betaFeedback

WorksComputer Science

The Komlós Problem in Matrix-Multiplication Time

Abstract

We give a randomized algorithm that, for an m×nm\times n matrix whose columns have Euclidean norm at most one, finds a signing with discrepancy below 9999 in expected O~(Lin+nω)\widetilde O(L_{\mathrm{in}}+n^ω) bit operations, where LinL_{\mathrm{in}} is the input encoding length and ωω is the exponent of matrix multiplication. The previous fastest algorithm with a constant discrepancy bound, due to Li, is deterministic and uses O(mn+nω+2log⁡3n)O(mn+n^{ω+2}\log^3 n) arithmetic operations. We build on the spectral signing framework of Guo, Fang, and Lu and of Li, which rounds a single fractional coloring while one spectral potential controls every row. Li's potential tracks a top eigenvalue, and the gap below that eigenvalue, which can be of order 1/n1/n, limits the length of every step. We replace it with a resolvent potential that is smooth without any gap condition, and we draw step signs at random, so that the potential only needs to be concave while progress is measured separately. Our key insight is to reuse a single subspace of directions throughout a batch of steps, thereby using only one spectral computation, so that the more expensive linear algebraic operations are paid for only polylogarithmically often at each scale. Within a batch, we sample directions from a Gaussian completion matrix whose inverse we maintain under rank-one row replacements. Finally, we use a finite-precision analysis to prove stability of the algorithm and attain the bit-complexity bound.

Introduction

The Komlós problem asks how well we can balance vectors in the Euclidean unit ball by assigning signs of ±1\pm1 [31]. For a matrix A=[a1 ⋯ an]∈RmA=[a_1\ \cdots\ a_n]\in\mathbb{R}^{m}, its signing discrepancy is

disc⁡(A)=min⁡ε∈{−1,1}n∥Aε∥∞.(1)\operatorname{disc}(A)=\min_{\varepsilon\in\{-1,1\}^{n}}\|A\varepsilon\|_{\infty}. \tag*{(1)}

Given the promise that ∑i=1maij2≤1\sum_{i=1}^{m}a_{ij}^{2}\le1 for all j∈[n]j\in[n], the Komlós problem asks whether an absolute constant bounds disc⁡(A)\operatorname{disc}(A) independently of both dimensions. In the Beck–Fiala setting [9], each element of a universe belongs to at most tt sets, so dividing the incidence matrix by t\sqrt{t} normalizes its columns to Euclidean norm at most 11, and a constant Komlós bound gives an imbalance of O(t)O(\sqrt{t}) in every set. Vector balancing also has natural applications to rounding: the theorem of Lovász, Spencer, and Vesztergombi [28] rounds any x∈[0,1]nx\in[0,1]^n to some y∈{0,1}ny\in\{0,1\}^n with ∥A(y−x)∥∞=O(1)\|A(y-x)\|_{\infty}=O(1), so a bound on each column’s Euclidean norm controls the error in every linear measurement, independently of the number of variables and measurements. Furthermore vector balancing has seen a number of applications in machine learning and statistics such as coresets for large datasets [23], attention approximation [22], covariate balance in experimental design [HSSZ24], and distribution thinning [13] where balancing a set of vectors in two parts allows one to approximate the whole by some carefully chosen subset. The Komlós problem was a longstanding conjecture in discrepancy theory until it was recently resolved by Guo, Fang, and Lu [17]. In this work, we study the time needed to find a signing.

Algorithmic discrepancy theory offers several starting points. The earliest algorithms, due to Bansal [5], used semidefinite programs to correlate the increments of a random walk and obtained algorithmic counterparts of entropy-method bounds. Lovett and Meka [26] replaced this optimization step by a walk in the subspace orthogonal to nearly tight constraints; their partial-coloring algorithm illustrates a principle that also guides our construction, namely to protect a small collection of constraints while the remaining dimensions make progress. For vector balancing, Banaszczyk’s Gaussian-measure theorem [4] gives discrepancy O(log⁡2n)O(\sqrt{\log2n}) under normalized column norms. Dadush, Garg, Lovett, and Nikolov [15] connected that theorem to subgaussian distributions over signed sums, which the Gram–Schmidt walk [8] samples efficiently. Guo, Fang, and Lu [17] proved that the constant 32π3\sqrt{2\pi} suffices (see also the shorter proof of Karingula and Lovett [21], with constant 36), and introduced a polynomial-time spectral signing algorithm [16]. Li [25] developed this framework into a deterministic algorithm with discrepancy below 99 and arithmetic cost O(mn+nω+2log⁡3n)O(mn+n^{\omega+2}\log^3 n).

Main Result

For a rational-valued input, let LinL_{\mathrm{in}} be its total binary encoding length. We count bit operations with fast integer arithmetic, and allow O~\widetilde{O} to suppress factors polynomial in log⁡(2n)\log(2n). Now, we are ready to state our main result.

Theorem 1.1. There exists a randomized algorithm that takes any A∈Qm×n\mathbf{A}\in\mathbb{Q}^{m\times n} with column norms at most 1, and returns ε∈{−1,1}n\varepsilon\in\{-1,1\}^{n} with ∥Aε∥∞<99\|\mathbf{A}\varepsilon\|_{\infty}<99 in O~(Lin+nω)\widetilde{O}(L_{\mathrm{in}}+n^\omega) expected bit operations.

Remark 1.2. For real-valued inputs, the idealized algorithm uses O~(mn+nω)\widetilde{O}(mn+n^\omega) operations in a model that assigns unit cost to field operations, comparisons, square roots, and scalar Gaussian samples, and the finite-bit algorithm approximates these normalizations and gives Gaussian digits from random bits [20]. For rational entries of at most BB bits, the input term becomes O~(mnB)\widetilde{O}(mnB).

Proof Overview

We begin by reviewing the spectral signing approach of [16, 25]. Spectral signing moves a fractional coloring x∈[−1,1]nx\in[-1,1]^n from the origin to a vertex of the cube. Every medium row carries two concave barriers, one for each sign of its discrepancy, and rows near their barriers are protected so that, by concavity, their barriers cannot increase. The barrier weights enter an entrywise nonnegative Gram matrix M\mathbf{M}, and bounding its top eigenvalue bounds 1TM1\mathbf{1}^{\mathsf T}\mathbf{M}\mathbf{1} and hence the number of protected rows. Li’s algorithm [25] tracks this eigenvalue, slightly regularized, with a potential that is both the safety device and the progress clock: each full step chooses the better of x±thx\pm th and lowers the potential by a definite amount. That requires the top eigenvalue to be smooth along the step, hence a gap below it, and Li’s regularizer guarantees a gap of only order 1/n1/n at the start. Steps must therefore be tiny, and the algorithm makes O(n2log⁡n)O(n^2\log n) updates, each paying for a fresh round of dense matrix computations. Li observes that a faster algorithm needs a potential that, like the top eigenvalue, controls the averages of the Gram matrix over every set of active coordinates, while being smooth at a coarser scale [25 Section 12]. We keep Li’s barriers, affine row representations, and final constant, and change three things: the potential, the way steps are signed, and how often the spectral computation is paid for. Two smaller departures are the retirement of rows with tiny mass and a rational weight function, which we describe in further detail in § 2.1.

In an ambient space of ss active coordinates, we use the resolvent potential

Fb(M)=1T(bI−M)−11−sb.(2)F_b(\mathbf{M})=\mathbf{1}^{\mathsf T}(b\mathbf{I}-\mathbf{M})^{-1}\mathbf{1}-\frac{s}{b}. \tag*{(2)}

where M\mathbf{M} is PSD and entrywise nonnegative, with M≺bI\mathbf{M} \prec b\mathbf{I}. It is a barrier for λmax⁡(M)<b\lambda_{\max}(\mathbf{M}) < b: finite and nonnegative on that region, it blows up as λmax⁡(M)\lambda_{\max}(\mathbf{M}) increases to bb, so along a path that starts inside the region a bounded potential keeps the top eigenvalue below bb, and Li’s count of nearly tight rows still applies. Its Neumann series has nonnegative terms, so FbF_b decreases when entries of M\mathbf{M} decrease or a coordinate is fixed, which is the property Li asks for. Unlike the top eigenvalue, it is a rational function of M\mathbf{M} on the whole region, so repeated or crossing eigenvalues cost nothing.

Each step first exposes a proposal, a direction hh and a length tt clipped so that x±thx \pm th both stay in the cube, and only then draws a fair sign σ\sigma. If FbF_b is concave on the segment, then EσFb(M(x+σth))≤Fb(M(x))\mathbb{E}_{\sigma}F_b(\mathbf{M}(x+\sigma th)) \leq F_b(\mathbf{M}(x)), so the potential is a supermartingale and Doob’s inequality keeps it below a cap. Here, we measure progress separately by the coordinate energy ∥x∥2\lVert x\rVert^2, which grows by t2∥h∥2t^2\lVert h\rVert^2 in expectation (Theorem 3.1). The step length is therefore set, up to a logarithmic factor needed for concentration, by the inverse-polylogarithmic radius of the region where concavity is certified, and the walk takes O~(n)\widetilde{O}(n) steps instead of Li’s O(n2log⁡n)O(n^2\log n).

However, recomputing a curvature subspace at every step would still cost nω+1n^{\omega+1}, and dynamic inverse maintenance does not help directly, since a step changes every row weight and hence changes M\mathbf{M} by a matrix of high rank. Therefore, we instead compute a subspace at an anchor and reuse it for a batch of steps. Theorem 2.1 finds a subspace of dimension at least ⌈s/32⌉\lceil s/32\rceil on which the Hessian P−D\mathbf{P}-\mathbf{D} of FbF_b satisfies P0[h]≤(1−ρ)D0[h]\mathbf{P}_0[h] \leq(1-\rho)\mathbf{D}_0[h], a margin measured against the barriers’ own concavity, and shows that this certificate survives a trust window of inverse-polylogarithmic radius once nearly tight rows and rows of large load are frozen (§ 2.2). Each direction’s normal is added as a constraint, so directions within a batch are nearly orthogonal and, with the fair signs, the walk stays in its window. A batch ends after about s/log⁡ns/\log n constraints, so an epoch, which ends when the number of active coordinates halves, contains only polylogarithmically many anchors. Within a batch, directions come from a square Gaussian completion matrix Q\mathbf{Q} whose rows are the constraints so far, hidden Gaussian rows, and one reference row. The vector Q−1ek\mathbf{Q}^{-1}e_k is annihilated by every row except the reference row, and since the common kernel of d−1d-1 Gaussian rows in dd dimensions is a uniformly random line, it yields a nearly isotropic feasible direction (Theorem 4.1). Adding a constraint overwrites one hidden row, in a predetermined order, which gives the setting of van den Brand, Nanongkai, and Saranurak [33], and amortized O~(sω−1)\widetilde{O}(s^{\omega-1}) work per operation (Theorem 5.1).

Finally, we note that retiring rows of tiny mass leaves O~(s)\widetilde{O}(s) rows per anchor, so each epoch costs O~(sω)\widetilde{O}(s^\omega), and the geometrically shrinking epochs sum to O~(nω)\widetilde{O}(n^\omega). § 6 implements the algorithm with polylogarithmic-bit numbers, using gap-free approximate diagonalization [30] at anchors and dithered rounding that couples the sampler to an exact reference process. From here, independently restarting the process yields the expected-time bound.

Related Work

Bansal’s semidefinite-programming algorithm [5] and the Lovett–Meka walk [26] made classical discrepancy bounds constructive. Levy, Ramadas, and Rothvoss [27] obtained deterministic algorithms through multiplicative weights. Bansal and Garg [10] controlled the full rounding trajectory to avoid the accumulation of partial-coloring errors, while Bansal [6] combined iterated rounding with concentration. The stochastic framework of Bansal, Laddha, and Vempala [12] and the regularization framework of Pesenti and Vladu [29] give broader ways to design walks and discrepancy potentials. Banaszczyk’s Gaussian-measure theorem [4] gives an O(log⁡(2n))O(\sqrt{\log(2n)}) Komlós bound. Bansal, Dadush, and Garg [7] made this bound algorithmic. Dadush, Garg, Lovett, and Nikolov [15] related vector balancing to subgaussian signed sums, and the Gram-Schmidt walk [8] efficiently constructs such distributions. More recently, Bansal and Jiang [11] improved the Komlós bound to O~((log⁡n)1/4)\widetilde{O}((\log n)^{1/4}) through affine spectral independence. Guillen and Kobzar [18] proved a constant bound when signs may be arbitrary complex numbers of unit modulus. Their concave energy barriers are among the precursors of the spectral signing framework used here. On the other hand, fast implementations pose a separate problem. The self-balancing walk of Alweiss, Liu, and Sawhney [1] gives logarithmic Komlós bounds in linear time, and Larsen [24] gives faster algorithms with hereditary guarantees. Our analysis instead combines an absolute discrepancy bound with nearly matrix-multiplication time. Its computational tools come from dynamic inverse maintenance [33] and the matrix-formula framework [32]. Stable fast linear algebra [14] and the bit-complexity analysis of dynamic algebraic formulas [3] address numerical implementation. These tools become useful here after the geometric analysis limits how often the walk rebuilds its curvature subspace.

Notation

We use Euclidean vector norms and operator matrix norms unless a subscript indicates otherwise. Matrices are bold. For quadratic forms, D[h]\mathbf{D}[h] means hTDhh^{\mathsf{T}}\mathbf{D}h. Matrix inequalities use the Loewner order unless we explicitly specify entrywise comparison, and 1\mathbf{1} denotes the all-ones vector. We write L=⌈log⁡2(2n)⌉L=\lceil\log_2(2n)\rceil. Several objects come from Li [25], sometimes under different names; for example, Li’s R0R_0, b0b_0, and A0A_0 are our Rmax⁡R_{\max}, bdepb_{\mathrm{dep}}, and ν(0)\nu(0), and Li’s LL is a top eigenvalue. Symbols introduced inside a proof in the appendices are local to that proof.

The potential is FbF_b (which we shorten to FF in Appendices B, C, and F where bb is fixed). The calligraphic F\mathcal{F} is the set of frozen rows when it is an index set (§ 2.2) and the exposed history in conditional expectations, and the italic FF is the feasible subspace in § 4 and Appendix D. Besides the spectral level bb (or bjb_j in epoch jj) and the coefficient vectors bib_i, bb counts constraint slots in § 4. The index jj ranges over coordinates, except in bjb_j, NjN_j, TjT_j, where it indexes epochs. P\mathcal{P} and PP are caps, and P\mathcal{P} is a curvature matrix. We let A=bI−MA=bI-M, where A(Q)A(Q) is the augmented completion matrix. We use tt to index steps, ttt_t to be a step length, and ti=ziTvt_i=z_i^{\mathsf{T}}v to be a load. Then, KK bounds ∥Q∥F\lVert Q\rVert_F, ∥Q−1∥F\lVert Q^{-1}\rVert_F in Theorem 5.1 and Appendix E and abbreviates KratK_{\mathrm{rat}} in Appendix A. Inside proofs in Appendices D and E, LL may name a local quantity; elsewhere L=⌈log⁡2(2n)⌉L=\lceil\log_2(2n)\rceil. Finally, GiG_i is the energy of row ii and ∥x∥2\lVert x\rVert^2 the coordinate energy; unqualified “energy” in § 3 and Appendix F means the latter. (Li uses that name for ∑j(1−xj2)=n−∥x∥2\sum_j(1-x_j^2)=n-\lVert x\rVert^2.)

The batched signing algorithm

We begin by recalling the framework we use from Li (§ 2.1), which gives the new batch certificate (§ 2.2), and assembles the algorithm.

The framework from Li

The walk maintains a fractional coloring x∈[−1,1]nx\in[-1,1]^n, starting at x=0x=0. A coordinate is fixed once it reaches ±1\pm1, and VV denotes the set of ss active coordinates. This subsection follows Li [25], § 3, except for the retirement of rows with very small mass and a rational weight function. Rows with ∥ai∥≤1\lVert a_i\rVert\le1, whose discrepancy never exceeds one, are discarded first, and fewer than n2n^2 rows remain (Appendix A), at a cost of O(mn)O(mn) arithmetic operations.

References

  1. [1][ALS21] Ryan Alweiss, Yang P. Liu, and Mehtaab Sawhney. Discrepancy minimization via a self-balancing walk. In 53rd Annual ACM SIGACT Symposium on Theory of Computing (STOC), pages 14–20, 2021.
  2. [2]Emile Anand, Jan van den Brand, and Peter Chen. Finite-precision Gram–Schmidt walks, 2026. arXiv:2610.08562.arxiv.org/abs/2610.08562
  3. [3]Emile Anand, Jan van den Brand, Mehrdad Ghadiri, and Daniel J. Zhang. The bit complexity of dynamic algebraic formulas and their determinants. In 51st International Colloquium on Automata, Languages, and Programming (ICALP), volume 297 of Leibniz International Proceedings in Informatics, pages 10:1–10:20, 2024.arxiv.org/abs/2401.11127
  4. [4]Wojciech Banaszczyk. Balancing vectors and Gaussian measures of n-dimensional convex bodies. Random Structures & Algorithms, 12(4):351–360, 1998.
  5. [5]Nikhil Bansal. Constructive algorithms for discrepancy minimization. In 51st Annual IEEE Symposium on Foundations of Computer Science (FOCS), pages 3–10, 2010.arxiv.org/abs/1002.2259
  6. [6]Nikhil Bansal. On a generalization of iterated and randomized rounding. Theory of Computing, 20(6):1–23, 2024.
  7. [7]Nikhil Bansal, Daniel Dadush, and Shashwat Garg. An algorithm for Komlós conjecture matching Banaszczyk’s bound. SIAM Journal on Computing, 48(2):534–553, 2019.
  8. [8]Nikhil Bansal, Daniel Dadush, Shashwat Garg, and Shachar Lovett. The Gram–Schmidt walk: A cure for the Banaszczyk blues. Theory of Computing, 15(21):1–27, 2019.arxiv.org/abs/1708.01079
  9. [9]József Beck and Tibor Fiala. “integer-making” theorems. Discrete Applied Mathematics, 3(1):1–8, 1981.DOI
  10. [10]Nikhil Bansal and Shashwat Garg. Algorithmic discrepancy beyond partial coloring. In 49th Annual ACM SIGACT Symposium on Theory of Computing (STOC), pages 914–926, 2017.
  11. [11]Nikhil Bansal and Haotian Jiang. Decoupling via affine spectral-independence: Beck–Fiala and Komlós bounds beyond Banaszczyk. In 58th Annual ACM Symposium on Theory of Computing (STOC), pages 432–442, 2026.DOI
  12. [12]Nikhil Bansal, Aditi Laddha, and Santosh Vempala. A unified approach to discrepancy minimization. In Approximation, Randomization, and Combinatorial Optimization. Algorithms and Techniques (APPROX/RANDOM), volume 245 of Leibniz International Proceedings in Informatics, pages 1:1–1:22, 2022.arxiv.org/abs/2205.01023
  13. [13]Annabelle Michael Carrell, Albert Gong, Abhishek Shetty, Raaz Dwivedi, and Lester Mackey. Low-rank thinning. In Proceedings of the 42nd International Conference on Machine Learning, volume 267 of Proceedings of Machine Learning Research, pages 6811–6848. PMLR, 2025.arxiv.org/abs/2502.12063
  14. [14]James Demmel, Ioana Dumitriu, and Olga Holtz. Fast linear algebra is stable. Numerische Mathematik, 108(1):59–91, 2007.
  15. [15]Daniel Dadush, Shashwat Garg, Shachar Lovett, and Aleksandar Nikolov. Towards a constructive version of Banaszczyk’s vector balancing theorem. Theory of Computing, 15(15):1–58, 2019.
  16. [16]Shengtao Guo, Ethan X. Fang, and Junwei Lu. Vector balancing in polynomial time, 2026.arxiv.org/abs/2609.23540
  17. [17]Shengtao Guo, Ethan X. Fang, and Junwei Lu. Vector balancing via directional total variation, 2026.arxiv.org/abs/2609.11189
  18. [18]Nestor Guillen and Vladimir A. Kobzar. The Komlós conjecture for complex discrepancy, 2026.arxiv.org/abs/2609.15071
  19. [20]Charles F. F. Karney. Sampling exactly from the normal distribution. ACM Transactions on Mathematical Software, 42(1):3:1–3:14, 2016.DOI
  20. [21]Sankeerth Rao Karingula and Shachar Lovett. An elementary proof of the Komlós conjecture, 2026.arxiv.org/abs/2609.20979
  21. [22]Ekaterina Kochetkova, Kshiteej Sheth, Insu Han, Amir Zandieh, and Michael Kapralov. Streaming attention approximation via discrepancy theory, 2026.arxiv.org/abs/2502.07861
  22. [23]Edo Liberty, Alexandr Andoni, and Eldar Kleiner. Nearly optimal attention coresets, 2026.arxiv.org/abs/2605.05602
  23. [24]Kasper Green Larsen. Fast discrepancy minimization with hereditary guarantees. In ACM–SIAM Symposium on Discrete Algorithms (SODA), 2023.arxiv.org/abs/2207.03268
  24. [25]Xiaoyu Li. Fast spectral signing for vector balancing, 2026.arxiv.org/abs/2609.30044
  25. [26]Shachar Lovett and Raghu Meka. Constructive discrepancy minimization by walking on the edges. SIAM Journal on Computing, 44(5):1573–1582, 2015.
  26. [27]Avi Levy, Harishchandra Ramadas, and Thomas Rothvoss. Deterministic discrepancy minimization via the multiplicative weight update method. In Integer Programming and Combinatorial Optimization (IPCO), volume 10328 of Lecture Notes in Computer Science, pages 380–391, 2017.arxiv.org/abs/1611.08752
  27. [28]László Lovász, Joel Spencer, and Katalin Vesztergombi. Discrepancy of set-systems and matrices. European Journal of Combinatorics, 7(2):151–160, 1986.DOI
  28. [29]Lucas Pesenti and Adrian Vladu. Discrepancy minimization via regularization. In ACM–SIAM Symposium on Discrete Algorithms (SODA), pages 1734–1758, 2023.arxiv.org/abs/2211.05509
  29. [30]Rikhav Shah. Fast Hermitian diagonalization with nearly optimal precision, 2024.arxiv.org/abs/2408.09880
  30. [31]Joel Spencer. Ten Lectures on the Probabilistic Method, volume 52 of CBMS-NSF Regional Conference Series in Applied Mathematics. Society for Industrial and Applied Mathematics, 1987.
  31. [32]Jan van den Brand. Unifying matrix data structures: Simplifying and speeding up iterative algorithms. In Symposium on Simplicity in Algorithms (SOSA), pages 1–13, 2021.arxiv.org/abs/2010.13888
  32. [33]Jan van den Brand, Danupon Nanongkai, and Thatchaphol Saranurak. Dynamic matrix inverse: Improved algorithms and matching conditional lower bounds. In 60th IEEE Symposium on Foundations of Computer Science (FOCS), pages 456–480, 2019.arxiv.org/abs/1905.05067

Paper details

vlnc:W_qutakc7w
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

GPT-6 Astra (bare), Devin, Claude Opus 5.5 (bare)

View statement
Looking for related papers…
Contents