Appendix B: Notation and Glossary
node_idnode-book_building-frontier-llm-from-scratch_appendix-b-notation-and-glossary
node_typechapter-node
schema_profileworld.chapter_node.v1
statusactive
entropyhigh
manifoldworld
domainimagineworld.net
authorityinforms
layercorpus
book_parentnode-book_building-frontier-llm-from-scratch
chapter_titleAppendix B: Notation and Glossary
governed_byCORPUS
constitutional_citationCONSTITUTION
local graph
Appendix B: Notation and Glossary
Section titled “Appendix B: Notation and Glossary”Appendix B — Notation and Glossary
A quick reference for the symbols and terms used throughout the book.
| Symbol | Meaning |
|---|---|
| B, T | batch size; sequence length (tokens) |
| d / d_model | model (hidden) dimension |
| V | vocabulary size |
| N, D | number of parameters; number of training tokens |
| h, d_head | number of attention heads; per-head dimension |
| E, k | number of experts; active experts (or top-k) |
| θ, β | parameters; KL / preference strength |
Table B.1 — Notation
| Term | Definition |
|---|---|
| Autoregressive | generating one token at a time, each conditioned on all previous |
| Attention | content-based mixing of information across positions (Chapter 7) |
| BPE | byte-pair encoding; merges frequent token pairs to build a subword vocabulary |
| Continued pre-training | further pretraining of an existing base model on new data (Chapter 17) |
| Cross-entropy | the language-modeling loss; negative log-likelihood of the true token |
| Distillation | training a small student to imitate a large teacher (Chapter 26) |
| DPO | Direct Preference Optimization; preference alignment without a reward model |
| FP8 | 8-bit floating point; halves memory and doubles matmul throughput (Chapter 18) |
| GQA | grouped-query attention; shares keys/values across query heads |
| GRPO | Group Relative Policy Optimization; RL with a group-mean baseline (Chapter 25) |
| KV cache | stored keys/values of past tokens, reused during decoding (Chapter 12, 27) |
| LoRA | low-rank adapters for cheap fine-tuning (Chapter 22) |
| MFU | model FLOPs utilization; fraction of peak compute |
Table B.2 — Glossary
| Term | Definition |
|---|---|
| MLA | Multi-head Latent Attention; compresses the KV cache to a latent (Chapter 12) |
| MoE | Mixture-of-Experts; route each token to a few of many experts (Chapter 11) |
| MTP | multi-token prediction; predict several future tokens (Chapter 13) |
| Perplexity | exponential of per-token cross-entropy; effective branching factor |
| Pre-norm | normalizing a sublayer’s input rather than its output (Chapter 8) |
| Quantization | storing weights/activations in fewer bits (Chapter 26) |
| RLHF | reinforcement learning from human feedback (Chapter 23) |
| RMSNorm | normalization by root-mean-square, no mean-centering (Chapter 8) |
| RoPE | rotary position embedding; encodes relative position by rotation (Chapter 9) |
| SFT | supervised fine-tuning on instruction-response pairs (Chapter 22) |
| SwiGLU | gated feed-forward activation, the modern default (Chapter 8) |
| Token / Tokenizer | a subword unit; the component that maps text to token ids (Chapter 5) |
Glossary of Core Terms
The terms below recur throughout the book. Definitions are deliberately compact; the chapter cross-references in the text give the full treatment.
Table B.2 — Glossary
| Term | Meaning |
|---|---|
| Self-attention | each token forms a weighted average over all tokens’ value vectors |
| Multi-head attention | several attention operations run in parallel on projected subspaces |
| MLA | Multi-head Latent Attention; caches a compressed latent in place of full K/V |
| KV cache | stored keys and values of past tokens, reused during generation |
| RoPE | rotary position embedding; encodes position by rotating query/key pairs |
| Residual stream | the running sum each sublayer reads from and adds back to |
| RMSNorm | normalization that rescales by root-mean-square, without centering |
| Term | Meaning |
|---|---|
| MoE | Mixture of Experts; many expert FFNs, a router activates a few per token |
| Router / gate | network that scores experts and selects the top-k for each token |
| Shared expert | an expert every token uses, alongside the routed ones |
| Sparse attention | attention restricted to a selected subset of keys per query |
| MTP | Multi-Token Prediction; auxiliary heads predict several future tokens |
| Logits | pre-softmax scores over the vocabulary |
| Vocabulary | the set of tokens a model can read and produce |
| Table B.1 — Architecture and model terms |
| Term | Meaning |
|---|---|
| Pretraining | self-supervised next-token training on a large corpus |
| Cross-entropy | loss measuring the gap between predicted and true token distributions |
| Perplexity | exponential of mean cross-entropy; effective choices per token |
| AdamW | the optimizer behind most LLMs; adaptive, with decoupled weight decay |
| LR schedule | how the step size changes over training [warmup then decay] |
| Gradient accumulation | summing gradients over microbatches before one optimizer step |
| Gradient clipping | capping the gradient norm to prevent instability |
| Mixed precision | low precision for matmuls, high precision for sensitive ops |
| Data parallelism | replicate the model across devices, each on different data |
| Tensor parallelism | split individual layers across devices |
| Pipeline parallelism | split layers into stages across devices |
| Expert parallelism | distribute MoE experts across devices |
| ZeRO / FSDP | shard optimizer state, gradients, and parameters across DP ranks |
| MFU | Model FLOPs Utilization; fraction of peak compute actually used |
| Loss spike | a sudden jump in training loss; a stability failure |
| Table B.2 — Training terms |
| Term | Meaning |
|---|---|
| SFT | supervised fine-tuning on instruction-response pairs |
| Term | Meaning |
|---|---|
| RLHF | reinforcement learning from human feedback |
| Reward model | model trained to score responses by human preference |
| PPO | Proximal Policy Optimization; the classic RLHF algorithm |
| DPO | Direct Preference Optimization; aligns from preferences, no reward model |
| GRPO | Group Relative Policy Optimization; group-mean baseline, no critic |
| KL penalty | term keeping the policy close to a reference model |
| Reward hacking | exploiting a reward’s flaws to score high without being good |
| Verifiable reward | a programmatic, checkable reward (tests pass, answer matches) |
| LoRA | Low-Rank Adaptation; fine-tuning via small adapter matrices |
| Distillation | training a small student to imitate a large teacher |
| RLAIF | RL from AI feedback; a model judge replaces the human labeler |
| Table B.3 — Alignment and post-training terms |
| Term | Meaning |
|---|---|
| Autoregressive | producing tokens one at a time, each conditioned on the last |
| Temperature | scaling of logits that controls the randomness of sampling |
| Nucleus (top-p) | sample from the smallest token set summing to probability p |
| Beam search | decoding that keeps the top-b partial sequences by likelihood |
| Speculative decoding | a draft model proposes tokens the main model verifies in one pass |
| Continuous batching | add and remove requests from a batch as they arrive and finish |
| Paged attention | manage the KV cache in fixed-size pages to cut waste |
| Prefill / decode | the prompt-processing phase versus token generation |
| Quantization | storing weights or activations in fewer bits (INT8, INT4) |
| pass@k | probability that at least one of k samples is correct |
| Table B.4 — Inference and serving terms |
Glossary: Systems and Infrastructure
A final group of terms, drawn from the training- and serving- systems chapters, where much of the real engineering of a frontier model lives.
| Term | Meaning |
|---|---|
| All-reduce | collective that sums a tensor across devices and shares the result |
| All-to-all | collective that exchanges data among all devices; used for MoE routing |
| NCCL | NVIDIA’s library of GPU collective communication primitives |
| RDMA | remote direct memory access; low-latency inter-node transfer |
| HBM | high-bandwidth memory; the GPU’s main, relatively slow memory |
| Arithmetic intensity | FLOPs performed per byte of memory moved (Section 20.10) |
| Roofline | model classifying a kernel as compute- or memory-bound |
| Pipeline bubble | idle time while a pipeline fills and drains (Section 19.11) |
| 1F1B | one-forward-one-backward pipeline schedule |
| DualPipe | DeepSeek’s overlapping pipeline schedule |
| Activation checkpointing | recompute activations in backward to save memory |
| Sequence parallelism | shard replicated regions along the token dimension |
| Cold start | the minutes a new replica needs to load a large model |
| Canary | a new version released to a small traffic slice first |
| Spot instance | cheap, preemptible cloud compute (Section 35.8) |
Table B.5 — Systems and infrastructure terms