Akeratos Billet: 162M core, 6.0B-parameter n-gram table
Akeratos Billet is a decoder-only transformer with a 162M-parameter core and a learned n-gram table of 6.0B parameters, trained from scratch with MLX on about 3.2B tokens of English web text (FineWeb-Edu) on one MacBook Pro with an M4 Max and 48 GB of unified memory. The whole table stayed in the Mac's unified memory while it trained. It is the proof of concept of Akeratos, which pretrains small language models on a Mac, and it is released as a research checkpoint.
Its twin, Akeratos Billet-Twin, is the same model trained on the same tokens with the table switched off. Comparing the two measures what the table adds.
What it is and is not
- It supports one narrow claim: a learned table of billions of parameters can be trained resident in one Mac's unified memory, beside a twin trained the same way without the table. Whether the table helped is the evaluation below.
- It is a small base model that continues text. It does not follow instructions, has had no safety training and is not a product.
- Only Akeratos's own code runs it. The files are in Akeratos's own format, so transformers, mlx-lm and GGUF tools cannot load them. There is no quantised version.
Run it
You need a Mac with Apple silicon and macOS 14 or later, uv 0.13.6 or newer (what you need), about 14.4 GB of free disk for the download, and unified memory for the 13.0 GiB that bake generate took at its peak on the M4 Max below. No Hugging Face account is needed.
git clone --branch v0.1.0 https://github.com/cogvera-labs/akeratos
cd akeratos
uv sync --frozen
uv run --frozen --no-sync hf download Cogvera-Labs/Akeratos-Billet --local-dir Akeratos-Billet
(cd Akeratos-Billet && shasum -a 256 -c SHA256SUMS)
uv run --frozen --no-sync bake generate Akeratos-Billet --prompt "The capital of France is"
shasum checks every file against SHA256SUMS (bake generate does not); each line should end in OK. bake generate loads the weights and the table, decodes greedily and prints the continuation. It stops after --max-tokens new tokens (default 256) or at the end-of-document token. --weights ema uses the moving-average weights, and --json also prints the token ids.
For this prompt Billet's continuation begins Paris. It is the largest city in France and the second largest in Europe., and then repeats itself.
Files
| File | What it holds |
|---|---|
dense.safetensors | the raw weights, in float32 |
ema.safetensors | their exponential moving average |
table/ | the table in 12 shards (bfloat16 rows, each with a float32 optimiser value and an int32 stamp), table.json, and reads.npy, how often each row was read |
tokenizer.json | SmolLM2's tokenizer |
logs/run.json | every setting of the training run |
logs/metrics.jsonl | the training log, one line per step |
LICENSE, NOTICE | the Apache-2.0 licence, and the notices for the training data and the tokenizer |
config.json | the step, the weight files and the run's configuration (model, table, optimiser, schedule and seeds), in Akeratos's own schema (metalforge.export/v1). It is not a transformers config; it is the file the Hub counts downloads by |
SHA256SUMS | the SHA-256 of every file above |
metalforge-as-trained-8fd42291.tar.gz | the code as trained (see Training); its SHA-256 is 4bec8a37eeff6b04e56f72a8049f9c701ef44354d0b33b1a470c599c4eb81d5e |
bake export copied the weights and the table byte for byte from the training checkpoint that was scored, and the logs from its run. The optimiser state of the dense weights is not included.
The model
- 18 layers of width 768. Attention has 6 query heads and 2 key-value heads of 128; the feed-forward block is 3,456 wide with squared ReLU. Input and output embeddings are tied, and the odd layers add value embeddings.
- Most layers attend to the last 512 tokens; layers 4, 9, 14 and 17 (counting from 0) attend to the whole context. Context: 2,048 tokens.
- Vocabulary: SmolLM2's 49,152 tokens. Id 0 separates documents. Ids 1-16 are reserved, and this base model never predicts them.
- The table has 7,812,500 rows of 768 numbers. At each position the model reads one hashed bigram row and one hashed trigram row, adds them, divides by √2 and adds the result to the residual stream before every block, each block with its own learned strength. How the n-gram memory works.
- Parameters: core 161,611,776 (the tied embedding, attention and feed-forward weights, reported as 162M); 274,918,908 dense parameters in all, counting the value embeddings, norms and gates; table 6,000,000,000.
Training
- 24,415 steps of 131,072 tokens (2 rows of 2,048 tokens, 32 micro-batches), about 3.2B tokens.
- Peak learning rate 1e-2, picked from 1e-3, 3e-3 and 1e-2 by a sweep of 50M tokens each on this model (lowest mean loss over the last tenth of the steps). The rate decays over the last 20% of the steps, from step 19,532.
config.jsonholds the full schedule and optimiser settings. - bfloat16 compute with float32 master weights.
- One MacBook Pro, M4 Max (40 GPU cores, 48 GB). MLX's peak memory reading: 24.1 GiB, the largest in the training log. Training time: 107.6 hours, the sum of the step times in
logs/metrics.jsonl. - Code:
metalforge-as-trained-8fd42291.tar.gz, in this repository, holds the package as trained, unedited, under the project's first name, MetalForge. Akeratos holds the same code, tidied. Master seed 0 (the default). - The snapshot's test: with the extracted package in a fresh environment built from Akeratos's lock file (MLX 0.32.4; training used 0.32.3), the first 20 steps of each run replay its released training log, with 20 of 20 batch hashes equal. The twin's losses match exactly; Billet's are within 6.68e-06 (a Billet replay is held to 5e-05). The snapshot cannot read the files in this repository: their format was built after training.
- Reproduce has the commands that rebuild the data and rerun Billet and its twin.
- Training logs, in this repository:
logs/run.jsonandlogs/metrics.jsonl.
Training data and licences
- FineWeb-Edu (HuggingFaceFW/fineweb-edu) at revision
87f09149ef4734204d70ed1d046ddc9ca3f2b8f9, the 14 Parquet files ofsample/10BT. Contains information from FineWeb-Edu, which is made available under the ODC Attribution License. FineWeb-Edu is derived from Common Crawl; its use is also subject to the Common Crawl Terms of Use. - How FineWeb-Edu's pages were chosen. Hugging Face selected them with HuggingFaceFW/fineweb-edu-classifier (Apache-2.0), a classifier trained on educational scores that Meta Llama 3 70B Instruct (Meta Llama 3 Community License) gave about 468,000 web pages; pages it rated below 3 of 5 were dropped. The training text contains none of those scores, and Akeratos's pipeline did not run or download any Llama model.
- Tokenizer: HuggingFaceTB/SmolLM2-135M at revision
93efa2f097d58c2a74874c7e644dbc9b0cee75a2(Apache-2.0). It was itself trained on a mix that is 70% FineWeb-Edu. - Held-out text. About one document in 1,024, chosen by a keyed hash of its text, was set aside before training and never trained on: 7,314 documents, 7,643,425 tokens. The training store holds 7,918,559,792 tokens.
Evaluation
Each number below is scored in float32 and read from results/billet/report.json, under the field named.
| Measure | Billet | Billet-Twin | In report.json |
|---|---|---|---|
| Held-out bits per byte, raw weights | 0.8866 | 0.9030 | primary |
| Held-out bits per byte, EMA weights | 0.8866 | 0.9031 | ema |
| Held-out bits per byte, raw weights, step 19,532 | 0.9580 | 0.9753 | pinned |
| HellaSwag, acc_norm (%) | 36.89 | 36.04 | zero_shot.tasks.hellaswag |
| ARC-Easy, acc (%) | 58.62 | 59.52 | zero_shot.tasks.arc_easy |
| PIQA, acc (%) | 65.31 | 65.97 | zero_shot.tasks.piqa |
| Winogrande, acc (%) | 52.09 | 51.85 | zero_shot.tasks.winogrande |
| LAMBADA, acc (%) | 30.66 | 30.66 | zero_shot.tasks.lambada_openai |
- Held-out: the 7,314 held-out documents above.
- Benchmarks: zero-shot, on the items left after removing those found in the training text: HellaSwag 9,864, ARC-Easy 2,337, PIQA 1,819, Winogrande 1,267 and LAMBADA 5,146. LAMBADA is OpenAI's version.
- Billet minus its twin, Δ: −0.0164 bits per byte (95% interval −0.0172 to −0.0157), computed as the analysis plan, posted before the twin finished, sets out. Its bar, δ, is 0.00432. Δ is below −δ, so by the plan's rule the table helps.
- With EMA weights the difference is −0.0165, also below −δ. The plan tests the five zero-shot tasks: HellaSwag shows a difference (+0.85 points, Holm-adjusted p = 0.016); for the other four no difference is claimed. Billet and its twin has every readout and what one seed cannot say.
- To check a held-out number on these files, build the data as Reproduce says, then pass the downloaded folder as
--ckptto its scoring command (4. Score). It checks every file againstSHA256SUMSfirst and stops on a missing or changed one.
Safety
- Billet is a base model and was not post-trained, so it has no harmful-answer or over-refusal rate.
- Hallucination rate: not measured. Billet continues text and is not set up to answer questions.
- Memorisation, how often it repeats training text word for word: not measured. On 7,314 training documents, Billet minus its twin is −0.0456 bits per byte, against −0.0164 held out (
memorisationin the report; described, not tested). Nothing fixed this readout's code in advance: read it with less weight than the rest.
Limitations
- Each arm was trained once, with seed 0, so this pair does not measure run-to-run variation; the analysis plan says how the comparison allows for it.
- A small model trained on 3.2B tokens: expect fluent text that is often wrong.
- It learned from web text, so it can repeat the errors, biases and personal details in that text.
- English only.
- Greedy decoding only, with no key-value cache: no sampling, and long outputs are slow.
- The table alone takes 11.2 GiB of memory. Billet has been run only on the M4 Max above.
The step-19532 branch
The step-19532 branch holds the checkpoint at step 19,532, the last one before the learning-rate decay, in the same layout as main. It is the evaluation's secondary point. It holds no dense optimiser state, so a training run cannot resume from it exactly. Its logs/ are the whole run's, the same files as on main.
uv run --frozen --no-sync hf download Cogvera-Labs/Akeratos-Billet --revision step-19532 --local-dir Akeratos-Billet-19532
Licence
Apache-2.0, ungated. NOTICE carries the notices for FineWeb-Edu and the tokenizer.
Citation
Cite the software, Akeratos, by its Zenodo DOI. Akeratos's CITATION.cff gives the entry for the latest version.
DOI: 10.5281/zenodo.24211849 (v0.1.0).
@software{akeratos2026,
title = {Akeratos: an open lab for training language models on Apple silicon},
author = {Nicklin, Thomas},
year = {2026},
version = {0.1.0},
publisher = {Zenodo},
doi = {10.5281/zenodo.24211849},
url = {https://github.com/cogvera-labs/akeratos}
}
Questions and problems
Ask in GitHub Discussions and report bugs in GitHub Issues. A number you cannot reproduce is a finding: open an issue. Report a safety problem, such as the model repeating personal or private text, privately through the repository's Security tab, not in a public issue.