Appendix A: Capstones
Every earlier chapter of this book builds one piece of the system and tests it on its own. The capstones are where the pieces have to work together, for hours, on one goal. The first capstone trains a roughly 10M-parameter Llama-family model on TinyStories end to end: your corpus pipeline cleans the data as a durable workflow, your tokenizer is trained and ablated (BPE against Unigram), your trainer runs with mixed precision and resumes bitwise, the model is evaluated against the model zoo, released through your release workflow with a model card and data ledger, and served by your engine behind your gateway. The second capstone, which is optional, post-trains that model into an instruction follower.
Concepts from other sections (15)
This section uses these ideas. Each has a short definition and a link to the section that explains it in full. Tap a dotted term in the text to preview it.
- Model zoo: the table that scores every model family the system trained on the same held-out text. Read more: A.1 Capstone: TinyStories, owned end to end
- Model card: the model’s interface documentation: details, intended and out-of-scope use, evaluation with uncertainty, limitations, and data. Read more: 35.1 Datasheet and model card
- Confidence interval: a procedure that, over repeated samples, produces intervals covering the fixed true parameter at the stated rate. Read more: 13.11 Probability problem set, part c: limit theorems and confidence intervals in Mathematics
- Compute budget: the training FLOP available, , which fixes the trade between parameters and tokens . Read more: A.1 Capstone: TinyStories, owned end to end
- Burn check: a single query of the canary’s SLO burn rate after the bake, compared against a threshold. Read more: 1.3 Design review: the whole system in Systems Engineering
- Multi-head latent attention (MLA): attention whose keys and values are rebuilt per head from a cached low-rank latent of each token. Read more: 13.6 Multi-Head Latent Attention and Weight Absorption
- Grouped-query attention (GQA): query heads share key/value heads, each serving a contiguous group of query heads. Read more: 13.5 Grouped-Query Attention with a Cache Hook, Windows, and Sinks
- Mixture of experts (MoE): a layer of many expert MLPs of which a router picks per token. Read more: 13.8 Mixture of Experts
- Active parameters: parameters participating in the computation for a particular token. Read more: 20.9 Architecture choices and performance limits
- Architecture decision record (ADR): a short, numbered, append-only file recording one hard-to-reverse decision with its context, consequences, and rejected alternatives. Read more: 12.1 Architecture decision records in Software Engineering
- Scaling fit: the least-squares line through measured sizes. Read more: A.1 Capstone: TinyStories, owned end to end
- DPO: minimizing over preference pairs, equivalent to fitting the KL-regularized reward objective. Read more: 18.2 Direct preference optimization and IPO
- GRPO: a PPO-style RL method that replaces the critic with the group-normalized reward of several samples of the same prompt. Read more: 19.7 The training step and validation
- paired bootstrap: a bootstrap that resamples whole pairs, so the two arms are never drawn independently. Read more: 29.4 Paired A/B experiments
- Permutation test: a test that compares the observed statistic difference with its distribution over random relabelings of the pooled samples. Read more: 23.12 Run comparison and the regression gate
Both capstones share one idea: the report is the evidence. Nothing is taken on trust. Parameter counts follow from configs, verdicts follow from confidence intervals, decisions are recorded with the measurements that justify them, and a model ships only when the system’s own gates let it through.
Learning objectives
- Run the whole system on one training goal and size that run from a compute budget.
- Design ablations as paired experiments at an equal budget and read their verdicts from bootstrap confidence intervals.
- Release a model through a gated workflow with a model card, data ledger, and canary burn check.
- Evaluate a post-trained model against its base on a fixed held-out set, with claims that match the evidence.
Three ideas that run through both
Section titled “Three ideas that run through both”The first idea is one config, two sizes. The full run is about 10.4M parameters and 100M tokens, an estimated 4 to 12 hours on an M-series laptop. A short config of about 2.5M parameters trains in under an hour and is accepted at a looser threshold, and a smoke tier proves the pipeline in minutes.
The second is that ablations are experiments. The tokenizer (BPE against Unigram), the attention (MLA against GQA at equal KV bytes), and the MLP (MoE against dense at equal active parameters) are each compared on paired held-out documents, reported with a paired confidence interval, and recorded in an ADR.
The third is that release is gated. The model card, the data ledger, and the eval suite must pass before the engine serves the model.
Before you begin
Section titled “Before you begin”The capstones assume every chapter before them. The first exercises the corpus pipeline from Data Engineering, the tokenizers, the modern decoder block, the optimizers from Mathematics, mixed precision, accumulation, and checkpointing, the durable workflows of AI Engineering (in particular deterministic replay, subprocess activities, TrainRun and EvalSuite, and ModelRelease), the inference stack, and the serving platform. The second needs the post-training part. On the course path, the first capstone closes the capstone training stage, and the optional second belongs to the agents stage.
In this chapter
Section titled “In this chapter”- Capstone: TinyStories, owned end to end. Runs the whole system on one goal: sizing the run, three paired ablations, a scaling fit, the zoo table, ADRs, and a gated release, with every number in the reference report recomputed by hand.
- Capstone 2: post-trained TinyStories model. Optional. Post-trains the released model with SFT and then DPO or GRPO, and shows how a paired bootstrap and permutation test decide whether the held-out gain is real.
Further reading
Section titled “Further reading”- Eldan and Li, TinyStories.
- Hoffmann et al., Training Compute-Optimal Large Language Models, the source of the scaling-law fit.