[Paper Review] Context Tuning for Retrieval Augmented Generation
This paper introduces Context Tuning, a novel component for Retrieval-Augmented Generation (RAG) that enhances tool retrieval and planner accuracy by proactively retrieving contextual information for ambiguous or incomplete queries. By leveraging numerical, categorical, and usage-based signals with a lightweight RRF-LambdaMART model, it achieves a 3.5-fold improvement in Recall@K for context retrieval and an 11.6% increase in planner accuracy, outperforming even GPT-4-based retrieval systems.
Large language models (LLMs) have the remarkable ability to solve new tasks with just a few examples, but they need access to the right tools. Retrieval Augmented Generation (RAG) addresses this problem by retrieving a list of relevant tools for a given task. However, RAG's tool retrieval step requires all the required information to be explicitly present in the query. This is a limitation, as semantic search, the widely adopted tool retrieval method, can fail when the query is incomplete or lacks context. To address this limitation, we propose Context Tuning for RAG, which employs a smart context retrieval system to fetch relevant information that improves both tool retrieval and plan generation. Our lightweight context retrieval model uses numerical, categorical, and habitual usage signals to retrieve and rank context items. Our empirical results demonstrate that context tuning significantly enhances semantic search, achieving a 3.5-fold and 1.5-fold improvement in Recall@K for context retrieval and tool retrieval tasks respectively, and resulting in an 11.6% increase in LLM-based planner accuracy. Additionally, we show that our proposed lightweight model using Reciprocal Rank Fusion (RRF) with LambdaMART outperforms GPT-4 based retrieval. Moreover, we observe context augmentation at plan generation, even after tool retrieval, reduces hallucination.
Motivation & Objective
- To address the limitation of traditional RAG in handling implicit or under-specified queries where semantic search fails due to missing context.
- To design a context tuning component that enhances both tool retrieval and plan generation by retrieving relevant contextual signals.
- To empirically evaluate and compare various context retrieval methods, including CoT augmentation and fine-tuned models, in isolation and combination.
- To demonstrate that fine-tuning the retrieval model eliminates the need for CoT augmentation, reducing input length while maintaining performance.
- To show that context augmentation during plan generation reduces hallucination, even when tools are correctly retrieved.
Proposed method
- Introduces Context Tuning as a pre-retrieval module that retrieves and ranks contextual signals—numerical, categorical, and habitual usage patterns—before tool retrieval.
- Employs a lightweight retrieval model combining LambdaMART for learning-to-rank and Reciprocal Rank Fusion (RRF) to aggregate results from multiple retrieval signals.
- Uses a hybrid retrieval strategy: retrieves context items based on semantic similarity and usage patterns, then re-ranks them using learned relevance scores.
- Applies both zero-shot CoT augmentation and fine-tuned retrieval models to assess the impact of context on retrieval and planning performance.
- Evaluates end-to-end planner accuracy with and without context tuning, using lower and upper bounds to isolate the effect of context on hallucination and correctness.
- Employs synthetic user profiles and personas to simulate real-world RAG scenarios while preserving privacy.

Experimental results
Research questions
- RQ1Can context tuning significantly improve retrieval performance for under-specified or context-seeking queries in RAG?
- RQ2Does fine-tuning the retrieval model eliminate the need for CoT-based query augmentation in context retrieval?
- RQ3How does context augmentation during plan generation affect hallucination and planner accuracy?
- RQ4Can a lightweight retrieval model outperform large LLM-based retrieval systems like GPT-4 in context retrieval?
- RQ5What is the relative contribution of different context signals—numerical, categorical, and usage-based—to retrieval effectiveness?
Key findings
- Context Tuning improves Recall@K for context retrieval by 3.5-fold compared to standard semantic search.
- Tool retrieval Recall@K improves by 1.5-fold with context tuning, demonstrating its effectiveness in downstream planning.
- The context-tuned planner achieves 85.24% AST-based plan accuracy, an 11.6% improvement over standard RAG-based planners.
- The proposed RRF-LambdaMART model outperforms GPT-4-based retrieval systems in context retrieval, achieving 98.24% NDCG@K on the best-performing setting.
- Fine-tuning the retrieval model reduces the need for CoT augmentation, as fine-tuned models with CoT show only marginal gains over fine-tuned models alone.
- Context augmentation during plan generation reduces hallucination by 64% (from 2.59 to 0.93) compared to the lower bound, even when tools are correctly retrieved.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.