REAPER: Reasoning based Retrieval Planning for Complex RAG Systems

Ashutosh Joshi, Sheikh Muhammad Sarwar, Samarth Varshney, Sreyashi Nag, Shrivats Agrawal, Juhi Naik

TL;DR

REAPER (REAsoning-based PlannER) is a specialized 7B-parameter LLM designed to generate complex, multi-step retrieval plans for RAG systems in a single pass. By offloading retrieval logic to a dedicated planner, it achieves a 10x reduction in latency compared to general-purpose agents while maintaining 96% accuracy in tool selection.

Introduction: The Reasoning Bottleneck in RAG

Retrieval-Augmented Generation (RAG) is evolving from simple document lookups to complex, multi-step workflows. In domains like conversational shopping, a single query such as "How much memory is on my phone?" requires a sequence of actions: first identifying the specific device from a user's order history, and then retrieving technical specifications for that specific model.

Existing solutions typically fall into two categories, both of which present significant drawbacks for real-time applications:

  1. Chain-of-Thought (CoT) Agents: These systems interleave reasoning and retrieval. While flexible, the iterative nature adds seconds of latency per step, making them unsuitable for low-latency chat interfaces.
  2. Classifiers: These route queries to specific tools but often fail at multi-step logic and are difficult to scale as new tools are introduced.

REAPER addresses this "reasoning bottleneck" by utilizing a fast, specialized model dedicated solely to retrieval planning.

The REAPER Methodology

REAPER is built upon a fine-tuned Mistral-7B-Instruct-v0.2. Unlike standard agents that follow an "act-and-observe" loop, REAPER adopts the Reasoning Without Observation (ReWOO) paradigm. It generates a complete execution plan—including tool selection, sequence, and arguments—in a single forward pass.

REAPER architecture for sequential retrieval planning.

To achieve high performance with limited in-domain data, the authors developed a robust data generation pipeline:

  • Tool Evolve (TEvo): Automatically paraphrases tool descriptions to prevent overfitting to specific phrasing.
  • Tool-Task Generator (TTG): Creates auxiliary tasks, such as reordering steps, to ensure the model understands underlying tool logic.
  • Diverse Query Sampler (DQS): Uses BERT-based embeddings to ensure the training set covers a wide semantic range of potential user queries.
  • Balanced Fine-Tuning: The model is trained on a mix of domain-specific planning data and general Instruction Fine-Tuning (IFT) data (at a 1:6 ratio) to maintain general reasoning capabilities and prevent "instruction forgetting."

Experimental Setup and Datasets

The model was evaluated using a dataset of 6,000 unique queries from an Amazon conversational shopping context, expanded via synthesis to approximately 19k–32k tasks. Evaluation focused on six distinct classes: Customer Support, Shipment Status, Product Search, Product Q&A, Review Summary, and No-retrieval.

Key Results

REAPER demonstrates that high-speed planning does not require a massive, general-purpose LLM. Key performance metrics include:

  • Latency: REAPER generates a full plan in just 207ms, whereas models like Claude-3 Sonnet can take ~2 seconds per reasoning step.
  • Accuracy: The model achieved 96% tool selection accuracy, significantly outperforming zero-shot Mistral (72%) and a RoBERTa-based ensemble classifier (94%).
  • Argument Precision: It reached 92% accuracy in generating correct tool arguments (e.g., specific Product IDs).
Performance comparison across task classes showing REAPER's high precision and recall.

Furthermore, the system proved highly scalable; it successfully learned to utilize a new compatible_products tool with fewer than 300 training examples.

Conclusion

REAPER proves that the perceived tradeoff between latency and accuracy in RAG systems can be overcome through specialized planning. By separating the retrieval plan from response generation, developers can create modular, high-performance systems that are both fast enough for real-time interaction and accurate enough for complex enterprise tasks.

Summary updated

BibTeX
@inproceedings{joshi2024reaper,
  author = {Ashutosh Joshi and Sheikh Muhammad Sarwar and Samarth Varshney and Sreyashi Nag and Shrivats Agrawal and Juhi Naik},
  title = {{REAPER: Reasoning based Retrieval Planning for Complex RAG Systems}},
  booktitle = {ACM International Conference on Information and Knowledge Management},
  year = {2024},
  doi = {10.1145/3627673.3680087},
}
Figure