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.
Glossary
Krylov Subspace Methods

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.
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.
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.
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.
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
Ais impossible. - Implicit operators where
Arepresents 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.
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
Aonto the Krylov subspace. The eigenvalues of this much smaller projected matrix (Ritz values) approximate the extreme eigenvalues of the original large matrixA.
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 subspaceK_k(A, r₀), wherer₀ = b - Ax₀is the initial residual.
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. Aftermiterations, 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.
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.
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 / Method | Arnoldi Iteration | Lanczos Algorithm | Conjugate 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 |
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:
codeKₖ(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.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Krylov subspace methods are iterative algorithms for large-scale linear algebra problems. The following concepts are foundational to understanding their construction, convergence, and application in model compression.
Lanczos Algorithm
The Lanczos algorithm is a specialized Krylov subspace method for approximating the extreme eigenvalues and eigenvectors of a large, sparse, symmetric matrix. It constructs an orthonormal basis for the Krylov subspace and reduces the original matrix to a symmetric tridiagonal form, which is much easier to analyze.
- Core Mechanism: Iteratively builds a basis using the recurrence
A * q_{k-1} = β_{k-1} * q_{k-2} + α_k * q_{k-1} + β_k * q_k. - Primary Use: Fundamental for eigenvalue problems in Principal Component Analysis (PCA) and low-rank approximations via Truncated SVD.
- Connection to Compression: Used to efficiently compute the dominant singular values/vectors of large weight matrices for Low-Rank Factorization.
Arnoldi Iteration
Arnoldi iteration generalizes the Lanczos algorithm to non-symmetric (or non-Hermitian) matrices. It builds an orthonormal basis for the Krylov subspace and reduces the matrix to an upper Hessenberg form.
- Core Mechanism: Employs the modified Gram-Schmidt process to orthogonalize each new vector against all previous basis vectors.
- Primary Use: Forms the foundation for the GMRES (Generalized Minimal Residual) method for solving non-symmetric linear systems
Ax = b. - Application Context: While less common in symmetric factorization for compression, it is crucial for solving the large linear systems that can arise during model training or fine-tuning phases.
Rayleigh Quotient
The Rayleigh quotient is a scalar function R(A, x) = (x* A x) / (x* x) for a given vector x and a Hermitian matrix A. It provides an estimate for an eigenvalue of A.
- Key Property: For an eigenvector, the Rayleigh quotient equals the corresponding eigenvalue. For an approximation, it provides an optimal eigenvalue estimate given the vector.
- Role in Krylov Methods: In the Lanczos algorithm, the Rayleigh quotients of the basis vectors with respect to the tridiagonal matrix yield Ritz values, which are approximations to the eigenvalues of
A. This is central to monitoring convergence. - Optimization Link: The minimization/maximization of the Rayleigh quotient is directly related to finding extreme eigenvectors, connecting to variational principles in PCA.
Conjugate Gradient Method
The Conjugate Gradient (CG) method is a Krylov subspace algorithm for solving systems of linear equations Ax = b where A is symmetric and positive-definite. It is optimal in that it finds the exact solution in at most n iterations (in exact arithmetic).
- Krylov Subspace: The
k-th iteratex_klies in the Krylov subspaceK_k(A, r_0), wherer_0is the initial residual. - Optimization Perspective: CG can be viewed as an iterative method for minimizing the quadratic form
(1/2)xᵀAx - bᵀx. - System Solution in ML: While direct compression uses eigenvalue methods, efficient solvers like CG are vital for the linear subproblems in Alternating Least Squares (ALS) for tensor factorization or certain training procedures.
Power Iteration
Power iteration is the simplest Krylov subspace method, used to find the dominant eigenvector (associated with the eigenvalue of largest magnitude) of a matrix. It repeatedly applies the matrix to a vector and normalizes: x_{k+1} = (A * x_k) / ||A * x_k||.
- Krylov Subspace: The sequence
{x_k}spans the Krylov subspaceK_k(A, x_0). - Limitations: Only finds one eigenpair and convergence can be slow if the eigenvalue gap is small.
- Foundation Role: It is the conceptual precursor to more sophisticated methods like Lanczos and Arnoldi, which leverage the entire subspace for better approximations. Used in simple Truncated SVD implementations.
GMRES (Generalized Minimal Residual)
GMRES is a Krylov subspace method for solving non-symmetric linear systems Ax = b. It finds the vector in the Krylov subspace that minimizes the norm of the residual ||b - Ax||.
- Subspace Construction: Uses Arnoldi iteration to build an orthonormal basis for the Krylov subspace
K_m(A, r_0). - Minimization: Solves a least squares problem in the smaller Hessenberg matrix generated by Arnoldi to find the optimal approximation.
- Engineering Relevance: In machine learning pipelines, large, sparse, non-symmetric systems can arise from constraints or specific model architectures. GMRES provides a robust, iterative solver for these scenarios, ensuring numerical stability where direct methods fail.

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.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us