One-Bit Estimators via the Balanced Fast Johnson-Lindenstrauss Transform

Alexander J SmolaarXiv 2026

TL;DR

Compressing massive, high-dimensional vectors down to just 1-bit sign codes makes similarity search and LLM attention caching blazingly fast—except that generating those codes with dense matrices creates a nasty encoding bottleneck. This paper provides the first finite-sample theoretical guarantees for accelerating 1-bit sketches using sparse projections, revealing a crisp geometric trade-off: quantizing to one bit forces you to make your projection matrix slightly denser, rather than making your bit-strings longer. Along the way, it introduces a hardware-friendly "balanced" transform that simultaneously speeds up execution and improves statistical accuracy.

What Problem Does This Paper Address?

Modern vector databases and LLM key-value (KV) caches store billions of high-dimensional vectors and need to rapidly estimate inner products against incoming queries. One-bit sketches achieve extreme compression by multiplying a vector by a random Gaussian matrix and keeping only the signs ($\pm 1$) of the output. You can then compare two sign codes directly (symmetric, known as SimHash or BB) or correlate a stored sign code against an uncompressed query (asymmetric, or BG, used in recent LLM KV-cache compressors like QJL and TurboQuant).

The catch? Multiplying an $n$-dimensional vector by a dense $\ell \times n$ matrix takes $O(n\ell)$ operations—meaning encoding a single vector costs as much as comparing it against $n$ compressed codes. For standard linear sketches (GG), the Fast Johnson–Lindenstrauss Transform (FJLT) solves this by first applying random sign flips and a fast Walsh–Hadamard transform (spreading a vector's energy evenly across coordinates in $O(n \log n)$ time), and then multiplying by a sparse matrix with roughly $r \ll n$ nonzeros per row.

Practitioners have naturally tried taking the signs of an FJLT to get fast 1-bit sketches, but finite-sample guarantees were missing. Why? Because classical FJLT proofs rely heavily on linearity, and the sign() function shatters linearity.

Methods

The author analyzes three estimators—GG (full precision), BG (1-bit stored, full query), and BB (1-bit on both sides)—through a unified geometric lens and introduces three main technical components:

  • Random-Metric Analysis: Conditioned on which $r$ coordinates a sparse row samples, the projection is still exact Gaussian, but it views the 2D plane spanned by two vectors through a randomly distorted metric (deforming the unit circle into an ellipse).
Figure 1: Conditioned on its support S, a sparse row views the pair (u, v) through the subsampled pair (˜uS, ˜vS); among the three geometric features read by the estimators, only the inner product is unbiased across supports. Left: a dense row sees (˜u, ˜v) on the Euclidean unit circle. Right: given S, coordinate subsampling deforms the unit circle of span{u, v} (dashed) into an ellipse. The linear estimator GG reads σuv = ⟨˜uS, ˜vS⟩, the asymmetric estimator BG reads the scalar projection ζS = σuv/σu of ˜vS onto the direction of ˜uS, and SimHash (BB) reads the angle θS.
  • Balanced FJLT: In the classical FJLT, each coordinate enters a row independently with probability $r/n$, yielding ragged row lengths that require awkward sparse-matrix indexing and uneven thread loads. Here, every row chooses exactly $r$ coordinates uniformly without replacement. This turns the sparse matrix into simple rectangular arrays and eliminates row-length fluctuations.
  • Data-Dependent Certificates & Catoni Decoding: Instead of relying solely on pessimistic worst-case union bounds, the theorems hold conditionally on the realized Hadamard sign flips. By recording simple $O(n)$ summary statistics during encoding—how spiky a preconditioned vector's coordinates are—practitioners can compute tight accuracy certificates directly on their deployed data. Furthermore, replacing the standard dot-product average with Catoni’s robust mean estimator tames rare outlier rows; in a neat one-step variant for BG, this reduces to softly clipping the query projections once upon arrival before taking a standard dot product.

Datasets

Because this is a theoretical paper, the author does not evaluate on external real-world datasets. Instead, the theory is stress-tested via controlled numerical simulations in dimensions $n = 4,096$ to $65,536$ across three synthetic vector pair geometries:

  • Gaussian pairs: Typical well-spread vectors.
  • One-hot pairs: Standard basis vectors, which Hadamard preconditioning makes perfectly flat (the best-case geometry).
  • Hard Walsh-block pairs: Newly constructed adversarial pairs where random signs align with Walsh functions, creating spiky vectors that probe the exact worst-case regime of the paper's lower bounds.

Key Insights and Ideas

  • Why 1-bit sparse sketches have an irreducible floor ("Support Bias"): A full-precision sketch (GG) reads the inner product on the distorted ellipse, which is a linear function of the random metric—so distortions average out to zero across rows. By contrast, BG normalizes by a distorted length and BB reads a distorted angle. Because these are nonlinear operations, metric fluctuations create a systematic second-order shift called support bias (via Jensen's inequality). Adding more rows ($\ell$) shrinks variance, not this bias! Only increasing row density ($r$) dampens the ellipse distortion itself.
  • Quantization costs row density, not sketch length: To hit accuracy $\varepsilon$, sparse 1-bit sketches need essentially the same number of bits ($\ell = O(\varepsilon^{-2} \log(N/\delta))$) as dense sketches, but require $r = O(\varepsilon^{-1} \log(nN/\delta))$ nonzeros per row—an unavoidable $1/\varepsilon$ tax proven via matching lower bounds.
  • Hardware-friendly balancing is a statistical free lunch: Fixing every row to have exactly $r$ nonzeros doesn't just make SIMD/GPU gathers branch-free; it removes row-length variance, cutting BG's support bias by ~33% on Gaussian inputs and reducing it to exact zero on perfectly flat vectors.
  • Correcting a literature bug: Along the way, the paper derives the sharp sub-Gaussian constant ($\pi$) for dense BG sketches, catching and fixing an optimistic constant error in the prior QJL KV-cache analysis that underestimated required sketch lengths.

Key Results

  • Drastic sparsity reductions via certificates: For a realistic billion-vector scale ($m = N = 10^9$, dimension $n = 65,536$, target error $\varepsilon = 0.1$), worst-case bounds demand sampling ~15–17% of coordinates per row. Evaluating the paper's data-dependent certificates on typical Gaussian-like pairs slashes the required sparsity to roughly 0.6%–1.3% ($r \approx 398\text{–}849$), a 12× to 29× reduction over worst-case theory.
Certified sketch budgets at n = 65,536 and N = 10^9 show typical-pair sparsity dropping to ~1% compared to 15-17% in the worst case.
  • Bias–variance trade-off in action: Simulations at $n = 4,096$ show GG and BB maintaining dense-sketch accuracy all the way down to $r = 32$ and $r = 8$. Meanwhile, BG clearly exhibits the predicted support bias: quadrupling accuracy (increasing $\ell$ from $2^9$ to $2^{15}$ to cut noise by 8×) requires 8× denser rows ($r = 32 \to 256$) to keep bias below the noise floor. Even so, sampling just 1 in 16 coordinates ($r = 256$) brings all estimators within 10% of dense baselines.
RMSE vs. row sparsity r: as sketch length increases from 2^9 to 2^15, only the asymmetric estimator BG requires proportionally denser rows to beat its bias floor.
  • Full-precision optimal sparsity: When no signs are taken (GG), Catoni's robust decoder achieves accuracy $\varepsilon$ using just $r = O(\log(nm/\delta))$ nonzeros per row—completely independent of $\varepsilon$.

Limitations and Future Work

  • Dimension sweet spot: Because FJLT overhead scales with $\log n$, sparse 1-bit sketches shine when $n$ is in the thousands or tens of thousands. For single LLM attention heads ($n \approx 128$), certified $r$ exceeds $n$, so standard dense projections remain the right tool unless keys are grouped across heads.
  • Conservative worst-case constants: While conditional bounds match empirical bias within a factor of 2×–6× on hard inputs, worst-case corollaries and unconditional lower bounds remain separated by a constant factor of >5,000 due to union-bound slack.
  • Open theoretical questions: Proving whether SimHash (BB) truly requires the $1/\varepsilon$ sparsity factor under additive error (rather than relative small-angle error), proving dimension-free concentration for fourth moments, and testing fused GPU kernels on live LLM and billion-scale vector search workloads remain exciting next steps.

Summary updated

BibTeX
@misc{smola2026one,
  author = {Alexander J Smola},
  title = {{One-Bit Estimators via the Balanced Fast Johnson-Lindenstrauss Transform}},
  year = {2026},
  eprint = {2611.35730},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.35730},
}
Figure