Efficient Similarity Search in Dynamic Data Streams

Marc Bury, Chris SchwiegelshohnarXiv 2016 · OpenReview

TL;DR

This paper introduces the first locality-sensitive hashing (LSH) algorithm capable of efficiently handling both additions and deletions in dynamic data streams for similarity search, specifically focusing on the Jaccard index. This breakthrough addresses a critical limitation of existing LSH methods, enabling scalable similarity computations in real-world scenarios where data is constantly changing.

What Problem Does This Paper Address?

Nearest neighbor search, crucial for applications like recommendation systems and pattern recognition, becomes computationally challenging with massive datasets. Locality-Sensitive Hashing (LSH) is a popular technique for approximating similarity efficiently. However, existing LSH methods, often based on min-hashing, struggle with dynamic data streams, particularly when items are deleted. Recomputing similarity after deletions is computationally prohibitive. This paper tackles this gap by developing an LSH scheme that can effectively manage both insertions and deletions in data streams, a significant step towards real-time similarity analysis in evolving datasets.

Methods

The authors propose a two-pronged approach. First, they establish theoretical groundwork by showing that for a broad class of "rational set similarities" (including the Jaccard index), if their corresponding distance metric is well-behaved, a space-efficient summary can approximate the similarity within a $(1 \pm \varepsilon)$ multiplicative error in dynamic streams. This is achieved using a black-box reduction to $\ell_0$ norm estimation.

The core contribution is a novel LSH algorithm designed for dynamic data streams. This algorithm is inspired by min-hashing but incorporates techniques to handle deletions. Key elements include:

  • Sketching: Users' item sets are represented by compact sketches (polylog bits) instead of full matrices.
  • Cardinality-Based Filtering: An initial filtering step uses item set cardinalities to quickly discard dissimilar pairs.
  • Small Space Item Sampling: A nested hashing approach is used to maintain multiple samples of item indices for various "k" values, balancing space efficiency and sampling probability.
  • Selective Recomputation: In case of deletions, only "sensitive" buckets (those relevant to the current similarity thresholds) are recomputed, significantly reducing overhead compared to full recomputation.

Datasets

  • Synthetic Dataset: A large binary data matrix (10,000 rows, up to 1,000,000 columns) with varying sparsity (1-5% non-zero entries) was used. This dataset was augmented with pairs of rows having artificially increased Jaccard similarity to test performance on high-similarity pairs.
  • Last.FM Dataset: A real-world dataset containing temporal listening histories of 15K users, representing around 4.6M unique tracks and 700 music genres. This dataset was processed to create user profiles based on artists listened to, with insertions and deletions simulated based on listening activity and expiration thresholds.

Key Insights and Ideas

  • Deletions are the Achilles' Heel of Traditional LSH: The paper highlights that while min-hashing is efficient for insertions, it breaks down with deletions, necessitating a new approach.
  • Theoretical Foundation for Dynamic Similarity: The authors provide a theoretical basis for approximating rational set similarities in dynamic streams, linking LSH-ability to metric properties of the distance function.
  • Selective Recomputation is Key: The most significant practical insight is that by focusing recomputation efforts only on "sensitive" parts of the data structure during deletions, significant performance gains can be achieved.
  • Trade-offs in Parameter Tuning: The experimental results demonstrate clear trade-offs between parameters like a (inverse sampling rate) and c² (number of buckets) in terms of approximation quality, running time, and filtering effectiveness.

Key Results

  • First LSH for Dynamic Streams with Deletions: The paper presents the first LSH algorithm that efficiently handles both insertions and deletions in data streams.
  • Competitive Running Times: For insertion-only streams, the proposed algorithm shows comparable running times to existing methods. In fully dynamic streams with deletions, it significantly outperforms a baseline "Vanilla MinHashing" approach, being up to 100 times faster.
  • Space Efficiency: The algorithm uses a space-efficient sketch of polylog bits per user.
  • Good Approximation Quality: Experimental results on synthetic and Last.FM datasets show low average squared deviations between sketched and exact Jaccard similarities, indicating good approximation quality.
  • Effective Filtering: The algorithm demonstrates strong filtering capabilities, achieving over 90% filtering with low false positive rates on the Last.FM dataset.

Limitations and Future Work

  • Approximation Guarantees: While the algorithm provides good approximations, the paper notes that the theoretical guarantees are for individual pairs, and it's unclear if this holds simultaneously for all pairs, especially with small bucket sizes.
  • Parameter Sensitivity: The performance is sensitive to parameter choices (a, c²), requiring careful tuning for optimal results.
  • Extension to Other Similarities: The authors suggest extending their techniques to other similarity measures beyond the Jaccard index, particularly those used in collaborative filtering.
  • Real-world Deployment: While the Last.FM experiment is promising, further validation on diverse real-world datasets would be beneficial.
  • Sharp Thresholds: The paper acknowledges that achieving perfectly sharp thresholds for filtering (i.e., strictly separating pairs above and below a certain similarity) is challenging and might require lower r₁ values or different parameter combinations.

Summary updated

Abstract

The Jaccard index is an important similarity measure for item sets and Boolean data. On large datasets, an exact similarity computation is often infeasible for all item pairs both due to time and space constraints, giving rise to faster approximate methods. The algorithm of choice used to quickly compute the Jaccard index $\frac{\vert A \cap B \vert}{\vert A\cup B\vert}$ of two item sets $A$ and $B$ is usually a form of min-hashing. Most min-hashing schemes are maintainable in data streams processing only additions, but none are known to work when facing item-wise deletions. In this paper, we investigate scalable approximation algorithms for rational set similarities, a broad class of similarity measures including Jaccard. Motivated by a result of Chierichetti and Kumar [J. ACM 2015] who showed any rational set similarity $S$ admits a locality sensitive hashing (LSH) scheme if and only if the corresponding distance $1-S$ is a metric, we can show that there exists a space efficient summary maintaining a $(1\pm \varepsilon)$ multiplicative approximation to $1-S$ in dynamic data streams. This in turn also yields a $\varepsilon$ additive approximation of the similarity. The existence of these approximations hints at, but does not directly imply a LSH scheme in dynamic data streams. Our second and main contribution now lies in the design of such a LSH scheme maintainable in dynamic data streams. The scheme is space efficient, easy to implement and to the best of our knowledge the first of its kind able to process deletions.
BibTeX
@misc{bury2016efficient,
  author = {Marc Bury and Chris Schwiegelshohn},
  title = {{Efficient Similarity Search in Dynamic Data Streams}},
  year = {2016},
  eprint = {1605.03949},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1605.03949},
}
Figure