Skip to main content

Someone wanted to learn this too, so Grasp built them a personal learning path.

You can keep exploring this one or create your own

SVD: Decomposing Linear Transformations

Introduction

In our last lesson, we explored how eigendecomposition, , reveals the principal axes of a linear transformation. We saw that for matrices with a full set of eigenvectors, the transformation is fundamentally a simple scaling along these axes. However, this powerful picture has a limitation: it doesn't apply to all matrices. A shear transformation, for example, doesn't have enough eigenvectors to form a basis, and rectangular matrices don't have eigenvectors at all.

This raises a crucial question: Is there a more general geometric decomposition that works for any matrix? Can we find an intuitive geometric meaning—a set of principal axes—for transformations like shears, or even for maps between different dimensions (e.g., from to )?

The answer is a resounding yes, and it is given by the Singular Value Decomposition (SVD). This lesson will focus on developing the powerful geometric intuition behind SVD. We will see that any linear transformation, no matter how complex, can be broken down into a sequence of three fundamental operations: a rotation, a scaling, and another rotation.

The Universal Geometric Recipe: Rotation, Scaling, Rotation

The Singular Value Decomposition states that any matrix can be factored into the product of three other matrices:

where:

  • is an orthogonal matrix. Geometrically, it represents a rotation (and possibly a reflection) in the input space .
  • (Sigma) is an diagonal matrix. Its diagonal entries, , are the singular values of . Geometrically, this matrix performs a scaling along the new, rotated axes. If the dimensions and differ, it also handles the change in dimension.
  • is an orthogonal matrix. It represents a final rotation in the output space .
This diagram illustrates the core idea of SVD: any matrix transformation `M` can be decomposed into a sequence of a rotation (`Váµ€`), a stretch (`S`), and a final rotation (`U`).

The profound insight of SVD is that even the most complex-looking transformations, like shears, are just simple axis-aligned scaling operations viewed from a "tilted" perspective. SVD finds the perfect "un-tilting" and "re-tilting" rotations to reveal this simple scaling at the core.

Deconstructing a Shear Transformation

Let's use a shear transformation as a test case. As we saw, a shear is tricky for eigendecomposition. However, SVD handles it with ease. The key idea is that we can break down the shear into a sequence of simpler, more intuitive steps.

The following article provides a superb visual and textual explanation for this exact process.

Six (and a half) intuitions for SVD - LessWrong

This excerpt from the LessWrong article "Six (and a half) intuitions for SVD" demonstrates how a complex shear can be decomposed.

Please read the section titled Rotations and Scalings. Pay close attention to the diagrams that show a grid being transformed. Observe how the initial rotation (Váµ€) aligns the grid, the scaling (S) stretches it, and the final rotation (U) moves it into the final sheared position.

As you saw, the process unfolds in three steps:

  1. First Rotation (): This initial rotation aligns a specific set of orthogonal vectors in the input space with the standard coordinate axes (). These aren't just any vectors; they are the special directions that will remain orthogonal after being transformed by . These are called the right singular vectors and form the columns of .
  2. Scaling (): With the input space correctly aligned, the transformation becomes a simple scaling. The space is stretched or squished along each axis. The amount of scaling on each axis is given by the corresponding singular value . If the matrix is rectangular, this step also adds or removes dimensions.
  3. Second Rotation (): The scaled vectors now lie along the axes of the output space. This final rotation moves them into their final orientation. The destination axes for this rotation are the left singular vectors, which form the columns of .

The Canonical Visualization: Transforming a Sphere

Perhaps the most fundamental geometric interpretation of SVD is its effect on a unit sphere (or a unit circle in 2D). For any matrix , the transformation maps the unit sphere in the input space to an ellipsoid in the output space.

SVD reveals the geometry of this transformation:

  • The right singular vectors (, columns of ) are the orthogonal vectors on the input unit sphere that become the principal axes of the output ellipsoid.
  • The left singular vectors (, columns of ) are the orthogonal principal axes of the output ellipsoid.
  • The singular values () are the lengths of these principal axes.

The following article develops this idea from first principles, starting with a simple square.

Singular Value Decomposition as Simply as Possible

This blog post by Gregory Gundersen provides an excellent, jargon-free explanation of the geometric meaning of SVD.

Read the section SVD without jargon, focusing on the intuition of transforming a square into a rectangle via rotation and scaling (Figure 4). Then, continue reading the next section which extends this to a circle and an ellipse (Figure 5), and explains how singular values relate to the axes of the ellipse.

This circle-to-ellipse mapping is the heart of SVD's geometry. The entire complex deformation of space caused by is captured by identifying the principal axes of this resulting ellipsoid (), determining how much they were stretched (), and finding which input vectors gave rise to them ().

Putting It All Together: A Visual Summary

We have seen the components of SVD in action. Now, let's watch a video that animates the entire process, showing how the three operations compose to produce the final transformation.

SVD Visualized, Singular Value Decomposition explained | SEE Matrix , Chapter 3 #SoME2

The video "SVD Visualized" from the Visual Kernel channel provides a comprehensive and elegant animated explanation of the SVD process.

You can start with the introduction for motivation and the brief review of matrix effects. The most crucial part is the main visualization from this segment. Watch carefully as it applies the sequence of Vᵀ (rotation), Σ (scaling and dimension change), and U (rotation) to transform a sphere into an ellipse.

The following image provides a static summary of the two equivalent paths to transform a set of points, as shown in the video.

This diagram shows that the direct transformation of a set of points via matrix A is geometrically equivalent to the three-step process of SVD: a rotation by Váµ€, a scaling by S, and a final rotation by U.

Bridging Geometry and Algebra

We have established the geometric picture. Now, let's briefly connect this intuition back to the algebraic formulation.

We said that the right singular vectors are mapped to the axes of the output ellipse, which are the left singular vectors scaled by the singular values .

Question: Based on this description, how would you write an equation that relates a single vector to its transformed counterpart using the matrix , the vector , and the scalar ?

Answer The transformation of $\vec{v}_i$ by $A$ results in the vector $\vec{u}_i$ scaled by $\sigma_i$. So, the equation is: $$ A\vec{v}_i = \sigma_i \vec{u}_i $$

This simple equation holds for all . We can stack these vector equations side-by-side into a single matrix equation:

This can be rewritten more compactly. The left side is simply . The right side can be factored into the product of the matrix of left singular vectors and the diagonal matrix of singular values . This gives us:

Finally, since is an orthogonal matrix, its inverse is its transpose (). Right-multiplying by gives us the familiar form of the SVD:

This shows how the geometric picture of mapping orthogonal input vectors to orthogonal output vectors directly leads to the algebraic decomposition.

Conclusion

In this lesson, we established the geometric foundation of the Singular Value Decomposition. Unlike eigendecomposition, which is limited to certain square matrices, SVD provides a universal and intuitive way to understand any linear transformation.

Key Takeaways:

  • Universal Decomposition: Any matrix can be decomposed into .
  • Geometric Meaning: This decomposition represents any linear transformation as a sequence of three simpler operations: an initial rotation (), an axis-aligned scaling (), and a final rotation ().
  • Sphere to Ellipsoid: SVD formalizes the idea that any linear map transforms a unit sphere into an ellipsoid. The singular vectors ( and ) define the principal axes of this mapping, and the singular values () define the extent of stretching along those axes.

We now have a solid intuition for what SVD is and why it's so fundamental. But how do we actually find the matrices , , and for a given matrix ? In our next lesson, we will answer this question by deriving the full algebraic procedure for computing the SVD, revealing a deep and elegant connection back to the eigendecomposition of the symmetric matrices and .

Can't find a good explanation? Sign up and we'll make it for you

Sign up