Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.Learning a machine by poking it
Imagine a huge machine you can’t open. All you can do is put something in and see what comes out. If you feed the output back in again and again, you collect a few clues: , then , then . These clues span a Krylov subspace.
The surprise is that a few dozen clues are often enough to solve equations with millions of unknowns, or to find a machine’s strongest and weakest directions.
Walking down a narrow valley shows why the smart way matters. Steepest descent zig-zags from wall to wall. Conjugate gradients remembers where it has been and heads straight for the bottom.
A spacecraft’s structural model can have millions of unknowns, far too many to store as a full matrix. Engineers find its vibration modes and solve its stress equations with Krylov methods, which only ever ask the model “what happens if I push this way?”.
- 1. Krylov methods only need to…
- 2. In a narrow valley, steepest descent…
- 3. After feeding the output back 3 times, how many clue vectors do you have (b, Ab, A²b, A³b)?
Level 1: Beginner
★★☆☆☆ Basic⏱ 15 minSecondary-school mathematics: arithmetic and elementary algebra.The Krylov subspace
- Only matrix–vector products are needed. That’s perfect for sparse matrices: a 2-D grid simulation with unknowns has only about 5 nonzeros per row, so a product costs about operations, while the dense matrix would need numbers.
- It also works for matrix-free operators: Hessian–vector products in deep learning, or “run the simulator once”.
- Each step adds one dimension (until the space stops growing). Any vector in is for a polynomial of degree .
Example. , : , .
- 1. For A = diag(1, 2), b = (1, 1): A²b = ?
- 2. If b is an eigenvector of A, the Krylov space has dimension…
- 3. Why are Krylov methods great for sparse matrices?
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 45 minUndergraduate students and practising engineers.Arnoldi and Lanczos: an orthonormal basis for
The raw vectors quickly line up with the top eigenvector, so they form a terrible basis (power iteration, A2.3-1). Arnoldi runs Gram–Schmidt (A2.4-1) as it goes: multiply the newest basis vector by , then orthogonalize. This gives
For symmetric , is symmetric and Hessenberg, so it is tridiagonal. Each new vector only needs the previous two: that’s the Lanczos three-term recurrence. The eigenvalues of the small matrix (the Ritz values) approximate the extreme eigenvalues of remarkably fast.
Conjugate gradients (CG)
For symmetric positive-definite , solving is the same as minimizing . CG (Hestenes and Stiefel, 1952) picks as the best point in in the -norm, using short recurrences:
The search directions are A-conjugate (), so progress along one is never undone by the next.
| Method | Matrix | Minimizes over | Iterations to accuracy ε |
|---|---|---|---|
| steepest descent | SPD | (one direction only) | |
| CG | SPD | the -norm error | |
| MINRES | symmetric | the residual norm | similar |
| GMRES | any | the residual norm | depends on the spectrum and non-normality |
Preconditioning solves with cheap to invert (Jacobi, incomplete Cholesky, multigrid). It shrinks , and with it the number of iterations.
- 1. CG needs roughly how many iterations for κ = 10⁴?
- 2. For symmetric A, the Arnoldi matrix H is…
- 3. GMRES minimizes…
Level 3: Advanced
★★★★☆ Advanced⏱ 45 minGraduate level, with full derivations and proofs.The polynomial view
Every Krylov iterate is , so its error is for a polynomial of degree with . CG’s optimality gives
Two consequences:
- Finite termination. If has distinct eigenvalues, take , which is zero on the whole spectrum. So CG is exact in steps (in exact arithmetic).
- The Chebyshev bound. Choosing the shifted Chebyshev polynomial on gives
Clustered eigenvalues make CG even faster than this bound. That is the real goal of a preconditioner.
Lanczos in floating point
In exact arithmetic, Lanczos vectors stay orthogonal. In floating point, they lose orthogonality exactly when a Ritz value converges. Paige (1971) showed this loss is structured, not random. The symptom is “ghost” duplicate eigenvalues. Remedies are full or selective reorthogonalization, or implicit restarts (ARPACK, Lehoucq, Sorensen and Yang, 1998). Despite this, CG and Lanczos remain the methods of choice, and their finite-precision behaviour is well understood (Greenbaum, 1997).
Exercise 3.1: Why is the A-norm error of CG monotonically decreasing?
The spaces are nested: . CG returns the A-norm-optimal point in each, and minimizing over a bigger space can’t do worse.
- 1. A has 4 distinct eigenvalues. CG (exact arithmetic) finishes in at most…
- 2. The Chebyshev factor (√κ−1)/(√κ+1) for κ = 100?
- 3. Plain Lanczos in floating point loses…
Level 4: Expert
★★★★★ Expert⏱ 40 minResearchers: original papers and open problems.Eigenvalues of operators you never form
Krylov methods in ML, robotics and space
- Hessian-free optimization. Solve the Newton system with CG, using Hessian–vector products. Pearlmutter’s trick computes them for about the cost of a gradient (Martens, 2010).
- Trust-region policy optimization (TRPO). Robot-learning agents solve (with the Fisher matrix) by about 10 CG iterations of Fisher–vector products to get the natural-gradient step (Schulman et al., 2015). This is how locomotion policies for simulated legged robots were trained.
- Loss-landscape spectra. Lanczos on Hessian–vector products gives the top eigenvalues (sharpness, A2.4-2) and, via stochastic Lanczos quadrature, the full spectral density of networks with millions of parameters (Ghorbani, Krishnan and Xiao, 2019).
- Gaussian processes at scale. GPyTorch replaces Cholesky () with batched preconditioned CG, plus Lanczos for log-determinants (Gardner et al., 2018). Exact GPs on a million points became feasible.
- Structural and fluid simulation. Finite-element models of spacecraft and aircraft are solved with preconditioned CG/GMRES (often with multigrid), and their vibration modes are found with ARPACK’s implicitly restarted Arnoldi/Lanczos. This is the same software behind
scipy.sparse.linalg.eigsh. - PageRank and graphs: power and Arnoldi iterations on web-scale sparse matrices.
References
- C. Lanczos (1950). “An iteration method for the solution of the eigenvalue problem of linear differential and integral operators.” J. Res. Nat. Bur. Standards, 45.
- W. Arnoldi (1951). “The principle of minimized iterations in the solution of the matrix eigenvalue problem.” Quarterly of Applied Mathematics, 9.
- M. Hestenes, E. Stiefel (1952). “Methods of conjugate gradients for solving linear systems.” J. Res. Nat. Bur. Standards, 49(6).
- C. Paige (1971). The computation of eigenvalues and eigenvectors of very large sparse matrices. PhD thesis, University of London.
- Y. Saad, M. Schultz (1986). “GMRES: A generalized minimal residual algorithm for solving nonsymmetric linear systems.” SIAM J. Sci. Stat. Comput., 7(3).
- A. Greenbaum (1997). Iterative Methods for Solving Linear Systems. SIAM.
- R. Lehoucq, D. Sorensen, C. Yang (1998). ARPACK Users’ Guide. SIAM.
- J. Martens (2010). “Deep learning via Hessian-free optimization.” ICML.
- J. Schulman, S. Levine, P. Moritz, M. Jordan, P. Abbeel (2015). “Trust region policy optimization.” ICML.
- J. Gardner, G. Pleiss, D. Bindel, K. Weinberger, A. G. Wilson (2018). “GPyTorch: Blackbox matrix-matrix Gaussian process inference with GPU acceleration.” NeurIPS.
- B. Ghorbani, S. Krishnan, Y. Xiao (2019). “An investigation into neural net optimization via Hessian eigenvalue density.” ICML.