Skip to content
AI.info

Mathematical foundations

Singular Value Decomposition and Low-Rank Structure

Understand the SVD, low-rank approximation, pseudoinverses, compression, denoising, and the geometric foundation of PCA.

By the end you can

Example

115 faces, 128 × 128 pixels, about 40 numbers each

A face photograph is a grid of pixels, and a grid of pixels is a matrix. In 1987 L. Sirovich and M. Kirby asked how few ordered patterns could stand in for one. They assembled a file of 115 face photographs, each divided into 128 × 128 picture elements. Their introduction states the answer rather than promising it: “we show, through actual construction, that roughly 40 numbers giving the admixture of eigenpictures characterize a face to within 3% error”. That is the low-rank claim in its concrete form. A matrix of pixels, approximated by a short sum of rank-one patterns. The error stated as a number rather than as a hope.

  • Rank-one component: σ₁u₁v₁ᵀ captures the strongest separable row–column pattern — over the file of 115 pictures, the single eigenpicture that best accounts for all of them at once.
  • Additional components: Each singular triplet adds detail the earlier components did not represent. Sirovich and Kirby needed roughly 40 of them before the reconstruction error came down to 3%.
  • Compression: Storing k vectors and values can require far fewer numbers than the full image when k is small — here, about 40 coefficients in place of a grid of 128 × 128 picture elements.
  • Denoising: Weak components may contain noise, but small singular values are not automatically noise. What the 40-coefficient reconstruction leaves behind is the 3% error, and that residue is discarded signal as much as it is noise.
  • Evaluation: Choose k from visual quality or downstream task performance, not from explained energy alone. Four years later Turk and Pentland ran the same construction as a recogniser, over a database of over 2,500 face images: sixteen subjects digitised at three head orientations, three head sizes or scales, and three lighting conditions. They reported “approximately 96% correct classification averaged over lighting variation, 85% correct averaged over orientation variation, and 64% correct averaged over size variation”. One representation, one k, three different verdicts depending on which factor moved.

The SVD works even when eigenvectors do not

For any real m×n matrix A, the singular value decomposition writes A = UΣVᵀ. The columns of V are orthogonal input directions, Σ contains nonnegative gains, and U gives the corresponding output directions. This three-part view separates orientation from strength. A matrix rotates or reflects into a principal coordinate system, scales each direction, then maps into the output space. Unlike eigendecomposition, the SVD applies to rectangular matrices. It does not require a complete eigenbasis.

The singular values reveal how strongly a matrix transmits each principal direction.

Example

A patented k: one hundred dimensions against a rank in the tens of thousands

A truncated SVD expresses a matrix as a sum of rank-one outer products ordered by singular value. Latent semantic indexing is that construction shipped as a product. Seven inventors at Bell Communications Research filed it in September 1988 and were granted US Patent 4,839,853 in June 1989. The patent puts the method in a single sentence: “A reduced SVD is employed to approximate the original matrix in terms of a much smaller number of orthogonal dimensions.” The matrix is terms against documents. The rank-one components are latent topics. And, unusually for a patent, the specification commits to a number for k.

  • First component: σ₁u₁v₁ᵀ captures the strongest transmission direction — in a term-document matrix, the single term-pattern-by-document-pattern pairing that explains the most co-occurrence.
  • Second component: σ₂u₂v₂ᵀ adds the next orthogonal pattern, constrained to be orthogonal to the first rather than merely different from it.
  • Truncation: Keeping k components gives the best rank-k approximation under common unitarily invariant norms. The patent fixes k by a stated rule — “The value of k is chosen for each application; it is generally such that k >= 100 for collections of 1000-3000 data objects”, adding that “For diverse information sources, 100 or more dimensions may be needed”.
  • Residual: Omitted components contain both weak signal and noise. In latent semantic indexing the discarded directions are most of the matrix. Introduction to Information Retrieval describes a term-document matrix with “a rank in the tens of thousands” reduced to a k in the hundreds, so the great majority of the spectrum is deliberately thrown away.
  • Validation: Downstream usefulness must be checked, because retained energy is not identical to retained meaning. The value that survived experiment, rather than derivation, is small and stable. The same book, published in 2008, records that “In the experimental work cited later in this section, [k] is generally chosen to be in the low hundreds”.

Analogy

A prism separates a mixed beam into independent channels

A prism decomposes an incoming signal into orthogonal channels, attenuates or amplifies each one, then recombines them into an output signal. The right singular vectors are the input channels, the singular values are the gains, and the left singular vectors are the output patterns. Unlike a prism’s fixed spectrum, these channels are derived from the matrix itself. They can be unstable when singular values are nearly tied.

The SVD exposes independent transmission channels ordered by strength.

Rank is the number of nonzero transmission channels

The rank of A equals the number of nonzero singular values. In noisy data, exact zeros are rare, so practitioners also inspect effective rank or the decay pattern. A steep spectrum suggests that a few directions carry most of the matrix’s energy. A flat spectrum indicates that aggressive compression will discard substantial structure. The best rank-k approximation under common matrix norms is obtained by keeping the k largest singular values and corresponding vectors. This is the Eckart–Young result.

The name on the theorem is narrower than the theorem, and later than it too. Carl Eckart and Gale Young published their version in Psychometrika in 1936. Erhard Schmidt had proved it twenty-nine years earlier, in 1907, in a paper on linear and nonlinear integral equations. G. W. Stewart's history of the SVD makes the correction: “Eckart and Young [12, 1936], [13, 1939] extended it to rectangular matrices and rediscovered Schmidt's approximation theorem, which is often (and incorrectly) called the Eckart–Young theorem.” Leonid Mirsky then proved the general case in 1960. His version holds in every unitarily invariant norm. The Frobenius norm is one instance.

What a steep spectrum is worth in production can be read off a single system. LoRA, published in June 2021, freezes a pre-trained model’s weights and trains injected rank-decomposition matrices instead. The bet is that the update a fine-tune needs is low-rank even when the weight matrix is not. The abstract prices the bet: “Compared to GPT-3 175B fine-tuned with Adam, LoRA can reduce the number of trainable parameters by 10,000 times and the GPU memory requirement by 3 times.” The method matched or beat full fine-tuning on RoBERTa, DeBERTa, GPT-2 and GPT-3, and added no inference latency. Ten thousand times fewer trainable parameters is what an assumption about rank buys when it is correct.

Steps

Using low-rank structure responsibly

A spectrum is evidence, not an automatic compression policy.

FigureProcess · 5 steps
  1. 1. Define the matrix

    State what rows, columns, and entries mean.

  2. 2. Apply required centering or scaling

    Match preprocessing to the statistical question.

  3. 3. Inspect the spectrum

    Look for decay, gaps, ties, and sensitivity across resamples.

  4. 4. Compare reconstruction and task error

    Do not rely on explained energy alone.

  5. 5. Test stability

    Check whether selected subspaces persist under noise, seeds, and data slices.

Visual

A matrix as rotate–scale–rotate

The familiar phrase is approximate because U and V can change dimension. But it captures the geometry.

FigureProcess · 4 steps
  1. 1. Express in V coordinates

    Vᵀ decomposes the input into orthogonal right-singular directions.

  2. 2. Scale by Σ

    Each coordinate is multiplied by a nonnegative singular value.

  3. 3. Express in U coordinates

    U maps the scaled components into orthogonal output directions.

  4. 4. Observe discarded directions

    Zero singular values identify input directions annihilated by A.

Right singular vectors describe input modes; left singular vectors describe their output images.

Key idea

Two principal components of a genotype matrix redraw the map of Europe

If X is a centered data matrix, its right singular vectors give principal feature directions. Squared singular values, scaled by sample convention, correspond to covariance eigenvalues. PCA is a statistical construction about variation in observations.

SVD is a matrix factorization. It applies whether or not rows are samples, and whether or not the matrix has been centered. Failing to center changes the direction being summarized; failing to scale can let high-unit-variance features dominate.

What a rank-2 summary of a real centred matrix looks like was settled in 2008. Genotype data from 197,146 loci in 1,387 individuals, each person plotted by their first two principal components — and the plot came out as a map. The first component correlated with latitude at r² = 0.71, the second with longitude at r² = 0.72. After rotation, r² = 0.77 and r² = 0.78. Novembre and eleven colleagues reported it in Nature, and their abstract states the finding without hedging: “a geographical map of Europe arises naturally as an efficient two-dimensional summary of genetic variation in Europeans”. Nobody supplied the coordinates. The centring, the covariance and the two leading singular directions did it. An independent consortium replicated the result in the same month, in Current Biology, using 309,790 SNPs in 2,457 individuals from 23 sampling sites in 20 countries, where “the first two PCs were found to account for 31.6% and 17.3%, respectively, of the total variation”. Note the size of those percentages against the strength of the result. Two directions carrying under half the variance were enough to reconstruct a continent.

SVD is the algebraic engine; PCA adds a data interpretation and preprocessing choices.

Comparison

Truncation and shrinkage handle weak directions differently

Both methods reduce sensitivity to small singular values, but they impose different preferences.

Hard truncation is not condemned to be arbitrary. Matan Gavish and David Donoho derived the exact threshold in 2014. For an n-by-n matrix in noise of level sigma, the AMSE-optimal hard threshold is (4/sqrt(3))·sqrt(n)·sigma, about 2.309·sqrt(n)·sigma. When sigma is unknown, the rule becomes 2.858 times the median empirical singular value. Their abstract makes the strongest available claim for it: “it is always better than hard thresholding at any other value, no matter what the matrix is that we are trying to recover, and is always better than ideal Truncated SVD (TSVD), which truncates at the true rank of the low-rank matrix we are trying to recover.” Read that second clause slowly. Truncating at the true rank is provably not optimal. Thresholding at their value guarantees an AMSE of at most 3·n·r·sigma², against 5·n·r·sigma² for truncating at the true rank. Data-Driven Science and Engineering restates the rule with a worked case — n = 600, sigma = 1, cutoff tau approximately 56.6 — and disposes of the habit it replaces. Of energy-based truncation it says: “Although crude, this technique is commonly used.”

The cost of no stabilization at all is also on public record. The US National Institute of Standards and Technology publishes a certified least-squares benchmark named Filip: 82 observations, a 10th-degree polynomial with 11 parameters, classified “Higher Level of Difficulty”. The certified intercept is B0 = -1467.48961422980, the residual standard deviation 0.334801051324544E-02, the R-squared 0.996727416185620. The certified answers exist; the question is whether software can reach them. Allin Cottrell benchmarked the gretl econometrics package against the NIST values and recorded 0 correct significant digits on Filip with the standard solver: “gretl refuses to produce estimates due to a high degree of multicollinearity (the popular commercial econometrics program Eviews 3.1 also baulks at this regression).” Two shipping regression packages, one certified dataset, zero correct digits. Only the multiple-precision GMP plugin reached 12. That is what dividing at full inverse strength by singular values close to zero does to a problem that looks well posed.

FigureComparison · 3 columns

Hard truncation

Discard singular directions below a chosen rank or threshold.

  • Produces an explicitly low-rank matrix
  • Simple compression interpretation
  • Can create an abrupt decision boundary
  • Useful when a low-dimensional signal model is credible

Tikhonov or ridge shrinkage

Reduce the influence of weak directions smoothly.

  • Avoids dividing strongly by tiny singular values
  • Retains all directions with graded influence
  • Corresponds to an L2 preference on coefficients
  • Often more stable under uncertain rank

No stabilization

Use every singular direction at full inverse strength.

  • Matches exact algebra in noiseless well-conditioned cases
  • Amplifies noise along tiny singular values
  • Creates high-variance coefficient estimates
  • Rarely appropriate for ill-posed data

Key takeaways