Research · KW5 · Apache 2.0
KW5. Kiswahili, measured in the open.
- 173.6M
- Stored parameters
- 1.97B
- Pretraining tokens
- 32,000
- Vocabulary
- 2,048
- Context window
What KW5 is.
KW5 learns directly from Kiswahili text. The 109M and 149M generations each have a base checkpoint and instruction-tuned variants, released under Apache 2.0.
The release names identify the generations. The 149M generation stores 173.6M parameters: a 123.9M transformer body, separate 24.6M input and output embeddings, and the Canon layers. Use the stored count when comparing memory and model size.
Built for a closer look.
The training stack supports document-boundary attention and label masking, checkpoint resume, and a cooldown transition within the run. A frozen Kiswahili corpus retains its provenance across eight language registers. These choices make the training process inspectable alongside the resulting weights.
The v2 history also documents an embedding-tie error at load time. The base weights were recovered and verified on reload. The subsequent instruction diagnosis showed why falling training loss alone could miss repetitive generation: the samples had already entered a loop while the loss continued to improve.
Small models make these failures easier to reproduce and investigate. Compression, extraction, instruction following and factual recall need separate measurements; success in one does not establish success in the others.
Inside the 149M generation.
A decoder trained for Kiswahili, with a 32,000-token SentencePiece vocabulary, byte fallback and NFC text normalization. The 149M generation has a 2,048-token context window; the 109M generation was trained at 1,024.
- Depth and width
- 20 layers · 768 hidden dimensions · 2,048 feed-forward dimensions
- Attention
- 12 query heads · 3 key/value heads · grouped-query attention
- Normalization
- Pre-norm RMSNorm, with normalization on queries and keys
- Activation and position
- SwiGLU · rotary position encoding
- Canon
- Causal depthwise convolutions at four points in each block
- Released precision
- FP32 weights; training used bf16 autocast on TPU v5e-8
The model card includes the inference implementation and prompt conventions. KW5 v2 is a custom architecture; loading it as an unrelated transformer can change behaviour or fail outright.
Open releases.
- 01149M BasePretrained on 1.97B tokens. A foundation for language research and further training.
- 02149M Instruct r2The revised instruction release. More abstention, with documented limits in follow-up turns and factual reliability.
- 03149M InstructThe first v2 fine-tune. Retained for comparison; repetition behaviour is documented in the audit.
- 04109M BaseThe first-generation base model, pretrained on 1.41B tokens.
- 05109M InstructThe first-generation instruction model and a baseline for later evaluations.
What we measured.
The 28 October comparison put the third generation, KW5-230M, beside the second and size-matched models: language compression and likelihood-based classification. Bits per byte supports comparison across tokenizers; perplexity does not. These results do not measure the quality of a conversation; the frozen suites on the models page do.
Scores describe that run, rather than a general ranking. The manifest pins model revisions and the result files include confidence intervals.
- 0.891
- Bits per byte
- KW5-230M base on 120 MasakhaNEWS test documents, the lowest in the run; KW5-149M scored 0.926. News is in the training mix, so read it as in-domain.
- 35.6%
- Belebele
- KW5-230M-instruct, reading comprehension. Every model clears chance; its interval overlaps the next model's, so it leads without being separated.
- 36.5%
- AfriXNLI
- KW5-230M base, against a 33.3% chance rate (p = 0.055). No model in the run clears chance on inference.
- KW5-230M230M · base0.891
Goldfish swa 100MB125M · base0.894- KW5-230M-instruct230M · instruct0.910
- KW5-149M174M · base0.926
- KW5-149M-instruct-r2174M · instruct0.933
XGLM-564M565M · base1.122
swahili-gemma-1b1000M · instruct1.334
BLOOM-560m559M · base1.699
GPT-2 124M124M · base2.126
Qwen2.5-0.5B494M · base2.393
Qwen2.5-0.5B-Instruct494M · instruct2.407
Qwen3-0.6B596M · instruct2.556
Run of 2026-10-28, seed 20260914, float32 on one Tesla T4: 120 MasakhaNEWS test documents, 320,701bytes. News is in KW5's pretraining mix and overlap was not checked, so the KW5 rows are in-domain. Bits per byte compares models across tokenizers; perplexity does not.
The September audit.
The later audit examined generated behaviour, prompt formatting and the evaluation itself. It found positional bias in grounded questions and training-template overlap in parts of the behavioural test. An instruction checkpoint scored on unformatted completion prompts is not a test of instruction following.
On a small out-of-template set, r2 produced 11 genuine refusals out of 20 unanswerable questions after manual review. Follow-up questions still triggered excessive refusal. All evaluated models failed the 30-item arithmetic probe. These are small diagnostic sets, with their method and outputs retained.
Use with the limits in view.
These are research models. Fluent text can contain invented facts, repetitive output or an inappropriate refusal. They are not a reliable basis for consequential decisions.
For the 149M instruction releases, use the exact chat format in the model card: an explicit beginning-of-sequence token and the correct end-of-turn stop token. The base and instruction models use different prompt conventions.
V3 is in progress. The published generations remain available as baselines; this page does not announce a new checkpoint.
Reproduce the comparison.
230M comparison · 28 October
Seed 20260914, Tesla T4, float32. The same 900 Belebele, 600 AfriXNLI and 476 MasakhaNEWS items and the same 320,701 bytes of news as September, with the instruct models as a second group. Gemma 3 270M and the two Gemma 3 instruct models did not load (a licence not accepted on the running account); their failures remain in the files.
- KW5-230M-instruct230M · instruct35.6%
- KW5-230M230M · base33.0%
Qwen2.5-0.5B494M · base31.3%
Qwen2.5-0.5B-Instruct494M · instruct31.3%
swahili-gemma-1b1000M · instruct30.3%
GPT-2 124M124M · base30.2%
Qwen3-0.6B596M · instruct30.0%- KW5-149M174M · base29.3%
XGLM-564M565M · base29.1%- KW5-149M-instruct-r2174M · instruct29.0%
BLOOM-560m559M · base28.3%
Goldfish swa 100MB125M · base28.0%
Raw suffix likelihood, with each model's 95% interval as a whisker. Every model clears chance (one-sided, p < 0.05).
- KW5-230M230M · base36.5%
Goldfish swa 100MB125M · base35.5%- KW5-230M-instruct230M · instruct35.5%
XGLM-564M565M · base35.3%
GPT-2 124M124M · base34.8%- KW5-149M-instruct-r2174M · instruct34.3%
Qwen2.5-0.5B494M · base34.2%- KW5-149M174M · base33.7%
Qwen2.5-0.5B-Instruct494M · instruct33.5%
swahili-gemma-1b1000M · instruct32.2%
Qwen3-0.6B596M · instruct32.2%
BLOOM-560m559M · base31.2%
Raw suffix likelihood, with each model's 95% interval as a whisker. No model clears chance; every row is drawn faint.
- KW5-230M230M · base74.2%
- KW5-230M-instruct230M · instruct73.1%
- KW5-149M174M · base72.9%
XGLM-564M565M · base72.5%- KW5-149M-instruct-r2174M · instruct72.5%
Goldfish swa 100MB125M · base61.8%
swahili-gemma-1b1000M · instruct53.1%
Qwen2.5-0.5B-Instruct494M · instruct30.7%
Qwen2.5-0.5B494M · base28.8%
GPT-2 124M124M · base28.4%
Qwen3-0.6B596M · instruct26.3%
BLOOM-560m559M · base17.6%
Raw suffix likelihood, with each model's 95% interval as a whisker. 11 of 12 models clear chance; the others are drawn faint. News is in KW5's training domain.
Lower and further left is better: KW5-230M sits beside a 125M Kiswahili-only model, and below every multilingual model two to four times its size. In-domain for KW5.
Chance is 25%. The intervals (in the Belebele chart) overlap across most of the field: KW5-230M-instruct leads without being separated from the next model.
Run artifacts
149M comparison · 14 September
Seed 20260914, Tesla T4, float16. The run scores 900 Belebele items, 600 AfriXNLI items and 476 MasakhaNEWS items. Compression uses 320,701 bytes across 120 MasakhaNEWS test documents; news is in the pretraining mix and overlap was not checked, so the figure is in-domain. Two checkpoints could not load; their failures remain in the table.
| Model | Bits / byte ↓ | Belebele | AfriXNLI | MasakhaNEWS | Run status |
|---|---|---|---|---|---|
| KW5-149M | 0.9262 | 29.3% | 33.7% | 73.1% | Completed |
| KW5-149M-instruct | 0.9329 | 29.1% | 34.8% | 72.5% | Completed |
| XGLM-564M | 1.1216 | 28.8% | 35.3% | 72.5% | Completed |
| BLOOM-560M | 1.6994 | 26.2% | 32.2% | 18.3% | Completed |
| GPT-2 124M | 2.1256 | 26.4% | 33.3% | 24.4% | Completed |
| Pythia-410M | 2.2855 | 27.2% | 33.7% | 26.1% | Completed |
| Qwen2.5-0.5B | 2.3930 | 27.0% | 33.3% | 25.0% | Completed |
| Goldfish swa 100MB | Unmeasured | Unmeasured | Unmeasured | Unmeasured | Failed to load |
| Gemma 3 270M | Unmeasured | Unmeasured | Unmeasured | Unmeasured | Failed to load |
- KW5-149M173.6M0.926
- KW5-149M-instruct173.6M0.933
XGLM-564M564.5M1.122
BLOOM-560M559.2M1.699
GPT-2 124M124.4M2.126
Pythia-410M405.3M2.285
Qwen2.5-0.5B494M2.393
Run of 2026-09-14, seed 20260914, float16. In-domain for KW5. The October run, with KW5-230M, is above.
- KW5-149M29.3%
- KW5-149M-instruct29.1%
XGLM-564M28.8%
Pythia-410M27.2%
Qwen2.5-0.5B27.0%
GPT-2 124M26.4%
BLOOM-560M26.2%
XGLM-564M35.3%- KW5-149M-instruct34.8%
- KW5-149M33.7%
Pythia-410M33.7%
GPT-2 124M33.3%
Qwen2.5-0.5B33.3%
BLOOM-560M32.2%
- KW5-149M73.1%
- KW5-149M-instruct72.5%
XGLM-564M72.5%
Pythia-410M26.1%
Qwen2.5-0.5B25.0%
GPT-2 124M24.4%
BLOOM-560M18.3%
Rows that do not clear chance (one-sided, p < 0.05) are drawn faint.
109M comparison · 4 September
The earlier run uses seed 20260904 and its own pinned model revisions. Classification uses PMI-normalized suffix likelihood. Entries flagged for single-label collapse remain unscored. This is a separate experiment, so its values should not be treated as a matched comparison with the later 149M run.
| Model | Bits / byte ↓ | Belebele | AfriXNLI | MasakhaNEWS | Run status |
|---|---|---|---|---|---|
| KW5-Lite (base) | 1.2009 | 26.1% | 32.5% | 23.1% | Completed |
| KW5-Lite (instruct) | 1.3016 | 25.0% | 33.5% | 29.0% | Completed |
| swa-gpt2-100mb | 1.2851 | 26.2% | 36.2% | 28.1% | Completed |
| XGLM-564M | 1.3360 | 29.2% | 34.3% | 63.4% | Completed |
| BLOOM-560m | 2.1054 | 28.1% | 33.8% | 41.2% | Completed |
| Qwen2.5-0.5B | 2.9629 | 25.2% | 32.7% | 37.4% | Completed |
| Pythia-410m | 2.7877 | 28.1% | Unscored | 30.3% | Completed |
| GPT-2-124m | 3.4553 | 27.7% | Unscored | 21.6% | Completed |
| Gemma-3-270m | Unmeasured | Unscored | Unscored | Unscored | Failed to load |
- KW5-Lite (base)109.5M1.201
swa-gpt2-100mb124.8M1.285- KW5-Lite (instruct)109.5M1.302
XGLM-564M564.5M1.336
BLOOM-560m559.2M2.105
Pythia-410m405.3M2.788
Qwen2.5-0.5B494M2.963
GPT-2-124m124.4M3.455
XGLM-564M29.2%
BLOOM-560m28.1%
Pythia-410m28.1%
GPT-2-124m27.7%
swa-gpt2-100mb26.2%- KW5-Lite (base)26.1%
Qwen2.5-0.5B25.2%- KW5-Lite (instruct)25.0%
swa-gpt2-100mb36.2%
XGLM-564M34.3%
BLOOM-560m33.8%- KW5-Lite (instruct)33.5%
Qwen2.5-0.5B32.7%- KW5-Lite (base)32.5%
XGLM-564M63.4%
BLOOM-560m41.2%
Qwen2.5-0.5B37.4%
Pythia-410m30.3%- KW5-Lite (instruct)29.0%
swa-gpt2-100mb28.1%- KW5-Lite (base)23.1%
GPT-2-124m21.6%
PMI-normalised suffix likelihood. Entries the run flagged for single-label collapse stay unscored and are left out.
Run artifacts
- Every metric, every model
- 95% bootstrap intervals per task
- Paired deltas against each baseline
- Single-label prediction share per task
- Decoding sweep: temperature and repetition penalty
- Load method and revision per model
- Per-model rollup, raw and PMI
- Every generated sample, three seeds
- Every scored item, all three tasks (2.5 MB)
- Seed, environment, and pinned revisions
Run it yourself.
The manifest pins every model revision, the seed and the environment.




