Skip to main content

Akeratos

Pretrain a small language model from scratch on your Mac, with MLX. On one M4 Max a first model trains in 41 minutes and 6.7 GiB of memory. Billet, a 162M-parameter model with a table of 6.0 billion numbers, trained for four and a half days on that Mac.

Cogvera Labs built Akeratos to test one idea: a very large learned n-gram table, held in the Mac's unified memory beside a small transformer. A Mac has modest compute and plenty of memory, and the table costs memory more than compute. Against the same model without it, the table lowers held-out bits per byte from 0.9030 to 0.8866, one seed each, at nearly twice the training memory: the result.

git clone https://github.com/cogvera-labs/akeratos && cd akeratos
uv sync
uv run bake bench

You need an Apple silicon Mac on macOS 14 or later, and uv 0.13.6 or newer. bake bench trains a 10M model twice on synthetic tokens, table off and table on, and prints what the table costs per step on your Mac. On the same M4 Max (48 GB) it took 74 seconds and peaked at 6.2 GiB of memory. Smaller Macs are untested: send your Mac's row.

What you can do

  • Train a first model in 41 minutes. After a 285 MB download, bake train starter pretrains a 10M model with a table of 1.0 billion numbers on 75M tokens, through the same trainer as Billet: a first run.
  • Enter the five-minute speedrun. bake speedrun trains the model in speedrun/train.py for 300 seconds of step time and scores it on held-out text. Change the file, beat the record, send your runs by pull request: the Mac speedrun.
  • Rerun Billet in four and a half days. bake train billet trains the 162M model in 24.1 GiB of memory, and bake evaluate scores it. Its twin takes as long again: Reproduce.
  • Use Billet's weights with no training. bake generate continues a prompt with the released weights: a 14.4 GB download, 13.0 GiB of memory. The capital of France is gives, greedily, Paris. It is the largest city in France and the second largest in Europe. The 41-minute starter gives the capital of the world. Billet is a base model: fluent, and often wrong.
  • Score the released weights in 36 minutes. With no training and no data build, bake evaluate gives both published scores; the twin's takes 18 minutes: Score.

Akeratos's models run in its own code, not in mlx-lm or llama.cpp. To fine-tune or chat with an existing model, start with the options on a Mac.

The result

Billet is a 162M-parameter transformer (275M with its value embeddings) with a table of 6.0 billion trained numbers: one vector for each hashed bigram and trigram, added to the residual stream before every block. Its twin is the same model without the table, trained on the same 3.2 billion tokens in the same order.

On 7,314 held-out documents of FineWeb-Edu Bits per byte, lower is better
Billet 0.8866
Its twin 0.9030
Billet minus its twin −0.0164 bits per byte (95% interval −0.0172 to −0.0157)

By the rule fixed before the twin finished, the table helps. Each model was trained once, on one MacBook Pro (M4 Max, 48 GB): the interval resamples held-out documents, not seeds. The two are not matched for parameters or memory: Billet's run peaked at 24.1 GiB against its twin's 12.4, and a training step takes 5.2% longer with the table on. On the 2,456 held-out documents that share no 13-gram with the training data, the difference is −0.0079 bits per byte.

Training loss of Billet and its twin, step by step

The curves nearly coincide at this scale: Billet runs 0.04 to 0.06 nats below its twin. Both bend at step 19,532, where the learning rate starts to fall.

The result page has every readout and what one seed cannot say. The analysis plan is the rule as posted. results/billet/ holds the report this number is read from. The weights are on Hugging Face: Billet and its twin.

Hashed n-gram tables are not new. Engram and the Over-Tokenized Transformer hash n-grams into embedding tables, and DeepSeek-V4.1-Flash ships 196B parameters of Engram memory. The modded-nanogpt speedrun added a hashed bigram table in its record 62. The n-gram memory names the rest of the work this builds on.

Read the code

Billet was trained with the banded attention code, and bake train still uses it. bake bench and the speedrun use the fused Metal kernels where they fit (the code map).

Open problems

OPEN_PROBLEMS.md lists what Cogvera Labs cannot answer alone. Each question names its baseline and what counts as an answer; a negative result is an answer. CONTRIBUTING.md says how to send a result, a claim or a fix.

How it is made

AI coding agents (Claude) write most of the code; Cogvera Labs reviews and merges. Development happens in a private repository where the agents' checks run; this one is exported from it, one commit per change.

Thomas Nicklin (@BhodiSea) maintains Akeratos at Cogvera Labs. The licence is Apache-2.0.

Metadata

Release files for akeratos 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for akeratos 0.1.1
File Size Uploaded Provenance Actions
akeratos-0.1.1.tar.gz 163.6 kB With provenance Details for akeratos-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for akeratos 0.1.1
File Interpreter ABI Platform Actions
akeratos-0.1.1-py3-none-any.whl Python 3 none any Details for akeratos-0.1.1-py3-none-any.whl

Total release size: 347.4 kB

Release files / akeratos-0.1.1.tar.gz

Download URL akeratos-0.1.1.tar.gz
Size 163.6 kB
Tags Source
SHA-256 checksum
How to use checksums
2194b0a4e27d137b84e213cf4b1683e3726ef692f84be9ef58f48fbb22cb4dd8
BLAKE2b-256 checksum
How to use checksums
88aaea8555c7e1ab5ab640a4126fa7b56c2e222f33bddac4dd0846cb96208806
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Release files / akeratos-0.1.1-py3-none-any.whl

Download URL akeratos-0.1.1-py3-none-any.whl
Size 183.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7b9e18794e78c4f9762eba57786c70c6474989cc02a8d4b32596bab6b20c46a6
BLAKE2b-256 checksum
How to use checksums
9d97f0fee592f6ba3e50c6c42d4bd46ff5e6547bda3c48ef08de996148eb4008
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Security for akeratos 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for akeratos-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page