Architecture
NawalTransformer is a 100% sovereign language model built from scratch. Two configurations exist: a 254.8M-parameter model that runs on-device, and a 9.11B-parameter flagship trained on an HPC cluster and distilled down into it. A genome evolution system encodes and optimizes architectures as compact DNA sequences, enabling evolutionary search across neural topologies.
Architecture Details
NawalTransformer
Pre-norm transformer blocks with LayerNorm → MultiHeadAttention → residual → LayerNorm → FFN → residual. GELU activation, weight tying between embeddings and LM head, and KV caching for generation.
Two Model Sizes
nawal_small (254.8M params at the vocabulary ceiling, 768 hidden, 12 layers, 12 heads) runs on-device. nawal_flagship (9.11B params, 6144 hidden, 24 layers, 24 heads) is the HPC-trained model, distilled down into nawal_small for Maya Wallet inference.
Genome Evolution System
A genome serialises a whole neural architecture to a few kilobytes of JSON instead of hundreds of megabytes of weights. 28 LayerTypes including MoE, SSM, Flash Attention and RoPE, with mutation, crossover and selection operators.
GenomeToNawalAdapter
Pipeline from Genome DNA → GenomeEncoder → NawalConfig → NawalTransformer. ModelBuilder covers all 28 layer types with FLOPs and memory estimation.
Fitness Evaluation
Three-factor scoring: quality (40%), timeliness (30%), honesty (30%). PopulationManager tracks genome populations across evolutionary generations.
Multilingual Embeddings
NawalEmbeddings with token + positional encoding and Xavier/Glorot initialization. The sovereign tokenizer is built to a 100,000-token vocabulary across 5 Belizean languages: English, Spanish, Kriol, Garifuna and Mopan Maya. The trained artifact currently in use is 12,137 tokens.