This final chapter is the payoff. Every concept in the book reappears here as the working machinery of modern AI. The thesis is simple and, by now, earned: linear algebra is the language in which machine learning is written. Data are tensors; models are matrices; learning is optimization over matrix-valued functions; and the deepest tools — the SVD, the spectral theorem, the pseudoinverse — are exactly the ones that make AI tractable. We tour the landscape application by application, pointing back to the chapter where each idea was built.

Data is linear algebra

Before any algorithm runs, the data is already a linear-algebra object.

  • A tabular dataset is a matrix \(\mX\in\R^{n\times d}\): \(n\) samples (rows) \(\times\) \(d\) features (columns).

  • An image is a matrix (grayscale) or order-3 tensor (color); a batch is order-4.

  • Text becomes a matrix of token embeddings; a corpus a term–document matrix.

  • A graph is its adjacency or Laplacian matrix; a user–item ratings table is a (sparse) matrix.

Choosing a representation is choosing a matrix, and the geometry of that matrix — its rank, its singular values, its null space — already constrains what any model can learn from it (Chapters [ch:vectorspaces][ch:svd]).

Linear and ridge regression: projection and the pseudoinverse

The foundational supervised model is linear regression, and we have already solved it three ways. Geometrically it is the projection of the target \(\vy\) onto the column space of the design matrix (Chapter [ch:orthogonality]); algebraically it is the normal equations \(\mX\tp\mX\hat\vw=\mX\tp\vy\); computationally it is the pseudoinverse \(\hat\vw=\mX^{+}\vy\) via SVD (Chapter [ch:svd]). Ridge regression adds \(\lambda\norm{\vw}_2^2\), giving \[\hat\vw=(\mX\tp\mX+\lambda\mI)\inv\mX\tp\vy.\] The \(\lambda\mI\) term lifts every eigenvalue of \(\mX\tp\mX\) by \(\lambda\), raising \(\sigma_{\min}\), lowering the condition number (Chapter [ch:numerical]), and selecting the minimum-norm solution when the null space is nontrivial (Chapter [ch:vectorspaces]). Regularization is linear algebra repairing ill-posedness.

Principal Component Analysis: the SVD of data

PCA is the most-used unsupervised method, and it is nothing but the SVD of the centered data matrix (Chapters [ch:symmetric][ch:svd]).

Center \(\mX\), take its SVD \(\mX=\mU\mSig\mV\tp\). The right singular vectors (columns of \(\mV\)) are the principal directions; the singular values give the variance captured (\(\sigma_i^2/n\)); projecting onto the top \(k\) directions, \(\mZ=\mX\mV_k\), is the optimal \(k\)-dimensional linear summary of the data by Eckart–Young. PCA \(=\) change of basis to the variance-maximizing axes \(+\) truncation.

PCA powers visualization, denoising, decorrelation/whitening, and compression. The reason production code computes PCA from the SVD of \(\mX\) rather than the eigendecomposition of the covariance \(\mX\tp\mX\) is numerical: forming \(\mX\tp\mX\) squares the condition number (Chapter [ch:numerical]).

Neural networks: stacks of affine maps

A feedforward network alternates linear algebra with cheap nonlinearities: \[\vh^{(\ell)} = \phi\big(\mW^{(\ell)}\vh^{(\ell-1)} + \vb^{(\ell)}\big).\] Each layer is an affine transformation (matrix multiply \(+\) bias, Chapters [ch:matrices][ch:transformations]) followed by an activation \(\phi\). The nonlinearity is essential: without it, the composition \(\mW^{(L)}\cdots\mW^{(1)}\) collapses to a single matrix and the network could only fit lines. Training computes \(\nabla_{\vtheta}L\) by backpropagation — the chain rule as a sequence of vector–Jacobian products (Chapter [ch:matrixcalc]) — and every forward/backward pass is dominated by matrix multiplication, which is why GPUs (matrix-multiply engines) define the field’s hardware.

Read a deep network as a learned sequence of changes of representation: each layer re-expresses the input in new coordinates where the next sub-task is easier, until the final space makes the classes linearly separable. “Representation learning” is, very literally, learning a useful basis (Chapter [ch:transformations]).

Convolution and weight sharing

A convolutional layer is still a linear map — a highly structured matrix with shared, sparse weights (a Toeplitz/circulant structure). Expressing it as such explains its efficiency and its equivariance to translation, and reveals that the backward pass is again a (transposed) convolution, i.e. another structured matrix multiply (Chapter [ch:matrixcalc]).

Embeddings and similarity

Words, items, users, and images are mapped to vectors in a learned space where geometry encodes meaning. Similarity is the (normalized) dot product — cosine similarity (Chapter [ch:vectors]): \[\cos\theta=\frac{\vu\tp\vv}{\norm{\vu}\,\norm{\vv}}.\] Nearest-neighbor retrieval in a vector database ranks by this quantity; analogies (“king \(-\) man \(+\) woman \(\approx\) queen”) are vector arithmetic. Embedding tables are matrices, and compressing them with truncated SVD/PCA (Chapter [ch:svd]) shrinks storage 8–32\(\times\) while often improving recall by discarding noisy directions.

Attention and Transformers

The Transformer — the architecture behind modern large language models — is built almost entirely from matrix multiplications. Packing a sequence of token vectors into rows of \(\mX\), three learned projections produce queries, keys, and values, and attention is \[\text{Attention}(\mQ,\mK,\mV)=\softmax\!\left(\frac{\mQ\mK\tp}{\sqrt{d_k}}\right)\mV.\]

Unpack the linear algebra. \(\mQ\mK\tp\) is a matrix of all pairwise dot products between query and key vectors — token-to-token similarity (Chapter [ch:vectors]). Scaling by \(1/\sqrt{d_k}\) controls the variance so the softmax stays well-conditioned. The softmax turns each row into attention weights, and multiplying by \(\mV\) forms a weighted combination of value vectors — a linear combination (Chapter [ch:vectors]) whose weights are data-dependent. Multi-head attention runs several such projections in parallel (block/tensor structure, Chapter [ch:matrixcalc]). Attention is dot products, softmax, and matrix products — linear algebra end to end.

Low-rank structure: LoRA and model compression

Eckart–Young (Chapter [ch:svd]) is now a daily engineering tool. LoRA fine-tunes a giant pretrained model by freezing its weight matrix \(\mW\) and learning a low-rank update \(\Delta\mW=\mB\mA\) with \(\mA\in\R^{r\times d}\), \(\mB\in\R^{d\times r}\), \(r\ll d\). This trains a tiny fraction of the parameters on the bet — empirically sound — that the needed adaptation is low-rank. The same low-rank idea compresses layers, accelerates inference, and underlies recommender-system matrix factorization (the Netflix Prize: complete a sparse ratings matrix with a low-rank model).

Graphs, spectra, and PageRank

Graph data lives in the adjacency matrix and the graph Laplacian \(\mL=\mD-\mA\) (symmetric PSD, Chapter [ch:symmetric]). Its smallest eigenvectors give spectral clustering and the low-frequency features used by graph neural networks; PageRank is the dominant eigenvector of a Markov matrix (Chapter [ch:eigen]), historically found by the power method (Chapter [ch:numerical]). Spectral graph theory is eigenvalues doing applied work.

Probabilistic models and Gaussian processes

The multivariate Gaussian is pure linear algebra: a quadratic form \((\vx-\vmu)\tp\mSig\inv(\vx-\vmu)\) in the exponent (Chapter [ch:symmetric]) and \(\det(\mSig)\) in the normalizer (Chapter [ch:determinants]). Gaussian processes hinge on Cholesky factorization of the (symmetric PD) kernel matrix for both the predictive mean and a stable log-determinant in the marginal likelihood (Chapter [ch:numerical]). Sampling \(\vx=\vmu+\mL\vz\) uses the Cholesky factor \(\mL\). Normalizing flows track the Jacobian determinant of an invertible neural map to transform densities exactly (Chapter [ch:determinants]).

Optimization landscapes: curvature is eigenvalues

Training is optimization, and its difficulty is governed by the spectrum of the loss Hessian (Chapters [ch:eigen][ch:symmetric]). The eigenvalues are the curvatures along the principal directions; their ratio is the condition number, which sets how badly gradient descent zig-zags and bounds the stable learning rate. Indefinite Hessians mean saddle points, which dominate high-dimensional deep-learning loss surfaces. Normalization, good initialization (often orthogonal, Chapter [ch:orthogonality]), and second-order/preconditioned methods are all attempts to improve conditioning.

The grand summary table

Linear-algebra concept Ch. Where it powers AI
Dot product / cosine [ch:vectors] neurons, similarity, attention scores, retrieval
Norms (L1/L2/nuclear) [ch:vectors],[ch:numerical] Lasso/Ridge, weight decay, low-rank penalties
Matrix multiply [ch:matrices] every layer; batched on GPUs
Linear systems / null space [ch:systems],[ch:vectorspaces] regression solvability; why regularization is needed
Rank & four subspaces [ch:vectorspaces] feature redundancy, identifiability
Linear maps / change of basis [ch:transformations] layers as representation learning; PCA, whitening
Projection / least squares / QR [ch:orthogonality] linear regression, orthogonal init, decorrelation
Eigenvalues / diagonalization [ch:eigen] PageRank, spectral clustering, dynamics, curvature
Spectral theorem / PSD / quadratic forms [ch:symmetric] PCA, kernels, Gaussians, Hessian/saddle analysis
SVD / Eckart–Young / pseudoinverse [ch:svd] PCA, LSA, recommenders, LoRA, compression
Condition number / decompositions [ch:numerical] training stability, GP Cholesky, randomized SVD
Tensors / Jacobians / VJP [ch:matrixcalc] autodiff, backpropagation, custom layers
Determinant / Jacobian det [ch:determinants] Gaussian densities, normalizing flows

Strip away the branding and modern AI is linear algebra running at scale. Data are tensors; a model is a pipeline of matrix multiplies separated by nonlinearities; training projects, factors, and differentiates those matrices; and the field’s hardest problems — compression, stability, generalization, efficient adaptation — are solved with the SVD, the spectral theorem, conditioning, and low-rank structure. Master the twelve concepts in the table and the equations in any deep-learning paper stop being intimidating: you will recognize them as old friends from this book.

Where to go next

With this foundation, the natural next steps are multivariable calculus and optimization (gradient methods, convexity), probability and statistics (estimation, the Gaussian, Bayes), and then the deep-learning curriculum proper — where you will see these matrices come alive in convolutional networks, Transformers, and generative models. You now read the language; the rest is vocabulary.

Chapter summary

  • Data (tables, images, text, graphs) are matrices and tensors; their geometry bounds what models can learn.

  • Regression is projection / pseudoinverse; ridge is conditioning repair; PCA is the SVD of data.

  • Neural nets are stacked affine maps; attention is dot products \(+\) softmax \(+\) matrix products; LoRA is low-rank Eckart–Young.

  • Eigenvalues run PageRank, spectral clustering, and curvature/optimization analysis; Cholesky and determinants run probabilistic models.

  • The whole of modern AI is linear algebra executed at scale — which is exactly why this subject was worth mastering.