Preply — Study more efficiently by working with a personal tutor. Get 50% off.Affiliate

Wikipedia

Johnson–Lindenstrauss lemma

In mathematics, the Johnson–Lindenstrauss lemma is a result named after William B. Johnson and Joram Lindenstrauss concerning low-distortion embeddings of points from high-dimensional into low-dimensional Euclidean space. The lemma states that a set of points in a high-dimensional space can be embedded into a space of much lower dimension in such a way that distances between the points are nearly preserved. In the classical proof of the lemma, the embedding is a random orthogonal projection. The lemma has applications in compressed sensing, manifold learning, dimensionality reduction, graph embedding, and natural language processing. Much of the data stored and manipulated on computers, including text and images, can be represented as points in a high-dimensional space (see vector space model for the case of text). However, the essential algorithms for working with such data tend to become bogged down very quickly as dimension increases. It is therefore desirable to reduce the dimensionality of the data in a way that preserves its relevant structure.

Statement Given 0 < ε < 1 {\displaystyle 0<\varepsilon <1} , a set X {\displaystyle X} of N {\displaystyle N} points in R n {\displaystyle \mathbb {R} ^{n}} , and an integer k > 8 ( ln ⁡ N ) / ε 2 {\displaystyle k>8(\ln N)/\varepsilon ^{2}} , there is a linear map f : R n → R k {\displaystyle f:\mathbb {R} ^{n}\rightarrow \mathbb {R} ^{k}} such that

( 1 − ε ) ‖ u − v ‖ 2 ≤ ‖ f ( u ) − f ( v ) ‖ 2 ≤ ( 1 + ε ) ‖ u − v ‖ 2 {\displaystyle (1-\varepsilon )\|u-v\|^{2}\leq \|f(u)-f(v)\|^{2}\leq (1+\varepsilon )\|u-v\|^{2}}

for all u , v ∈ X {\displaystyle u,v\in X} . The formula can be rearranged: ( 1 + ε ) − 1 ‖ f ( u ) − f ( v ) ‖ 2 ≤ ‖ u − v ‖ 2 ≤ ( 1 − ε ) − 1 ‖ f ( u ) − f ( v ) ‖ 2 {\displaystyle (1+\varepsilon )^{-1}\|f(u)-f(v)\|^{2}\leq \|u-v\|^{2}\leq (1-\varepsilon )^{-1}\|f(u)-f(v)\|^{2}}

Alternatively, for any ε ∈ ( 0 , 1 ) {\displaystyle \varepsilon \in (0,1)} and any integer k ≥ 15 ( ln ⁡ N ) / ε 2 {\displaystyle k\geq 15(\ln N)/\varepsilon ^{2}} there exists a linear function f : R n → R k {\displaystyle f:\mathbb {R} ^{n}\rightarrow \mathbb {R} ^{k}} such that the restriction f | X {\displaystyle f|_{X}} is ( 1 + ε ) {\displaystyle (1+\varepsilon )} -bi-Lipschitz. Also, the lemma is tight up to a constant factor, i.e. there exists a set of points of size N that needs dimension

Ω ( log ⁡ ( N ) ε 2 ) {\displaystyle \Omega \left({\frac {\log(N)}{\varepsilon ^{2}}}\right)}

in order to preserve the distances between all pairs of points within a factor of ( 1 ± ε ) {\displaystyle (1\pm \varepsilon )} . The classical proof of the lemma takes f {\displaystyle f} to be a scalar multiple of an orthogonal projection P {\displaystyle P} onto a random subspace of dimension k {\displaystyle k} in R n {\displaystyle \mathbb {R} ^{n}} . An orthogonal projection collapses some dimensions of the space it is applied to, which reduces the length of all vectors, as well as distance between vectors in the space. Under the conditions of the lemma, concentration of measure ensures there is a nonzero chance that a random orthogonal projection reduces pairwise distances between all points in X {\displaystyle X} by roughly a constant factor c {\displaystyle c} . Since the chance is nonzero, such projections must exist, so we can choose one P {\displaystyle P} and set f ( v ) = P v / c {\displaystyle f(v)=Pv/c} . To obtain the projection algorithmically, it suffices with high probability to repeatedly sample orthogonal projection matrices at random. If you keep rolling the dice, you will eventually obtain one in polynomial random time.

Proof The proof below is based on the course notes of Afonso Bandeira that can be found at the following link. Construct a random matrix A ∼ N ( 0 , 1 ) k × n {\displaystyle A\sim {\mathcal {N}}(0,1)^{k\times n}} , obtained by sampling each entry from the standard normal distribution. Define P := A k {\textstyle P:={\frac {A}{\sqrt {k}}}} , then for any nonzero vector x ∈ R n {\displaystyle x\in \mathbb {R} ^{n}} , let the projected vector be x ^ := A x {\displaystyle {\hat {x}}:=Ax} . Standard geometric arguments show that r := ‖ x ^ ‖ 2 ‖ x ‖ 2 {\textstyle r:={\frac {\|{\hat {x}}\|^{2}}{\|x\|^{2}}}} is chi-square distributed, that is, r ∼ χ 2 ( k ) {\textstyle r\sim \chi ^{2}(k)} . Thus, it satisfies a concentration inequality for the chi-squared distribution: Pr ( r ∈ ( 1 ± ϵ ) k ) ≥ 1 − 2 e − k 2 ( 1 2 ϵ 2 − 1 3 ϵ 3 ) {\displaystyle \Pr(r\in (1\pm \epsilon )k)\geq 1-2e^{-{\frac {k}{2}}\left({\frac {1}{2}}\epsilon ^{2}-{\frac {1}{3}}\epsilon ^{3}\right)}}

By the union bound, the probability that this relation is true for all of x 1 , … , x N {\displaystyle x_{1},\dots ,x_{N}} is greater than 1 − 2 N e − k 2 ( 1 2 ϵ 2 − 1 3 ϵ 3 ) {\textstyle 1-2Ne^{-{\frac {k}{2}}({\frac {1}{2}}\epsilon ^{2}-{\frac {1}{3}}\epsilon ^{3})}} . When k ≥ 4 ln ⁡ 2 N ϵ 2 ( 1 − 2 ϵ / 3 ) {\textstyle k\geq {\frac {4\ln 2N}{\epsilon ^{2}\left(1-2\epsilon /3\right)}}} , the probability is nonzero. More generally, when k ≥ 4 ( d + 1 ) ln ⁡ 2 N ϵ 2 ( 1 − 2 ϵ 3 ) {\textstyle k\geq {\frac {4(d+1)\ln 2N}{\epsilon ^{2}\left(1-{\frac {2\epsilon }{3}}\right)}}} , the probability is greater than, or equal to 1 − 1 ( 2 N ) d {\textstyle 1-{\frac {1}{(2N)^{d}}}} , allowing arbitrarily high probability of success per sample, and a fortiori polynomial random time.

Alternate statement A related lemma is the distributional JL lemma. This lemma states that for any 0 < ε , δ < 1 / 2 {\displaystyle 0<\varepsilon ,\delta <1/2} and positive integer d {\displaystyle d} , there exists a distribution over R k × d {\displaystyle \mathbb {R} ^{k\times d}} from which the matrix A {\displaystyle A} is drawn such that for k = O ( ε − 2 log ⁡ ( 1 / δ ) ) {\displaystyle k=O(\varepsilon ^{-2}\log(1/\delta ))} and for any unit-length vector x ∈ R d {\displaystyle x\in \mathbb {R} ^{d}} , the claim below holds.

P ( | ‖ A x ‖ 2 2 − 1 | > ε ) < δ {\displaystyle P(|\Vert Ax\Vert _{2}^{2}-1|>\varepsilon )<\delta }

One can obtain the JL lemma from the distributional version by setting x = ( u − v ) / ‖ u − v ‖ 2 {\displaystyle x=(u-v)/\|u-v\|_{2}} and δ < 1 / n 2 {\displaystyle \delta <1/n^{2}} for some pair u,v both in X. Then the JL lemma follows by a union bound over all such pairs.

Sparse JL transform

Database-friendly JL transform (Achlioptas, 2003) proposed "database-friendly" JL transform, using matrices with only entries from (-1, 0, +1).

Fix some unit vector v ∈ R n {\textstyle v\in \mathbb {R} ^{n}} . Define Q i := ∑ j R i j v j {\textstyle Q_{i}:=\sum _{j}R_{ij}v_{j}} . We have ‖ f ( v ) ‖ 2 2 = 1 k ∑ i Q i 2 {\textstyle \|f(v)\|_{2}^{2}={\frac {1}{k}}\sum _{i}Q_{i}^{2}} . Now, since the Q 1 , … , Q k {\textstyle Q_{1},\dots ,Q_{k}} are IID, we want to apply a Chernoff concentration bound for 1 k ∑ i Q i 2 {\textstyle {\frac {1}{k}}\sum _{i}Q_{i}^{2}} around 1. This requires upper-bounding the cumulant generating function (CGF).

Now that Q i {\textstyle Q_{i}} is stochastically dominated by the standard gaussian, and E [ Q i 2 ] = 1 {\textstyle E[Q_{i}^{2}]=1} , it remains to perform a Chernoff bound for Q i 2 {\textstyle Q_{i}^{2}} , which requires bounding the cumulant generating function on both ends.

Sparser JL transform on well-spread vectors (Matoušek, 2008) proposed a variant of the above JL transform that is even more sparsified, though it only works on "well-spread" vectors.

The above cases are generalized to the case for matrices with independent, mean-zero, unit variance, subgaussian entries in (Dirksen, 2016).

Speeding up the JL transform Given A, computing the matrix vector product takes O ( k d ) {\displaystyle O(kd)} time. There has been some work in deriving distributions for which the matrix vector product can be computed in less than O ( k d ) {\displaystyle O(kd)} time. There are two major lines of work. The first, Fast Johnson Lindenstrauss Transform (FJLT), was introduced by Ailon and Chazelle in 2006. This method allows the computation of the matrix vector product in just d log ⁡ d + k 2 + γ {\displaystyle d\log d+k^{2+\gamma }} for any constant γ > 0 {\displaystyle \gamma >0} . Another approach is to build a distribution supported over matrices that are sparse. This method allows keeping only an ε {\displaystyle \varepsilon } fraction of the entries in the matrix, which means the computation can be done in just k d ε {\displaystyle kd\varepsilon } time. Furthermore, if the vector has only b {\displaystyle b} non-zero entries, the Sparse JL takes time k b ε {\displaystyle kb\varepsilon } , which may be much less than the d log ⁡ d {\displaystyle d\log d} time used by Fast JL.

Tensorized random projections It is possible to combine two JL matrices by taking the so-called face-splitting product, which is defined as the tensor products of the rows (was proposed by V. Slyusar in 1996 for radar and digital antenna array applications). More directly, let C ∈ R 3 × 3 {\displaystyle {C}\in \mathbb {R} ^{3\times 3}} and D ∈ R 3 × 3 {\displaystyle {D}\in \mathbb {R} ^{3\times 3}} be two matrices. Then the face-splitting product C ∙ D {\displaystyle {C}\bullet {D}} is

C ∙ D = [ C 1 ⊗ D 1 C 2 ⊗ D 2 C 3 ⊗ D 3 ] . {\displaystyle {C}\bullet {D}=\left[{\begin{array}{c }{C}_{1}\otimes {D}_{1}\\\hline {C}_{2}\otimes {D}_{2}\\\hline {C}_{3}\otimes {D}_{3}\\\end{array}}\right].}

This idea of tensorization was used by Kasiviswanathan et al. for differential privacy. JL matrices defined like this use fewer random bits, and can be applied quickly to vectors that have tensor structure, due to the following identity:

( C ∙ D ) ( x ⊗ y ) = C x ∘ D y = [ ( C x ) 1 ( D y ) 1 ( C x ) 2 ( D y ) 2 ⋮ ] {\displaystyle (\mathbf {C} \bullet \mathbf {D} )(x\otimes y)=\mathbf {C} x\circ \mathbf {D} y=\left[{\begin{array}{c }(\mathbf {C} x)_{1}(\mathbf {D} y)_{1}\\(\mathbf {C} x)_{2}(\mathbf {D} y)_{2}\\\vdots \end{array}}\right]} , where ∘ {\displaystyle \circ } is the element-wise (Hadamard) product. Such computations have been used to efficiently compute polynomial kernels and many other linear-algebra algorithms. In 2020 it was shown that if the matrices C 1 , C 2 , … , C c {\displaystyle C_{1},C_{2},\dots ,C_{c}} are independent ± 1 {\displaystyle \pm 1} or Gaussian matrices, the combined matrix C 1 ∙ ⋯ ∙ C c {\displaystyle C_{1}\bullet \dots \bullet C_{c}} satisfies the distributional JL lemma if the number of rows is at least

O ( ϵ − 2 log ⁡ 1 / δ + ϵ − 1 ( 1 c log ⁡ 1 / δ ) c ) {\displaystyle O(\epsilon ^{-2}\log 1/\delta +\epsilon ^{-1}({\tfrac {1}{c}}\log 1/\delta )^{c})} . For large ϵ {\displaystyle \epsilon } this is as good as the completely random Johnson-Lindenstrauss, but a matching lower bound in the same paper shows that this exponential dependency on ( log ⁡ 1 / δ ) c {\displaystyle (\log 1/\delta )^{c}} is necessary. Alternative JL constructions are suggested to circumvent this.

See also Random projection Restricted isometry property Word embeddings

Notes

References

Further reading Achlioptas, Dimitris (2003), "Database-friendly random projections: Johnson–Lindenstrauss with binary coins", Journal of Computer and System Sciences, 66 (4): 671–687, doi:10.1016/S0022-0000(03)00025-4, MR 2005771. Journal version of a paper previously appearing at PODC 2001. Baraniuk, Richard; Davenport, Mark; DeVore, Ronald; Wakin, Michael (2008), "A simple proof of the restricted isometry property for random matrices", Constructive Approximation, 28 (3): 253–263, doi:10.1007/s00365-007-9003-x, hdl:1911/21683, MR 2453366, S2CID 15911073. Dasgupta, Sanjoy; Gupta, Anupam (2003), "An elementary proof of a theorem of Johnson and Lindenstrauss" (PDF), Random Structures & Algorithms, 22 (1): 60–65, doi:10.1002/rsa.10073, MR 1943859, S2CID 10327785. Landweber, Peter; Lazar, Emanuel A.; Patel, Neel (2016), "On fiber diameters of continuous maps", American Mathematical Monthly, 123 (4): 392–397, arXiv:1503.07597, doi:10.4169/amer.math.monthly.123.4.392, S2CID 51751732 Slyusar, V. I. (1997-05-20), "Analytical model of the digital antenna array on a basis of face-splitting matrix products." (PDF), Proc. ICATT-97, Kyiv: 108–109 Slyusar, V. I. (March 13, 1998), "A Family of Face Products of Matrices and its Properties" (PDF), Cybernetics and Systems Analysis C/C of Kibernetika I Sistemnyi Analiz.- 1999., 35 (3): 379–384, doi:10.1007/BF02733426, S2CID 119661450. The Modern Algorithmic Toolbox Lecture #4: Dimensionality Reduction (PDF), 2023

Tags

  • Lemmas
  • Metric geometry