Guided route and resource map
Three questions, nine stages, territories, sections, pages, and canonical concepts
Nine stages of Understand · Resource map
Theory path — Understand
We first observe what an LLM predicts, then reconstruct the computation that produces its predictive distribution. The route next follows the generation loop, then examines how the application assembles the context for each call. It finally returns to the distribution’s other two uses: scoring an observed target and learning the parameters. This is a pedagogical order: context design acts upstream of each call, even though the route studies it after generation. The nine stages provide a first-reading order, not a strict prerequisite chain.
Learning path skeleton
The details of each lesson follow the form ideas used → object studied · intended outcome.
- The model · Overview
- Predict a token · Tokenize → Represent → Contextualize → Predict
- Use and train · Generate · Shape context · Score · Train
Compare uses
| Stage | Context \(c\) | Parameters \(\theta\) | Operation |
|---|---|---|---|
| Generate | Grows with each token fed back | Fixed | Output · Select and feed back a token |
| Shape context | Assembled for each call | Fixed | Input · Choose the information supplied |
| Score | Prefix given for each target | Fixed | Output · Score an observed target or sequence |
| Train | Prefixes from observed examples | Updated | Training · Aggregate losses and update parameters |
Context design shapes the input. The other three operations use the distribution. Training aggregates penalties on observed targets, backpropagates the gradient, and applies an update.
Skeleton of the 20 lessons
How an LLM works
- Next-token prediction + Autoregressive generation (preview) · Trace two rounds of prediction and feedback · Review sheet
From text to tokens
- Text context → Token + Token IDs · Trace text to IDs and explain what can change between two tokenizers. · Review sheet
From IDs to representations
- Token IDs + Embedding lookup → Initial token embedding · Trace the vectors selected by an ID sequence in order and explain why repeated IDs retrieve the same vector with a fixed table · Review sheet
- Initial token embedding → Positional encoding · Distinguish token content from its position · Review sheet
- Initial token embedding + Positional encoding → Contextualized representation · Explain why two occurrences of one token can have different states · Review sheet
Understand Transformer computation
- Initial hidden states → Model forward pass · Trace how the blocks transform the states · Review sheet
- Transformer-block input → Query + Key + Value · Predict the effect of V with queries, keys and mask fixed · Review sheet
- Query + Key + Value → Scaled dot-product attention + Attention weights · Compute one query’s weights and aggregate the values · Review sheet
- Attention score → Causal mask + Masked scores · Determine which positions participate in softmax · Review sheet
From hidden states to the predictive distribution
- Final hidden states → Logits · Assign a score to each vocabulary token · Review sheet
- Logits → Next-token conditional distribution · Normalize scores over the vocabulary · Review sheet
- Next-token conditional distribution → Entropy · Distinguish distribution uncertainty from one token’s surprisal · Review sheet
Run inference and generate text
- Next-token conditional distribution → Autoregressive generation + Prefill + Incremental decode step (revisit) · Connect the first token to subsequent steps · Review sheet
Use and design context
- Token-ID context → In-context learning · Explain the effect of a supplied example with fixed parameters · Review sheet
- Token-ID context → Context engineering · Determine what is actually supplied in each call · Review sheet
Score observed tokens
- Next-token conditional distribution + Observed target token → Sequence likelihood + Log-likelihood · Combine the conditional probabilities of an observed sequence · Review sheet
- Next-token conditional distribution + Observed target token → Cross-entropy + Per-token NLL · Compute a one-position penalty and identify the one-hot case · Review sheet
Learn and update parameters
- Per-token NLL → Loss reduction + Training objective · Form a scalar from the losses at valid positions · Review sheet
- Training objective → Gradient + Parameter update · Use the gradient to compute the parameter change · Review sheet
- Parameter update → Training loop · Identify when parameters are updated and when the model is evaluated · Review sheet
Predictions in notation
For an autoregressive GPT, \(f_\theta(c)\) maps context \(c\) to logits using parameters \(\theta\). Normalizing the logits gives the base next-token distribution.
\[p_\theta(\cdot\mid c)=\operatorname{softmax}\!\bigl(f_\theta(c)\bigr).\]
The nine stages
These stages follow the canonical curriculum. They show the study order and optional resources. Pages within a stage complement one another.
Learning path plan and review sheets
Viewed progress · stored only in this browser
The model
01 · How an LLM works
Locate the model’s context and parameters. Follow two generation steps in the overview before studying how a prediction is computed.
Core pages
Optional resources
Predict a token
02 · From text to tokens
Distinguish text, tokens, and token IDs that form the model’s discrete input without needing to study segmentation algorithms.
Core pages
Optional resources
03 · From IDs to representations
Identify embeddings and positional information. Compare initial and contextualized states before opening the blocks that turn the former into the latter.
Core pages
- From token IDs to vectors: embeddings
- Positional encoding: giving tokens an order
- Why can the same token have different contextualized representations?
Optional resources
04 · Understand Transformer computation
Connect Q/K/V projections, attention scores and weights, value aggregation, causal masking, and the other operations in a Transformer block.
Core pages
- The Transformer in a GPT: architecture and computation
- Queries, keys, and values (Q, K, V)
- Scaled dot-product attention
- Causal masking
Optional resources
Use and train
06 · Run inference and generate text
Distinguish prompt prefill from iterative decode, select a token with a decoding policy, feed it back into the context, and stop generation without updating parameters.
Core pages
Optional resources
07 · Use and design context
Extend inference to the application level. Explain the effect of examples supplied in the prompt, then choose what information a system passes to the model.
Core pages
Optional resources
08 · Score observed tokens
Evaluate the probability assigned to a known target, build a sequence likelihood, and connect negative log-likelihood to cross-entropy without selecting a token or changing parameters.
Core pages
Optional resources
09 · Learn and update parameters
Connect observed targets to the aggregated loss, gradients, and parameter updates, then to the repeated training loop and validation loss; understand teacher forcing conceptually without making shifted-example preparation a stage of the Theory path.
Core pages
- From token penalties to batch loss
- Gradients: connecting loss to parameters
- The training loop: from gradients to a trained model
Optional resources
Try the end-of-path exercise, then design an evaluation on held-out data.
Other primary path — Build: To build a small GPT, follow the independent Build path. It has its own implementation milestones and prerequisites; it is not a required continuation of the Theory path. Corpus preparation and training-example construction form a dedicated model-learning branch, not a prerequisite for inference.
Explore the resources
How to read this map
- Territories — the main parts of the site: Understand, Build, Practice, Deepen, Reference.
- Sections — clicking a territory reveals its subsections; the breadcrumb or the Escape key takes you back up one level at a time.
- Pages — clicking a page shows its details (purpose, sections, links); “Open the page” navigates there directly.
- Concepts — the “Canonical concepts” view groups the concepts from the bilingual registry versioned in
data/concepts.ymlby discovery domain, with their definitions, typed relationships, and resource pages. The search and the relation-type filter narrow the list, a selected concept highlights its neighbours, and related concepts remain clickable from the details panel.
Section headings shown in a page’s details are editorial landmarks, not canonical concepts. The guided route provides a reading order.
The URL records the search, filter, and selection. “Copy link” shares that view. “Reset view” clears those three settings. The map and static list are generated from the Quarto sidebar and page metadata.
Loading the map…
Use this map for orientation, not as a strict prerequisite graph. Advanced pages can be consulted directly when they address the question at hand.
All resources, as a list
The same structure as a static list: useful without JavaScript, for printing, or for copying a link. It is produced by the same generation as the interactive map.
- Understand LLMs
- Architecture comparison (optional)
- Overview: what is an LLM?
- From text to tokens: representing language
- From token IDs to vectors: embeddings
- Positional encoding: giving tokens an order
- Why can the same token have different contextualized representations?
- The Transformer in a GPT: architecture and computation
- Queries, keys, and values (Q, K, V)
- Scaled dot-product attention
- Causal masking
- Logits: scores before normalization
- Output probabilities: from logits to a distribution
- Entropy: uncertainty over the next token
- Generating text: inference step by step
- In-context learning
- Context engineering
- Likelihood and log-likelihood
- Cross-entropy for a token prediction
- From token penalties to batch loss
- Gradients: connecting loss to parameters
- The training loop: from gradients to a trained model
- Review
- Learning path plan and review sheets
- Review — How an LLM works
- Review — From text to tokens
- Review — Embeddings and table lookup
- Review — Positional information
- Review — Contextualized representations
- Review — GPT Transformer computation
- Review — Queries, keys and values
- Review — Scaled dot-product attention
- Review — Causal masking
- Review — Output logits
- Review — Next-token probabilities
- Review — Predictive entropy
- Review — Autoregressive generation
- Review — In-context learning
- Review — Context engineering
- Review — Sequence likelihood
- Review — Cross-entropy
- Review — GPT loss function
- Review — Gradients and parameter updates
- Review — Training loop
- Synthesis sheet — Entropy, from language to LLMs
- Revision sheet — Information theory and LLMs
- Build a small GPT
- Prepare training data
- Guided tour of the reference code
- Build a small GPT
- Practice and experiment
- Mathematical foundations
- Text data
- Attention
- Transformer
- Generation
- Deepen
- Language, information, and statistics
- Information theory
- Exercise catalogue
- Explore and compare Transformers
- Evaluating a model: from score to experimental protocol
- Deepen your understanding
- Language modeling
- Attention, position, and architectures
- Why scale attention scores?
- Contextualized representations: dependencies across positions and layers
- Q/K/V: mathematical formulation and variants
- Cross-attention: connecting two sequences
- Multimodal architectures: understanding and generation
- RoPE: geometry, derivation, and limitations
- Sinusoidal positional encodings: frequencies, geometry, and limits
- Hybrid LLM architectures: Nemotron 3 and 3.5
- Next-Concept Modeling: generation over representation levels
- Text, corpora, and tokenization
- Tokenization and tokenizers
- Language statistics
- Probabilistic formalization and the training chain
- Inference and efficiency
- Scale and research questions
- Attention, position, and architectures
- Mathematical tools and geometry
- Deep-dive map
- Language modeling
- Glossary and history
Browse the glossary · Explore the GPT build path · Version française