Inferensys

Glossary

Krylov Subspace Methods

Krylov subspace methods are a class of iterative algorithms for solving large-scale eigenvalue problems and linear systems by constructing approximations from sequences of matrix-vector products.
Wide-angle shot of a modern WeWork open floor plan with creative walls covered in AI system architecture diagrams, product team collaborating in standing desk area with industrial lighting.
NUMERICAL LINEAR ALGEBRA

What is Krylov Subspace Methods?

Krylov subspace methods are a foundational class of iterative algorithms in numerical linear algebra for solving large-scale linear systems and eigenvalue problems, particularly when matrices are sparse or too large for direct factorization.

Krylov subspace methods are iterative algorithms for solving large, sparse linear systems (Ax = b) and eigenvalue problems by constructing approximations from the sequence of vectors generated by repeated matrix-vector products. The core idea is to build a Krylov subspace, K_k(A, r_0) = span{r_0, Ar_0, A²r_0, ..., A^(k-1)r_0}, where r_0 is an initial residual vector. The algorithm then finds an approximate solution within this much smaller subspace, dramatically reducing computational cost compared to direct methods for high-dimensional problems.

These methods form the basis for widely used algorithms like the Conjugate Gradient (CG) for symmetric positive-definite systems, GMRES for general nonsymmetric systems, and the Lanczos and Arnoldi iterations for eigenvalue computations. Their efficiency stems from requiring only matrix-vector multiplications, avoiding explicit matrix storage or inversion. This makes them indispensable in scientific computing, machine learning (e.g., large-scale optimization, kernel methods), and model reduction, where they enable the solution of problems with millions of variables.

ITERATIVE ALGORITHMS

Key Characteristics of Krylov Methods

Krylov subspace methods are a class of iterative algorithms for solving large-scale eigenvalue problems and linear systems, forming approximations from sequences of matrix-vector products.

01

Subspace Construction

The core mechanism of Krylov methods is the iterative construction of the Krylov subspace K_k(A, v) = span{v, Av, A²v, ..., A^(k-1)v}. This subspace is generated by repeatedly applying the matrix A to an initial vector v. The power of the method lies in the fact that for many practical problems, a good approximation to the desired solution (e.g., an eigenvector or the solution to Ax = b) lies within a relatively low-dimensional Krylov subspace, even when A is enormous and sparse.

02

Matrix-Free Operation

A defining feature is their matrix-free nature. The algorithm only requires the ability to compute the matrix-vector product A * v, not explicit access to or storage of the full matrix A. This is critical for:

  • Extremely large systems where storing A is impossible.
  • Implicit operators where A represents a function or a differential operator.
  • Sparse matrices where the product can be computed efficiently without forming the dense matrix. This property makes them the algorithm of choice for problems arising from finite element methods, computational fluid dynamics, and quantum chemistry.
03

Orthogonalization & Basis Formation

To ensure numerical stability, the raw power basis {v, Av, A²v, ...} is transformed into an orthonormal basis for the Krylov subspace. This is achieved via processes like:

  • Arnoldi iteration (for general matrices).
  • Lanczos algorithm (for Hermitian/symmetric matrices). These processes produce a Hessenberg matrix (Arnoldi) or a tridiagonal matrix (Lanczos) that represents the projection of A onto the Krylov subspace. The eigenvalues of this much smaller projected matrix (Ritz values) approximate the extreme eigenvalues of the original large matrix A.
04

Connection to Linear Systems (CG, GMRES)

Krylov methods are foundational for solving large, sparse linear systems Ax = b. Two seminal algorithms are:

  • Conjugate Gradient (CG): Used for symmetric positive definite (SPD) matrices. It finds the solution by minimizing the error in the A-norm over the Krylov subspace. It has optimality properties and finite termination in exact arithmetic.
  • Generalized Minimal Residual (GMRES): Used for general non-symmetric matrices. It finds the solution that minimizes the residual norm ||b - Ax||₂ over the Krylov subspace. Both methods implicitly build and utilize the Krylov subspace K_k(A, r₀), where r₀ = b - Ax₀ is the initial residual.
05

Computational Complexity & Restarting

The primary cost of Krylov methods grows with the subspace dimension k:

  • Storage: O(n*k) for the orthonormal basis vectors.
  • Computation: O(k²*n) for full orthogonalization in Arnoldi/GMRES. To manage this cost for problems requiring many iterations, restarting is essential. After m iterations, the algorithm discards the subspace, uses the current best approximation as a new starting vector, and begins building a fresh Krylov subspace. While this can slow convergence, it makes solving very large problems feasible within memory constraints.
06

Preconditioning

The convergence rate of Krylov methods depends heavily on the spectral properties of the matrix A (e.g., eigenvalue distribution). Preconditioning is the critical technique to accelerate convergence by transforming the original system Ax = b into an equivalent one with better spectral properties. A preconditioner M ≈ A⁻¹ is applied, leading to systems like M⁻¹Ax = M⁻¹b. Effective preconditioning (e.g., incomplete LU factorization, multigrid, domain decomposition) is often the difference between a solution that is obtained in seconds versus one that fails to converge.

ITERATIVE SOLVERS

Comparison of Key Krylov Subspace Methods

A feature comparison of prominent Krylov subspace algorithms used for solving large-scale eigenvalue problems and linear systems, highlighting their primary applications, matrix requirements, and computational characteristics.

Feature / MethodArnoldi IterationLanczos AlgorithmConjugate Gradient (CG)Generalized Minimal Residual (GMRES)

Primary Problem Type

Non-symmetric eigenvalue

Symmetric eigenvalue

Symmetric Positive Definite (SPD) linear systems

General non-symmetric linear systems

Matrix Requirement

General square matrix

Real symmetric / Hermitian

SPD matrix

General square matrix (non-singular)

Subspace Basis

Orthonormal (full Arnoldi)

Orthonormal & tridiagonal

Conjugate A-orthogonal directions

Orthonormal (from Arnoldi process)

Storage Cost

O(n * k) for k iterations

O(n * 3) (3-term recurrence)

O(n * 3)

O(n * k) for k iterations (restarts needed)

Optimality Property

Minimizes residual of Ritz pairs

Minimizes Rayleigh quotient on subspace

Minimizes error in A-norm

Minimizes residual norm ||b - Ax||₂

Breakdown Risk

None (with full orthogonalization)

Loss of orthogonality (numerical instability)

Breakdown if matrix not SPD

True breakdown possible (e.g., invariant subspace)

Common Application

Finding interior eigenvalues via shift-invert

Extreme eigenvalue computation

Large sparse SPD systems (e.g., FEM)

Non-symmetric systems from PDEs/CFD

Restarting Required

Yes, for large k

No, but reorthogonalization often needed

No

Yes, critical for memory management

KRYLOV SUBSPACE METHODS

Frequently Asked Questions

Krylov subspace methods are a foundational class of iterative algorithms for solving large-scale linear algebra problems, crucial for model compression and eigenvalue computations in machine learning. These FAQs address their core mechanics, applications, and relationship to other factorization techniques.

A Krylov subspace is a vector space spanned by the sequence of vectors generated by repeatedly applying a matrix to an initial vector. For a given square matrix A and a starting vector b, the order-k Krylov subspace Kₖ(A, b) is defined as:

code
Kₖ(A, b) = span{ b, Ab, A²b, ..., Aᵏ⁻¹b }

This subspace is constructed iteratively. Each new basis vector is formed by a matrix-vector product of A with the previous vector. The power of this construction lies in its ability to capture the dominant spectral properties of A (its largest or smallest eigenvalues and corresponding eigenvectors) using only these products, without ever needing to form or factor the full matrix. This makes it exceptionally efficient for large-scale, sparse matrices common in machine learning, such as Hessians in optimization or graph Laplacians.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.