Matrix Phylogeny
Matrix Decompositions
Let's step back and organize the decompositions you have met into a phylogeny — a family tree of matrix factorizations, each specialized for different matrix classes. The most general factorizations apply to the broadest set of matrices; the most specialized exploit extra structure for speed or insi
Decompositions form a hierarchy: SVD (most general) → QR → eigendecomposition → Cholesky (most specialized).
Let's step back and organize the decompositions you have met into a phylogeny — a family tree of matrix factorizations, each specialized for different matrix classes. The most general factorizations apply to the broadest set of matrices; the most specialized exploit extra structure for speed or insight.
At the top sit LU (, requires invertible after permutations) and QR (, exists for any rectangular ). These are the workhorses for solving linear systems and least-squares problems. LU is cheap but numerically delicate; QR uses orthogonal matrices and is more stable, especially for tall-skinny matrices.
Moving to square matrices, eigendecomposition () exists for diagonalizable matrices. For the subset of symmetric matrices, it specializes to with orthogonal (spectral theorem). For the even narrower subset of symmetric positive definite matrices, we get Cholesky () as a fast square-root factorization.
Above everything in generality sits SVD (), which works for every rectangular matrix, every rank, every condition number. It is slower than specialized decompositions but universal. Inside, every other decomposition can be connected to it: QR is an intermediate step, eigendecomposition is SVD when is symmetric, and Cholesky is a specialized for positive-definite matrices.
Worked example — decision flowchart: You need to solve for a matrix . Is SPD (e.g., in regression)? → Cholesky ( flops). Otherwise is square and well-conditioned? → LU with partial pivoting ( flops). Otherwise for least squares or rank-deficient ? → QR or SVD. Matching the decomposition to the problem structure can cut compute by a factor of 2–10.
Worked example — SVD vs. eigendecomposition cost: For a symmetric matrix, eigendecomposition costs ; SVD on the same matrix also costs but with a larger constant (~2-3×). Rule of thumb: use eigendecomposition when you know the matrix is symmetric (PCA covariance, graph Laplacian); use SVD for rectangular data matrices or when you don't trust the symmetry. For a matrix, this constant factor is hours of compute.
ML connection — normalizing flows use log|det J|: Normalizing flows require efficient Jacobian determinants. Designs often constrain the Jacobian to be triangular (so = product of diagonal) or to be a composition of rotations + diagonal scales (Cholesky-like). Picking the right decomposition structure for your layer is a modeling choice that directly controls training speed.
When you are solving an ML problem, pick the most specific decomposition that still applies. For normal equations , use Cholesky — it's twice as fast as LU. For least squares on ill-conditioned data, use QR on directly, avoiding the conditioning squaring from . For PCA, use SVD on directly for best numerics. For general spectral problems, use eigendecomposition of the relevant symmetric operator. Knowing the phylogeny is knowing when to use which tool.
Exercises
Put your understanding to the test. Score + streak + speed all count.
Confirm you've got it
3 quick questions. Get 2 right to mark this lesson complete.