Numerical Linear Algebra in Linear Space

Yiping Liu, Hoai-An Nguyen, Junzhao YangarXiv 2025 · DOI

Abstract

In numerical linear algebra, researchers have long faced a trade-off between memory efficiency, computational speed, and numerical stability. Traditional solvers either require quadratic space to store the matrix or rely on iterative methods that fail when matrices are poorly conditioned. This paper presents a randomized algorithm that solves general linear systems ($Ax = b$) using only linear working space—memory proportional to the size of a single vector rather than the entire matrix. By combining Wiedemann’s algorithm with a novel variant of p-adic lifting, the authors provide a solver that is independent of the matrix condition number and extends to core tasks such as linear regression, Singular Value Decomposition (SVD), and linear programming.

Introduction: The Memory-Conditioning Trade-off

Modern data science and engineering frequently encounter "Big Matrix" problems where the dataset is too large to fit into a computer's main memory. Historically, solving a linear system $Ax = b$ required choosing between three imperfect options:

  1. Direct Solvers: Methods like Gaussian elimination or LU decomposition are robust but require $O(n^2)$ space. For massive datasets, this memory requirement is a physical impossibility.
  2. Iterative Solvers: Methods like Conjugate Gradient use $O(n)$ space but are highly sensitive to the matrix "condition number." If a matrix is nearly singular or "stiff," these methods converge slowly or not at all.
  3. Finite Field Solvers: Algorithms like Wiedemann’s are both fast and space-efficient but are restricted to modular arithmetic, making them unsuitable for the rational or real numbers used in physical sciences.

This research bridges these gaps by developing a solver that operates over the rationals, maintains a linear space profile, and remains robust regardless of how "well-behaved" the matrix is.

Methodology

The proposed algorithm achieves its efficiency by integrating classical algebraic tools with a new approach to memory management. The framework relies on four primary components:

1. Wiedemann’s Algorithm as a Foundation

The researchers utilize Wiedemann’s algorithm, which is traditionally used for sparse matrices over finite fields. Because it only requires black-box access to the matrix (the ability to compute the product $Av$), it avoids the "fill-in" problem where sparse matrices become dense during computation.

2. Determinants via the Chinese Remainder Theorem (CRT)

To transition from finite fields to the rational numbers, the algorithm computes the matrix determinant exactly. By applying the Chinese Remainder Theorem across multiple primes while staying within linear space, the authors can reconstruct the necessary integer values without a quadratic memory overhead.

3. Innovation: Space-Efficient p-adic Lifting

The core technical innovation is a modified version of Dixon’s p-adic lifting. Standard p-adic lifting iteratively refines a solution but typically requires $O(n^2)$ space to store high-precision results. The authors designed a variant that tracks entry-wise multiplicative approximations using floating-point numbers. By managing a "remainder" vector that is constrained to polynomial size ($poly(n)$), they keep the total working memory at $O(n \log n)$ bits.

Key Insights and Theoretical Results

Entry-wise Multiplicative Guarantees

Unlike most solvers that provide "norm-wise" error (where the total error of the vector is small), this solver provides an entry-wise multiplicative approximation. This means every single element in the resulting vector is accurate to within a $(1+\epsilon)$ factor, a much stricter and more useful guarantee for sensitive applications.

Condition Number Independence

A significant breakthrough of this work is that the running time does not depend on the condition number of the matrix. This makes the algorithm a truly "general-purpose" tool, capable of handling ill-conditioned matrices that would cause iterative solvers to fail.

Broad Application Scope

The paper demonstrates that this linear-space approach is not limited to simple linear systems:

  • Linear Regression: The authors provide a least-squares version ($\min \|Ax-b\|_2$) using $O(d \log(nU))$ space, where $d$ is the number of features.
  • SVD and Eigen-decomposition: By shifting the matrix slightly to separate eigenvalues (spectrum perturbation), the authors achieved the first polynomial-time, near-linear space algorithms for these fundamental tasks.
  • Linear Programming: The solver was successfully integrated into the Interior Point Method (IPM), proving that complex optimization problems can be solved without quadratic memory.

Limitations and Future Outlook

While the algorithm achieves the optimal $O(n \log n)$ bit space, the authors note that reaching "truly" linear space (exactly $O(n)$ bits) may be impossible, as even storing the determinant of a simple 0/1 matrix can require $\Omega(n \log n)$ bits.

Furthermore, there is a trade-off in time complexity. The solver runs in $\tilde{O}(n^2 \cdot nnz(A))$ bit operations. While this is polynomial time, it is slower than the $O(n^\omega)$ solvers that utilize quadratic space. A major open question for the field is whether a linear-space solver can eventually match the speed of Wiedemann’s finite-field algorithm ($O(n \cdot nnz)$). Finally, while the theoretical error analysis is rigorous, future empirical work is needed to test these algorithms against the specific precision limits of modern floating-point hardware.

Summary updated

BibTeX
@misc{liu2025numerical,
  author = {Yiping Liu and Hoai-An Nguyen and Junzhao Yang},
  title = {{Numerical Linear Algebra in Linear Space}},
  year = {2025},
  eprint = {2507.02433},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2507.02433},
}
Figure