Sketching as a tool for Algorithmic Design Alex Andoni (Columbia - - PowerPoint PPT Presentation
Sketching as a tool for Algorithmic Design Alex Andoni (Columbia - - PowerPoint PPT Presentation
Sketching as a tool for Algorithmic Design Alex Andoni (Columbia University) Find similar pairs Methodology ? Small space algorithms Sketching Fast algorithms 000000 000000 dimension 011100 011100 010100 010100 reduction 000100
Find similar pairs
000000 011100 010100 000100 010100 011111 000000 001100 000100 000100 110100 111111
Methodology ?
000000 011100 010100 000100 010100 011111 000000 001100 000100 000100 110100 111111β
Sketching Fast algorithms
- compression
- good for
specific task
- lossy
dimension reduction
Dimension reduction: linear map π: βπ β βπ s.t:
- for any points π, π β βπ:
Pr
π ||π π βπ(π)|| ||πβπ||
β 1 Β± π β₯ 1 β π [Johnson- Lindenstraussβ84]: π = Gaussian matrix π = π 1 π2 log 1 π
Small space algorithms
Plan
4
ο½ Numerical Linear Algebra ο½ Nearest Neighbor Search ο½ Min-cost matching in plane
a sketch of sketching applicationsβ¦
Plan
5
ο½ Numerical Linear Algebra
ο½ the power of linear sketches
ο½ Nearest Neighbor Search ο½ Min-cost matching in plane
Numerical Linear Algebra
ο½ Problem: Least Square Regression
ο½ π¦β = ππ πππππ¦||π΅π¦ β π|| ο½ where π΅ is π Γ π matrix ο½ π β« π ο½ 1 + π approximation
ο½ Idea: Sketch-And-Solve
ο½ solve π¦β² = ππ πππππ¦||π β π΅π¦ β π || = ππ πππππ¦||ππ΅π¦ β ππ||
ο½ where π: βπ β βπ is a dimension-reducing matrix
ο½ reduces to much smaller π Γ π problem ο½ Hope: ||π΅π¦β² β π|| β€ 1 + π ||π΅π¦β β π||
π΅ π β ππ΅ π¦ ππ β π¦ π π
Sketch-And-Solve
[Sβ06, CWβ13, NNβ13, MMβ13, Cβ16]
ο½ Issue: time to compute sketch
ο½ When π=Gaussian ([JL]) β computing ππ΅ takes π(π β π2) time ο½ Idea: structured π s.t. ππ΅ can be computed faster
ο½ +structured π: π πππ¨ π΅ +
π π π 1
time
ο½ +Preconditioner: π
πππ¨ π΅ + ππ 1 β log
1 π
Oblivious Subspace Embedding: linear map π: βπ β βπs.t.
- for any linear subspace π β βπ of dimension π:
Pr
π
βπ β π βΆ
||π π || ||π|| β 1 Β± π
β₯ 1 β π π~π
slower than the
- riginal problem !
β1 regression
ο½ No similar dimension reduction in β1 [BCβ04,JNβ09] ο½ +structured π, +preconditioner: π πππ¨ π΅ β log π +
π π π 1
ο½ More: other norms (βπ, M-estimator, Orlicz norms), low-rank
approximation & optimization, matrix multiplication, see [Woodruff, FnTTCSβ14,β¦]
Weak DR: linear map π: βπ β βπ, s.t.
- for any π β βπ: Pr
π
1 β€
||π π ||1 ||π||1
β€
1 π β₯ 1 β π(π)
Weak(er) OSE: linear map π: βπ β βπs.t.
- for any linear subspace π β βπof dimension π:
Pr
π
βπ β π βΆ 1 β€
||π π ||1 ||π||1
β€ ππ 1 β₯ 0.9 πππ βΌ Cauchy distribution, or 1/Exponential π = π(π β log π)
[Iβ00] [SWβ11, MMβ13, WZβ13, WWβ18]
Plan
9
ο½ Numerical Linear Algebra ο½ Nearest Neighbor Search
ο½ ultra-small sketches
ο½ Min-cost matching in plane
Approximate Near Neighbor Search
ο½ Preprocess: a set of π point
ο½ approximation π > 1
ο½ Query: given a query point π, report a
point πβ β π with the smallest distance to π
ο½ up to factor π
ο½ Near neighbor: threshold π ο½ Parameters: space & query time
10
π π πβ πβ² ππ
Ultra-small sketches
11
ο½ [KORβ98,IMβ98]: β2, β1 have 1 + π, 0.1, π
1 π2
- DE
sketches
ο½ Via: bit sampling (Hamming), ο½ or discretizing dimension reduction
Distance Estimation Sketch: for approx π, & all thresholds π map π: βπ β {0,1}π, estimator π(β ,β ), s.t. for any π, π β βπ:
- ||π β π|| β€ π , then Pr
π π π π , π π
= "ππππ‘π" β₯ 1 β π
- ||π β π|| > ππ , then Pr
π π π π , π π
= "ππππ‘π" β€ π (π, π, π)- DE sketch const # of bits!
000000 011100 010100 000100 010100 011111
DE Sketch => NNS
12
Proof: construct a sketch with failure probability 1/π
ο½ by concatenating π log π i.i.d. copies of the sketch, and taking
majority vote
ο½ Data structure: a look-up table for all possible sketches of a
query: 2π πβ log π = ππ π possibilities only
ο½ Query time: computing the sketch, typically ~π(ππ log π)
[see also ACβ06]
Const size DES => NNS with polynomial space!
[KORβ98,IMβ98]: (π, 1/3, π)-DES imply π-approx NNS with space ππ π and 1 memory probe per query [AK+ANNRWβ18]: (π, 0.1, π)-DES implies NNS with π(ππ)-approximation and π(π1.1) space, π π0.1 memory probes per query
[AKRβ15]: when π is a norm:
Beyond β1 and β2
13
π·-embedding of metric π into βπ: for distortion πΈ, power π½ β₯ 1: map π: π β β1, s.t. for any π, π β π:
- ||π π β π π ||π½ β€ πππ‘π’π π, π β€ πΈ β ||π π β π π ||π½
Embedding with πΈ = π
OPEN: if π½ = 1 achievable
π π , 0.1, π 1
- DES
NNS Embedding with πΈ = π(ππ) π π , 0.1, π -DES
Not true for general π [KN]
NNS with smaller space?
14
ο½ Space closer to linear in π ? LSH Sketch: for approx π, & β thresholds π map π: βπ β {0,1}π, estimator π(β ,β ), s.t. for any π, π β βπ:
- ||π β π|| β€ π , then Pr
π π π π , π π
= "ππππ‘π" β₯ 2βππ
- ||π β π|| > ππ , then Pr
π π π π , π π
= "ππππ‘π" β€ 2βπ+1
- πΉ π, π = "ππππ‘πβ iff π = π
(π, π, π)-LSH
[IMβ98]: (π, π, π)-LSH imply π-approx NNS with π(π1+π) space and π ππ memory probes per query
[IMβ98]: π = 1/π for β1
Plan
15
ο½ Numerical Linear Algebra ο½ Nearest Neighbor Search ο½ Min-cost matching in plane
ο½ specialized sketches
ο½ Exploit sketches for:
ο½ input ο½ internal state / partial computations
Computation
ο½ Problem:
ο½ Given two sets π΅, πΆ of points in β2, ο½ Find min-cost matching (1 + π approx.) ο½ a.k.a., Earth-Mover Distance, optimal transport,
Wasserstein metric, etc
ο½ Classically: LP with π2 variables
ο½ General: ΰ·¨
π(π2/π4) time [AWRβ17]
ο½ In 2D: hope for β π time [SAβ12]
LP for Geometric Matching
16
min
πββ+
π2 ΰ·
ππ
||ππ β ππ|| β πππ s.t. ππ =
1 π π and ππ’π = 1 π π
[ANOYβ14]: Solve-And-Sketch framework Solves in π1+π(1) time (for fixed π)
Solve-And-Sketch (=Divide & Conquer)
ο½ Partition the space hierarchically in a βnice wayβ ο½ In each part
ο½ Compute a βsolutionβ for the local view ο½ Sketch the solution using small space ο½ Combine local sketches into (more) global solution
17
ο½ Partition the space hierarchically in a βnice wayβ ο½ In each part
ο½ Compute a βsolutionβ for the local view ο½ Sketch the solution using small space ο½ Combine local sketches into (more) global solution
Solve-And-Sketch for 2D Matching
quad-tree after committing to a wrong alternation, cannot get <2 approximation! cannot precompute any βlocal solutionβ
all potential local solutions
Sketch of all potential local solutions: Small-space sketch of the βsolutionβ function πΊ: βπ β β+
- input π¦ β βπ defines the flow (matching) at the
βinterfaceβ to the rest
- πΊ(π¦) is the min-cost matching assuming flow π¦ at
interface
Exists with polylog(n) space
A sketch of the rest
19
ο½ Numerical Linear Algebra
ο½ linear sketching
ο½ Nearest Neighbor Search
ο½ ultra-small sketches
ο½ Min-cost matching in plane
ο½ specialized sketching
ο½ Graph sketching
ο½ Linear sketch for graph => data structures for dynamic connectivity
[AGMβ12, KKMβ13]
ο½ Characterization of DE-sketch size for metrics:
ο½ For symmetric norms [BBCKYβ17]
ο½ Adaptive sketching: when we know we sketch set π΅ β βπ
ο½ Then π β may depend (weakly) on π΅ ο½ Non-oblivious subspace embeddings [DMMβ06,β¦, Woodruffβ14] ο½ Data-dependent LSH [AINRβ14, ARβ15]
Sketching Fast algorithms
Bibliography 1
20
ο½ Sarlosβ06 ο½ Clarkson-Woodruffβ13, ο½ Nguyen-Nelsonβ13, ο½ Mahoney-Mengβ13, ο½ Cohenβ16 ο½ Indykβ00 ο½ Sohler-Woodruffβ11 ο½ Woodruff-Zhangβ13 ο½ Wang-Woodruffβ18 (arxiv)
Bibliography 2
21
ο½ Kushilevitz-Ostrovsky-Rabaniβ98 ο½ Indyk-Motwaniβ98 ο½ Ailon-Chazelleβ06 ο½ Khot-Naor (unpublished) ο½ A-Krauthgamer (unpublished) ο½ A-Naor-Nikolov-Razenshteyn-Weingartenβ18 ο½ Altschuler-Weed-Rigoletβ17 ο½ Sharathkumar-Agarwalβ12
ο½ A.-Nikolov-Onak-Yaroslavtsevβ14
ο½ Ahn-Guha-McGregorβ12 ο½ Kapron-King-Mountjoyβ13 ο½ Blasiok-Braverman-Chestnut-Krauthgamer-Yangβ17 ο½ Drineas-Mahoney-Muthukrishnanβ06 ο½ A-Indyk-Nguyen-Razenshteynβ14 ο½ A-Razenshteynβ15