Dimension Reduction and Nearest Neighbor Search Advanced - - PowerPoint PPT Presentation

β–Ά
dimension reduction
SMART_READER_LITE
LIVE PREVIEW

Dimension Reduction and Nearest Neighbor Search Advanced - - PowerPoint PPT Presentation

Dimension Reduction and Nearest Neighbor Search Advanced Algorithms Nanjing University, Fall 2018 Dimension reduction: Why we care? High dimension data are common, yet working on them directly is expensive. Dimension reduction: Why we


slide-1
SLIDE 1

Dimension Reduction and Nearest Neighbor Search

Advanced Algorithms Nanjing University, Fall 2018

slide-2
SLIDE 2

Dimension reduction: Why we care?

  • High dimension data are common, yet working on

them directly is expensive.

slide-3
SLIDE 3

Dimension reduction: Why we care?

  • High dimension data are common, yet working on

them directly is expensive.

  • Or, we just want a map!

low-distortion metric embedding

slide-4
SLIDE 4

Dimension reduction: What we want?

slide-5
SLIDE 5

Dimension reduction: What we want?

  • Usually we want 𝑙 β‰ͺ 𝑒.
  • How small can 𝑙 be?
  • For what distance β‹… ?
  • The embedding should be efficiently constructible.
slide-6
SLIDE 6

The JLT (Johonson-Linenstrauss Theorem)

β€œ In Euclidian space, it is always possible to embed a set of π‘œ points in arbitrary dimension to 𝑃(log π‘œ) dimension with constant distortion. ”

slide-7
SLIDE 7

The JLT (Johonson-Linenstrauss Theorem)

β€œ In Euclidian space, it is always possible to embed a set of π‘œ points in arbitrary dimension to 𝑃(log π‘œ) dimension with constant distortion. ” Theorem (Johnson-Lindenstrauss 1984):

βˆ€0 < πœ— < 1, for any set 𝑇 of π‘œ points from ℝ𝑒, there is a 𝜚: ℝ𝑒 β†’ ℝ𝑙 with 𝑙 ∈ 𝑃(πœ—βˆ’2 β‹… log π‘œ), such that βˆ€π‘¦π‘—, π‘¦π‘˜ ∈ 𝑇: 1 βˆ’ πœ— 𝑦𝑗 βˆ’ π‘¦π‘˜

2 2 ≀

𝜚 𝑦𝑗 βˆ’ 𝜚 π‘¦π‘˜

2 2 ≀ (1 + πœ—) 𝑦𝑗 βˆ’ π‘¦π‘˜ 2 2

slide-8
SLIDE 8

Theorem (Johnson-Lindenstrauss 1984):

βˆ€0 < πœ— < 1, for any set 𝑇 of π‘œ points from ℝ𝑒, there is a 𝜚: ℝ𝑒 β†’ ℝ𝑙 with 𝑙 ∈ 𝑃(πœ—βˆ’2 β‹… log π‘œ), such that βˆ€π‘¦π‘—, π‘¦π‘˜ ∈ 𝑇: 1 βˆ’ πœ— 𝑦𝑗 βˆ’ π‘¦π‘˜

2 2 ≀

𝜚 𝑦𝑗 βˆ’ 𝜚 π‘¦π‘˜

2 2 ≀ (1 + πœ—) 𝑦𝑗 βˆ’ π‘¦π‘˜ 2 2

β€œ Even better, it is very easy to find such 𝜚 ”

slide-9
SLIDE 9

Theorem (Johnson-Lindenstrauss 1984):

βˆ€0 < πœ— < 1, for any set 𝑇 of π‘œ points from ℝ𝑒, there is a 𝜚: ℝ𝑒 β†’ ℝ𝑙 with 𝑙 ∈ 𝑃(πœ—βˆ’2 β‹… log π‘œ), such that βˆ€π‘¦π‘—, π‘¦π‘˜ ∈ 𝑇: 1 βˆ’ πœ— 𝑦𝑗 βˆ’ π‘¦π‘˜

2 2 ≀

𝜚 𝑦𝑗 βˆ’ 𝜚 π‘¦π‘˜

2 2 ≀ (1 + πœ—) 𝑦𝑗 βˆ’ π‘¦π‘˜ 2 2

β€œ Even better, it is very easy to find such 𝜚 ” β€œ Just sample a random 𝑙 Γ— 𝑒 matrix 𝐡 ”

slide-10
SLIDE 10

Theorem (Johnson-Lindenstrauss 1984):

βˆ€0 < πœ— < 1, for any set 𝑇 of π‘œ points from ℝ𝑒, there is a 𝜚: ℝ𝑒 β†’ ℝ𝑙 with 𝑙 ∈ 𝑃(πœ—βˆ’2 β‹… log π‘œ), such that βˆ€π‘¦π‘—, π‘¦π‘˜ ∈ 𝑇: 1 βˆ’ πœ— 𝑦𝑗 βˆ’ π‘¦π‘˜

2 2 ≀

𝜚 𝑦𝑗 βˆ’ 𝜚 π‘¦π‘˜

2 2 ≀ (1 + πœ—) 𝑦𝑗 βˆ’ π‘¦π‘˜ 2 2

β€œ Even better, it is very easy to find such 𝜚 ” β€œ Just sample a random 𝑙 Γ— 𝑒 matrix 𝐡 ”

Images extracted from https://graphics.stanford.edu/courses/cs468-06-fall/Slides/aneesh-michael.pdf

slide-11
SLIDE 11

Theorem (Johnson-Lindenstrauss 1984):

βˆ€0 < πœ— < 1, for any set 𝑇 of π‘œ points from ℝ𝑒, there is a 𝜚: ℝ𝑒 β†’ ℝ𝑙 with 𝑙 ∈ 𝑃(πœ—βˆ’2 β‹… log π‘œ), such that βˆ€π‘¦π‘—, π‘¦π‘˜ ∈ 𝑇: 1 βˆ’ πœ— 𝑦𝑗 βˆ’ π‘¦π‘˜

2 2 ≀

𝜚 𝑦𝑗 βˆ’ 𝜚 π‘¦π‘˜

2 2 ≀ (1 + πœ—) 𝑦𝑗 βˆ’ π‘¦π‘˜ 2 2

β€œ Even better, it is very easy to find such 𝜚 ” β€œ Just sample a random 𝑙 Γ— 𝑒 matrix 𝐡 ”

How to construct (sample) 𝐡?

  • Project onto uniform random 𝑙-dimensional subspace;

(Johnson-Lindenstrauss; Dasgupta-Gupta)

  • Independent Gaussian entries; (Indyk-Motwani)
  • Simply i.i.d. +1/-1 entries. (Achlioptas)
slide-12
SLIDE 12

Theorem (Johnson-Lindenstrauss 1984):

βˆ€0 < πœ— < 1, for any set 𝑇 of π‘œ points from ℝ𝑒, there is a 𝜚: ℝ𝑒 β†’ ℝ𝑙 with 𝑙 ∈ 𝑃(πœ—βˆ’2 β‹… log π‘œ), such that βˆ€π‘¦π‘—, π‘¦π‘˜ ∈ 𝑇: 1 βˆ’ πœ— 𝑦𝑗 βˆ’ π‘¦π‘˜

2 2 ≀

𝜚 𝑦𝑗 βˆ’ 𝜚 π‘¦π‘˜

2 2 ≀ (1 + πœ—) 𝑦𝑗 βˆ’ π‘¦π‘˜ 2 2

β€œ Even better, it is very easy to find such 𝜚 ” β€œ Just sample a random 𝑙 Γ— 𝑒 matrix 𝐡 ”

How to construct (sample) 𝐡?

  • Project onto uniform random 𝑙-dimensional subspace;

(Johnson-Lindenstrauss; Dasgupta-Gupta)

  • Independent Gaussian entries; (Indyk-Motwani)
  • Simply i.i.d. +1/-1 entries. (Achlioptas)
slide-13
SLIDE 13

Choose some suitable 𝑙 ∈ 𝑃(πœ—βˆ’2 β‹… log π‘œ). For each entry 𝑏𝑗,π‘˜ of 𝐡 ∈ ℝ𝑙×𝑒: Independently sample 𝑏𝑗,π‘˜ from Gaussian distribution 𝑢(0,1/𝑙). For each π‘š ∈ [π‘œ]: Let π‘§π‘š = π΅π‘¦π‘š.

slide-14
SLIDE 14

Choose some suitable 𝑙 ∈ 𝑃(πœ—βˆ’2 β‹… log π‘œ). For each entry 𝑏𝑗,π‘˜ of 𝐡 ∈ ℝ𝑙×𝑒: Independently sample 𝑏𝑗,π‘˜ from Gaussian distribution 𝑢(0,1/𝑙). For each π‘š ∈ [π‘œ]: Let π‘§π‘š = π΅π‘¦π‘š.

Gaussian distribution (a.k.a. normal distribution) 𝑢(𝜈, 𝜏2): 𝔽 π‘Œ = 𝜈, Var π‘Œ = 𝜏2 Pr π‘Œ ≀ 𝑒 = ΰΆ±

βˆ’βˆž 𝑒

1 2𝜌𝜏2 π‘“βˆ’ π‘¦βˆ’πœˆ 2/(2𝜏2) d𝑦

slide-15
SLIDE 15

βˆ€0 < πœ— < 1: let 𝐡 be a 𝑙 Γ— 𝑒 matrix with 𝑙 ∈ 𝑃(πœ—βˆ’2 β‹… log π‘œ), if each entry of 𝐡 is independently drawn from 𝑢(0,1/𝑙), then with high probability: for all 𝑦𝑗, π‘¦π‘˜ ∈ 𝑇, 1 βˆ’ πœ— 𝑦𝑗 βˆ’ π‘¦π‘˜

2 2 ≀

𝐡𝑦𝑗 βˆ’ π΅π‘¦π‘˜

2 2 ≀ (1 + πœ—) 𝑦𝑗 βˆ’ π‘¦π‘˜ 2 2

slide-16
SLIDE 16

βˆ€0 < πœ— < 1: let 𝐡 be a 𝑙 Γ— 𝑒 matrix with 𝑙 ∈ 𝑃(πœ—βˆ’2 β‹… log π‘œ), if each entry of 𝐡 is independently drawn from 𝑢(0,1/𝑙), then with high probability: for all 𝑦𝑗, π‘¦π‘˜ ∈ 𝑇, 1 βˆ’ πœ— 𝑦𝑗 βˆ’ π‘¦π‘˜

2 2 ≀

𝐡𝑦𝑗 βˆ’ π΅π‘¦π‘˜

2 2 ≀ (1 + πœ—) 𝑦𝑗 βˆ’ π‘¦π‘˜ 2 2

1 βˆ’ πœ— ≀ 𝐡 𝑦𝑗 βˆ’ π‘¦π‘˜ 𝑦𝑗 βˆ’ π‘¦π‘˜

2 2 2

≀ 1 + πœ—

slide-17
SLIDE 17

βˆ€0 < πœ— < 1: let 𝐡 be a 𝑙 Γ— 𝑒 matrix with 𝑙 ∈ 𝑃(πœ—βˆ’2 β‹… log π‘œ), if each entry of 𝐡 is independently drawn from 𝑢(0,1/𝑙), then with high probability: for all 𝑦𝑗, π‘¦π‘˜ ∈ 𝑇, 1 βˆ’ πœ— 𝑦𝑗 βˆ’ π‘¦π‘˜

2 2 ≀

𝐡𝑦𝑗 βˆ’ π΅π‘¦π‘˜

2 2 ≀ (1 + πœ—) 𝑦𝑗 βˆ’ π‘¦π‘˜ 2 2

1 βˆ’ πœ— ≀ 𝐡 𝑦𝑗 βˆ’ π‘¦π‘˜ 𝑦𝑗 βˆ’ π‘¦π‘˜

2 2 2

≀ 1 + πœ— unit vector!

slide-18
SLIDE 18

Norm Preservation

βˆ€0 < πœ— < 1: let 𝐡 be a 𝑙 Γ— 𝑒 matrix with 𝑙 ∈ 𝑃(πœ—βˆ’2 β‹… log π‘œ), if each entry of 𝐡 is independently drawn from 𝑢(0,1/𝑙), then with high probability: for all 𝑦𝑗, π‘¦π‘˜ ∈ 𝑇, 1 βˆ’ πœ— 𝑦𝑗 βˆ’ π‘¦π‘˜

2 2 ≀

𝐡𝑦𝑗 βˆ’ π΅π‘¦π‘˜

2 2 ≀ (1 + πœ—) 𝑦𝑗 βˆ’ π‘¦π‘˜ 2 2

1 βˆ’ πœ— ≀ 𝐡 𝑦𝑗 βˆ’ π‘¦π‘˜ 𝑦𝑗 βˆ’ π‘¦π‘˜

2 2 2

≀ 1 + πœ— unit vector!

slide-19
SLIDE 19

Norm Preservation

βˆ€0 < πœ— < 1: let 𝐡 be a 𝑙 Γ— 𝑒 matrix with 𝑙 ∈ 𝑃(πœ—βˆ’2 β‹… log π‘œ), if each entry of 𝐡 is independently drawn from 𝑢(0,1/𝑙), then with high probability: for all 𝑦𝑗, π‘¦π‘˜ ∈ 𝑇, 1 βˆ’ πœ— 𝑦𝑗 βˆ’ π‘¦π‘˜

2 2 ≀

𝐡𝑦𝑗 βˆ’ π΅π‘¦π‘˜

2 2 ≀ (1 + πœ—) 𝑦𝑗 βˆ’ π‘¦π‘˜ 2 2

1 βˆ’ πœ— ≀ 𝐡 𝑦𝑗 βˆ’ π‘¦π‘˜ 𝑦𝑗 βˆ’ π‘¦π‘˜

2 2 2

≀ 1 + πœ— unit vector!

For any unit vector 𝑣 ∈ ℝ𝑒: Pr 𝐡𝑣 2

2 βˆ’ 1 > πœ— < 1/π‘œ3 union bound over 𝑃(π‘œ2) pairs of 𝑦𝑗, π‘¦π‘˜ ∈ 𝑇

slide-20
SLIDE 20

Let 𝑙 ∈ 𝑃(πœ—βˆ’2 β‹… log π‘œ) and 𝐡 ∈ ℝ𝑙×𝑒, let each entry of 𝐡 is chosen i.i.d. from 𝑢(0,1/𝑙), then for any unit vector 𝑣 ∈ ℝ𝑒: Pr 𝐡𝑣 2

2 βˆ’ 1 > πœ— < 1/π‘œ3

slide-21
SLIDE 21

Let 𝑙 ∈ 𝑃(πœ—βˆ’2 β‹… log π‘œ) and 𝐡 ∈ ℝ𝑙×𝑒, let each entry of 𝐡 is chosen i.i.d. from 𝑢(0,1/𝑙), then for any unit vector 𝑣 ∈ ℝ𝑒: Pr 𝐡𝑣 2

2 βˆ’ 1 > πœ— < 1/π‘œ3

slide-22
SLIDE 22

Let 𝑙 ∈ 𝑃(πœ—βˆ’2 β‹… log π‘œ) and 𝐡 ∈ ℝ𝑙×𝑒, let each entry of 𝐡 is chosen i.i.d. from 𝑢(0,1/𝑙), then for any unit vector 𝑣 ∈ ℝ𝑒: Pr 𝐡𝑣 2

2 βˆ’ 1 > πœ— < 1/π‘œ3

slide-23
SLIDE 23

Let 𝑙 ∈ 𝑃(πœ—βˆ’2 β‹… log π‘œ) and 𝐡 ∈ ℝ𝑙×𝑒, let each entry of 𝐡 is chosen i.i.d. from 𝑢(0,1/𝑙), then for any unit vector 𝑣 ∈ ℝ𝑒: Pr 𝐡𝑣 2

2 βˆ’ 1 > πœ— < 1/π‘œ3

  • Each π΅π‘—π‘˜ is chosen i.i.d. from 𝑢(0,1/𝑙)
  • Linear combination of independent Gaussian r.v. is also Gaussian
  • π‘Œ~𝑢 πœˆπ‘Œ, πœπ‘Œ

2 , 𝑍~𝑢 πœˆπ‘, πœπ‘ 2 β†’ π‘π‘Œ + 𝑐𝑍~𝑢 π‘πœˆπ‘Œ + π‘πœˆπ‘, 𝑏2πœπ‘Œ 2 + 𝑐2πœπ‘ 2

slide-24
SLIDE 24

Let 𝑙 ∈ 𝑃(πœ—βˆ’2 β‹… log π‘œ) and 𝐡 ∈ ℝ𝑙×𝑒, let each entry of 𝐡 is chosen i.i.d. from 𝑢(0,1/𝑙), then for any unit vector 𝑣 ∈ ℝ𝑒: Pr 𝐡𝑣 2

2 βˆ’ 1 > πœ— < 1/π‘œ3

  • Each π΅π‘—π‘˜ is chosen i.i.d. from 𝑢(0,1/𝑙)
  • Linear combination of independent Gaussian r.v. is also Gaussian
  • π‘Œ~𝑢 πœˆπ‘Œ, πœπ‘Œ

2 , 𝑍~𝑢 πœˆπ‘, πœπ‘ 2 β†’ π‘π‘Œ + 𝑐𝑍~𝑢 π‘πœˆπ‘Œ + π‘πœˆπ‘, 𝑏2πœπ‘Œ 2 + 𝑐2πœπ‘ 2

slide-25
SLIDE 25

Let 𝑙 ∈ 𝑃(πœ—βˆ’2 β‹… log π‘œ) and 𝐡 ∈ ℝ𝑙×𝑒, let each entry of 𝐡 is chosen i.i.d. from 𝑢(0,1/𝑙), then for any unit vector 𝑣 ∈ ℝ𝑒: Pr 𝐡𝑣 2

2 βˆ’ 1 > πœ— < 1/π‘œ3

  • Each π΅π‘—π‘˜ is chosen i.i.d. from 𝑢(0,1/𝑙)
  • Linear combination of independent Gaussian r.v. is also Gaussian
  • π‘Œ~𝑢 πœˆπ‘Œ, πœπ‘Œ

2 , 𝑍~𝑢 πœˆπ‘, πœπ‘ 2 β†’ π‘π‘Œ + 𝑐𝑍~𝑢 π‘πœˆπ‘Œ + π‘πœˆπ‘, 𝑏2πœπ‘Œ 2 + 𝑐2πœπ‘ 2

𝑣 is unit vector

slide-26
SLIDE 26

Let 𝑙 ∈ 𝑃(πœ—βˆ’2 β‹… log π‘œ) and 𝐡 ∈ ℝ𝑙×𝑒, let each entry of 𝐡 is chosen i.i.d. from 𝑢(0,1/𝑙), then for any unit vector 𝑣 ∈ ℝ𝑒: Pr 𝐡𝑣 2

2 βˆ’ 1 > πœ— < 1/π‘œ3

  • Each π΅π‘—π‘˜ is chosen i.i.d. from 𝑢(0,1/𝑙)
  • Linear combination of independent Gaussian r.v. is also Gaussian
  • π‘Œ~𝑢 πœˆπ‘Œ, πœπ‘Œ

2 , 𝑍~𝑢 πœˆπ‘, πœπ‘ 2 β†’ π‘π‘Œ + 𝑐𝑍~𝑢 π‘πœˆπ‘Œ + π‘πœˆπ‘, 𝑏2πœπ‘Œ 2 + 𝑐2πœπ‘ 2

𝑣 is unit vector

Moreover, these 𝐡𝑣 𝑗 are mutually independent!

slide-27
SLIDE 27

Let 𝑙 ∈ 𝑃(πœ—βˆ’2 β‹… log π‘œ) and 𝐡 ∈ ℝ𝑙×𝑒, let each entry of 𝐡 is chosen i.i.d. from 𝑢(0,1/𝑙), then for any unit vector 𝑣 ∈ ℝ𝑒: Pr 𝐡𝑣 2

2 βˆ’ 1 > πœ— < 1/π‘œ3

slide-28
SLIDE 28

Let 𝑙 ∈ 𝑃(πœ—βˆ’2 β‹… log π‘œ) and 𝐡 ∈ ℝ𝑙×𝑒, let each entry of 𝐡 is chosen i.i.d. from 𝑢(0,1/𝑙), then for any unit vector 𝑣 ∈ ℝ𝑒: Pr 𝐡𝑣 2

2 βˆ’ 1 > πœ— < 1/π‘œ3

slide-29
SLIDE 29

Let 𝑙 ∈ 𝑃(πœ—βˆ’2 β‹… log π‘œ) and 𝐡 ∈ ℝ𝑙×𝑒, let each entry of 𝐡 is chosen i.i.d. from 𝑢(0,1/𝑙), then for any unit vector 𝑣 ∈ ℝ𝑒: Pr 𝐡𝑣 2

2 βˆ’ 1 > πœ— < 1/π‘œ3

slide-30
SLIDE 30

Let 𝑙 ∈ 𝑃(πœ—βˆ’2 β‹… log π‘œ) and 𝐡 ∈ ℝ𝑙×𝑒, let each entry of 𝐡 is chosen i.i.d. from 𝑢(0,1/𝑙), then for any unit vector 𝑣 ∈ ℝ𝑒: Pr 𝐡𝑣 2

2 βˆ’ 1 > πœ— < 1/π‘œ3

In terms of expectation we are fine, but how fast do we deviate from expectation?

slide-31
SLIDE 31

Let 𝑙 ∈ 𝑃(πœ—βˆ’2 β‹… log π‘œ) and 𝐡 ∈ ℝ𝑙×𝑒, let each entry of 𝐡 is chosen i.i.d. from 𝑢(0,1/𝑙), then for any unit vector 𝑣 ∈ ℝ𝑒: Pr 𝐡𝑣 2

2 βˆ’ 1 > πœ— < 1/π‘œ3

slide-32
SLIDE 32

Let 𝑙 ∈ 𝑃(πœ—βˆ’2 β‹… log π‘œ) and 𝐡 ∈ ℝ𝑙×𝑒, let each entry of 𝐡 is chosen i.i.d. from 𝑢(0,1/𝑙), then for any unit vector 𝑣 ∈ ℝ𝑒: Pr 𝐡𝑣 2

2 βˆ’ 1 > πœ— < 1/π‘œ3

slide-33
SLIDE 33

Let 𝑙 ∈ 𝑃(πœ—βˆ’2 β‹… log π‘œ) and 𝐡 ∈ ℝ𝑙×𝑒, let each entry of 𝐡 is chosen i.i.d. from 𝑢(0,1/𝑙), then for any unit vector 𝑣 ∈ ℝ𝑒: Pr 𝐡𝑣 2

2 βˆ’ 1 > πœ— < 1/π‘œ3

slide-34
SLIDE 34

Let 𝑙 ∈ 𝑃(πœ—βˆ’2 β‹… log π‘œ) and 𝐡 ∈ ℝ𝑙×𝑒, let each entry of 𝐡 is chosen i.i.d. from 𝑢(0,1/𝑙), then for any unit vector 𝑣 ∈ ℝ𝑒: Pr 𝐡𝑣 2

2 βˆ’ 1 > πœ— < 1/π‘œ3

Chernoff bound for ππŸ‘-distribution: For i.i.d. π‘Œ1, π‘Œ2, β‹― , π‘Œπ‘™~𝑢(0,1) and 0 < πœ— < 1, Pr

1 𝑙 σ𝑗=1 𝑙

π‘Œπ‘—

2 βˆ’ 1 > πœ— < 2π‘“βˆ’π‘™πœ—2/8

slide-35
SLIDE 35

Let 𝑙 ∈ 𝑃(πœ—βˆ’2 β‹… log π‘œ) and 𝐡 ∈ ℝ𝑙×𝑒, let each entry of 𝐡 is chosen i.i.d. from 𝑢(0,1/𝑙), then for any unit vector 𝑣 ∈ ℝ𝑒: Pr 𝐡𝑣 2

2 βˆ’ 1 > πœ— < 1/π‘œ3

Chernoff bound for ππŸ‘-distribution: For i.i.d. π‘Œ1, π‘Œ2, β‹― , π‘Œπ‘™~𝑢(0,1) and 0 < πœ— < 1, Pr

1 𝑙 σ𝑗=1 𝑙

π‘Œπ‘—

2 βˆ’ 1 > πœ— < 2π‘“βˆ’π‘™πœ—2/8

Notice π‘Œπ‘— = 𝑙 β‹… 𝑍

𝑗

slide-36
SLIDE 36

Let 𝑙 ∈ 𝑃(πœ—βˆ’2 β‹… log π‘œ) and 𝐡 ∈ ℝ𝑙×𝑒, let each entry of 𝐡 is chosen i.i.d. from 𝑢(0,1/𝑙), then for any unit vector 𝑣 ∈ ℝ𝑒: Pr 𝐡𝑣 2

2 βˆ’ 1 > πœ— < 1/π‘œ3

Chernoff bound for ππŸ‘-distribution: For i.i.d. π‘Œ1, π‘Œ2, β‹― , π‘Œπ‘™~𝑢(0,1) and 0 < πœ— < 1, Pr

1 𝑙 σ𝑗=1 𝑙

π‘Œπ‘—

2 βˆ’ 1 > πœ— < 2π‘“βˆ’π‘™πœ—2/8

slide-37
SLIDE 37

Let 𝑙 ∈ 𝑃(πœ—βˆ’2 β‹… log π‘œ) and 𝐡 ∈ ℝ𝑙×𝑒, let each entry of 𝐡 is chosen i.i.d. from 𝑢(0,1/𝑙), then for any unit vector 𝑣 ∈ ℝ𝑒: Pr 𝐡𝑣 2

2 βˆ’ 1 > πœ— < 1/π‘œ3

Chernoff bound for ππŸ‘-distribution: For i.i.d. π‘Œ1, π‘Œ2, β‹― , π‘Œπ‘™~𝑢(0,1) and 0 < πœ— < 1, Pr

1 𝑙 σ𝑗=1 𝑙

π‘Œπ‘—

2 βˆ’ 1 > πœ— < 2π‘“βˆ’π‘™πœ—2/8

For suitable 𝑙 ∈ 𝑃(πœ—βˆ’2 β‹… log π‘œ)

slide-38
SLIDE 38

Chernoff bound for ππŸ‘-distribution: For i.i.d. π‘Œ1, π‘Œ2, β‹― , π‘Œπ‘™~𝑢(0,1) and 0 < πœ— < 1, Pr

1 𝑙 σ𝑗=1 𝑙

π‘Œπ‘—

2 βˆ’ 1 > πœ— < 2π‘“βˆ’π‘™πœ—2/8

slide-39
SLIDE 39

Chernoff bound for ππŸ‘-distribution: For i.i.d. π‘Œ1, π‘Œ2, β‹― , π‘Œπ‘™~𝑢(0,1) and 0 < πœ— < 1, Pr

1 𝑙 σ𝑗=1 𝑙

π‘Œπ‘—

2 βˆ’ 1 > πœ— < 2π‘“βˆ’π‘™πœ—2/8

slide-40
SLIDE 40

Chernoff bound for ππŸ‘-distribution: For i.i.d. π‘Œ1, π‘Œ2, β‹― , π‘Œπ‘™~𝑢(0,1) and 0 < πœ— < 1, Pr

1 𝑙 σ𝑗=1 𝑙

π‘Œπ‘—

2 βˆ’ 1 > πœ— < 2π‘“βˆ’π‘™πœ—2/8

slide-41
SLIDE 41

Chernoff bound for ππŸ‘-distribution: For i.i.d. π‘Œ1, π‘Œ2, β‹― , π‘Œπ‘™~𝑢(0,1) and 0 < πœ— < 1, Pr

1 𝑙 σ𝑗=1 𝑙

π‘Œπ‘—

2 βˆ’ 1 > πœ— < 2π‘“βˆ’π‘™πœ—2/8

slide-42
SLIDE 42

Chernoff bound for ππŸ‘-distribution: For i.i.d. π‘Œ1, π‘Œ2, β‹― , π‘Œπ‘™~𝑢(0,1) and 0 < πœ— < 1, Pr

1 𝑙 σ𝑗=1 𝑙

π‘Œπ‘—

2 βˆ’ 1 > πœ— < 2π‘“βˆ’π‘™πœ—2/8

slide-43
SLIDE 43

Chernoff bound for ππŸ‘-distribution: For i.i.d. π‘Œ1, π‘Œ2, β‹― , π‘Œπ‘™~𝑢(0,1) and 0 < πœ— < 1, Pr

1 𝑙 σ𝑗=1 𝑙

π‘Œπ‘—

2 βˆ’ 1 > πœ— < 2π‘“βˆ’π‘™πœ—2/8

If π‘Œ~𝑢(0,1) and 𝑑 < 1/2, then 𝔽 π‘“π‘‘π‘Œ2 =

1 1βˆ’2𝑑

slide-44
SLIDE 44

Chernoff bound for ππŸ‘-distribution: For i.i.d. π‘Œ1, π‘Œ2, β‹― , π‘Œπ‘™~𝑢(0,1) and 0 < πœ— < 1, Pr

1 𝑙 σ𝑗=1 𝑙

π‘Œπ‘—

2 βˆ’ 1 > πœ— < 2π‘“βˆ’π‘™πœ—2/8

If π‘Œ~𝑢(0,1) and 𝑑 < 1/2, then 𝔽 π‘“π‘‘π‘Œ2 =

1 1βˆ’2𝑑

slide-45
SLIDE 45

Chernoff bound for ππŸ‘-distribution: For i.i.d. π‘Œ1, π‘Œ2, β‹― , π‘Œπ‘™~𝑢(0,1) and 0 < πœ— < 1, Pr

1 𝑙 σ𝑗=1 𝑙

π‘Œπ‘—

2 βˆ’ 1 > πœ— < 2π‘“βˆ’π‘™πœ—2/8

If π‘Œ~𝑢(0,1) and 𝑑 < 1/2, then 𝔽 π‘“π‘‘π‘Œ2 =

1 1βˆ’2𝑑

slide-46
SLIDE 46

Chernoff bound for ππŸ‘-distribution: For i.i.d. π‘Œ1, π‘Œ2, β‹― , π‘Œπ‘™~𝑢(0,1) and 0 < πœ— < 1, Pr

1 𝑙 σ𝑗=1 𝑙

π‘Œπ‘—

2 βˆ’ 1 > πœ— < 2π‘“βˆ’π‘™πœ—2/8

If π‘Œ~𝑢(0,1) and 𝑑 < 1/2, then 𝔽 π‘“π‘‘π‘Œ2 =

1 1βˆ’2𝑑

slide-47
SLIDE 47

Chernoff bound for ππŸ‘-distribution: For i.i.d. π‘Œ1, π‘Œ2, β‹― , π‘Œπ‘™~𝑢(0,1) and 0 < πœ— < 1, Pr

1 𝑙 σ𝑗=1 𝑙

π‘Œπ‘—

2 βˆ’ 1 > πœ— < 2π‘“βˆ’π‘™πœ—2/8

If π‘Œ~𝑢(0,1) and 𝑑 < 1/2, then 𝔽 π‘“π‘‘π‘Œ2 =

1 1βˆ’2𝑑

when πœ‡ ≀ 1/4

slide-48
SLIDE 48

Chernoff bound for ππŸ‘-distribution: For i.i.d. π‘Œ1, π‘Œ2, β‹― , π‘Œπ‘™~𝑢(0,1) and 0 < πœ— < 1, Pr

1 𝑙 σ𝑗=1 𝑙

π‘Œπ‘—

2 βˆ’ 1 > πœ— < 2π‘“βˆ’π‘™πœ—2/8

If π‘Œ~𝑢(0,1) and 𝑑 < 1/2, then 𝔽 π‘“π‘‘π‘Œ2 =

1 1βˆ’2𝑑

when πœ‡ ≀ 1/4 let πœ‡ = πœ—/4

slide-49
SLIDE 49

Theorem (Johnson-Lindenstrauss 1984):

βˆ€0 < πœ— < 1, for any set 𝑇 of π‘œ points from ℝ𝑒, there is a 𝜚: ℝ𝑒 β†’ ℝ𝑙 with 𝑙 ∈ 𝑃(πœ—βˆ’2 β‹… log π‘œ), such that βˆ€π‘¦π‘—, π‘¦π‘˜ ∈ 𝑇: 1 βˆ’ πœ— 𝑦𝑗 βˆ’ π‘¦π‘˜

2 2 ≀

𝜚 𝑦𝑗 βˆ’ 𝜚 π‘¦π‘˜

2 2 ≀ (1 + πœ—) 𝑦𝑗 βˆ’ π‘¦π‘˜ 2 2

β€œ Even better, it is very easy to find such 𝜚: Just sample a random 𝑙 Γ— 𝑒 matrix 𝐡 ” β€œ JLT states in Euclidian space, it is always possible to embed a set of π‘œ points in arbitrary dimension to 𝑃(log π‘œ) dimension with constant distortion. ”

slide-50
SLIDE 50

Nearest Neighbor Search (NNS)

Setup: metric space (π‘Œ, dist) Data: π‘œ points 𝑧1, 𝑧2, β‹― , π‘§π‘œ ∈ π‘Œ Query: given a point Τ¦ 𝑦 ∈ π‘Œ, find the 𝑧𝑗 which is closest to Τ¦ 𝑦

slide-51
SLIDE 51

Nearest Neighbor Search (NNS)

Setup: metric space (π‘Œ, dist) Data: π‘œ points 𝑧1, 𝑧2, β‹― , π‘§π‘œ ∈ π‘Œ Query: given a point Τ¦ 𝑦 ∈ π‘Œ, find the 𝑧𝑗 which is closest to Τ¦ 𝑦

a set a distance function satisfying triangle inequality

slide-52
SLIDE 52

Nearest Neighbor Search (NNS)

Setup: metric space (π‘Œ, dist) Data: π‘œ points 𝑧1, 𝑧2, β‹― , π‘§π‘œ ∈ π‘Œ Query: given a point Τ¦ 𝑦 ∈ π‘Œ, find the 𝑧𝑗 which is closest to Τ¦ 𝑦

slide-53
SLIDE 53

Nearest Neighbor Search (NNS)

Setup: metric space (π‘Œ, dist) Data: π‘œ points 𝑧1, 𝑧2, β‹― , π‘§π‘œ ∈ π‘Œ Query: given a point Τ¦ 𝑦 ∈ π‘Œ, find the 𝑧𝑗 which is closest to Τ¦ 𝑦 Can find many applications in:

  • database systems
  • pattern recognition
  • machine learning
  • bioinformatics
  • …
slide-54
SLIDE 54

Nearest Neighbor Search (NNS)

Setup: metric space (π‘Œ, dist) Data: π‘œ points 𝑧1, 𝑧2, β‹― , π‘§π‘œ ∈ π‘Œ Query: given a point Τ¦ 𝑦 ∈ π‘Œ, find the 𝑧𝑗 which is closest to Τ¦ 𝑦 Can find many applications in:

  • database systems
  • pattern recognition
  • machine learning
  • bioinformatics
  • …

size sound

?

slide-55
SLIDE 55

Nearest Neighbor Search (NNS)

Data: π‘œ points 𝑧1, 𝑧2, β‹― , π‘§π‘œ ∈ 𝑉 𝑒 for some finite 𝑉 Query: given a point Τ¦ 𝑦 ∈ 𝑉 𝑒, find the 𝑧𝑗 which is closest to Τ¦ 𝑦 Goal: Efficiently answer the query

What efficiency we care?

  • Usually space and time

Trivial solution:

  • No preprocessing, just linear search

When dimension 𝑒 is small:

  • Binary search when 𝑒 = 1
  • 𝑙-d tree
  • Voronoi diagram
  • …

𝑙-d tree Voronoi diagram

slide-56
SLIDE 56

Nearest Neighbor Search (NNS)

Data: π‘œ points 𝑧1, 𝑧2, β‹― , π‘§π‘œ ∈ 𝑉 𝑒 for some finite 𝑉 Query: given a point Τ¦ 𝑦 ∈ 𝑉 𝑒, find the 𝑧𝑗 which is closest to Τ¦ 𝑦 Goal: Efficiently answer the query What if dimension 𝑒 is large, say 𝑒 ≫ log π‘œ?

slide-57
SLIDE 57

Nearest Neighbor Search (NNS)

Data: π‘œ points 𝑧1, 𝑧2, β‹― , π‘§π‘œ ∈ 𝑉 𝑒 for some finite 𝑉 Query: given a point Τ¦ 𝑦 ∈ 𝑉 𝑒, find the 𝑧𝑗 which is closest to Τ¦ 𝑦 Goal: Efficiently answer the query What if dimension 𝑒 is large, say 𝑒 ≫ log π‘œ? Curse of dimensionality: It is conjectured that to solve NNS in high dimension requires either super-polynomial(π‘œ) space or super-polynomial(𝑒) time.

slide-58
SLIDE 58

Nearest Neighbor Search (NNS)

Data: π‘œ points 𝑧1, 𝑧2, β‹― , π‘§π‘œ ∈ 𝑉 𝑒 for some finite 𝑉 Query: given a point Τ¦ 𝑦 ∈ 𝑉 𝑒, find the 𝑧𝑗 which is closest to Τ¦ 𝑦 Goal: Efficiently answer the query What if dimension 𝑒 is large, say 𝑒 ≫ log π‘œ? Curse of dimensionality: It is conjectured that to solve NNS in high dimension requires either super-polynomial(π‘œ) space or super-polynomial(𝑒) time. Blessing: Randomization + Approximation

slide-59
SLIDE 59

Setup: metric space (π‘Œ, dist) Data: π‘œ points 𝑧1, 𝑧2, β‹― , π‘§π‘œ ∈ π‘Œ Query: given a point Τ¦ 𝑦 ∈ π‘Œ, 𝒅-ANN (Approximate Nearest Neighbor):

Return a 𝑧𝑗 s.t. dist Τ¦ 𝑦, 𝑧𝑗 ≀ 𝑑 β‹… min

1β‰€π‘˜β‰€π‘œ dist( Τ¦

𝑦, π‘§π‘˜)

(𝒅, 𝒔)-ANN (Approximate Near Neighbor):

  • Return a 𝑧𝑗 s.t. dist Τ¦

𝑦, 𝑧𝑗 ≀ 𝑑𝑠 if βˆƒπ‘§π‘˜: dist Τ¦ 𝑦, π‘§π‘˜ ≀ 𝑠

  • Return β€œno” if βˆ€π‘§π‘˜: dist Τ¦

𝑦, π‘§π‘˜ > 𝑑𝑠

  • Arbitrary answer otherwise

Approximate Near(est) Neighbor (ANN)

slide-60
SLIDE 60

Setup: metric space (π‘Œ, dist) Data: π‘œ points 𝑧1, 𝑧2, β‹― , π‘§π‘œ ∈ π‘Œ Query: given a point Τ¦ 𝑦 ∈ π‘Œ, 𝒅-ANN (Approximate Nearest Neighbor):

Return a 𝑧𝑗 s.t. dist Τ¦ 𝑦, 𝑧𝑗 ≀ 𝑑 β‹… min

1β‰€π‘˜β‰€π‘œ dist( Τ¦

𝑦, π‘§π‘˜)

(𝒅, 𝒔)-ANN (Approximate Near Neighbor):

  • Return a 𝑧𝑗 s.t. dist Τ¦

𝑦, 𝑧𝑗 ≀ 𝑑𝑠 if βˆƒπ‘§π‘˜: dist Τ¦ 𝑦, π‘§π‘˜ ≀ 𝑠

  • Return β€œno” if βˆ€π‘§π‘˜: dist Τ¦

𝑦, π‘§π‘˜ > 𝑑𝑠

  • Arbitrary answer otherwise
slide-61
SLIDE 61

Setup: metric space (π‘Œ, dist) Data: π‘œ points 𝑧1, 𝑧2, β‹― , π‘§π‘œ ∈ π‘Œ Query: given a point Τ¦ 𝑦 ∈ π‘Œ, 𝒅-ANN (Approximate Nearest Neighbor):

Return a 𝑧𝑗 s.t. dist Τ¦ 𝑦, 𝑧𝑗 ≀ 𝑑 β‹… min

1β‰€π‘˜β‰€π‘œ dist( Τ¦

𝑦, π‘§π‘˜)

(𝒅, 𝒔)-ANN (Approximate Near Neighbor):

  • Return a 𝑧𝑗 s.t. dist Τ¦

𝑦, 𝑧𝑗 ≀ 𝑑𝑠 if βˆƒπ‘§π‘˜: dist Τ¦ 𝑦, π‘§π‘˜ ≀ 𝑠

  • Return β€œno” if βˆ€π‘§π‘˜: dist Τ¦

𝑦, π‘§π‘˜ > 𝑑𝑠

  • Arbitrary answer otherwise

If we can solve (𝑑, 𝑠)-ANN, then we can solve 𝑑-ANN with little overhead.

slide-62
SLIDE 62

Setup: metric space (π‘Œ, dist) Data: π‘œ points 𝑧1, 𝑧2, β‹― , π‘§π‘œ ∈ π‘Œ Query: given a point Τ¦ 𝑦 ∈ π‘Œ, 𝒅-ANN (Approximate Nearest Neighbor):

Return a 𝑧𝑗 s.t. dist Τ¦ 𝑦, 𝑧𝑗 ≀ 𝑑 β‹… min

1β‰€π‘˜β‰€π‘œ dist( Τ¦

𝑦, π‘§π‘˜)

(𝒅, 𝒔)-ANN (Approximate Near Neighbor):

  • Return a 𝑧𝑗 s.t. dist Τ¦

𝑦, 𝑧𝑗 ≀ 𝑑𝑠 if βˆƒπ‘§π‘˜: dist Τ¦ 𝑦, π‘§π‘˜ ≀ 𝑠

  • Return β€œno” if βˆ€π‘§π‘˜: dist Τ¦

𝑦, π‘§π‘˜ > 𝑑𝑠

  • Arbitrary answer otherwise

If we can solve (𝑑, 𝑠)-ANN, then we can solve 𝑑-ANN with little overhead. πΈπ‘›π‘—π‘œ = min

1≀𝑗<π‘˜β‰€π‘œ dist(𝑧𝑗, π‘§π‘˜)

𝐸𝑛𝑏𝑦 = max

1≀𝑗<π‘˜β‰€π‘œ dist(𝑧𝑗, π‘§π‘˜)

𝑆 = πΈπ‘›π‘—π‘œ 2 β‹… 𝑑 βˆ’1, πΈπ‘›π‘—π‘œ 2 β‹… 𝑑 0, πΈπ‘›π‘—π‘œ 2 β‹… 𝑑 1, β‹― , 𝐸𝑛𝑏𝑦

slide-63
SLIDE 63

Setup: metric space (π‘Œ, dist) Data: π‘œ points 𝑧1, 𝑧2, β‹― , π‘§π‘œ ∈ π‘Œ Query: given a point Τ¦ 𝑦 ∈ π‘Œ, 𝒅-ANN (Approximate Nearest Neighbor):

Return a 𝑧𝑗 s.t. dist Τ¦ 𝑦, 𝑧𝑗 ≀ 𝑑 β‹… min

1β‰€π‘˜β‰€π‘œ dist( Τ¦

𝑦, π‘§π‘˜)

(𝒅, 𝒔)-ANN (Approximate Near Neighbor):

  • Return a 𝑧𝑗 s.t. dist Τ¦

𝑦, 𝑧𝑗 ≀ 𝑑𝑠 if βˆƒπ‘§π‘˜: dist Τ¦ 𝑦, π‘§π‘˜ ≀ 𝑠

  • Return β€œno” if βˆ€π‘§π‘˜: dist Τ¦

𝑦, π‘§π‘˜ > 𝑑𝑠

  • Arbitrary answer otherwise

If we can solve (𝑑, 𝑠)-ANN, then we can solve 𝑑-ANN with little overhead. πΈπ‘›π‘—π‘œ = min

1≀𝑗<π‘˜β‰€π‘œ dist(𝑧𝑗, π‘§π‘˜)

𝐸𝑛𝑏𝑦 = max

1≀𝑗<π‘˜β‰€π‘œ dist(𝑧𝑗, π‘§π‘˜)

𝑆 = πΈπ‘›π‘—π‘œ 2 β‹… 𝑑 βˆ’1, πΈπ‘›π‘—π‘œ 2 β‹… 𝑑 0, πΈπ‘›π‘—π‘œ 2 β‹… 𝑑 1, β‹― , 𝐸𝑛𝑏𝑦 Let π‘ βˆ— be the min in 𝑆 s.t. ( 𝑑, π‘ βˆ—)-ANN returns yes with π‘§βˆ—

slide-64
SLIDE 64

Setup: metric space (π‘Œ, dist) Data: π‘œ points 𝑧1, 𝑧2, β‹― , π‘§π‘œ ∈ π‘Œ Query: given a point Τ¦ 𝑦 ∈ π‘Œ, 𝒅-ANN (Approximate Nearest Neighbor):

Return a 𝑧𝑗 s.t. dist Τ¦ 𝑦, 𝑧𝑗 ≀ 𝑑 β‹… min

1β‰€π‘˜β‰€π‘œ dist( Τ¦

𝑦, π‘§π‘˜)

(𝒅, 𝒔)-ANN (Approximate Near Neighbor):

  • Return a 𝑧𝑗 s.t. dist Τ¦

𝑦, 𝑧𝑗 ≀ 𝑑𝑠 if βˆƒπ‘§π‘˜: dist Τ¦ 𝑦, π‘§π‘˜ ≀ 𝑠

  • Return β€œno” if βˆ€π‘§π‘˜: dist Τ¦

𝑦, π‘§π‘˜ > 𝑑𝑠

  • Arbitrary answer otherwise

If we can solve (𝑑, 𝑠)-ANN, then we can solve 𝑑-ANN with little overhead. πΈπ‘›π‘—π‘œ = min

1≀𝑗<π‘˜β‰€π‘œ dist(𝑧𝑗, π‘§π‘˜)

𝐸𝑛𝑏𝑦 = max

1≀𝑗<π‘˜β‰€π‘œ dist(𝑧𝑗, π‘§π‘˜)

𝑆 = πΈπ‘›π‘—π‘œ 2 β‹… 𝑑 βˆ’1, πΈπ‘›π‘—π‘œ 2 β‹… 𝑑 0, πΈπ‘›π‘—π‘œ 2 β‹… 𝑑 1, β‹― , 𝐸𝑛𝑏𝑦 Let π‘ βˆ— be the min in 𝑆 s.t. ( 𝑑, π‘ βˆ—)-ANN returns yes with π‘§βˆ— dist Τ¦ 𝑦, π‘§βˆ— ≀ 𝑑 β‹… π‘ βˆ— βˆ€π‘§π‘— ∈ π‘Œ: dist Τ¦ 𝑦, 𝑧𝑗 > π‘ βˆ—/ 𝑑

slide-65
SLIDE 65

Setup: metric space (π‘Œ, dist) Data: π‘œ points 𝑧1, 𝑧2, β‹― , π‘§π‘œ ∈ π‘Œ Query: given a point Τ¦ 𝑦 ∈ π‘Œ, 𝒅-ANN (Approximate Nearest Neighbor):

Return a 𝑧𝑗 s.t. dist Τ¦ 𝑦, 𝑧𝑗 ≀ 𝑑 β‹… min

1β‰€π‘˜β‰€π‘œ dist( Τ¦

𝑦, π‘§π‘˜)

(𝒅, 𝒔)-ANN (Approximate Near Neighbor):

  • Return a 𝑧𝑗 s.t. dist Τ¦

𝑦, 𝑧𝑗 ≀ 𝑑𝑠 if βˆƒπ‘§π‘˜: dist Τ¦ 𝑦, π‘§π‘˜ ≀ 𝑠

  • Return β€œno” if βˆ€π‘§π‘˜: dist Τ¦

𝑦, π‘§π‘˜ > 𝑑𝑠

  • Arbitrary answer otherwise

If we can solve (𝑑, 𝑠)-ANN, then we can solve 𝑑-ANN with little overhead. βˆ€π‘ : ( 𝑑, 𝑠)-ANN can be solved with space 𝑑 and query time 𝑒 𝑑-ANN can be solved with space 𝑃 𝑑 β‹… log𝑑 ΰ΅—

𝐸𝑛𝑏𝑦 πΈπ‘›π‘—π‘œ

and query time 𝑃 𝑒 β‹… log2 log𝑑 ΰ΅—

𝐸𝑛𝑏𝑦 πΈπ‘›π‘—π‘œ

slide-66
SLIDE 66

Setup: metric space (π‘Œ, dist) Data: π‘œ points 𝑧1, 𝑧2, β‹― , π‘§π‘œ ∈ π‘Œ Query: given a point Τ¦ 𝑦 ∈ π‘Œ, 𝒅-ANN (Approximate Nearest Neighbor):

Return a 𝑧𝑗 s.t. dist Τ¦ 𝑦, 𝑧𝑗 ≀ 𝑑 β‹… min

1β‰€π‘˜β‰€π‘œ dist( Τ¦

𝑦, π‘§π‘˜)

(𝒅, 𝒔)-ANN (Approximate Near Neighbor):

  • Return a 𝑧𝑗 s.t. dist Τ¦

𝑦, 𝑧𝑗 ≀ 𝑑𝑠 if βˆƒπ‘§π‘˜: dist Τ¦ 𝑦, π‘§π‘˜ ≀ 𝑠

  • Return β€œno” if βˆ€π‘§π‘˜: dist Τ¦

𝑦, π‘§π‘˜ > 𝑑𝑠

  • Arbitrary answer otherwise

If we can solve (𝑑, 𝑠)-ANN, then we can solve 𝑑-ANN with little overhead. βˆ€π‘ : ( 𝑑, 𝑠)-ANN can be solved with space 𝑑 and query time 𝑒 𝑑-ANN can be solved with space 𝑃 𝑑 β‹… log𝑑 ΰ΅—

𝐸𝑛𝑏𝑦 πΈπ‘›π‘—π‘œ

and query time 𝑃 𝑒 β‹… log2 log𝑑 ΰ΅—

𝐸𝑛𝑏𝑦 πΈπ‘›π‘—π‘œ

slide-67
SLIDE 67

Setup: consider Hamming space 0,1 𝑒 Data: π‘œ points 𝑧1, 𝑧2, β‹― , π‘§π‘œ ∈ 0,1 𝑒 Query: given a point Τ¦ 𝑦 ∈ 0,1 𝑒, (𝒅, 𝒔)-ANN (Approximate Near Neighbor):

  • Return a 𝑧𝑗 s.t. dist Τ¦

𝑦, 𝑧𝑗 ≀ 𝑑𝑠 if βˆƒπ‘§π‘˜: dist Τ¦ 𝑦, π‘§π‘˜ ≀ 𝑠

  • Return β€œno” if βˆ€π‘§π‘˜: dist Τ¦

𝑦, π‘§π‘˜ > 𝑑𝑠

  • Arbitrary answer otherwise

Let 𝑙, π‘ž and 𝑑 to be fixed later. Sample a 𝑙 Γ— 𝑒 Boolean matrix 𝐡 with i.i.d. entries from Bernoulli(π‘ž). For 𝑗 = 1,2, β‹― , π‘œ: let 𝑨𝑗 = 𝐡𝑧𝑗 ∈ 0,1 𝑙 on finite field GF(2). Store all 𝑑-balls 𝐢𝑑 𝑣 = 𝑧𝑗 dist 𝑣, 𝑨𝑗 ≀ 𝑑 for all 𝑣 ∈ 0,1 𝑙. Now, upon a query Τ¦ 𝑦 ∈ 0,1 𝑒: Retrieve 𝐢𝑑(𝐡 Τ¦ 𝑦). If 𝐢𝑑 𝐡 Τ¦ 𝑦 = βˆ… return β€œno”, else return any 𝑧𝑗 ∈ 𝐢𝑑(𝐡 Τ¦ 𝑦). GF(2): two elements {0,1}, XOR as sum, AND as multiplication. Therefore, 𝑨𝑗 π‘˜ = 𝐡𝑧𝑗 π‘˜ = Οƒπ‘š=1

𝑒

π΅π‘˜π‘š β‹… 𝑧𝑗 π‘š mod 2. Space: 𝑃(π‘œ β‹… 2𝑙) Query time: 𝑃(𝑒𝑙) computation + 𝑃(1) memory access

slide-68
SLIDE 68

Setup: consider Hamming space 0,1 𝑒 Data: π‘œ points 𝑧1, 𝑧2, β‹― , π‘§π‘œ ∈ 0,1 𝑒 Query: given a point Τ¦ 𝑦 ∈ 0,1 𝑒, (𝒅, 𝒔)-ANN (Approximate Near Neighbor):

  • Return a 𝑧𝑗 s.t. dist Τ¦

𝑦, 𝑧𝑗 ≀ 𝑑𝑠 if βˆƒπ‘§π‘˜: dist Τ¦ 𝑦, π‘§π‘˜ ≀ 𝑠

  • Return β€œno” if βˆ€π‘§π‘˜: dist Τ¦

𝑦, π‘§π‘˜ > 𝑑𝑠

  • Arbitrary answer otherwise

Let 𝑙, π‘ž and 𝑑 to be fixed later. Sample a 𝑙 Γ— 𝑒 Boolean matrix 𝐡 with i.i.d. entries from Bernoulli(π‘ž). For 𝑗 = 1,2, β‹― , π‘œ: let 𝑨𝑗 = 𝐡𝑧𝑗 ∈ 0,1 𝑙 on finite field GF(2). Store all 𝑑-balls 𝐢𝑑 𝑣 = 𝑧𝑗 dist 𝑣, 𝑨𝑗 ≀ 𝑑 for all 𝑣 ∈ 0,1 𝑙. Now, upon a query Τ¦ 𝑦 ∈ 0,1 𝑒: Retrieve 𝐢𝑑(𝐡 Τ¦ 𝑦). If 𝐢𝑑 𝐡 Τ¦ 𝑦 = βˆ… return β€œno”, else return any 𝑧𝑗 ∈ 𝐢𝑑(𝐡 Τ¦ 𝑦).

slide-69
SLIDE 69

Setup: consider Hamming space 0,1 𝑒 Data: π‘œ points 𝑧1, 𝑧2, β‹― , π‘§π‘œ ∈ 0,1 𝑒 Query: given a point Τ¦ 𝑦 ∈ 0,1 𝑒, (𝒅, 𝒔)-ANN (Approximate Near Neighbor):

  • Return a 𝑧𝑗 s.t. dist Τ¦

𝑦, 𝑧𝑗 ≀ 𝑑𝑠 if βˆƒπ‘§π‘˜: dist Τ¦ 𝑦, π‘§π‘˜ ≀ 𝑠

  • Return β€œno” if βˆ€π‘§π‘˜: dist Τ¦

𝑦, π‘§π‘˜ > 𝑑𝑠

  • Arbitrary answer otherwise

Let 𝑙, π‘ž and 𝑑 to be fixed later. Sample a 𝑙 Γ— 𝑒 Boolean matrix 𝐡 with i.i.d. entries from Bernoulli(π‘ž). For 𝑗 = 1,2, β‹― , π‘œ: let 𝑨𝑗 = 𝐡𝑧𝑗 ∈ 0,1 𝑙 on finite field GF(2). Store all 𝑑-balls 𝐢𝑑 𝑣 = 𝑧𝑗 dist 𝑣, 𝑨𝑗 ≀ 𝑑 for all 𝑣 ∈ 0,1 𝑙. Now, upon a query Τ¦ 𝑦 ∈ 0,1 𝑒: Retrieve 𝐢𝑑(𝐡 Τ¦ 𝑦). If 𝐢𝑑 𝐡 Τ¦ 𝑦 = βˆ… return β€œno”, else return any 𝑧𝑗 ∈ 𝐢𝑑(𝐡 Τ¦ 𝑦). For suitable 𝑙 ∈ 𝑃(log π‘œ), p and s; βˆ€ Τ¦ 𝑦, Τ¦ 𝑧 ∈ 0,1 𝑒:

slide-70
SLIDE 70

Setup: consider Hamming space 0,1 𝑒 Data: π‘œ points 𝑧1, 𝑧2, β‹― , π‘§π‘œ ∈ 0,1 𝑒 Query: given a point Τ¦ 𝑦 ∈ 0,1 𝑒, (𝒅, 𝒔)-ANN (Approximate Near Neighbor):

  • Return a 𝑧𝑗 s.t. dist Τ¦

𝑦, 𝑧𝑗 ≀ 𝑑𝑠 if βˆƒπ‘§π‘˜: dist Τ¦ 𝑦, π‘§π‘˜ ≀ 𝑠

  • Return β€œno” if βˆ€π‘§π‘˜: dist Τ¦

𝑦, π‘§π‘˜ > 𝑑𝑠

  • Arbitrary answer otherwise

Let 𝑙, π‘ž and 𝑑 to be fixed later. Sample a 𝑙 Γ— 𝑒 Boolean matrix 𝐡 with i.i.d. entries from Bernoulli(π‘ž). For 𝑗 = 1,2, β‹― , π‘œ: let 𝑨𝑗 = 𝐡𝑧𝑗 ∈ 0,1 𝑙 on finite field GF(2). Store all 𝑑-balls 𝐢𝑑 𝑣 = 𝑧𝑗 dist 𝑣, 𝑨𝑗 ≀ 𝑑 for all 𝑣 ∈ 0,1 𝑙. Now, upon a query Τ¦ 𝑦 ∈ 0,1 𝑒: Retrieve 𝐢𝑑(𝐡 Τ¦ 𝑦). If 𝐢𝑑 𝐡 Τ¦ 𝑦 = βˆ… return β€œno”, else return any 𝑧𝑗 ∈ 𝐢𝑑(𝐡 Τ¦ 𝑦). For suitable 𝑙 ∈ 𝑃(log π‘œ), p and s; βˆ€ Τ¦ 𝑦, Τ¦ 𝑧 ∈ 0,1 𝑒:

(𝑑, 𝑠)-ANN is solved w.h.p.

slide-71
SLIDE 71

random 𝑙 Γ— 𝑒 Boolean matrix 𝐡 with i.i.d. entries ∈ Bernoulli(π‘ž) computation on GF(2): 𝐡 Τ¦ 𝑦 𝑗 = Οƒπ‘˜=1

𝑒

π΅π‘—π‘˜ β‹… Τ¦ 𝑦 π‘˜ mod 2 for suitable 𝑙 ∈ 𝑃(log π‘œ), p and s; βˆ€ Τ¦ 𝑦, Τ¦ 𝑧 ∈ 0,1 𝑒:

slide-72
SLIDE 72

random 𝑙 Γ— 𝑒 Boolean matrix 𝐡 with i.i.d. entries ∈ Bernoulli(π‘ž) computation on GF(2): 𝐡 Τ¦ 𝑦 𝑗 = Οƒπ‘˜=1

𝑒

π΅π‘—π‘˜ β‹… Τ¦ 𝑦 π‘˜ mod 2 for suitable 𝑙 ∈ 𝑃(log π‘œ), p and s; βˆ€ Τ¦ 𝑦, Τ¦ 𝑧 ∈ 0,1 𝑒: each row vector 𝐡𝑗 of 𝐡 has i.i.d. entries ∈ Bernoulli(π‘ž)

slide-73
SLIDE 73

random 𝑙 Γ— 𝑒 Boolean matrix 𝐡 with i.i.d. entries ∈ Bernoulli(π‘ž) computation on GF(2): 𝐡 Τ¦ 𝑦 𝑗 = Οƒπ‘˜=1

𝑒

π΅π‘—π‘˜ β‹… Τ¦ 𝑦 π‘˜ mod 2 for suitable 𝑙 ∈ 𝑃(log π‘œ), p and s; βˆ€ Τ¦ 𝑦, Τ¦ 𝑧 ∈ 0,1 𝑒: each row vector 𝐡𝑗 of 𝐡 has i.i.d. entries ∈ Bernoulli(π‘ž)

slide-74
SLIDE 74

random 𝑙 Γ— 𝑒 Boolean matrix 𝐡 with i.i.d. entries ∈ Bernoulli(π‘ž) computation on GF(2): 𝐡 Τ¦ 𝑦 𝑗 = Οƒπ‘˜=1

𝑒

π΅π‘—π‘˜ β‹… Τ¦ 𝑦 π‘˜ mod 2 for suitable 𝑙 ∈ 𝑃(log π‘œ), p and s; βˆ€ Τ¦ 𝑦, Τ¦ 𝑧 ∈ 0,1 𝑒: each row vector 𝐡𝑗 of 𝐡 has i.i.d. entries ∈ Bernoulli(π‘ž)

an alternative view regarding the generation of 𝐡𝑗:

  • build 𝐷 βŠ† [𝑒] s.t. each element in [𝑒] is chosen independently with pr. 2π‘ž
  • each coordinate in 𝐷 is independently set to 0 or 1 each with pr. 1/2
slide-75
SLIDE 75

random 𝑙 Γ— 𝑒 Boolean matrix 𝐡 with i.i.d. entries ∈ Bernoulli(π‘ž) computation on GF(2): 𝐡 Τ¦ 𝑦 𝑗 = Οƒπ‘˜=1

𝑒

π΅π‘—π‘˜ β‹… Τ¦ 𝑦 π‘˜ mod 2 for suitable 𝑙 ∈ 𝑃(log π‘œ), p and s; βˆ€ Τ¦ 𝑦, Τ¦ 𝑧 ∈ 0,1 𝑒: each row vector 𝐡𝑗 of 𝐡 has i.i.d. entries ∈ Bernoulli(π‘ž)

an alternative view regarding the generation of 𝐡𝑗:

  • build 𝐷 βŠ† [𝑒] s.t. each element in [𝑒] is chosen independently with pr. 2π‘ž
  • each coordinate in 𝐷 is independently set to 0 or 1 each with pr. 1/2
  • bservations:
  • if π‘˜ βˆ‰ 𝐷 for all coordinates π‘˜ where Τ¦

𝑦 π‘˜ β‰  Τ¦ 𝑧 π‘˜, then 𝐡 Τ¦ 𝑦 𝑗 = 𝐡 Τ¦ 𝑧 𝑗

  • otherwise, if exists such π‘˜ ∈ 𝐷, then once all other entries in 𝐡𝑗 are fixed,

exactly one of the two choices for π΅π‘—π‘˜ will make 𝐡 Τ¦ 𝑦 𝑗 = 𝐡 Τ¦ 𝑧 𝑗

slide-76
SLIDE 76

choose π‘ž to satisfy 1 βˆ’ 2π‘ž = 2βˆ’1/𝑠 random 𝑙 Γ— 𝑒 Boolean matrix 𝐡 with i.i.d. entries ∈ Bernoulli(π‘ž) computation on GF(2): 𝐡 Τ¦ 𝑦 𝑗 = Οƒπ‘˜=1

𝑒

π΅π‘—π‘˜ β‹… Τ¦ 𝑦 π‘˜ mod 2 for suitable 𝑙 ∈ 𝑃(log π‘œ), p and s; βˆ€ Τ¦ 𝑦, Τ¦ 𝑧 ∈ 0,1 𝑒: each row vector 𝐡𝑗 of 𝐡 has i.i.d. entries ∈ Bernoulli(π‘ž)

slide-77
SLIDE 77

random 𝑙 Γ— 𝑒 Boolean matrix 𝐡 with i.i.d. entries ∈ Bernoulli(π‘ž) computation on GF(2): 𝐡 Τ¦ 𝑦 𝑗 = Οƒπ‘˜=1

𝑒

π΅π‘—π‘˜ β‹… Τ¦ 𝑦 π‘˜ mod 2 for suitable 𝑙 ∈ 𝑃(log π‘œ), p and s; βˆ€ Τ¦ 𝑦, Τ¦ 𝑧 ∈ 0,1 𝑒: choose π‘ž to satisfy 1 βˆ’ 2π‘ž = 2βˆ’1/𝑠

slide-78
SLIDE 78

random 𝑙 Γ— 𝑒 Boolean matrix 𝐡 with i.i.d. entries ∈ Bernoulli(π‘ž) computation on GF(2): 𝐡 Τ¦ 𝑦 𝑗 = Οƒπ‘˜=1

𝑒

π΅π‘—π‘˜ β‹… Τ¦ 𝑦 π‘˜ mod 2 for suitable 𝑙 ∈ 𝑃(log π‘œ), p and s; βˆ€ Τ¦ 𝑦, Τ¦ 𝑧 ∈ 0,1 𝑒: choose π‘ž to satisfy 1 βˆ’ 2π‘ž = 2βˆ’1/𝑠

dist 𝐡 Τ¦ 𝑦, 𝐡 Τ¦ 𝑧 = π‘Œ = σ𝑗=1

𝑙

π‘Œπ‘— where π‘Œπ‘— = α‰Š1 if 𝐡 Τ¦ 𝑦 𝑗 β‰  𝐡 Τ¦ 𝑧 𝑗

  • therwise
slide-79
SLIDE 79

random 𝑙 Γ— 𝑒 Boolean matrix 𝐡 with i.i.d. entries ∈ Bernoulli(π‘ž) computation on GF(2): 𝐡 Τ¦ 𝑦 𝑗 = Οƒπ‘˜=1

𝑒

π΅π‘—π‘˜ β‹… Τ¦ 𝑦 π‘˜ mod 2 for suitable 𝑙 ∈ 𝑃(log π‘œ), p and s; βˆ€ Τ¦ 𝑦, Τ¦ 𝑧 ∈ 0,1 𝑒: choose π‘ž to satisfy 1 βˆ’ 2π‘ž = 2βˆ’1/𝑠

dist 𝐡 Τ¦ 𝑦, 𝐡 Τ¦ 𝑧 = π‘Œ = σ𝑗=1

𝑙

π‘Œπ‘— where π‘Œπ‘— = α‰Š1 if 𝐡 Τ¦ 𝑦 𝑗 β‰  𝐡 Τ¦ 𝑧 𝑗

  • therwise
slide-80
SLIDE 80

random 𝑙 Γ— 𝑒 Boolean matrix 𝐡 with i.i.d. entries ∈ Bernoulli(π‘ž) computation on GF(2): 𝐡 Τ¦ 𝑦 𝑗 = Οƒπ‘˜=1

𝑒

π΅π‘—π‘˜ β‹… Τ¦ 𝑦 π‘˜ mod 2 for suitable 𝑙 ∈ 𝑃(log π‘œ), p and s; βˆ€ Τ¦ 𝑦, Τ¦ 𝑧 ∈ 0,1 𝑒: choose π‘ž to satisfy 1 βˆ’ 2π‘ž = 2βˆ’1/𝑠

dist 𝐡 Τ¦ 𝑦, 𝐡 Τ¦ 𝑧 = π‘Œ = σ𝑗=1

𝑙

π‘Œπ‘— where π‘Œπ‘— = α‰Š1 if 𝐡 Τ¦ 𝑦 𝑗 β‰  𝐡 Τ¦ 𝑧 𝑗

  • therwise

choose 𝑑 =

1 4+1 2βˆ’2βˆ’ 𝑑+1

𝑙 2

=

3 8 βˆ’ 2βˆ’(𝑑+2) 𝑙

slide-81
SLIDE 81

random 𝑙 Γ— 𝑒 Boolean matrix 𝐡 with i.i.d. entries ∈ Bernoulli(π‘ž) computation on GF(2): 𝐡 Τ¦ 𝑦 𝑗 = Οƒπ‘˜=1

𝑒

π΅π‘—π‘˜ β‹… Τ¦ 𝑦 π‘˜ mod 2 for suitable 𝑙 ∈ 𝑃(log π‘œ), p and s; βˆ€ Τ¦ 𝑦, Τ¦ 𝑧 ∈ 0,1 𝑒: choose π‘ž to satisfy 1 βˆ’ 2π‘ž = 2βˆ’1/𝑠

dist 𝐡 Τ¦ 𝑦, 𝐡 Τ¦ 𝑧 = π‘Œ = σ𝑗=1

𝑙

π‘Œπ‘— where π‘Œπ‘— = α‰Š1 if 𝐡 Τ¦ 𝑦 𝑗 β‰  𝐡 Τ¦ 𝑧 𝑗

  • therwise

choose 𝑑 =

1 4+1 2βˆ’2βˆ’ 𝑑+1

𝑙 2

=

3 8 βˆ’ 2βˆ’(𝑑+2) 𝑙

slide-82
SLIDE 82

random 𝑙 Γ— 𝑒 Boolean matrix 𝐡 with i.i.d. entries ∈ Bernoulli(π‘ž) computation on GF(2): 𝐡 Τ¦ 𝑦 𝑗 = Οƒπ‘˜=1

𝑒

π΅π‘—π‘˜ β‹… Τ¦ 𝑦 π‘˜ mod 2 for suitable 𝑙 ∈ 𝑃(log π‘œ), p and s; βˆ€ Τ¦ 𝑦, Τ¦ 𝑧 ∈ 0,1 𝑒: choose π‘ž to satisfy 1 βˆ’ 2π‘ž = 2βˆ’1/𝑠

dist 𝐡 Τ¦ 𝑦, 𝐡 Τ¦ 𝑧 = π‘Œ = σ𝑗=1

𝑙

π‘Œπ‘— where π‘Œπ‘— = α‰Š1 if 𝐡 Τ¦ 𝑦 𝑗 β‰  𝐡 Τ¦ 𝑧 𝑗

  • therwise

choose 𝑑 =

1 4+1 2βˆ’2βˆ’ 𝑑+1

𝑙 2

=

3 8 βˆ’ 2βˆ’(𝑑+2) 𝑙

independent

slide-83
SLIDE 83

random 𝑙 Γ— 𝑒 Boolean matrix 𝐡 with i.i.d. entries ∈ Bernoulli(π‘ž) computation on GF(2): 𝐡 Τ¦ 𝑦 𝑗 = Οƒπ‘˜=1

𝑒

π΅π‘—π‘˜ β‹… Τ¦ 𝑦 π‘˜ mod 2 for suitable 𝑙 ∈ 𝑃(log π‘œ), p and s; βˆ€ Τ¦ 𝑦, Τ¦ 𝑧 ∈ 0,1 𝑒: choose π‘ž to satisfy 1 βˆ’ 2π‘ž = 2βˆ’1/𝑠

dist 𝐡 Τ¦ 𝑦, 𝐡 Τ¦ 𝑧 = π‘Œ = σ𝑗=1

𝑙

π‘Œπ‘— where π‘Œπ‘— = α‰Š1 if 𝐡 Τ¦ 𝑦 𝑗 β‰  𝐡 Τ¦ 𝑧 𝑗

  • therwise

choose 𝑑 =

1 4+1 2βˆ’2βˆ’ 𝑑+1

𝑙 2

=

3 8 βˆ’ 2βˆ’(𝑑+2) 𝑙

independent

Chernoff bound: Let independent r.v. π‘Œ1, π‘Œ2, β‹― , π‘Œπ‘™ ∈ {0,1}, let π‘Œ = σ𝑗=1

𝑙

π‘Œπ‘—, then for 𝑑 > 0: Pr π‘Œ β‰₯ 𝔽 π‘Œ + 𝑑 ≀ exp βˆ’ 2𝑑2 𝑙 Pr π‘Œ ≀ 𝔽 π‘Œ βˆ’ 𝑑 ≀ exp βˆ’ 2𝑑2 𝑙

slide-84
SLIDE 84

random 𝑙 Γ— 𝑒 Boolean matrix 𝐡 with i.i.d. entries ∈ Bernoulli(π‘ž) computation on GF(2): 𝐡 Τ¦ 𝑦 𝑗 = Οƒπ‘˜=1

𝑒

π΅π‘—π‘˜ β‹… Τ¦ 𝑦 π‘˜ mod 2 for suitable 𝑙 ∈ 𝑃(log π‘œ), p and s; βˆ€ Τ¦ 𝑦, Τ¦ 𝑧 ∈ 0,1 𝑒: choose π‘ž to satisfy 1 βˆ’ 2π‘ž = 2βˆ’1/𝑠

dist 𝐡 Τ¦ 𝑦, 𝐡 Τ¦ 𝑧 = π‘Œ = σ𝑗=1

𝑙

π‘Œπ‘— where π‘Œπ‘— = α‰Š1 if 𝐡 Τ¦ 𝑦 𝑗 β‰  𝐡 Τ¦ 𝑧 𝑗

  • therwise

choose 𝑑 =

1 4+1 2βˆ’2βˆ’ 𝑑+1

𝑙 2

=

3 8 βˆ’ 2βˆ’(𝑑+2) 𝑙

independent

Chernoff bound: Let independent r.v. π‘Œ1, π‘Œ2, β‹― , π‘Œπ‘™ ∈ {0,1}, let π‘Œ = σ𝑗=1

𝑙

π‘Œπ‘—, then for 𝑑 > 0: Pr π‘Œ β‰₯ 𝔽 π‘Œ + 𝑑 ≀ exp βˆ’ 2𝑑2 𝑙 Pr π‘Œ ≀ 𝔽 π‘Œ βˆ’ 𝑑 ≀ exp βˆ’ 2𝑑2 𝑙

slide-85
SLIDE 85

random 𝑙 Γ— 𝑒 Boolean matrix 𝐡 with i.i.d. entries ∈ Bernoulli(π‘ž) computation on GF(2): 𝐡 Τ¦ 𝑦 𝑗 = Οƒπ‘˜=1

𝑒

π΅π‘—π‘˜ β‹… Τ¦ 𝑦 π‘˜ mod 2 for suitable 𝑙 ∈ 𝑃(log π‘œ), p and s; βˆ€ Τ¦ 𝑦, Τ¦ 𝑧 ∈ 0,1 𝑒: choose π‘ž to satisfy 1 βˆ’ 2π‘ž = 2βˆ’1/𝑠

dist 𝐡 Τ¦ 𝑦, 𝐡 Τ¦ 𝑧 = π‘Œ = σ𝑗=1

𝑙

π‘Œπ‘— where π‘Œπ‘— = α‰Š1 if 𝐡 Τ¦ 𝑦 𝑗 β‰  𝐡 Τ¦ 𝑧 𝑗

  • therwise

choose 𝑑 =

1 4+1 2βˆ’2βˆ’ 𝑑+1

𝑙 2

=

3 8 βˆ’ 2βˆ’(𝑑+2) 𝑙

independent

slide-86
SLIDE 86

Setup: consider Hamming space 0,1 𝑒 Data: π‘œ points 𝑧1, 𝑧2, β‹― , π‘§π‘œ ∈ 0,1 𝑒 Query: given a point Τ¦ 𝑦 ∈ 0,1 𝑒, (𝒅, 𝒔)-ANN (Approximate Near Neighbor):

  • Return a 𝑧𝑗 s.t. dist Τ¦

𝑦, 𝑧𝑗 ≀ 𝑑𝑠 if βˆƒπ‘§π‘˜: dist Τ¦ 𝑦, π‘§π‘˜ ≀ 𝑠

  • Return β€œno” if βˆ€π‘§π‘˜: dist Τ¦

𝑦, π‘§π‘˜ > 𝑑𝑠

  • Arbitrary answer otherwise

Let 𝑙 =

ln π‘œ Ξ€ 1 8βˆ’2βˆ’(𝑑+2), π‘ž =

Ξ€ 1 βˆ’ 2βˆ’1/𝑠 2 and 𝑑 = Ξ€ 3 8 βˆ’ 2βˆ’(𝑑+2) 𝑙. Sample a 𝑙 Γ— 𝑒 Boolean matrix 𝐡 with i.i.d. entries from Bernoulli(π‘ž). For 𝑗 = 1,2, β‹― , π‘œ: let 𝑨𝑗 = 𝐡𝑧𝑗 ∈ 0,1 𝑙 on finite field GF(2). Store all 𝑑-balls 𝐢𝑑 𝑣 = 𝑧𝑗 dist 𝑣, 𝑨𝑗 ≀ 𝑑 for all 𝑣 ∈ 0,1 𝑙. Now, upon a query Τ¦ 𝑦 ∈ 0,1 𝑒: Retrieve 𝐢𝑑(𝐡 Τ¦ 𝑦). If 𝐢𝑑 𝐡 Τ¦ 𝑦 = βˆ… return β€œno”, else return any 𝑧𝑗 ∈ 𝐢𝑑(𝐡 Τ¦ 𝑦). Space: 𝑃(π‘œ β‹… 2𝑙) Query time: 𝑃(𝑒𝑙) computation + 𝑃(1) memory access

slide-87
SLIDE 87

Setup: consider Hamming space 0,1 𝑒 Data: π‘œ points 𝑧1, 𝑧2, β‹― , π‘§π‘œ ∈ 0,1 𝑒 Query: given a point Τ¦ 𝑦 ∈ 0,1 𝑒, (𝒅, 𝒔)-ANN (Approximate Near Neighbor):

  • Return a 𝑧𝑗 s.t. dist Τ¦

𝑦, 𝑧𝑗 ≀ 𝑑𝑠 if βˆƒπ‘§π‘˜: dist Τ¦ 𝑦, π‘§π‘˜ ≀ 𝑠

  • Return β€œno” if βˆ€π‘§π‘˜: dist Τ¦

𝑦, π‘§π‘˜ > 𝑑𝑠

  • Arbitrary answer otherwise

Let 𝑙 =

ln π‘œ Ξ€ 1 8βˆ’2βˆ’(𝑑+2), π‘ž =

Ξ€ 1 βˆ’ 2βˆ’1/𝑠 2 and 𝑑 = Ξ€ 3 8 βˆ’ 2βˆ’(𝑑+2) 𝑙. Sample a 𝑙 Γ— 𝑒 Boolean matrix 𝐡 with i.i.d. entries from Bernoulli(π‘ž). For 𝑗 = 1,2, β‹― , π‘œ: let 𝑨𝑗 = 𝐡𝑧𝑗 ∈ 0,1 𝑙 on finite field GF(2). Store all 𝑑-balls 𝐢𝑑 𝑣 = 𝑧𝑗 dist 𝑣, 𝑨𝑗 ≀ 𝑑 for all 𝑣 ∈ 0,1 𝑙. Now, upon a query Τ¦ 𝑦 ∈ 0,1 𝑒: Retrieve 𝐢𝑑(𝐡 Τ¦ 𝑦). If 𝐢𝑑 𝐡 Τ¦ 𝑦 = βˆ… return β€œno”, else return any 𝑧𝑗 ∈ 𝐢𝑑(𝐡 Τ¦ 𝑦). Space: 𝑃(π‘œ β‹… 2𝑙) Query time: 𝑃(𝑒𝑙) computation + 𝑃(1) memory access Space: π‘œπ‘ƒ(1) Query time: 𝑃(𝑒 log π‘œ)

Solve (𝑑, 𝑠)-ANN w.h.p.

slide-88
SLIDE 88

Locality-Sensitive Hashing (LSH)

Given a metric space π‘Œ, dist , a random β„Ž: π‘Œ β†’ 𝑉 drawn from β„‹ is an (𝑠, 𝑑𝑠, π‘ž, π‘Ÿ)-LSH if, for all Τ¦ 𝑦, Τ¦ 𝑧 ∈ π‘Œ:

slide-89
SLIDE 89

Locality-Sensitive Hashing (LSH)

Given a metric space π‘Œ, dist , a random β„Ž: π‘Œ β†’ 𝑉 drawn from β„‹ is an (𝑠, 𝑑𝑠, π‘ž, π‘Ÿ)-LSH if, for all Τ¦ 𝑦, Τ¦ 𝑧 ∈ π‘Œ: π‘ž > π‘Ÿ

slide-90
SLIDE 90

Locality-Sensitive Hashing (LSH)

Given a metric space π‘Œ, dist , a random β„Ž: π‘Œ β†’ 𝑉 drawn from β„‹ is an (𝑠, 𝑑𝑠, π‘ž, π‘Ÿ)-LSH if, for all Τ¦ 𝑦, Τ¦ 𝑧 ∈ π‘Œ: If there exists an (𝑠, 𝑑𝑠, π‘ž, π‘Ÿ)-LSH β„Ž: π‘Œ β†’ 𝑉, then there exists an (𝑠, 𝑑𝑠, π‘žπ‘™, π‘Ÿπ‘™)-LSH 𝑕: π‘Œ β†’ 𝑉𝑙

slide-91
SLIDE 91

Locality-Sensitive Hashing (LSH)

Given a metric space π‘Œ, dist , a random β„Ž: π‘Œ β†’ 𝑉 drawn from β„‹ is an (𝑠, 𝑑𝑠, π‘ž, π‘Ÿ)-LSH if, for all Τ¦ 𝑦, Τ¦ 𝑧 ∈ π‘Œ: If there exists an (𝑠, 𝑑𝑠, π‘ž, π‘Ÿ)-LSH β„Ž: π‘Œ β†’ 𝑉, then there exists an (𝑠, 𝑑𝑠, π‘žπ‘™, π‘Ÿπ‘™)-LSH 𝑕: π‘Œ β†’ 𝑉𝑙

Independently draw β„Ž1, β„Ž2, β‹― , β„Žπ‘™ according to the distribution of β„Ž 𝑕 𝑦 = β„Ž1 𝑦 , β„Ž2 𝑦 , β‹― , β„Žπ‘™ 𝑦 ∈ 𝑉𝑙

slide-92
SLIDE 92

Setup: metric space (π‘Œ, dist) Data: π‘œ points 𝑧1, 𝑧2, β‹― , π‘§π‘œ ∈ π‘Œ Query: given a point Τ¦ 𝑦 ∈ π‘Œ:

  • Return a 𝑧𝑗 s.t. dist Τ¦

𝑦, 𝑧𝑗 ≀ 𝑑𝑠 if βˆƒπ‘§π‘˜: dist Τ¦ 𝑦, π‘§π‘˜ ≀ 𝑠

  • Return β€œno” if βˆ€π‘§π‘˜: dist Τ¦

𝑦, π‘§π‘˜ > 𝑑𝑠

  • Arbitrary answer otherwise

(𝒅, 𝒔)-ANN

Suppose we have (𝑠, 𝑑𝑠, π‘žβˆ—, Ξ€ 1 π‘œ)-LSH 𝑕: π‘Œ β†’ 𝑉 βˆ€ Τ¦ 𝑦, Τ¦ 𝑧 ∈ π‘Œ:

slide-93
SLIDE 93

Setup: metric space (π‘Œ, dist) Data: π‘œ points 𝑧1, 𝑧2, β‹― , π‘§π‘œ ∈ π‘Œ Query: given a point Τ¦ 𝑦 ∈ π‘Œ:

  • Return a 𝑧𝑗 s.t. dist Τ¦

𝑦, 𝑧𝑗 ≀ 𝑑𝑠 if βˆƒπ‘§π‘˜: dist Τ¦ 𝑦, π‘§π‘˜ ≀ 𝑠

  • Return β€œno” if βˆ€π‘§π‘˜: dist Τ¦

𝑦, π‘§π‘˜ > 𝑑𝑠

  • Arbitrary answer otherwise

(𝒅, 𝒔)-ANN

Suppose we have (𝑠, 𝑑𝑠, π‘žβˆ—, Ξ€ 1 π‘œ)-LSH 𝑕: π‘Œ β†’ 𝑉 βˆ€ Τ¦ 𝑦, Τ¦ 𝑧 ∈ π‘Œ: Store 𝑧1, 𝑧2, β‹― , π‘§π‘œ in nondecreasing order of 𝑕(𝑧𝑗). Upon query Τ¦ 𝑦 ∈ π‘Œ: Find all 𝑧𝑗 such that 𝑕 Τ¦ 𝑦 = 𝑕(𝑧𝑗) by binary search. If encounter some 𝑧𝑗 such that dist Τ¦ 𝑦, 𝑧𝑗 ≀ 𝑑𝑠 then return this 𝑧𝑗;

  • therwise return β€œno”.
slide-94
SLIDE 94

Setup: metric space (π‘Œ, dist) Data: π‘œ points 𝑧1, 𝑧2, β‹― , π‘§π‘œ ∈ π‘Œ Query: given a point Τ¦ 𝑦 ∈ π‘Œ:

  • Return a 𝑧𝑗 s.t. dist Τ¦

𝑦, 𝑧𝑗 ≀ 𝑑𝑠 if βˆƒπ‘§π‘˜: dist Τ¦ 𝑦, π‘§π‘˜ ≀ 𝑠

  • Return β€œno” if βˆ€π‘§π‘˜: dist Τ¦

𝑦, π‘§π‘˜ > 𝑑𝑠

  • Arbitrary answer otherwise

(𝒅, 𝒔)-ANN

Suppose we have (𝑠, 𝑑𝑠, π‘žβˆ—, Ξ€ 1 π‘œ)-LSH 𝑕: π‘Œ β†’ 𝑉 βˆ€ Τ¦ 𝑦, Τ¦ 𝑧 ∈ π‘Œ: Store 𝑧1, 𝑧2, β‹― , π‘§π‘œ in nondecreasing order of 𝑕(𝑧𝑗). Upon query Τ¦ 𝑦 ∈ π‘Œ: Find all 𝑧𝑗 such that 𝑕 Τ¦ 𝑦 = 𝑕(𝑧𝑗) by binary search. If encounter some 𝑧𝑗 such that dist Τ¦ 𝑦, 𝑧𝑗 ≀ 𝑑𝑠 then return this 𝑧𝑗;

  • therwise return β€œno”.

If the real answer is β€œno”: always correct If the real answer is β€œyes”: correct with probability at least π‘žβˆ—

slide-95
SLIDE 95

Setup: metric space (π‘Œ, dist) Data: π‘œ points 𝑧1, 𝑧2, β‹― , π‘§π‘œ ∈ π‘Œ Query: given a point Τ¦ 𝑦 ∈ π‘Œ:

  • Return a 𝑧𝑗 s.t. dist Τ¦

𝑦, 𝑧𝑗 ≀ 𝑑𝑠 if βˆƒπ‘§π‘˜: dist Τ¦ 𝑦, π‘§π‘˜ ≀ 𝑠

  • Return β€œno” if βˆ€π‘§π‘˜: dist Τ¦

𝑦, π‘§π‘˜ > 𝑑𝑠

  • Arbitrary answer otherwise

(𝒅, 𝒔)-ANN

Suppose we have (𝑠, 𝑑𝑠, π‘žβˆ—, Ξ€ 1 π‘œ)-LSH 𝑕: π‘Œ β†’ 𝑉 βˆ€ Τ¦ 𝑦, Τ¦ 𝑧 ∈ π‘Œ: Store 𝑧1, 𝑧2, β‹― , π‘§π‘œ in nondecreasing order of 𝑕(𝑧𝑗). Upon query Τ¦ 𝑦 ∈ π‘Œ: Find all 𝑧𝑗 such that 𝑕 Τ¦ 𝑦 = 𝑕(𝑧𝑗) by binary search. If encounter some 𝑧𝑗 such that dist Τ¦ 𝑦, 𝑧𝑗 ≀ 𝑑𝑠 then return this 𝑧𝑗;

  • therwise return β€œno”.

If the real answer is β€œno”: always correct If the real answer is β€œyes”: correct with probability at least π‘žβˆ— Space: 𝑃(π‘œ) Time: 𝑃(log π‘œ)

slide-96
SLIDE 96

Setup: metric space (π‘Œ, dist) Data: π‘œ points 𝑧1, 𝑧2, β‹― , π‘§π‘œ ∈ π‘Œ Query: given a point Τ¦ 𝑦 ∈ π‘Œ:

  • Return a 𝑧𝑗 s.t. dist Τ¦

𝑦, 𝑧𝑗 ≀ 𝑑𝑠 if βˆƒπ‘§π‘˜: dist Τ¦ 𝑦, π‘§π‘˜ ≀ 𝑠

  • Return β€œno” if βˆ€π‘§π‘˜: dist Τ¦

𝑦, π‘§π‘˜ > 𝑑𝑠

  • Arbitrary answer otherwise

(𝒅, 𝒔)-ANN

Suppose we have (𝑠, 𝑑𝑠, π‘žβˆ—, Ξ€ 1 π‘œ)-LSH 𝑕: π‘Œ β†’ 𝑉 βˆ€ Τ¦ 𝑦, Τ¦ 𝑧 ∈ π‘Œ: Store 𝑧1, 𝑧2, β‹― , π‘§π‘œ in nondecreasing order of 𝑕(𝑧𝑗). Upon query Τ¦ 𝑦 ∈ π‘Œ: Find all 𝑧𝑗 such that 𝑕 Τ¦ 𝑦 = 𝑕(𝑧𝑗) by binary search. If encounter some 𝑧𝑗 such that dist Τ¦ 𝑦, 𝑧𝑗 ≀ 𝑑𝑠 then return this 𝑧𝑗;

  • therwise return β€œno”.

If the real answer is β€œno”: always correct If the real answer is β€œyes”: correct with probability at least π‘žβˆ— Space: 𝑃(π‘œ) Time: 𝑃(log π‘œ) + 𝑃(1) in expectation

slide-97
SLIDE 97

Setup: metric space (π‘Œ, dist) Data: π‘œ points 𝑧1, 𝑧2, β‹― , π‘§π‘œ ∈ π‘Œ Query: given a point Τ¦ 𝑦 ∈ π‘Œ:

  • Return a 𝑧𝑗 s.t. dist Τ¦

𝑦, 𝑧𝑗 ≀ 𝑑𝑠 if βˆƒπ‘§π‘˜: dist Τ¦ 𝑦, π‘§π‘˜ ≀ 𝑠

  • Return β€œno” if βˆ€π‘§π‘˜: dist Τ¦

𝑦, π‘§π‘˜ > 𝑑𝑠

  • Arbitrary answer otherwise

Suppose we have (𝑑, 𝑑𝑠, π‘žβˆ—, Ξ€ 1 π‘œ)-LSH 𝑕: π‘Œ β†’ 𝑉 βˆ€ Τ¦ 𝑦, Τ¦ 𝑧 ∈ π‘Œ: Let π‘š = Ξ€ 1 π‘žβˆ—, independently draw 𝑕1, 𝑕2, β‹― , π‘•π‘š. Maintain π’Ž sorted tables: For π‘˜ = 1,2, β‹― , π‘š: Store 𝑧1, 𝑧2, β‹― , π‘§π‘œ in table-π‘˜ in nondecreasing order of π‘•π‘˜(𝑧𝑗). Upon query π’š ∈ 𝒀: Find first 10 β‹… π‘š such 𝑧𝑗 that βˆƒπ‘˜: π‘•π‘˜ Τ¦ 𝑦 = π‘•π‘˜(𝑧𝑗) by binary search. If encounter some 𝑧𝑗 such that dist Τ¦ 𝑦, 𝑧𝑗 ≀ 𝑑𝑠 then return this 𝑧𝑗;

  • therwise return β€œno”.

(𝒅, 𝒔)-ANN

slide-98
SLIDE 98

Let π‘š = Ξ€ 1 π‘žβˆ—, independently draw 𝑕1, 𝑕2, β‹― , π‘•π‘š. Maintain π’Ž sorted tables: For π‘˜ = 1,2, β‹― , π‘š: Store 𝑧1, 𝑧2, β‹― , π‘§π‘œ in table-π‘˜ in nondecreasing order of π‘•π‘˜(𝑧𝑗). Upon query π’š ∈ 𝒀: Find first 10 β‹… π‘š such 𝑧𝑗 that βˆƒπ‘˜: π‘•π‘˜ Τ¦ 𝑦 = π‘•π‘˜(𝑧𝑗) by binary search. If encounter some 𝑧𝑗 such that dist Τ¦ 𝑦, 𝑧𝑗 ≀ 𝑑𝑠 then return this 𝑧𝑗;

  • therwise return β€œno”.

(𝑑, 𝑠)-ANN in metric space (π‘Œ, dist) (𝑑, 𝑑𝑠, π‘žβˆ—, Ξ€ 1 π‘œ)-LSH 𝑕: π‘Œ β†’ 𝑉 Data: π‘œ points 𝑧1, 𝑧2, β‹― , π‘§π‘œ ∈ π‘Œ Query: some point Τ¦ 𝑦 ∈ π‘Œ

slide-99
SLIDE 99

Let π‘š = Ξ€ 1 π‘žβˆ—, independently draw 𝑕1, 𝑕2, β‹― , π‘•π‘š. Maintain π’Ž sorted tables: For π‘˜ = 1,2, β‹― , π‘š: Store 𝑧1, 𝑧2, β‹― , π‘§π‘œ in table-π‘˜ in nondecreasing order of π‘•π‘˜(𝑧𝑗). Upon query π’š ∈ 𝒀: Find first 10 β‹… π‘š such 𝑧𝑗 that βˆƒπ‘˜: π‘•π‘˜ Τ¦ 𝑦 = π‘•π‘˜(𝑧𝑗) by binary search. If encounter some 𝑧𝑗 such that dist Τ¦ 𝑦, 𝑧𝑗 ≀ 𝑑𝑠 then return this 𝑧𝑗;

  • therwise return β€œno”.

(𝑑, 𝑠)-ANN in metric space (π‘Œ, dist) (𝑑, 𝑑𝑠, π‘žβˆ—, Ξ€ 1 π‘œ)-LSH 𝑕: π‘Œ β†’ 𝑉 Data: π‘œ points 𝑧1, 𝑧2, β‹― , π‘§π‘œ ∈ π‘Œ Query: some point Τ¦ 𝑦 ∈ π‘Œ If the real answer is β€œno”: always correct.

slide-100
SLIDE 100

Let π‘š = Ξ€ 1 π‘žβˆ—, independently draw 𝑕1, 𝑕2, β‹― , π‘•π‘š. Maintain π’Ž sorted tables: For π‘˜ = 1,2, β‹― , π‘š: Store 𝑧1, 𝑧2, β‹― , π‘§π‘œ in table-π‘˜ in nondecreasing order of π‘•π‘˜(𝑧𝑗). Upon query π’š ∈ 𝒀: Find first 10 β‹… π‘š such 𝑧𝑗 that βˆƒπ‘˜: π‘•π‘˜ Τ¦ 𝑦 = π‘•π‘˜(𝑧𝑗) by binary search. If encounter some 𝑧𝑗 such that dist Τ¦ 𝑦, 𝑧𝑗 ≀ 𝑑𝑠 then return this 𝑧𝑗;

  • therwise return β€œno”.

(𝑑, 𝑠)-ANN in metric space (π‘Œ, dist) (𝑑, 𝑑𝑠, π‘žβˆ—, Ξ€ 1 π‘œ)-LSH 𝑕: π‘Œ β†’ 𝑉 Data: π‘œ points 𝑧1, 𝑧2, β‹― , π‘§π‘œ ∈ π‘Œ Query: some point Τ¦ 𝑦 ∈ π‘Œ If the real answer is β€œno”: always correct. If exists 𝑧𝑑 such that dist Τ¦ 𝑦, 𝑧𝑑 ≀ 𝑠, then Pr answer "no" ≀

slide-101
SLIDE 101

Let π‘š = Ξ€ 1 π‘žβˆ—, independently draw 𝑕1, 𝑕2, β‹― , π‘•π‘š. Maintain π’Ž sorted tables: For π‘˜ = 1,2, β‹― , π‘š: Store 𝑧1, 𝑧2, β‹― , π‘§π‘œ in table-π‘˜ in nondecreasing order of π‘•π‘˜(𝑧𝑗). Upon query π’š ∈ 𝒀: Find first 10 β‹… π‘š such 𝑧𝑗 that βˆƒπ‘˜: π‘•π‘˜ Τ¦ 𝑦 = π‘•π‘˜(𝑧𝑗) by binary search. If encounter some 𝑧𝑗 such that dist Τ¦ 𝑦, 𝑧𝑗 ≀ 𝑑𝑠 then return this 𝑧𝑗;

  • therwise return β€œno”.

(𝑑, 𝑠)-ANN in metric space (π‘Œ, dist) (𝑑, 𝑑𝑠, π‘žβˆ—, Ξ€ 1 π‘œ)-LSH 𝑕: π‘Œ β†’ 𝑉 Data: π‘œ points 𝑧1, 𝑧2, β‹― , π‘§π‘œ ∈ π‘Œ Query: some point Τ¦ 𝑦 ∈ π‘Œ If the real answer is β€œno”: always correct. If exists 𝑧𝑑 such that dist Τ¦ 𝑦, 𝑧𝑑 ≀ 𝑠, then Pr answer "no" ≀ Pr[βˆ€π‘˜, π‘•π‘˜ Τ¦ 𝑦 β‰  π‘•π‘˜ 𝑧𝑑 ] + Pr[exist 10π‘š bad 𝑧𝑗 that dist Τ¦ 𝑦, 𝑧𝑗 > 𝑑𝑠 yet βˆƒπ‘˜ s.t. π‘•π‘˜ Τ¦ 𝑦 = π‘•π‘˜(𝑧𝑗)]

slide-102
SLIDE 102

Let π‘š = Ξ€ 1 π‘žβˆ—, independently draw 𝑕1, 𝑕2, β‹― , π‘•π‘š. Maintain π’Ž sorted tables: For π‘˜ = 1,2, β‹― , π‘š: Store 𝑧1, 𝑧2, β‹― , π‘§π‘œ in table-π‘˜ in nondecreasing order of π‘•π‘˜(𝑧𝑗). Upon query π’š ∈ 𝒀: Find first 10 β‹… π‘š such 𝑧𝑗 that βˆƒπ‘˜: π‘•π‘˜ Τ¦ 𝑦 = π‘•π‘˜(𝑧𝑗) by binary search. If encounter some 𝑧𝑗 such that dist Τ¦ 𝑦, 𝑧𝑗 ≀ 𝑑𝑠 then return this 𝑧𝑗;

  • therwise return β€œno”.

(𝑑, 𝑠)-ANN in metric space (π‘Œ, dist) (𝑑, 𝑑𝑠, π‘žβˆ—, Ξ€ 1 π‘œ)-LSH 𝑕: π‘Œ β†’ 𝑉 Data: π‘œ points 𝑧1, 𝑧2, β‹― , π‘§π‘œ ∈ π‘Œ Query: some point Τ¦ 𝑦 ∈ π‘Œ If the real answer is β€œno”: always correct. If exists 𝑧𝑑 such that dist Τ¦ 𝑦, 𝑧𝑑 ≀ 𝑠, then Pr answer "no" ≀ Pr[βˆ€π‘˜, π‘•π‘˜ Τ¦ 𝑦 β‰  π‘•π‘˜ 𝑧𝑑 ] + Pr[exist 10π‘š bad 𝑧𝑗 that dist Τ¦ 𝑦, 𝑧𝑗 > 𝑑𝑠 yet βˆƒπ‘˜ s.t. π‘•π‘˜ Τ¦ 𝑦 = π‘•π‘˜(𝑧𝑗)]

slide-103
SLIDE 103

Let π‘š = Ξ€ 1 π‘žβˆ—, independently draw 𝑕1, 𝑕2, β‹― , π‘•π‘š. Maintain π’Ž sorted tables: For π‘˜ = 1,2, β‹― , π‘š: Store 𝑧1, 𝑧2, β‹― , π‘§π‘œ in table-π‘˜ in nondecreasing order of π‘•π‘˜(𝑧𝑗). Upon query π’š ∈ 𝒀: Find first 10 β‹… π‘š such 𝑧𝑗 that βˆƒπ‘˜: π‘•π‘˜ Τ¦ 𝑦 = π‘•π‘˜(𝑧𝑗) by binary search. If encounter some 𝑧𝑗 such that dist Τ¦ 𝑦, 𝑧𝑗 ≀ 𝑑𝑠 then return this 𝑧𝑗;

  • therwise return β€œno”.

(𝑑, 𝑠)-ANN in metric space (π‘Œ, dist) (𝑑, 𝑑𝑠, π‘žβˆ—, Ξ€ 1 π‘œ)-LSH 𝑕: π‘Œ β†’ 𝑉 Data: π‘œ points 𝑧1, 𝑧2, β‹― , π‘§π‘œ ∈ π‘Œ Query: some point Τ¦ 𝑦 ∈ π‘Œ If the real answer is β€œno”: always correct. If exists 𝑧𝑑 such that dist Τ¦ 𝑦, 𝑧𝑑 ≀ 𝑠, then Pr answer "no" ≀ Pr[βˆ€π‘˜, π‘•π‘˜ Τ¦ 𝑦 β‰  π‘•π‘˜ 𝑧𝑑 ] + Pr[exist 10π‘š bad 𝑧𝑗 that dist Τ¦ 𝑦, 𝑧𝑗 > 𝑑𝑠 yet βˆƒπ‘˜ s.t. π‘•π‘˜ Τ¦ 𝑦 = π‘•π‘˜(𝑧𝑗)] ≀ 1 βˆ’ π‘žβˆ— π‘š ≀ Ξ€ 1 𝑓

slide-104
SLIDE 104

Let π‘š = Ξ€ 1 π‘žβˆ—, independently draw 𝑕1, 𝑕2, β‹― , π‘•π‘š. Maintain π’Ž sorted tables: For π‘˜ = 1,2, β‹― , π‘š: Store 𝑧1, 𝑧2, β‹― , π‘§π‘œ in table-π‘˜ in nondecreasing order of π‘•π‘˜(𝑧𝑗). Upon query π’š ∈ 𝒀: Find first 10 β‹… π‘š such 𝑧𝑗 that βˆƒπ‘˜: π‘•π‘˜ Τ¦ 𝑦 = π‘•π‘˜(𝑧𝑗) by binary search. If encounter some 𝑧𝑗 such that dist Τ¦ 𝑦, 𝑧𝑗 ≀ 𝑑𝑠 then return this 𝑧𝑗;

  • therwise return β€œno”.

(𝑑, 𝑠)-ANN in metric space (π‘Œ, dist) (𝑑, 𝑑𝑠, π‘žβˆ—, Ξ€ 1 π‘œ)-LSH 𝑕: π‘Œ β†’ 𝑉 Data: π‘œ points 𝑧1, 𝑧2, β‹― , π‘§π‘œ ∈ π‘Œ Query: some point Τ¦ 𝑦 ∈ π‘Œ If the real answer is β€œno”: always correct. If exists 𝑧𝑑 such that dist Τ¦ 𝑦, 𝑧𝑑 ≀ 𝑠, then Pr answer "no" ≀ Pr[βˆ€π‘˜, π‘•π‘˜ Τ¦ 𝑦 β‰  π‘•π‘˜ 𝑧𝑑 ] + Pr[exist 10π‘š bad 𝑧𝑗 that dist Τ¦ 𝑦, 𝑧𝑗 > 𝑑𝑠 yet βˆƒπ‘˜ s.t. π‘•π‘˜ Τ¦ 𝑦 = π‘•π‘˜(𝑧𝑗)] ≀ 1 βˆ’ π‘žβˆ— π‘š ≀ Ξ€ 1 𝑓

slide-105
SLIDE 105

Let π‘š = Ξ€ 1 π‘žβˆ—, independently draw 𝑕1, 𝑕2, β‹― , π‘•π‘š. Maintain π’Ž sorted tables: For π‘˜ = 1,2, β‹― , π‘š: Store 𝑧1, 𝑧2, β‹― , π‘§π‘œ in table-π‘˜ in nondecreasing order of π‘•π‘˜(𝑧𝑗). Upon query π’š ∈ 𝒀: Find first 10 β‹… π‘š such 𝑧𝑗 that βˆƒπ‘˜: π‘•π‘˜ Τ¦ 𝑦 = π‘•π‘˜(𝑧𝑗) by binary search. If encounter some 𝑧𝑗 such that dist Τ¦ 𝑦, 𝑧𝑗 ≀ 𝑑𝑠 then return this 𝑧𝑗;

  • therwise return β€œno”.

(𝑑, 𝑠)-ANN in metric space (π‘Œ, dist) (𝑑, 𝑑𝑠, π‘žβˆ—, Ξ€ 1 π‘œ)-LSH 𝑕: π‘Œ β†’ 𝑉 Data: π‘œ points 𝑧1, 𝑧2, β‹― , π‘§π‘œ ∈ π‘Œ Query: some point Τ¦ 𝑦 ∈ π‘Œ If the real answer is β€œno”: always correct. If exists 𝑧𝑑 such that dist Τ¦ 𝑦, 𝑧𝑑 ≀ 𝑠, then Pr answer "no" ≀ Pr[βˆ€π‘˜, π‘•π‘˜ Τ¦ 𝑦 β‰  π‘•π‘˜ 𝑧𝑑 ] + Pr[exist 10π‘š bad 𝑧𝑗 that dist Τ¦ 𝑦, 𝑧𝑗 > 𝑑𝑠 yet βˆƒπ‘˜ s.t. π‘•π‘˜ Τ¦ 𝑦 = π‘•π‘˜(𝑧𝑗)] ≀ 1 βˆ’ π‘žβˆ— π‘š ≀ Ξ€ 1 𝑓 ≀ 𝔽 number of such bad 𝑧𝑗 10π‘š ≀ π‘œ β‹… π‘š β‹… Ξ€ 1 π‘œ 10π‘š = 0.1

slide-106
SLIDE 106

Let π‘š = Ξ€ 1 π‘žβˆ—, independently draw 𝑕1, 𝑕2, β‹― , π‘•π‘š. Maintain π’Ž sorted tables: For π‘˜ = 1,2, β‹― , π‘š: Store 𝑧1, 𝑧2, β‹― , π‘§π‘œ in table-π‘˜ in nondecreasing order of π‘•π‘˜(𝑧𝑗). Upon query π’š ∈ 𝒀: Find first 10 β‹… π‘š such 𝑧𝑗 that βˆƒπ‘˜: π‘•π‘˜ Τ¦ 𝑦 = π‘•π‘˜(𝑧𝑗) by binary search. If encounter some 𝑧𝑗 such that dist Τ¦ 𝑦, 𝑧𝑗 ≀ 𝑑𝑠 then return this 𝑧𝑗;

  • therwise return β€œno”.

(𝑑, 𝑠)-ANN in metric space (π‘Œ, dist) (𝑑, 𝑑𝑠, π‘žβˆ—, Ξ€ 1 π‘œ)-LSH 𝑕: π‘Œ β†’ 𝑉 Data: π‘œ points 𝑧1, 𝑧2, β‹― , π‘§π‘œ ∈ π‘Œ Query: some point Τ¦ 𝑦 ∈ π‘Œ If the real answer is β€œno”: always correct. If exists 𝑧𝑑 such that dist Τ¦ 𝑦, 𝑧𝑑 ≀ 𝑠, then Pr answer "no" ≀ Pr[βˆ€π‘˜, π‘•π‘˜ Τ¦ 𝑦 β‰  π‘•π‘˜ 𝑧𝑑 ] + Pr[exist 10π‘š bad 𝑧𝑗 that dist Τ¦ 𝑦, 𝑧𝑗 > 𝑑𝑠 yet βˆƒπ‘˜ s.t. π‘•π‘˜ Τ¦ 𝑦 = π‘•π‘˜(𝑧𝑗)] ≀ 1 βˆ’ π‘žβˆ— π‘š ≀ Ξ€ 1 𝑓 ≀ 𝔽 number of such bad 𝑧𝑗 10π‘š ≀ π‘œ β‹… π‘š β‹… Ξ€ 1 π‘œ 10π‘š = 0.1

+ ≀ Ξ€ 1 𝑓 + 0.1 < 0.5

slide-107
SLIDE 107

Let π‘š = Ξ€ 1 π‘žβˆ—, independently draw 𝑕1, 𝑕2, β‹― , π‘•π‘š. Maintain π’Ž sorted tables: For π‘˜ = 1,2, β‹― , π‘š: Store 𝑧1, 𝑧2, β‹― , π‘§π‘œ in table-π‘˜ in nondecreasing order of π‘•π‘˜(𝑧𝑗). Upon query π’š ∈ 𝒀: Find first 10 β‹… π‘š such 𝑧𝑗 that βˆƒπ‘˜: π‘•π‘˜ Τ¦ 𝑦 = π‘•π‘˜(𝑧𝑗) by binary search. If encounter some 𝑧𝑗 such that dist Τ¦ 𝑦, 𝑧𝑗 ≀ 𝑑𝑠 then return this 𝑧𝑗;

  • therwise return β€œno”.

(𝑑, 𝑠)-ANN in metric space (π‘Œ, dist) (𝑑, 𝑑𝑠, π‘žβˆ—, Ξ€ 1 π‘œ)-LSH 𝑕: π‘Œ β†’ 𝑉 Data: π‘œ points 𝑧1, 𝑧2, β‹― , π‘§π‘œ ∈ π‘Œ Query: some point Τ¦ 𝑦 ∈ π‘Œ

If the real answer is β€œno”: always correct. If exists 𝑧𝑑 such that dist Τ¦ 𝑦, 𝑧𝑑 ≀ 𝑠, then Pr answer "no" < 0.5

slide-108
SLIDE 108

Let π‘š = Ξ€ 1 π‘žβˆ—, independently draw 𝑕1, 𝑕2, β‹― , π‘•π‘š. Maintain π’Ž sorted tables: For π‘˜ = 1,2, β‹― , π‘š: Store 𝑧1, 𝑧2, β‹― , π‘§π‘œ in table-π‘˜ in nondecreasing order of π‘•π‘˜(𝑧𝑗). Upon query π’š ∈ 𝒀: Find first 10 β‹… π‘š such 𝑧𝑗 that βˆƒπ‘˜: π‘•π‘˜ Τ¦ 𝑦 = π‘•π‘˜(𝑧𝑗) by binary search. If encounter some 𝑧𝑗 such that dist Τ¦ 𝑦, 𝑧𝑗 ≀ 𝑑𝑠 then return this 𝑧𝑗;

  • therwise return β€œno”.

(𝑑, 𝑠)-ANN in metric space (π‘Œ, dist) (𝑑, 𝑑𝑠, π‘žβˆ—, Ξ€ 1 π‘œ)-LSH 𝑕: π‘Œ β†’ 𝑉 Data: π‘œ points 𝑧1, 𝑧2, β‹― , π‘§π‘œ ∈ π‘Œ Query: some point Τ¦ 𝑦 ∈ π‘Œ

If the real answer is β€œno”: always correct. If exists 𝑧𝑑 such that dist Τ¦ 𝑦, 𝑧𝑑 ≀ 𝑠, then Pr answer "no" < 0.5 Space: 𝑃 π‘œπ‘š = 𝑃( Ξ€ π‘œ π‘žβˆ—) Time: 𝑃 π‘š β‹… log π‘œ = 𝑃 Ξ€ (log π‘œ) π‘žβˆ—

slide-109
SLIDE 109

Setup: metric space (π‘Œ, dist) Data: π‘œ points 𝑧1, 𝑧2, β‹― , π‘§π‘œ ∈ π‘Œ Query: given a point Τ¦ 𝑦 ∈ π‘Œ:

  • Return a 𝑧𝑗 s.t. dist Τ¦

𝑦, 𝑧𝑗 ≀ 𝑑𝑠 if βˆƒπ‘§π‘˜: dist Τ¦ 𝑦, π‘§π‘˜ ≀ 𝑠

  • Return β€œno” if βˆ€π‘§π‘˜: dist Τ¦

𝑦, π‘§π‘˜ > 𝑑𝑠

  • Arbitrary answer otherwise

(𝒅, 𝒔)-ANN Suppose we have (𝑠, 𝑑𝑠, π‘ž, π‘Ÿ)-LSH β„Ž: π‘Œ β†’ 𝑉 We have (𝑠, 𝑑𝑠, π‘žπ‘™, Ξ€ 1 π‘œ)-LSH 𝑕: π‘Œ β†’ 𝑉𝑙 where 𝑙 = log(1/π‘Ÿ) π‘œ, implying π‘žπ‘™ = π‘žlog1/π‘Ÿ π‘œ = π‘œβˆ’πœ 𝜍 = log π‘ž log π‘Ÿ Hence we can solve (𝑑, 𝑠)-ANN with space 𝑃(π‘œ1+𝜍) and query time 𝑃(π‘œπœ β‹… log π‘œ) and one-sided error < 0.5

slide-110
SLIDE 110

Data: π‘œ points 𝑧1, 𝑧2, β‹― , π‘§π‘œ ∈ 0,1 𝑒 Query: given a point Τ¦ 𝑦 ∈ 0,1 𝑒:

  • Return a 𝑧𝑗 s.t. dist Τ¦

𝑦, 𝑧𝑗 ≀ 𝑑𝑠 if βˆƒπ‘§π‘˜: dist Τ¦ 𝑦, π‘§π‘˜ ≀ 𝑠

  • Return β€œno” if βˆ€π‘§π‘˜: dist Τ¦

𝑦, π‘§π‘˜ > 𝑑𝑠

  • Arbitrary answer otherwise

(𝒅, 𝒔)-ANN in Hamming Space 𝟏, 𝟐 𝒆

slide-111
SLIDE 111

Data: π‘œ points 𝑧1, 𝑧2, β‹― , π‘§π‘œ ∈ 0,1 𝑒 Query: given a point Τ¦ 𝑦 ∈ 0,1 𝑒:

  • Return a 𝑧𝑗 s.t. dist Τ¦

𝑦, 𝑧𝑗 ≀ 𝑑𝑠 if βˆƒπ‘§π‘˜: dist Τ¦ 𝑦, π‘§π‘˜ ≀ 𝑠

  • Return β€œno” if βˆ€π‘§π‘˜: dist Τ¦

𝑦, π‘§π‘˜ > 𝑑𝑠

  • Arbitrary answer otherwise

(𝒅, 𝒔)-ANN in Hamming Space 𝟏, 𝟐 𝒆 β„‹ = β„Žπ‘— | β„Žπ‘— Τ¦ 𝑦 = Τ¦ 𝑦 𝑗 for 𝑗 = 1,2, β‹― , 𝑒 β„Ž is chosen uniformly at random from β„‹

slide-112
SLIDE 112

Data: π‘œ points 𝑧1, 𝑧2, β‹― , π‘§π‘œ ∈ 0,1 𝑒 Query: given a point Τ¦ 𝑦 ∈ 0,1 𝑒:

  • Return a 𝑧𝑗 s.t. dist Τ¦

𝑦, 𝑧𝑗 ≀ 𝑑𝑠 if βˆƒπ‘§π‘˜: dist Τ¦ 𝑦, π‘§π‘˜ ≀ 𝑠

  • Return β€œno” if βˆ€π‘§π‘˜: dist Τ¦

𝑦, π‘§π‘˜ > 𝑑𝑠

  • Arbitrary answer otherwise

(𝒅, 𝒔)-ANN in Hamming Space 𝟏, 𝟐 𝒆 β„‹ = β„Žπ‘— | β„Žπ‘— Τ¦ 𝑦 = Τ¦ 𝑦 𝑗 for 𝑗 = 1,2, β‹― , 𝑒 β„Ž is chosen uniformly at random from β„‹

slide-113
SLIDE 113

Data: π‘œ points 𝑧1, 𝑧2, β‹― , π‘§π‘œ ∈ 0,1 𝑒 Query: given a point Τ¦ 𝑦 ∈ 0,1 𝑒:

  • Return a 𝑧𝑗 s.t. dist Τ¦

𝑦, 𝑧𝑗 ≀ 𝑑𝑠 if βˆƒπ‘§π‘˜: dist Τ¦ 𝑦, π‘§π‘˜ ≀ 𝑠

  • Return β€œno” if βˆ€π‘§π‘˜: dist Τ¦

𝑦, π‘§π‘˜ > 𝑑𝑠

  • Arbitrary answer otherwise

(𝒅, 𝒔)-ANN in Hamming Space 𝟏, 𝟐 𝒆 β„‹ = β„Žπ‘— | β„Žπ‘— Τ¦ 𝑦 = Τ¦ 𝑦 𝑗 for 𝑗 = 1,2, β‹― , 𝑒 β„Ž is chosen uniformly at random from β„‹ We have a (𝑠, 𝑑𝑠, 1 βˆ’ Ξ€ 𝑠 𝑒 , 1 βˆ’ Ξ€ 𝑑𝑠 𝑒)-LSH β„Ž: 0,1 𝑒 β†’ {0,1}

slide-114
SLIDE 114

Data: π‘œ points 𝑧1, 𝑧2, β‹― , π‘§π‘œ ∈ 0,1 𝑒 Query: given a point Τ¦ 𝑦 ∈ 0,1 𝑒:

  • Return a 𝑧𝑗 s.t. dist Τ¦

𝑦, 𝑧𝑗 ≀ 𝑑𝑠 if βˆƒπ‘§π‘˜: dist Τ¦ 𝑦, π‘§π‘˜ ≀ 𝑠

  • Return β€œno” if βˆ€π‘§π‘˜: dist Τ¦

𝑦, π‘§π‘˜ > 𝑑𝑠

  • Arbitrary answer otherwise

(𝒅, 𝒔)-ANN in Hamming Space 𝟏, 𝟐 𝒆 β„‹ = β„Žπ‘— | β„Žπ‘— Τ¦ 𝑦 = Τ¦ 𝑦 𝑗 for 𝑗 = 1,2, β‹― , 𝑒 β„Ž is chosen uniformly at random from β„‹ We have a (𝑠, 𝑑𝑠, 1 βˆ’ Ξ€ 𝑠 𝑒 , 1 βˆ’ Ξ€ 𝑑𝑠 𝑒)-LSH β„Ž: 0,1 𝑒 β†’ {0,1}

𝜍 = log 1 βˆ’ Ξ€ 𝑠 𝑒 log(1 βˆ’ Ξ€ 𝑑𝑠 𝑒) ≀ 1 𝑑

slide-115
SLIDE 115

Data: π‘œ points 𝑧1, 𝑧2, β‹― , π‘§π‘œ ∈ 0,1 𝑒 Query: given a point Τ¦ 𝑦 ∈ 0,1 𝑒:

  • Return a 𝑧𝑗 s.t. dist Τ¦

𝑦, 𝑧𝑗 ≀ 𝑑𝑠 if βˆƒπ‘§π‘˜: dist Τ¦ 𝑦, π‘§π‘˜ ≀ 𝑠

  • Return β€œno” if βˆ€π‘§π‘˜: dist Τ¦

𝑦, π‘§π‘˜ > 𝑑𝑠

  • Arbitrary answer otherwise

(𝒅, 𝒔)-ANN in Hamming Space 𝟏, 𝟐 𝒆 β„‹ = β„Žπ‘— | β„Žπ‘— Τ¦ 𝑦 = Τ¦ 𝑦 𝑗 for 𝑗 = 1,2, β‹― , 𝑒 β„Ž is chosen uniformly at random from β„‹ We have a (𝑠, 𝑑𝑠, 1 βˆ’ Ξ€ 𝑠 𝑒 , 1 βˆ’ Ξ€ 𝑑𝑠 𝑒)-LSH β„Ž: 0,1 𝑒 β†’ {0,1}

𝜍 = log 1 βˆ’ Ξ€ 𝑠 𝑒 log(1 βˆ’ Ξ€ 𝑑𝑠 𝑒) ≀ 1 𝑑

We can solve (𝑑, 𝑠)-ANN in Hamming space with space 𝑃(π‘œ1+1/𝑑), query time 𝑃(π‘œ1/𝑑 β‹… log π‘œ), and one-sided error < 0.5

slide-116
SLIDE 116

Recap

Dimension reduction (low-distortion metric embedding)

  • Johonson-Linenstrauss Theorem: in Euclidian space, it is

easy to embed a set of π‘œ points in arbitrary dimension to 𝑃(log π‘œ) dimension with constant distortion. Nearest neighbor search

  • Exact version of it is difficult in high-dimensional space.
  • Approximation and randomization helps.
  • If we can solve (𝒅, 𝒔)-ANN (Approximate Near Neighbor),

then we can solve 𝒅-ANN (Approximate Nearest Neighbor) with limited overhead.

  • Locality-sensitive hashing (LSH) is a powerful tool to solve

(𝑑, 𝑠)-ANN. (Collisions could be helpful for hashing.)