NTU and Alibaba's CARROT Beats Standard RAG by 30% Using Fewer Tokens
A new framework treats chunk selection as a tree search problem, using Monte Carlo rollouts and a learned agent to squeeze 30% more quality from RAG under tight token budgets.
ProTakeaways
- CARROT reframes RAG retrieval as an MCTS tree search over ordered chunk combinations under a token budget: arxiv.org/abs/2411.00744
- Achieves up to 30% quality gain over NaiveRAG, RAPTOR, HYDE, and GraphRAG on WikiPassageQA, MARCO, HotpotQA
- A learned configuration agent predicts the best reranker and MCTS hyperparameters per query using contrastive learning
- Parallel reranker simulation cuts per-query latency from 16.1s to 3.1s versus sequential scoring
- Chunk ordering alone accounts for an 11 to 15 percent ROUGE gap between best and worst permutations
- Code released at github.com/wang0702/CARROT, integrates with LlamaIndex and Faiss
Standard retrieval-augmented generation pipelines have a dirty secret. They grab the top-k chunks by cosine similarity, jam them into the prompt in whatever order they came out of the vector database, and hope the language model figures out the rest. A new paper from Nanyang Technological University and Alibaba argues that this pipeline is leaving a huge amount of quality on the table, and it proposes a search-based fix called CARROT that reportedly delivers up to a 30% improvement over standard baselines while using fewer tokens.
The framework treats chunk retrieval as a constrained combinatorial optimization problem rather than a ranking problem. It uses Monte Carlo Tree Search to explore chunk orderings, a token budget to cap costs, and a small learned agent that picks the search hyperparameters per query. The source code is available on GitHub.
Where naive RAG breaks down
The authors identify three failure modes in current rank-based RAG systems that anyone building a production pipeline will recognize. Approximate k-nearest neighbor retrieval disregards correlations between chunks entirely, while clustering treats all chunks in a cluster as equally relevant, leading to redundancy when chunks have overlapping information. Pull the top-5 nearest neighbors for a question about the Eiffel Tower and you may get five chunks that all describe its history, none of which mention its height.
The second issue is that adding more context can actively hurt. Excessive chunks can dilute key information by adding marginally relevant content, creating noise that reduces clarity, and conflicting or nuanced differences across chunks may confuse the model, leading to hallucinations. This connects to the well-documented "lost in the middle" effect, where LLMs underweight information buried in long contexts. In other words, chunk utility is non-monotonic: sometimes three chunks beat five.
The third problem is that no single reranker wins across query types. The authors show that the best reranker varies significantly depending on whether a query is academic, commercial, or general-knowledge, so a fixed pipeline configuration is always leaving performance on the table for some fraction of traffic.

Treating chunk selection as a tree search
CARROT reframes chunk selection as a search over a policy tree, where the root is an empty prompt and each child node appends one additional chunk to an ordered sequence. The goal is to find the node whose ordered chunk combination maximizes a reranker-assigned benefit score while staying inside a token budget. The authors prove this problem is NP-hard via reduction from the Maximum Weighted Hyperclique Problem, which rules out brute-force enumeration for realistic candidate sizes. For just 10 candidate chunks, there are already over 9 million ordered combinations.
The search itself is a Monte Carlo Tree Search variant with four familiar phases (selection, expansion, simulation, backpropagation) but several important tweaks:
- Cost-aware UCB scoring. The standard exploration-exploitation term is extended with a penalty proportional to how much of the token budget a node consumes, so the search naturally favors compact combinations.
- Parallel simulation. Instead of a random rollout, every expanded child is scored by the reranker in a single batched call. This lets k combinations be scored in one model call rather than k separate calls, leveraging transformer rerankers' batch processing for substantial efficiency gains.
- Full backpropagation. Unlike vanilla MCTS which updates only the best path, CARROT propagates benefits from every expanded child, preserving richer statistics for future iterations.
- Non-leaf final selection. The final answer can be an interior node, since a shorter combination often beats a longer one under budget or semantic coherence constraints.

A configuration agent that adapts per query
The second core piece is a small neural network that predicts MCTS hyperparameters, including the reranker choice, iteration count, exploration coefficient, and cost coefficient, based on the query and the retrieved candidate chunks. It fuses query and mean-pooled chunk embeddings from BGE-M3 through a Siamese network with three fully connected layers, and it is trained with a joint loss combining classification (which reranker), regression (the numeric hyperparameters), and contrastive learning to pull queries with the same optimal reranker closer in embedding space.
The authors argue this indirect approach is much more tractable than predicting chunk orderings directly, which would require supervised data over a factorial output space and would struggle with the non-additive nature of chunk benefits. Training the agent takes about 1.8 hours for data collection plus 7 minutes of training on 8 A5000 GPUs, which is trivial compared to fine-tuning-based baselines like ColBERT (10+ hours) or G-Retriever (6.2 hours).
The numbers
CARROT was evaluated on WikiPassageQA, MS MARCO, and HotpotQA against a spread of baselines including NaiveRAG, RAPTOR, HYDE, GraphRAG, FLARE, ColBERT, and HippoRAG2, using Llama3-8B, DeepSeek-V3, and GPT-4o as generators. A few results stand out:
- On WikiPassageQA with a 1024 token budget, CARROT hits ROUGE-1 of 0.432 versus 0.327 for NaiveRAG and 0.363 for HippoRAG2, while spending only 811 tokens per query on average.
- Graph-based methods like GraphRAG require millions of tokens for offline indexing (2.3M tokens on WikiPassageQA), while CARROT needs only 66.9 seconds of per-corpus indexing.
- Chunk ordering alone matters: fixing the top-5 chunks and only varying their order produces an 11 to 15 percent quality gap between the best and worst orderings, with multi-hop queries more sensitive than single-hop.
- Removing the configuration agent drops WikiPassageQA ROUGE-1 from 0.432 to 0.390, and removing parallel expansion inflates latency from 3.1s to 16.1s per query.
The end-to-end latency of about 3 seconds is higher than NaiveRAG's 2.3 seconds but dramatically better than graph-based methods like GraphRAG (80 seconds) or FLARE (45 seconds). The Pearson correlation between reranker-assigned benefit and downstream ROUGE-L is 0.83, which the authors use to justify why optimizing the reranker score is a reasonable proxy for optimizing the final output.
When it makes sense to use
CARROT is fundamentally a rank-based system, so it inherits the constraint that the reranker's score has to correlate with downstream quality. If your queries fall outside the domain the reranker was trained on, the whole search process is optimizing the wrong signal. It is also aimed at single-turn, knowledge-intensive Q&A, and the authors are explicit that agentic RAG establishes a new paradigm for complex, multi-step tasks and does not render standard RAG obsolete, since agentic systems may rely on standard RAG for subtasks.
Where it looks compelling is any production RAG deployment where token budget matters, chunk redundancy is a known issue, or the domain distribution of queries is heterogeneous enough that a single reranker cannot cover them all. The tree search overhead is modest, the offline training cost is a one-time expense that generalizes across domains and downstream LLMs, and the framework plugs into existing stacks like LlamaIndex and Faiss without needing to fine-tune the generator itself.