LESSON 0.1 · Map · 45 min

Map the LLM stack and how to learn it

Map the LLM stack and how to learn it. Learn pretraining, post-training, inference, and applications; parameters versus state and complete: Trace one request from text to output to

Learning objectives

  1. Separate parameters changed during training from state changed during a request.
  2. Draw data → tokens → training → base model → post-training → assistant → inference/tools.
  3. Attach lessons 2.x–7.x to the correct links.
  4. Explain why continuation ability is not assistant behavior.

Core concepts

Data and tokens

Collected text is filtered, deduplicated, mixed, and encoded with a fixed tokenizer. Changing the tokenizer changes sequence lengths, vocabulary indices, embeddings, and downstream interfaces.

Pretraining and parameters

The next-token objective updates weights with gradients. A new user message changes request state; it does not immediately retrain the model.

Base model

A base model continues the conditional distribution of its training text. A question may become a webpage or forum continuation rather than a direct service response.

Post-training and assistant

Demonstrations, preferences, and task rewards reshape role, format, and stopping behavior in the weights. Later lessons separate the algorithms.

Inference state

Prompt tokens, generated tokens, KV cache, and sampling settings belong to runtime state. Temperature reshapes decoding probabilities; it does not add knowledge.

Build and verify

Rebuild a usable LLM stack map in 45 minutes

  • Minutes 0–3: draw the request path without references.
  • Minutes 3–34: watch six required segments and answer one card question per segment.
  • Minutes 34–41: redraw data, parameter-update, and runtime-state flows with verbs on arrows.
  • Minutes 41–45: answer four retrieval questions and place 2.x–7.x.

Open the complete interactive lesson