What Mathematics an ML Engineer Actually Needs
Published:
The syllabus is determined by one sentence
Write down what a feed-forward network is. Each layer applies a matrix, adds a bias, and passes the result through a nonlinearity applied elementwise. Training adjusts the matrices by descending a scalar loss.
Everything mathematical you need follows from unpacking that:
- The matrices. What does $W$ do to a vector? Which directions does it stretch, which does it destroy, what information does it throw away? That is linear algebra, and it is the single largest slice of the syllabus.
- The descending. How does a change in one weight, buried eleven layers deep, affect a scalar at the end? That is the chain rule, applied at scale. Backpropagation is nothing else.
- The convergence. How fast does this get anywhere, and what shape of loss surface makes it slow? That is norms, curvature and convexity.
The nonlinearity is the only piece that is not mathematically interesting, which is why it gets one line and moves on.
The honest note about interviews
Interview mathematics is overwhelmingly linear algebra and calculus. Rank, eigenvectors, SVD, gradients, Jacobians, and a sanity check on convexity account for the large majority of questions actually asked. Probability and statistics form their own body of material and are treated separately from this book.
What almost never appears: epsilon-delta arguments, Lebesgue integration, compactness, Banach spaces. If a role genuinely needs those — theory positions, some optimisation research — the interview will say so in advance. Revising analysis instead of practising a Jacobian derivation is a bad trade.
What does appear, and catches people out, is not hard material. It is material people once knew and then stopped using: the difference between eigenvalues and singular values, why the gradient of $x^\top A x$ is $(A + A^\top)x$ and not $Ax$, why $L^1$ produces sparsity and $L^2$ does not.
The map
The seven remaining posts, in the order they build on one another.
Linear algebra
- Vectors and matrices — span, basis, rank; matrix multiplication read as composition of maps and as a change of basis; column space against null space, and rank–nullity as the conservation law that connects them.
- Eigenvalues, the spectral theorem and SVD — invariant directions, when diagonalisation fails, why the SVD always exists, and low-rank approximation with a worked $2\times2$ example carried through exactly.
Calculus
- Derivatives and gradients — the derivative as the best linear approximation, the gradient as a covector, and why reverse-mode differentiation is cheap precisely when there is one scalar output.
- Jacobians and Hessians — change of variables and the log-determinant term in normalising flows; curvature, second-order optimality, and why Newton’s method loses at scale.
- Matrix calculus — the dozen identities worth memorising, one derivation done slowly, and the layout convention that causes most sign errors.
Analysis and optimisation
- Norms and distances — $L^1$, $L^2$, $L^\infty$, operator and Frobenius norms; the geometry behind $L^1$ sparsity; cosine similarity against Euclidean distance.
- Convexity and optimisation — what convexity guarantees, how the condition number sets the convergence rate, KKT conditions, and the honest position on non-convex deep learning.
How to use this for revision
Read each post once for the argument, then close it and try to reproduce the one worked example from memory. The examples are chosen to be small enough to do by hand and specific enough that getting them right means you understood the mechanism, not the vocabulary.
Recap
- The syllabus falls out of one fact: a network is composed linear maps trained by gradients. Linear algebra explains the maps, calculus explains the gradients.
- Interview mathematics is dominated by linear algebra and calculus. Real analysis is rarely asked and is a poor use of revision time.
- Two framings recover most answers: what does this matrix do to space, and what is the local linear approximation.
- The recurring traps are eigenvalues versus singular values, matrix-calculus layout, and asserting optimality from a vanishing gradient alone.
References
- Strang, G. Introduction to Linear Algebra, 6th ed. Wellesley-Cambridge Press, 2023. Companion lectures: MIT 18.06.
- Deisenroth, M. P., Faisal, A. A., & Ong, C. S. Mathematics for Machine Learning. Cambridge University Press, 2020.
- Boyd, S., & Vandenberghe, L. Convex Optimization. Cambridge University Press, 2004.
- Golub, G. H., & Van Loan, C. F. Matrix Computations, 4th ed. Johns Hopkins University Press, 2013.
- Petersen, K. B., & Pedersen, M. S. The Matrix Cookbook, version 20121115, 2012.
