hypercube locality sensitive hashing for approximate near
play

Hypercube locality-sensitive hashing for approximate near neighbors - PowerPoint PPT Presentation

Hypercube locality-sensitive hashing for approximate near neighbors Thijs Laarhoven ts ttts MFCS 2017, Aalborg, Denmark (August 23, 2017) Nearest neighbor


  1. Hypercube locality-sensitive hashing for approximate near neighbors Thijs Laarhoven ♠❛✐❧❅t❤✐❥s✳❝♦♠ ❤tt♣✿✴✴✇✇✇✳t❤✐❥s✳❝♦♠✴ MFCS 2017, Aalborg, Denmark (August 23, 2017)

  2. Nearest neighbor searching O

  3. Nearest neighbor searching Data set O

  4. Nearest neighbor searching Target O

  5. Nearest neighbor searching Nearest neighbor ( ℓ 2 -norm) O

  6. Nearest neighbor searching Nearest neighbor ( ℓ 1 -norm) O

  7. Nearest neighbor searching Nearest neighbor (angular distance) O

  8. Nearest neighbor searching Nearest neighbor ( ℓ 2 -norm) O

  9. Nearest neighbor searching Distance guarantee r O

  10. Nearest neighbor searching Approximate nearest neighbor r O

  11. Nearest neighbor searching Approximation factor c > 1 r O c · r

  12. Nearest neighbor searching Example: Precompute Voronoi cells O

  13. Nearest neighbor searching Example: Precompute Voronoi cells O

  14. Nearest neighbor searching Given a target... O

  15. Nearest neighbor searching ...quickly find the right cell O

  16. Nearest neighbor searching Works well in low dimensions O

  17. Nearest neighbor searching Problem setting • High dimensions d

  18. Nearest neighbor searching Problem setting • High dimensions d • Large data set of size n = 2 Ω ( d / log d ) ◮ Smaller n ? = ⇒ Use JLT to reduce d

  19. Nearest neighbor searching Problem setting • High dimensions d • Large data set of size n = 2 Ω ( d / log d ) ◮ Smaller n ? = ⇒ Use JLT to reduce d • Assumption: Data set lies on the sphere ◮ Equivalent to angular distance / cosine similarity in all of � d ◮ Reduction from Eucl. NNS in � d to Eucl. NNS on the sphere [ AR’15 ]

  20. Nearest neighbor searching Problem setting • High dimensions d • Large data set of size n = 2 Ω ( d / log d ) ◮ Smaller n ? = ⇒ Use JLT to reduce d • Assumption: Data set lies on the sphere ◮ Equivalent to angular distance / cosine similarity in all of � d ◮ Reduction from Eucl. NNS in � d to Eucl. NNS on the sphere [ AR’15 ] • Goal: Query time O ( n ρ ) with ρ < 1

  21. Hyperplane LSH [ Charikar, STOC’02 ] O

  22. Hyperplane LSH Random point O

  23. Hyperplane LSH Opposite point O

  24. Hyperplane LSH Two Voronoi cells O

  25. Hyperplane LSH Another pair of points O

  26. Hyperplane LSH Another hyperplane O

  27. Hyperplane LSH Defines partition O

  28. Hyperplane LSH Preprocessing O

  29. Hyperplane LSH Query O

  30. Hyperplane LSH Collisions O

  31. Hyperplane LSH Failure O

  32. Hyperplane LSH Rerandomization O

  33. Hyperplane LSH Collisions O

  34. Hyperplane LSH Success O

  35. Hyperplane LSH Overview O

  36. Hyperplane LSH Overview • Simple: one hyperplane corresponds to one inner product O

  37. Hyperplane LSH Overview • Simple: one hyperplane corresponds to one inner product • Easy to analyze: collision probability 1 − θ π for vectors at angle θ O

  38. Hyperplane LSH Overview • Simple: one hyperplane corresponds to one inner product • Easy to analyze: collision probability 1 − θ π for vectors at angle θ • Can be made very efficient in practice ◮ Sparse hyperplane vectors [ Ach’01, LHC’06 ] ◮ Orthogonal hyperplanes [ TT’07 ] O

  39. Hyperplane LSH Overview • Simple: one hyperplane corresponds to one inner product • Easy to analyze: collision probability 1 − θ π for vectors at angle θ • Can be made very efficient in practice ◮ Sparse hyperplane vectors [ Ach’01, LHC’06 ] ◮ Orthogonal hyperplanes [ TT’07 ] • Theoretically suboptimal: use “nicer” (lattice-based) partitions O

  40. Hyperplane LSH Overview • Simple: one hyperplane corresponds to one inner product • Easy to analyze: collision probability 1 − θ π for vectors at angle θ • Can be made very efficient in practice ◮ Sparse hyperplane vectors [ Ach’01, LHC’06 ] ◮ Orthogonal hyperplanes [ TT’07 ] • Theoretically suboptimal: use “nicer” (lattice-based) partitions O ◮ Random points [ AI’06, AINR’14, ... ]

  41. Hyperplane LSH Overview • Simple: one hyperplane corresponds to one inner product • Easy to analyze: collision probability 1 − θ π for vectors at angle θ • Can be made very efficient in practice ◮ Sparse hyperplane vectors [ Ach’01, LHC’06 ] ◮ Orthogonal hyperplanes [ TT’07 ] • Theoretically suboptimal: use “nicer” (lattice-based) partitions O ◮ Random points [ AI’06, AINR’14, ... ] ◮ Leech lattice [ AI’06 ]

  42. Hyperplane LSH Overview • Simple: one hyperplane corresponds to one inner product • Easy to analyze: collision probability 1 − θ π for vectors at angle θ • Can be made very efficient in practice ◮ Sparse hyperplane vectors [ Ach’01, LHC’06 ] ◮ Orthogonal hyperplanes [ TT’07 ] • Theoretically suboptimal: use “nicer” (lattice-based) partitions O ◮ Random points [ AI’06, AINR’14, ... ] ◮ Leech lattice [ AI’06 ] ◮ Classical root lattices A d , D d [ JASG’08 ] ◮ Exceptional root lattices E 6,7,8 , F 4 , G 2 [ JASG’08 ]

  43. Hyperplane LSH Overview • Simple: one hyperplane corresponds to one inner product • Easy to analyze: collision probability 1 − θ π for vectors at angle θ • Can be made very efficient in practice ◮ Sparse hyperplane vectors [ Ach’01, LHC’06 ] ◮ Orthogonal hyperplanes [ TT’07 ] • Theoretically suboptimal: use “nicer” (lattice-based) partitions O ◮ Random points [ AI’06, AINR’14, ... ] ◮ Leech lattice [ AI’06 ] ◮ Classical root lattices A d , D d [ JASG’08 ] ◮ Exceptional root lattices E 6,7,8 , F 4 , G 2 [ JASG’08 ] ◮ Cross-polytopes [ TT’07, AILRS’15, KW’17 ]

  44. Hyperplane LSH Overview • Simple: one hyperplane corresponds to one inner product • Easy to analyze: collision probability 1 − θ π for vectors at angle θ • Can be made very efficient in practice ◮ Sparse hyperplane vectors [ Ach’01, LHC’06 ] ◮ Orthogonal hyperplanes [ TT’07 ] • Theoretically suboptimal: use “nicer” (lattice-based) partitions O ◮ Random points [ AI’06, AINR’14, ... ] ◮ Leech lattice [ AI’06 ] ◮ Classical root lattices A d , D d [ JASG’08 ] ◮ Exceptional root lattices E 6,7,8 , F 4 , G 2 [ JASG’08 ] ◮ Cross-polytopes [ TT’07, AILRS’15, KW’17 ] ◮ Hypercubes [ TT’07 ]

  45. Hyperplane LSH Asymptotically “optimal” • Simple: one hyperplane corresponds to one inner product • Easy to analyze: collision probability 1 − θ π for vectors at angle θ • Can be made very efficient in practice ◮ Sparse hyperplane vectors [ Ach’01, LHC’06 ] ◮ Orthogonal hyperplanes [ TT’07 ] • Theoretically suboptimal: use “nicer” (lattice-based) partitions O ◮ Random points [ AI’06, AINR’14, ... ] ◮ Leech lattice [ AI’06 ] ◮ Classical root lattices A d , D d [ JASG’08 ] ◮ Exceptional root lattices E 6,7,8 , F 4 , G 2 [ JASG’08 ] ◮ Cross-polytopes [ TT’07, AILRS’15, KW’17 ] ◮ Hypercubes [ TT’07 ]

  46. Hyperplane LSH Topic of this paper • Simple: one hyperplane corresponds to one inner product • Easy to analyze: collision probability 1 − θ π for vectors at angle θ • Can be made very efficient in practice ◮ Sparse hyperplane vectors [ Ach’01, LHC’06 ] ◮ Orthogonal hyperplanes [ TT’07 ] • Theoretically suboptimal: use “nicer” (lattice-based) partitions O ◮ Random points [ AI’06, AINR’14, ... ] ◮ Leech lattice [ AI’06 ] ◮ Classical root lattices A d , D d [ JASG’08 ] ◮ Exceptional root lattices E 6,7,8 , F 4 , G 2 [ JASG’08 ] ◮ Cross-polytopes [ TT’07, AILRS’15, KW’17 ] ◮ Hypercubes [ TT’07 ]

  47. Hypercube LSH [ Terasawa–Tanaka, WADS’07 ] O

  48. Hypercube LSH Vertices of hypercube O

  49. Hypercube LSH Random rotation O

  50. Hypercube LSH Voronoi regions O

  51. Hypercube LSH Defines partition O

  52. Hypercube LSH Collision probabilities 1 Hyperplane LSH Hypercube LSH ν → p ( θ ) 1 / d 3 π 1 π 0 arccos ( 2 0 π π π ) π 3 2 → θ

  53. Hypercube LSH Collision probabilities 1 Hyperplane LSH Hypercube LSH ν → p ( θ ) 1 / d 3 π 1 π 0 arccos ( 2 0 π π π ) π 3 2 → θ 2 ) − lie in the same orthant with probability ( 1 • Two vectors at angle ( π π ) d � • Two vectors at angle π 3 π ) d 3 lie in the same orthant with probability (

  54. Hypercube LSH Asymptotic performance (random data) 1 0.5 0.2 → ρ Hyperplane LSH 0.1 Hypercube LSH 0.05 Cross - polytope LSH 1 2 2 2 2 4 → c

  55. Hypercube LSH Asymptotic performance (random data) 1 0.5 0.2 → ρ Hyperplane LSH 0.1 Hypercube LSH 0.05 Cross - polytope LSH 1 2 2 2 2 4 → c � π c ln2 + O ( 1 2 • Hyperplane LSH: ρ = c 2 )

  56. Hypercube LSH Asymptotic performance (random data) 1 0.5 0.2 → ρ Hyperplane LSH 0.1 Hypercube LSH 0.05 Cross - polytope LSH 1 2 2 2 2 4 → c � π c ln2 + O ( 1 2 • Hyperplane LSH: ρ = c 2 ) � π c ln π + O ( 1 2 • Hypercube LSH: ρ = c 2 ) – saves factor log 2 ( π ) ≈ 1.65

Recommend


More recommend