TL;DR
LSHBloom is a novel architectural extension to MinHashLSH that replaces traditional, bulky tree- or hashmap-based indexing structures with an array of independent, probabilistic Bloom filters. By mapping locality-sensitive hashing (LSH) bands directly to contiguous bit vectors, it achieves a 12× throughput speedup and an 18× reduction in disk footprint compared to standard MinHashLSH, all while maintaining near-identical deduplication accuracy.
What Problem Does This Paper Address?
Internet-scale text databases—such as those used to train Large Language Models (LLMs)—are plagued by redundancy, with web-scraped corpora containing anywhere from 14% to 52% near-duplicate records. This redundancy inflates training costs, degrades language modeling performance, and slows down downstream applications like vector databases and full-text search engines.
While Locality-Sensitive Hashing (MinHashLSH) is the gold standard for identifying these near-duplicates, its traditional index implementations scale poorly. They rely on trees or hashmaps that suffer from massive disk footprints and high "pointer-chasing" latencies due to non-contiguous memory accesses. For instance, deduplicating the relatively small 39-million-document peS2o dataset using standard MinHashLSH requires over 200 GB of disk space and 35+ core hours, making billion-scale deduplication intractable on commodity hardware.
Methods
LSHBloom introduces a space-efficient, similarity-aware approximate membership query structure. Instead of storing full MinHash signatures in a traditional index, the authors assign an independent Bloom filter to each LSH band.
The pipeline works as follows:
- Signature Generation: A document's MinHash signature is computed and divided into $b$ bands of size $r$.
- Band Hashing: To insert or query a band, its vector of integers is hashed into a single integer value using a hardware-optimized universal hashing approach: $$\bar{h}(x) = \left( \sum_{i=1}^{r} h_i(x_i) \right) \pmod N$$
- Probabilistic Indexing: This single integer is then inserted into or queried against the corresponding Bloom filter. A collision in any of the $b$ Bloom filters flags the document as a duplicate.
Hardware-Software Co-design Optimizations
To maximize throughput, the authors implemented two key optimizations:
- Low-Level Assembly Hashing: Profiling revealed that Python's software extended-precision integer representation was a massive bottleneck. The authors rewrote the core vector-hashing logic in Rust, utilizing 128-bit fixed-precision arithmetic and native x86_64 assembly instructions (
adcor "add with carry"). This single change made the hashing operation 94% faster, leading to an 11× end-to-end wall-clock improvement. - Shared Memory Utilization: Because the Bloom filter indices are so compact, they can be hosted entirely in node-local shared memory segments (
/dev/shm), keeping the index in DRAM and eliminating slow disk I/O during queries.
Datasets
The authors evaluated their approach using:
- peS2o: A dataset of 39 million academic documents used to benchmark resource usage and scaling behavior at scale.
- Synthetic Tuning & Testing Datasets: To rigorously evaluate deduplication fidelity, the authors built a pipeline using scientific articles parsed via different tools (PyMuPDF, Nougat, Tesseract) and introduced random truncations. This emulates real-world web-scraping noise. They generated a 24,000-document dataset for hyperparameter tuning and a 50,000-document dataset (with duplication levels varying from 10% to 90%) for testing.
Key Insights and Ideas
- Approximating the Index: The core "aha" moment is realizing that the LSH index matching process itself can be approximated using probabilistic data structures. The resulting false positive overhead is analytically boundable and can be configured to be negligibly low.
- Index Size Invariance: Unlike traditional LSH indices, which grow linearly if you increase the bit-width of the hash values, the size of an LSHBloom index is completely invariant to the size of the MinHash hash values. This allows practitioners to use highly precise 64-bit or 128-bit integers to improve Jaccard similarity estimates at zero additional index storage cost.
- The Hidden Cost of High-Level Languages: A major takeaway for systems engineers is how easily high-level language abstractions (like Python's arbitrary-precision integers) can quietly destroy performance in data-intensive pipelines, and how targeted native rewrites (Rust/Assembly) can alleviate these bottlenecks.
Key Results
- Throughput & Speedup: On the 39M-document
peS2odataset, LSHBloom completed deduplication in just 3 hours compared to MinHashLSH's 37 hours—a 12× speedup. As shown in Figure 1, LSHBloom drastically reduces both insertion and query durations.
- Disk Space Reduction: LSHBloom required only 11 GB of disk space to process
peS2o, representing an 18× reduction over the 200+ GB required by traditional MinHashLSH. - Fidelity Maintained: LSHBloom achieved an F1 score within 1% of traditional MinHashLSH, significantly outperforming alternative paragraph- and n-gram-level methods (like Dolma and CCNet) on precision, especially when duplicates were rare.
- Billion-Scale Extrapolation: Projections for a 5-billion document corpus estimate that traditional MinHashLSH would require 200 days of compute and 277 TB of storage. LSHBloom is projected to handle the same workload in 15 days using just 15.5 TB of space.
Limitations and Future Work
While highly efficient, LSHBloom currently performs index insertions sequentially to prevent race conditions and duplicate identification errors. Though the optimized hashing routines make this step incredibly fast, developing a safely parallelized insertion strategy across threads or nodes remains a goal for future work. Additionally, the authors note that their synthetic evaluation dataset primarily mimics web-scraping artifacts and parsing noise; they hope to validate LSHBloom against more diverse, real-world forms of data duplication in the future.
Summary updated