arXiv:2608.26552cs.DSAug 2026

Manuscript Offprint

arXiv:2608.26552

Hadamard Flattening and Gaussian Pooling Sketch for Least Squares with Coordinate-wise Guarantee

Zhao Song, Lichen Zhang

Abstract

Randomized sketch-and-solve algorithms accelerate overconstrained ℓ2\ell_2 regression by replacing the input with a much smaller, randomly projected problem. Standard subspace embeddings guarantee that the cost of the regression is nearly preserved, but coordinate-wise accuracy of the solution is more delicate: instead of preserving the objective value, we want the solution vector itself to be close to the optimal solution in ℓ∞\ell_\infty norm. In particular, we want to find a vector x′∈Rdx' \in \mathbb{R}^d such that ∥x′−x⋆∥∞≤ϵd⋅∥Ax⋆−b∥2⋅∥A†∥op\|x' - x^\star\|_\infty \leq \frac{\epsilon}{\sqrt{d}} \cdot \|Ax^\star - b\|_2 \cdot \|A^\dagger\|_op, where A∈Rn×dA \in \mathbb{R}^{n \times d} is the design matrix, b∈Rnb \in \mathbb{R}^n is the label vector, x⋆∈Rdx^\star \in \mathbb{R}^d is the optimal solution and A†A^\dagger is the pseudo-inverse of AA. Price, Song and Woodruff initiated the study of this problem and showed that the subsampled randomized Hadamard transform (SRHT) with O(ϵ−2d1+Θ(log⁡log⁡n/log⁡d))O(\epsilon^{-2}d^{1+\Theta(\sqrt{\log \log n / \log d})}) rows achieves this guarantee. A subsequent work of Song, Ye, Yin and Zhang claimed to improve the row count to O(ϵ−2dlog⁡3n)O(\epsilon^{-2}d \log^3 n). Unfortunately, their proof relies on an independence assumption that does not hold in general, and we exhibit an explicit instance on which it fails.

To achieve a truly nearly-linear-in-d row count, we introduce a new fast, dense randomized transform, which combines a randomized Hadamard flattening, a random permutation, and balanced, disjoint Gaussian pooling. Conditioned on the Hadamard-and-permutation stage, the sketched problem becomes an exact Gaussian regression in which the noise is independent of the entire sketched design; this conditional independence is exactly what the earlier argument was missing. Our sketch yields the ℓ∞\ell_\infty guarantee with m=O(ϵ−2dlog⁡d)m = O(\epsilon^{-2}d\log d) rows, uses one Hadamard pass with a padded internal dimension N=O~(n+ϵ−2d3)N = \widetilde{O}(n + \epsilon^{-2}d^3), and is efficient to apply: the sketched pair (SA,Sb)(SA, Sb) can be computed in O(Ndlog⁡N)=O~(nd+ϵ−2d4)O(Nd\log N) = \widetilde{O}(nd + \epsilon^{-2}d^4) time.

1 Introduction

Least-squares regression is a workhorse of scientific computing, numerical linear algebra, and modern machine learning pipelines. In the overconstrained setting, a data matrix A∈Rn×dA \in \mathbb{R}^{n \times d} with n≫dn \gg d and a label vector b∈Rnb \in \mathbb{R}^n are given, and one wishes to (approximately) minimize ∥Ax−b∥2\|Ax - b\|_2 over x∈Rdx \in \mathbb{R}^d. A natural way to speed this up is to compress the problem before solving it: the sketch-and-solve paradigm draws an oblivious random matrix S∈Rm×nS \in \mathbb{R}^{m \times n} with m≪nm \ll n, forms SA and Sb, and solves the m-row problem min⁡x∈Rd∥SAx−Sb∥2\min_{x \in \mathbb{R}^d} \|SAx - Sb\|_2 instead. Randomized compression of this kind traces back to the Johnson–Lindenstrauss lemma [JL84]: any N points in Euclidean space can be mapped into O(ϵ−2log⁡N)O(\epsilon^{-2} \log N) dimensions so that every pairwise distance is preserved up to a 1±ϵ1 \pm \epsilon factor, and Larsen and Nelson [LN17] proved that no embedding, linear or not, can do better in the worst case. Regression asks for more than pairwise distances, and the right tool is an oblivious

∗^{*}Independent Researcher. Email: magic.linuxkde@gmail.com.

†^{\dagger}Massachusetts Institute of Technology. Email: lichenz@mit.edu.

subspace embedding [Sar06, DMMS11]: a random matrix that simultaneously preserves the norm of every vector in a fixed low-dimensional subspace, which suffices for relative-error guarantees on the objective. Such embeddings admit fast implementations of two kinds: dense ones built from randomized Hadamard transforms, and sparse ones built from hashing, including CountSketch, which originated in streaming frequency estimation [CCFC02] and later enabled regression in input-sparsity time [CW17], and OSNAP [NN13], which refined the tradeoff between sparsity and embedding dimension.

Guarantees of this type, however, primarily control the residual or a global norm of the solution error. When SS is an oblivious subspace embedding with distortion ϵ\epsilon, the minimizer x′x' of the sketched problem satisfies ∥x′−x⋆∥2≤O(ϵ)⋅∥Ax⋆−b∥2⋅∥A†∥op\|x' - x^\star\|_2 \leq O(\epsilon) \cdot \|Ax^\star - b\|_2 \cdot \|A^\dagger\|_{\mathrm{op}}, where x⋆x^\star denotes the optimal solution. For a direction a∈Rda \in \mathbb{R}^d fixed independently of the sketch, Cauchy–Schwarz then gives

∣⟨a,x′−x⋆⟩∣≤O(ϵ)⋅∥a∥2⋅∥Ax⋆−b∥2⋅∥A†∥op.|\langle a,x^{\prime}-x^{\star}\rangle|\leq O(\epsilon)\cdot\|a\|_{2}\cdot\|A x^{\star}-b\|_{2}\cdot\|A^{\dagger}\|_{\mathrm{o p}}.

This estimate, however, leaves a factor of d\sqrt{d} on the table: for a generic direction aa, the deviation should scale like a 1/d1/\sqrt{d} fraction of the ℓ2\ell_2 error, and a bound of this refined form, applied simultaneously to a=e1,…,eda = e_1, \ldots, e_d, yields an ℓ∞\ell_\infty guarantee on x′−x⋆x' - x^\star. Price, Song and Woodruff [PSW17] confirmed this prediction for the subsampled randomized Hadamard transform (SRHT), albeit with a row count that is superlinear in dd. [SYYZ23] later claimed a nearly-linear-in-d row count by combining a constant-distortion oblivious subspace embedding with an oblivious coordinate-wise embedding for a fixed pair of vectors. Unfortunately, their argument applies the fixed-vector guarantee to a direction that contains the inverse of the random sketched Gram matrix and therefore depends on the same sketch. The stated guarantee does not cover this adaptive choice, and as we show in Section 2, the gap is genuine rather than merely formal.

In this work, we introduce a new sketch, which we call the balanced Gaussian-pooled transform, and prove that it achieves the ℓ∞\ell_{\infty} guarantee with a truly nearly-linear-in-d row count. Since this sketch is the central object of the paper, let us first state its ingredients explicitly. The transform factors as

S:=BDγΠFNDσJ,S:=B D_{\gamma}\Pi F_{N}D_{\sigma}J,

applied from right to left: J pads the input from dimension n to a larger internal dimension N by appending zeros, DσD_{\sigma} is a diagonal matrix of random signs, FNF_N is one normalized Hadamard transform, Π\Pi is a uniformly random permutation, DγD_{\gamma} is a diagonal matrix of independent standard Gaussians, and B partitions the N coordinates into m consecutive blocks of equal size and sums each block. We call the block-summing step Gaussian pooling, since each row of the sketch pools an entire block of Gaussian-weighted coordinates; the blocks are balanced in the sense that, with high probability, the Hadamard transform and the random permutation spread the subspace relevant to the regression so evenly that every block carries a nearly equal share of its energy.

The intuition behind the construction is to expose the randomness in two stages. The first stage, the randomized Hadamard transform followed by the random permutation, flattens and shuffles the (padded) column space of A together with the residual direction, so that every block becomes a nearly isotropic copy of this fixed (d+1)(d+1)-dimensional subspace. Conditional on the first stage, the second stage takes over: because the pooling blocks are disjoint, the rows of the sketched problem are independent Gaussian vectors, and the sketched least squares becomes an exact Gaussian regression whose noise is independent of the entire design. The inverse sketched Gram matrix may then depend on the design in an arbitrary fashion, and no fixed-vector guarantee is ever applied to a sketch-dependent direction. With probability at least 1−δ1 - \delta, the resulting estimator satisfies the fixed-direction guarantee with m=O(ϵ−2dlog⁡(1/δ))m = O(\epsilon^{-2}d\log(1/\delta)) rows, and the simultaneous guarantee over all dd coordinates with m=O(ϵ−2dlog⁡(d/δ))m = O(\epsilon^{-2}d\log(d/\delta)) rows. The transform uses a single Hadamard pass, but we emphasize that it is not the canonical SRHT: the analysis works with a padded internal dimension N=O~(n+ϵ−2d3)N = \widetilde{O}(n + \epsilon^{-2}d^{3}).