Accelerating Retrieval-Augmented Generation

Derrick Quinn, Mohammad Nouri, Neel Patel, John Salihu, Alireza Salemi, Sukhan Lee, Hamed Zamani, Mohammad Alian

Retrieval-Augmented Generation (RAG) has become the gold standard for reducing hallucinations in Large Language Models (LLMs) by grounding them in external facts. However, as vector databases scale to terabytes, the "retrieval" part of RAG has become a massive bottleneck. At ASPLOS 2025, researchers from Cornell and their collaborators introduced the Intelligent Knowledge Store (IKS), a novel hardware-software co-design that moves vector search directly into memory.

TL;DR

The Intelligent Knowledge Store (IKS) is a CXL-based memory expander that accelerates RAG by offloading Exact Nearest Neighbor Search (ENNS) to near-memory accelerators. By making exact search efficient, IKS allows LLMs to use smaller, higher-quality context windows, resulting in up to a 26.3× speedup in end-to-end inference time compared to state-of-the-art CPUs.

What Problem Does This Paper Address?

In a typical RAG pipeline, the system must search through millions (or billions) of "embedding vectors" to find the most relevant documents for a user's query. This process, known as Nearest Neighbor Search, is notoriously expensive.

Currently, developers face a lose-lose choice:

  1. Exact Search (ENNS): Highly accurate but painfully slow on CPUs, often consuming up to 97% of total inference time.
  2. Approximate Search (ANNS): Faster, but lower quality. To compensate for the "fuzziness" of approximate results, developers often have to send more documents to the LLM to maintain accuracy. Because LLM generation time scales with input length, this "faster" search actually makes the overall system slower.

Furthermore, GPUs—while fast—are expensive and limited by their onboard memory (HBM) capacity, making them inefficient for the massive, terabyte-scale databases required for enterprise-grade RAG.

Methods

The authors propose IKS, a "Type-2" CXL (Compute Express Link) device. IKS acts as a memory expander (adding DRAM to the server) but contains specialized logic to perform vector math right where the data lives.

Key Innovations:

  • Near-Memory Accelerators (NMAs): Instead of one giant processor, IKS uses a scale-out architecture. It places small, low-profile accelerators next to eight LPDDR5X memory packages. This provides massive internal bandwidth (1 TB/s) that a central CPU simply cannot match.
  • Cache-Coherent Interface: IKS leverages the CXL.cache protocol to create a "doorbell" mechanism. The host CPU writes a query to a shared memory buffer, and the IKS device is notified instantly via hardware cache coherency—eliminating the high overhead of traditional system calls or interrupts.
  • Hardware-Optimized Top-K: The device includes dedicated hardware units to track and sort the "Top-K" most relevant results, a task that typically bogs down general-purpose SIMD units on GPUs and CPUs.
  • Data Layout: Embedding vectors are stored in a specific column-major block format (68 vectors per block) to perfectly saturate the NMA's processing engines.

Datasets

The researchers evaluated IKS using:

  • Natural Questions (NQ): A standard benchmark for open-domain question answering.
  • KILT Benchmark: Used for training and validating the retrieval models.
  • Wikipedia: Used as the massive external knowledge source (corpus).
  • Models: Evaluation was performed across FiDT5, Llama-3-8B, and Llama-3-70B.

Key Insights and Ideas

  • The "Exact Search" Paradox: The most surprising finding is that exact search is faster than approximate search for the end-user. Because ENNS is more accurate, you can send a very small number of documents (e.g., $K=1$) to the LLM. ANNS requires a larger $K$ (e.g., $K=16$) to reach the same accuracy. The time saved in the LLM's generation phase by having a shorter prompt far outweighs the extra cost of the exact search—provided you have the right hardware.
  • CXL as the "Sweet Spot": By using CXL, IKS solves the "stranded memory" problem. When the server isn't doing RAG, the IKS memory can be used by other applications as regular system RAM.
  • Memory Bandwidth is King: Vector search is strictly limited by how fast you can read from memory. By placing compute at the "shoreline" of LPDDR5X, IKS achieves higher effective throughput than an NVIDIA H100 for this specific task, despite having lower raw TFLOPS.

Key Results

  • Search Speedup: IKS delivers 13.4–27.9× faster exact search over a 512GB database compared to Intel Sapphire Rapids CPUs.
  • End-to-End Performance: For full RAG applications, this translates to a 1.7–26.3× reduction in total inference time.
  • Efficiency vs. GPUs: A single IKS unit outperformed a high-end GPU for a 50GB corpus because the GPU's memory architecture isn't optimized for the "Top-K" aggregation required in vector search.
  • Scalability: IKS provides near-perfect weak scaling; adding more units allows for searching multi-terabyte databases with almost no increase in latency.

Limitations and Future Work

  • Exhaustive Nature: IKS currently performs an exhaustive search (reading every vector). While fast, the authors note that incorporating "early termination" logic (stopping the search once a good enough match is found) could save even more energy.
  • Batch Size Sensitivity: The current NMA utilization is lower for very small batch sizes (less than 64 queries at once). Future iterations could use dynamic voltage and frequency scaling to save power during low-load periods.
  • Multi-node Deployment: The study focused on a single-server setup; exploring how IKS behaves in a distributed, multi-node cluster remains an open area for research.

Summary updated

BibTeX
@inproceedings{quinn2025accelerating,
  author = {Derrick Quinn and Mohammad Nouri and Neel Patel and John Salihu and Alireza Salemi and Sukhan Lee and Hamed Zamani and Mohammad Alian},
  title = {{Accelerating Retrieval-Augmented Generation}},
  booktitle = {ASPLOS},
  year = {2025},
  doi = {10.1145/3669940.3707264},
}

Loading related content...

Figure