LLM Kitchen
Explanations

Today's menu

LLM Kitchen

How a large language model works, one idea at a time. Start with guessing the next word, build up to an agent that uses tools, and finish with other kinds of models made from the same pieces.

Start with Ch 0 →

Part I Prediction

  1. The guessing game Ch 0
  2. Predicting by counting Ch 1
  3. Probability and sampling Ch 2

Part II Representation

  1. Text is just numbers Ch 3
  2. Tokens: the model's alphabet Ch 4
  3. Meaning as position Ch 5

Part III Learning

  1. A neuron Ch 6
  2. Learning from mistakes Ch 7

Part IV Context

  1. The context problem Ch 8
  2. Attention Ch 9
  3. The transformer block Ch 10

Part V Putting it together

  1. Generating text Ch 11
  2. Scale Ch 12
  3. Fewer bits per number Ch 13
  4. Guessing ahead Ch 14
  5. From predictor to assistant Ch 15
  6. Quirks and limits Ch 16
  7. Thinking before answering Ch 17

Part VI Prompt engineering

  1. A prompt is the start of a document Ch 18
  2. Learning from examples in the prompt Ch 19
  3. Instructions, roles, and the system prompt Ch 20
  4. Asking for steps and structure Ch 21
  5. Where prompts break Ch 22

Part VII Harnesses

  1. The model is not the product Ch 23
  2. Managing the context Ch 24
  3. Search and memory Ch 25
  4. Caching: reusing the work Ch 26
  5. Which model answers? Ch 27

Part VIII Agents

  1. Tools Ch 28
  2. The agent loop Ch 29
  3. Designing an agent Ch 30
  4. Splitting the work Ch 31

Part IX Safety

  1. Making things up Ch 32
  2. Prompt injection Ch 33
  3. Trust and guardrails Ch 34
  4. Did it work? Ch 35

Part X Other kinds of models

  1. Reading both ways Ch 36
  2. Many experts Ch 37
  3. Remembering without attention Ch 38
  4. Seeing pictures Ch 39
  5. Painting from noise Ch 40
  6. Choosing actions Ch 41

Wrap-up

  1. Recap: the whole picture Ch 42
  2. From message to reply Ch 43
  3. Is a model the right tool? Ch 44
  4. Picking a model Ch 45
  5. Check yourself Ch 46