Part VI — Synthesis
The whole budget — bytes → served assistant
Nineteen lessons each repaired the wall the one before it hit. You built a tokenizer, a Transformer, a modern recipe, an optimizer, a memory ledger, a kernel stack, a parallelism mesh, a way to run the job for weeks, a scaling law, a data pipeline, an eval harness, a long-context extension, an alignment pipeline, and an inference server. Every one of them was right in isolation — and that is the trap. The point of the course is that they are not nineteen choices; they are one decision chain, and each link is forced by the budget that flows through the previous one. This lesson walks a single concrete budget end to end, from raw bytes to a served assistant, and shows every earlier decision as the consequence it always was.
New idea: walk one concrete N-GPU, T-day budget end to end and show every earlier decision as a forced consequence of the one before it; the meta-lesson is that the frontier is a sequence of efficiency choices, and "from scratch" means you can now reason about each link from the budget alone.
Forces next: nothing inside this track — the chain is complete. What it forces is outward: the parts this course deliberately did not cover (multimodality, agents, deeper RL, deeper serving, compression) and the parts nobody has solved (data, evaluation, alignment).
lesson-flow, each link tagged with the lesson that owns it and shown as forced by the link above. (2) Restate the three motifs that recurred through all nineteen lessons — the 6ND budget, memory-bound vs compute-bound, params vs active-FLOPs. (3) Map what this course did not cover and point to where in the library it lives. (4) Be honest about the frontiers nobody has closed. Then drive the capstone widget: one GPU-hour budget flowing left→right through scaling, data, training, alignment, and serving, with the final readout being the biggest sensible model you can train and the rate you can serve it at.1 · The chain, start to finish
Begin with the only thing you are actually handed: a cluster and a calendar. Say 128 H100s for 5 days. At ≈990 bf16 TFLOP/s peak per GPU and a realistic ≈45% MFU (lesson 06, 05), that is a budget of
That single number C is the root of the tree. Everything below is the answer to "how do I spend C to buy the most capable served model?" Read the chain top to bottom; each link names the lesson that owns it, and each is forced by the one above.
Read it once more as a single sentence and the whole course collapses into one breath: a fixed compute budget picks how big a model and how many tokens; that demands a quality data pipeline; the tokens feed a Transformer built on the modern recipe; it is fit onto the hardware by a parallelism mesh and stepped by AdamW + FlashAttention, optionally sparsified with MoE; it is driven through a weeks-long run without losing the budget to a crash, measured, stretched to a long context, taught to be an assistant by SFT, sharpened by preference optimization, and finally served cheaply. Not one link is free. Pull on any one and the others move — train a bigger model and serving cost rises, so you over-train a smaller one; choose MoE and memory and comm blow up even though FLOPs don't; loosen the data filter and you need more tokens to hit the same loss. The chain is the model.
2 · The three motifs, restated
Three quantities recurred in every part of the course. They are the load-bearing intuitions; if you keep only three things, keep these.
3 · What this course did not cover — and where it lives
This was "language modeling from scratch," and it stopped exactly at the edges of that phrase. Four large neighbors were deliberately left out, each a track of its own. Cross-link them, do not re-derive them — that was the rule the whole way through.
4 · The honest frontiers
The chain above is a solved engineering problem — given a budget, a competent team can execute it. What is not solved are the three things that actually separate frontier models, and a from-scratch understanding means knowing exactly where the certainty ends.
- Data is the moat. Two labs with the same architecture, the same budget, and the same parallelism produce very different models, and the difference is overwhelmingly the data — its mix, its quality filters, its dedup, its late-stage annealing (13). Yet the best recipes are unpublished, the gains are hard to attribute, and "what makes a token good" has no theory. The most consequential lesson in the course (13) is also the least scientific.
- Evaluation is unsolved. You cannot improve what you cannot measure, and we cannot reliably measure capability (14). Benchmarks contaminate, saturate, and are gamed; the moment a benchmark becomes a target it dies (Goodhart). LLM-as-judge inherits the judge's flaws. There is no trusted, contamination-proof, general measure of "how good is this model," which means every reported number — including your own — deserves suspicion.
- Alignment is open. RLHF/DPO/GRPO optimize a proxy for what we want under a KL leash (17); they do not give us what we want, and the gap (reward hacking, sycophancy, the proxy diverging from human intent as capability rises) is an active, unresolved research problem. We can make a model an assistant; we cannot yet guarantee it is the assistant we meant.
That is the honest end state of "from scratch": the build is a chain you can now reason about link by link, and the open problems are no longer mysterious — they are located. You know which lesson owns each one, and that is the whole point of having built it yourself.
5 · The capstone: spend a budget end to end
The widget below is the entire course as one dashboard. A compute budget (GPU-count × days) enters on the left and flows through five stages, each a knob you have now earned: scaling (Chinchilla split, biased by how much you'll serve), data (do you have enough quality tokens for D*?), train (does the state fit on the mesh, and does it finish in budget?), align (a small post-training tax), and serve (decode throughput). It reuses the exact formulas from the lessons: C=6ND (05/12), the ≈20 tok/param optimum (12), ≈16 bytes/param of training state (05), and the weight-bandwidth-bound decode estimate (18). The final readout is the payoff of the whole course: the biggest sensible model this budget buys, and the rate you can serve it at. Push the serving slider up and watch the optimal model shrink — over-training is the budget defending itself against the 2N-per-token tax.
Failure modes & checklist
Failure modes
- Optimizing stages in isolation. Tuning the tokenizer, then the optimizer, then the data as separate projects, missing that each pins the next. Signal: a "great" data pipeline that produces fewer tokens than D* needs, or a model sized with no thought for serving cost.
- Compute-optimal when you'll serve at scale. Training the Chinchilla-optimal giant, then paying its 2N/token forever in production. Signal: training was efficient but the inference bill dwarfs it within weeks.
- Trusting a benchmark number. Reporting (or believing) a score without checking contamination, prompt format, and harness. Signal: a leap on a public benchmark that doesn't transfer to held-out or real use.
- Treating alignment as solved. Cranking the reward and assuming "more reward = better assistant." Signal: high reward-model scores with sycophantic, hacked, or degenerate outputs (β too small, lesson 17).
Checklist
- Start from C. Write the budget in FLOPs first; derive every downstream knob from it, never the reverse.
- Price serving before sizing. Estimate lifetime inference tokens and bend the N/D split toward over-training accordingly.
- Confirm the tokens exist. Check that the data pipeline's yield ≥ D* before committing the run.
- Check the fit on paper. 16 bytes/param ÷ shard degree vs 80 GB, plus activations — before requesting the cluster.
- Locate every open problem. Know which lesson owns data, eval, and alignment, and stay suspicious of all three.
Checkpoint
Where this points next
There is no next lesson — this is the end of the chain, and the wall it leaves you at is the edge of the course itself. You can now reason about any single decision in a modern LLM from the budget down, which is exactly what "from scratch" was supposed to buy. The walls beyond this one are other people's tracks: the model that sees and hears (generative_continuous), the model that acts (agentic_systems), the model that reasons via deep RL (reinforcement_learning), and the engines that serve it at scale (vLLM / SGLang). Or go back to lesson 00 and re-read the budget thesis — it should now read like the table of contents it always was.
Interview prompts
- You're handed 1,024 H100s for 30 days. Walk the chain from that to a served assistant. (§1 — budget C≈6ND in FLOPs → Chinchilla split for N,D bent toward over-training by serving cost → quality data pipeline for D* → BPE → Transformer + modern recipe → FSDP/TP/PP fit + AdamW/bf16/FlashAttention → optional MoE → eval → SFT → preference optimization → paged-KV/GQA/spec-decode/quant serving.)
- Why does the optimal model get smaller as you plan to serve it more? (§1, 12, 18 — Chinchilla minimizes loss per training FLOP; serving adds 2N per token forever, so total lifetime FLOPs = 6ND + 2N·D_inf is minimized by a smaller N trained on more D — over-training.)
- State the three recurring motifs and one place each shows up. (§2 — 6ND budget (split by scaling laws); memory-bound vs compute-bound (FlashAttention, decode); params vs active-FLOPs (MoE decoupling, served-token cost).)
- MoE grows total params 8× at the same compute budget — why don't training FLOPs grow? (§2, 10 — C≈6ND counts FLOPs over active params; top-k routing keeps active params (hence FLOPs/token) ≈flat while total params grow E×; the cost moves to memory and all-to-all comm, not FLOPs.)
- Your data pipeline yields fewer tokens than D* — what are your options? (§3 widget, 13 — loosen filters / add sources to raise yield, repeat data up to ~4 epochs (data-constrained scaling), or shrink N (raise tokens/param less, smaller D* target); each trades quality or capability.)
- Which parts of the LLM stack did this course deliberately not cover, and where do they live? (§3 — multimodal → generative_continuous; agents/tools → agentic_systems; deep RL → reinforcement_learning; deep serving → vllm/sglang; compression → distillation.)
- Name the three open frontiers and why each is unsolved. (§4 — data (the moat, no theory of token quality, recipes unpublished); evaluation (contamination, saturation, Goodhart, no trusted general measure); alignment (we optimize a proxy under a KL leash, not the true objective — reward hacking, sycophancy).)