TL;DR
Building massive vector search indexes upfront across entire data lakes is prohibitively expensive, especially when many datasets are rarely queried. CrackIVF adapts the concept of database cracking to Approximate Nearest Neighbor Search (ANNS), constructing and refining an Inverted File (IVF) index incrementally as a side effect of answering incoming queries. It achieves 10–1000× faster startup times, processes hundreds of thousands of queries before static indexes finish building, and ultimately matches or exceeds the search performance of fully pre-built indexes.
What Problem Does This Paper Address?
Retrieval-Augmented Generation (RAG) empowers LLMs by querying external vector embeddings. In "embedding data lakes" containing millions of unstructured datasets, index selection faces an impossible trade-off:
- Pre-building static indexes (such as standard IVF or HNSW graphs) requires heavy upfront computational and memory costs that are wasted if the dataset is rarely accessed.
- Skipping indexing (brute-force scan) enables instant query response on cold data but fails to scale past tens or hundreds of queries.
Traditional "database cracking"—which incrementally organizes data during query processing—was originally designed for 1D database columns and exact search. Prior extensions to multidimensional data do not scale to the hundreds of dimensions and approximate nearest neighbor requirements typical of modern RAG embeddings.
Methods
CrackIVF extends FAISS Inverted File (IVF) indexes with adaptive cracking through two decoupled operations:
- CRACK (Partition Expansion): Treats incoming queries as prospective new cluster centroids ("cracks"). Instead of recomputing distances from scratch, it reuses the distance computations already performed during
SEARCHto "steal" nearby points from existing clusters. Cracking is buffered and executed lazily to avoid continuous data-movement overhead. - REFINE (Centroid Optimization): Runs localized K-means eagerly on the local partition region visited by a query to correct cluster imbalances and reposition centroids.
- Two-State Tracking & Rollbacks: Maintains both a committed
trueindex state and adynamicuncommitted state. If a localREFINEinvalidates prior point assignments, candidate cracks are safely rolled back before commitment. - Dual Control Mechanisms ("Where" and "When"):
- Where: Heuristic rules classify incoming queries to prevent wasteful operations (e.g., rejecting cracks that steal too few points or avoiding over-partitioning a local region).
- When: A multivariate linear regression cost model predicts the execution time of build kernels and enforces a strict budget (capping index maintenance to $\le 50\%$ of cumulative system runtime).
Datasets
The authors evaluated CrackIVF against standard open-source ANN benchmarks:
- SIFT1M & SIFT10M: 128-dimensional SIFT visual descriptors evaluated using Euclidean distance ($L_2$).
- DEEP10M: 96-dimensional image representation embeddings ($L_2$).
- GloVe (GloVe-50, GloVe-100): 1.18M word vectors (50-d and 100-d) evaluated using Inner Product / Cosine similarity.
- Last.fm: 64-dimensional user-music preference vectors evaluated using Inner Product, exhibiting natural query skew.
(Query traces were replicated up to 1M queries to evaluate scalability; no new benchmarks were introduced.)
Key Insights and Ideas
- Decoupling Partitioning from Refining: Index quality relies on two independent levers: increasing partition counts and refining point distribution via K-means. Separating these operations across time and space avoids expensive global retraining.
- Capitalizing on Query Skew: In real-world workloads, query distributions are heavily skewed (often leaving up to 85% of vector partitions untouched). CrackIVF naturally allocates partitions and fine-tuning compute only where queries actually land, skipping cold regions of the vector space.
- Zero-Cost Partition Proposals: Because IVF query processing naturally computes distances between queries and candidate vectors, query execution itself does the heavy lifting of identifying centroid locations and point reassignments.
Key Results
- Instantaneous Startup: CrackIVF initialized 10× to 1000× faster than pre-built IVF baselines. On SIFT10M, CrackIVF served between 100,000 and 1,000,000 queries before large baseline indexes (IVFFlat-5000 and 16000) even finished building.
- Pareto-Optimal Query Performance: As query volume scaled, CrackIVF converged to the Pareto frontier of pre-built indexes. On the skewed Last.fm dataset, CrackIVF achieved ~50% higher QPS at 0.90 Recall@10 than static baselines with a fraction of the partitions (1,264 final clusters).
- Comparison to Cracking Baselines: Outperformed AV-Tree (an exact k-NN cracking baseline) by 3.7× in cumulative time over 1M queries on SIFT1M.
- Practical Rule of Thumb: Brute force is best for $<10\text{--}100$ queries; CrackIVF becomes the dominant strategy once a dataset receives more than 100 queries.
Limitations and Future Work
- Static Datasets Only: The system evaluates static data distributions without considering streaming insertions, deletions, or data drift.
- Simplified Cost Model: The linear cost model ignores nonlinear system phenomena like CPU cache hierarchies, SIMD efficiency, and NUMA memory layout.
- Hand-Tuned Heuristic Boundaries: While default heuristic thresholds demonstrated cross-dataset stability, the authors note that optimal boundaries are dataset-dependent and could benefit from automated learning.
- Extension to Graph Indexes: Future research remains to apply adaptive cracking ideas to graph-based indexes (like HNSW), dynamically rewiring graph edges based on query frequency.
Summary updated