TL;DR
DiskJoin is a novel algorithm designed to perform billion-scale vector similarity joins on a single machine using high-performance SSDs. By shifting from a "query-based" search approach to a "batch-based" orchestration strategy, it achieves speedups of 50× to 1000× over state-of-the-art methods, effectively eliminating disk I/O as the primary bottleneck.
What Problem Does This Paper Address?
Vector similarity joins—finding all pairs of vectors within a certain distance threshold—are essential for tasks like deduplicating massive LLM training sets or identifying similar videos on platforms like YouTube. However, when datasets reach the billion-scale, they no longer fit in a single machine's RAM.
Existing solutions fall into two camps:
- Distributed Clusters: These are expensive to deploy and often bogged down by slow inter-machine communication.
- Disk-Based Search: These use SSD-optimized indices (like DiskANN) to treat every vector as a separate query. This leads to "read amplification" (reading a full 4KB disk page for a tiny 512B vector) and "repetitive access" (reading the same data from disk multiple times for different queries).
The authors tackle the challenge of making these joins efficient on a single, cost-effective machine by rethinking how we access data on disk.
Methods
DiskJoin introduces three key technical innovations:
- Access Batching (Bucketization): Instead of processing vectors one by one, DiskJoin groups similar vectors into "buckets." It then reorganizes the disk layout so that vectors in the same bucket are stored consecutively. This allows the system to read large, sequential blocks of data, which is exactly what NVMe SSDs are built for.
- Task Orchestration: The join is modeled as an edge-covering problem on a "bucket graph" (where edges represent buckets that might contain similar vectors). Because the algorithm knows the entire "future" of the join process, it uses a greedy graph reordering heuristic to ensure that buckets processed in sequence share as many neighbors as possible.
- Optimal Caching (Belady’s Algorithm): Unlike standard systems that use LRU (Least Recently Used) caching, DiskJoin uses Belady’s algorithm—the theoretically optimal eviction policy. Since the task orchestration provides a perfect roadmap of future data needs, the system can precisely choose which bucket to evict to minimize future disk reads.
- Probabilistic Pruning: To further speed up computation, the authors use a statistical pruning technique that skips bucket pairs unlikely to contain similar vectors, while still meeting a user-defined recall target (e.g., 90% or 99%).
Datasets
The authors evaluated DiskJoin on three massive, real-world datasets:
- Deep100M: 100 million image embeddings (96 dimensions).
- BigANN100M: 100 million SIFT descriptors (128 dimensions).
- SPACEV1B: A staggering 1.4 billion document embeddings (100 dimensions), totaling over 500 GB of data.
Key Insights and Ideas
- Join is not Search: The most important "aha" moment is that a similarity join is an offline batch task, not an online query task. This distinction allows the system to plan its data access ahead of time, turning a chaotic random-access problem into a streamlined sequential one.
- The "Perfect Knowledge" Advantage: By building the bucket graph first, the system gains "perfect knowledge" of the workload. This enables the use of Belady’s eviction policy, which is rarely seen in practice because most systems don't know what data they will need next.
- I/O is no longer the enemy: Through these optimizations, DiskJoin achieves nearly zero read amplification. In fact, the authors found that disk I/O became so efficient that the CPU's distance computations became the new bottleneck.
Key Results
- Massive Speedups: On the BigANN100M dataset, DiskJoin completed the join in 1,185 seconds, while a baseline using DiskANN took 130,107 seconds (a ~110x improvement).
- I/O Efficiency: DiskJoin reduced disk traffic by orders of magnitude. For the Deep100M dataset, DiskANN read 139,485 GB of data, while DiskJoin only needed to read 181 GB.
- Scalability: DiskJoin successfully processed the 1.4 billion vector SPACEV1B dataset on a single machine with RAM limited to just 10% of the dataset size—a feat that caused other baselines to fail or take days to complete.
Limitations and Future Work
- Static vs. Dynamic: The current implementation is optimized for static datasets. While many deduplication tasks are one-off batch processes, adapting DiskJoin for streaming data where vectors are constantly added remains an open challenge.
- GPU Acceleration: Since the bottleneck has shifted from disk I/O to computation, the authors suggest that offloading distance calculations to GPUs could provide even further acceleration.
- High-Dimensional Pruning: While the probabilistic pruning is effective, the "curse of dimensionality" still looms; as dimensions increase, the number of candidate buckets that must be checked grows, potentially impacting performance on extremely high-dimensional embeddings (e.g., >1000 dimensions).
Summary updated