In our previous lesson, we dove into the calculus behind neural network training, establishing backpropagation as an efficient application of the multivariate chain rule. We now shift from the continuous world of derivatives to the discrete, geometric world of linear algebra. Your goal is to move beyond just using models to understanding their structure, and this lesson provides the tools for exactly that.
Today, we will explore eigenvalues, eigenvectors, and the Singular Value Decomposition (SVD). These are not merely abstract mathematical concepts; they are the language used to describe how linear transformations act on data, how to analyze the structure of weight matrices, and how to perform powerful optimizations. By the end of this lesson, you will be able to explain what these tools are and, more importantly, why they are essential for model analysis and low-rank approximation—a technique at the heart of modern methods like LoRA, which you'll master later in this course.
1. Eigenvectors and Eigenvalues: The Skeletons of a Transformation
A linear transformation, represented by a matrix, can stretch, squish, rotate, and shear vectors in space. Amidst this complex motion, certain vectors stand out. These special vectors, called eigenvectors, are those that are not knocked off their original span by the transformation. Their direction remains unchanged; they are only scaled. The factor by which they are scaled is their corresponding eigenvalue, denoted by .
This concept provides a powerful way to understand a transformation's fundamental behavior by identifying its "axes" of action.
Eigenvectors and eigenvalues | Chapter 14, Essence of linear algebra
To build a strong visual intuition for this, watch the first part of the video "Eigenvectors and eigenvalues" from the excellent 3Blue1Brown series. It masterfully illustrates the geometric meaning of these concepts.
Watch from the beginning to grasp the core idea of vectors that stay on their span. Then, watch the segment on 3D rotation to see a practical example: the eigenvector of a 3D rotation matrix is its axis of rotation, a profound simplification of a complex transformation.
Formally, for a square matrix , a non-zero vector is an eigenvector if it satisfies the equation:
where is the scalar eigenvalue. This equation states that the action of the matrix on the vector is the same as simply scaling by .
To find these, we can rearrange the equation:
For this equation to have a non-zero solution for , the matrix must be singular, meaning it squishes space into a lower dimension. This is equivalent to its determinant being zero:
Solving this characteristic equation gives us the eigenvalues . We can then plug each back into to solve for the corresponding eigenvectors .
Eigenvectors and eigenvalues | Chapter 14, Essence of linear algebra
The same video also provides a clear walkthrough of the computation and introduces a critical related concept: the eigenbasis.
First, watch the section on the symbolic representation to see how the characteristic equation is derived and used to find eigenvalues. Then, watch the final segment on the eigenbasis. This explains that if a matrix has enough linearly independent eigenvectors to span the entire space, we can form a basis with them. In this new basis, the transformation matrix becomes diagonal, with the eigenvalues on the diagonal. This "diagonalization" dramatically simplifies matrix operations and is a core principle in linear algebra.
While powerful, eigenvalue decomposition has a major limitation: it only applies to square matrices. This is where SVD comes in.
2. Singular Value Decomposition (SVD): A Generalization for All Matrices
The Singular Value Decomposition (SVD) is one of the most important factorizations in linear algebra. It asserts that any matrix can be decomposed into three component matrices:
where:
- is an orthogonal matrix whose columns are the left-singular vectors.
- is an diagonal matrix with non-negative, sorted values on its diagonal. These are the singular values.
- is the transpose of an orthogonal matrix , whose columns are the right-singular vectors.
Geometrically, SVD states that any linear transformation can be broken down into a sequence of three fundamental operations: a rotation (or reflection) by , a scaling along the axes by , and another rotation (or reflection) by .
Singular Value Decomposition (the SVD)
For a concise introduction, watch this opening segment from Professor Gilbert Strang's lecture on SVD at MIT OpenCourseWare.
Watch from the beginning where he introduces the A = U\Sigma V^T factorization and contrasts it with the eigenvalue decomposition you just learned about, highlighting SVD's generality.
The critical insight for your work is how SVD connects to eigenvalues. Since can be rectangular, we can't find its eigenvalues directly. However, we can construct two related square, symmetric matrices: and . These matrices are always positive semidefinite, guaranteeing their eigenvalues are real and non-negative.
The connection is profound:
- The columns of (the right-singular vectors of ) are the eigenvectors of .
- The columns of (the left-singular vectors of ) are the eigenvectors of .
- The non-zero singular values of () are the square roots of the non-zero eigenvalues of both and . ().

Singular Value Decomposition (SVD), Demystified
This article provides a clear, step-by-step derivation and a numerical example that will solidify your understanding of how SVD is computed.
First, read the section under "Computing the SVD." Focus on the proof that demonstrates the connection between singular vectors/values and the eigenvectors/eigenvalues of A^TA and AA^T. Then, follow the Numerical Example. Tracing the calculation of A^TA, finding its eigenvalues (\lambda_1=9, \lambda_2=1), getting the singular values (\sigma_1=3, \sigma_2=1), and then finding the eigenvectors to form V and deriving U will make the abstract theory concrete.
3. Application 1: Low-Rank Approximation
The SVD provides a decomposition of a matrix into a sum of rank-1 matrices, ordered by importance via the singular values:
where is the rank of , and are the -th singular vectors.
Many real-world matrices, including weight matrices in neural networks, are "compressible" in the sense that their essential information is captured by the first few, largest singular values. The remaining singular values are small and can be discarded with minimal loss of information.
This leads to low-rank approximation. By keeping only the top singular values and their corresponding vectors, we can construct a new matrix that is the best possible rank- approximation of (in the Frobenius norm sense, as guaranteed by the Eckart-Young-Mirsky theorem).

This is not just a compression trick. It's a foundational technique for efficiency in modern AI.
The Singular Value Decomposition (SVD) and Low-Rank ...
These lecture notes from Stanford's CS168 course directly motivate low-rank approximation from an engineering perspective. This aligns perfectly with your goals.
Read the section Low-Rank Matrix Approximations: Motivation. Pay close attention to the applications listed: Compression: The classic example, reducing storage from O(mn) to O(k(m+n)). Updating Huge ML Models: This is a critical connection for you. The notes explicitly mention LoRA (Low-Rank Adaptation), explaining that fine-tuning updates to large models are often low-rank. This is the theoretical justification for why LoRA, which you will build in Module 6, is so effective. De-noising: Discarding small singular values often corresponds to removing noise.
A classic visual example is image compression. An image can be represented as a matrix of pixel values. By performing a low-rank approximation via truncated SVD, we can drastically reduce the amount of data needed to store the image while preserving most of the visual content.
Singular Value Decomposition (SVD), Demystified
To see this in action, review the image compression example in the Towards Data Science article.
Read the section Image Compression. Observe how an image reconstructed with just k=100 components (out of 1600) is nearly identical to the original, demonstrating the power of low-rank approximation.
4. Application 2: Model and Data Analysis (PCA)
Beyond approximation, SVD is the engine behind Principal Component Analysis (PCA), a cornerstone of data analysis. PCA seeks to find the directions of maximum variance in a dataset—the "principal components."
Given a data matrix where each row is a data point, the principal components are precisely the eigenvectors of the covariance matrix . As we established earlier, the eigenvectors of are the right-singular vectors of (the columns of , or rows of ).
Therefore, computing the SVD of your data matrix directly gives you the principal components. The singular values are related to the amount of variance captured by each component, so they tell you which components are most important for describing the data.
The Singular Value Decomposition (SVD) and Low-Rank ...
The Stanford notes provide a rigorous but clear explanation of this link.
Read the section PCA Reduces to SVD. It shows the derivation X⊤X = VDV⊤, proving that the right-singular vectors of the data matrix X are the eigenvectors of the covariance matrix X^TX. This means "the SVD of X hands you these eigenvectors on a silver platter." This connection is fundamental to using linear algebra for data analysis.
In the context of AI, you can apply this to analyze weight matrices, activation patterns, or embedding spaces to understand the dominant "concepts" or features learned by a model.
Conclusion
In this lesson, we transitioned from the calculus of optimization to the linear algebra of structure. You've now equipped yourself with a set of powerful analytical tools that are central to modern AI engineering.
The key takeaways are:
- Eigenvectors and eigenvalues reveal the intrinsic axes of a linear transformation, showing directions that are purely scaled.
- Singular Value Decomposition (SVD) generalizes this idea to any matrix (), breaking it down into rotation, scaling, and rotation.
- The components of SVD are deeply connected to eigenvalues: the singular vectors of are the eigenvectors of and .
- Low-rank approximation via truncated SVD is the optimal way to compress a matrix, forming the theoretical basis for techniques like LoRA.
- SVD is the computational engine behind PCA, allowing you to find the most significant patterns and directions of variance in your data or model components.
You now have the necessary calculus and linear algebra foundations. In our next lesson, we will add the third pillar of our mathematical toolkit: probability. We will explore the probabilistic interpretation of common loss functions like Cross-Entropy, connecting them to the principle of maximum likelihood estimation. This will give you a deeper understanding of why we choose certain objective functions when training our models.