Introduction
In modern data science, measuring similarity between high-dimensional weighted sets is a fundamental task. While Jaccard Similarity suffices for binary sets, real-world applications—such as text mining with word frequencies—require Weighted Jaccard Similarity (WJS). To process massive datasets efficiently, researchers rely on "sketches," compact data summaries that allow for rapid similarity estimation. The Improved Consistent Weighted Sampling (ICWS) algorithm has long been the gold standard for generating these sketches. However, ICWS is computationally intensive, requiring multiple random number generations, logarithms, and exponentiations for every feature. This paper introduces Simplified Consistent Weighted Sampling (SCWS), an engineered alternative that achieves up to a 22x speedup while maintaining the accuracy of ICWS.
Methodology
The efficiency of SCWS stems from two primary innovations: mathematical simplification and a hardware-aware pooling strategy.
Mathematical Simplification
By building on the principles of "0-bit" CWS—which demonstrates that only the index of the winning feature is necessary for similarity estimation—the authors simplified the ICWS derivation. By removing the "floor" function, the complex hashing formula collapses into a straightforward calculation: $a_z = w(S, z)^{-1} \cdot \text{RandomValue}$. This reduction transforms a sequence of expensive transcendental functions into a single floating-point multiplication (FLOP).
The Pooling Strategy
Unlike ICWS, where random values are tied to weights and must be generated on-the-fly, the random component in SCWS is independent. The authors utilize a pre-calculated "pool" of 4,000 random values. This pool size is specifically chosen to fit within a processor's L1 cache, preventing memory latency bottlenecks. To access these values, a fast Linear Congruential Generator (LCG) picks an index, ensuring the entire hashing process remains extremely lean.
Experimental Evaluation
The authors evaluated SCWS against ICWS and other variants using eight diverse, high-dimensional datasets from the LIBSVM repository, including MNIST (digit recognition), RCV1 (text classification), and URL (malicious URL detection with over 3 million features).
Key Results
The empirical results demonstrate that SCWS provides a massive performance boost without sacrificing fidelity.
Performance Gains
SCWS was consistently 7.7x to 22.1x faster than ICWS across all tested datasets. For instance, on the MNIST dataset, the time required for hashing was slashed from approximately 2,000 seconds to just 86 seconds. This speedup is visualized in Figure 1, where SCWS reaches low bias thresholds significantly faster than its predecessors.
Accuracy and Robustness
Despite the simplification and the use of a finite random pool, SCWS maintains parity with ICWS in classification accuracy (using SVMs) and Nearest Neighbor search precision. The pooling strategy proved robust; reusing 4,000 random values millions of times yielded results virtually indistinguishable from generating unique random numbers for every operation.
Conclusion and Future Work
SCWS represents a significant step forward in scalable similarity estimation. By prioritizing hardware efficiency and mathematical simplicity, it removes a major bottleneck in large-scale data processing. While SCWS is a high-fidelity approximation rather than an exact clone of ICWS, its empirical performance is compelling. Future research will focus on establishing formal mathematical error bounds and exploring adaptive sketching techniques that leverage the algorithm's extreme speed.
Summary updated