TL;DR
CAIMS is a novel framework that enables highly scalable top-$k$ similarity search across multiple in-memory search (IMS) arrays. By combining intelligent threshold-based matching with a hardware-software co-design, it achieves up to $22.3\times$ higher throughput and $426.6\times$ better energy efficiency than server-class CPUs while maintaining near-optimal search accuracy.
What Problem Does This Paper Address?
Top-$k$ similarity search is the backbone of modern AI applications like Retrieval-Augmented Generation (RAG) and recommender systems. However, as datasets grow, moving massive amounts of data between memory and processors creates a significant performance bottleneck.
In-memory search (IMS) using Content-Addressable Memory (CAM) offers a solution by processing data directly where it lives. The catch? A single CAM array is too small for modern workloads. When you split a dataset across multiple arrays, a "local vs. global" accuracy gap emerges: a candidate that looks like a "winner" in its local array might actually be a poor match globally. Existing designs struggle to accurately and efficiently combine these local results into a global top-$k$ list without incurring massive data transfer overhead or requiring power-hungry hardware like high-resolution ADCs.
Methods
The authors introduce CAIMS, a framework agnostic to specific memory technologies that focuses on three core schemes:
- Dataset-Assisted Scalable Search (DASS): Instead of just looking for the "best" match locally, DASS applies a unified threshold ($T_{filter}$) across all arrays. This transforms binary local matches into globally comparable "coarse-grained" similarity scores.
- Online Result Count Adaptation (ORCA): To handle shifts in query patterns, ORCA dynamically tunes search parameters at runtime. It ensures the system returns approximately $k$ results on average, maintaining a balance between accuracy and efficiency.
- Local Aggregation and Selective Transfer (LAST): This hardware-software co-design performs result reduction locally within the memory peripherals. It only transfers the final global selection results and minimal control signals, drastically reducing data movement.
Additionally, the paper utilizes Quantile Quantization to map high-precision vectors into 3-bit NAND Flash cells. Unlike standard quantization that minimizes reconstruction error, this method focuses on preserving the relative similarity between vectors, which is crucial for accurate top-$k$ ranking.
Datasets
The framework was evaluated using the retrieval phase of RAG on six diverse datasets from the BEIR and DPR benchmarks:
- Small/Medium: BEIR-SciFact (~5k candidates), BEIR-SciDocs (~25k), BEIR-Quora (~522k).
- Large: BEIR-NQ (~2.6M), DPR-NQ (~21M), DPR-TQA (~21M).
Key Insights and Ideas
- Coarse-Grained is Enough: You don't need expensive, high-resolution analog-to-digital converters (ADCs) to find the top-$k$ results. Aggregating simple binary threshold matches across partitioned dimensions provides a surprisingly effective proxy for global similarity.
- Unifying the Scale: The "aha moment" is realizing that local winners are meaningless without a shared reference. By enforcing a unified threshold across all arrays, CAIMS gives every local match the same "similarity interpretation," making global aggregation possible.
- Constant Latency Scaling: Because CAIMS exploits the massive internal parallelism of storage devices (like 3D NAND Flash), the search latency remains largely constant even as the dataset size grows, provided it fits within the parallel capacity of the hardware.
Key Results
Compared to a server-class CPU baseline and prior 3D NAND Flash accelerators, CAIMS demonstrated:
- Throughput: Up to $22.3\times$ improvement over CPU and $10.1\times$ over previous flash-based accelerators.
- Energy Efficiency: A massive $426.6\times$ gain over CPU and $23.7\times$ over prior art.
- Accuracy: Maintained comparable accuracy (HitRate@100) to theoretical-optimal brute-force search across all tested datasets.
- Hardware Feasibility: The additional logic required for LAST is minimal, incurring less than 1.5% area overhead per plane in a standard SSD architecture.
Limitations and Future Work
- Power Constraints: While CAIMS is energy-efficient, simultaneously activating many memory planes to maximize parallelism could exceed the power envelope of standard SSDs. The authors suggest that power-aware scheduling will be a necessary direction for future practical implementations.
- Memory Agnosticism: Although the framework is designed to be agnostic, the current evaluation is heavily centered on 3D NAND Flash. Exploring its performance on emerging non-volatile memories like RRAM or FeFET remains an open area.
- Distribution Shifts: While ORCA adapts to query shifts, extremely rapid or radical changes in data distribution might still require more frequent offline recalibration of the DASS parameters.
Summary updated