Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.A picture made of layers
Imagine a picture built by stacking see-through layers. The first layer gives the rough shape, the next adds a bit more, and later layers add only tiny details. If you keep just the first few layers, the picture still looks almost right, and you’ve saved a lot of space.
The SVD (A2.3-5) splits any table of numbers into exactly such layers, sorted from most to least important. Keeping only the top few is called a low-rank approximation. Slide to see a robot face rebuilt from just a few layers:
- 1. A 100-number photo is stored using its 10 most important numbers. What fraction is kept?
- 2. Which SVD layers matter most?
- 3. In the demo, what needs more layers: straight rectangles or round eyes?
Level 1: Beginner
★★☆☆☆ Basic⏱ 15 minSecondary-school mathematics: arithmetic and elementary algebra.Truncating the SVD
From , keep the first terms:
Example. . Its best rank-1 approximation is . The error is what’s left, .
How big is the error?
- In the spectral norm, the error is the first singular value you dropped: , which is 3 here.
- In the Frobenius norm, it’s , which is here.
Storage
A rank- approximation of an matrix needs numbers instead of . For a matrix at rank 1, that’s 201 numbers instead of 10,000.
- 1. Spectral error of the best rank-1 approximation to diag(5, 3, 1)?
- 2. Storage of a rank-1 approximation of a 100 × 100 matrix?
- 3. Entry (1,1) of the rank-1 approximation of diag(5, 3, 1)?
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 35 minUndergraduate students and practising engineers.Energy and choosing k
The energy captured by rank is . Common recipes:
- keep enough terms for 90–99% of the energy (as for PCA’s explained variance);
- look for an elbow (a sudden drop) in the singular-value plot;
- use cross-validation on the downstream task.
For , rank 2 keeps . For , you need rank 2 to pass 90%.
Where low rank shows up
| Domain | Low-rank model |
|---|---|
| Data science | PCA: approximate centred data with its top components (D9) |
| Recommenders | ratings ≈ users × items with latent factors (D13) |
| Images and signals | compression, denoising (noise spreads over all singular values, signal sits in a few) |
| NLP | latent semantic analysis: the SVD of the term–document matrix (D9) |
| LLM fine-tuning | LoRA: , a rank- update (F6) |
| Robotics and sensing | multi-sensor arrays and vibration data are driven by a few modes (Practice Code 5) |
- 1. σ = (4, 2, 1, 1). Smallest rank keeping ≥ 90% of the energy?
- 2. σ = (4, 2, 1, 1): Frobenius error at rank 2?
- 3. Why does truncation denoise?
Level 3: Advanced
★★★★☆ Advanced⏱ 45 minGraduate level, with full derivations and proofs.The Eckart–Young–Mirsky theorem
For every matrix of rank at most :
The truncated SVD is the best possible rank- approximation, in both norms (indeed in every unitarily invariant norm).
Proof (spectral norm). has rank at most , so has dimension at least . The span of has dimension , so by dimension counting (A2.1-4) the two subspaces share a unit vector . Then
So . ∎
Why this matters
Many problems, including PCA, latent factor models, and finding the closest rank-deficient matrix, are non-convex optimization problems over low-rank matrices. Yet the SVD solves them exactly. It’s a rare and powerful situation.
Low rank as a convex surrogate
Rank isn’t convex, so problems like “find a low-rank matrix matching observed entries” are hard in general. The nuclear norm is its tightest convex relaxation (A2.3-8), just as the L1 norm relaxes sparsity. Candès and Recht (2009) proved that minimizing the nuclear norm recovers a low-rank matrix exactly from surprisingly few entries: matrix completion.
Exercise 3.1: Best rank-1 approximation errors for σ = (9, 5, 2)
Spectral error . Frobenius error .
- 1. σ = (9, 5, 2). The best rank-1 spectral error is…
- 2. Squared Frobenius error of the best rank-1 approximation for σ = (9, 5, 2)?
- 3. Nuclear norm of diag(3, −2)?
Level 4: Expert
★★★★★ Expert⏱ 35 minResearchers: original papers and open problems.Randomized SVD for huge matrices
For matrices with millions of rows, even SVDs are too slow. Randomized SVD (Halko, Martinsson and Tropp, 2011) multiplies by a thin random matrix to capture its range, orthonormalizes, and does an exact SVD of a small matrix. With a little oversampling and a couple of power iterations, it reaches error within a small factor of the optimal , using only a few passes over the data. scikit-learn’s TruncatedSVD and PCA solvers use it.
Low rank in modern AI
- LoRA (Hu et al., 2022): freeze and learn of rank . For a layer at , that’s 131,072 trainable numbers instead of 16.8 million. Variants (QLoRA, DoRA) are the default way to fine-tune LLMs on modest hardware (F6).
- Low-rank gradient compression cuts communication in distributed training (PowerSGD, Vogels et al., 2019).
- KV-cache compression in long-context LLMs exploits the approximately low-rank structure of keys and values (F8).
- The Netflix Prize (2006–2009) was won largely with low-rank matrix factorization (Koren, Bell and Volinsky, 2009). Billions of ratings were modelled with tens of factors.
Low rank in robotics and science
- Proper orthogonal decomposition (J5): snapshots of a fluid or structural simulation are approximated by a few SVD modes, giving reduced-order models fast enough for real-time control and digital twins.
- Dynamic mode decomposition builds on the same truncated SVD to extract oscillation modes from sensor data (J5).
- Structure from motion (Tomasi and Kanade, 1992): under orthographic projection, the matrix of tracked feature points has rank 3, so a truncated SVD recovers camera motion and 3-D shape together.
References
- C. Eckart and G. Young (1936). “The approximation of one matrix by another of lower rank.” Psychometrika, 1.
- L. Mirsky (1960). “Symmetric gauge functions and unitarily invariant norms.” Quarterly Journal of Mathematics, 11.
- C. Tomasi and T. Kanade (1992). “Shape and motion from image streams under orthography: a factorization method.” IJCV, 9(2).
- E. Candès and B. Recht (2009). “Exact matrix completion via convex optimization.” Foundations of Computational Mathematics, 9.
- Y. Koren, R. Bell, C. Volinsky (2009). “Matrix factorization techniques for recommender systems.” IEEE Computer, 42(8).
- N. Halko, P.-G. Martinsson, J. Tropp (2011). “Finding structure with randomness: probabilistic algorithms for constructing approximate matrix decompositions.” SIAM Review, 53(2).
- T. Vogels, S. P. Karimireddy, M. Jaggi (2019). “PowerSGD: Practical low-rank gradient compression for distributed optimization.” NeurIPS.
- E. Hu et al. (2022). “LoRA: Low-rank adaptation of large language models.” ICLR.