Skip to content
ImagineWorld

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
chapter_titleAppendix B: Notation and Glossary
governed_byCORPUS
constitutional_citationCONSTITUTION
local graph

Appendix B — Notation and Glossary

A quick reference for the symbols and terms used throughout the book.

SymbolMeaning
B, Tbatch size; sequence length (tokens)
d / d_modelmodel (hidden) dimension
Vvocabulary size
N, Dnumber of parameters; number of training tokens
h, d_headnumber of attention heads; per-head dimension
E, knumber of experts; active experts (or top-k)
θ, βparameters; KL / preference strength

Table B.1 — Notation

TermDefinition
Autoregressivegenerating one token at a time, each conditioned on all previous
Attentioncontent-based mixing of information across positions (Chapter 7)
BPEbyte-pair encoding; merges frequent token pairs to build a subword vocabulary
Continued pre-trainingfurther pretraining of an existing base model on new data (Chapter 17)
Cross-entropythe language-modeling loss; negative log-likelihood of the true token
Distillationtraining a small student to imitate a large teacher (Chapter 26)
DPODirect Preference Optimization; preference alignment without a reward model
FP88-bit floating point; halves memory and doubles matmul throughput (Chapter 18)
GQAgrouped-query attention; shares keys/values across query heads
GRPOGroup Relative Policy Optimization; RL with a group-mean baseline (Chapter 25)
KV cachestored keys/values of past tokens, reused during decoding (Chapter 12, 27)
LoRAlow-rank adapters for cheap fine-tuning (Chapter 22)
MFUmodel FLOPs utilization; fraction of peak compute

Table B.2 — Glossary

TermDefinition
MLAMulti-head Latent Attention; compresses the KV cache to a latent (Chapter 12)
MoEMixture-of-Experts; route each token to a few of many experts (Chapter 11)
MTPmulti-token prediction; predict several future tokens (Chapter 13)
Perplexityexponential of per-token cross-entropy; effective branching factor
Pre-normnormalizing a sublayer’s input rather than its output (Chapter 8)
Quantizationstoring weights/activations in fewer bits (Chapter 26)
RLHFreinforcement learning from human feedback (Chapter 23)
RMSNormnormalization by root-mean-square, no mean-centering (Chapter 8)
RoPErotary position embedding; encodes relative position by rotation (Chapter 9)
SFTsupervised fine-tuning on instruction-response pairs (Chapter 22)
SwiGLUgated feed-forward activation, the modern default (Chapter 8)
Token / Tokenizera 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

TermMeaning
Self-attentioneach token forms a weighted average over all tokens’ value vectors
Multi-head attentionseveral attention operations run in parallel on projected subspaces
MLAMulti-head Latent Attention; caches a compressed latent in place of full K/V
KV cachestored keys and values of past tokens, reused during generation
RoPErotary position embedding; encodes position by rotating query/key pairs
Residual streamthe running sum each sublayer reads from and adds back to
RMSNormnormalization that rescales by root-mean-square, without centering
TermMeaning
MoEMixture of Experts; many expert FFNs, a router activates a few per token
Router / gatenetwork that scores experts and selects the top-k for each token
Shared expertan expert every token uses, alongside the routed ones
Sparse attentionattention restricted to a selected subset of keys per query
MTPMulti-Token Prediction; auxiliary heads predict several future tokens
Logitspre-softmax scores over the vocabulary
Vocabularythe set of tokens a model can read and produce
Table B.1 — Architecture and model terms
TermMeaning
Pretrainingself-supervised next-token training on a large corpus
Cross-entropyloss measuring the gap between predicted and true token distributions
Perplexityexponential of mean cross-entropy; effective choices per token
AdamWthe optimizer behind most LLMs; adaptive, with decoupled weight decay
LR schedulehow the step size changes over training [warmup then decay]
Gradient accumulationsumming gradients over microbatches before one optimizer step
Gradient clippingcapping the gradient norm to prevent instability
Mixed precisionlow precision for matmuls, high precision for sensitive ops
Data parallelismreplicate the model across devices, each on different data
Tensor parallelismsplit individual layers across devices
Pipeline parallelismsplit layers into stages across devices
Expert parallelismdistribute MoE experts across devices
ZeRO / FSDPshard optimizer state, gradients, and parameters across DP ranks
MFUModel FLOPs Utilization; fraction of peak compute actually used
Loss spikea sudden jump in training loss; a stability failure
Table B.2 — Training terms
TermMeaning
SFTsupervised fine-tuning on instruction-response pairs
TermMeaning
RLHFreinforcement learning from human feedback
Reward modelmodel trained to score responses by human preference
PPOProximal Policy Optimization; the classic RLHF algorithm
DPODirect Preference Optimization; aligns from preferences, no reward model
GRPOGroup Relative Policy Optimization; group-mean baseline, no critic
KL penaltyterm keeping the policy close to a reference model
Reward hackingexploiting a reward’s flaws to score high without being good
Verifiable rewarda programmatic, checkable reward (tests pass, answer matches)
LoRALow-Rank Adaptation; fine-tuning via small adapter matrices
Distillationtraining a small student to imitate a large teacher
RLAIFRL from AI feedback; a model judge replaces the human labeler
Table B.3 — Alignment and post-training terms
TermMeaning
Autoregressiveproducing tokens one at a time, each conditioned on the last
Temperaturescaling of logits that controls the randomness of sampling
Nucleus (top-p)sample from the smallest token set summing to probability p
Beam searchdecoding that keeps the top-b partial sequences by likelihood
Speculative decodinga draft model proposes tokens the main model verifies in one pass
Continuous batchingadd and remove requests from a batch as they arrive and finish
Paged attentionmanage the KV cache in fixed-size pages to cut waste
Prefill / decodethe prompt-processing phase versus token generation
Quantizationstoring weights or activations in fewer bits (INT8, INT4)
pass@kprobability 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.

TermMeaning
All-reducecollective that sums a tensor across devices and shares the result
All-to-allcollective that exchanges data among all devices; used for MoE routing
NCCLNVIDIA’s library of GPU collective communication primitives
RDMAremote direct memory access; low-latency inter-node transfer
HBMhigh-bandwidth memory; the GPU’s main, relatively slow memory
Arithmetic intensityFLOPs performed per byte of memory moved (Section 20.10)
Rooflinemodel classifying a kernel as compute- or memory-bound
Pipeline bubbleidle time while a pipeline fills and drains (Section 19.11)
1F1Bone-forward-one-backward pipeline schedule
DualPipeDeepSeek’s overlapping pipeline schedule
Activation checkpointingrecompute activations in backward to save memory
Sequence parallelismshard replicated regions along the token dimension
Cold startthe minutes a new replica needs to load a large model
Canarya new version released to a small traffic slice first
Spot instancecheap, preemptible cloud compute (Section 35.8)

Table B.5 — Systems and infrastructure terms