beyond locality sensitive hashing
play

Beyond Locality-Sensitive Hashing Huy L. Nguy Alexandr Andoni 1 - PowerPoint PPT Presentation

Beyond Locality-Sensitive Hashing Huy L. Nguy Alexandr Andoni 1 Piotr Indyk 2 n 3 Ilya Razenshteyn 2 1 Microsoft Research SVC 2 MIT, CSAIL 3 Princeton SODA 2014 1 / 16 The Near Neighbor Problem Let P be an n -point subset of a metric ( X , D


  1. Beyond Locality-Sensitive Hashing Huy L. Nguy˜ Alexandr Andoni 1 Piotr Indyk 2 ên 3 Ilya Razenshteyn 2 1 Microsoft Research SVC 2 MIT, CSAIL 3 Princeton SODA 2014 1 / 16

  2. The Near Neighbor Problem Let P be an n -point subset of a metric ( X , D ) , r > 0 For q ∈ X find any p ∈ P with D ( p , q ) ≤ r 2 / 16

  3. The Near Neighbor Problem Let P be an n -point subset of a metric ( X , D ) , r > 0 For q ∈ X find any p ∈ P with D ( p , q ) ≤ r q r p 2 / 16

  4. The Near Neighbor Problem Let P be an n -point subset of a metric ( X , D ) , r > 0 For q ∈ X find any p ∈ P with D ( p , q ) ≤ r q r p 2 / 16

  5. The Near Neighbor Problem Let P be an n -point subset of a metric ( X , D ) , r > 0 For q ∈ X find any p ∈ P with D ( p , q ) ≤ r Hard, if ( X , D ) is high-dimensional (space or query time is exponential in the dimension) q r p 2 / 16

  6. The Approximate Near Neighbor Problem (ANN) Let P be an n -point subset of a metric ( X , D ) , r > 0, c > 1 For q ∈ X find any p ′ ∈ P with D ( p ′ , q ) ≤ cr , provided that there exists p ∈ P with D ( p , q ) ≤ r 3 / 16

  7. The Approximate Near Neighbor Problem (ANN) Let P be an n -point subset of a metric ( X , D ) , r > 0, c > 1 For q ∈ X find any p ′ ∈ P with D ( p ′ , q ) ≤ cr , provided that there exists p ∈ P with D ( p , q ) ≤ r q p ′ r p cr 3 / 16

  8. The Approximate Near Neighbor Problem (ANN) Let P be an n -point subset of a metric ( X , D ) , r > 0, c > 1 For q ∈ X find any p ′ ∈ P with D ( p ′ , q ) ≤ cr , provided that there exists p ∈ P with D ( p , q ) ≤ r q p ′ r p cr 3 / 16

  9. Literature Exponential dependence on the dimension: (Arya, Mount 1993), (Meister 1993), (Clarkson 1994), (Arya, Mount, Netanyahu, Silverman, We, 1998), (Kleinberg, 1997), (Har-Peled 2002) Polynomial dependence on the dimension: (Indyk, Motwani 1998), (Kushilevitz, Ostrovsky, Rabani 1998), (Indyk 1998), (Indyk 2001), (Gionis, Indyk, Motwani 1999), (Charikar 2002), (Datar, Immorlica, Indyk, Mirrokni 2004), (Chakrabarti, Regev 2004), (Panigrahy 2006), (Ailon, Chazelle 2006), (Andoni, Indyk 2006), (Indyk, Kapralov 2013), (Nguy˜ ên 2013) 4 / 16

  10. Locality-Sensitive Hashing (LSH) The goal: solve ANN with polynomial in the dimension space and query time, near-linear in n space, and sublinear in n query time 5 / 16

  11. Locality-Sensitive Hashing (LSH) The goal: solve ANN with polynomial in the dimension space and query time, near-linear in n space, and sublinear in n query time The only known technique: Locality-Sensitive Hashing (LSH) (Indyk, Motwani 1998) 5 / 16

  12. Locality-Sensitive Hashing (LSH) The goal: solve ANN with polynomial in the dimension space and query time, near-linear in n space, and sublinear in n query time The only known technique: Locality-Sensitive Hashing (LSH) (Indyk, Motwani 1998) A hash family H on ( X , D ) is ( r , cr , p 1 , p 2 ) -sensitive, if for every p , q ∈ X : if D ( p , q ) ≤ r , then Pr h ∼H [ h ( p ) = h ( q )] ≥ p 1 ; if D ( p , q ) ≥ cr , then Pr h ∼H [ h ( p ) = h ( q )] ≤ p 2 5 / 16

  13. Locality-Sensitive Hashing (LSH) The goal: solve ANN with polynomial in the dimension space and query time, near-linear in n space, and sublinear in n query time The only known technique: Locality-Sensitive Hashing (LSH) (Indyk, Motwani 1998) A hash family H on ( X , D ) is ( r , cr , p 1 , p 2 ) -sensitive, if for every p , q ∈ X : if D ( p , q ) ≤ r , then Pr h ∼H [ h ( p ) = h ( q )] ≥ p 1 ; if D ( p , q ) ≥ cr , then Pr h ∼H [ h ( p ) = h ( q )] ≤ p 2 collision probability 1 p 1 p 2 distance r cr 5 / 16

  14. From LSH to ANN Let H be a “reasonable” ( r , cr , p 1 , p 2 ) -sensitive family 6 / 16

  15. From LSH to ANN Let H be a “reasonable” ( r , cr , p 1 , p 2 ) -sensitive family Define “quality” of H as ρ = ln ( 1 / p 1 ) ln ( 1 / p 2 ) 6 / 16

  16. From LSH to ANN Let H be a “reasonable” ( r , cr , p 1 , p 2 ) -sensitive family Define “quality” of H as ρ = ln ( 1 / p 1 ) ln ( 1 / p 2 ) Then, can solve ANN with roughly O ( n 1 + ρ + nd ) space and O ( d · n ρ ) query time (Indyk, Motwani 1998) 6 / 16

  17. From LSH to ANN Let H be a “reasonable” ( r , cr , p 1 , p 2 ) -sensitive family Define “quality” of H as ρ = ln ( 1 / p 1 ) ln ( 1 / p 2 ) Then, can solve ANN with roughly O ( n 1 + ρ + nd ) space and O ( d · n ρ ) query time (Indyk, Motwani 1998) Example: { 0 , 1 } d with Hamming distance; Let H = { h 1 , . . . , h d } , where h i ( x ) = x i ; One can check that ρ ≤ 1 / c 6 / 16

  18. From LSH to ANN Let H be a “reasonable” ( r , cr , p 1 , p 2 ) -sensitive family Define “quality” of H as ρ = ln ( 1 / p 1 ) ln ( 1 / p 2 ) Then, can solve ANN with roughly O ( n 1 + ρ + nd ) space and O ( d · n ρ ) query time (Indyk, Motwani 1998) Example: { 0 , 1 } d with Hamming distance; Let H = { h 1 , . . . , h d } , where h i ( x ) = x i ; One can check that ρ ≤ 1 / c 11101110 10111101 6 / 16

  19. Known LSH constructions (Indyk, Motwani 1998), (Andoni, Indyk 2006), (Motwani, Naor, Panigrahy 2007), (O’Donnell, Wu, Zhou 2011), (Indyk, Kapralov 2013), (Nguy˜ ên 2013) Bounds on ρ = ln ( 1 / p 1 ) / ln ( 1 / p 2 ) for various spaces: Space Upper bound Lower bound ℓ 1 ρ ≤ 1 / c ρ ≥ 1 / c − o ( 1 ) ℓ p ρ ≥ 1 / c p − o ( 1 ) ρ ≤ O ( 1 / c p ) 1 < p < 2 ρ ≤ 1 / c 2 + o ( 1 ) ρ ≥ 1 / c 2 − o ( 1 ) ℓ 2 7 / 16

  20. Known LSH constructions (Indyk, Motwani 1998), (Andoni, Indyk 2006), (Motwani, Naor, Panigrahy 2007), (O’Donnell, Wu, Zhou 2011), (Indyk, Kapralov 2013), (Nguy˜ ên 2013) Bounds on ρ = ln ( 1 / p 1 ) / ln ( 1 / p 2 ) for various spaces: Space Upper bound Lower bound ℓ 1 ρ ≤ 1 / c ρ ≥ 1 / c − o ( 1 ) ℓ p ρ ≥ 1 / c p − o ( 1 ) ρ ≤ O ( 1 / c p ) 1 < p < 2 ρ ≤ 1 / c 2 + o ( 1 ) ρ ≥ 1 / c 2 − o ( 1 ) ℓ 2 This work: ANN in space O ( n 1 + τ + nd ) and time O ( dn τ ) , where � � 7 1 τ ≤ 8 c + O + o ( 1 ) for ℓ 1 c 3 / 2 � � 7 1 τ ≤ 8 c 2 + O + o ( 1 ) for ℓ 2 c 3 The first improvement upon (Indyk, Motwani 1998) for ℓ 1 and (Andoni, Indyk 2006) for ℓ 2 ! 7 / 16

  21. The main idea LSH is oblivious, can we construct a hash family that would depend on the data? 8 / 16

  22. The main idea LSH is oblivious, can we construct a hash family that would depend on the data? H is ( r , cr , p 1 , p 2 ) -sensitive , if for every p , q ∈ X if D ( p , q ) ≤ r , then Pr h ∼H [ h ( p ) = h ( q )] ≥ p 1 ; if D ( p , q ) ≥ cr , then Pr h ∼H [ h ( p ) = h ( q )] ≤ p 2 8 / 16

  23. The main idea LSH is oblivious, can we construct a hash family that would depend on the data? H is ( r , cr , p 1 , p 2 ) -sensitive , if for every p , q ∈ X if D ( p , q ) ≤ r , then Pr h ∼H [ h ( p ) = h ( q )] ≥ p 1 ; if D ( p , q ) ≥ cr , then Pr h ∼H [ h ( p ) = h ( q )] ≤ p 2 Too strong! Enough to satisfy these for p ∈ P and q ∈ X . Can exploit the geometry of P to construct a better family 8 / 16

  24. The main idea LSH is oblivious, can we construct a hash family that would depend on the data? H is ( r , cr , p 1 , p 2 ) -sensitive , if for every p , q ∈ X if D ( p , q ) ≤ r , then Pr h ∼H [ h ( p ) = h ( q )] ≥ p 1 ; if D ( p , q ) ≥ cr , then Pr h ∼H [ h ( p ) = h ( q )] ≤ p 2 Too strong! Enough to satisfy these for p ∈ P and q ∈ X . Can exploit the geometry of P to construct a better family Parallels with practice! PCA trees (Sproull 1991), (McNames 2001), (Verma, Kpotufe, Dasgupta 2009) Spectral Hashing (Weiss, Torralba, Fergus 2008) Semantic Hashing (Salakhutdinov, Hinton 2009) WTA Hashing (Yagnik, Strelow, Ross, Lin 2011) 8 / 16

  25. The main idea (contd) From now on, looking at the Euclidean case and trying to improve upon ρ ≤ 1 / c 2 (Andoni, Indyk 2006) 9 / 16

  26. The main idea (contd) From now on, looking at the Euclidean case and trying to improve upon ρ ≤ 1 / c 2 (Andoni, Indyk 2006) Partition P into low-diameter clusters (of diameter O ( cr ) ) Improve upon 1 / c 2 for the low-diameter case 9 / 16

  27. The low-diameter case All points and queries are on a sphere of radius O ( cr ) 10 / 16

  28. The low-diameter case All points and queries are on a sphere of radius O ( cr ) Can achieve ρ = ln ( 1 / p 1 ) ln ( 1 / p 2 ) ≤ 1 − Ω( 1 ) c 2 using “ball carving” (similar to (Karger, Motwani, Sudan 1998)) 10 / 16

  29. The low-diameter case All points and queries are on a sphere of radius O ( cr ) Can achieve ρ = ln ( 1 / p 1 ) ln ( 1 / p 2 ) ≤ 1 − Ω( 1 ) c 2 using “ball carving” (similar to (Karger, Motwani, Sudan 1998)) 10 / 16

  30. The low-diameter case All points and queries are on a sphere of radius O ( cr ) Can achieve ρ = ln ( 1 / p 1 ) ln ( 1 / p 2 ) ≤ 1 − Ω( 1 ) c 2 using “ball carving” (similar to (Karger, Motwani, Sudan 1998)) 10 / 16

  31. The low-diameter case All points and queries are on a sphere of radius O ( cr ) Can achieve ρ = ln ( 1 / p 1 ) ln ( 1 / p 2 ) ≤ 1 − Ω( 1 ) c 2 using “ball carving” (similar to (Karger, Motwani, Sudan 1998)) 10 / 16

  32. The low-diameter case All points and queries are on a sphere of radius O ( cr ) Can achieve ρ = ln ( 1 / p 1 ) ln ( 1 / p 2 ) ≤ 1 − Ω( 1 ) c 2 using “ball carving” (similar to (Karger, Motwani, Sudan 1998)) 10 / 16

Recommend


More recommend