33.6 Further Reading
This section connects the linear algebra developed in this chapter to numerical analysis, random matrix theory, and deep-learning applications, followed by a curated list of textbooks and courses covering the chapter’s core material. If your main interest is deep learning, start with random projections, iterative solvers, random matrices and trainable depth, and sketching, then jump to the final two entries on low-rank attention and spectral-norm optimizers. Nothing elsewhere in the book depends on this section.
33.6.1 Geometry and Linear Maps
33.6.1.1 Other Inner Products: Kernel Methods
The nearest-mean rule of Section 33.1.4.2 classifies a test image by comparing it with two class averages through a single dot product, which forces the decision boundary to be a flat hyperplane. That simplicity breaks down whenever a class is curved or split into clusters, as happens when distinguishing t-shirts from shirts. Kernel methods keep the exact same geometric rule and change only the inner product: we replace \(\mathbf{x}\cdot\mathbf{x}_i\) by a similarity function \(k(\mathbf{x},\mathbf{x}_i)\) that corresponds to a genuine inner product in some other, possibly infinite-dimensional, feature space. The class average becomes a mean in that hidden space, every training example votes with weight \(k(\mathbf{x},\mathbf{x}_i)\), and the resulting boundary can bend freely in the original input space. Asking which training points actually need nonzero weights leads directly to the support vector machine. Schölkopf and Smola (2002) open their book with this very classifier and build the full theory of kernel methods from it.
33.6.1.2 Random Projections
In Section 33.1, we saw that random directions in high-dimensional space \(\mathbb{R}^d\) are almost orthogonal to one another. Surprisingly, that geometric quirk lets us shrink the dimension of a dataset without looking at the data at all. The Johnson–Lindenstrauss lemma (Johnson and Lindenstrauss 1984) guarantees that for any collection of \(n\) points, multiplying by a suitably scaled random Gaussian matrix into \(k\) dimensions of order \(\varepsilon^{-2}\log n\) preserves all \(\binom{n}{2}\) pairwise distances within a factor of \(1\pm\varepsilon\), with high probability. Unlike principal component analysis (Section 33.5.2.2), a random projection is completely data-independent, and its target dimension \(k\) does not even depend on the ambient dimension \(d\). The trick therefore pays off most when \(d\) is vastly larger than \(\varepsilon^{-2}\log n\). Dasgupta and Gupta (2003) give a remarkably short proof with explicit constants, while Vershynin (2018) situates the lemma inside the broader theory of concentration for random vectors.
33.6.1.3 Solving Linear Systems at Scale
In Section 33.2.2.4, we solved linear systems via LU factorization and noted that the inverse of a large sparse matrix is typically dense. Why does Gaussian elimination with partial pivoting work so reliably in floating-point arithmetic, even though pathological worst-case matrices exist? Trefethen and Bau (1997) give an illuminating explanation of this gap between worst-case and practical stability, and Higham (2002) provides the definitive rounding-error analysis.
At large scale, sparse solvers never form \(\mathbf{A}^{-1}\), and often avoid forming dense LU factors altogether. Sparse direct methods carefully reorder the unknowns so that elimination introduces as few new nonzeros as possible. Iterative methods go a step further and access the matrix solely through matrix–vector products \(\mathbf{A}\mathbf{x}\), much like power iteration (Section 33.4.1.2). When \(\mathbf{A}\) is symmetric positive definite, the conjugate gradient method of Hestenes and Stiefel (1952) shrinks the error after \(k\) steps by at least a factor of \(2\bigl((\sqrt\kappa-1)/(\sqrt\kappa+1)\bigr)^k\) in the norm induced by \(\mathbf{A}\), where \(\kappa\) is the condition number from Section 33.5.3.2. Golub and Van Loan (1996) treat conjugate gradient and its relatives in full detail.
33.6.1.4 Contraction Order and Tensor Decompositions
The einsum notation of Section 33.2.1.4 specifies the mathematical result of contracting several tensors, but it leaves open the order in which pairwise contractions are carried out. That choice can make a dramatic difference: for \(n\times n\) matrices, computing \((\mathbf{A}\mathbf{B})\mathbf{x}\) takes roughly \(n^3\) multiplications, whereas \(\mathbf{A}(\mathbf{B}\mathbf{x})\) takes only \(2n^2\). When many factors are involved, choosing the cheapest order becomes a search over parenthesizations, which np.einsum(..., optimize=True) and the opt_einsum package (Smith and Gray 2018) automate.
The idea of low-rank approximation also extends beyond matrices to higher-order tensors, though with a sobering catch. A three-way tensor can be written as a sum of rank-one outer products \(\mathbf{a}_i\otimes\mathbf{b}_i\otimes\mathbf{c}_i\) (the CP decomposition), as a small core tensor multiplied by a factor matrix along each mode (the Tucker decomposition), or as a chain of three-way cores (the tensor train of Oseledets (2011)). Unfortunately, nothing as clean as the Eckart–Young theorem holds in general for tensors: determining the CP rank is NP-hard, and a best approximation of a given CP rank may not even exist. The survey by Kolda and Bader (2009) is the standard guide to CP and Tucker decompositions and their algorithms.
33.6.2 Eigenvalues and Spectra
33.6.2.1 Computing Eigenvalues in Practice
There is no formula in radicals for the roots of a general polynomial of degree five or higher, so every practical eigensolver must iterate. Worse still, no production library forms the characteristic polynomial of Section 33.3.1.2, because the roots of a polynomial can be extraordinarily sensitive to tiny rounding errors in its coefficients. Instead, eig first applies orthogonal similarity transformations to reduce the matrix to Hessenberg form (zero everywhere below the first subdiagonal), which takes \(O(n^3)\) operations. It then runs the shifted QR algorithm: factor \(\mathbf{H}-\mu\mathbf{I}=\mathbf{Q}\mathbf{R}\), form \(\mathbf{R}\mathbf{Q}+\mu\mathbf{I}\), and repeat. Every step is a similarity transformation, so the eigenvalues never change, while the subdiagonal entries shrink toward zero and the diagonal reveals the spectrum (complex conjugate pairs of a real matrix settle into \(2\times 2\) diagonal blocks). For symmetric matrices, the Hessenberg form is tridiagonal, and eigh exploits that structure for major speedups. Trefethen and Bau (1997) derive the QR algorithm cleanly from power iteration on subspaces, and Golub and Van Loan (1996) supply the production engineering details.
33.6.2.2 Pseudospectra and the Kreiss Matrix Theorem
In Section 33.4.2.4, we saw that for a non-normal matrix, eigenvalues inside the unit disc do not prevent large transient growth in \(\|\mathbf{A}^k\|_2\). The Kreiss matrix theorem turns the visual intuition of pseudospectra into a quantitative bound. Defining the Kreiss constant as \(K(\mathbf{A})=\sup_{|z|>1}(|z|-1)\|(z\mathbf{I}-\mathbf{A})^{-1}\|_2\), the theorem brackets the worst-case power norm for any \(n\times n\) matrix: \(K(\mathbf{A})\le\sup_k\|\mathbf{A}^k\|_2\le e\,n\,K(\mathbf{A})\). You can prove the lower bound in an exercise in Section 33.4; the upper bound guarantees that a matrix whose pseudospectra hug the unit disc closely cannot experience unbounded transient growth. Trefethen and Embree (2005) develop this theory thoroughly, including its classic application to fluid flows that transition to turbulence even when every linearized eigenvalue is strictly stable.
33.6.2.3 Mixing Times and the Spectral Gap
In the two-page Markov chain of Section 33.3, the distance to the stationary distribution shrinks by a factor of 4 at every click because the second eigenvalue is \(1/4\). How many steps does a general Markov chain need to mix? For a reversible chain, let \(\lambda_\star\) be the largest modulus among all eigenvalues other than \(1\). The number of steps required to come within total variation distance \(\varepsilon\) of the stationary distribution is bounded both above and below by multiples of \(1/(1-\lambda_\star)\), where the constants depend on \(\varepsilon\) and on the smallest stationary probability. For a lazy chain—one that stays at its current state with probability at least \(1/2\)—all eigenvalues are nonnegative, so \(\lambda_\star\) is simply the second eigenvalue \(\lambda_2\). Cheeger’s inequality then links the spectral gap \(1-\lambda_2\) from both sides to the chain’s conductance, the smallest probability flow leaving any subset relative to its stationary mass. In other words, you can read the convergence rate directly from the bottlenecks of the graph. Levin and Peres (2017) present this theory with great clarity, alongside the convergence results that Section 33.4.1.3 cites from Horn and Johnson (2012) .
33.6.2.4 Random Matrices and Trainable Depth
In Section 33.4.2.5, we observed that the spectral radii of individual layer Jacobians do not control the behavior of a long product of Jacobians. What, then, determines whether a very deep network can be trained from initialization? Saxe et al. (2014) solve the learning dynamics of deep linear networks exactly and show that orthogonal initial weights keep the training time independent of depth, whereas scaled Gaussian weights cause learning to slow down as depth grows. Extending the analysis to nonlinear networks, Pennington et al. (2017) use free probability to compute the full singular value distribution of the input–output Jacobian. They show that dynamical isometry, the regime in which all singular values cluster tightly near \(1\), is achievable with orthogonal weights and \(\tanh\) activations but not with ReLU, and that networks initialized in this regime train substantially faster at large depth.
33.6.2.5 Spectra of Trained Weights
The Marchenko–Pastur law of Section 33.3.2.4 describes the singular value spectrum of a matrix of pure independent noise, which is what the weight matrices of a freshly initialized network look like. Martin and Mahoney (2021) compare the spectra of trained neural network weights against this random-matrix baseline and observe that training produces both sharp outliers and a heavy, power-law tail. They interpret the tail exponent as a signature of implicit self-regularization. While this departure from Marchenko–Pastur appears consistently across many architectures, using the tail exponent to rank model quality without evaluating on test data remains an empirical correlation rather than a proven theorem.
33.6.3 Low Rank Beyond the Truncated SVD
33.6.3.1 Matrix Completion and the Nuclear Norm
A movie-ratings matrix might have only a few percent of its entries observed, whereas the Eckart–Young theorem (Section 33.5.2.1) requires knowing the entire matrix up front. Matrix completion bridges this gap by minimizing the nuclear norm \(\|\mathbf{Z}\|_*=\sum_i\sigma_i\), which serves as a convex stand-in for matrix rank in the same way that the \(\ell_1\) norm stands in for vector sparsity, subject to matching all observed entries. Candès and Recht (2009) prove that this convex optimization problem recovers an underlying low-rank matrix exactly, with high probability, from far fewer than \(n^2\) randomly observed entries, provided its singular vectors are spread out across the coordinates rather than concentrated on a few spikes. Soft-Impute (Mazumder et al. 2010) solves the penalized version of this problem by alternating a fill-in step with soft-thresholding of the singular values.
33.6.3.2 CUR Decompositions and Sketching
Although the truncated SVD is optimal in approximation error, its singular vectors mix together all rows and columns, making them difficult to interpret, and computing a full SVD of an \(m\times n\) matrix costs \(O(mn\min(m,n))\) operations. A CUR decomposition instead builds an approximation from actual columns \(\mathbf{C}\) and actual rows \(\mathbf{R}\) of the data matrix, linked by a small core matrix \(\mathbf{U}\). In Section 33.5.2.1, we saw that the naive strategy of picking the columns with the largest norms loses badly to the truncated SVD. Mahoney and Drineas (2009) show how to fix this: sampling columns and rows according to their leverage scores, the squared lengths of their projections onto the top singular vectors, gets within a small constant factor of the Eckart–Young error with high probability.
More broadly, the randomized range finder of Section 33.5.4.3 is one example of sketching: multiply a large matrix by a thin random matrix and solve the problem on the much smaller sketch. Woodruff (2014) surveys how this same idea accelerates least squares and regression, returning a solution within a \(1+\varepsilon\) factor of optimal from a sketch with far fewer rows than the original dataset.
33.6.3.3 Adapter Variants
LoRA (Section 33.5.4.1) initializes its low-rank update \(\mathbf{B}\mathbf{A}\) with \(\mathbf{B}=\mathbf{0}\) and a random \(\mathbf{A}\), which means the earliest gradient steps see the input only through a random \(k\)-dimensional subspace unrelated to the pretrained weight. Several variants change this initialization or parameterization in simple ways. PiSSA (Meng et al. 2024) initializes \(\mathbf{B}\mathbf{A}\) to the rank-\(k\) truncated SVD of the pretrained weight and freezes the residual, so fine-tuning immediately adapts the principal directions of the original matrix. DoRA (Liu et al. 2024) decomposes each weight column into a scalar magnitude and a unit direction, trains the magnitudes directly, and applies the low-rank update only to the directions.
33.6.3.4 Low Rank in Attention
Self-attention over a sequence of \(n\) tokens forms an \(n\times n\) score matrix, and several efficient architectures in the attention chapters replace either that matrix or its key–value cache with a low-rank factorization. Linear attention (Section 10.6) expresses the attention scores as feature dot products \(\phi(\mathbf{q})\cdot\phi(\mathbf{k})\), capping the rank of the score matrix at the feature dimension. Multi-head latent attention (Section 11.3.3.2) (DeepSeek-AI 2024) compresses the cache by storing a single low-dimensional latent vector per token instead of separate keys and values for every head. Linformer (Wang et al. 2020) starts from the empirical observation that trained attention matrices have rapidly decaying singular values, and projects the keys and values along the sequence dimension down to a fixed length.
33.6.3.5 Steepest Descent under Other Norms
In Section 33.5.4.2, we computed the polar factor \(\mathbf{U}\mathbf{V}^\top\) of a gradient matrix. Geometrically, this matrix is the steepest-descent direction when step sizes are measured in the spectral norm rather than the Euclidean norm. Bernstein and Newhouse (2024) turn that observation into a unifying lens for deep-learning optimizers: with their moving averages turned off, Adam reduces to sign descent (steepest descent under the \(\ell_\infty\) norm), while Shampoo reduces to steepest descent under the spectral norm. From this viewpoint, choosing the right norm for each layer is the core design decision, and the update rule follows automatically. The spectral-norm optimizer built on this idea is developed in Section 9.6.
33.6.4 Books, Courses, and Notes
Books
- Mathematics for Machine Learning by Deisenroth, Faisal, and Ong: a free textbook whose Chapters 2 (Linear Algebra), 3 (Analytic Geometry), and 4 (Matrix Decompositions) cover the material of this chapter from a machine-learning perspective.
- Introduction to Applied Linear Algebra: Vectors, Matrices, and Least Squares by Boyd and Vandenberghe: a free book with slides and code organized around least squares and data, pairing well with Section 33.1 and Section 33.5.
- Introduction to Linear Algebra, 6th ed. and Linear Algebra and Learning from Data by Gilbert Strang: the classic introduction built around the column picture and the four fundamental subspaces, and its SVD-centered companion for data analysis and optimization.
- Linear Algebra Done Right, 4th ed. by Sheldon Axler: a free, determinant-free treatment of eigenvalues, operators, and the spectral theorem (Section 33.3).
- Numerical Linear Algebra by Trefethen and Bau: an accessible treatment of conditioning, stability, QR, and the floating-point algorithms behind
solve,eig, andsvd.
Courses and Tutorials
- MIT 18.06 Linear Algebra and MIT 18.065 Matrix Methods in Data Analysis, Signal Processing, and Machine Learning by Gilbert Strang: complete lecture courses with notes and problem sets.
- Essence of Linear Algebra by 3Blue1Brown and Singular Value Decomposition by Steve Brunton: visual lectures on linear maps, determinants, eigenvectors, and the SVD.
- Linear Algebra Review and Reference by Kolter and Do (Stanford CS229) and Immersive Linear Algebra by Ström, Åström, and Akenine-Möller.