Foundations to Frontier
Tests
A. Mathematical Foundations › A2 Linear Algebra › Decompositions

Low-Rank Approximation and the Eckart–Young Theorem

Keep the few strongest SVD terms and throw the rest away, with a proof that nothing does better. This one idea compresses images, denoises sensors, powers recommenders and LoRA, and makes huge matrices manageable.

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:

Image compression with a truncated SVD
original (48×48 = 2304 numbers)
rank 3 (291 numbers)
Relative error ‖A − A_k‖_F / ‖A‖_F = 11.6% · energy kept 98.7% · storage 13% of the original
Bars: the first 24 singular values (blue = kept). Rectangles need only a few terms; round eyes need more.
📝 Quick check (Level 0)
0/3 answered
  1. 1. A 100-number photo is stored using its 10 most important numbers. What fraction is kept?
  2. 2. Which SVD layers matter most?
  3. 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 A=∑i=1rσiuivi⊤A = \sum_{i=1}^r\sigma_i\mathbf u_i\mathbf v_i^\top, keep the first kk terms:

Ak=∑i=1kσiuivi⊤A_k = \sum_{i=1}^k\sigma_i\mathbf u_i\mathbf v_i^\top

Example. A=diag⁡(5,3,1)A = \operatorname{diag}(5,3,1). Its best rank-1 approximation is diag⁡(5,0,0)\operatorname{diag}(5,0,0). The error is what’s left, diag⁡(0,3,1)\operatorname{diag}(0,3,1).

How big is the error?

  • In the spectral norm, the error is the first singular value you dropped: σk+1\sigma_{k+1}, which is 3 here.
  • In the Frobenius norm, it’s σk+12+⋯+σr2\sqrt{\sigma_{k+1}^2 + \dots + \sigma_r^2}, which is 9+1≈3.16\sqrt{9+1}\approx3.16 here.

Storage

A rank-kk approximation of an m×nm\times n matrix needs k(m+n+1)k(m + n + 1) numbers instead of mnmn. For a 100×100100\times100 matrix at rank 1, that’s 201 numbers instead of 10,000.

📝 Quick check (Level 1)
0/3 answered
  1. 1. Spectral error of the best rank-1 approximation to diag(5, 3, 1)?
  2. 2. Storage of a rank-1 approximation of a 100 × 100 matrix?
  3. 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 kk is ∑i≤kσi2/∑iσi2\sum_{i\le k}\sigma_i^2/\sum_i\sigma_i^2. 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 σ=(5,3,1)\sigma = (5,3,1), rank 2 keeps 34/35≈97%34/35\approx97\%. For σ=(4,2,1,1)\sigma = (4,2,1,1), you need rank 2 to pass 90%.

🐍 Exercise 1: truncated SVD and its exact errors
Return the best rank-k approximation. The tests confirm the spectral error equals σ₍ₖ₊₁₎ and the Frobenius error equals √(Σ tail σ²).

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 kk 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: ΔW=BA\Delta W = BA, a rank-rr update (F6)
Robotics and sensing multi-sensor arrays and vibration data are driven by a few modes (Practice Code 5)
📝 Quick check (Level 2)
0/3 answered
  1. 1. σ = (4, 2, 1, 1). Smallest rank keeping ≥ 90% of the energy?
  2. 2. σ = (4, 2, 1, 1): Frobenius error at rank 2?
  3. 3. Why does truncation denoise?

Level 3: Advanced

★★★★☆ Advanced⏱ 45 minGraduate level, with full derivations and proofs.

The Eckart–Young–Mirsky theorem

Theorem (Eckart–Young, 1936; Mirsky, 1960)

For every matrix BB of rank at most kk:

∥A−B∥2≥σk+1=∥A−Ak∥2,∥A−B∥F≥∑i>kσi2=∥A−Ak∥F.\lVert A - B\rVert_2 \ge \sigma_{k+1} = \lVert A - A_k\rVert_2, \qquad \lVert A - B\rVert_F \ge \sqrt{\textstyle\sum_{i>k}\sigma_i^2} = \lVert A - A_k\rVert_F.

The truncated SVD is the best possible rank-kk approximation, in both norms (indeed in every unitarily invariant norm).

Proof (spectral norm). BB has rank at most kk, so ker⁡B\ker B has dimension at least n−kn - k. The span of v1,…,vk+1\mathbf v_1, \dots, \mathbf v_{k+1} has dimension k+1k + 1, so by dimension counting (A2.1-4) the two subspaces share a unit vector x=∑i≤k+1civi\mathbf x = \sum_{i\le k+1}c_i\mathbf v_i. Then

∥(A−B)x∥=∥Ax∥=∥∑i≤k+1ciσiui∥≥σk+1∑ci2=σk+1.\lVert(A - B)\mathbf x\rVert = \lVert A\mathbf x\rVert = \Big\lVert\sum_{i\le k+1}c_i\sigma_i\mathbf u_i\Big\rVert \ge \sigma_{k+1}\sqrt{\textstyle\sum c_i^2} = \sigma_{k+1}.

So ∥A−B∥2≥σk+1\lVert A - B\rVert_2\ge\sigma_{k+1}. ∎

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 ∥A∥∗=∑σi\lVert A\rVert_* = \sum\sigma_i 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 σ2=5\sigma_2 = 5. Frobenius error 25+4=29≈5.39\sqrt{25 + 4} = \sqrt{29}\approx5.39.

📝 Quick check (Level 3)
0/3 answered
  1. 1. σ = (9, 5, 2). The best rank-1 spectral error is…
  2. 2. Squared Frobenius error of the best rank-1 approximation for σ = (9, 5, 2)?
  3. 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 O(mnmin⁡(m,n))O(mn\min(m,n)) SVDs are too slow. Randomized SVD (Halko, Martinsson and Tropp, 2011) multiplies AA 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 σk+1\sigma_{k+1}, using only a few passes over the data. scikit-learn’s TruncatedSVD and PCA solvers use it.

🐍 Exercise 2 (research): randomized SVD
Implement the Halko–Martinsson–Tropp randomized SVD with oversampling and power iterations. Compare its error with the optimal σ₍ₖ₊₁₎.

Low rank in modern AI

  • LoRA (Hu et al., 2022): freeze W0W_0 and learn ΔW=BA\Delta W = BA of rank rr. For a 4096×40964096\times4096 layer at r=16r = 16, 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

  1. C. Eckart and G. Young (1936). “The approximation of one matrix by another of lower rank.” Psychometrika, 1.
  2. L. Mirsky (1960). “Symmetric gauge functions and unitarily invariant norms.” Quarterly Journal of Mathematics, 11.
  3. C. Tomasi and T. Kanade (1992). “Shape and motion from image streams under orthography: a factorization method.” IJCV, 9(2).
  4. E. Candès and B. Recht (2009). “Exact matrix completion via convex optimization.” Foundations of Computational Mathematics, 9.
  5. Y. Koren, R. Bell, C. Volinsky (2009). “Matrix factorization techniques for recommender systems.” IEEE Computer, 42(8).
  6. N. Halko, P.-G. Martinsson, J. Tropp (2011). “Finding structure with randomness: probabilistic algorithms for constructing approximate matrix decompositions.” SIAM Review, 53(2).
  7. T. Vogels, S. P. Karimireddy, M. Jaggi (2019). “PowerSGD: Practical low-rank gradient compression for distributed optimization.” NeurIPS.
  8. E. Hu et al. (2022). “LoRA: Low-rank adaptation of large language models.” ICLR.