Thirteen lessons that teach their own subject
Quantifiers
Quantifiers turn a predicate into a proposition: ∀ means the predicate holds for every element of a domain, ∃ means it holds for at least one. Their order changes the meaning, and their negations follow two exact rules.
Rank–nullity theorem
For a linear map T: V → W between finite-dimensional vector spaces, dim V = dim ker T + dim im T. The theorem is an exact dimension identity, proved by extending a basis of the kernel to a basis of the whole space.
Gradient Descent
Gradient descent turns the local geometry of a differentiable loss surface into an iterative algorithm: move opposite the steepest local direction, with a step size justified by a first-order Taylor model.
Singular Value Decomposition and Principal Component Analysis
The singular value decomposition factors any matrix into orthogonal directions and nonnegative scales, giving the optimal low-rank approximation; PCA is that same spectral structure applied to a centered data matrix, recovering the directions of maximum variance.
Bayes' Theorem and Bayesian Inference
Bayes' theorem inverts conditional probabilities: the posterior odds of a hypothesis equal its prior odds multiplied by the likelihood ratio of the observed data, with the evidence playing the role of a normalization constant.
Backpropagation and Computational Graphs
Backpropagation is reverse-mode automatic differentiation: it composes local derivatives in reverse topological order of a computational graph, obtaining the gradient of one scalar loss with respect to every parameter at roughly the cost of one forward pass.
Scaled Dot-Product Self-Attention
Scaled dot-product self-attention maps each token to queries, keys and values, computes softmax of $QK^\top/\sqrt{d_k}$, and returns a convex combination of values — a content-based, permutation-equivariant routing layer with $O(n^2d)$ cost.
Transformer Architecture
A Transformer is a stack of blocks, each combining multi-head self-attention with a position-wise feed-forward network, residual connections and normalization. Attention mixes information across tokens; the feed-forward network transforms each token independently.
Proximal Policy Optimization
PPO stabilizes policy-gradient training by limiting how far the policy can move per update: TRPO imposes a hard KL trust region, while PPO uses a clipped importance-ratio surrogate that removes the incentive for overly large probability changes. Combined with generalized advantage estimation and value/entropy losses, it is the default general-purpose on-policy RL algorithm.
LLM-as-a-Judge: Designing Trustworthy Model-Based Evaluation
How to use an LLM as a grader without being fooled by position bias, verbosity, self-preference or uncalibrated confidence.
Agent Evaluation: Measuring Reliability Under Tool Failure
How to evaluate autonomous agents on long-horizon tasks when tools fail, traces are noisy and success is not a single answer.
Mechanistic Interpretability: From Activations to Causal Claims
How to move from 'this neuron lights up' to a controlled causal claim about a circuit, with superposition and controls taken seriously.
FlashAttention: Deriving IO-Aware Exact Attention
Why exact attention is memory-bound, how tiling and online softmax avoid the n×n matrix, and how to verify correctness.