NeuroGenesys.
The Geometry of LearningAcademy • Foundations • Lesson 3 of 3

Eigenvectors and the SVD: the directions that matter

7 min read • By Will Schulz • NeuroGenesys AI Academy

Most matrices in a trained network are large, but their action is often dominated by a handful of directions. Eigenvectors and the singular value decomposition find those directions, say how much each one matters, and give the provably best way to throw the rest away.

Eigenvectors: directions a map only stretches

A square matrix AA generally rotates and stretches vectors. An eigenvector is a nonzero vector whose direction AA leaves unchanged:

Av=λv.Av = \lambda v.

The scalar λ\lambda is its eigenvalue: the factor by which AA stretches (or, if negative, flips) that direction. Along an eigenvector a matrix acts like a number.

The most useful case is a symmetric matrix (A=A⊤A = A^\top), such as a covariance matrix or a Hessian of a loss. The spectral theorem guarantees that a real symmetric n×nn \times n matrix has nn real eigenvalues and an orthonormal set of eigenvectors, so

A=QΛQ⊤,A = Q \Lambda Q^\top,

with the eigenvectors as the columns of QQ and the eigenvalues on the diagonal of Λ\Lambda.[1] In the eigenvector coordinate system, the matrix is just independent scaling along each axis.

Worked example

Let A=(2112)A = \begin{pmatrix} 2 & 1 \\ 1 & 2 \end{pmatrix}. Try v1=(1,1)v_1 = (1, 1): Av1=(3,3)=3v1Av_1 = (3, 3) = 3v_1. Try v2=(1,−1)v_2 = (1, -1): Av2=(1,−1)=1⋅v2Av_2 = (1, -1) = 1 \cdot v_2. So the eigenvalues are 3 and 1, with orthogonal eigenvectors along the diagonals. AA triples everything along (1,1)(1,1) and leaves (1,−1)(1,-1) alone.

Repeated application: the dominant direction wins

Apply AA repeatedly to x=(1,0)x = (1, 0):

Ax=(2,1),A2x=(5,4),A3x=(14,13),A4x=(41,40).Ax = (2, 1), \quad A^2 x = (5, 4), \quad A^3 x = (14, 13), \quad A^4 x = (41, 40).

The vector swings towards (1,1)(1,1). Writing x=12v1+12v2x = \tfrac12 v_1 + \tfrac12 v_2 shows why: Akx=123kv1+12v2A^k x = \tfrac12 3^k v_1 + \tfrac12 v_2, and the v1v_1 component outgrows the other by a factor of 3 per step. This is power iteration, the simplest algorithm for finding the top eigenvector.

The same arithmetic explains a classical failure of recurrent networks. Backpropagating through TT time steps multiplies gradients by the recurrent weight matrix (and activation derivatives) TT times. Pascanu, Mikolov and Bengio showed that, in the linear case, a largest eigenvalue below 1 is sufficient for long-range gradient components to vanish, and a largest eigenvalue above 1 is necessary for them to explode.[2] Eigenvalues of size 0.90.9 or 1.11.1 look harmless until raised to the hundredth power: 0.9100≈2.7×10−50.9^{100} \approx 2.7 \times 10^{-5} and 1.1100≈1.4×1041.1^{100} \approx 1.4 \times 10^{4}.

Check your understanding

A symmetric matrix has eigenvalues 0.5 and 2 with orthonormal eigenvectors u1,u2u_1, u_2. A vector x=u1+u2x = u_1 + u_2 is multiplied by the matrix 10 times. What is the result, and which component dominates?

Show answer +

0.510u1+210u2≈0.001 u1+1024 u20.5^{10} u_1 + 2^{10} u_2 \approx 0.001\,u_1 + 1024\,u_2. The u2u_2 component dominates by a factor of about 10610^6: repeated application amplifies the largest eigenvalue's direction and suppresses the rest.

The SVD: every matrix, rotate–scale–rotate

Eigenvectors require a square matrix, and for non-symmetric matrices they may be complex or fail to form a basis. The singular value decomposition has no such restrictions. Any real m×nm \times n matrix can be written

W=UΣV⊤=∑i=1rσi uivi⊤,W = U \Sigma V^\top = \sum_{i=1}^{r} \sigma_i\, u_i v_i^\top,

where UU (m×mm \times m) and VV (n×nn \times n) have orthonormal columns, and Σ\Sigma is diagonal with singular values σ1≥σ2≥⋯≥σr>0\sigma_1 \ge \sigma_2 \ge \cdots \ge \sigma_r > 0, r=rank⁡(W)r = \operatorname{rank}(W).[1] Geometrically: rotate the input into the basis {vi}\{v_i\}, stretch the ii-th axis by σi\sigma_i (dropping dimensions or adding zeros to change size), then rotate into the output basis {ui}\{u_i\}. Every linear map, including every weight matrix in a network, is that sequence.

The singular values are the square roots of the eigenvalues of W⊤WW^\top W, and the right singular vectors viv_i are its eigenvectors. For a symmetric matrix with non-negative eigenvalues, like AA above, the SVD and the eigendecomposition coincide.

The SVD reads off several quantities at once:

  • Rank is the number of nonzero singular values.
  • The spectral norm ∥W∥2=σ1\|W\|_2 = \sigma_1 is the largest factor by which WW can stretch any vector. It bounds how much a layer can amplify a perturbation, which is why Miyato and colleagues stabilised GAN training by dividing each layer's weights by an estimate of σ1\sigma_1 (spectral normalisation).[3]
  • The Frobenius norm ∥W∥F=∑ijWij2=∑iσi2\|W\|_F = \sqrt{\sum_{ij} W_{ij}^2} = \sqrt{\sum_i \sigma_i^2} measures total energy across all directions.

Eckart–Young: the best low-rank approximation

Keep only the top kk terms of the sum:

Wk=∑i=1kσi uivi⊤.W_k = \sum_{i=1}^{k} \sigma_i\, u_i v_i^\top.

Eckart and Young proved in 1936 that no rank-kk matrix is closer to WW in the Frobenius norm,[4] and the error is exactly what was discarded:

∥W−Wk∥F=σk+12+⋯+σr2.\|W - W_k\|_F = \sqrt{\sigma_{k+1}^2 + \cdots + \sigma_r^2}.

(The analogous result holds in the spectral norm, with error σk+1\sigma_{k+1}.) If the singular values decay quickly, a small kk captures most of the matrix, and WkW_k needs only k(m+n+1)k(m + n + 1) numbers instead of mnmn.

Applied to a centred data matrix whose rows are examples, the top right singular vectors are the directions of greatest variance, which is principal component analysis. Pearson introduced the idea in 1901 as finding the lines and planes of closest fit to a cloud of points.[5]

Worked example: compressing AA

For A=(2112)A = \begin{pmatrix} 2 & 1 \\ 1 & 2 \end{pmatrix}, σ1=3\sigma_1 = 3 with u1=v1=12(1,1)u_1 = v_1 = \tfrac{1}{\sqrt 2}(1, 1), and σ2=1\sigma_2 = 1. The best rank-1 approximation is

A1=3 u1u1⊤=(1.51.51.51.5),A−A1=(0.5−0.5−0.50.5).A_1 = 3\, u_1 u_1^\top = \begin{pmatrix} 1.5 & 1.5 \\ 1.5 & 1.5 \end{pmatrix}, \qquad A - A_1 = \begin{pmatrix} 0.5 & -0.5 \\ -0.5 & 0.5 \end{pmatrix}.

The error's Frobenius norm is 4×0.25=1=σ2\sqrt{4 \times 0.25} = 1 = \sigma_2, as the theorem says. The approximation keeps σ12/(σ12+σ22)=9/10\sigma_1^2 / (\sigma_1^2 + \sigma_2^2) = 9/10 of the energy.

Check your understanding

A 1000×10001000 \times 1000 matrix has singular values σi=1/i\sigma_i = 1/i. Roughly what fraction of its squared Frobenius norm does the best rank-10 approximation keep, and how many numbers does it need to store compared with the full matrix?

Show answer +

∑i≤101/i2≈1.550\sum_{i\le 10} 1/i^2 \approx 1.550 versus ∑i≤10001/i2≈1.644\sum_{i \le 1000} 1/i^2 \approx 1.644, so about 94%94\%. Storage: 10×(1000+1000+1)=20,01010 \times (1000 + 1000 + 1) = 20{,}010 numbers versus 10610^6, about 2%2\%.

Low rank in modern models

These ideas explain why low-rank methods work for fine-tuning. Aghajanyan, Zettlemoyer and Gupta measured the intrinsic dimension of fine-tuning: optimising only 200 parameters, randomly projected into the full parameter space of a RoBERTa model, reached 90% of full fine-tuning performance on one paraphrase task (MRPC), and larger pretrained models tended to have lower intrinsic dimension.[6] LoRA, introduced in the previous lesson, builds the low-rank constraint into the weight update itself, ΔW=BA\Delta W = BA. Hu and colleagues report that on GPT-3, a rank as small as one sufficed for adapting the query and value projections on the tasks they examined; comparing the subspaces learned at rank 8 and rank 64, they found that the top singular directions overlapped substantially while the remaining directions did not.[7] In SVD terms, the useful part of the update was concentrated in its first few singular values.

Low rank is an empirical property of particular updates and tasks, not a law, and nothing guarantees it for a new task. The SVD is the tool for checking: compute the singular values of a learned update, and see how fast they decay.

Key takeaways

  • An eigenvector is a direction a square matrix only stretches; symmetric matrices have orthogonal eigenvectors and real eigenvalues.
  • Repeated application amplifies the largest-eigenvalue direction; this is power iteration, and in recurrent networks it is the root of vanishing and exploding gradients.
  • The SVD writes any matrix as rotate–scale–rotate. Singular values give the rank, the spectral norm (maximum stretch) and the Frobenius norm (total energy).
  • By Eckart–Young, truncating the SVD gives the best rank-kk approximation, with error equal to the discarded singular values. PCA and low-rank adaptation such as LoRA rest on this.

Sources

  1. G. Strang (2023). Introduction to Linear Algebra, 6th ed. Wellesley-Cambridge Press. https://math.mit.edu/~gs/linearalgebra/ila6/indexila6.html ↩ ↩2

  2. R. Pascanu, T. Mikolov, Y. Bengio (2013). "On the difficulty of training Recurrent Neural Networks." ICML 2013. arXiv:1211.5063. https://arxiv.org/abs/1211.5063 ↩

  3. T. Miyato, T. Kataoka, M. Koyama, Y. Yoshida (2018). "Spectral Normalization for Generative Adversarial Networks." ICLR 2018. arXiv:1802.05957. https://arxiv.org/abs/1802.05957 ↩

  4. C. Eckart and G. Young (1936). "The Approximation of One Matrix by Another of Lower Rank." Psychometrika 1(3): 211–218. https://doi.org/10.1007/BF02288367 ↩

  5. K. Pearson (1901). "On Lines and Planes of Closest Fit to Systems of Points in Space." Philosophical Magazine 2(11): 559–572. https://doi.org/10.1080/14786440109462720 ↩

  6. A. Aghajanyan, L. Zettlemoyer, S. Gupta (2020). "Intrinsic Dimensionality Explains the Effectiveness of Language Model Fine-Tuning." arXiv:2012.13255. https://arxiv.org/abs/2012.13255 ↩

  7. E. J. Hu, Y. Shen, P. Wallis, Z. Allen-Zhu, Y. Li, S. Wang, L. Wang, W. Chen (2021). "LoRA: Low-Rank Adaptation of Large Language Models." arXiv:2106.09685. https://arxiv.org/abs/2106.09685 ↩

Leadership

A word from the founder — on why the brain is the blueprint, and why the next decade of intelligence will be built here.

"The brain is the universe's only proof that general intelligence is possible. We treat it as the blueprint."

From cortical interfaces to photonic silicon, every program at NeuroGenesys exists to answer one question: how does intelligence arise — and how do we build it safely.

Will Schulz

Will Schulz

Founder, NeuroGenesys • AW3 Technology