arXiv:2610.08562cs.DSOct 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2610.08562

Finite-Precision Gram-Schmidt Walks

Emile Anand, Jan van den Brand, Peter Chen

ABSTRACT

The Gram-Schmidt Walk is a randomized vector-balancing algorithm whose sub-gaussian guarantees support applications in discrepancy, experimental design, and data compression; however, these theoretical guarantees are established in exact arithmetic, whereas implementations must approximate least-squares directions, boundary updates, and sampling probabilities in finite precision. This is important because small numerical errors can change which coordinates freeze and thereby alter the subsequent trajectory. We analyze the concentration of the perturbed Gram-Schmidt walk directly under bounded, potentially biased and history-dependent errors. For nn input vectors of Euclidean norm at most one, we obtain a modified MGF bound depending on key error sources which recovers the original result as the error goes to zero. We also construct a full-column-rank instance in which bounded update errors produce bias of order min⁡{n2εiter,n}\min\{n^2\varepsilon_{\text{iter}}, n\}, showing that updates accumulate error unavoidably under this model. Finally, we validate our findings in a variety of settings by ablating on the bit precision and problem size.

1 INTRODUCTION

Selecting a small representative subset of a dataset is an important task in algorithmic statistics (Xiao et al., 2026; Göttlich et al., 2024; Chazelle, 2000), which requires preserving many statistics with relatively few points. Discrepancy theory offers a useful perspective on this task: assign signs to data vectors so that their signed sum is small. Given some matrix A∈Rm×nA \in \mathbb{R}^{m \times n}, we seek to assign weights {1,−1}\{1, -1\} to its columns such that the sum is minimized in the infinity norm. In other words, we ask how to split the columns into two groups such that both groups have roughly the same sum as measured by the infinity norm of the difference. We call this quantity the discrepancy of the matrix,

disc(A)=min⁡x∈{−1,1}n∥Ax∥∞(1)\mathrm{disc}(A)=\min_{x\in\{-1,1\}^{n}}\|Ax\|_{\infty} \tag{1}

A balanced partition can serve as a compression step if its cardinality or weights are controlled, and finding such a coloring has natural applications in machine learning such as coresets for large datasets (Karnin and Liberty, 2019; Liberty et al., 2026; Ren et al., 2026), attention approximation (Kochetkova et al., 2026; Anand et al., 2026a), covariate balance in experimental design (Harshaw et al., 2024), and distribution thinning (Carrell et al., 2025), where one wishes to summarize a large dataset with a few carefully chosen points. In theoretical computer science, this problem has found applications to spectral sparsification (Lau et al., 2025), approximation algorithms (Eisenbrand et al., 2012), computational geometry (Chazelle, 2004), Monte Carlo integration (Dick and Pillichshammer, 2014), and matrix-vector multiplication (Lingas, 2024; Anand et al., 2026b). Intuitively, if we can split a dataset into two balanced parts where the whole dataset can be summarized by one of the halves, then we can recursively repeat this procedure to find a small approximation of the dataset.

One such algorithm is the Gram-Schmidt Walk of Bansal et al. (2017) which recovers a seminal result of Banaszczyk (1998) by allowing one to sample xx from a certain distribution such that AxAx concentrates tightly around the zero vector. Given B=[b1,…,bn]∈Rm×nB = [b_1, \ldots, b_n] \in \mathbb{R}^{m \times n} with ∥bi∥2≤1\|b_i\|_2 \leq 1 and an initial fractional assignment z0∈[−1,1]nz_0 \in [-1, 1]^n, the walk returns z∈{1,−1}nz \in \{1, -1\}^n. At a high level, the algorithm takes a random walk in the unit cube [−1,1]n[-1, 1]^n with entries becoming integral as the algorithm progresses. Once an entry becomes integral we say that it is frozen, with future steps not moving along this dimension. The steps of the random walk are chosen to be mean zero while not increasing discrepancy too much among the alive entries such that the final output has small discrepancy. Harshaw et al. (2024) showed that for every v∈Rmv \in \mathbb{R}^m,

E[exp⁡(⟨B(z−z0),v⟩)]≤exp⁡(12∥v∥22).(2)\mathbb{E}\left[\exp\left(\langle B(z-z_{0}),v\rangle\right)\right]\leq\exp\left(\frac{1}{2}\|v\|_{2}^{2}\right). \tag{2}

Thus every fixed linear projection of the discrepancy has Gaussian-type tails with a dimension-independent scale. This property is also useful as a component of more elaborate algorithms. For instance, Carrell et al. (2025) develop Gram-Schmidt-based thinning procedures and implementations that accelerate repeated balancing steps.

The concentration guarantees above are established for an idealized Gram-Schmidt Walk operating in exact arithmetic: specifically, the least-squares directions and boundary steps are computed exactly, and each random choice follows its prescribed probability, and these guarantees do not automatically extend to the finite precision process which would be executed on a computer that uses a small number of bits. In particular, these aforementioned theoretical guarantees do not quantify how much numerical error the walk can tolerate due to the sensitivity of its movement within the hypercube, or how much working precision is sufficient to preserve the desired discrepancy bound. This motivates a finite-precision analysis that explains how numerical errors affect concentration and provides sufficient conditions for preserving a desired discrepancy guarantee.

Indeed, implementing these steps in practice introduces errors due to finite-precision. These errors can manifest in the computed direction, the boundary update, and the probabilities of hitting each boundary of the unit hypercube, and can affect the current iterate; however, more seriously, they can also affect which coordinate freezes, which in turn changes the least-squares system (which is also solved by maintaining a Cholesky factorization for improved runtimes) that must later be solved. Therefore, in the worst-case, the perturbed trajectory can deviate significantly from the ideal trajectory. It is not clear a priori that subgaussianity should be preserved under approximate arithmetic, as small perturbations in position can potentially change which entries become frozen in a given iteration, changing the path that the walk takes over the rest of the algorithm. So, any analysis that follows the perturbed trajectory alongside one exact trajectory may lose the structure responsible for concentration. Moreover, deterministic rounding may not preserve conditional mean zero, so an implementation can accumulate systematic discrepancy even when the individual update errors are small. Numerical sensitivity is already familiar from classical Gram-Schmidt orthogonalization, which can suffer severe loss of orthogonality in finite precision, especially for nearly linearly dependent inputs (Giraud et al., 2005). The Gram-Schmidt walk introduces a further challenge: numerical errors can affect both the computed directions and the branching and freezing decisions, changing the subsequent trajectory and the distribution of the final coloring. Understanding its numerical robustness therefore requires connecting local computational errors to the concentration of the final discrepancy.

These observations expose a gap between theory and practice for the Gram-Schmidt Walk. The classical concentration guarantees assume exact arithmetic, while practical implementations use approximate least-squares directions, rounded updates, and inexact sampling probabilities. These errors can change which coordinates freeze and hence which subproblems the algorithm solves next, so the exact-arithmetic guarantees need not hold for the resulting finite-precision output distribution.

We address this gap by studying a model with updates zt+1=zt+δ^tu^t+εtz_{t+1} = z_t + \hat{\delta}_t \hat{u}_t + \varepsilon_t for ∥εt∥∞≤εiter\|\varepsilon_t\|_\infty \leq \varepsilon_{\text{iter}} where u^t\hat{u}_t and δ^t\hat{\delta}_t are computed quantities, and εt\varepsilon_t includes rounding, clamping, and freezing corrections. Uniform budgets εLS\varepsilon_{LS} and εpr\varepsilon_{\text{pr}} additionally control least-squares image error and conditional branch-probability error, respectively. Our analysis permits biased, history-dependent errors and changes to the freezing trajectory. Section 3 specifies the complete model, including feasibility and freezing requirements. Our contributions address the theory-practice gap in two directions:

(1) Theoretical guarantees. We establish concentration guarantees for the Gram-Schmidt Walk under biased, history-dependent perturbations. The key technical challenge is that numerical errors can change freezing decisions and subsequent least-squares directions, while destroying the exact conditional unbiasedness used in prior analyses. We address these interacting effects through a phase-based analysis that controls accumulated conditional drift without requiring proximity to an ideal execution. While our bounds retain the sharp exact-arithmetic quadratic term in the log moment-generating function, we further reveal how the discrepancy quality depends on arithmetic precision, the bit complexity, and the error of the least-squares solver.

(2) Empirical validation. Our experiments illustrate the precision-dependent discrepancy in practical numerical implementations. We show that finite precision can significantly degrade the discrepancy achieved by the Gram-Schmidt Walk, and characterize the sensitivity of this degradation on the precision and matrix conditioning. By measuring empirical discrepancy tails, we evaluate when approximate arithmetic preserves output quality and when it is a limitation.

References (34)