A GPT Grown From One Book

Foundations · 11 / 14·Joshua Uwaifo · UEFO · September 2026

A GPT-2, from scratch, on the Bible alone

Tokenizer, attention, MLPs, training loop — written by hand, trained on nothing but the 66 books, and running in this tab. Type a prompt.

the training run, replayed: loss on 60 books read and 6 never read
the architecture, one token at a time
the trained model, running in this tab — type a prompt
the last step’s top guesses
status

loading weights…

–

What was built

A GPT-2-style decoder: byte-level BPE tokens (4,096, learned from the text) + learned positions → → LayerNorm → logits tied to the token embedding. Every piece — LayerNorm, causal multi-head attention, the GELU MLP, the residual stream, AdamW with warm-up and cosine decay — is written out in biblegpt/model.py and biblegpt/train.py; PyTorch supplies tensors and autograd, nothing else. The corpus is the 66-book World English Bible and nothing else.

What the numbers say

Trained on a two-core CPU in minutes. On the six books it never read it reaches nats per token = bits per word, against for a bigram model of the same books — a small model, honestly measured; the widening gap between the two curves is memorisation setting in. GPT-2 small on a rented GPU is the next page.

Nine seconds elsewhere

The foundations in learning order, then the series they lead to. Each lands in about nine seconds.