Training
Everything between random initialisation and a checkpoint worth keeping. Memory arithmetic that decides what fits, sharding strategies that decide what scales, and the preference objectives that have largely replaced hand-written reward functions.
40 entries across five branches. One is a stub and is marked as such — read them as open questions rather than answers.
Objectives
objectives/ ›what the loss actually asks the model to do
02.1O(d)02.2O(G·T·d)02.3O(n·V)02.4O(n·V)02.5O(n·V·m)02.6O(n·V)02.7O(T·d)02.8O(n·d²)
Direct Preference Optimisationstandard
Closed-form preference objective that removes the reward model.
GRPOcommon
Group-relative advantages from sampled completions; no value network.
KL Regularisationstandard
A leash to the reference policy, and the three ways it is estimated.
Knowledge Distillationcommon
Train the small model on the big one’s distribution, not on the labels.
Masked Language Modellingcommon
Corrupt the input, predict what was removed; the objective that lost to next-token.
Next-Token Predictionstandard
Cross-entropy over the next token, and everything that follows from teacher forcing.
Proximal Policy Optimisationcommon
Clipped surrogate advantage objective with KL control to a reference.
Reward Modellingstandard
Fit a scalar reward to pairwise preferences, then watch the policy exploit it.
Optimisers
optimisers/ ›the update rule and the schedule wrapped around it
02.9O(d)02.10O(P)02.11O(1)02.12—02.13O(P)02.14O(P)02.15O(d^1.5)02.16O(P)
AdamWstandard
Adaptive moments with weight decay decoupled from the gradient.
Gradient Clippingstandard
Bound the update norm so one bad batch cannot destroy a run.
Learning-Rate Schedulesstandard
Warmup, cosine decay, and the warmup–stable–decay alternative.
Maximal Update Parameterisationcommon
Scale the initialisation and learning rates so the optimum transfers across width.
Memory-Efficient Optimiserscommon
Adam’s state is twice the model; factorise it, quantise it, or project it.
Schedule-Free Optimisationpromising
Averaging in place of a decay schedule, so the run has no fixed horizon.
Second-Order Preconditioningstubpromising
Shampoo, Muon and the orthogonalised-update family.
Stochastic Gradient Descentcommon
A step against the gradient, momentum on top, and why it loses to Adam on transformers.
Scaling
scaling/ ›how loss falls as compute, data and parameters grow
02.17—02.18—02.19—02.20—02.21—02.22—02.23—02.24O(N·D)
Chinchilla Scaling Lawscommon
Compute-optimal allocation between parameters and training tokens.
Compute-Optimal versus Inference-Optimalstandard
Chinchilla minimises training cost. Nobody trains a model they only train once.
Data-Constrained Scalingcommon
What repeated tokens are worth, and how many epochs before they are worth nothing.
Emergent Abilitiescommon
Capabilities that appear abruptly with scale, and the argument that the abruptness is the metric.
Kaplan Scaling Lawsstale
The 2020 power laws, and the three choices that made them recommend the wrong model.
Scaling Law Methodologycommon
How the curves are fitted, and how the fits go wrong.
Test-Time Compute Scalingstandard
Spend more compute per question instead of more compute per model.
Training Compute Accountingstandard
Why a training run costs 6ND FLOPs, and where the six comes from.
Memory
memory/ ›trading arithmetic for activation storage
02.25O(L·B·T·d)02.26O(L·B·T·d)02.27—02.28O(1)02.29O(√L)02.30—02.31O(P)02.32O(L)
Activation Compressionpromising
Store the saved activations in fewer bits instead of recomputing them.
Activation Memory Accountingstandard
How much a forward pass must keep, and which term dominates when.
CPU and NVMe Offloadingcommon
Park what is not in use on host memory or disk, bounded by PCIe rather than compute.
Gradient Accumulationstandard
Simulate a large batch with several small ones, and the normalisation bug that follows.
Gradient Checkpointingstandard
Trade recompute for activation memory at segment boundaries.
Memory Fragmentationcommon
The allocator that says out-of-memory with gigabytes free, and what to do about it.
Mixed-Precision Trainingstandard
Half-precision compute, full-precision accumulation, and the master copy in between.
Selective Recomputationcommon
Recompute only the cheap-and-large activations, not the whole block.
Distributed
distributed/ ›splitting a model that does not fit on one device
02.33O(N)02.34O(n²·d/N)02.35O(P)02.36—02.37—02.38O(P/N)02.39O(P/N)02.40O(d/N)
Collective Communicationstandard
All-reduce, all-gather, reduce-scatter, all-to-all — the six primitives everything is built from.
Context Parallelismcommon
Split the sequence across devices, and pass the KV blocks around a ring.
Data Parallelismstandard
Replicate the model, split the batch, average the gradients.
Fault Tolerancecommon
At ten thousand devices something fails hourly; the run has to survive it.
Parallelism Compositionstandard
Four or five strategies at once, and the topology decides the order.
Pipeline Parallelismstandard
Layers on different devices, and the bubble that schedule design exists to shrink.
Tensor Parallelismstandard
Split each matrix across devices; two all-reduces per layer buy the memory back.
ZeRO Shardingstandard
Partition optimiser state, gradients and parameters across ranks.