Skip to main content

Concentration Probability

Fast and Sparse Johnson-Lindenstrauss Transforms

Applying a Johnson-Lindenstrauss embedding faster than a dense k-by-d matrix: the Ailon-Chazelle fast transform, the dual BCH and RIP-based refinements, sparse matrices with order log(1/delta)/epsilon nonzeros per column, and the Larsen-Nelson theorem that no embedding, linear or not, beats order log(n)/epsilon^2 dimensions on worst-case point sets.

AdvancedAdvancedTier 2StableSupporting~60 min
For:MLResearch

Learning position

Place this page in a reading path.

concentration-probability | layer 4 | tier 2. This page has 3 direct prerequisites and 0 published dependents.

What next

Sparse Recovery and Compressed Sensing

This is the first curated or graph-derived continuation from the current page.

Evidence badge

Source-grounded page

This page has no public Lean mapping yet. Use the evidence page to inspect how claim status labels work.

Show the backing system

Why This Matters

The Johnson-Lindenstrauss lemma answers a dimension question: nn points in Rd\mathbb{R}^d fit into k=O(ε−2log⁡n)k = O(\varepsilon^{-2}\log n) dimensions with every squared pairwise distance kept within a factor 1±ε1 \pm \varepsilon. It leaves two questions open. How fast can the map be applied, and can kk be smaller?

The Gaussian proof produces a dense k×dk \times d matrix, so embedding one point costs O(kd)=O(ε−2dlog⁡n)O(kd) = O(\varepsilon^{-2} d \log n) arithmetic operations. With d=220d = 2^{20}, n=106n = 10^6 and ε=0.1\varepsilon = 0.1 that is about 1.4×1091.4 \times 10^9 operations per point before any constant factor. Two lines of work cut this cost. Fast transforms apply a randomized Hadamard transform and then a cheap projection, which costs about dlog⁡dd \log d. Sparse transforms put only O(ε−1log⁡n)O(\varepsilon^{-1}\log n) nonzeros in each column, so the cost scales with the number of nonzero input coordinates instead of with dd.

The dimension question was settled in 2017. Larsen and Nelson built point sets on which every map with the JL guarantee, linear or not, needs Ω(ε−2log⁡n)\Omega(\varepsilon^{-2}\log n) dimensions over almost the whole range of ε\varepsilon where such a bound can hold. The random-projection dimension is therefore not an artifact of the union-bound proof.

Mental Model

Three numbers describe a JL construction:

  1. Rows kk. The target dimension. The lower bounds at the end of this page say kk cannot drop below order ε−2log⁡n\varepsilon^{-2}\log n for worst-case inputs.
  2. Time per point. Dense Gaussian or sign matrices cost O(kd)O(kd). Fast transforms cost O(dlog⁡d)O(d \log d) plus a term that grows with kk. Sparse transforms cost O(s⋅nnz(x))O(s \cdot \mathrm{nnz}(x)).
  3. Column sparsity ss. The number of nonzeros per column. In a stream where one coordinate of xx changes at a time, updating the sketch SxSx costs ss.

The obstacle is a sparse input. If x=e1x = e_1 and the matrix is sparse, then SxSx is one sparse column, and its squared norm averages too few terms to land within 1±ε1 \pm \varepsilon of ∥x∥22\|x\|_2^2. Fast transforms first spread the mass of xx over all coordinates. Sparse transforms instead put exactly ss entries of size s−1/2s^{-1/2} in each column, so ∥Sej∥2=1\|Se_j\|_2 = 1 for every basis vector and all error comes from coordinates that share a row; ss of order ε−1log⁡(1/δ)\varepsilon^{-1}\log(1/\delta) keeps those collisions small.

Formal Setup

Definition

JL guarantee

Let X⊂RdX \subset \mathbb{R}^d with ∣X∣=n|X| = n and ε∈(0,1)\varepsilon \in (0,1). A map f:X→Rkf: X \to \mathbb{R}^k has the ε\varepsilon-JL guarantee on XX if

(1−ε)∥x−y∥22≤∥f(x)−f(y)∥22≤(1+ε)∥x−y∥22for all x,y∈X.(1-\varepsilon)\|x-y\|_2^2 \le \|f(x)-f(y)\|_2^2 \le (1+\varepsilon)\|x-y\|_2^2 \quad \text{for all } x, y \in X.

The map may be nonlinear and may depend on XX.

Definition

Distributional JL property

A distribution D\mathcal{D} over k×dk \times d real matrices has the (ε,δ)(\varepsilon, \delta) distributional JL property if for every fixed x∈Rdx \in \mathbb{R}^d,

PS∼D((1−ε)∥x∥2≤∥Sx∥2≤(1+ε)∥x∥2)>1−δ.\mathbb{P}_{S \sim \mathcal{D}}\big((1-\varepsilon)\|x\|_2 \le \|Sx\|_2 \le (1+\varepsilon)\|x\|_2\big) > 1 - \delta.

For 0<ε,δ<1/20 < \varepsilon, \delta < 1/2 such distributions exist with k=Θ(ε−2log⁡(1/δ))k = \Theta(\varepsilon^{-2}\log(1/\delta)). This is the JL lemma in the form stated as Lemma 1 of Kane and Nelson 2014, who credit it to Johnson and Lindenstrauss.

Taking δ<1/(n2)\delta < 1/\binom{n}{2} and a union bound over the difference vectors x−yx - y turns any distributional JL construction into an ε\varepsilon-JL map for each fixed XX of size nn, with k=O(ε−2log⁡n)k = O(\varepsilon^{-2}\log n). All known upper-bound proofs of the JL lemma take this route (Larsen and Nelson 2017, Section 1.1). Versions stated with squared or unsquared norms differ by a constant rescaling of ε\varepsilon. Below, nnz(x)\mathrm{nnz}(x) is the number of nonzero coordinates of xx, and running times count arithmetic operations for one input vector after the random matrix has been sampled.

Why a Sparse Matrix Alone Fails

Achlioptas showed that a matrix whose entries are 00 with probability 2/32/3 and a scaled ±1\pm 1 otherwise still gives the JL guarantee (Achlioptas 2003). That saves a factor of three. Ailon and Chazelle explain why independent sparsification cannot go much further: a sparse matrix distorts sparse vectors (Ailon and Chazelle 2009, Section 1.1).

Take P∈Rk×dP \in \mathbb{R}^{k \times d} with independent entries that are 00 with probability 1−q1-q and N(0,q−1)\mathcal{N}(0, q^{-1}) with probability qq, so every entry has mean 00 and second moment 11 and E∥Px∥22=k∥x∥22\mathbb{E}\|Px\|_2^2 = k\|x\|_2^2. For x=e1x = e_1, PxPx is the first column of PP. That column is identically zero with probability (1−q)k≥1−qk(1-q)^k \ge 1 - qk. If qk≤1/4qk \le 1/4, the estimate ∥Pe1∥22/k\|Pe_1\|_2^2/k equals 00 with probability at least 3/43/4, while its target is 11. For a flat input with ∣xj∣=d−1/2|x_j| = d^{-1/2} for every jj, each row sums about qdqd nonzero terms of equal size, and once qdqd is large enough the estimate concentrates. The fix is to make every input flat first.

The Fast Johnson-Lindenstrauss Transform

Lemma

Fast Johnson-Lindenstrauss Transform (Ailon-Chazelle)

Statement

Let k=c ε−2log⁡nk = c\,\varepsilon^{-2}\log n for a suitable global constant cc, and let Φ=PHD\Phi = PHD, where:

  • DD is a d×dd \times d diagonal matrix with independent uniform ±1\pm 1 entries;
  • HH is the normalized d×dd \times d Walsh-Hadamard matrix, Hij=d−1/2(−1)⟨i−1, j−1⟩H_{ij} = d^{-1/2}(-1)^{\langle i-1,\, j-1\rangle}, with the inner product of binary expansions taken mod 2;
  • PP is k×dk \times d with independent entries, each 00 with probability 1−q1-q and N(0,q−1)\mathcal{N}(0, q^{-1}) with probability qq, where q=min⁡{Θ(log⁡2n/d), 1}q = \min\{\Theta(\log^2 n / d),\ 1\}.

With probability at least 2/32/3 both of the following hold:

  1. (1−ε)∥x∥2≤k−1/2∥Φx∥2≤(1+ε)∥x∥2(1-\varepsilon)\|x\|_2 \le k^{-1/2}\|\Phi x\|_2 \le (1+\varepsilon)\|x\|_2 for every x∈Xx \in X;
  2. computing Φx\Phi x takes O(dlog⁡d+min⁡{d ε−2log⁡n, ε−2log⁡3n})O\big(d \log d + \min\{d\,\varepsilon^{-2}\log n,\ \varepsilon^{-2}\log^3 n\}\big) operations.

This is the Euclidean case p=2p = 2 of Lemma 1 in Ailon and Chazelle (SIAM J. Comput. 2009), first presented at STOC 2006. The same lemma with q=min⁡{Θ(ε−1log⁡n/d),1}q = \min\{\Theta(\varepsilon^{-1}\log n / d), 1\} embeds into ℓ1k\ell_1^k in O(dlog⁡d+min⁡{d ε−2log⁡n, ε−3log⁡2n})O(d\log d + \min\{d\,\varepsilon^{-2}\log n,\ \varepsilon^{-3}\log^2 n\}) operations. The paper writes part 1 with a normalizing factor α2\alpha_2; the factor k−1/2k^{-1/2} used here is the one fixed by E∥Pu∥22=k∥u∥22\mathbb{E}\|Pu\|_2^2 = k\|u\|_2^2. Section 2 of the paper assumes n≥dn \ge d throughout; without it, the flattening step below gives the level log⁡(nd)/d\sqrt{\log(nd)/d} in place of log⁡n/d\sqrt{\log n/d}. When XX is known, success can be tested, and O(log⁡(1/δ))O(\log(1/\delta)) independent repetitions raise the success probability to 1−δ1 - \delta.

Intuition

HDHD is orthogonal, so it changes no norm. A vector and its Walsh-Hadamard transform cannot both be concentrated on few coordinates, and the random signs in DD make it unlikely that HDxHDx is concentrated for any of the nn fixed inputs. After this rotation every input looks like the flat vector from the previous section, which is the good case for the sparse projection PP.

Proof Sketch

Step 1: flattening. Fix a unit vector xx and let u=HDxu = HDx. Each coordinate is ui=∑jajxju_i = \sum_j a_j x_j with independent signs aj=±d−1/2a_j = \pm d^{-1/2}. For λ>0\lambda > 0,

E eλui=∏jcosh⁡(λxj/d)≤eλ2/(2d),\mathbb{E}\, e^{\lambda u_i} = \prod_j \cosh\big(\lambda x_j/\sqrt{d}\big) \le e^{\lambda^2/(2d)},

and Markov's inequality with λ=td\lambda = td gives P(∣ui∣≥t)≤2e−t2d/2\mathbb{P}(|u_i| \ge t) \le 2e^{-t^2 d/2} for every threshold t>0t > 0. Choosing t=Θ(log⁡n/d)t = \Theta(\sqrt{\log n / d}) and taking a union bound over the ndnd coordinates of {HDx:x∈X}\{HDx : x \in X\}, with nd≤n2nd \le n^2 because n≥dn \ge d, gives max⁡x∈X∥HDx∥∞=O(log⁡n/d)\max_{x \in X}\|HDx\|_\infty = O(\sqrt{\log n / d}) with probability at least 19/2019/20.

Step 2: projecting a flat vector. Condition on that event. The squared norm ∥Pu∥22\|Pu\|_2^2 is a sum of kk independent row terms, each with mean ∥u∥22=1\|u\|_2^2 = 1. Because no coordinate of uu carries more than O(log⁡n/d)O(\log n / d) of the squared mass, the moments of each row term are controlled at sparsity q=Θ(log⁡2n/d)q = \Theta(\log^2 n / d), and a Chernoff bound gives failure probability small enough for a union bound over XX once k=c ε−2log⁡nk = c\,\varepsilon^{-2}\log n.

Step 3: time. DD costs O(d)O(d). HH costs O(dlog⁡d)O(d\log d) by the recursive Walsh-Hadamard transform. PP costs its number of nonzeros, a Binomial(kd,q)\mathrm{Binomial}(kd, q) count with mean qkd=O(ε−2log⁡3n)qkd = O(\varepsilon^{-2}\log^3 n) when q<1q < 1, and never more than kdkd. Markov's inequality turns the mean into a constant-probability bound.

Why It Matters

Whenever ε−2log⁡3n≤dlog⁡d\varepsilon^{-2}\log^3 n \le d\log d, one point costs O(dlog⁡d)O(d \log d) instead of O(ε−2dlog⁡n)O(\varepsilon^{-2} d\log n). Ailon and Chazelle used it for approximate nearest neighbors: for nn points in ℓ2d\ell_2^d and any ε>0\varepsilon > 0 they build a randomized structure of size nO(ε−2)n^{O(\varepsilon^{-2})} that answers ε\varepsilon-approximate nearest neighbor queries in O(dlog⁡d+ε−3log⁡2n)O(d\log d + \varepsilon^{-3}\log^2 n) time with high probability (Theorem 1 of the journal version).

Failure Mode

The O(dlog⁡d)O(d\log d) cost holds only while the second term is smaller. At fixed ε\varepsilon, ε−2log⁡3n≤dlog⁡d\varepsilon^{-2}\log^3 n \le d\log d means log⁡n\log n is at most of order (dlog⁡d)1/3(d\log d)^{1/3}; Krahmer and Ward summarize the construction as fast only for about ed1/3e^{d^{1/3}} points. The dlog⁡dd\log d term is paid in full even when nnz(x)=1\mathrm{nnz}(x) = 1, which rules the construction out for streaming updates. The guarantee is for a set fixed before the randomness is drawn, with success probability 2/32/3. The Walsh-Hadamard matrix needs dd to be a power of two, so inputs are padded with zeros.

Refinements of the Fast Transform

Dual BCH codes: O(dlog⁡k)O(d \log k) time

Ailon and Liberty say a distribution over k×dk \times d matrices has the Johnson-Lindenstrauss property if every unit xx and every 0≤ε<1/20 \le \varepsilon < 1/2 satisfy P(∣∥Ax∥2−1∣>ε)≤c1e−c2kε2\mathbb{P}(|\|Ax\|_2 - 1| > \varepsilon) \le c_1 e^{-c_2 k\varepsilon^2} for global constants c1,c2>0c_1, c_2 > 0.

Theorem

Fast JL via Rademacher Series on Dual BCH Codes (Ailon-Liberty)

Statement

Fix a constant γ>0\gamma > 0. For all dd and kk with k≤d1/2−γk \le d^{1/2-\gamma} there is a distribution over k×dk \times d matrices AA with this Johnson-Lindenstrauss property such that x↦Axx \mapsto Ax can be computed in O(dlog⁡k)O(d\log k) time for every x∈Rdx \in \mathbb{R}^d. Sampling AA uses O(d)O(d) random bits, and the same holds for embeddings into ℓ1\ell_1. The constants depend on γ\gamma (Ailon and Liberty, Discrete Comput. Geom. 2009; statement and proof constants read in the author-hosted conference version).

With k=Cε−2log⁡nk = C\varepsilon^{-2}\log n and a union bound, this gives an ε\varepsilon-JL map for a fixed nn-point set at cost O(dlog⁡k)O(d \log k) per point, provided Cε−2log⁡n≤d1/2−γC\varepsilon^{-2}\log n \le d^{1/2-\gamma}.

Intuition

Two substitutions. The random sparse PP becomes a deterministic code matrix that is 4-wise independent: in any 4 rows, the entries of a uniformly random column are independent random signs, up to scaling. That makes its 2→42 \to 4 operator norm small. The ℓ∞\ell_\infty flatness of the input becomes ℓ4\ell_4 flatness, which a few rounds of randomized Hadamard transforms deliver.

Proof Sketch

Write A=BDΦ′A = BD\Phi', where Φ′=HD(r)⋯HD(1)\Phi' = HD^{(r)}\cdots HD^{(1)} uses r=⌈1/(2γ)⌉r = \lceil 1/(2\gamma) \rceil independent sign diagonals, DD is a fresh sign diagonal, and BB is built from copies of a k×Θ(k2)k \times \Theta(k^2) dual BCH code matrix that is 4-wise independent in this sense. For y=Φ′xy = \Phi' x, the quantity Z=∥BDy∥2Z = \|BDy\|_2 is the norm of a Rademacher series in the signs of DD. Talagrand's inequality for such series gives P(∣Z−μ∣>t)≤4e−t2/(8σ2)\mathbb{P}(|Z - \mu| > t) \le 4e^{-t^2/(8\sigma^2)}, with median μ\mu within O(σ)O(\sigma) of 11 and, by Cauchy-Schwarz, σ≤∥y∥4 ∥B⊤∥2→4\sigma \le \|y\|_4\,\|B^\top\|_{2\to 4}. Four-wise independence gives ∥B⊤∥2→4≤(3d)1/4k−1/2\|B^\top\|_{2\to 4} \le (3d)^{1/4}k^{-1/2}. The Hausdorff-Young bound ∥H∥4/3→4≤d−1/4\|H\|_{4/3 \to 4} \le d^{-1/4} applied over the rr rounds gives ∥y∥4=O(d−1/4)\|y\|_4 = O(d^{-1/4}) with probability 1−O(e−k)1 - O(e^{-k}). Hence σ=O(k−1/2)\sigma = O(k^{-1/2}) and the tail is e−ckt2e^{-ck t^2}. Running the Hadamard rounds blockwise on blocks whose size is polynomial in kk brings the time from O(dlog⁡d)O(d\log d) to O(dlog⁡k)O(d\log k).

Why It Matters

Up to k≤d1/2−γk \le d^{1/2-\gamma} this removes the kk-dependent term of the original fast transform and beats both it and the dense O(kd)O(kd) map. For very small kk the log⁡k\log k factor replaces log⁡d\log d.

Failure Mode

The cap k≤d1/2−γk \le d^{1/2-\gamma} is binding. In the worked example below, k≈1382k \approx 1382 exceeds d1/2=1024d^{1/2} = 1024, so the theorem does not apply. The constant in the ℓ4\ell_4 bound grows exponentially in 1/γ1/\gamma.

Removing the cap on the number of points

Ailon and Liberty (SODA 2011; ACM Trans. Algorithms 2013) take Φ\Phi to be kk rows chosen at random from the unnormalized d×dd \times d Hadamard matrix and DbD_b a random sign diagonal. For ε∈(0,1/2]\varepsilon \in (0, 1/2], a set YY of nn vectors in the Euclidean unit ball, and k=Θ(ε−4log⁡n log⁡4d)k = \Theta(\varepsilon^{-4}\log n\,\log^4 d), with constant probability every y∈Yy \in Y satisfies

k−1∥ΦDby∥22=∥y∥22+O(ε),k^{-1}\|\Phi D_b y\|_2^2 = \|y\|_2^2 + O(\varepsilon),

and one vector costs O(dlog⁡d)O(d\log d). The proof extends the Rudelson-Vershynin restricted isometry analysis of partial Fourier matrices, which replaces a Rademacher process by a Gaussian one through a comparison inequality and bounds the Gaussian process with Dudley's entropy integral (empirical processes and chaining). Their abstract states the reach: point sets of size up to exp⁡(O~(d))\exp(\tilde O(d)), against exp⁡(O~(d1/2))\exp(\tilde O(d^{1/2})) for the dual BCH construction and exp⁡(O~(d1/3))\exp(\tilde O(d^{1/3})) for the original transform. The price is the ε−4\varepsilon^{-4} and log⁡4d\log^4 d factors in kk.

From restricted isometry to JL: random column signs

The restricted isometry property of order rr with constant δr\delta_r asks that (1−δr)∥z∥22≤∥Φz∥22≤(1+δr)∥z∥22(1-\delta_r)\|z\|_2^2 \le \|\Phi z\|_2^2 \le (1+\delta_r)\|z\|_2^2 for every rr-sparse zz.

Theorem

RIP Matrices with Random Column Signs Are JL Embeddings (Krahmer-Ward)

Statement

Fix η>0\eta > 0, ε∈(0,1)\varepsilon \in (0,1), and a finite set E⊂RdE \subset \mathbb{R}^d with ∣E∣=n|E| = n. Let r≥40log⁡(4n/η)r \ge 40\log(4n/\eta) and let Φ∈Rk×d\Phi \in \mathbb{R}^{k \times d} have the restricted isometry property of order rr with constant δr≤ε/4\delta_r \le \varepsilon/4. Let ξ\xi be uniform on {−1,1}d\{-1,1\}^d and Dξ=diag(ξ)D_\xi = \mathrm{diag}(\xi). With probability exceeding 1−η1 - \eta,

(1−ε)∥x∥22≤∥ΦDξx∥22≤(1+ε)∥x∥22for all x∈E.(1-\varepsilon)\|x\|_2^2 \le \|\Phi D_\xi x\|_2^2 \le (1+\varepsilon)\|x\|_2^2 \quad \text{for all } x \in E.

(Krahmer and Ward, SIAM J. Math. Anal. 2011, Theorem 3.1.)

Intuition

Sort the coordinates of xx by magnitude. The few large coordinates form a sparse vector, which RIP handles deterministically. The remaining coordinates are small, and their interaction with the large block and with each other is a sum with random signs, which concentrates.

Proof Sketch

Normalize ∥x∥2=1\|x\|_2 = 1, put xx in decreasing arrangement, and cut it into blocks of size s=r/2s = r/2. Expand ∥ΦDξx∥22=∥ΦDxξ∥22\|\Phi D_\xi x\|_2^2 = \|\Phi D_x \xi\|_2^2 into three parts.

  1. Within-block terms. Each block is ss-sparse, so RIP bounds their sum by (1±δr)∥x∥22(1 \pm \delta_r)\|x\|_2^2 with no randomness.
  2. First block against the rest. For fixed signs on the first block this is a linear form ⟨v,ξ♭⟩\langle v, \xi_\flat \rangle with ∥v∥2≤δr/s\|v\|_2 \le \delta_r/\sqrt{s}. Hoeffding gives a tail 2exp⁡(−t2s/(2δr2))2\exp(-t^2 s/(2\delta_r^2)).
  3. Remaining cross-block terms. These form a Rademacher chaos ⟨ξ,Cξ⟩\langle \xi, C\xi \rangle with zero diagonal, ∥C∥≤δr/s\|C\| \le \delta_r/s and ∥C∥F≤δr/s\|C\|_F \le \delta_r/\sqrt{s}, controlled by a Hanson-Wright-type chaos bound.

The norm estimates use two facts: RIP of order 2s2s gives ∥Φ(J)⊤Φ(L)∥≤δr\|\Phi_{(J)}^\top \Phi_{(L)}\| \le \delta_r for disjoint blocks, and a decreasing arrangement gives ∥x(J)∥∞≤s−1/2∥x(J−1)∥2\|x_{(J)}\|_\infty \le s^{-1/2}\|x_{(J-1)}\|_2. A union bound over EE with s≥20log⁡(4n/η)s \ge 20\log(4n/\eta) combines the three parts.

Why It Matters

Every RIP bound becomes a JL bound. A random partial Hadamard or partial Fourier matrix has RIP of order rr and constant δ\delta once k≳δ−2rlog⁡4dk \gtrsim \delta^{-2} r \log^4 d. With random signs and EE the set of pairwise differences, k≳ε−2log⁡(n/η)log⁡4dk \gtrsim \varepsilon^{-2}\log(n/\eta)\log^4 d rows give an ε\varepsilon-JL map computable in O(dlog⁡d)O(d\log d) time. Krahmer and Ward call the construction unrestricted: nn has no cap of the form exp⁡(d1/3)\exp(d^{1/3}) or exp⁡(d1/2)\exp(d^{1/2}). More than dd rows saves nothing over the identity map, so k≤dk \le d still limits nn to exp⁡(O~(ε2d))\exp(\tilde O(\varepsilon^2 d)). This improves the ε−4\varepsilon^{-4} of Ailon and Liberty to ε−2\varepsilon^{-2}, the optimal dependence up to the log⁡4d\log^4 d factor.

Failure Mode

The signs must be independent of EE. A fixed Φ\Phi with k<dk < d has a nontrivial null space and maps those vectors to 00, so RIP alone never implies JL for an arbitrary set. The polylogarithmic factor in dd inherited from structured RIP bounds remains.

Sparse JL Matrices

Dasgupta, Kumar, and Sarlós (STOC 2010) gave a JL distribution into ℓ2\ell_2 with O~(ε−1)\tilde O(\varepsilon^{-1}) nonzeros per column, fewer than the Θ(ε−2log⁡(1/δ))\Theta(\varepsilon^{-2}\log(1/\delta)) rows once log⁡2(k/δ)=o(1/ε)\log^2(k/\delta) = o(1/\varepsilon). Set k=12ε−2log⁡(1/δ)k = 12\varepsilon^{-2}\log(1/\delta) and c=16ε−1log⁡(1/δ)log⁡2(k/δ)c = 16\varepsilon^{-1}\log(1/\delta)\log^2(k/\delta). Replicate each input coordinate cc times with weight c−1/2c^{-1/2}, then send each of the cdcd copies to one uniformly random row with a random sign. For any fixed xx, with probability 1−4δ1 - 4\delta the resulting Φ\Phi satisfies (1−ε)∥x∥22≤∥Φx∥22≤(1+ε)∥x∥22(1-\varepsilon)\|x\|_2^2 \le \|\Phi x\|_2^2 \le (1+\varepsilon)\|x\|_2^2, and Φx\Phi x costs O(ε−1log⁡2(k/δ)log⁡(1/δ)⋅nnz(x))O(\varepsilon^{-1}\log^2(k/\delta)\log(1/\delta)\cdot\mathrm{nnz}(x)) (their Theorem 1). The hashing step alone is analyzed for inputs with ∥x∥∞≤c−1/2\|x\|_\infty \le c^{-1/2}, ε<1\varepsilon < 1 and δ<1/10\delta < 1/10; replication supplies that flatness. The same hashing construction appears in the feature hashing work of Weinberger, Dasgupta, Langford, Smola and Attenberg (ICML 2009); Dasgupta, Kumar, and Sarlós note that the concentration bound claimed there was false because of an error in applying Talagrand's inequality.

Theorem

Sparser Johnson-Lindenstrauss Transforms (Kane-Nelson)

Statement

For 0<ε,δ<1/20 < \varepsilon, \delta < 1/2 there are k=Θ(ε−2log⁡(1/δ))k = \Theta(\varepsilon^{-2}\log(1/\delta)), s=Θ(ε−1log⁡(1/δ))s = \Theta(\varepsilon^{-1}\log(1/\delta)) and a distribution over k×dk \times d matrices SS with exactly ss nonzero entries in every column, each equal to ±s−1/2\pm s^{-1/2}, such that for every x∈Rdx \in \mathbb{R}^d

P((1−ε)∥x∥2≤∥Sx∥2≤(1+ε)∥x∥2)>1−δ.\mathbb{P}\big((1-\varepsilon)\|x\|_2 \le \|Sx\|_2 \le (1+\varepsilon)\|x\|_2\big) > 1 - \delta.

Two placements work. In the graph construction each column puts its ss nonzeros in ss distinct random rows. In the block construction the kk rows are split into ss blocks of k/sk/s rows and each column picks one random row per block. Hash locations and signs need only O(log⁡(1/δ))O(\log(1/\delta))-wise independence (for the graph construction, almost O(log⁡(1/δ))O(\log(1/\delta))-wise independent permutations), and one of the two can be sampled with O(log⁡(1/δ)log⁡d)O(\log(1/\delta)\log d) random bits. Computing SxSx costs O(s⋅nnz(x))O(s \cdot \mathrm{nnz}(x)) (Kane and Nelson, J. ACM 2014; conference version SODA 2012).

With δ<1/(n2)\delta < 1/\binom{n}{2}: k=O(ε−2log⁡n)k = O(\varepsilon^{-2}\log n), s=O(ε−1log⁡n)s = O(\varepsilon^{-1}\log n), and one point costs O(ε−1log⁡n⋅nnz(x))O(\varepsilon^{-1}\log n \cdot \mathrm{nnz}(x)).

Intuition

Write Sri=ηriσri/sS_{ri} = \eta_{ri}\sigma_{ri}/\sqrt{s} with ηri∈{0,1}\eta_{ri} \in \{0,1\} the nonzero pattern and σri\sigma_{ri} the signs. Because every column has exactly ss entries of size s−1/2s^{-1/2}, the diagonal part of ∥Sx∥22\|Sx\|_2^2 equals ∥x∥22\|x\|_2^2 exactly. All error comes from collisions, pairs i≠ji \ne j that share a row:

Z=∥Sx∥22−1=1s∑r=1k∑i≠jηriηrjσriσrjxixj(∥x∥2=1).Z = \|Sx\|_2^2 - 1 = \frac{1}{s}\sum_{r=1}^{k}\sum_{i \ne j}\eta_{ri}\eta_{rj}\sigma_{ri}\sigma_{rj}x_i x_j \qquad (\|x\|_2 = 1).

Proof Sketch

Start with a fixed pattern in which any two columns share O(s2/k)O(s^2/k) rows (the code-based analysis). Then Z=σ⊤TσZ = \sigma^\top T\sigma for a block-diagonal TT with zero trace, ∥T∥F2=O(1/k)\|T\|_F^2 = O(1/k) and ∥T∥2≤1/s\|T\|_2 \le 1/s. The Hanson-Wright moment bound

E∣σ⊤Tσ∣ℓ≤Cℓmax⁡{ℓ ∥T∥F, ℓ ∥T∥2}ℓ\mathbb{E}|\sigma^\top T\sigma|^\ell \le C^\ell \max\{\sqrt{\ell}\,\|T\|_F,\ \ell\,\|T\|_2\}^\ell

with ℓ=log⁡2(1/δ)\ell = \log_2(1/\delta), an even integer when 1/δ1/\delta is a power of 44, and Markov's inequality give P(∣Z∣>2ε−ε2)≤δ\mathbb{P}(|Z| > 2\varepsilon - \varepsilon^2) \le \delta once k≳ε−2ℓk \gtrsim \varepsilon^{-2}\ell (Frobenius term) and s≳ε−1ℓs \gtrsim \varepsilon^{-1}\ell (operator term). The event ∣Z∣≤2ε−ε2|Z| \le 2\varepsilon - \varepsilon^2 gives (1−ε)≤∥Sx∥2≤(1+ε)(1-\varepsilon) \le \|Sx\|_2 \le (1+\varepsilon). A deterministic code with the required overlap forces ss slightly larger; the random-hashing analysis bounds EZℓ\mathbb{E}Z^\ell directly by counting the graphs that index its monomials and reaches s=O(ε−1log⁡(1/δ))s = O(\varepsilon^{-1}\log(1/\delta)).

Why It Matters

In a turnstile stream, an update xj←xj+Δx_j \leftarrow x_j + \Delta changes the sketch by Δ⋅Sej\Delta \cdot Se_j, which costs s=O(ε−1log⁡(1/δ))s = O(\varepsilon^{-1}\log(1/\delta)) instead of kk for a dense matrix or Ω(dlog⁡d)\Omega(d\log d) for a Hadamard-based one. Kane and Nelson use this to speed up the streaming regression and low-rank approximation algorithms of Clarkson and Woodruff (their Section 6). The output lives in ℓ2\ell_2, not behind a median estimator, so it can feed nearest-neighbor search or gradient-based training on hashed features.

Failure Mode

The sparsity cannot drop much further. Kane and Nelson show that, for k=Cε−2log⁡(1/δ)k = C\varepsilon^{-2}\log(1/\delta) and δ\delta below a constant depending on CC, their graph and block constructions need s=Ω(ε−1log⁡(1/δ))s = \Omega(\varepsilon^{-1}\log(1/\delta)) even with fully random hash functions (Theorems 18 and 19), and that the Dasgupta-Kumar-Sarlós scheme needs s=Ω(ε−1log⁡2(1/δ)/log⁡2(1/ε))s = \Omega(\varepsilon^{-1}\log^2(1/\delta)/\log^2(1/\varepsilon)) (Theorem 16). Nelson and Nguyen (STOC 2013) show that some nn-point set forces many nonzeros per column in every JL matrix on it. Their Theorem 10 concerns nn unit vectors in Rk\mathbb{R}^k with at most ss nonzeros each and pairwise inner products at most ε\varepsilon in absolute value. For 1/n<ε<ε01/\sqrt{n} < \varepsilon < \varepsilon_0, with ε0≤1/2\varepsilon_0 \le 1/2 a fixed constant, and k<O(n/log⁡(1/ε))k < O(n/\log(1/\varepsilon)), it gives s=Ω(ε−1log⁡n/log⁡(k/log⁡n))s = \Omega(\varepsilon^{-1}\log n/\log(k/\log n)). When also k≤poly(1/ε)log⁡nk \le \mathrm{poly}(1/\varepsilon)\log n, this reads s=Ω(ε−1log⁡n/log⁡(1/ε))s = \Omega(\varepsilon^{-1}\log n/\log(1/\varepsilon)) (their Corollary 11), which matches Kane-Nelson up to log⁡(1/ε)\log(1/\varepsilon). On a dense input, nnz(x)=d\mathrm{nnz}(x) = d and the cost O(ε−1dlog⁡n)O(\varepsilon^{-1}d\log n) is only a factor ε−1\varepsilon^{-1} below the dense matrix.

How Small Can kk Be?

The upper bound is k=O(min⁡{n,d,ε−2log⁡n})k = O(\min\{n, d, \varepsilon^{-2}\log n\}): the identity map gives dd, and projecting onto the span of XX gives at most nn. Lower bounds came in four steps.

  1. Johnson and Lindenstrauss (1984) proved Ω(log⁡n)\Omega(\log n) for ε\varepsilon below a constant, as recounted by Larsen and Nelson.
  2. Alon (2003) proved, via a rank bound for perturbed identity matrices: if P0,…,Pn∈RkP_0, \ldots, P_n \in \mathbb{R}^k have all pairwise distances in [1,1+ε][1, 1+\varepsilon] with n−1/2≤ε≤1/10n^{-1/2} \le \varepsilon \le 1/10, then k≥c′ε−2log⁡n/log⁡(1/ε)k \ge c'\varepsilon^{-2}\log n/\log(1/\varepsilon) (Alon 2009, Proposition 3.1, proved in Alon 2003). An ε\varepsilon-JL map sends e1,…,ene_1, \ldots, e_n to points whose pairwise distances lie within a factor 1±ε1 \pm \varepsilon of 2\sqrt 2, so after rescaling the proposition applies to those images with 3ε3\varepsilon in place of ε\varepsilon whenever n−1/2≤3ε≤1/10n^{-1/2} \le 3\varepsilon \le 1/10. For the simplex {0,e1,…,en}\{0, e_1, \ldots, e_n\} and 0<ε<1/20 < \varepsilon < 1/2, Larsen and Nelson state the resulting bound as Ω(min⁡{n,ε−2log⁡n/log⁡(1/ε)})\Omega(\min\{n, \varepsilon^{-2}\log n/\log(1/\varepsilon)\}) dimensions (Larsen and Nelson 2016, Section 1). They credit it to Levenshtein and Alon and note that it also follows from the Welch bound (Larsen and Nelson 2017, Section 1). For the simplex the log⁡(1/ε)\log(1/\varepsilon) loss is real: Reed-Solomon codes embed it into O(ε−2min⁡{log⁡n,(log⁡n/log⁡(1/ε))2})O(\varepsilon^{-2}\min\{\log n, (\log n/\log(1/\varepsilon))^2\}) dimensions (Larsen and Nelson 2016, Section 1).
  3. Larsen and Nelson (ICALP 2016) removed the loss for linear maps.
  4. Larsen and Nelson (FOCS 2017) removed it for all maps.
Theorem

The JL Dimension Is Optimal for Linear Maps (Larsen-Nelson 2016)

Statement

There is an absolute constant C>0C > 0 such that for every d>1d > 1, every 0<ε<1/20 < \varepsilon < 1/2 and every N>dCN > d^C, some NN-point set X⊂RdX \subset \mathbb{R}^d has the following property: every linear map A:Rd→RkA: \mathbb{R}^d \to \mathbb{R}^k with the ε\varepsilon-JL guarantee on XX has

k=Ω(min⁡{d, ε−2log⁡N}).k = \Omega(\min\{d,\ \varepsilon^{-2}\log N\}).

(Larsen and Nelson, ICALP 2016, LIPIcs 55, 82:1-82:11.)

Intuition

Include the basis vectors, which force every column of AA to have norm near 11, so tr(A⊤A)≈d\mathrm{tr}(A^\top A) \approx d. Include many Gaussian vectors gg. For any fixed matrix, ∥Ag∥22−tr(A⊤A)\|Ag\|_2^2 - \mathrm{tr}(A^\top A) fluctuates at scale ∥A⊤A∥F\|A^\top A\|_F, and some gg hits a large fluctuation. The JL guarantee caps the fluctuation, which caps ∥A⊤A∥F\|A^\top A\|_F, and a trace-to-Frobenius ratio bounds the rank from below.

Proof Sketch

Let X={e1,…,ed}∪VX = \{e_1, \ldots, e_d\} \cup V with VV a set of O(d3)O(d^3) Gaussian vectors (arXiv version). Discretize candidate matrices by a net FF of size eO(d2log⁡d)e^{O(d^2\log d)} in Frobenius norm at scale d−Cd^{-C}. By Latała's lower-tail form of Hanson-Wright, a Gaussian gg satisfies ∣∥A^g∥22−tr(A^⊤A^)∣≥Ω(log⁡(1/δ) ∥A^⊤A^∥F)|\|\hat A g\|_2^2 - \mathrm{tr}(\hat A^\top \hat A)| \ge \Omega(\sqrt{\log(1/\delta)}\,\|\hat A^\top \hat A\|_F) with probability at least δ\delta. With δ=1/poly(d)\delta = 1/\mathrm{poly}(d) and a union bound over FF, every A^∈F\hat A \in F meets such a g∈Vg \in V. The JL guarantee on XX bounds that deviation by O(εd+dlog⁡d)O(\varepsilon d + \sqrt{d\log d}), so

tr(A^⊤A^)≥(1−O(ε))d,∥A^⊤A^∥F2=O ⁣(ε2d2log⁡d+d).\mathrm{tr}(\hat A^\top \hat A) \ge (1 - O(\varepsilon))d, \qquad \|\hat A^\top \hat A\|_F^2 = O\!\left(\frac{\varepsilon^2 d^2}{\log d} + d\right).

Since A^⊤A^\hat A^\top \hat A has rank at most kk, Cauchy-Schwarz on its eigenvalues gives k≥tr2/∥⋅∥F2=Ω(min⁡{d,ε−2log⁡d})k \ge \mathrm{tr}^2/\|\cdot\|_F^2 = \Omega(\min\{d, \varepsilon^{-2}\log d\}), and log⁡N=Θ(log⁡d)\log N = \Theta(\log d) here.

Why It Matters

Every known JL construction is linear, and linearity is required in turnstile streaming and compressed sensing. This theorem rules out a better linear map even with full knowledge of XX, for example one chosen after a first pass over the data.

Failure Mode

The hard instance here is nearly orthogonal, and nearly orthogonal sets admit nonlinear embeddings into o(ε−2log⁡n)o(\varepsilon^{-2}\log n) dimensions when ε<2−ω(log⁡n)\varepsilon < 2^{-\omega(\sqrt{\log n})} (Larsen and Nelson 2017, Section 1.1). So this theorem alone leaves room for nonlinear maps.

Theorem

Optimality of the Johnson-Lindenstrauss Lemma (Larsen-Nelson 2017)

Statement

For all integers n,d≥2n, d \ge 2 and every ε\varepsilon with

(log⁡n)0.5001min⁡{n,d}<ε<1,\frac{(\log n)^{0.5001}}{\sqrt{\min\{n,d\}}} < \varepsilon < 1,

there is a set X⊂RdX \subset \mathbb{R}^d with ∣X∣=n|X| = n such that every map f:X→Rkf: X \to \mathbb{R}^k with the ε\varepsilon-JL guarantee on XX has

k=Ω(ε−2log⁡(ε2n)).k = \Omega\big(\varepsilon^{-2}\log(\varepsilon^2 n)\big).

In particular, if also ε≥n−0.4999\varepsilon \ge n^{-0.4999}, then log⁡(ε2n)≥0.0002log⁡n\log(\varepsilon^2 n) \ge 0.0002\log n and k=Ω(ε−2log⁡n)k = \Omega(\varepsilon^{-2}\log n) (Larsen and Nelson, FOCS 2017, pp. 633-638, Theorem 2).

Intuition

Build many point sets that differ in which coordinates each point touches, in a way any JL map must preserve. If kk were small, the embedded sets could be written down in too few bits to tell all the original sets apart.

Proof Sketch

Hard family. Take t=ε−2/256t = \varepsilon^{-2}/256 and, for S⊂[d]S \subset [d] with ∣S∣=t|S| = t, let yS=t−1/2∑j∈Sejy_S = t^{-1/2}\sum_{j \in S} e_j. Then ⟨yS,ej⟩=16ε\langle y_S, e_j\rangle = 16\varepsilon if j∈Sj \in S and 00 otherwise. Each member of the family is a sequence (0,e1,…,ed,yS1,…,ySQ)(0, e_1, \ldots, e_d, y_{S_1}, \ldots, y_{S_Q}) with Q=n−d−1Q = n - d - 1.

What a JL map preserves. Translate so f(0)=0f(0) = 0. Then ff preserves squared norms within 1±ε1 \pm \varepsilon, and the polarization identity gives ⟨f(ej),f(yS)⟩∈⟨ej,yS⟩±4ε\langle f(e_j), f(y_S)\rangle \in \langle e_j, y_S\rangle \pm 4\varepsilon. A gap of 8ε8\varepsilon separates j∈Sj \in S from j∉Sj \notin S after embedding, so the embedded sequence determines every SℓS_\ell.

Encoding. Round embedded points to nets of convex bodies in Rk\mathbb{R}^k (a volume argument covers an origin-symmetric convex body T⊂RkT \subset \mathbb{R}^k by 2klog⁡2(1+2/ε)2^{k\log_2(1+2/\varepsilon)} translated copies of εT\varepsilon T) and encode each embedded sequence in O(nk)O(nk) bits, injectively. The family has (dt)Q\binom{d}{t}^Q members. In the simple case d=n/log⁡(1/ε)d = n/\log(1/\varepsilon),

2O(nk)≥(dt)Q⟹k=Ω ⁣(ε−2log⁡ε2nlog⁡(1/ε)).2^{O(nk)} \ge \binom{d}{t}^{Q} \quad\Longrightarrow\quad k = \Omega\!\left(\varepsilon^{-2}\log\frac{\varepsilon^2 n}{\log(1/\varepsilon)}\right).

The paper removes the log⁡(1/ε)\log(1/\varepsilon) in the denominator and handles general dd.

Why It Matters

Distributional JL plus a union bound is optimal: no nonlinear, data-dependent embedding improves the dimension for worst-case inputs. The necessary condition ε=Ω(1/min⁡{n,d})\varepsilon = \Omega(1/\sqrt{\min\{n,d\}}) for any bound of this form follows from the upper bound O(min⁡{n,d,ε−2log⁡n})O(\min\{n,d,\varepsilon^{-2}\log n\}), and the theorem matches it up to the (log⁡n)0.5001(\log n)^{0.5001} factor. Larsen and Nelson conjecture the optimal dimension is Θ(min⁡{n,d,ε−2log⁡(2+ε2n)})\Theta(\min\{n, d, \varepsilon^{-2}\log(2 + \varepsilon^2 n)\}) for all n,d>1n, d > 1 and 0<ε<10 < \varepsilon < 1. The revised arXiv version (Section 1.2) reports that Alon and Klartag proved the lower bound over the full parameter range, removing the (log⁡n)0.5001(\log n)^{0.5001} condition.

Failure Mode

The bound is about the worst nn-point set. Sets of low dimension, or the simplex at very small ε\varepsilon, embed into fewer dimensions. The earlier hard instances were nearly orthogonal and could not have given this result, because of the Reed-Solomon embeddings noted above; the encoding argument needs the different family.

A separate fact concerns the distributional form. Any distribution with the (ε,δ)(\varepsilon, \delta) distributional JL property needs k=Ω(min⁡{d,ε−2log⁡(1/δ)})k = \Omega(\min\{d, \varepsilon^{-2}\log(1/\delta)\}) rows (Larsen and Nelson 2017, Section 1.1, citing Jayram-Woodruff and Kane-Meka-Nelson). That rules out better oblivious linear constructions with the union bound, but not a map chosen after seeing XX. The two Larsen-Nelson theorems close that gap.

Worked Example: Cost per Point

Take d=220=1,048,576d = 2^{20} = 1{,}048{,}576, n=106n = 10^6, ε=0.1\varepsilon = 0.1, natural logarithms, and every hidden constant set to 11, so k=ε−2ln⁡n≈1382k = \varepsilon^{-2}\ln n \approx 1382 and s=ε−1ln⁡n≈138s = \varepsilon^{-1}\ln n \approx 138. Real constants are larger; the ratios are the point. Here dd slightly exceeds nn, against the fast transform's assumption n≥dn \ge d, but ln⁡d≈13.9\ln d \approx 13.9 and ln⁡n≈13.8\ln n \approx 13.8, so the orders of its terms do not change.

ConstructionOperation count per pointValue
Dense Gaussiankdkd≈1.45×109\approx 1.45 \times 10^9
Achlioptas signs, one third nonzerokd/3kd/3≈4.8×108\approx 4.8 \times 10^8
Fast JL transformdlog⁡2d+ε−2ln⁡3nd\log_2 d + \varepsilon^{-2}\ln^3 n≈2.10×107+2.6×105\approx 2.10 \times 10^7 + 2.6 \times 10^5
Sparse JL, dense inputs⋅ds \cdot d≈1.45×108\approx 1.45 \times 10^8
Sparse JL, input with 1000 nonzeross⋅1000s \cdot 1000≈1.4×105\approx 1.4 \times 10^5

Four readings follow.

  • The fast transform is about 6868 times cheaper than the dense matrix here because ε−2ln⁡3n≈2.6×105\varepsilon^{-2}\ln^3 n \approx 2.6 \times 10^5 is far below dlog⁡2d≈2.1×107d\log_2 d \approx 2.1 \times 10^7. It stays in that regime until ln⁡n≈(ε2dlog⁡2d)1/3≈59\ln n \approx (\varepsilon^2 d\log_2 d)^{1/3} \approx 59, about 6×10256 \times 10^{25} points.
  • The dual BCH construction does not apply: k≈1382>d1/2=1024k \approx 1382 > d^{1/2} = 1024.
  • On a dense input, sparse JL is about 77 times more expensive than the fast transform. On an input with 10001000 nonzeros it is about 150150 times cheaper.
  • No construction can use fewer than order ε−2log⁡(ε2n)\varepsilon^{-2}\log(\varepsilon^2 n) dimensions on a worst-case million-point set; here ε2n=104\varepsilon^2 n = 10^4, so the lower bound is of order 100⋅ln⁡104≈920100 \cdot \ln 10^4 \approx 920 times an unknown constant.

Common Confusions

Watch Out

The lower bound does not say every point set needs order log n over epsilon squared dimensions

Larsen-Nelson exhibit one hard set per (n,d,ε)(n, d, \varepsilon). Many sets need far fewer dimensions: a set inside a 1010-dimensional subspace embeds isometrically into R10\mathbb{R}^{10}, and the simplex at very small ε\varepsilon embeds into fewer than ε−2log⁡n\varepsilon^{-2}\log n dimensions through Reed-Solomon codes. The theorem says the union-bound dimension cannot be improved uniformly over all sets.

Watch Out

Which paper proved which lower bound

Johnson and Lindenstrauss (1984) proved Ω(log⁡n)\Omega(\log n). Alon (2003) proved Ω(ε−2log⁡n/log⁡(1/ε))\Omega(\varepsilon^{-2}\log n/\log(1/\varepsilon)) with the simplex. Larsen and Nelson proved Ω(ε−2log⁡n)\Omega(\varepsilon^{-2}\log n) for linear maps at ICALP 2016 and for arbitrary maps at FOCS 2017, not STOC. Citing the 1984 paper for the ε−2\varepsilon^{-2} factor, or the 2016 paper for nonlinear maps, misattributes the result.

Watch Out

The fast transform is not O(d log d) unconditionally

The Ailon-Chazelle cost is O(dlog⁡d+min⁡{dε−2log⁡n,ε−2log⁡3n})O(d\log d + \min\{d\varepsilon^{-2}\log n, \varepsilon^{-2}\log^3 n\}). The second term is dropped only when it is smaller than dlog⁡dd\log d. The later refinements trade this term for a cap on kk (dual BCH codes) or for extra factors in kk (partial Hadamard with random signs).

Watch Out

A random sparse matrix is not automatically a sparse JL transform

Independent sparsification with qk≤1/4qk \le 1/4 sends e1e_1 to 00 with probability at least 3/43/4. The sparse JL constructions fix exactly ss nonzeros per column with ss of order ε−1log⁡(1/δ)\varepsilon^{-1}\log(1/\delta); that structure makes the diagonal part of ∥Sx∥22\|Sx\|_2^2 exact. Sparsity also buys time only on sparse inputs.

Watch Out

RIP does not imply JL without random signs

A matrix with the restricted isometry property can still annihilate any vector in its null space. Krahmer-Ward needs column signs drawn independently of the point set. The other direction, from distributional JL to RIP, is the theorem of Baraniuk et al. (2008) discussed on the RIP page.

Where This Appears in Learning Theory and ML

  • Nearest-neighbor search. The fast transform was introduced for approximate nearest neighbors, and random projection before search is the motivation on semantic search and embeddings.
  • Sketching for regression and low-rank approximation. Sparse JL matrices cut the update cost of streaming least squares and low-rank approximation.
  • Feature hashing. Hashing features into kk buckets with random signs is the one-nonzero-per-column case; the Dasgupta-Kumar-Sarlós and Kane-Nelson analyses state when it preserves Euclidean geometry and how many nonzeros are needed. The analyses need hash families with limited independence, not the collision-resistant functions of cryptographic hashing.
  • Compressed sensing. Krahmer-Ward make every RIP measurement matrix a JL map after randomizing column signs. They note an application to cross validation: if hold-out measurements Φ1\Phi_1 satisfy JL, then ∥Φ1(x−x^)∥2\|\Phi_1(x - \hat x)\|_2 estimates the recovery error ∥x−x^∥2\|x - \hat x\|_2. See sparse recovery and compressed sensing.
  • Compression arguments. Any analysis that compresses nn points to kk dimensions while keeping all squared distances within 1±ε1 \pm \varepsilon pays k=Ω(ε−2log⁡(ε2n))k = \Omega(\varepsilon^{-2}\log(\varepsilon^2 n)) on worst-case inputs, whatever the map. A dimension-reduction step inside a generalization or privacy argument cannot beat this rate without assumptions on the data.

Summary

  • Dense JL maps cost O(kd)O(kd) per point with k=O(ε−2log⁡n)k = O(\varepsilon^{-2}\log n).
  • Ailon-Chazelle: Φ=PHD\Phi = PHD costs O(dlog⁡d+min⁡{dε−2log⁡n,ε−2log⁡3n})O(d\log d + \min\{d\varepsilon^{-2}\log n, \varepsilon^{-2}\log^3 n\}) with probability at least 2/32/3 for a fixed nn-point set.
  • Ailon-Liberty: O(dlog⁡k)O(d\log k) time for k≤d1/2−γk \le d^{1/2-\gamma} via dual BCH codes; O(dlog⁡d)O(d\log d) time with k=Θ(ε−4log⁡nlog⁡4d)k = \Theta(\varepsilon^{-4}\log n\log^4 d) and no cap on nn of the form exp⁡(d1/2)\exp(d^{1/2}).
  • Krahmer-Ward: RIP of order 40log⁡(4n/η)40\log(4n/\eta) and constant ε/4\varepsilon/4 plus random column signs gives JL with probability exceeding 1−η1-\eta.
  • Kane-Nelson: s=Θ(ε−1log⁡(1/δ))s = \Theta(\varepsilon^{-1}\log(1/\delta)) nonzeros per column with the optimal kk, cost O(s⋅nnz(x))O(s \cdot \mathrm{nnz}(x)); Nelson-Nguyen show this is tight up to log⁡(1/ε)\log(1/\varepsilon) when k≤poly(1/ε)log⁡nk \le \mathrm{poly}(1/\varepsilon)\log n.
  • Lower bounds: Alon 2003 Ω(ε−2log⁡n/log⁡(1/ε))\Omega(\varepsilon^{-2}\log n/\log(1/\varepsilon)); Larsen-Nelson ICALP 2016 Ω(ε−2log⁡n)\Omega(\varepsilon^{-2}\log n) for linear maps; Larsen-Nelson FOCS 2017 Ω(ε−2log⁡(ε2n))\Omega(\varepsilon^{-2}\log(\varepsilon^2 n)) for all maps when (log⁡n)0.5001/min⁡{n,d}<ε<1(\log n)^{0.5001}/\sqrt{\min\{n,d\}} < \varepsilon < 1.

Exercises

ExerciseCore

Problem

Let P∈Rk×dP \in \mathbb{R}^{k \times d} have independent entries equal to 00 with probability 1−q1-q and N(0,q−1)\mathcal{N}(0, q^{-1}) with probability qq. Take d=220d = 2^{20}, n=106n = 10^6, ε=0.1\varepsilon = 0.1, k=ε−2ln⁡nk = \varepsilon^{-2}\ln n and q=ln⁡2n/dq = \ln^2 n / d. Bound the probability that Pe1=0Pe_1 = 0. Then compute every coordinate of HDe1HDe_1 for the normalized Walsh-Hadamard matrix HH and a random sign diagonal DD.

ExerciseCore

Problem

For the fast transform with d=220d = 2^{20} and ε=0.1\varepsilon = 0.1, and all hidden constants equal to 11, find the number of points nn at which the term ε−2ln⁡3n\varepsilon^{-2}\ln^3 n overtakes dlog⁡2dd\log_2 d.

ExerciseAdvanced

Problem

Let ff satisfy the ε\varepsilon-JL guarantee on a set containing 00, eje_j, and yS=t−1/2∑i∈Seiy_S = t^{-1/2}\sum_{i \in S} e_i with ∣S∣=t|S| = t, and assume f(0)=0f(0) = 0. Show that ⟨f(ej),f(yS)⟩\langle f(e_j), f(y_S)\rangle is within 4ε4\varepsilon of ⟨ej,yS⟩\langle e_j, y_S\rangle. For which ε\varepsilon is the choice t=ε−2/256t = \varepsilon^{-2}/256 meaningful?

ExerciseAdvanced

Problem

(a) Show that a nonzero symmetric positive semidefinite matrix MM of rank rr satisfies r≥(tr M)2/∥M∥F2r \ge (\mathrm{tr}\,M)^2/\|M\|_F^2. (b) Let v1,…,vnv_1, \ldots, v_n be unit vectors in Rk\mathbb{R}^k with ∣⟨vi,vj⟩∣≤ε|\langle v_i, v_j\rangle| \le \varepsilon for i≠ji \ne j. Deduce k≥n/(1+(n−1)ε2)k \ge n/(1 + (n-1)\varepsilon^2). (c) Explain why this gives only Ω(min⁡{n,ε−2})\Omega(\min\{n, \varepsilon^{-2}\}) and what the linear-map lower bound adds.

ExerciseAdvanced

Problem

In the code-based sparse JL analysis, Z=σ⊤TσZ = \sigma^\top T\sigma with ∥T∥F2≤C1/k\|T\|_F^2 \le C_1/k and ∥T∥2≤1/s\|T\|_2 \le 1/s, and the moment bound E∣Z∣ℓ≤Cℓmax⁡{ℓ ∥T∥F,ℓ ∥T∥2}ℓ\mathbb{E}|Z|^\ell \le C^\ell\max\{\sqrt{\ell}\,\|T\|_F, \ell\,\|T\|_2\}^\ell holds for even ℓ≥2\ell \ge 2. With ℓ=log⁡2(1/δ)\ell = \log_2(1/\delta), where 1/δ1/\delta is a power of 44 so that ℓ\ell is an even integer, and ε≤1/2\varepsilon \le 1/2, find conditions on kk and ss that give P(∣Z∣>2ε−ε2)≤δ\mathbb{P}(|Z| > 2\varepsilon - \varepsilon^2) \le \delta.

References

Fast transforms:

  • Ailon & Chazelle, "Approximate nearest neighbors and the fast Johnson-Lindenstrauss transform" (STOC 2006, pp. 557-563)
  • Ailon & Chazelle, "The Fast Johnson-Lindenstrauss Transform and Approximate Nearest Neighbors" (SIAM J. Comput. 39(1), 2009, pp. 302-322), Lemma 1 and Theorem 1
  • Ailon & Liberty, "Fast Dimension Reduction Using Rademacher Series on Dual BCH Codes" (Discrete Comput. Geom. 42(4), 2009, pp. 615-630); Theorem 2.2 and Lemmas 4.1, 5.1 and 5.2 read in the author-hosted conference version
  • Ailon & Liberty, "An Almost Optimal Unrestricted Fast Johnson-Lindenstrauss Transform" (SODA 2011, pp. 185-191; ACM Trans. Algorithms 9(3), 2013; statement read in arXiv:1005.5513, Theorem 3.1)
  • Krahmer & Ward, "New and Improved Johnson-Lindenstrauss Embeddings via the Restricted Isometry Property" (SIAM J. Math. Anal. 43(3), 2011, pp. 1269-1281), Theorem 3.1 and Section 6
  • Achlioptas, "Database-friendly random projections: Johnson-Lindenstrauss with binary coins" (J. Comput. Syst. Sci. 66(4), 2003, pp. 671-687)

Sparse transforms:

  • Dasgupta, Kumar & Sarlós, "A Sparse Johnson-Lindenstrauss Transform" (STOC 2010, pp. 341-350), Theorems 1-3
  • Kane & Nelson, "Sparser Johnson-Lindenstrauss Transforms" (J. ACM 61(1), 2014; SODA 2012, pp. 1195-1206), Theorems 7, 13, 16, 18, 19 in arXiv:1012.1577v6
  • Nelson & Nguyen, "Sparsity Lower Bounds for Dimensionality Reducing Maps" (STOC 2013, pp. 101-110), Theorem 10 and Corollary 11 in arXiv:1211.0995
  • Weinberger, Dasgupta, Langford, Smola & Attenberg, "Feature hashing for large scale multitask learning" (ICML 2009, pp. 1113-1120)

Lower bounds:

  • Johnson & Lindenstrauss, "Extensions of Lipschitz mappings into a Hilbert space" (Contemporary Mathematics 26, 1984, pp. 189-206)
  • Alon, "Problems and results in extremal combinatorics, I" (Discrete Mathematics 273, 2003, pp. 31-53)
  • Alon, "Perturbed Identity Matrices Have High Rank: Proof and Applications" (Combinatorics, Probability and Computing 18(1-2), 2009, pp. 3-15), Proposition 3.1
  • Larsen & Nelson, "The Johnson-Lindenstrauss Lemma Is Optimal for Linear Dimensionality Reduction" (ICALP 2016, LIPIcs 55, 82:1-82:11)
  • Larsen & Nelson, "Optimality of the Johnson-Lindenstrauss Lemma" (FOCS 2017, pp. 633-638), Theorem 2 and Conjecture 1; arXiv:1609.02094v2 Section 1.2 for later work

Next Topics

Last reviewed: September 14, 2026

Cite this page

Sneiderman, Robby. "Fast and Sparse Johnson-Lindenstrauss Transforms." TheoremPath, reviewed 2026-09-14. https://theorempath.com/topics/fast-and-sparse-johnson-lindenstrauss

Canonical URL
https://theorempath.com/topics/fast-and-sparse-johnson-lindenstrauss
Author
Robby Sneiderman, TheoremPath
Last reviewed
2026-09-14
What this is
A reference page on TheoremPath. Written and maintained by the named author. Not peer reviewed and not refereed by any venue. Each claim below carries its own verification status.
Terms
All rights reserved. Non-commercial quotation with attribution permitted.

Canonical graph

Required before and derived from this topic

These links come from prerequisite edges in the curriculum graph. Editorial suggestions are shown here only when the target page also cites this page as a prerequisite.

Required prerequisites

3

Derived topics

0

No published topic currently declares this as a prerequisite.