Field guide

Notation

Every symbol used in Descent, what it means, and how to say it out loud. Papers are written in a compressed dialect; this is the dictionary. Filter by typing a word you half-remember.

Conventions and decorations

“theta (bold)”The model's parameters: every adjustable number, stacked into one vector. Plain is a single parameter.In , holds all the weights.Taught in: Reading the symbols
“alpha”A scalar coefficient; in the Adam optimiser, the step size (default ).Taught in: Reading the symbols
“epsilon”A small positive constant that keeps a computation finite (Adam adds to a denominator) — or, in diffusion models, random noise. The paper decides which.Taught in: Reading the symbols
“lambda”The strength of a regulariser, ; in linear algebra, an eigenvalue or a Lagrange multiplier.Ridge regression adds to the loss.Taught in: Reading the symbols
“y hat”A prediction or estimate: the hat means 'computed from data'. (Occasionally a paper uses a hat for something else — check its definition.) are fitted parameters; is a predicted target.Taught in: Reading the symbols
“x bar”An average, usually the sample mean.Taught in: Reading the symbols
“theta star”The optimum: the value that minimises (or maximises) the objective.Taught in: Reading the symbols
“x tilde”Another version of — modified, noisy, approximate or simply a second one. No fixed meaning; the paper defines it.Taught in: Reading the symbols
“f prime of x”The derivative of . On a variable, may just mean 'another ' — and in some statistics papers is a transpose.Taught in: Reading the symbols
“is defined as”Introduces a new name for the expression on the right.Taught in: Reading the symbols
“is identical to”Identical: equal for every value of the variables, not just for particular ones. Check the paper's usage.Taught in: Reading the symbols
“is approximately equal to”Close, with the approximation usually explained nearby.Taught in: Reading the symbols
“is proportional to”Equal up to a constant factor that is being ignored.Taught in: Reading the symbols
“is replaced by”Assignment in pseudo-code: overwrite the left side with the value on the right.Adam: Taught in: Reading the symbols
“indicator of the condition”1 if the condition is true, 0 otherwise.Accuracy Taught in: Reading the symbols
“big-O of n squared”Grows at most proportionally to for large (constant factors ignored).A self-attention layer costs for positions of width .Taught in: Reading the symbols
“mel of f”The HTK mel scale, one of several conventions for warping frequency toward perceived pitch. mel.Taught in: Speech and audio
“blank”In CTC, the blank symbol: it outputs nothing and separates repeated characters. hello.Taught in: Speech and audio
“y hat T plus h given T”The forecast for time made with data up to time ; is the horizon.Taught in: Time series and forecasting
“f32 of shape 2 by 3”An abstract value as printed in a jaxpr (or an FX graph): the dtype and shape of an array, without its numbers. Tracing works on these. records a sine of a float32 scalar.Taught in: JAX: tracing and transformations
“the absmax scale”The scale for symmetric absmax quantization to bits: values are stored as and read back as times that integer. The largest value sets the step for everything it covers.For int8, ; a single outlier of 20 makes the step .Taught in: Quantization and distillation
“W eight A eight; W four A sixteen”Quantization settings: the bit width of the weights (W) and of the activations (A).SmoothQuant targets W8A8; GPTQ and AWQ are usually used as W4A16 (4-bit weights, 16-bit activations).Taught in: Quantization and distillation
“with respect to”Names the variable a derivative or optimisation is taken over.Adam's Algorithm 1: 'Get gradients w.r.t. stochastic objective at timestep '.Taught in: How to read an ML paper
“for example”Latin exempli gratia: introduces examples, not a complete list.Taught in: How to read an ML paper
“that is”Latin id est: introduces a restatement or the complete meaning.Taught in: How to read an ML paper
“arXiv seventeen-oh-six dot oh-three-seven-six-two, version seven”An arXiv identifier: YYMM of first submission, a sequence number, and the version. Cite the version you read.1706 = June 2017, the first version of the transformer paper.Taught in: How to read an ML paper
“c i”The cluster that point is assigned to, a whole number from to .: point 7 belongs to cluster 3.Taught in: k-means, properly

Sets and spaces

“a is in A” is an element of the set ; means 'is not in'.Taught in: Reading the symbols
“R”The real numbers.Taught in: Reading the symbols
“R n”Vectors of real numbers. is a list of three reals.Taught in: Reading the symbols
“R n by d”Real matrices with rows and columns.A data matrix : one row per example.Taught in: Reading the symbols
“the set one to K”The integers from 1 to ; curly braces list or build a set.Taught in: Reading the symbols
“closed interval; half-open interval” includes both ends; excludes and includes .Taught in: Reading the symbols
“A is a subset of B”Every element of is also in .Taught in: Reading the symbols
“A minus B”The elements of that are not in .Taught in: Reading the symbols
“the empty set”The set with no elements.Taught in: Reading the symbols
“the size of S”For a set, its number of elements; around a number, absolute value; around a matrix, sometimes the determinant.A vocabulary has tokens.Taught in: Reading the symbols
“for all”Universal quantifier: the statement holds for every value.Taught in: Reading the symbols
“there exists”Existential quantifier: at least one value makes the statement true.Taught in: Reading the symbols
“f maps R n to R” takes a vector of reals and returns one real — the function's type.Taught in: Reading the symbols
“g after f”Function composition: . A few sources use for the element-wise product instead.Taught in: Reading the symbols
“f of x, parametrised by theta”A function of the input whose behaviour is set by the parameters (held fixed while it is applied).Taught in: Reading the symbols
“script D”A dataset.Taught in: Reading the symbols
“N k of x”The neighbourhood of : the indices of the training points closest to it.With , k-NN predicts the majority label among the 5 points in .Taught in: Nearest neighbours and naive Bayes
“R m”The region (axis-aligned box) of input space that ends at leaf of a tree..Taught in: Decision trees
“H k, the RKHS”The reproducing kernel Hilbert space of kernel : a space of functions with .The representer theorem: regularised minimisers over have the form .Taught in: Support vector machines and kernels
“the neighbourhood of i”The set of nodes joined to node by an edge.Message passing aggregates over , often including itself.Taught in: Graph neural networks
“B by T by d”A shape written out in a paper: here a batch of sequences of tokens with features each. Broadcasting rules compare such shapes from the right.Adding a bias of shape to an activation of shape broadcasts over and .Taught in: Arrays: NumPy and SciPy
“the size of the vocabulary”The number of distinct symbols (letters, words or tokens) a language model can predict. The softmax output has one entry per vocabulary item.Shannon's alphabet has : 26 letters and the space.Taught in: From n-grams to neural language models
“script H”The hypothesis class: the set of prediction rules a learner may output, fixed before seeing data.All thresholds .Taught in: PAC learning
“the VC dimension of H”The size of the largest set of points the class can shatter (label in every possible way).Half-planes in : 3. Half-spaces in : .Taught in: VC dimension
“H restricted to C”The set of label vectors the class can produce on the finite point set . shatters when .Thresholds on 3 points give 4 label vectors, not 8.Taught in: VC dimension
“x is in R d” is a vector of real numbers. Bold lowercase means a vector, written as a column.A greyscale image flattened into a vector lives in .Taught in: Vectors and the dot product
“single linkage”Distance between clusters as their closest pair (complete: farthest pair; average: mean over pairs).Taught in: Hierarchical and density-based clustering
“epsilon, min points”DBSCAN's radius and the number of points (itself included, in scikit-learn) needed within it for a core point., minPts .Taught in: Hierarchical and density-based clustering

Sums, products and indices

“the sum from i equals 1 to n of a i”Add : a for-loop with an accumulator starting at 0.Taught in: Shapes, indices and sums
“the product from i equals 1 to n of a i”Multiply : a loop whose accumulator starts at 1. Its log is a sum of logs.Taught in: Shapes, indices and sums
“x superscript i”The -th training example; the brackets say it is not a power.Taught in: Reading the symbols
“W superscript l”The weights of layer (a common course convention).Taught in: Reading the symbols
“x sub t”The value at time step (also written ).Taught in: Reading the symbols
“C i j equals the sum over k of A i k B k j”Matrix product in index notation: are free (they index the result), is summed away. Count free indices to know the shape.Taught in: Shapes, indices and sums
“aggregate over the neighbours of i”A permutation-invariant aggregation (sum, mean or max) of messages from node 's neighbours.Taught in: Graph neural networks
“X of m, k, the short-time Fourier transform”The DFT of frame (hop , window of length ): how much of frequency is present in that frame.Whisper: , at 16 kHz (25 ms windows, 10 ms hop).Taught in: Speech and audio
“o plus the sum over k of s k times n k”The strided indexing formula: where item of an array lives, measured from the start of the buffer ( is the array's starting offset).Item of an int64 array sits at bytes.Taught in: Arrays: NumPy and SciPy
“x before t”All the symbols before position : (the context or history). Also written or, in Bengio et al. (2003), .For the text 'cat', at the context is 'ca'.Taught in: Predicting the next letter
“tau H of m (growth function)”The largest number of distinct labellings the class can produce on any points. Written by Mohri et al.Sauer–Shelah: if , .Taught in: VC dimension

Vectors and matrices

“rho of W, the spectral radius”The largest absolute value of the eigenvalues of a square matrix . It governs whether shrinks () or can grow ().For with orthogonal, .Taught in: Recurrent networks
“a Hadamard b (elementwise product)”Elementwise multiplication of two vectors of the same shape. Gates act on signals this way.Taught in: LSTM and GRU
“x transpose”Turns a column vector into a row; swaps a matrix's rows and columns. Also written or .Taught in: Reading the symbols
“the inner product of x and y”, also written : two vectors in, one number out.Taught in: Reading the symbols
“the two-norm of x”Euclidean length ; a bare usually means this.Taught in: Reading the symbols
“the one-norm of x”.Taught in: Reading the symbols
“A Hadamard B”Element-wise product of same-shaped arrays. NumPy: A * B.Taught in: Reading the symbols
“n by k times k by m gives n by m”The shape rule of matrix multiplication: inner sizes must match and disappear.Taught in: Shapes, indices and sums
“the n by n identity”The square matrix with ones on the diagonal and zeros elsewhere.Taught in: Reading the symbols
“Mahalanobis distance” for a positive definite matrix ; gives Euclidean distance.With , a difference of 1 in the second feature counts as much as 4 in the first.Taught in: Nearest neighbours and naive Bayes
“k of x and x prime”A kernel: a similarity equal to an inner product in some feature space. Valid kernels make every Gram matrix positive semidefinite.RBF: .Taught in: Support vector machines and kernels
“the Gram matrix”The matrix of kernel values between all pairs of training points.Kernel ridge regression: .Taught in: Support vector machines and kernels
“f of P X, P A P transpose equals P f of X, A”Permutation equivariance: relabelling a graph's nodes (permutation matrix ) relabels a node-level output the same way.A graph-level readout instead satisfies (invariance).Taught in: Graph neural networks
“A tilde, D tilde”The adjacency matrix with self-loops, and its diagonal degree matrix (each node's degree plus one).Taught in: Graph neural networks
“r hat u i”Biased matrix factorisation: global mean plus user and item biases plus the dot product of user and item latent factors.Taught in: Recommender systems
“s i j”Cosine similarity between normalised image embedding and text embedding ; CLIP's logits are .Taught in: Multimodal models
“s sub k, the stride of axis k”How far to move in memory when the index along axis increases by one. NumPy counts strides in bytes, PyTorch in elements. Zero means the axis is broadcast; negative means it runs backwards.An int64 array of shape in C order has strides bytes; its transpose has .Taught in: Arrays: NumPy and SciPy
“item size times the product of the sizes after axis k”The stride of axis for a freshly created row-major (C-order) array with shape .float32 (4 bytes), shape : strides .Taught in: Arrays: NumPy and SciPy
“y hat equals w transpose x plus b”The linear model: a weighted sum of the features plus a bias. With a leading 1 appended to it becomes a single dot product .With , and : .Taught in: Linear regression
“X theta”All predictions at once: the data (design) matrix , one example per row with a leading column of ones, times the parameter vector. is and is , so is .Taught in: Linear regression
“X transpose X theta hat equals X transpose y”The normal equations: the gradient of the squared error is zero, equivalently the residual is orthogonal (normal) to every column of .With one feature and an intercept they give and .Taught in: The closed form: normal equations
“theta hat equals X transpose X inverse, X transpose y”The closed-form (OLS) least-squares solution, valid when the columns of are linearly independent. Compute it with QR or the SVD (np.linalg.lstsq), not an explicit inverse.One column , no intercept: .Taught in: The closed form: normal equations
“X plus, the pseudoinverse of X”The Moore–Penrose pseudoinverse. is the least-squares solution of smallest norm, defined even when is singular. Via the SVD, .If has independent columns, .Taught in: The closed form: normal equations
“the hat matrix”The orthogonal projection onto the column space of : it maps the targets to the fitted values, . Symmetric, and .Projecting twice changes nothing: .Taught in: The closed form: normal equations
“kappa of A, the condition number”The ratio of the largest to the smallest singular value; large values mean a nearly singular matrix whose solutions are sensitive to small errors. For a Hessian, the ratio of extreme eigenvalues, which controls how fast gradient descent converges., so forming squares it.Taught in: The closed form: normal equations
“cosine similarity of q and d”The dot product of two vectors divided by the product of their lengths: the cosine of the angle between them. For unit-length embeddings it is just the dot product.Dense retrieval returns the documents whose embeddings have the highest cosine similarity to the query's.Taught in: Embeddings, retrieval and RAG
“A is positive semidefinite”The symmetric matrix has for every , equivalently all its eigenvalues are . means ; is the strict (positive definite) version.A twice-differentiable is convex exactly when everywhere.Taught in: Convexity
“A Kronecker B”The Kronecker product: the block matrix whose block is . Satisfies , which is why K-FAC can invert large curvature blocks cheaply.Taught in: Newton, quasi-Newton and natural gradients
“the infinity norm of delta is at most epsilon”An adversarial budget: no input coordinate (pixel) may change by more than .CIFAR-10 attacks commonly use .Taught in: Adversarial examples and robustness
“Phi plus (pseudo-inverse)”The Moore–Penrose pseudo-inverse. is the least-squares solution, and the minimum-norm one when there are many. over non-zero singular values.Taught in: Double descent
“sigma min of Phi”The smallest non-zero singular value of the feature matrix; it approaches zero near the interpolation threshold, which amplifies noise.Dividing noise by multiplies it by a thousand.Taught in: Double descent
“x sub i”The -th component (entry) of the vector , a single number, so written in italic.If then and .Taught in: Vectors and the dot product
“the two-norm of x”Euclidean (straight-line) length: . Plain usually means this one..Taught in: Vectors and the dot product
“the one-norm of x”Taxicab length: the sum of absolute values of the components. Used for L1 (lasso) penalties..Taught in: Vectors and the dot product
“the infinity-norm of x”The largest absolute component..Taught in: Vectors and the dot product
“a dot b”The dot product: . A single number that is large when the vectors point the same way..Taught in: Vectors and the dot product
“the inner product of a and b”Another way to write the dot product (and its generalisations)..Taught in: Vectors and the dot product
“a transpose b”The dot product written as a matrix product: a row times a column.Attention scores are a table of such products.Taught in: Vectors and the dot product
“cosine similarity”Cosine similarity: the dot product with lengths divided out, between and .A vector and times itself have cosine similarity .Taught in: Vectors and the dot product
“projection of b onto a”The closest point to on the line through : ..Taught in: Vectors and the dot product
“the span of v and w”Every vector reachable as a linear combination .Two non-parallel vectors in the plane span the whole plane.Taught in: Vectors and the dot product
“A is an m by n real matrix”A matrix with rows and columns; as a transformation it maps . Its columns are where the basis vectors land.A layer mapping 784 inputs to 128 outputs has a matrix (in the convention).Taught in: Matrices as transformations
“A i j”The entry of in row , column ..Taught in: Matrices as transformations
“A B”Matrix product = composition: apply first, then . Needs inner dimensions to match: . In general .Shear after rotation differs from rotation after shear.Taught in: Matrices as transformations
“A transpose”Rows and columns swapped: .Gradients through a layer flow back through .Taught in: Matrices as transformations
“determinant of A”The factor by which scales area (volume); negative if it flips orientation; zero if it squashes space flat. Also written ..Taught in: Matrices as transformations
“A inverse”The transformation that undoes : . Exists exactly when .Solve as (in code: np.linalg.solve).Taught in: Matrices as transformations
“the identity matrix”The matrix that leaves every vector unchanged: ones on the diagonal, zeros elsewhere..Taught in: Matrices as transformations
“rank of A”The dimension of the column space: how many independent directions survive the transformation.A matrix that squashes the plane onto a line has rank 1.Taught in: Matrices as transformations
“the kernel (null space) of A”All inputs that sends to zero. Rank–nullity: . sends every multiple of to zero.Taught in: Matrices as transformations
“element-wise (Hadamard) product”Multiply two same-shaped arrays entry by entry.Backprop through an activation: .Taught in: Matrix calculus you actually need
“A v equals lambda v”The eigenvalue equation: (nonzero) is an eigenvector, a direction only stretches, by the eigenvalue . has eigenvalues and .Taught in: Eigenvectors, SVD and PCA
“A equals Q Lambda Q transpose”Spectral decomposition of a symmetric matrix: orthonormal eigenvectors in , real eigenvalues on the diagonal of .Every covariance matrix has one.Taught in: Eigenvectors, SVD and PCA
“A equals U Sigma V transpose”Singular value decomposition: rotate (), stretch by singular values (), rotate (). Exists for every real matrix.PCA directions are the columns of for centred data.Taught in: Eigenvectors, SVD and PCA
“sigma sub i”The -th singular value, sorted . (In statistics, alone is a standard deviation.).Taught in: Eigenvectors, SVD and PCA
“the Frobenius norm of A”.Truncated SVD error: .Taught in: Eigenvectors, SVD and PCA
“the spectral norm of A”The most can lengthen a unit vector: its largest singular value. Also .Eckart–Young: .Taught in: Eigenvectors, SVD and PCA
“trace of A”Sum of the diagonal entries; equals the sum of the eigenvalues.Total variance of a dataset = of its covariance.Taught in: Eigenvectors, SVD and PCA
“W, w i j”The weight (affinity) matrix of a similarity graph: is the strength of the edge between points and .A Gaussian kernel .Taught in: Spectral clustering and graph Laplacians
“D”The degree matrix: on the diagonal.Taught in: Spectral clustering and graph Laplacians
“L equals D minus W”The graph Laplacian. ; its zero eigenvalues count connected components.Taught in: Spectral clustering and graph Laplacians
“L sym”The symmetric normalised Laplacian used by the Ng–Jordan–Weiss algorithm ( is the random-walk version).Taught in: Spectral clustering and graph Laplacians
“indicator of S”The indicator vector of a set of nodes: 1 on , 0 elsewhere.Taught in: Spectral clustering and graph Laplacians

Calculus

“the product of the step-to-step Jacobians”How a late state depends on an early one. A long product of Jacobians tends to vanish or explode: the core difficulty of training RNNs.For a tanh RNN each factor is .Taught in: Recurrent networks
“d f d x”The derivative of a one-input function with respect to .Taught in: Reading the symbols
“partial f partial x j”How changes when only moves, all other inputs held fixed.Taught in: Reading the symbols
“a plus b epsilon, with epsilon squared equal to zero”A dual number: a primal value carrying a tangent . Arithmetic on dual numbers applies the chain rule automatically — the basis of forward-mode autodiff.; seed to read off .Taught in: Autodiff from scratch
“v bar, the adjoint of v”The adjoint of an intermediate value : , the sensitivity of the final output to . Reverse mode computes adjoints from the output backwards, summing over every place is used.For : .Taught in: Autodiff from scratch
“x dot, a tangent”A tangent vector: a direction in input space along which forward mode differentiates.A one-hot makes one column of the Jacobian.Taught in: Autodiff from scratch
“J times x dot, a Jacobian-vector product”A JVP: what forward-mode autodiff computes in one pass, about as costly as evaluating the function a few times. JAX writes it .For , three JVPs give the whole Jacobian.Taught in: Autodiff from scratch
“y bar transpose times J, a vector-Jacobian product”A VJP: what reverse-mode autodiff (backpropagation) computes in one backward pass. For a scalar loss with it is the whole gradient. JAX writes it , with a cotangent.One VJP of a training loss gives for all parameters at once.Taught in: Autodiff from scratch
“partial f of x, the Jacobian of f at x”JAX documentation's notation for the Jacobian of at , an matrix (or the linear map it represents).A loss has , a very wide Jacobian — reverse mode's best case.Taught in: JAX: tracing and transformations
“absolute determinant of the Jacobian of f at u”How much an invertible map scales volume near . Normalizing flows divide the base density by it: .For an affine coupling layer it is , the product of the scales.Taught in: Normalizing flows
“d x equals f dt plus g d w”A stochastic differential equation: a drift plus Brownian noise of size . Diffusion models' forward processes are SDEs of this form, reversible given the score.DDPM's limit: , .Taught in: Score matching and flow matching
“centred difference”A finite-difference estimate of a derivative, with error of order . Used to check backpropagation code.With 64-bit floats, works well.Taught in: Backpropagation
“the subdifferential of h at x”The set of subgradients of a convex function: slopes with for all . A single gradient where is differentiable, an interval at a kink. at is .Taught in: Constraints, projections and proximal methods
“f prime of x; d f d x”The derivative: how much changes per unit nudge of . .For , .Taught in: Derivatives, gradients and the chain rule
“partial f partial x i”Partial derivative: nudge only , hold the other inputs fixed.For : .Taught in: Derivatives, gradients and the chain rule
“grad f, or nabla f”The gradient: the vector of partial derivatives, same shape as the input. Points in the direction of steepest ascent, perpendicular to contour lines. has .Taught in: Derivatives, gradients and the chain rule
“grad of L with respect to theta”Gradient of the loss with respect to the parameters; the subscript says which variables are nudged.Gradient descent: .Taught in: Derivatives, gradients and the chain rule
“directional derivative of f along u”Rate of change of moving in unit direction : .Largest when points along .Taught in: Derivatives, gradients and the chain rule
“the Jacobian of f with respect to x”The Jacobian: an matrix with entries (numerator layout). The matrix of the best local linear approximation.The Jacobian of is .Taught in: Matrix calculus you actually need
“J f of x”Another name for the Jacobian of at . Chain rule: . is the local area scaling of a map.Taught in: Matrix calculus you actually need
“d L by d W”Gradient of a scalar with respect to a matrix: same shape as , entry is .For : .Taught in: Matrix calculus you actually need

Probability and statistics

“mu”A mean (bold for a mean vector). is a Gaussian with mean .Taught in: Reading the symbols
“sigma”A standard deviation — or, written as a function , the logistic sigmoid.Taught in: Reading the symbols
“p of y given x”The probability of given . Different from .Taught in: Reading the symbols
“p of x, parametrised by theta”A distribution whose shape is set by ; also written .Taught in: Reading the symbols
“x is distributed as p” is a random draw from the distribution .Taught in: Reading the symbols
“P of y given do x”The interventional distribution: the distribution would have if were set to by an outside action, for every unit. Not the same as .If a hidden cause drives both and , reflects it but does not.Taught in: Interventions and the do-operator
“X j is assigned f j of its parents and its noise”One assignment of a structural causal model: a variable is computed from its direct causes and an independent noise term. The marks an assignment, not an equation. says is computed from , not the reverse.Taught in: Causal graphs and d-separation
“the parents of j”The direct causes of variable in a causal graph: the nodes with an arrow into .In , .Taught in: Causal graphs and d-separation
“X and Y are d-separated by S in G”d-separation: every path between and in the graph is blocked by . It implies conditional independence in any distribution generated by the graph.In , and are d-separated by the empty set but not by .Taught in: Causal graphs and d-separation
“M sub x; G with X over-barred”The model after the intervention , and its graph: all arrows into deleted (graph surgery). deletes the arrows out of .Randomising a treatment turns the graph into .Taught in: Interventions and the do-operator
“Y i of one, Y i of zero”Potential outcomes: what unit 's outcome would be under treatment and under control. Only one is ever observed.A patient's blood pressure with the drug, , and without it, .Taught in: Potential outcomes and treatment effects
“tau i”The individual treatment effect. Never observable, by the fundamental problem of causal inference.If and , then .Taught in: Potential outcomes and treatment effects
“A T E, A T T”Average treatment effect over everyone, and the average among the treated, .In a trial, the difference in mean outcomes between arms estimates the ATE.Taught in: Potential outcomes and treatment effects
“tau of x”The conditional average treatment effect (CATE): the average effect among units with covariates . Used for personalisation and uplift modelling.A campaign might have for persuadables and for sleeping dogs.Taught in: Potential outcomes and treatment effects
“e of x, the propensity score”The probability of receiving treatment given the covariates. Units with the same propensity score have the same covariate distribution in both arms.Inverse propensity weighting gives each treated unit weight .Taught in: Potential outcomes and treatment effects
“the potential outcomes are independent of treatment given X”Ignorability (unconfoundedness): among units with the same covariates, treatment is as good as random. Untestable from data.Holds by design in a trial randomised within strata of .Taught in: Potential outcomes and treatment effects
“theta hat D M L”The double/debiased machine learning estimate: regress the outcome residual on the treatment residual , with both nuisance models cross-fitted.With lasso nuisance models it corrects the shrinkage bias of a single lasso.Taught in: Causal discovery and causal ML
“h of W”The NOTEARS acyclicity function: zero exactly when the weighted adjacency matrix has no directed cycles.For a single edge , is nilpotent, so and .Taught in: Causal discovery and causal ML
“p of x given y equals the product over j of p of x j given y”The naive Bayes assumption: features are conditionally independent given the class.For two binary words with and , the model gives .Taught in: Nearest neighbours and naive Bayes
“Gini impurity”Impurity of a tree node with class proportions : the chance of mislabelling a random example if labels were drawn from the node's proportions.A node with 5 blue and 5 gold examples has ; a pure node has .Taught in: Decision trees
“rho sigma squared plus one minus rho over B sigma squared”Variance of an average of estimators with variance and pairwise correlation .With , , : variance ; it can never fall below .Taught in: Bagging and random forests
“out-of-bag”Training examples left out of a given bootstrap sample (about 37% of them); predicting each example with only the trees that did not see it gives an error estimate..Taught in: Bagging and random forests
“g of mu equals eta”The link function of a GLM: connects the mean response to the linear predictor .Poisson regression uses the log link, .Taught in: Generalized linear models
“A of theta”The log-partition function of an exponential family; its derivatives give the mean, , and variance, .Poisson: , so mean = variance = .Taught in: Generalized linear models
“deviance”Twice the log-likelihood gap between the saturated model and the fitted model; for a Gaussian it is the residual sum of squares.Poisson unit deviance: .Taught in: Generalized linear models
“intersection over union”Area of overlap of two boxes divided by the area of their union; 1 for identical boxes, 0 for disjoint ones. Detections count as correct above a threshold.COCO's AP averages over IoU thresholds .Taught in: Vision transformers, detection and segmentation
“A P fifty, A P seventy-five, A P small”Average precision at IoU threshold 0.50 or 0.75, or restricted to small objects (area below pixels). Plain “AP” in COCO averages over IoU thresholds and categories.Taught in: Vision transformers, detection and segmentation
“the CTC probability”Probability of transcript : the sum over all frame-level alignments that collapse to (merge repeats, drop blanks) of the product of per-frame probabilities.Taught in: Speech and audio
“word error rate”Substitutions, deletions and insertions in the best word alignment, divided by the number of reference words. Can exceed 1.Taught in: Speech and audio
“r k, the autocorrelation at lag k”Sample correlation between a series and itself shifted by steps.For an AR(1) with coefficient , the autocorrelation at lag is .Taught in: Time series and forecasting
“ARIMA p d q”An autoregressive model of order with moving-average (past error) terms, fitted to the series differenced times.Taught in: Time series and forecasting
“mean absolute scaled error”Out-of-sample mean absolute error divided by the in-sample mean absolute error of the seasonal-naive forecast (M4 definition).Taught in: Time series and forecasting
“symmetric mean absolute percentage error”A percentage error between 0 and 200, as defined in the M4 competition code.Taught in: Time series and forecasting
“N D C G at k”Discounted cumulative gain of the top (relevance divided by ), divided by its ideal value; between 0 and 1.Taught in: Recommender systems
“recall at k”Fraction of a user's relevant items that appear in the top recommendations.Taught in: Recommender systems
“true positives, false positives, false negatives, true negatives”The four cells of a binary confusion matrix: counts of each combination of true label and predicted label.A false negative is a positive example predicted as negative.Taught in: Precision, recall and ROC
“true-positive rate”Recall or sensitivity: the fraction of actual positives the classifier flags. It does not depend on how common positives are.Catching 90 of 100 sick patients gives TPR = 0.9.Taught in: Precision, recall and ROC
“false-positive rate”The fraction of actual negatives wrongly flagged; one minus the specificity. The x-axis of a ROC curve.Flagging 9 of 100 healthy people gives FPR = 0.09.Taught in: Precision, recall and ROC
“precision”Of the examples flagged positive, the fraction that really are. It depends on the prevalence.90 true positives among 981 flagged gives precision 0.092.Taught in: Precision, recall and ROC
“F beta”A weighted harmonic mean of precision and recall; says how many times more recall matters than precision. weighs them equally..Taught in: Precision, recall and ROC
“area under the ROC curve”The probability that a randomly chosen positive gets a higher score than a randomly chosen negative (ties count half).0.5 for random scores, 1 for a perfect ranking.Taught in: Precision, recall and ROC
“R squared”One minus the ratio of a regression model's squared error to that of predicting the mean. Can be negative.Predicting the mean everywhere gives .Taught in: Precision, recall and ROC
“calibration”A model is calibrated if, among inputs where it predicts probability , a fraction are positive.Of days forecast at 70% rain, it rains on about 70%.Taught in: Calibration and proper scoring rules
“expected calibration error”The bin-size-weighted average gap between confidence and observed frequency (or accuracy) in a reliability diagram. Depends on binning and sample size.ECE = 0.02 means predictions are off by about 2 points on average.Taught in: Calibration and proper scoring rules
“Brier score”Mean squared error between predicted probabilities and 0/1 outcomes: a proper scoring rule.Its expectation is , smallest at .Taught in: Calibration and proper scoring rules
“importance weight”The density ratio between target and source input distributions; weighting training losses by it corrects for covariate shift.Estimated from a classifier that tells source from target inputs.Taught in: Imbalance and distribution shift
“source and target distributions”The distribution a model was trained (and usually tested) on, and the one it is deployed on.Covariate shift: but .Taught in: Imbalance and distribution shift
“standard error of p hat”The standard deviation of a measured accuracy across test sets of size ., : se = 0.003.Taught in: How sure are you? Bootstrap and tests
“discordant counts”In McNemar's test, the numbers of test examples where only model B, or only model A, is correct. Only these carry information about which is better.Under no difference, .Taught in: How sure are you? Bootstrap and tests
“p data of x; p theta of x”The (unknown) distribution the data came from, and the model's distribution with parameters . A generative model tries to make close to . Diffusion papers write the data side as .Maximum likelihood minimises .Taught in: What generative modelling is
“Fréchet Inception Distance” for Gaussians fitted to Inception-network features of real and generated images. Lower is better; depends on sample size and implementation.Two samples from the same distribution give FID near 0 only when the samples are large.Taught in: What generative modelling is
“p theta of x given z”A VAE's decoder (generative network): a distribution over data given a latent code.A Bernoulli probability for each pixel, output by a network from .Taught in: Autoencoders and VAEs
“the ELBO, L of theta and phi at x”The evidence lower bound of a VAE: . It is at most , and the gap is the KL from the encoder to the true posterior.The toy VAE of the lesson reaches a negative ELBO of about 23.9 nats per digit image.Taught in: Autoencoders and VAEs
“Wasserstein-1 distance, earth mover's distance”The least total mass-times-distance needed to move onto ; equivalently the largest over 1-Lipschitz . Used by Wasserstein GANs.A distribution and a copy shifted by are apart.Taught in: Generative adversarial networks
“beta t, alpha t, alpha bar t”A diffusion model's noise schedule: is the noise added at step , , and is the fraction of signal variance left after steps.DDPM: rises linearly from to over steps, giving .Taught in: Diffusion models
“the score; grad x of log p of x”The score function: the gradient of the log-density with respect to the data. It does not depend on the normalising constant. (Not the Fisher score .)For the score is .Taught in: Score matching and flow matching
“the energy E theta of x; the partition function Z theta”An energy-based model defines with any network ; is usually intractable.Adding two energies multiplies the densities (a product of experts).Taught in: Score matching and flow matching
“p of x t given x before t”The probability of the next symbol given everything before it. By the chain rule, a language model that supplies these can assign a probability to any text: . is close to 1.Taught in: Predicting the next letter
“the count of w t minus one followed by w t”How many times a sequence occurs in the training text. An n-gram model estimates ; add-one smoothing uses .If 'the' occurs 100 times and 'the cat' 5 times, the bigram estimate of is 0.05.Taught in: From n-grams to neural language models
“R of h”True risk (generalization error) of a hypothesis: the probability it misclassifies a fresh example from the data distribution. Written in Shalev-Shwartz & Ben-David.A threshold that disagrees with the truth on 5% of inputs has .Taught in: PAC learning
“R hat S of h”Empirical risk (training error): the fraction of the sample that gets wrong. Also .3 mistakes on 100 examples: .Taught in: PAC learning
“epsilon, delta”PAC accuracy and confidence: with probability at least over the sample, the learned hypothesis has error at most (or within of the best in the class)., .Taught in: PAC learning
“n sub H of epsilon, delta”Sample complexity: the number of examples that suffices to learn to accuracy with confidence . Written in most texts.Finite class, realizable: at most .Taught in: PAC learning
“empirical Rademacher complexity of H on S”The expected best correlation between the class's outputs on the sample and independent random signs: how well the class fits noise on your inputs.Any class that fits every labelling of the sample has .Taught in: Rademacher complexity and generalization bounds
“sigma i (Rademacher variable)”A fair random sign, or with probability each.Coin flips used as fake labels to measure capacity.Taught in: Rademacher complexity and generalization bounds
“approximation error, estimation error”The risk of ERM splits into the best risk achievable in the class (approximation) and the excess due to learning from a sample (estimation).More data shrinks ; only a better class shrinks .Taught in: No free lunch and inductive bias
“r i equals y i minus y hat i”The residual of example : measured value minus prediction. Positive when the point lies above the fitted line.If and , then .Taught in: Linear regression
“the log-odds, or logit, of p”The inverse of the sigmoid. Logistic regression models the log-odds of class 1 as a linear function, . gives log-odds 0; gives .Taught in: Logistic regression and softmax
“noise plus bias squared plus variance”The decomposition of expected squared test error at an input: irreducible noise, the squared gap between the average prediction and the truth, and the spread of predictions across training sets.A degree-11 polynomial through 12 noisy points: tiny bias, enormous variance.Taught in: Generalization, bias–variance and regularization
“f bar of x, the average prediction”The model's prediction at averaged over all training sets it might have been trained on. Bias compares it with the truth; variance measures spread around it.Taught in: Generalization, bias–variance and regularization
“K-fold cross-validation”Split the training data into folds; train on , validate on the remaining one, rotate through all , and average. Used to choose hyperparameters such as without touching the test set. with 30 examples: five rounds, each validating on 6 examples.Taught in: Generalization, bias–variance and regularization
“softmax with temperature T”Softmax of logits at temperature . In distillation the teacher's outputs at a high are the student's soft targets; higher gives a flatter distribution.Hinton et al. multiply the soft-target gradients by because they shrink like .Taught in: Quantization and distillation
“p eta of z given x”In RAG, the retriever: a distribution over passages given the input , proportional to . Paired with a generator .RAG-Sequence: .Taught in: Embeddings, retrieval and RAG
“inverse document frequency of w”A weight that grows as a word gets rarer in the collection; in Lucene's BM25, for of documents containing .A word in every document gets an idf near 0; a word in one document of 1,000 gets about 6.5.Taught in: Embeddings, retrieval and RAG
“pass hat k”The chance that all independent attempts at a task succeed, averaged over tasks; estimated as from successes in trials. A reliability metric, unlike pass@k.A task solved 7 times in 10 has pass@1 = 0.7 but pass^8 = 0.Taught in: Agents and tool use
“standard error of a benchmark score”The standard error of an accuracy measured on questions scored 0 or 1. A 95% interval is about .70% on 1,000 questions: points, so points at 95%.Taught in: Evaluating language models
“sigma of xi m minus xi m prime”The Bradley–Terry probability that model beats model in a pairwise vote, from their strengths . Chatbot Arena fits the by logistic regression on votes.Equal strengths give a 50% win probability; a difference of 1 gives about 73%.Taught in: Evaluating language models
“the Fisher information matrix”The expected outer product of the score, with outcomes drawn from the model; equals minus the expected Hessian of the log-likelihood. Measures how fast the model's distribution changes with its parameters.For in : .Taught in: Newton, quasi-Newton and natural gradients
“mu k”The centroid of cluster in k-means: the mean of the points assigned to it.Taught in: Three kinds of learning signal
“p of theta given D”The posterior: your belief about the parameters after seeing the data; proportional to likelihood times prior.With a flat prior and 4 heads in 4 flips, .Taught in: Bayesian inference
“p of D, the evidence”The evidence or marginal likelihood : the probability a model gave the data, averaged over its prior. Normalises the posterior and scores whole models.A fair-coin model gives any sequence of 10 flips evidence .Taught in: Bayesian inference
“beta of theta with a and b”A distribution over a probability ; conjugate to Bernoulli data, so heads add to and tails to (pseudo-counts). after 7 heads and 3 tails; mean .Taught in: Bayesian inference
“p of y star given D, the posterior predictive”The probability of a new observation, averaging the model's prediction over the posterior: .For a coin with a flat prior: , Laplace's rule of succession.Taught in: Bayesian inference
“x i given its parents”A node's conditional distribution in a Bayes net, given the values of its parents; the joint is the product of these over all nodes..Taught in: Graphical models
“A is independent of B given C”Conditional independence: once is known, learning tells you nothing more about . Also written with a double bar, .In a chain : .Taught in: Graphical models
“psi c”A potential (factor): a non-negative compatibility score on the variables of clique in a Markov random field.Ising model: if neighbouring spins agree, if not.Taught in: Graphical models
“Z, the partition function”The normalising constant of an undirected model: the sum over all configurations of the product of potentials..Taught in: Graphical models
“the message from s to t”In belief propagation, what the part of the graph behind node says about node 's value.On a tree, two sweeps of messages give every node's exact marginal.Taught in: Graphical models
“alpha t of j”The forward (filtering) probability in an HMM: (some texts use the unnormalised joint ).In the lesson's example, after hearing silence the state Asleep has .Taught in: Latent variables, HMMs and Kalman filters
“delta t of j”Viterbi score: the probability of the best hidden path ending in state at time , jointly with the observations so far..Taught in: Latent variables, HMMs and Kalman filters
“A i j, B j k”HMM transition probability and emission probability .Each row of and of sums to 1.Taught in: Latent variables, HMMs and Kalman filters
“K t, the Kalman gain”How much of the innovation (observed minus expected reading) the Kalman filter adds to its state estimate.1-D: prediction variance 4, sensor variance 1 gives .Taught in: Latent variables, HMMs and Kalman filters
“mu and sigma, t given t minus 1”Mean and covariance of the predicted state at time using observations up to (also written , )..Taught in: Latent variables, HMMs and Kalman filters
“the ELBO”The evidence lower bound ; equals minus .Maximising it over is variational inference.Taught in: Variational inference
“q phi of z given x”A variational (approximate) posterior with parameters ; amortised when a network outputs from .A diagonal Gaussian in a VAE.Taught in: Variational inference
“z equals mu plus sigma times epsilon”The reparameterisation trick: write a sample as a differentiable function of parameters and parameter-free noise , so gradients flow through it.torch.distributions.Normal(mu, s).rsample().Taught in: Variational inference
“A of theta prime given theta”Metropolis–Hastings acceptance probability ; the normalising constant cancels.Symmetric proposal: accept uphill moves always, downhill ones with probability .Taught in: Markov chain Monte Carlo
“R hat”Potential scale reduction factor: compares between-chain and within-chain variance of several MCMC chains; near 1 when they agree.Current advice (Vehtari et al., 2021): use the sample only if .Taught in: Markov chain Monte Carlo
“H of theta and v, the Hamiltonian”Total energy in HMC: potential plus kinetic .Leapfrog nearly conserves , so HMC proposals are usually accepted.Taught in: Markov chain Monte Carlo
“f is drawn from a Gaussian process with mean m and kernel k”A distribution over functions: the values at any finite set of inputs are jointly Gaussian with means and covariances .Zero mean and an SE kernel give smooth random functions.Taught in: Gaussian processes
“k of x and x prime, the kernel”A positive-definite covariance function: how correlated the function values at two inputs are. Choosing it is choosing a prior over functions.SE kernel: .Taught in: Gaussian processes
“ell, the length-scale”In a stationary kernel, how far apart two inputs must be before their function values become nearly unrelated.Short : wiggly functions. Long : nearly straight ones.Taught in: Gaussian processes
“U is independent of V given W”Conditional independence: once is known, tells you nothing more about . Group-fairness criteria are written this way.Separation (equalized odds): .Taught in: Fairness
“the probability of a positive decision in group a”A group's selection rate; demographic parity asks that it be equal across groups.Equal selection rates for two groups of loan applicants.Taught in: Fairness
“Chouldechova's identity”Links a group's false-positive rate to its prevalence , positive predictive value and false-negative rate; with equal PPV and FNR, different prevalences force different FPRs.Prevalences 0.51 and 0.39 force an FPR ratio of about 1.63.Taught in: Fairness
“epsilon delta differential privacy”For all neighbouring datasets and all output sets, .Abadi et al. trained MNIST to 97% accuracy at -DP.Taught in: Privacy and differential privacy
“the sensitivity of f”The largest change in a query's answer caused by changing one record. Sets the scale of privacy noise.A count has .Taught in: Privacy and differential privacy
“Laplace with scale b”The Laplace distribution with density ; adding noise gives -DP. on a count: noise scale .Taught in: Privacy and differential privacy
“ensemble predictive variance”A deep ensemble's variance: average predicted noise (aleatoric) plus disagreement between members (epistemic).Far from the training data the second term dominates.Taught in: Uncertainty in deep learning
“q hat”In split conformal prediction: the -th smallest calibration score, used as the threshold for prediction sets., : the 46th smallest score.Taught in: Uncertainty in deep learning
“the conformal coverage guarantee”Split-conformal prediction sets cover the true label with probability at least (marginally, for exchangeable data), whatever the model.90% intervals from 200 calibration points.Taught in: Uncertainty in deep learning
“p over n”Parameters (or features) per training example; the interpolation threshold of least-squares models is at . Often written or .20 random features for 20 points: , the peak of double descent.Taught in: Double descent
“p of N to the L”Exact-match accuracy on an -token answer if each token is right with probability independently — a sharp function of a smooth one. but .Taught in: Scaling laws and their limits
“omega”The sample space: the set of all possible outcomes of an experiment.Two dice: 36 outcomes.Taught in: Probability as bookkeeping
“probability of E”Probability of an event . Non-negative, , additive over disjoint events (Kolmogorov's axioms)..Taught in: Probability as bookkeeping
“X is distributed as p”The random variable has distribution (a pmf or pdf)..Taught in: Probability as bookkeeping
“p of x and y”Joint distribution. Sum rule: . Product rule: .Independence means .Taught in: Probability as bookkeeping
“p of y given x”Conditional distribution of once is known: .A classifier outputs .Taught in: Probability as bookkeeping
“Bayes' rule”Posterior = likelihood × prior / evidence.A positive test for a rare condition can still mean a low posterior.Taught in: Probability as bookkeeping
“expected value of X”The probability-weighted average of : or . Linear.A fair die has .Taught in: Probability as bookkeeping
“expectation of f of x, x drawn from p”Average of over samples from ; the subscript names the distribution.The training loss is .Taught in: Probability as bookkeeping
“variance of X”Average squared distance from the mean, . Square root: standard deviation .Variance of an average of i.i.d. draws: .Taught in: Probability as bookkeeping
“covariance of X and Y”: how two variables move together. Zero covariance does not imply independence..Taught in: Probability as bookkeeping
“capital sigma (covariance matrix)”Covariance matrix of a random vector: . Symmetric, positive semidefinite. (In an SVD, instead holds singular values.)Its eigenvectors are the axes of a Gaussian's density ellipses.Taught in: Probability as bookkeeping
“normal with mean mu and variance sigma squared”The Gaussian distribution. The second argument is the variance (some software takes the standard deviation instead). puts about 95% of its probability within .Taught in: Probability as bookkeeping
“multivariate normal with mean mu and covariance Sigma”The multivariate Gaussian; density .Contours of constant density are ellipses.Taught in: Probability as bookkeeping
“independent and identically distributed”Each sample drawn independently from the same distribution; makes a dataset's likelihood a product.The CLT and LLN are stated for i.i.d. samples.Taught in: Probability as bookkeeping
“X bar n”The average of the first samples. By the LLN it converges to ; by the CLT it is approximately .The average of 100 die rolls has standard deviation about .Taught in: Probability as bookkeeping
“the likelihood of theta”The likelihood: probability of the observed data as a function of the parameters. Not a distribution over .For heads in flips, .Taught in: Maximum likelihood: where losses come from
“the log-likelihood”Log of the likelihood: same maximiser, turns products into sums, avoids underflow. Minus it is the NLL..Taught in: Maximum likelihood: where losses come from
“theta hat M L E”Maximum-likelihood estimate: the parameters that make the observed data most probable.For a coin, .Taught in: Maximum likelihood: where losses come from
“theta hat M A P”Maximum a posteriori estimate: the peak of likelihood × prior. A Gaussian prior on weights gives an L2 penalty.With a Beta prior: .Taught in: Maximum likelihood: where losses come from
“p theta of x t given x before t”A language model's next-token distribution given the preceding tokens; multiplying these over gives the probability of a whole sequence.Training minimises averaged over positions.Taught in: GPT and next-token prediction
“s of i”The silhouette of point : is its mean distance to its own cluster, to the nearest other cluster. Between and ., gives .Taught in: k-means, properly
“p of x equals the sum over k of pi k times a Gaussian”A Gaussian mixture: Gaussians with weights that sum to 1.Two components with .Taught in: Gaussian mixtures and EM
“pi k”A mixing weight: the prior probability that a point comes from component .: 30% of points come from component 2.Taught in: Gaussian mixtures and EM
“r i k”The responsibility: posterior probability that component generated point . Sums to 1 over ..Taught in: Gaussian mixtures and EM
“N k”The effective number of points in component during EM.Responsibilities give .Taught in: Gaussian mixtures and EM
“ELBO”Evidence lower bound: , with equality when is the posterior.Taught in: Gaussian mixtures and EM
“B I C”Bayesian information criterion (scikit-learn's sign convention: lower is better); is the number of free parameters.Taught in: Gaussian mixtures and EM
“p of j given i”In SNE/t-SNE: the probability that point picks as its neighbour, from a Gaussian of width .Taught in: t-SNE, UMAP and manifold learning
“q i j”In t-SNE: the similarity of map points and under a Student-t (Cauchy) kernel, normalised over all pairs.Taught in: t-SNE, UMAP and manifold learning
“p hat h of x”The kernel density estimator with kernel and bandwidth .Taught in: Density estimation
“h”The bandwidth of a kernel density estimate: bias grows like , variance like .Silverman: .Taught in: Density estimation
“delta squared”Squared Mahalanobis distance; for Gaussian data it follows a chi-square distribution with degrees of freedom.Taught in: Anomaly detection
“L O F k of p”Local outlier factor: average ratio of the neighbours' local densities to the point's own. About 1 for inliers.Taught in: Anomaly detection
“s of x”Isolation-forest anomaly score from the average path length : near 1 means anomalous, well below 0.5 normal; if every point scores about 0.5, there are no distinct anomalies.Taught in: Anomaly detection

Information theory

“log x”In ML papers, the natural logarithm (base ) unless stated otherwise.Taught in: Reading the symbols
“log base 2 of x”The logarithm used when information is measured in bits. bits.Taught in: Reading the symbols
“exp of x”, written this way when the exponent is long.Taught in: Reading the symbols
“information gain”The drop in entropy from a parent node to the weighted average entropy of its children after a split.Splitting (5, 5) into (4, 1) and (1, 4) gains bits.Taught in: Decision trees
“the InfoNCE loss”Cross-entropy for picking the true partner of a context among negatives; CLIP applies it in both directions over a batch.Taught in: Multimodal models
“bits per dimension”A model's negative log-likelihood of an image in bits, divided by the number of values in it (pixels times channels). Lower is better.5,000 nats for a image is bits per dimension.Taught in: What generative modelling is
“Jensen–Shannon divergence of p and q” with . Symmetric, between 0 and .Against a perfect discriminator, a GAN's generator minimises .Taught in: Generative adversarial networks
“log base two of one over p of x”The surprise (Shannon information content, surprisal) of an outcome with probability , in bits. Equal to .An outcome with carries bits; a certain outcome carries 0.Taught in: Surprise, bits and entropy
“the entropy of X”Average surprise of a random variable: bits. A lower bound on the average number of bits (yes/no questions) per outcome of any lossless code, approached by coding long blocks. Also written or .A fair coin has bit; a coin with has bits.Taught in: Surprise, bits and entropy
“H of p (binary entropy)”For a single number : the entropy of a coin that lands heads with probability , . For a distribution : its entropy. bit, the maximum for two outcomes.Taught in: Surprise, bits and entropy
“bit, nat”Units of information: a bit uses , a nat uses the natural log . 1 nat bits. ML losses are usually in nats.A loss of 2.0 nats per token is bits per token.Taught in: Surprise, bits and entropy
“F sub N”Shannon's N-gram entropy: the average uncertainty (conditional entropy) of the next symbol when the previous symbols are known. It decreases with toward the entropy rate of the source.Shannon (1951), 26 letters: , , bits per letter.Taught in: Predicting the next letter
“the cross-entropy of p and q”Average code length (bits) when outcomes come from but are coded with a code built for : . Measured on data, it is the average negative log-likelihood: the training loss of language models.Shannon's code for used on a uniform 4-letter source costs bits per letter.Taught in: Cross-entropy, KL and perplexity
“the KL divergence of p from q”Extra bits paid for coding with 's code: . Never negative (Gibbs' inequality), zero only when , not symmetric, infinite if where . Also called relative entropy.For , : bits but bits.Taught in: Cross-entropy, KL and perplexity
“perplexity”Perplexity: , the inverse probability of a text normalised by its length. The effective number of equally likely choices per symbol (a weighted average branching factor). Only comparable between models with the same vocabulary.A model with a loss of 2.0 nats per token has perplexity .Taught in: Cross-entropy, KL and perplexity
“KL divergence from prior P to posterior Q”In PAC-Bayes bounds: the price a posterior over hypotheses pays for moving away from a prior fixed before seeing the data..Taught in: Rademacher complexity and generalization bounds
“binary cross-entropy”The negative log-likelihood of a label under a Bernoulli model that predicts . Its gradient with respect to the score is ., : loss .Taught in: Logistic regression and softmax
“bits per byte”A language model's total negative log-likelihood of a text, in bits, divided by the text's length in bytes. Unlike per-token perplexity it does not depend on the tokenizer..Taught in: Evaluating language models
“E”Irreducible loss: the loss of an ideal predictor, identified with the entropy of the data; no model or dataset size can go below it. nats per token in Chinchilla's fit to its own data.Taught in: Scaling laws and their limits
“perplexity”The effective number of neighbours of point in t-SNE: two to the entropy (in bits) of its neighbour distribution.A uniform choice among 30 neighbours has perplexity 30.Taught in: t-SNE, UMAP and manifold learning

Optimization

“eta”The learning rate: the step size of gradient descent, chosen by hand.Taught in: Reading the symbols
“beta one, beta two”In Adam, the decay rates of the running averages of the gradient and its square (defaults and ).Taught in: Reading the symbols
“the minimum over x of f of x”The smallest value takes.For : .Taught in: Reading the symbols
“the arg-min over x of f of x”Where the minimum is attained — the input, not the value. Strictly a set, since several inputs can tie.For : .Taught in: Reading the symbols
“the arg-max over k”The with the largest value — for a classifier, the predicted class.Taught in: Reading the symbols
“C alpha of T”Cost-complexity of a subtree : training loss plus times the number of leaves. Pruning minimises it.Larger prunes to smaller trees; is chosen by cross-validation.Taught in: Decision trees
“F m equals F m minus one plus nu h m”One stage of boosting: add a shrunken new base learner to the model built so far.With , each tree moves predictions a tenth of the way it wants to.Taught in: Gradient boosting
“r i m”Pseudo-residual: the negative gradient of the loss with respect to the model's output for example at stage . For squared error it is the ordinary residual.For log loss, .Taught in: Gradient boosting
“w j star equals minus G j over H j plus lambda”XGBoost's optimal leaf value from a second-order expansion: sum of gradients over sum of Hessians plus the L2 penalty.For squared loss this is the leaf's summed residual divided by (number of examples + ).Taught in: Gradient boosting
“alpha i”In SVMs and kernel methods: the dual variable (Lagrange multiplier) of training example . Nonzero only for support vectors in an SVM..Taught in: Support vector machines and kernels
“xi i”Slack variable: how far example falls short of its margin in a soft-margin SVM. means example is misclassified.Taught in: Support vector machines and kernels
“hinge loss”The SVM's loss: zero beyond the margin, growing linearly inside it or on the wrong side.A point with has hinge loss .Taught in: Support vector machines and kernels
“min over G, max over D, of V”A two-player minimax game: the discriminator maximises the value function, the generator minimises it. The original GAN objective..Taught in: Generative adversarial networks
“h hat S is an empirical risk minimiser”Empirical risk minimisation (ERM): pick a hypothesis in the class with the smallest training error.The threshold with the fewest training mistakes.Taught in: PAC learning
“regret after T rounds”Online learning: the learner's total loss minus that of the best fixed expert (or action, or parameter vector) in hindsight.Exponential weights: .Taught in: Online learning and bandits
“p t i proportional to e to the minus eta L”Exponential weights (Hedge): follow expert with probability decreasing exponentially in its cumulative loss. balances the two terms of the regret bound.Taught in: Online learning and bandits
“the squared norm of y minus X theta”The sum of squared residuals (SSE, also RSS). Dividing by gives the mean squared error (MSE); both have the same minimiser.Residuals give .Taught in: Linear regression
“theta k plus one equals theta k minus eta times grad L at theta k”One step of gradient descent: move against the gradient, scaled by the learning rate .Least squares: .Taught in: Gradient descent
“eta between zero and two over lambda max”The learning rates for which gradient descent converges on a quadratic loss, where is the largest eigenvalue of the Hessian.Hessian eigenvalues 1 and 50: any converges; diverges.Taught in: Gradient descent
“the minibatch B and its size”A random subset of training examples used to estimate the gradient in stochastic / minibatch gradient descent. is SGD in the original sense; is full-batch gradient descent. and : about 32 updates per epoch.Taught in: Gradient descent
“the ridge solution”Minimiser of . The matrix is invertible for every ; each singular direction is shrunk by . recovers ordinary least squares.Taught in: Generalization, bias–variance and regularization
“lambda times the L1 norm of theta”The lasso penalty, the sum of absolute values of the weights. It sets some coefficients exactly to zero; there is no closed-form solution in general..Taught in: Generalization, bias–variance and regularization
“soft thresholding of z at tau”Shrinks toward zero by and sets it exactly to zero if . The lasso solution when the features are orthonormal, and the step used by coordinate-descent lasso solvers.: , .Taught in: Generalization, bias–variance and regularization
“sixteen psi (bytes)”GPU memory for the model states of mixed-precision Adam training: 2 bytes of weights, 2 of gradients and 12 of fp32 optimizer state per parameter, for parameters (ZeRO's notation).A 7B model needs about 112 GB of model states before any activations.Taught in: Fine-tuning and LoRA
“p minus one over m plus p minus one”The fraction of a pipeline-parallel training step spent idle (the bubble), with pipeline stages and microbatches per step., : idle; with , about 9%.Taught in: Training at scale
“model FLOPs utilization”Observed training throughput as a fraction of what the hardware's peak FLOP/s would allow, counting only the forward and backward pass (not recomputation).PaLM 540B reported 46.2%; Llama 3 405B 38–43%.Taught in: Training at scale
“momentum update”SGD with momentum (PyTorch's form): a running sum of past gradients , with momentum coefficient ; the parameters step along .With and a constant gradient, .Taught in: Training in practice
“m t, v t, m hat, v hat”Adam's running means of the gradient and of its elementwise square, and their bias-corrected versions , .Update: .Taught in: Training in practice
“f is mu-strongly convex”Strong convexity with constant : every eigenvalue of the Hessian is at least , so the function curves up at least as fast as .Ridge regression's objective is -strongly convex.Taught in: Convexity
“f is L-smooth”The gradient is -Lipschitz: it cannot change faster than times the distance moved. Then lies below a parabola of curvature on top of each tangent plane (the descent lemma).For a quadratic, of the Hessian.Taught in: Convexity
“kappa equals L over mu”The condition number of a smooth, strongly convex function: the ratio of its largest to smallest curvature. Gradient descent needs about steps; accelerated methods about .Taught in: Why SGD converges
“f star, p star, d star”Optimal values: ; in constrained problems is the primal optimum and the optimum of the dual.Weak duality says .Taught in: Lagrange multipliers, duality and KKT
“the Lagrangian”The objective plus a multiplier times each constraint function (, ). Multipliers for inequalities must be .Taught in: Lagrange multipliers, duality and KKT
“the Lagrange dual function”Minimise the Lagrangian over for fixed multipliers. Always concave, and a lower bound on whenever . Boyd and Vandenberghe write .Taught in: Lagrange multipliers, duality and KKT
“complementary slackness”At an optimum (with zero duality gap), each inequality constraint is either tight or has a zero multiplier.In an SVM, only the support vectors have .Taught in: Lagrange multipliers, duality and KKT
“the Newton step”The step to the minimum of the local quadratic (second-order Taylor) model, where is the Hessian. Exact in one step on a quadratic.Taught in: Newton, quasi-Newton and natural gradients
“J transpose J (the Gauss–Newton matrix)”For a least-squares loss with Jacobian of the residuals: the part of the Hessian built from first derivatives only. Always positive semidefinite.Taught in: Newton, quasi-Newton and natural gradients
“the secant equation”Quasi-Newton methods choose an inverse-Hessian approximation that maps the last change of gradient to the last step .Taught in: Newton, quasi-Newton and natural gradients
“the natural gradient”The gradient preconditioned by the inverse Fisher matrix: steepest descent when distance is measured by KL divergence between the model's distributions.Taught in: Newton, quasi-Newton and natural gradients
“rates of convergence”How the error bound shrinks with the iteration count : sublinear rates (gradient descent, convex) and (Nesterov), or linear rates with (strong convexity).Taught in: Why SGD converges
“the prox of eta h at v”The proximal operator: — decrease while staying close to .The prox of is soft-thresholding; the prox of an indicator function is a projection.Taught in: Constraints, projections and proximal methods
“the projection of v onto C”The closest point of the set to in Euclidean distance. Projected gradient descent takes a gradient step and then projects.Projecting onto is .Taught in: Constraints, projections and proximal methods
“the indicator function of C”Zero if and otherwise (also written or ). Turns a constraint into a penalty.Taught in: Constraints, projections and proximal methods
“the Bregman divergence of phi”: how far a convex lies above its tangent. The distance used by mirror descent.With on the simplex, is the KL divergence.Taught in: Constraints, projections and proximal methods
“x plus epsilon times the sign of the input gradient”The fast gradient sign method (FGSM): one step to the corner of the ball that most increases the linearised loss.Goodfellow et al.: ε = 0.25 on MNIST fooled a softmax classifier 99.9% of the time.Taught in: Adversarial examples and robustness
“min over theta of the expected worst-case loss”The adversarial-training (robust optimisation) objective of Madry et al.: the attacker maximises inside the budget , the defender minimises the result.The inner max is approximated with a few steps of PGD.Taught in: Adversarial examples and robustness
“projection onto S”Projection back into an allowed set; for an box, clipping each coordinate.PGD: .Taught in: Adversarial examples and robustness
“g clipped to norm C”Per-example gradient clipping in DP-SGD: gradients longer than are scaled down to length .With , a gradient of norm 3.8 becomes a unit vector.Taught in: Privacy and differential privacy
“flops”Floating-point operations — used as a hardware-independent measure of training cost.The transformer paper estimates FLOPs for its base model.Taught in: Worked reading: Attention Is All You Need
“N star and D star of C”Compute-optimal model size and number of tokens for a compute budget .Chinchilla's Table 3: goes with tokens.Taught in: Scaling laws and their limits
“mu P”The maximal update parametrization: rules for scaling initialization and learning rates with width so that features keep learning and hyperparameters transfer across widths.Tune a 40M-parameter model in µP, reuse its hyperparameters at 6.7B.Taught in: Width versus depth
“arg max over theta of f”The value of at which is largest (not the largest value itself). likewise..Taught in: Maximum likelihood: where losses come from
“J equals the sum over i of the squared distance from x i to mu c i”The k-means objective: within-cluster sum of squares (scikit-learn's inertia, Murphy's distortion).Two points at distance 1 and 2 from their centroids give .Taught in: k-means, properly
“script Q of theta”EM's expected complete-data log-likelihood, maximised in the M step.Taught in: Gaussian mixtures and EM
“N-cut of A and A bar”Normalised cut: cut weight divided by the volume of each side, summed.Taught in: Spectral clustering and graph Laplacians

Neural networks

“X cross-correlated with K”Slide the kernel over and take a dot product at every position, with no kernel flip. This is what deep-learning libraries compute and call “convolution”.Taught in: Convolution
“X convolved with K”Convolution in the signal-processing sense: like cross-correlation but with the kernel flipped. In ML papers usually just means “a convolutional layer”.Taught in: Convolution
“K sub o, c, a, b”A convolution kernel: output channel , input channel , row offset , column offset . The tensor has shape .64 kernels of on an RGB image: parameters.Taught in: Convolution
“C in, C out”Numbers of input and output channels (feature maps) of a convolutional layer.An RGB image has .Taught in: Convolution
“n out equals floor of n plus 2p minus k over s, plus one”Output size of a convolution with input size , kernel , padding and stride . gives .Taught in: Convolution
“r sub L”Receptive field: the width, in input pixels, of the square patch of inputs that can influence a unit in layer . .Three stacked layers: .Taught in: Convolution
“y equals F of x plus x”A residual block: layers learn a correction that is added to an identity shortcut.If the block is the identity, and gradients pass through unchanged.Taught in: The CNN lineage: LeNet to ResNet
“h sub t”Hidden state of a recurrent network after reading inputs : its memory.Taught in: Recurrent networks
“W h, W x”Recurrent (state-to-state) and input-to-state weight matrices of an RNN, shared across all time steps.With , : is and is .Taught in: Recurrent networks
“delta sub t”In backpropagation through time: the gradient of the total loss with respect to the state at step . It collects this step's output error plus everything flowing back from later steps.Taught in: Recurrent networks
“c sub t, the cell state”An LSTM's long-term memory, updated additively: .Taught in: LSTM and GRU
“forget, input and output gates”LSTM gates, each a sigmoid layer with values in : how much of the old cell to keep, how much of the candidate to write, and how much of the cell to expose.Taught in: LSTM and GRU
“c tilde sub t, the candidate”The new values an LSTM proposes to write into its cell, in . PyTorch calls it .Taught in: LSTM and GRU
“sigma of z”The logistic sigmoid . Inside gated RNNs it turns a score into a gate value between 0 (closed) and 1 (open).Taught in: LSTM and GRU
“z sub t and r sub t, update and reset gates”The two gates of a GRU. sets how much of the old state to keep; sets how much of it feeds the candidate. (Cho et al.'s convention)Taught in: LSTM and GRU
“v, the summary vector”In an encoder–decoder, the encoder's final state: the whole source sequence compressed into one fixed-length vector (Bahdanau et al. write ).Sutskever et al.'s deep LSTM used 8,000 numbers.Taught in: Seq2seq and the bottleneck
“the probability of y given x is the product over t of p of y t given v and the earlier y's”How an encoder–decoder scores a translation: one next-word prediction at a time, each conditioned on the summary vector and the words already produced.Taught in: Seq2seq and the bottleneck
“max of zero and x”The positive part — the ReLU activation. Applied element-wise to vectors.Transformer FFN: Taught in: Reading the symbols
“softmax of z, component i”: turns scores into positive weights that sum to 1.Taught in: Reading the symbols
“t x, t w”Faster R-CNN's box regression targets: the offset and log-scale of a box relative to an anchor .Taught in: Vision transformers, detection and segmentation
“the symmetrically normalised adjacency”GCN's propagation matrix: entry is for neighbours (and self). Its eigenvalues lie in .A GCN layer is .Taught in: Graph neural networks
“alpha i j, graph attention”GAT's attention weight from node to node , normalised over 's neighbourhood; is concatenation.Taught in: Graph neural networks
“softmax of z over T”Temperature scaling: dividing logits by softens () or sharpens () the probabilities without changing the predicted class. is fitted by minimising validation log loss.Taught in: Calibration and proper scoring rules
“beta (in a beta-VAE)”The weight on a VAE's KL term. is the standard VAE, a plain autoencoder; larger compresses the code more. (In diffusion models is instead the noise schedule.)With a 2-D code, the lesson's VAE ignores its latent entirely (posterior collapse).Taught in: Autoencoders and VAEs
“G of z, D of x”A GAN's generator, which maps noise to a sample, and discriminator, which outputs the probability that is real data.The optimal discriminator is .Taught in: Generative adversarial networks
“epsilon theta of x t and t”A diffusion model's noise predictor: a network that guesses the noise that was added to produce . Trained with .The score estimate is .Taught in: Diffusion models
“w, the guidance weight”In classifier-free guidance, . Larger : samples follow the condition more closely but are less diverse. is the plain conditional model.Taught in: Diffusion models
“s theta of x and t”A score network: a learned estimate of the score of the data blurred to noise level (or ), trained by denoising score matching.Denoising target: .Taught in: Score matching and flow matching
“v theta of x and t”A velocity field learned by flow matching: samples are made by integrating from noise at to data at .Trained by regressing onto at .Taught in: Score matching and flow matching
“top k of z”Keeps the largest entries of a vector of router logits and sets the rest to (so they get zero weight after a softmax). Used to pick experts in mixture-of-experts layers.Mixtral uses of 8 experts per layer; Switch Transformer uses .Taught in: Mixture of experts
“G of x, sub i”The gate weight that a mixture-of-experts router gives expert for input ; zero for experts that are not selected. The layer output is .Taught in: Mixture of experts
“alpha N sum over i of f i P i”The load-balancing auxiliary loss for mixture-of-experts routers: is the fraction of tokens sent to expert , the average router probability for expert . Equal to when routing is perfectly uniform.Four experts, all tokens sent to expert 1 with : (times ).Taught in: Mixture of experts
“C of w”In Bengio et al. (2003): the learned feature vector (embedding) of word , a row of the matrix . Later papers usually call the matrix or .With features and words, has about 1.8 million entries.Taught in: From n-grams to neural language models
“softmax of z, entry k”Turns a vector of real scores into a probability distribution: exponentiate, then normalise. Preserves order and ignores a common shift of all scores..Taught in: Logistic regression and softmax
“the logits”Unnormalised class scores, one per class, fed into a softmax (or, for two classes, a sigmoid). Losses in PyTorch such as CrossEntropyLoss take logits, not probabilities.Logits put almost all probability on the first two classes, equally.Taught in: Logistic regression and softmax
“softmax at temperature T”Dividing the logits by a temperature sharpens the distribution (, toward the largest logit) or flattens it (, toward uniform).Halving is the same as doubling every logit.Taught in: Logistic regression and softmax
“p minus y”The gradient of softmax cross-entropy with respect to the logits: predicted probabilities minus the one-hot label. The weight gradient is ., true class 2: gradient .Taught in: Logistic regression and softmax
“W nought plus alpha over r, B A”A LoRA-adapted weight matrix: the frozen pretrained () plus a trainable low-rank change with , , scaled by . on a matrix trains numbers instead of about 16.8 million.Taught in: Fine-tuning and LoRA
“r, the rank”In LoRA, the rank of the update : the width of the bottleneck between and . Chosen by hand, typically much smaller than the matrix dimensions.The LoRA paper found already competitive for adapting and of GPT-3 on WikiSQL.Taught in: Fine-tuning and LoRA
“w transpose x plus b equals zero”The decision boundary of a linear classifier: a hyperplane (a line in 2-D). Every linear model's boundary has this form.XOR's classes cannot be split by any such line.Taught in: The limits of linear
“phi of x”A feature map: a fixed, hand-chosen function turning an input into a (usually longer) feature vector. Careful — the same letter is also used for activation functions. makes XOR linearly separable.Taught in: The limits of linear
“W layer l, b layer l”The weights and biases of layer . Row of holds the incoming weights of unit ; the bracketed superscript is a layer index, not a power.784 inputs to 128 hidden units: is .Taught in: The multilayer perceptron
“z layer l, a layer l”Pre-activations and activations of layer ; .For a batch, stack them as rows: .Taught in: The multilayer perceptron
“n l”The width of layer : its number of units. is the number of input features.Taught in: The multilayer perceptron
“phi of z”An activation function, applied elementwise after each layer's linear map. Without it, stacked layers collapse into one affine map., or ReLU.Taught in: The multilayer perceptron
“rectified linear unit of z”The rectifier: passes positive inputs unchanged, zeroes negative ones. Its slope is 1 for and 0 for ., .Taught in: The multilayer perceptron
“tan h of z”Hyperbolic tangent: an S-shaped activation from to , equal to , with slope .Taught in: The multilayer perceptron
“d L d W layer l”The gradient of the loss with respect to layer 's weights: a matrix of the same shape as , computed by backpropagation.For : .Taught in: Backpropagation
“delta layer l”The error at layer : for one example (), or for a batch (). Backprop computes it from the layer above.Softmax + cross-entropy: .Taught in: Backpropagation
“Delta times phi prime of Z, elementwise”The Hadamard (entrywise) product, as it appears in the backward pass: how a gradient passes through an elementwise activation..Taught in: Backpropagation
“Xavier variance”Xavier (Glorot) initialisation: a weight variance chosen so that signals keep roughly the same spread forwards and backwards through a layer.He initialisation for ReLU uses instead.Taught in: Training in practice
“mu B, sigma squared B”The mean and variance of a feature over the current mini-batch , used by batch normalisation.Taught in: Training in practice
“gamma, beta”The learned scale and shift applied after batch or layer normalisation: .Taught in: Training in practice
“p”The probability that dropout zeroes a unit during training; survivors are scaled by . drops about half the units on each step.Taught in: Training in practice
“residual connection”A residual (skip) connection: a block adds its input to its output, so gradients have an identity path backwards.Taught in: Training in practice
“x prime”In attribution: the baseline input that means “no signal” (a black image, an all-zero embedding), against which a prediction is explained.Integrated gradients with baseline .Taught in: Interpretability
“phi i”The attribution of feature : its share of the change in output, e.g. an integrated-gradients or Shapley value.For at from : , .Taught in: Interpretability
“integrated gradients of feature i”Integrated gradients: the gradient averaged along the straight path from baseline to input, times the change in the feature. The attributions sum to .Approximated by a Riemann sum with 20–1000 steps.Taught in: Interpretability
“P drop”The dropout rate: the probability that a unit's output is zeroed during training. for the base transformer.Taught in: Worked reading: Attention Is All You Need
“epsilon L S”The label-smoothing value: probability mass moved from the correct token to the rest of the vocabulary in the training targets. in the transformer paper.Taught in: Worked reading: Attention Is All You Need
“N”In scaling laws: the number of model parameters (Kaplan et al. exclude embeddings; Chinchilla counts all).Chinchilla has billion parameters.Taught in: Scaling laws and their limits
“C is about six N D”Training compute in FLOPs: about per token for the forward pass and for the backward pass, times tokens., gives FLOPs.Taught in: Scaling laws and their limits
“L of N and D equals E plus A over N to the alpha plus B over D to the beta”The Chinchilla parametric loss: irreducible loss plus a model-size term plus a data term, fitted to training runs.Hoffmann et al. fitted , , , , .Taught in: Scaling laws and their limits
“alpha, beta”Scaling exponents: how fast the model-size and data terms of the loss shrink.Doubling multiplies by .Taught in: Scaling laws and their limits
“alpha N”Kaplan et al.'s exponent for loss versus non-embedding parameters, ..Taught in: Scaling laws and their limits
“effective model complexity”Nakkiran et al.'s effective model complexity: the largest number of samples on which a training procedure reaches training error at most on average.Test error tends to peak when the EMC is close to the number of training samples.Taught in: Double descent
“the neural tangent kernel at x and x prime”The neural tangent kernel: , how a gradient step on one input moves the output at another.In the infinite-width NTK limit, stays constant during training.Taught in: Width versus depth
“layer norm of x”Layer normalisation: centre and rescale one token's vector using its own mean and variance, then apply a learned gain and bias.Pre-LN blocks compute ; the 2017 Post-LN blocks compute .Taught in: The transformer block

Transformers

“z zero equals class token, then each patch times E, plus position embeddings”The Vision Transformer's input: flattened image patches mapped by a shared matrix , a learned class token prepended, learned position embeddings added.A image with gives patch tokens plus one class token.Taught in: Vision transformers, detection and segmentation
“N equals H W over P squared”Number of patches in an image: the ViT's sequence length (before the class token). for ViT-L/14 at 224 px.Taught in: Vision transformers, detection and segmentation
“arithmetic intensity: FLOPs per byte”Arithmetic intensity: how many floating-point operations a computation does per byte it moves to or from memory. Compare it with the chip's ratio to see whether it is compute-bound or memory-bound.A batch of tokens times a weight matrix has ; decoding one sequence has .Taught in: The cost of attention
“pi over beta, the ridge point”Peak FLOP/s divided by memory bandwidth in bytes/s: the critical arithmetic intensity (ridge point of a roofline). Below it a computation is memory-bound, above it compute-bound. Here is not the circle constant.An H100: FLOPs per byte.Taught in: The cost of attention
“twenty-four n d squared plus four n squared d”Forward FLOPs of one GPT-style transformer layer on tokens of width : weight matmuls (linear in ) plus the and products (quadratic in ). The second term dominates when .For , attention FLOPs pass the rest at about tokens.Taught in: The cost of attention
“h K V, the number of key-value heads”The number of key–value heads in an attention layer. Equal to the number of query heads in multi-head attention, 1 in multi-query attention, and in between for grouped-query attention.Llama 2 70B has query heads and .Taught in: The KV cache
“two L h K V d k n b s”The size of the KV cache in bytes: keys and values, for layers, key–value heads of width , cached tokens, batch , and bytes per number.Llama 2 7B in 16-bit: bytes per token.Taught in: The KV cache
“c K V sub t”In multi-head latent attention (DeepSeek-V2), the compressed latent vector for token from which all heads' keys and values are reconstructed. It is what gets cached.DeepSeek-V2 uses , plus a 64-dimensional positional key: 576 cached numbers per layer per token.Taught in: The KV cache
“S sub i, the allowed set of query i”In sparse attention, the set of key positions that query may attend to: row of the attention mask. The cost of a layer is proportional to .Causal attention: . A sliding window: .Taught in: Sparse attention
“order n root n”The cost of the Sparse Transformer's strided and fixed attention patterns with stride : each of queries attends to about keys.At , about pairs instead of about for causal attention.Taught in: Sparse attention
“phi of q transpose phi of k”The similarity used by linear attention in place of , with a feature map (for example ). It lets the sums over keys be computed once, giving cost.Taught in: Sparse attention
“m sub i and ell sub i”The running maximum and running softmax denominator for query row in the online softmax used by FlashAttention. When the maximum grows from to , the old sum is rescaled by .Scores : goes .Taught in: FlashAttention and the memory hierarchy
“B r and B c, the block sizes”In FlashAttention, the number of rows of (for ) and of and (for ) in one tile, chosen so the tiles fit in on-chip SRAM.Taught in: FlashAttention and the memory hierarchy
“s b h times thirty-four plus five a s over h”Bytes of activations a transformer layer saves for the backward pass (Korthikanti et al.), for sequence length , microbatch , hidden size , heads, 16-bit precision. The second term is the attention scores., , : the part is about 1.1 GB per layer.Taught in: Training at scale
“blue”An automatic machine-translation score based on n-gram overlap with human reference translations (Papineni et al., 2002). Higher is better.The transformer paper reports 28.4 BLEU on WMT 2014 English-to-German.Taught in: Worked reading: Attention Is All You Need
“d f f”The inner width of the transformer's position-wise feed-forward layer. with in the base model.Taught in: Worked reading: Attention Is All You Need
“w k equals two pi k over p”A Fourier frequency on the integers mod ; networks that grok modular addition represent numbers as and for a few key .Nanda et al.'s model uses for .Taught in: Grokking
“c i equals the sum over j of alpha i j times h j”Bahdanau attention's context vector: a fresh weighted average of the encoder states for each output step .If , then .Taught in: Attention: learning where to look
“alpha i j”Attention weight: how much output (or query) draws on input (or key) . Each row is a softmax, so the weights are nonnegative and sum to 1.A row puts 70% of the attention on the first item.Taught in: Attention: learning where to look
“e i j equals a of s i minus one and h j”An alignment score or energy: how well decoder state matches encoder annotation (Bahdanau et al.).Additive attention uses .Taught in: Attention: learning where to look
“query, key, value”The three roles in attention: a query is compared with keys to produce weights, and the weights average the values.In Bahdanau attention the decoder state is the query and each encoder state is both key and value.Taught in: Attention: learning where to look
“Q equals X W Q, and so on”Queries, keys and values for a whole sequence, one row per token, from three learned projection matrices.With and , is .Taught in: Scaled dot-product and multi-head attention
“softmax of Q K transpose over root d k, times V”Scaled dot-product attention (Vaswani et al., 2017): score every query against every key, scale, softmax each row, average the values.For queries and keys, is and the output is .Taught in: Scaled dot-product and multi-head attention
“d k”The length of each query and key vector (per head). Scores are divided by so their variance does not grow with it.The base Transformer has .Taught in: Scaled dot-product and multi-head attention
“d v”The length of each value vector, and so of each head's output.The base Transformer uses .Taught in: Scaled dot-product and multi-head attention
“d model”The width of every token's vector throughout the model — the dimension of the residual stream.512 in the base Transformer, 768 in GPT-2 small, 12,288 in GPT-3.Taught in: The transformer block
“h, the number of heads”How many attention functions run in parallel in one multi-head layer; usually . in the base Transformer, 96 in GPT-3.Taught in: Scaled dot-product and multi-head attention
“W Q i, W K i, W V i, W O”Per-head query, key and value projections ( or ) and the output projection that mixes the concatenated heads back to .Together they hold weights, whatever the number of heads.Taught in: Scaled dot-product and multi-head attention
“multi-head of Q K V”Multi-head attention: run attention heads on different learned projections and combine them.Each .Taught in: Scaled dot-product and multi-head attention
“M i j, the mask”An attention mask added to the scores before the softmax: 0 where query may look at key , where it may not (weight exactly 0).The causal mask sets for every .Taught in: Scaled dot-product and multi-head attention
“F F N of x”The position-wise feed-forward sublayer: a two-layer MLP applied to each token separately.In the base Transformer it maps 512 → 2048 → 512.Taught in: The transformer block
“N is about twelve n layer d model squared”Non-embedding parameter count of a standard transformer (Kaplan et al., 2020): for attention plus for the feed-forward network per layer.GPT-3: .Taught in: The transformer block
“P E of pos, two i”The sinusoidal positional encoding (with cosine in dimension ), added to the token embeddings; each pair of dimensions turns at its own frequency.Pair has wavelength positions; the last pair about .Taught in: Positional information
“R theta m”The rotary position embedding (RoPE) rotation for position : rotates each pair of query/key dimensions by , so depends only on .In 2-D, .Taught in: Positional information
“a K i j”A relative position representation (Shaw et al., 2018): a learned vector for the clipped offset between query and key , added to the key.With there are distinct vectors.Taught in: Positional information
“p i proportional to e to the z i over tau”Sampling temperature: dividing the logits by before the softmax. sharpens (towards greedy), flattens.At sampling becomes argmax (greedy) decoding.Taught in: GPT and next-token prediction
“V p, the nucleus”In top- (nucleus) sampling, the smallest set of most-probable tokens whose probabilities sum to at least ; sampling is restricted to it and renormalised.With the nucleus may hold 3 tokens when the model is confident and 50 when it is not.Taught in: GPT and next-token prediction

Reinforcement learning

“delta i”The gap of bandit arm : how much less it pays on average than the best arm.Means 0.7 and 0.55: gap 0.15.Taught in: Online learning and bandits
“mu hat i plus the square root of two log t over N i”The UCB1 index: an arm's average reward plus an exploration bonus that shrinks with its pull count .Pull the arm with the largest index.Taught in: Online learning and bandits
“pi of a t given c t”An agent's policy: the distribution over its next action given the context — every observation and action so far.For an LLM agent, is literally the prompt, including earlier tool outputs.Taught in: Agents and tool use
“s t”The state of the environment at time — everything the agent needs to know to choose an action.In a maze, which square the robot is on.Taught in: Reinforcement learning foundations
“a t”The action the agent takes at time .Up, down, left or right; or the next token for a language model.Taught in: Reinforcement learning foundations
“r t plus one”The reward that arrives after the action at time (many papers write for the same thing). for stepping onto the exit.Taught in: Reinforcement learning foundations
“the MDP tuple”A Markov decision process: states, actions, transition probabilities, reward function, discount.Taught in: Reinforcement learning foundations
“P of s prime given s, a”Transition probability: the chance of landing in after taking in .With a slip probability of 0.2, the intended move happens with probability 0.8.Taught in: Reinforcement learning foundations
“gamma”The discount factor, usually in : a reward steps away is worth of its face value. (RLHF implementations usually set ; in InstructGPT's objective, is instead a pretraining-loss weight.)With , a reward 10 steps away counts about .Taught in: Reinforcement learning foundations
“G t”The return: the discounted sum of all rewards from time on, .Taught in: Reinforcement learning foundations
“pi of a given s”A policy: the probability of taking action in state . For a language model, is the probability of response to prompt .Taught in: Reinforcement learning foundations
“V pi of s”State value: the expected return from when following policy .Taught in: Reinforcement learning foundations
“Q pi of s, a”Action value: the expected return from taking in , then following .Taught in: Reinforcement learning foundations
“V star, Q star”Optimal values: the best achievable expected return. Acting greedily on is optimal.Taught in: Reinforcement learning foundations
“delta t”The temporal-difference (TD) error : how much better things went than predicted.Taught in: Reinforcement learning foundations
“epsilon”In ε-greedy exploration, the probability of a random action; in PPO and GRPO, the clip range for the probability ratio (often 0.2).Taught in: Reinforcement learning foundations
“tau”A trajectory (episode, rollout): the sequence generated by a policy.Taught in: Policy gradients and PPO
“J of theta”The expected return of the policy with parameters — the objective policy-gradient methods climb.Taught in: Policy gradients and PPO
“grad log pi”The direction in parameter space that makes action more likely in state ; the policy gradient weights it by how good the action turned out.For a softmax policy, .Taught in: Policy gradients and PPO
“A pi”The advantage : how much better action is than the policy's average in . is an estimate of it.Taught in: Policy gradients and PPO
“rho t”The probability ratio used by TRPO, PPO and GRPO (the PPO paper writes ).Taught in: Policy gradients and PPO
“clip rho”Clamp the ratio to ; inside PPO's , this removes the incentive to move an action's probability further in one update.Taught in: Policy gradients and PPO
“L clip”PPO's clipped surrogate objective .Taught in: Policy gradients and PPO
“GAE advantage”Generalized Advantage Estimation: ; trades bias against variance.Taught in: Policy gradients and PPO
“r phi of x, y”A reward model: a network scoring response to prompt with one number, trained on human preferences.Taught in: RLHF: learning from preferences
“sigma of r w minus r l”The Bradley–Terry preference probability: the chance a person prefers the answer with reward over the one with .Rewards 2.0 and 0.5 give .Taught in: RLHF: learning from preferences
“y w, y l”The preferred (winning) and rejected (losing) responses in a preference pair; also written (chosen, rejected).Taught in: RLHF: learning from preferences
“pi ref”The frozen reference policy — usually the supervised fine-tuned model — that RLHF, DPO and GRPO penalise drifting away from.Taught in: RLHF: learning from preferences
“beta times KL”The KL penalty in RLHF-style objectives; sets how expensive drift from the reference model is.Taught in: RLHF: learning from preferences
“pi star”The closed-form optimum of the KL-regularised reward objective, : reweight the reference model by .Taught in: RLHF: learning from preferences
“Z of x”A partition function (normaliser) summing over all possible responses; it cancels in the DPO derivation.Taught in: RLHF: learning from preferences
“L DPO”The DPO loss: of times the difference in log-probability ratios (policy over reference) of the preferred and rejected responses.Taught in: RLHF: learning from preferences
“A i, group-relative”GRPO's advantage: a sampled answer's reward standardised within its group of answers to the same prompt.Rewards give advantages .Taught in: RLVR and reasoning models
“pass at k”The probability that at least one of sampled answers is correct; estimated without bias as from samples with correct.Taught in: RLVR and reasoning models
“proxy equals true value plus error”A Goodhart model: the measured proxy is the true objective plus error ; optimising hard selects for large when is heavy-tailed.Best-of-4,096 with Student-t error: proxy ≈ 93, true value ≈ 0.13.Taught in: Alignment and safety
“Q w minus”The target network: a delayed copy of the Q-network, used only to compute bootstrap targets. DQN refreshes it every C updates; DDPG, TD3 and SAC Polyak-average it every step.DQN's target .Taught in: Deep Q-learning and actor–critic methods
“Polyak averaging”A slowly moving target network: each step it moves a small fraction of the way to the trained weights. Papers often write . (i.e. ).Taught in: Deep Q-learning and actor–critic methods
“mu theta of s”A deterministic policy (the actor in DDPG and TD3): it outputs an action vector rather than a distribution, and stands in for in continuous action spaces.Taught in: Deep Q-learning and actor–critic methods
“alpha times the entropy of pi”The entropy bonus of maximum-entropy RL (SAC). is a temperature trading reward against randomness, not a step size.Taught in: Deep Q-learning and actor–critic methods
“N, W, P of s, a”Tree-search edge statistics: visit count, total backed-up value (so ), and — in AlphaZero-style search — the network's prior probability for the move.Taught in: Model-based RL and planning
“p, v equals f theta of s”The AlphaGo Zero / AlphaZero network: move probabilities and a value for position . MuZero adds learned representation and dynamics functions.Taught in: Model-based RL and planning
“beta over root N”A count-based exploration bonus: large for rarely tried state–action pairs, shrinking like one over the square root of the visit count.MBIE-EB adds it inside the Bellman equation.Taught in: Exploration
“N hat n of x”A pseudo-count: a visit count derived from a density model's probability of before and after one more observation of , so that similar states share counts.Taught in: Exploration
“extrinsic plus beta intrinsic”Task (extrinsic) reward plus an intrinsic reward the agent pays itself for novelty or surprise, as in curiosity and RND.Taught in: Exploration
“pi beta”The behaviour policy that generated a fixed dataset in offline RL (also written or ).Taught in: Imitation and offline RL
“the behavioural cloning bound”A policy with error rate on the expert's states can incur extra cost growing quadratically in the horizon ; DAgger's bound is linear, .Taught in: Imitation and offline RL
“pi minus i”The policies of every agent except agent . A Nash equilibrium is a joint policy in which each is a best response to .Taught in: Multi-agent RL
“the Markov game tuple”A Markov (stochastic) game: agents, states, each agent's actions, transitions on the joint action, each agent's reward, discount.Taught in: Multi-agent RL
“Q tot”A team's joint action value, built (in QMIX) as a monotonic mix of per-agent values so decentralised greedy actions agree with the joint argmax.Taught in: Multi-agent RL