The handbook

Background reading. The notebooks teach you to build; this explains what you are building on — where these models come from, how they are made, and why the tools around them exist.

It is written to be read straight through in an evening, or dipped into. It assumes nothing beyond the ability to read code, and it does not require you to run anything.


Why this exists

You can use an LLM productively without knowing how it was trained, in the same way you can drive without knowing how an engine works. But the moment something goes wrong — the model invents a citation, ignores your instruction, costs ten times what you expected — the people who can diagnose it are the ones who know what is happening underneath.

This handbook is that layer of understanding. It is also, deliberately, a map of the ecosystem: there are hundreds of tools with confident names and similar descriptions, and most of the confusion in this field comes from not knowing which layer a tool sits in or which problem it was born to solve.

The chapters

  Chapter What you get
1 How we got here Why each piece was invented, in order. The shortest useful history.
2 How models work Tokens, embeddings, attention, context windows — the mechanism, without the maths degree.
3 How LLMs are trained Every phase: data, pre-training, post-training, RLHF, DPO, reasoning, and what you can do.
4 The model landscape Base vs instruct vs reasoning. Foundation vs frontier. How to read a model card.
5 The tool ecosystem Every tool worth knowing: what problem it solves, why it was built, when to use it.
6 Protocols and standards The OpenAI API as lingua franca, tool-calling formats, and MCP in depth.
7 The mathematics For the deep dive. Attention derived from scratch: Q/K/V, \(\sqrt{d_k}\), masking, RoPE, the residual stream, and what it all costs.
8 Who builds them, and what it costs Parameter counts that mean different things, what training actually costs, and what closed labs do and do not disclose.

How it relates to the workshop

The handbook is standalone — you can read it without touching a notebook. But each chapter points at the notebook where you do the thing it describes.

Handbook Notebook
How models work 01 (tokenization), 03 (generation)
The mathematics 21 (attention from scratch), 13 (pre-training)
How LLMs are trained 11 (LoRA fine-tuning)
The model landscape 02 (choosing a model)
Who builds them 02 (choosing a model), 20 (why benchmark numbers move)
The tool ecosystem 05 (runtimes), 06 (serving)
Protocols and standards 07 (tool calling), 10 (agents)

A note on dates and numbers

Specific figures — parameter counts, token budgets, training costs, release dates — are a snapshot, and this field moves faster than any document can. They are here to give you a sense of scale, not to be quoted.

The reasoning should outlast them. When a number here disagrees with a model card, believe the model card.

Anything asserted about a specific model should be checked against its own documentation. Anything asserted about why a technique exists is much more durable — that is what this handbook is really for.


Table of contents


Back to top

ROBT407LLM workshop materials. Code is MIT licensed; prose is CC BY 4.0. Model weights are governed by their own licences - check each model card.