                                             CARROT: A Learned Cost-Constrained Retrieval
                                                   Optimization System for RAG
                                                                         Ziting Wang† , Haitao Yuan† , Wei Dong† , Gao Cong† , Feifei Li‡
                                                                                       † Nanyang Technological University, Singapore
                                                                                                        ‡ Alibaba Group, China
                                                       † ziting001@e.ntu.edu.sg, † {haitao.yuan, wei dong, gaocong}@ntu.edu.sg, ‡ lifeifei@alibaba-inc.com



                                            Abstract—Large Language Models (LLMs) have demonstrated                                                           Response:
                                         impressive ability in generation and reasoning tasks but struggle                                                    Designer: The Eiffel Tower was named after
                                                                                                                                                              the engineer Gustave Eiffel, whose company
                                                                                                                     Query: "Who designed the Eiffel
                                         with handling up-to-date knowledge, leading to inaccuracies or                                                       designed and built the tower.
arXiv:2411.00744v2 [cs.DB] 12 Mar 2026




                                                                                                                     Tower and when was it
                                                                                                                                                              Construction period: It was constructed
                                         hallucinations. Retrieval-Augmented Generation (RAG) mitigates              constructed? Provide information
                                                                                                                     on its height as well."                  between 1887 and 1889.
                                         this by retrieving and incorporating external knowledge into                                                         Height: The Eiffel Tower stands at 324 meters
                                                                                                                                                              tall.
                                                                                                                                                                                                                   LLMs
                                         input prompts. In particular, due to LLMs’ context window
                                         limitations and long-context hallucinations, only the most relevant          Chunk1: "The Eiffel Tower in Paris
                                                                                                                                                                                                                           Token
                                                                                                                      held the title of the world's tallest                                                        Score
                                         “chunks” are retrieved. However, current RAG systems face three              structure for over 40 years until                                                χ1
                                         key challenges: (1) chunks are often retrieved independently                 1930.”                                                                                   0.3 256
                                                                                                                                                                                                    χ1 + χ3    0.4 512
                                         without considering their relationships, such as redundancy and              Chunk2:“It was the tallest man-
                                                                                                                      made structure in the world for 41
                                         ordering; (2) the utility of chunks is non-monotonic, as adding              years until the completion of the
                                                                                                                                                                   Reranker Model                   χ3 + χ4    0.8 512
                                                                                                                      Chrysler Building in New York in
                                         more chunks can degrade quality; and (3) retrieval strategies fail           1930. ”                                                                       χ4 + χ3    0.9 512
                                                                                                                                                                              Score
                                         to adapt to the unique characteristics of different queries.                 Chunk3:" The Eiffel Tower                  Chunk χ3 0.8                     χ1 + χ2 + χ4 0.6 768
                                                                                                                      constructed between 1887 and
                                            To overcome these challenges, we design a cost-constrained                1889, it stands at 324 meters tall.”       Chunk χ1 0.6                     χ1 + χ4 + χ3 0.8 768
                                         retrieval optimization framework for RAG. We adopt a Monte                   Chunk4:"It was named after the             Chunk χ4 0.4
                                         Carlo Tree Search (MCTS) based strategy to find the opti-                    engineer Gustave Eiffel, whose                                            χ1 + χ2 + χ3+ χ4 0.9 913
                                                                                                                      company designed and built the             Chunk χ2 0.3
                                         mal chunk combination order, which considers the chunks’                     item, even though several other
                                                                                                                      designs were considered initially."                                            Chunk Combination Order
                                                                                                                                                                    Chunk Scores
                                         correlations. In addition, to address the non-monotonicity of                       Potential Chunks

                                         chunk utility, instead of treating budget exhaustion as the
                                         termination condition, we design a utility computation strategy                             Fig. 1: Chunk combination order example.
                                         to identify the optimal chunk combination without necessarily
                                         exhausting the budget. Furthermore, we propose a configuration             Q&A, as evidenced by results on knowledge-intensive tasks
                                         agent that predicts optimal configurations for each query do-
                                         main, improving our framework’s adaptability and efficiency.
                                                                                                                    and broad industry adoption [19], [20].
                                         Experimental results demonstrate up to a 30% improvement                      However, many existing RAG frameworks incur expensive
                                         over baseline models, highlighting the framework’s effectiveness,          computational costs. First, tuning-based RAG approaches [14],
                                         scalability, and suitability. Our source code has been released at         [21]–[24] require extensive instruction tuning to enhance
                                         https://github.com/wang0702/CARROT.                                        LLMs’ abilities in context evaluation and utilization. These
                                                                                                                    methods fine-tune models on specialized tasks like context
                                                                 I. I NTRODUCTION                                   ranking [14] or self-reflection [21] to improve retrieval quality
                                            Although LLMs have demonstrated exceptional capabilities                and generation accuracy. While effective, they demand signif-
                                         in generative tasks, they still struggle with accessing up-to-date         icant computational cost for model training and specialized
                                         information [1]–[4], leading to hallucinations [5]. RAG has                datasets. Similarly, graph-based RAG methods [6], [13], [25]–
                                         emerged as a crucial solution to address this issue, especially            [27] rely on LLM inference to construct knowledge graphs or
                                         for tasks requiring updated external knowledge such as ques-               guide actions. While these graph-based approaches avoid tun-
                                         tion answering tasks [2], [5]–[7], personalized agents [8], and            ing models, they impose significant computational overhead by
                                         time series analysis [9], [10]. External data is often too large to        requiring multiple LLM inferences for graph construction and
                                         input directly into LLMs, so it is split into chunks stored in a           chunk summarization, making them prohibitively expensive
                                         vector database [11]–[15]. Users query these chunks to create              when scaling to large knowledge bases.
                                         prompts, making efficient and accurate search algorithms a                    Besides tuning-based and graph-based methods, rank-based
                                         key research focus in the information retrieval domain [1]–[5],            RAG represents another prevalent approach [12], [15], [28],
                                         [16]. Note that although Agentic RAG [17], [18] establishes a              [29]. These methods assign a utility score to each chunk,
                                         new paradigm for complex, multi-step tasks, it does not render             indicating its relevance for answering the user query. These
                                         standard RAG obsolete and may rely on standard RAG for                     scores typically derive from similarity metrics between queries
                                         subtasks. Moreover, standard RAG remains the default choice                and chunks or from specialized reranker models [28], [30],
                                         for efficient, single-turn information retrieval in enterprise             [31], whose scores have demonstrated strong correlation with
                                                                                                                    final response quality in production deployments [32], [33].
                                           Corresponding author: Haitao Yuan (haitao.yuan@ntu.edu.sg)               Unlike tuning-based and graph-based methods that require
             User Query          Embedding          Vector DB            Potential        Configuration Agent   Policy Tree          Optimal Chunk
                                                                         Chunks                                                          Order           LLMs
                                                                                                                 Search



              Chunks Retrieval                 Online Configuration Inference
                                                                                                                Optimal Chunk Combination Order Search
                                                                          Reranker
                                        Configuration
                 Chunks                    Agent                          Iterations
                Candidates
                                                                         Coefficient

                                         Positive                       Lconstrastive
                  Query                   Label
                                                                        Lclassification                                MCTS-Based Tree Search
                                        Negative
                                         Label      Encoding Network   Lregression
                                               Offline Contrastive Training


                                       Fig. 2: The architecture overview of CARROT framework.

substantial LLM modifications and interactions, rank-based                                  hallucinations. For example, as illustrated in Figure 1, when
methods usually employ reranker models, offering reasonable                                 χ3 and χ4 are selected, adding chunk χ1 decreases utility,
computational efficiency. However, our empirical study in                                   highlighting that utility scores are often non-monotonic.
Table II reveals that existing rank-based methods underper-                                    Challenge 3: Diversity of queries. Users’ queries have
form in difficult query workloads and long-context scenarios,                               different types, requiring different ranking strategies due to
presenting three key challenges.                                                            their unique characteristics [15], [37]. Current RAG systems
   Challenge 1: Relationships between chunks. There are two                                 predominantly rely on a single reranker model [30], [38] to
main methods to identify relevant chunks. The first uses                                    determine chunks’ utility scores. Although various reranker
approximate k-nearest neighbor (AKNN) to rank and select                                    models have been developed, their performance varies sig-
top-k chunks [34]. The second clusters chunks and returns                                   nificantly by query types, with no single model consistently
all chunks in the most relevant clusters [6], [13]. However,                                outperforming others across all variations (as shown in our
AKNN disregards correlations entirely, and clustering treats all                            preliminary experiments in Fig. 5). Current RAG systems [12],
chunks in a cluster as equally relevant, leading to redundancy                              [28] lack the flexibility to adapt to varying query intentions.
when chunks have overlapping information. For example, in                                   Problem Statement. Is there a RAG framework that achieves
Figure 1, querying the height and history of the Eiffel Tower                               both high efficacy and efficiency while maintaining acceptable
using the AKNN method would select χ3 and χ1 , which                                        computational costs?
only provide historical details, failing to address the query                               Our contributions. We answer this question by proposing
fully. However, the clustering approach returns all chunks                                  a novel rank-based RAG framework named cost-constrained
(χ1 , χ2 , χ3 , χ4 ), causing redundancy. The optimal solution                              retrieval optimization (CARROT). On one hand, CARROT is
is to select χ3 and χ4 , avoiding redundancy while meeting                                  a rank-based framework, thus having much higher efficiency
the query’s intent. In addition, previous work [35], [36]                                   than graph-based and tuning-based methods. On the other
demonstrates that information position significantly affects                                hand, it considers chunks correlation, non-monotonicity, and
RAG performance, a phenomenon known as “lost in the                                         query intent diversity in the search process to enhance response
middle” [35]. For instance, placing χ4 before χ3 yields better                              quality. Additionally, to further reduce computational costs
results. However, finding the best chunk combination and order                              and make the framework practical, we minimize token cost
is challenging due to the exponentially growing search space,                               by incorporating cost constraints in the search process.
and we prove this problem is NP-hard in Section II.                                         • We propose the first RAG framework that explicitly consid-
   Challenge 2: Non-monotonicity of utility. Current solutions                                 ers chunk combination order for the RAG task. Rather than
are typically based on the assumption that including more                                      treating each chunk independently or at the cluster level, we
chunks will yield better final results. Specifically, in the                                   design an MCTS-based policy tree search to identify the op-
AKNN-based approach, exactly k chunks are selected each                                        timal chunk combination order. Unlike greedy methods that
time. In the clustering approach, a distance threshold between                                 select the highest-scored chunk at each step, our approach
clusters and the query is fixed, and all clusters within this                                  iteratively samples and evaluates different paths, leveraging
threshold are returned. Both of them return as many chunks                                     a UCB-based utility function to balance exploring new
as possible. However, in practice, the utility of chunks is not                                combinations with exploiting promising ones. This design
monotonic. More specifically, excessive chunks can dilute key                                  addresses the exponential search space by focusing compu-
information by adding marginally relevant content, creating                                    tational resources on high-potential paths, while our parallel
noise that reduces clarity. Additionally, conflicting or nuanced                               evaluation strategy scores multiple candidates simultane-
differences across chunks may confuse the model, leading to                                    ously for efficiency. Through these designs, we address
  Challenge 1 while maintaining computational efficiency.               as shown in Fig. 1, the order of chunks in this combination
• In contrast to existing RAG frameworks that treat budget              critically affects RAG performance. Therefore, we incorporate
  exhaustion merely as a termination criterion, we design               the chunk combination order to denote it, and the objective is
  a novel formulation that directly incorporates budget con-            to determine the combination and ordering that yield the best
  straints into the optimization of chunk combinations. Our             benefit, formally defined as follows:
  formulation explicitly captures the non-monotonic utility of
                                                                        Definition 2 (Optimal Chunk Combination Order Selection).
  chunks, effectively addressing Challenge 2.
                                                                        Let Q denote the input query, {χ1 , χ2 , . . . , χk } the set of
• We propose a contrastive learning-based configuration agent
                                                                        candidate chunks, B the cost budget, and W (Φ) the benefit
  that dynamically predicts MCTS configurations per query,
                                                                        of a chunk combination order Φ = ⟨χϕ1 , . . . , χϕm ⟩, where
  adapting reranker models and configurations to the specific
                                                                        ϕi indicates the position of each chunk in the sequence. The
  query domain. This approach tailors retrieval for dynamic,
                                                                        objective is to identify the optimal chunk combination order Φ̂
  domain-specific queries with flexibility and robustness, ad-
                                                                        that maximizes the overall benefit under the cost constraint:
  dressing Challenge 3.                                                                                       X
• We conducted comprehensive experiments comparing our                           Φ̂ = arg max W (Φ)    s.t.           cost(χi ) ≤ B   (1)
                                                                                            Φ
  framework against both graph-based and rank-based meth-                                                     χi ∈Φ

  ods. The results validate the effectiveness, efficiency, and             Importantly, solving the above problem is non-trivial be-
  scalability of our approach, demonstrating a 30% perfor-              cause the benefit of a chunk combination cannot be obtained
  mance improvement over baseline methods.                              by simply summing the individual benefits of its constituent
                             II. P RELIMINARIES                         chunks. Instead, the overall benefit must be evaluated by
                                                                        invoking theP reranker model on the whole combination (i.e.,
   We first introduce the definitions of chunks and chunk               W (Φ) ̸=       χi ∈Φ W (χi )). To verify this, we conducted ex-
combination orders. We then formalize the chunk order opti-             periments to analyze the non-additivity of chunk benefits, as
mization problem and give the NP-hard proof of the problem.             detailed in our technical report [40], which demonstrates that
RAG & Chunks. RAG improves generation models by re-                     all tested reranker models exhibit non-additive scoring behav-
trieving relevant context from external corpora, which is first         ior. Furthermore, the problem is computationally challenging,
divided into smaller, manageable units called chunks, typically         as formally established by the following theorem.
stored in a vector database. The definition of chunk is given
as follows:                                                             Theorem 1. The Optimal Chunk Combination Order Selection
Definition 1 (Chunk). Let C represent a corpus of documents,            problem is NP-hard.
and a chunk χ is defined as a contiguous block of text extracted           The NP-hardness is proved via a polynomial-time re-
from C. Formally, a chunk χ consists of a sequence of tokens            duction from the Maximum Weighted Hyperclique Problem
(t1 , t2 , . . . , tn ), where each ti is a token from C and the size   (MWHP) [41], which has been shown to be NP-hard, as
n is set by users.                                                      discussed in the corresponding technical report [40].
Chunk Cost & Benefit. Similar to prior work [39], the cost of
a chunk is defined as cost(χ) = |χ|, representing the number                                III. R ELATED W ORK
of tokens it contains; thus, longer chunks incur higher costs.              1) Retrieval-augmented Generation: RAG [1], [10], [28],
The benefit of a chunk reflects its estimated contribution to           [42] is widely used to handle knowledge-intensive NLP tasks.
the final response quality. In RAG systems, each chunk is               Current studies [13]–[15], [21] focus on how to optimize RAG
embedded into a vector representation using an embedding                performance using different approaches, broadly classified as
model to capture its semantic information. Given a query Q,             rank-based methods, graph-based methods, and tuning-based
the vector database performs a similarity search to identify the        methods. In typical rank-based methods, a dense embedding-
most relevant chunks, which are then passed to the generator            based retriever searches for relevant information from an
(e.g., a large language model) to produce the final response.           external database, which is then used by the LLM generation
In this phase, we measure the benefit of a chunk by its esti-           process. To improve this pipeline, some studies [12], [43]
mated contribution to the final response quality. We measure            have focused on training retrievers to better suit the generation
this using a reranker model: W (Q, χ) = Reranker(Q, χ),                 needs of LLMs, developing multi-step retrieval methods, and
where the reranker is a neural model trained to predict the             filtering out irrelevant information. Although there are many
relevance between query Q and chunk χ. For simplicity, we               advanced retrievers [1], [29], [42], [44], it is more promising
use W (Q, χ) and W (χ) interchangeably when no ambiguity                to optimize the retriever and LLM together in an end-to-
arises.                                                                 end process [7], [45]. For example, research [46], [47] has
Chunk Combination Order. In an RAG system, retrieval                    focused on training retrievers and LLMs together, either si-
from the vector database often yields multiple chunks. How-             multaneously or in stages. For graph-based methods [6], [13],
ever, due to input constraints and hallucination of the genera-         [25]–[27], studies try to use knowledge graphs to optimize
tion model, incorporating all of them is infeasible. Thus, it is        external knowledge organization. However, these methods
necessary to select an optimal subset, referred to as a chunk           require frequent external LLM calls to generate the graph
combination, that fits within a given cost budget. Moreover,            structure or guide actions, especially when the graph needs
to be re-indexed or updated with new knowledge frequently,        To tackle these, we propose CARROT, a learned system that
which incurs high computational costs. Therefore, tuning-         retrieves the optimal chunk combination under a given query
based methods such as [14], [21], [22] use instruction tun-       and cost budget. Its core component, the Optimal Chunk Com-
ing to improve response comprehensiveness and enable the          bination Search module, employs an MCTS-based policy tree
LLM to self-reflect or rank knowledge without frequent re-        to sequentially explore chunk orders under cost constraints,
indexing. However, these approaches often overlook the high       effectively modeling inter-chunk dependencies (Challenge 1)
computational cost in the tuning phase, which significantly       and non-monotonic utilities (Challenge 2). Furthermore, the
impacts the practicality of RAG systems. To our knowledge,        Configuration Agent module automatically selects the best
this paper is the first approach that considers the order of      MCTS configuration and reranker for different query domains,
chunk combinations within computational cost constraints.         addressing Challenge 3. We next overview these two modules.
   2) Reranking for RAG: Reranking methods [30], [38], [48],      1. Optimal Chunk Combination Search: A straightforward
[49] are crucial for improving retrieval performance in rank-     approach to considering chunk correlations involves retrieving
based RAG methods, as they align retrieved chunks with LLM        potential chunks from a vector database (Step 1 in Figure 2)
requirements and prioritize the content most conducive to         and exhaustively exploring all possible chunk combinations.
generating high-quality responses. Traditional reranking ap-      However, this method incurs significant latency and computa-
proaches [31], [50] typically rely on mid-sized language mod-     tional costs. To mitigate this, we construct a policy tree (Step 2
els, such as BERT or T5, to rank retrieved contexts. However,     in Figure 2), reframing the optimal chunk combination search
these models often struggle to capture semantic relationships     as a node search problem within the tree. Specifically, the
between queries and contexts, especially in zero-shot or few-     root node of the policy tree represents an initial empty state,
shot settings. Therefore, recent tuning-based research [14],      and each child node corresponds to a specific combination
[21], [22] highlights the potential of instruction-tuned LLMs     of chunks. We design an MCTS-based search algorithm to
to improve context reranking by more accurately identifying       address this problem, which iteratively constructs a policy tree
relevant contexts, even in the presence of noise or irrelevant    for optimal chunk combination search. During the search pro-
information. Despite these advancements, the full capacity of     cess, both cost and budget constraints are explicitly incorpo-
LLMs for reranking in RAG systems remains underutilized. In       rated to guide decision-making. Each iteration of the algorithm
particular, studies have shown that the arrangement of chunks     consists of four phases: (1) Selection: iteratively selecting child
can affect LLM performance [36], emphasizing the need to          nodes from the root using a UCB-based utility function that
consider the order of the combination of chunks in RAG            balances exploration and exploitation while incorporating cost
tasks. However, existing methods are not well-suited for cases    control; (2) Expansion: generating all feasible child nodes; (3)
where optimal retrieval requires a specific chunk combination     Simulation: performing parallel evaluations of the expanded
order, rather than isolated chunks. In this paper, we propose     nodes via reranker scoring; and (4) Backpropagation: updat-
CARROT, a cost-constrained retrieval optimization framework       ing path statistics with the obtained benefits. In particular,
that addresses the overlooked importance of considering the       we leverage parallel reranker evaluations to process multiple
order of chunk combinations.                                      chunk combinations simultaneously, substantially improving
   3) Reinforcement Learning for Large Language Models:           computational efficiency.
Recently, reinforcement learning (RL) has been increasingly       2. Configuration Inference: A naive approach to config-
utilized in various data management and RAG tasks. The RL         uration tuning is to exhaustively evaluate all configurations
technique can enable large language models to improve their       and rerankers in parallel, which is prohibitively expensive for
generation ability by leveraging external knowledge sources,      RAG systems. To address this, we introduce a Configuration
such as search engines [30]. In particular, the human feed-       Agent that dynamically generates optimal settings—such as
back [15], [51] can be integrated to help models produce          iteration count, cost coefficient, and exploration factor—based
more accurate and contextually relevant responses through         on the query domain and retrieved data. Specifically, the
the RL framework. In addition, some query optimization            configuration agent takes both the query and the retrieved
approaches [1], [8], [37] further refine retrieval processes,     chunks as input, fusing their embeddings through a data-
allowing model performance to inform query adjustments and        aware mechanism to capture the correlation between the query
ultimately enhance downstream task outcomes. In this work,        intent and the actual data distribution, enabling configuration
we apply a lightweight RL technique MCTS to optimize the          prediction conditioned on both query semantics and data
chunk combination order search process in the RAG system.         characteristics. To enhance the model’s effectiveness, we em-
We also introduce a configuration agent to guide the MCTS         ploy a contrastive learning approach that uses positive and
search process. To the best of our knowledge, this is the first   negative label pairs: positive labels correspond to query-data
approach to addressing this problem.                              pairs with the same optimal reranker, while negative labels
                                                                  come from different optimal rerankers. A joint loss function
                  IV. S YSTEM OVERVIEW                            is used to simultaneously optimize both the regression (for
   Existing RAG frameworks face three major challenges: cap-      parameter tuning) and contrastive learning (to enhance label
turing inter-chunk correlations, handling the non-monotonic       differentiation).
utility of chunk order, and adapting to diverse query domains.    RAG Pipeline. Our framework pipeline is shown in Figure 2.
We first generate an embedding for the input query, which           Φvi , whose corresponding cost and benefit are denoted as
is then used to retrieve potential chunks from the vector           cost(Φvi ) and W (Φvi ), respectively, as defined in Sec. II.
database. Both the query and retrieved chunks are fed into the      Therefore, the task described in Definition 2 can be refor-
configuration agent, which dynamically generates the optimal        mulated as searching for the node within the cost budget
configuration by analyzing the query-data correlation through       B that yields the highest benefit. Formally, this is expressed
data-aware embedding fusion. Using the optimal configuration,       as:vˆi = arg maxvi ⊆T, cost(Φvi )≤B W (Φvi ).
we can search the policy tree to determine the optimal chunk
                                                                    B. MCTS-Based Policy Tree Search
combination and order from the retrieved potential chunks.
Finally, this optimal chunk combination is used to construct           Enumerating all possible nodes in the policy tree T is
the final prompt for the LLMs.                                      infeasible due to the exponential growth of the search space.
                                                                    To efficiently explore this space, we employ an MCTS-based
             V. C HUNK C OMBINATION S EARCH                         approach that incrementally expands nodes to construct a
Motivation. The optimal chunk combination order selection           partial tree TMCTS , from which a solution can be derived
problem presents two fundamental challenges. First, the search      without full enumeration. In each iteration, the algorithm
                                                                    selects nodes to expand, evaluates their potential, and uses
space P grows exponentially:
          n                 Pn for nn! candidate chunks, there      the evaluation results to guide the next round of search. To
exist     k=1 P (n, k)   =    k=1 (n−k)! ordered combinations
(e.g., n = 10 yields over 9 million combinations), mak-             incorporate cost constraints and improve efficiency, we design
ing exhaustive enumeration infeasible. Second, greedy strate-       a cost-aware node utility function to guide node selection and
gies may fail due to the non-monotonic nature of chunk              introduce a parallel evaluation mechanism to accelerate the
benefits. For example, while individual chunks may satisfy          scoring process.
W (χ1 ) > W (χ2 ), their chunk combination orders could yield       Cost-aware Node Utility U(v). Because exhaustive explo-
W (⟨χ2 , χ3 ⟩) ≫ W (⟨χ1 , χ3 ⟩) in a real RAG scenario, as          ration is infeasible, we guide the search with a UCB-style [52]
established in Section II. Once the greedy approach selects         heuristic that balances exploitation and exploration while
χ1 in the first step, it cannot backtrack to explore the superior   accounting for cost. For each node v, the algorithm maintains
combination ⟨χ2 , χ3 ⟩, thus missing the globally optimal chunk     the cumulative reward V (v) (aggregated over historical visits)
combination order. To address these challenges, we design a         and the visit count N (v). We use Nparent(v) to denote the visit
policy tree to organize the combination space and formulate         count of v’s parent node. We define the cost-aware utility as
the chunk combination order selection task as an optimal node
                                                                                              s
                                                                                   V (v)         ln Nparent(v)      cost(Φv )
search problem in the policy tree. We employ an MCTS-based              U(v) =            + c                  − λ            , (2)
                                                                                   N (v)             N (v)             B
search algorithm that strategically explores only a small subset
of promising paths instead of enumerating all possibilities. The    where c and λ are tuning parameters. This extends standard
key insight is that MCTS iteratively expands and evaluates          UCB to our budget-constrained setting.
nodes along high-potential paths, accumulating node benefits        Algorithm Overview. As outlined in Algorithm 1, we ini-
through backpropagation, and ultimately returns the node            tialize the root node of the policy tree and iteratively refine
with the highest reranker-assigned benefit among the explored       the tree until the iteration budget is exhausted. Each iteration
paths. Unlike greedy selection, MCTS’s exploration mecha-           performs four phases: (1) Selection, traversing from root to
nism ensures that nodes with initially lower individual benefits    an unexpanded node using node utility U(v); (2) Expansion,
can still be discovered if they lead to superior combinations.      generating all possible child nodes within the cost budget;
                                                                    (3) Simulation, evaluating all children in parallel and assign-
A. Policy Tree Search Modeling                                      ing them node benefits W (Φv ); and (4) Backpropagation,
Policy Tree. As illustrated in Figure 3, we construct a policy      updating the cumulative reward V (·) and visit count N (·)
tree to represent all possible orders of chunk combinations         along the path to the root using the obtained benefit W (Φv ).
retrieved from the vector database. The root node corresponds       After completing all iterations, we obtain the MCTS policy
to the initial state with no selected chunks, while each child      tree TM CT S and select the node with the maximum reranker-
node is generated by appending one additional chunk to the or-      assigned benefit W (Φv ) among all non-root nodes that satisfy
dered sequence represented by its parent node. Thus, each non-      the cost budget constraint. Notably, unlike traditional MCTS,
root node corresponds to an ordered combination of chunks,          which focuses on leaf nodes, our method considers nodes at all
incrementally built through this process. For example, if a node    depths, as shorter combinations may outperform longer ones
represents the combination Φv1 = ⟨χ1 ⟩, its child nodes may         due to budget constraints or semantic coherence.
correspond to ordered extensions such as Φv2 = ⟨χ1 , χ2 ⟩,          Detailed Phases. We now describe the five phases of the
Φv3 = ⟨χ1 , χ3 ⟩, or Φv4 = ⟨χ1 , χ4 ⟩.                              MCTS-based policy tree search.
Remark. The entire policy tree does not need to be constructed      (1) Selection (Function 1). Starting from the root, the algo-
and typically only a small portion of it is dynamically ex-         rithm recursively selects child nodes guided by the utility
panded during our MCTS-based search process.                        function U(v) (Eq. 2), which balances exploitation, explo-
Optimal Node Search Modeling. Each non-root node vi                 ration, and cost. At each step, among available children, we
in the policy tree T represents a chunk combination order           select the one with the highest U(v) value. The exploration
                                                                                                                     W=0.3
                                                                      R                                              V=0.3
                                                                                              χ1+χ2                  N=1
                                                                                                                                           Root
                             R                   R
           χ1                                                                                                        W=0.2
                χ                                             W=0.1 … W=0.2                   χ1+χ3                  V=0.2
                …2 χ4                                                                                                N=1            0.1     …     W=0.2
                        χ1   …   χ4   W=0.1      …    W=0.2                                                                                       V=1.4
                                      V=0.1           V=0.2                                                                                       N=4
                                      N=1             N=1
                                                              χ1+χ2       χ1+χ3   χ1+χ4       χ1+χ4       Parallel   W=0.7
                                                                                                                     V=0.7
                                                                                                          Evaluate   N=1              W =0.3      W =0.2       W =0.7


         Potential      Policy Tree           Selection                                                                              Backpropagation                        Find Best
         Chunks                                                                   Expansion & Simulation                                                                     Node


                               Fig. 3: Workflow of MCTS-Based Policy Tree Search
 Algorithm 1: MCTS-Based Policy Tree Search              Function 1: Selection
  Input: q: a query; D: a set of candidate chunks; B: total                                 Input: vi : current tree node; B: total budget
           budget; Reranker: predicted reranker                                           1 while vi .isFullyExpanded() do
1 Initialize root node v0 with query q for the policy tree                                2     foreach child nodes vj of vi do
   TM CT S ;                                                                              3         compute utility
2 while within iteration do
                                                                                                                          r
                                                                                                                      V (v )              ln Nparent(v )                cost(Φvj )
3      vselected = Selection(v0 , B);                                                                       U(vj ) = N (vjj ) + c              N (vj )
                                                                                                                                                           j
                                                                                                                                                                 −λ         B
                                                                                                                                                                                     ;
4      {v1 , . . . , vk } = Expansion(vselected , D, B);
5      Simulation(vselected , {v1 , . . . , vk }, Reranker);                              4           vi = arg maxvj ∈Children(vi ) U(vj );
6      BackPropagation({v1 , . . . , vk });                                               5   return vi
7   return arg maxv∈TM CT S ,cost(Φv )≤B W (Φv )
                                                                                           Function 2: Expansion
                                                                                            Input: v: unexpanded node to expand; D: set of candidate
       p                                                                                            chunks; B: total budget
term c ln Nparent(v) /N (v) in U(v) ensures that less-visited                               // Create all possible child nodes
                                                                                          1 Expand v by using the candidate chunks in D to construct
nodes receive priority, preventing premature convergence to
                                                                                             child nodes {v1 , v2 , . . . , vk } whose costs do not exceed the
locally optimal paths. Selection proceeds until reaching an                                  budget B;
unexpanded node, ensuring both deep and broad exploration                                 2 foreach child nodes vj do
of the search space.                                                                      3     calculate and record cost(Φvj );
(2) Expansion (Function 2). Upon reaching an unexpanded                                   4     initialize N (vj ) = 0, V (vj ) = 0;
node v, all potential child nodes {v1 , v2 , . . . , vk } are generated                   5   return {v1 , v2 , . . . , vk }
by appending one additional chunk (each child cost does                                    Function 3: Simulation
not exceed the budget B) to the current combination. Unlike                                 Input: v: parent node; {v1 , . . . , vk }: expanded children;
standard MCTS, which expands a single child per iteration,                                         Reranker: predicted reranker
our approach expands all possible children simultaneously to                                // Parallel evaluation via reranker
prepare for parallel evaluation. In particular, we initialize each                        1 compute benefit

new node’s cumulative reward and visit count to zero.                                        [W (Φv1 ), . . . , W (Φvk )] = Reranker(Q, [Φv1 , . . . , Φvk ]);
                                                                                          2 foreach child nodes vj do
(3) Simulation: Parallel Evaluation (Function 3). Instead of                              3     record W (Φvj );
random rollouts, we evaluate all expanded nodes in
parallel using the reranker [W (Φv1 ), . . . , W (Φvk )] =                                 Function 4: BackPropagation
Reranker(Q, [Φv1 , . . . , Φvk ]), where W (Φvj ) denotes the                               Input: {v1 , v2 , . . . , vk }: the expanded child nodes
reranker-assigned benefit for combination Φvj . This design                                 // Backpropagate each child
allows all k combinations to be scored in one model call (cost                            1 foreach child nodes vj do

O(r)) rather than k separate calls (cost O(k · r)), leveraging                            2     vcurrent = vj ;
                                                                                          3     repeat
transformer rerankers’ batch processing for substantial effi-                             4         V (vcurrent ) = V (vcurrent ) + W (Φvj );
ciency gains. For each vj , we record W (Φvj ) and compute its                            5         N (vcurrent ) = N (vcurrent ) + 1;
token cost cost(Φvj ).                                                                    6         vcurrent = Parent(vcurrent );
(4) Backpropagation (Function 4). Each child’s benefit                                    7     until vcurrent is None;
W (Φvj ) is propagated upward along the path to the root,
updating cumulative rewards V (·) and visit counts N (·).
Unlike traditional MCTS, which updates only the best path,
we backpropagate all children independently, preserving                                   assigned benefit W (Φv ) rather than the averaged reward
richer exploration statistics to guide future iterations.                                 V (v)/N (v), as W (Φv ) more accurately reflects the true
(5) Final Node Selection. After all iterations, we perform                                relevance between query and chunk combination order. When
a global search across explored nodes and select the                                      multiple nodes have identical W (Φv ), we prefer nodes with
one with the highest benefit under the cost budget:                                       more visits and greater depth.
v̂ = arg maxv∈TM CT S , cost(Φv )≤B W (Φv ). Unlike traditional                           Complexity Analysis. Let N be the number of candidate
MCTS methods, the final decision is based on the reranker-                                chunks, B the token budget, s the fixed chunk token cost,
                                                  Training pair
                                      Query1: “What is the capital city of                                                                                                                                                    Ground Truth
                                                                                                                                                                               Feature
                                      Germany?” + Relevance Chunks                                                                                                                               LConstrastive     Query1
                                                                                                                                                                               Map Pair
                                      Query2: “Which country is Berlin‘s                                                                                                                                           Best reranker:jina-reranker-v1-turbo-en
                                      capital?” + Relevance Chunks                                                                                                                                     +           Best parameters
                                      Label: Positive pair                                                                                                                                                         (Iteration = 30, 𝜆= 0.1, C = 2.4)
                                                                                                                                                                               Reranker
                                                                                                                                                                                                 LClassification   Query2
                                                                                                                                                                                Class
                                       Query3: " How to bake a                                                                                                Classification                                       Best reranker:jina-reranker-v1-turbo-en
                                       chocolate cake?” + Relevance                                              Encoding Network                                                                      +           Best parameters
                                       Chunks                                                                                                                                  Iteration,                           (Iteration = 24, 𝜆= 0.2, C = 2.6)
                                                                                                                                                                                                  LRegression
                                       Query4: “What is the meaning of                                                                                                            λ,C
                                       happiness?” + Relevance                                   Input
                                                                                                                                                               Regression
                                       Chunks                                                  Embeddings
                                                                                                                                                Feature Map
                                                                                                                                                                                      Joint Training
                                       Label: Negative pair

                                                                                                                            Fig. 4: Overview of Configuration Agent

                                                      WikiPassageQA                                                        MARCO
                                 1.0                                                             1.0                                                                    (i) the N ! combinatorial space makes supervised data col-
                                 0.9                                                             0.9
      Best Reranker Proportion




                                 0.8                                                             0.8
                                                                                                                                                                        lection infeasible; (ii) non-monotonic utility functions where
                                 0.7                                                             0.7                                                                    W (A ∪ B) ̸= W (A) + W (B) are difficult for neural networks
                                 0.6                                                             0.6
                                 0.5                                                             0.5                                                                    to approximate; (iii) predicting chunk combination orders re-
                                 0.4                                                             0.4
                                 0.3                                                             0.3
                                                                                                                                                                        quires structured outputs from the N ! space, whereas predict-
                                 0.2                                                             0.2                                                                    ing MCTS hyperparameters reduces to lightweight regression.
                                 0.1                                                             0.1
                                 0.0 Academic Commerce Literature Healthcare Legal   Others      0.0 Academic Commerce Literature Healthcare Legal   Others
                                                                                                                                                                        Accordingly, we present the agent framework in Section VI-A
                                                            Domain                                                          Domain
                                                                  jina-v1-turbo               bge-v2-m3            bge-base                                             and the learning pipeline in Section VI-B.
                                                                  jina-v2-multi               bge-large            gte-base
                                                                                                                                                                        A. Model Framework
                                                Fig. 5: Best Reranker Distribution                                                                                      Design Rationale. A straightforward approach is to use a
                                                                                                                                                                        multilayer perceptron (MLP) classifier to predict the optimal
and r the maximum cost of a single batched reranker call.                                                                                                               reranker for each query. However, due to the high semantic
Any budget-feasible combination contains at most DB =                                                                                                                   and domain diversity of RAG queries, such classifiers of-
min{N, ⌊B/s⌋} chunks.                                                                                                                                                   ten perform poorly, as shown in our experimental result in
(1) Time Complexity: Each of the I iterations performs selec-                                                                                                           Table VI. To overcome this limitation, we adopt a Siamese
tion, expansion, simulation, and backpropagation. (i) Selection                                                                                                         network trained with contrastive learning, which encourages
traverses O(DB ) levels with O(N ) children per level, yielding                                                                                                         similar query representations to be closer while pushing apart
O(DB · N ) complexity; (ii) Expansion creates up to N                                                                                                                   dissimilar ones, promoting cross-domain generalization [53].
children, contributing O(N ); (iii) Simulation evaluates all ex-                                                                                                           Figure 4 illustrates the overall architecture, which comprises
panded children in a single batched reranker call, costing O(r);                                                                                                        two main modules for transforming the input into feature
(iv) Backpropagation updates O(N ) children across O(DB )                                                                                                               maps. First, the embedding module generates representations
levels, giving O(DB · N ). Thus, the total time complexity is                                                                                                           for input queries and their retrieved chunks. Then, the encod-
O(I · (DB · N + r)). A smaller B reduces DB , shrinking the                                                                                                             ing network refines these embeddings into feature maps, which
search space. In practice, I is predicted by the configuration                                                                                                          are used by classification or regression layers to produce the
agent. As shown in Fig. 9, I remains a small value, ensuring                                                                                                            final configuration outputs. The following sections describe
efficient search.                                                                                                                                                       each component in detail.
(2) Space Complexity: Space is allocated to store the nodes of                                                                                                          (1) Input Embedding. Given a query and its retrieved chunks
                                                 PI where ki ≤
the tree. In the i-th iteration, we expand ki nodes,                                                                                                                    from the vector database, we employ the BGE-M3 model [54]
N . Over I iterations, this results in a total of i=1 ki ≤ I · N                                                                                                        to generate 1024-dimensional embeddings for the query and
nodes, leading to a space complexity of O(I · N ).                                                                                                                      the mean-pooled representation of retrieved chunks. Encoding
                                                                                                                                                                        the retrieved chunks enables the agent to capture query-related
                                                     VI. C ONFIGURATION AGENT                                                                                           data characteristics, enhancing its sensitivity to contextual
Motivation. The MCTS process requires critical configura-                                                                                                               nuances. These embeddings preserve semantic information, fa-
tions including reranker selection, iteration count, exploration                                                                                                        cilitating efficient comparison and classification by the encod-
coefficient, and cost coefficient. Our preliminary experiments                                                                                                          ing network. This design improves retrieval relevance across
(details in our technical report [40]) reveal that optimal                                                                                                              diverse query types by explicitly modeling the relationship
configurations vary across queries and retrieved data. For                                                                                                              between query intent and data distribution.
instance, Fig. 5 shows that different query domains (Academic,                                                                                                          (2) Feature Map Generation with Encoding Network. To op-
Commerce, etc.) exhibit distinct best-performing rerankers,                                                                                                             timize reranker selection across diverse query types, we
validating the necessity of adaptive configuration. Therefore,                                                                                                          employ an encoding network that jointly learns classifica-
we design a configuration agent that predicts optimal MCTS                                                                                                              tion and configuration representations. A Siamese network
configurations based on both query and chunk characteristics.                                                                                                           with three fully connected layers fuses query and chunk
A natural alternative is to directly predict chunk combination                                                                                                          embeddings, capturing query–data correlations for context-
orders via a learned model. However, this is impractical:                                                                                                               dependent predictions. Both branches share weights with linear
layers and ReLU activations, reducing the concatenated 2048-            Algorithm 6: Joint Contrastive Training
dimensional input (x ⊕ c) through layers of 512, 256, and                Input: Query embedding pairs (xi , xj ), chunk embeddings
128 dimensions. The output layer produces (i) a classification                    (ci , cj ), labels (yi , yj ), params (pi , pj ), similarity
result identifying the optimal reranker and (ii) regression out-                  indicator Iij (0 for same class, 1 for different class)
puts predicting MCTS configurations (iterations, exploration             Output: models fθ , gθ and hθ
                                                                       1 Initialize fθ with projection head;
coefficient c, and cost coefficient λ). By conditioning on             2 for epoch = 1 to N do
both query and chunk embeddings, this architecture adaptively          3      for batch (xi , xj , ci , cj , Iij , yi , yj , pi , pj ) do
controls various search parameters. For example, by predicting         4           zi ← fθ (xi ⊕ ci ), zj ← fθ (xj ⊕ cj )
iterations, it adjusts search depth: fewer iterations for simple                    yipred ← gθ (zi ), ppred i   ← hθ (zi );
query-data pairs where lightweight search suffices, more for           5
                                                                                    pred
                                                                                   yj       ← gθ (zj ), ppred
                                                                                                           j   ←    hθ (zj );
complex ones requiring deeper exploration.                             6           Lcon ←
B. Joint Training                                                                   (1 − Iij )∥zi − zj ∥2 + Iij max(0, γ − ∥zi − zj ∥)2
                                                                                    Lcla ← CE(yipred , yi ) + CE(yjpred , yj );           // CE
   In this section, we present the training pipeline for the                        is the cross-entropy loss
configuration agent (Figure 4). It integrates three joint tasks:       7           Lreg ← ∥ppred     − pi ∥2 + ∥ppred      − p j ∥2 ;
                                                                                                 i                    j
classification for reranker selection, regression for MCTS             8           Update θ using ∇θ (Lcon + Lcla + Lreg );
hyperparameter prediction, and contrastive learning to further
enhance representation quality.
   1) Classification and regression losses: Let the query and
its relevant chunk embeddings be denoted as x and c, re-
spectively, where ⊕ denotes the concatenation operation. The           with different rerankers), we first generate their corresponding
encoding network is represented by fθ , with a classification          feature maps with the encoding model fθ . These feature maps
head gθ and a regression head hθ in the output layer. The clas-        are then utilized to compute the contrastive loss Lcon . As
                                                                  
sification loss is defined as Lcla (θ) = Fcla gθ (fθ (x⊕c)), ytrue ,   shown in Algorithm 6, the contrastive loss uses the similarity
where ytrue is the ground-truth optimal reranker obtained              indicator Iij to handle both positive and negative pairs in a
through actual reranker execution, and Fcla denotes the cross-         unified formulation. This loss function is designed to ensure
entropy loss between predicted and true labels. Similarly, the         that query-data pairs with the same reranker are brought closer
regression loss is given by Lreg (θ) = Freg hθ (fθ (x⊕c)), ptrue ,
                                                                      together in the embedding space, while those with different
where ptrue represents the optimal MCTS hyperparameters                rerankers are distanced.
(iterations, exploration coefficient c, and cost coefficient λ)           3) Whole training process: As shown in Algorithm 6, we
identified via grid search on real query executions, and Freg          implement the complete training process by designing a loss
denotes the mean squared error (MSE) loss.                             function Ltotal that combines contrastive, classification, and
   2) Contrastive Learning: To efficiently distinguish between         regression losses as follows: Ltotal (θ) = Lcon (θ) + Lcla (θ) +
different query domains and recommend the optimal configu-             Lreg (θ). In particular, the contrastive loss Lcon (θ) encourages
ration for each query, we utilize contrastive learning to bring        the embeddings of queries with the same optimal reranker
queries with the same optimal reranker closer together while           to be close together, while pushing apart the embeddings of
pushing apart embeddings from different reranker classes.              queries with different rerankers. The classification loss Lcla (θ)
Contrastive pairs preparation. First, we obtain ground truth           aids the model in correctly identifying the reranker using
labels via grid search over parameters using ROUGE-L,                  cross-entropy, and the regression loss Lreg (θ) minimizes the
evaluating different parameter combinations to select con-             error in predicting the optimal MCTS configuration.
figurations yielding optimal response quality. Next, we gen-           Complexity Analysis We analyze the computational complex-
erate contrastive pairs based on these optimal annotations:            ity of both training and inference procedures for the Configura-
positive pairs share the same optimal reranker (promoting              tion Agent. (1) During offline training, we adopt a contrastive
minimal embedding distance), and negative pairs use different          learning framework that processes N training pairs in each
rerankers (maximizing embedding distance). We construct                batch. The computational cost of generating embeddings is
approximately 10,000 training pairs. The labeling process only         O(N · TE ), where TE denotes the embedding generation time
requires pairwise preference comparisons between configura-            for a single sample. Subsequently, each embedding is passed
tions, and we deploy Llama3-8B locally to generate training            through our lightweight configuration network, incurring an
pairs. Since the contrastive pairs are constructed from query-         additional cost of O(N ·TS ), where TS represents the process-
chunk embeddings with ground truth labels, the agent learns            ing time per sample in this smaller network. Since the con-
query-context patterns that share similar optimal configura-           figuration network is significantly smaller and faster than the
tions. These patterns become domain-invariant representations,         embedding network (e.g., BGE-M3), we have TS ≪ TE . Thus,
enabling generalization to different downstream LLMs and               the total training time complexity is dominated by embedding
unseen domains without retraining.                                     generation: O(N · TE + N · TS ) = O(N · TE ). This implies
Contrastive loss. As illustrated in Figure 4, for a given pair         that the training complexity scales linearly with the number of
(xi ⊕ ci , xj ⊕ cj ) with similarity indicator Iij (Iij = 0 for        training samples. (2) For online inference, suppose the query
positive pairs with the same reranker, Iij = 1 for negative pairs      workload size is |Q| and the network latency per query is
  TABLE I: Statistics of datasets used in the experiments.        GPUs for 16 hours and 4 A100 GPUs for 12 hours, re-
         Dataset      #train   #dev    #test      #p              spectively. We therefore include ColBERT as a representative
                                                                  baseline for fairness, noting that such tuning-based methods
        MARCO     808,731 101,093 101,092 8,841,823
     WikiPassageQA 3,332    417     416    244,136                are often impractical for large-scale deployment due to their
       HotpotQA    90,564 7,405 14,810 5,000,000+                 prohibitive training and indexing costs. Details of all baselines
                                                                  are provided in our technical report [40].
C. The overall inference complexity is then O(C · |Q|). In
                                                                     In addition, we remove the configuration agent from our
our empirical study in Table VI, both classification prediction
                                                                  method as a baseline to evaluate its impact on the performance
and parameter prediction process queries within an acceptable
                                                                  of CARROT, referring to this version as CARROT w/o Agent.
efficiency range.
                                                                  Finally, we implement a method called CARROT Upper to
                     VII. E XPERIMENT                             establish an upper bound by enumerating all possible chunk
  The experimental study intends to answer the following          combinations within the top-5 chunk candidates and selecting
questions:                                                        the optimal chunk combination order. We adopt Llama3-
• RQ1: (1) How effective is our CARROT for the cost-              8B [61] as the default large language model for these methods.
  constrained RAG pipeline compared to other methods? (2)         Hyper-parameter Settings. The hyper-parameters for CAR-
  Does CARROT consistently maintain its effectiveness across      ROT are automatically determined by the configuration agent,
  different LLMs?                                                 while NaiveRAG does not require hyper-parameters. For other
• RQ2: How efficient is CARROT compared to different              baseline methods, we ensure consistency by using identical
  baselines?                                                      hyper-parameters for fair comparisons. Specifically, we set the
• RQ3: How does CARROT perform with large-scale datasets          exploration coefficient to 2.4, the number of iterations to 10,
  when evaluating its scalability?                                and the cost coefficient λ to 0.1. Due to the computational
• RQ4: How does the performance of CARROT vary across             constraints imposed by combinatorial complexity, we set the
  different cost budget constraints?                              candidate chunks to 5 in the CARROT Upper case. By default,
• RQ5: What is the effectiveness of each component in             we set the fixed chunk size to 256 and the budget to 1024 for
  CARROT?                                                         fair ablation studies. For offline data collection, we sample 1K
                                                                  seed queries from three datasets and perform grid search over
A. Experimental Setting                                           6 rerankers with 20 parameter combinations per query.
Environment. We integrate our framework with the RAG              Learning Setting. In our method, the configuration agent
framework LlamaIndex [32] and Faiss [55]. Experiments used        is trained using contrastive learning. The hyper-parameters
dual Intel Xeon Gold 6326 CPUs (32 cores, 64 threads),            used during this process include a margin for contrastive loss
512 GB DDR4 RAM, and 960 GB NVMe SSD. The con-                    (margin=1.0), learning rate (lr=0.001), batch size (32), number
figuration agent is implemented in PyTorch 2.4, with data         of epochs (num epochs=60), and the embedding model (i.e.,
collection and training performed on 8×A5000 GPUs. We             BAAI/bge-m3 [54]).
choose OpenRouter [56] to deploy our inference service.           Evaluation Metrics. Following [12], [14], [15], we utilize
Datasets. To evaluate the performance of CARROT across di-        ROUGE-1, ROUGE-L [62], and BLEU-1 [63] for single-
verse scenarios, we conduct experiments on three datasets with    hop retrieval tasks, and F1 score [64] for multi-hop retrieval
differing task focuses (Table I): (1) WikiPassageQA [57] is a     scenarios. To evaluate efficiency, we measure the retrieval
question-answering benchmark containing 4,165 questions and       latency across different methods.
over 100,000 text chunks, designed for non-factoid question
answering and passage retrieval. (2) MARCO [58] is a compre-      B. Performance Comparison
hensive dataset tailored for natural language processing tasks,      1) RQ1-(1): Effectiveness Comparison Across Datasets and
primarily emphasizing question answering and retrieval. (3)       Chunk Sizes: As shown in Table II, we evaluate the ef-
HotpotQA [59] is a question-answering benchmark designed          fectiveness of CARROT compared to various baselines on
for multi-hop reasoning tasks, consisting of approximately        three datasets: WikiPassageQA, MARCO, and HotpotQA. The
113K QA pairs sourced from Wikipedia.                             first two are single-hop datasets, while the last is a multi-
Baselines. We compare CARROT against representative rank-         hop dataset. For methods that support token-level budget
based RAG methods, including RAPTOR [6], NaiveRAG [28],           constraints (e.g., RAPTOR, NaiveRAG, and HYDE), we fix
HYDE [29], and FLARE [17], to demonstrate improvements            the token budget to 1024. For other methods, we report results
in retrieval relevance and response quality. We also evaluate     without budget limitations. To ensure fairness, all methods are
graph-based approaches such as GraphRAG [13], Graph-              built upon Llama3-8B. The experimental results lead to the
CoT [25], and G-Retriever [60], highlighting our efficiency       following observations:
advantages. Finally, we include comparisons with tuning-based     (1) CARROT consistently outperforms all baselines across
methods, despite their substantial computational overhead and     different datasets. Specifically, it achieves about 30% relative
infrastructure requirements. For instance, ColBERT [23] re-       gain on both single-hop and multi-hop tasks. As expected, it
quires 3 hours to index 9M passages on four V100 GPUs,            does not surpass the CARROT upper, which represents a nearly
while RankRAG [14] and Self-RAG [21] demand 128 A100              exhaustive search over chunk combinations.
  TABLE II: Effectiveness Comparison and Token Cost Across Datasets (All methods are built upon Llama3-8B. Best in bold,
  second-best underlined). On.=Average online token cost (per-query).
                                                                                                 WikiPassageQA                                                                       MARCO                                    HotpotQA
                   Method                                    256                                     512                           1024              On.↓          256               512              1024         On.↓ 256   512 1024 On.↓
                                                      R1     RL           B-1       R1               RL       B-1        R1         RL         B-1            R1   RL     B-1   R1   RL    B-1   R1   RL     B-1        F1    F1   F1
                   RAPTOR                        0.328 0.306 0.345 0.322 0.301 0.333 0.335 0.305 0.370 1024 0.386 0.356 0.371 0.393 0.366 0.370 0.338 0.316 0.328 1024 0.248 0.252 0.245 1024
                   NaiveRAG                      0.327 0.302 0.333 0.321 0.297 0.321 0.334 0.303 0.338 1024 0.398 0.369 0.385 0.395 0.368 0.372 0.337 0.312 0.324 1024 0.243 0.248 0.240 1024
                   HYDE                          0.311 0.301 0.323 0.306 0.286 0.311 0.318 0.290 0.328 1024 0.367 0.338 0.352 0.373 0.348 0.349 0.321 0.300 0.312 1024 0.228 0.235 0.225 1024
                   ColBERT                       0.329 0.304 0.335 0.324 0.300 0.326 0.333 0.307 0.336 1024 0.376 0.357 0.358 0.375 0.349 0.351 0.324 0.309 0.319 1024 0.247 0.253 0.244 1024
                   Graph-CoT                     0.362 0.343 0.324 0.359 0.341 0.321 0.364 0.345 0.326 14237 0.364 0.345 0.349 0.362 0.343 0.347 0.360 0.342 0.345 14576 0.294 0.297 0.295 14011
                   G-Retriever                   0.356 0.337 0.318 0.353 0.335 0.315 0.358 0.339 0.320 13239 0.358 0.339 0.343 0.356 0.337 0.341 0.354 0.336 0.339 12428 0.281 0.284 0.282 13003
                   FLARE                         0.367 0.348 0.330 0.364 0.346 0.327 0.370 0.351 0.333 16913 0.370 0.351 0.355 0.368 0.349 0.353 0.366 0.348 0.352 16584 0.305 0.307 0.305 15022
                   GraphRAG                      0.337 0.315 0.311 0.322 0.302 0.291 0.331 0.290 0.304 1024 0.376 0.343 0.357 0.370 0.342 0.351 0.307 0.295 0.304 1004 0.298 0.318 0.291 1001
                   HippoRAG2                     0.363 0.345 0.328 0.360 0.343 0.325 0.367 0.348 0.331 1024 0.367 0.348 0.352 0.365 0.347 0.350 0.363 0.346 0.349 1003 0.311 0.327 0.313 1028
                   CARROT upper     0.437 0.416 0.395 0.426 0.406 0.423 0.444 0.423 0.420 923 0.435 0.414 0.431 0.425 0.397 0.411 0.447 0.426 0.420 822 0.347 0.357 0.339 1011
                   CARROT w/o Agent 0.390 0.364 0.337 0.372 0.347 0.379 0.388 0.362 0.368 838 0.401 0.374 0.389 0.393 0.372 0.377 0.393 0.364 0.368 725 0.299 0.312 0.307 1021
                   CARROT           0.432 0.401 0.392 0.413 0.381 0.394 0.419 0.386 0.397 811 0.425 0.391 0.413 0.419 0.386 0.400 0.423 0.393 0.405 789 0.320 0.349 0.336 1007

                                   TABLE III: Effectiveness Comparison Across Different LLMs (best in bold, second-best underlined)
                          Dataset                  LLM     RAPTOR NaiveRAG HYDE ColBERT Graph-CoT G-Retriever FLARE GraphRAG HippoRAG2 CARROT upper CARROT w/o Agent CARROT
                     WikiPassageQA              Llama3-8B   0.328   0.327  0.311 0.329    0.362     0.356      0.367  0.337     0.363     0.437          0.390        0.432
                                                DeepseekV3  0.348   0.347  0.330 0.348    0.371     0.368      0.389  0.358     0.369     0.463          0.413        0.459
                    (Rouge-1 score ↑)             GPT-4o    0.341   0.340  0.324 0.344    0.367     0.371      0.382  0.351     0.361     0.454          0.406        0.449
                        MARCO                   Llama3-8B   0.386   0.398  0.367 0.376    0.364     0.358      0.370  0.376     0.367     0.435          0.401        0.425
                                                DeepseekV3  0.409   0.422  0.389 0.379    0.419     0.428      0.429  0.399     0.410     0.461          0.425        0.454
                    (Rouge-1 score ↑)             GPT-4o    0.401   0.414  0.382 0.372    0.411     0.418      0.422  0.391     0.402     0.452          0.417        0.440
                         HotpotQA               Llama3-8B   0.248   0.243  0.228 0.247    0.294     0.281      0.305  0.298     0.311     0.347          0.299        0.320
                                                DeepseekV3  0.263   0.258  0.242 0.262    0.311     0.298      0.319  0.316     0.329     0.368          0.317        0.341
                        (F1 score ↑)              GPT-4o    0.259   0.254  0.238 0.256    0.305     0.291      0.311  0.307     0.318     0.355          0.309        0.331

                                        GraphRAG       HYDE
              90                        HippoRAG2
                                        Graph-CoT
                                                       NaiveRAG
                                                       ColBERT                                  80
                                                                                                                              GraphRAG                             TABLE IV: Cost Breakdown on WikiPassageQA (Llama3-8B).
                                        FLARE          CARROT w/o Agent
              80                        G-Retriever    CARROT                                                                            HippoRAG2
                                        Raptor                                                  70                                                                                   Offline Indexing    Online      Quality
              70                                                                                                                         Graph-CoT                       Method
              60                                                                                60                                                                                   Time(s) Token Time(s) Token R1↑ RL↑
                                                                                Time Cost (s)
Latency (s)




                                                                                                50           Raptor
              50                                                                                                                          FLARE                          NaiveRAG     61.2       –     2.3    1024 0.327 0.302
              40                                                                                40                                                                       HYDE          66.1      –    28.7    1024 0.311 0.301
              30                                                                                30                                                                       ColBERT      1731       –     2.5    1024 0.329 0.304
                                                                                                                G-Retriever      HYDE
              20                                                                                20                                                                       G-Retriever 1281.1      –    22.8 13239 0.356 0.337
              10                                                                                                                                                         FLARE         70.0      –    45.5 16913 0.367 0.348
                                                                                                10
               0                                                                                           NaiveRAG      ColBERT                     CARROT
                   WikiPassageQA     MARCO             HotpotQA                                  0 0.26 0.28 0.30 0.32 0.34 0.36 0.38 0.40                               RAPTOR      21301.0 0.9M     55.1    1024 0.328 0.306
                                    Datasets
                                                                                                                   RougeL Score                                          Graph-CoT 28888.1 2.1M       61.3 14237 0.362 0.343
                                                                                                                                                                         GraphRAG 55003.2 2.3M        80.2    1024 0.337 0.315
  (a)   Efficiency                            Comparison                          (b) Time Cost vs Response                                                              HippoRAG2 32401.3 1.7M       78.0    1024 0.363 0.345
  Across Datasets                                                                 Quality Tradeoff                                                                       CARROT        66.9      –     3.1     811 0.432 0.401

                     Fig. 6: Efficiency and Quality Trade-off Analysis                                                                                            3) RQ2: Efficiency Evaluation: As depicted in Figure 6a,
                                                                                                                                                               we evaluate the retrieval efficiency by comparing the latency
  (2) Optimal chunk sizes vary across methods and datasets. For
                                                                                                                                                               between different methods across the three datasets, with
  instance, CARROT performs best with a chunk size of 256
                                                                                                                                                               the chunk size set at 256. The results show that NaiveRAG
  in the single-hop datasets and 512 in the multi-hop setting.
                                                                                                                                                               requires the least time for retrieval as it directly invokes
  Meanwhile, the CARROT upper achieves its best results with
                                                                                                                                                               the reranker model and uses the vector index to calculate
  a chunk size of 1024 in the single-hop dataset while 512 in
                                                                                                                                                               similarities. On the other hand, CARROT requires more time as
  multi-hop dataset. Notably, the average number of tokens used
                                                                                                                                                               it employs a configuration agent to predict optimal parameters
  in HotpotQA is higher than in single-hop datasets, likely due
                                                                                                                                                               and utilizes a policy tree to search for the optimal chunk
  to the increased complexity of multi-hop reasoning, which
                                                                                                                                                               combination. Conversely, CARROT w/o Agent, which operates
  benefits from larger chunk sizes that capture more context.
                                                                                                                                                               with default parameter settings, demonstrates reduced re-
  (3) CARROT upper achieves better performance at a modest                                                                                                     trieval time compared to CARROT. Additionally, other baseline
  increase in cost. For example, on WikiPassageQA, the R1                                                                                                      methods, which involve invoking LLMs to process retrieval,
  score improves from 0.432 to 0.437 while the average token                                                                                                   exhibit higher latency. For instance, RAPTOR and Graph-based
  usage increases from 811 to 923, demonstrating that exhaustive                                                                                               methods, which use an external LLM for summarization or
  search with larger search spaces provides diminishing returns,                                                                                               extraction, showed significantly reduced efficiency.
  validating the cost-quality trade-off of CARROT.
                                                                                                                                                                  Figure 6b demonstrates that CARROT achieves high re-
     2) RQ1-(2): Effectiveness Comparison Across LLMs: As                                                                                                      sponse quality within acceptable time costs. The comparable
  shown in Table III, we evaluated CARROT across three LLMs:                                                                                                   latencies between NaiveRAG and CARROT result from key
  Llama3-8B [61], DeepseekV3 [65], and GPT-4o [66]. The                                                                                                        optimizations: (1) Minimal LLM calls: CARROT invokes the
  evaluation utilizes Rouge-1 for WikiPassageQA, MARCO and                                                                                                     LLM only once at final inference after tree search completion.
  F1 scores for HotpotQA, with a standardized cost constraint                                                                                                  (2) Shallow search depth: optimal gold passages are typically
  of 1024 tokens. The results indicate that CARROT consistently                                                                                                covered by several chunks, resulting in shallow tree depths.
  outperforms baseline methods across all LLMs, with particu-                                                                                                  (3) Parallel expansion: parallel mechanisms enable concurrent
  larly strong performance when integrated with DeepseekV3,                                                                                                    computation of multiple candidate nodes’ utility scores with-
  highlighting our method’s generalizability.                                                                                                                  out significantly increasing external model calls.
TABLE V: Effectiveness comparison vs. budgets (best in bold, second-best underlined). On.=Online token cost (per-query).
                                         Budget=1024                                     Budget=2048                                    Budget=8192
    Methods             WikiPassageQA       MARCO          HotpotQA      WikiPassageQA      MARCO         HotpotQA      WikiPassageQA      MARCO         HotpotQA
                        R1↑      On.↓    R1↑     On.↓     F1↑    On.↓    R1↑      On.↓   R1↑     On.↓    F1↑    On.↓    R1↑      On.↓   R1↑     On.↓    F1↑    On.↓
    RAPTOR              0.328    1024    0.386   1024    0.248    1024   0.334    2048   0.389   2048   0.255    2048   0.330    8192   0.381   8192   0.247    8192
    NaiveRAG            0.327    1024    0.398   1024    0.243    1024   0.333    2048   0.401   2048   0.250    2048   0.328    8192   0.392   8192   0.242    8192
    HYDE                0.311    1024    0.367   1024    0.228    1024   0.317    2048   0.371   2048   0.236    2048   0.312    8192   0.363   8192   0.227    8192
    ColBERT             0.329    1024    0.376   1024    0.247    1024   0.335    2048   0.379   2048   0.254    2048   0.330    8192   0.371   8192   0.246    8192
    Graph-CoT           0.362   14156    0.364  14089    0.262   14823   0.365   14298   0.367  14312   0.269   15067   0.361   14421   0.363  14487   0.260   15213
    G-Retriever         0.356   13102    0.358  13187    0.270   13356   0.359   13245   0.361  13312   0.276   13489   0.354   13378   0.356  13456   0.268   13612
    FLARE               0.367   16789    0.370  16102    0.301   16867   0.370   16912   0.373  16278   0.309   17023   0.366   17045   0.369  16421   0.303   17189
    GraphRAG            0.337    1024    0.376   1004    0.298    1001   0.343    2048   0.381   2048   0.305    2048   0.335    8192   0.369   8192   0.292    8192
    HippoRAG2           0.363    1024    0.367   1003    0.311    1028   0.369    2048   0.372   2048   0.318    2048   0.362    8192   0.365   8192   0.309    8192
    CARROT w/o Agent    0.390     823    0.401   841     0.299    987    0.372     856   0.393   712    0.312   1018    0.388     879   0.393   748    0.307   1035
    CARROT upper        0.437     912    0.435    938    0.347     997   0.426     934   0.425    867   0.357    1012   0.444    971    0.447   835    0.339   1027
    CARROT              0.432     798    0.425   776     0.320    991    0.417     823   0.419   801    0.349   1008    0.420     847   0.420   819    0.336   1015


TABLE VI: Ablation Study of Components (WikiPassageQA)                             consistently outperforms all baseline methods regardless of
              Methods (Chunk Size=256)
                                           Quality      Online Cost                budget constraints. Notably, CARROT consistently maintains
                                          R1↑    RL↑    Tok.   Time                average token consumption below designated budget thresh-
              Top-k+JinaV2               0.327   0.302 1024      2.3               olds. Furthermore, several baseline methods do not improve
              w Agent-Only               0.297   0.271  795      2.5
              w Beam Search              0.380   0.354  820      3.0               monotonically with larger budgets, empirically validating our
              w Bandit                   0.362   0.337  815      2.9               observation in Challenge 2 that chunk utility does not follow a
              w MLP                      0.341   0.318  992      3.5
              w/o Agent                  0.390   0.364  838      2.6               monotonic relationship with context length. In contrast, several
              w/o Predicted Reranker     0.367   0.342  805      2.7
              w/o Predicted C            0.394   0.367  815      2.8               baseline approaches either exceed the allocated budgets or
              w/o Predicted λ            0.391   0.364  812      2.8               consume them entirely, rendering such methods impractical
              w/o Parallel Expansion     0.401   0.374  840     16.1
                                                                                   for real-world deployment scenarios.
              CARROT                     0.432 0.401    811      3.1†
†                                                                                  Remark. For adaptable baselines like NaiveRAG and HYDE,
 Latency breakdown: Embed 0.2s (6.5%), Retrieval 0.5s (16.1%), Config Agent 0.5s
(16.1%), Simulation 1.5s (48.4%), Tree Ops 0.3s (9.7%), Other 0.1s (3.2%).         we adapted these methods by limiting their token, stopping the
                                                                                   addition of chunks when the output would exceed constraints.
   Table IV decomposes computational costs into two dimen-                         For graph-based methods such as GraphRAG and HippoRAG2,
sions: Offline Indexing and Online retrieval. Offline Indexing                     costs shown here reflect online token cost only; offline graph
captures per-corpus preprocessing costs that must be repeated                      construction costs are discussed separately in Table IV.
for each new corpus, e.g., GraphRAG requires 2.3M tokens
for WikiPassageQA indexing. CARROT requires negligible                             C. RQ5: Ablation Study
per-corpus indexing of 66.9s. For online retrieval, CARROT                            1) Ablation Studies on Different Components.: Table VI
achieves 811 tokens per query with R1=0.432, demonstrat-                           demonstrates that each component contributes substantially:
ing superior token efficiency compared to baselines, making                        removing the policy tree, configuration agent, or predicted
CARROT suitable for large-scale deployments.                                       parameters all cause significant performance decline. Notably,
Remark (One-time Data Collection and Pre-training Cost).                           the parallel expansion mechanism enhances efficiency by
CARROT requires 1.8 hours for data collection and about 7                          reducing latency from 16.1s to 3.1s (80.7% reduction). The
minutes for agent training, which is acceptable compared to                        latency breakdown (Table VI footnote) reveals that the Simu-
training-based methods such as ColBERT (10+ hours) and G-                          lation phase requiring reranker inference dominates (48.4%),
Retriever (6.2 hours). This is a one-time cost and can be reused                   while MCTS Tree Ops add only 9.7% overhead, confirming
across deployments, as the configuration agent generalizes to                      that MCTS introduces acceptable computational cost for its
unseen domains and different LLMs (Figure 11).                                     quality gains. To further justify MCTS necessity, we compare
   4) RQ3: Scalability Evaluation: To evaluate the scala-                          five search strategies: (1) Top-k+JinaV2 (k=10) applies a fixed
bility of CARROT, we use the large-scale WikiPassageQA                             reranker to top-k candidates without exploring chunk combi-
dataset and vary the number of chunks to assess performance                        nation orders, achieving R1=0.327; (2) Agent-Only extends
under increasing data volumes. As shown in Figure 7, we                            the configuration agent to directly predict chunk combination
randomly sample between 10K and 100K chunks from the                               order scores by adding a scoring head, bypassing MCTS
full dataset and measure the retrieval latency across different                    search; it achieves the lowest quality because direct prediction
baselines. Despite the tenfold increase in data size, CAR-                         cannot effectively consider chunk correlations; (3) Bandit [52]
ROT’s latency rises by only about 10%, demonstrating strong                        employs arm-level exploration but neglects chunk combi-
scalability in handling large-scale retrieval tasks. This stems                    nation order dependencies, achieving R1=0.362; (4) Beam
from CARROT’s ability to effectively prune the search space,                       Search [67] maintains top-k candidates per step yet remains
maintaining a favorable balance between performance and                            limited by greedy local exploration, achieving R1=0.380; (5)
computational overhead. In contrast, graph-based and online                        CARROT with MCTS systematically explores chunk order de-
reasoning methods exhibit significantly higher overhead.                           pendencies via tree-based global search, achieving R1=0.432,
   5) RQ4: Effectiveness Evaluation on Different Budgets:                          a 32.1% gain over Top-k+JinaV2 with minimal overhead.
As demonstrated in Table V, we evaluate CARROT under                                  2) Ablation Studies on Design Choices.: We conduct three
various budget constraints to assess its performance. Ex-                          ablation studies on key factors affecting RAG performance.
periments conducted across the three datasets with budget                             (1) Validity of Reranker Scores as Simulation Reward.
limits of 1024, 2048, and 8192 tokens reveal that CARROT                           In CARROT’s policy tree search, the reranker assigns node
                    80
                    70                                                                                                                                                                                                                                                                                                                          40
                                                                                                                                    0.65




                                                                                                                                                                                                                                                                                                            Iterations / External Model Calls
                                                                                                                                                                                                                                      0.450
                    60
                                                                                                                                    0.60
                                                                                                                                              r = 0.83                                                                                                                                                                                          35
      Latency (s)


                    50                                                                                                                                                                                                                0.425                                                                                                     30
                                                                                                                                    0.55




                                                                                                                                                                                                                       RougeL Score
                    40                                                                                                                                                                                                                0.400                                                                                                     25
                                                                                                                                    0.50
                    30




                                                                                                                          ROUGE-L
                                                                                                                                                                                                                                      0.375                                                                                                     20
                    20                                                                                                              0.45
                                                                                                                                                                                                                                      0.350                                                                                                     15
                    10                                                                                                              0.40
                                                                                                                                                                                                                                      0.325                                                                                                     10
                     0                                                                                                              0.35
                                                                                                                                                                                                                                                                                                                                                 5
                                                                                                                                                                                                                                      0.300
                                                                                                                                    0.30
                           k


                                  k


                                          k


                                                    k


                                                             k


                                                                        k


                                                                                 k


                                                                                           k


                                                                                                       k


                                                                                                               0k
                         10


                                20


                                        30


                                                  40


                                                           50


                                                                      60


                                                                               70


                                                                                         80


                                                                                                     90


                                                                                                             10
                                                                                                                                                                                                                                              10       20       30       40                   50    60                                               10        20      30        40    50      60
                                                         Number of Chunks                                                           0.25                                                                                                                     Chunk Candidates                                                                                       Chunk Candidates
                                      GraphRAG          G-Retriever         NaiveRAG             HippoRAG2                          0.200.3
                                      Graph-CoT         Raptor              CARROT               ColBERT                                        0.4      0.5   0.6   0.7    0.8              0.9     1.0                                                        CARROT                 Graph-CoT          FLARE                                           Raptor       NaiveRAG
                                      FLARE             HYDE                                                                                     Reranker Score (Normalized)                                                                                    GraphRAG               ColBERT            G-Retriever                                     HYDE         HippoRAG2



          Fig. 7: Scalability Comparison (WikiPassageQA) Fig. 8: Reranker-Quality correlation                                                                                                                                                 Fig. 9: Quality/Efficiency vs. Candidates

                               Llama3-8B                                                         0.50                                                                                                                                                                                                                                                                                       0.44
                                                                                                             Single-hop
          0.45                 DeepseekV3                                                                    Multi-hop                                                                     Academic 0.409     0.389     0.377             0.391      0.368    0.382                       WikiPassageQA                                          0.398           0.371       0.324
                                                                                                                                                                                                                                                                                                                                                                                            0.42
                               GPT-4o                                                            0.45
                                                                                                                                                                                                                                                                                                                                                                                            0.40




                                                                                                                                                                                                                                                                              Train Dataset
                                                                                                                                                                                                                                                                           0.41
                                                                                                                                                                                       Commerce 0.386         0.412     0.378             0.371      0.376    0.389
          0.40                                                                                   0.40
ROUGE-L




                                                                                       ROUGE-L


                                                                                                                                                                                                                                                                                                      Marco                                      0.376           0.389       0.318          0.38




                                                                                                                                                                            Train Domain
                                                                                                                                                                                                                                                                           0.40
                                                                                                                                                                                           Literature 0.382   0.391     0.396             0.379      0.388    0.374
                                                                                                 0.35
          0.35                                                                                                                                                                         Healthcare 0.379       0.385     0.372             0.405      0.387    0.384
                                                                                                                                                                                                                                                                           0.39                                                                                                             0.36


                                                                                                 0.30                                                                                                                                                                      0.38                    HotpotQA                                      0.383           0.369       0.345          0.34
                                                                                                                                                                                              Legal 0.378     0.371     0.388             0.389      0.418    0.375
          0.30
                                                                                                 0.25                                                                                        Others 0.383     0.376     0.381             0.372      0.378    0.392
                                                                                                                                                                                                                                                                           0.37
                                                                                                                                                                                                                                                                                                                                                                                            0.32




                                                                                                                                                                                                                                                                                                                                                          QA

                                                                                                                                                                                                                                                                                                                                                                    rco



                                                                                                                                                                                                                                                                                                                                                                                 QA
                                                                                                                                                                                                                                                                                                                                                     ge




                                                                                                                                                                                                                                                                                                                                                                             ot
                                                                                                                                                                                                                                                                                                                                                               Ma
          0.25                                                                                   0.20




                                                                                                                                                                                                                                                                                                                                                                            tp
                                                                                                                                                                                                                                                                                                                                                     sa




                                                                                                                                                                                                                                                                                                                                                                            Ho
                                                                                                                                                                                                                                                                                                                                             s
                          Random Score-Desc Score-Asc                  CARROT                            Random     Score-Desc Score-Asc                  CARROT




                                                                                                                                                                                                        ic


                                                                                                                                                                                                                  ce


                                                                                                                                                                                                                                re


                                                                                                                                                                                                                                              re

                                                                                                                                                                                                                                                      al


                                                                                                                                                                                                                                                                 s




                                                                                                                                                                                                                                                                                                                                          Pa
                                                                                                                                                                                                                                                               er
                                                                                                                                                                                                      em




                                                                                                                                                                                                                                                       g
                                                                                                                                                                                                                            tu


                                                                                                                                                                                                                                             ca
                                                                                                                                                                                                                er




                                                                                                                                                                                                                                                    Le


                                                                                                                                                                                                                                                                h




                                                                                                                                                                                                                                                                                                             iki
                                                                                                                                                                                                                          a
                                                                                                                                                                                                              m




                                                                                                                                                                                                                                          lth




                                                                                                                                                                                                                                                             Ot
                                                                                                                                                                                                     ad




                                                                                                                                                                                                                       er
                                      Ordering Strategy                                                             Ordering Strategy




                                                                                                                                                                                                              m




                                                                                                                                                                                                                                                                                                            W
                                                                                                                                                                                                                                          a
                                                                                                                                                                                                   Ac




                                                                                                                                                                                                                      Lit


                                                                                                                                                                                                                                       He
                                                                                                                                                                                                           Co
                                                                                                                                                                                                                         Test Domain                                                                                                                       Test Dataset

                               (a) Across LLMs                                                           (b) Across query types                                                            (a) Domain Generalization                                                                               (b) Data Generalization
                                        Fig. 10: Chunk order sensitivity analysis                                                                                                          Fig. 11: Data and Domain Generalization Evaluation
          benefits W (Φv ) during the simulation phase to assess chunk                                                                                                                                                                             Query: Is bougainvillea a shrub?


          combinations orders. Prior work [33], [38] has demonstrated                                                                                                  1)Bougainvillea is a tropical vining
                                                                                                                                                                       shrub that comes in a wide array of                            Score
                                                                                                                                                                                                                                                   3)During colder months, they are…
                                                                                                                                                                                                                                                   2)Bougainvillea are tropical and                      Score
                                                                                                                                                                                                                                                                                                                                                 The flowers are actually modified
                                                                                                                                                                                                                                                                                                                                                                                            Score
                                                                                                                                                                                                                                                                                                                                                 leaves, called bracts, that are long
                                                                                                                                                                                                                                       0.43                                                               0.21                                                                               0.27
          high correlations between reranker scores and end-task quality;                                                                                              bright and fanciful colors....
                                                                                                                                                                       2)Bougainvillea are tropical and
                                                                                                                                                                                                                                      Token
                                                                                                                                                                                                                                                   must be protected from frost...
                                                                                                                                                                                                                                                   1)Bougainvillea is a tropical vining
                                                                                                                                                                                                                                                                                                         Token                                   lasting and bright... Bougainvillea        Token
                                                                                                                                                                                                                                       899                                                                899                                    are tropical and must be protected          8192
          we empirically verify this property in our setting by sam-                                                                                                   must be protected from frost...
                                                                                                                                                                       3)During colder months, they are…
                                                                                                                                                                                                                                                   shrub that comes in a wide array of
                                                                                                                                                                                                                                                   bright and fanciful colors....                                                                from frost...

          pling ∼50% queries from WikiPassageQA and enumerating                                                                                                                              CARROT                                                          Adversely Order                                                                                   NaïveRAG

                                                                                                                                                                       2)Bougainvillea are tropical and                                            Bougainvillea is a stunning tropical                                                          During colder months, they
          diverse chunk combinations to collect reranker score, quality                                                                                                must be protected from frost...
                                                                                                                                                                                                                                      Score        vining shrub known for its vibrant                    Score
                                                                                                                                                                                                                                                                                                                                                 are… Bougainvillea are
                                                                                                                                                                                                                                                                                                                                                                                            Score
                                                                                                                                                                                                                                       0.33                                                               0.32                                                                               0.23
          (ROUGE-L) pairs. As shown in Figure 8, we observe a                                                                                                          N)The flowers are actually modified                            Token
                                                                                                                                                                                                                                                   array of bright and fanciful colors.
                                                                                                                                                                                                                                                   As a tropical plant, it requires
                                                                                                                                                                                                                                                                                                         Token                                   tropical and must be protected             Token
                                                                                                                                                                       leaves, called bracts, that are long                            1011                                                               8192                                   from frost...                               8192
          Pearson correlation [68] of r=0.83, confirming that reranker-                                                                                                lasting and bright...
                                                                                                                                                                                                                                                   protection from frost…


          assigned benefits reliably reflect downstream quality.                                                                                                              CARROT w/o Agent                                                                  RAPTOR                                                                                              HYDE


             (2) Impact of Chunk Candidate Counts. As shown in                                                                                                                      Fig. 12: Case Study for CARROT
          Figure 9, our analysis of chunk candidate counts on WikiPas-                                                                                               train the configuration agent on one domain’s training set and
          sageQA demonstrates that CARROT achieves high response                                                                                                     evaluate on other domains’ test sets using six distinct do-
          quality while requiring fewer iterations and thus fewer external                                                                                           mains [25], creating a 6×6 generalization matrix (where each
          model calls through its parallel expansion algorithm and pol-                                                                                              cell represents the ROUGE-L score as shown in Figure 11(a)).
          icy tree search mechanism. Across different chunk candidate                                                                                                For dataset-level generalization, we train CARROT on one
          counts, several methods require more external model calls to                                                                                               dataset and test on entirely different datasets (to verify cross-
          select their optimal retrieval output, whereas CARROT shows                                                                                                dataset transferability, with ROUGE-L for WikiPassageQA
          only a slight increase in external model call counts while                                                                                                 and MARCO, F1 for HotpotQA presented in Figure 11(b)).
          maintaining them within an acceptable range and achieving                                                                                                  CARROT exhibits robust generalization across both dimen-
          response quality superior to baselines.                                                                                                                    sions, maintaining competitive performance on training do-
             (3) Sensitivity of Chunk Combination Order. To isolate                                                                                                  mains while achieving comparable results on unseen domains
          the effect of chunk combination order, we fix the chunk selec-                                                                                             and datasets, demonstrating practical applicability.
          tion to top-5 chunks and vary only their ordering among four
          strategies: Random, Score-Descending (highest-first), Score-                                                                                               D. Case Study
          Ascending, and CARROT. As shown in Figure 10, CAR-                                                                                                            Figure 12 presents qualitative examples comparing the re-
          ROT outperforms the highest-first heuristic by 11–15% rel-                                                                                                 trieval performance of CARROT against traditional baselines,
          ative gain. Figure 10(a) shows consistent ∼11% performance                                                                                                 illustrating how our method effectively addresses key chal-
          gap between best and worst orderings across Llama3-8B,                                                                                                     lenges: (1) Importance of Chunk Combination Order. To
          DeepseekV3, and GPT-4o. Figure 10(b) reveals that multi-hop                                                                                                evaluate the impact of chunk combination order, we test a
          queries exhibit higher order sensitivity (12% gap) than single-                                                                                            deliberately reordered version of CARROT’s output. The result
          hop queries (11%), suggesting complex reasoning benefits                                                                                                   shows a significant performance drop, with the ROUGE-1
          more from optimal ordering.                                                                                                                                score declining from 0.43 to 0.21, confirming that the chunk
             3) Generalizability Evaluation: To evaluate CARROT’s                                                                                                    combination order is critical for RAG inference.
          generalizability, we conduct experiments across both domain                                                                                                (2) Non-monotonic Utility of Chunk Selection. We compare
          and dataset dimensions. For domain-level generalization, we                                                                                                CARROT with baselines such as RAPTOR, NaiveRAG, and
HYDE, all of which consume the full 8192 online input                         [2] J. Zhu, P. Cai, K. Xu, L. Li, Y. Sun, S. Zhou, H. Su, L. Tang, and Q. Liu,
tokens but underperform relative to CARROT, which uses                            “Autotqa: Towards autonomous tabular question answering through
                                                                                  multi-agent large language models,” Proc. VLDB Endow., vol. 17, no. 12,
only 899 online input tokens. For instance, NaiveRAG relies                       pp. 3920–3933, 2024.
on top-k retrieval with reranking but greedily selects chunks                 [3] P. Li, Y. He, D. Yashar, W. Cui, S. Ge, H. Zhang, D. R. Fainman,
without considering their correlations, often failing to capture                  D. Zhang, and S. Chaudhuri, “Table-gpt: Table fine-tuned GPT for
                                                                                  diverse table tasks,” Proc. ACM Manag. Data, vol. 2, no. 3, p. 176,
semantically relevant context. When answering the query ”Is                       2024.
bougainvillea a shrub?”, it retrieves text containing match-                  [4] S. Arora, B. Yang, S. Eyuboglu, A. Narayan, A. Hojel, I. Trummer,
ing terms but misses the essential taxonomic information.                         and C. Ré, “Language models enable simple systems for generating
                                                                                  structured views of heterogeneous data lakes,” Proc. VLDB Endow.,
Meanwhile, HYDE and RAPTOR depend on costly LLM                                   vol. 17, no. 2, pp. 92–105, 2023.
calls to generate hypotheses or summarize content, leading                    [5] B. Snyder, M. Moisescu, and M. B. Zafar, “On early detection of
to inefficient token usage. In contrast, CARROT’s adaptive                        hallucinations in factual question answering,” in KDD, 2024, pp. 2721–
                                                                                  2732.
chunk selection strategy retrieves concise, semantically aligned
                                                                              [6] P. Sarthi, S. Abdullah, A. Tuli, S. Khanna, A. Goldie, and C. D.
context, enabling more accurate and efficient LLM responses.                      Manning, “RAPTOR: recursive abstractive processing for tree-organized
(3) Handling Query Diversity. To assess robustness to di-                         retrieval,” in ICLR, 2024.
verse query types, we compare CARROT with its variant                         [7] J. Fan, Z. Gu, S. Zhang, Y. Zhang, Z. Chen, L. Cao, G. Li, S. Madden,
                                                                                  X. Du, and N. Tang, “Combining small language models and large
CARROT w/o Agent, which lacks the adaptive configuration                          language models for zero-shot NL2SQL,” Proc. VLDB Endow., vol. 17,
agent. Without this component, the model struggles to identify                    no. 11, pp. 2750–2763, 2024.
optimal chunk combinations and often fails to retrieve the                    [8] Z. Wang, Z. Li, Z. Jiang, D. Tu, and W. Shi, “Crafting personalized
                                                                                  agents through retrieval-augmented generation on editable memory
most relevant information, demonstrating the importance of                        graphs,” in EMNLP, 2024, pp. 4891–4906.
the configuration agent in handling varied query intents.                     [9] E. Fons, R. Kaur, S. Palande, Z. Zeng, T. Balch, M. Veloso, and
                                                                                  S. Vyetrenko, “Evaluating large language models on time series feature
                        VIII. C ONCLUSION                                         understanding: A comprehensive taxonomy and benchmark,” in EMNLP,
                                                                                  2024, pp. 21 598–21 634.
   Considering non-monotonic chunk utility, chunk correla-                   [10] Y. Ang, Y. Bao, Q. Huang, A. K. H. Tung, and Z. Huang, “Tsgassist: An
tion, and diverse query domains, we propose CARROT, a                             interactive assistant harnessing llms and RAG for time series generation
                                                                                  recommendations and benchmarking,” Proc. VLDB Endow., vol. 17,
learned cost-constrained retrieval optimization framework for                     no. 12, pp. 4309–4312, 2024.
RAG. We model chunk combination orders as a policy tree                      [11] S. Chen, J. Fan, B. Wu, N. Tang, C. Deng, P. Wang, Y. Li, J. Tan, F. Li,
and apply MCTS to find the optimal combination within                             J. Zhou, and X. Du, “Automatic database configuration debugging using
                                                                                  retrieval-augmented language models,” Proc. ACM Manag. Data, vol. 3,
a cost constraint. A configuration agent predicts the best                        no. 1, pp. 13:1–13:27, 2025.
query configuration and reranker, while a parallel expansion                 [12] S. Wang, X. Yu, M. Wang, W. Chen, Y. Zhu, and Z. Dou, “Richrag:
strategy processes multiple nodes per iteration. Comprehensive                    Crafting rich responses for multi-faceted queries in retrieval-augmented
                                                                                  generation,” CoRR, vol. abs/2406.12566, 2024.
experiments across three benchmark datasets demonstrate that                 [13] D. Edge, H. Trinh, N. Cheng, J. Bradley, A. Chao, A. Mody, S. Truitt,
CARROT significantly outperforms state-of-the-art methods                         and J. Larson, “From local to global: A graph RAG approach to query-
under constrained costs, achieving up to 30% improvement                          focused summarization,” CoRR, vol. abs/2404.16130, 2024.
while maintaining superior efficiency and scalability.                       [14] Y. Yu, W. Ping, Z. Liu, B. Wang, J. You, C. Zhang, M. Shoeybi,
                                                                                  and B. Catanzaro, “Rankrag: Unifying context ranking with retrieval-
                                                                                  augmented generation in llms,” in NeurIPS, 2024.
                        ACKNOWLEDGMENT                                       [15] Z. Wang, S. X. Teo, J. Ouyang, Y. Xu, and W. Shi, “M-RAG: rein-
                                                                                  forcing large language model performance through retrieval-augmented
   This research is supported by Singapore MOE AcRF Tier-                         generation with multiple partitions,” in ACL, 2024, pp. 1966–1978.
2 grant MOE-T2EP20223-0004. Wei Dong is supported by                         [16] D. Gao, H. Wang, Y. Li, X. Sun, Y. Qian, B. Ding, and J. Zhou, “Text-
the National Research Foundation, Singapore, and the Cyber                        to-sql empowered by large language models: A benchmark evaluation,”
Security Agency of Singapore under the National Cyberse-                          Proc. VLDB Endow., vol. 17, no. 5, pp. 1132–1145, 2024.
                                                                             [17] Z. Jiang, F. F. Xu, L. Gao, Z. Sun, Q. Liu, J. Dwivedi-Yu, Y. Yang,
curity R&D Programme and the CyberSG R&D Programme                                J. Callan, and G. Neubig, “Active retrieval augmented generation,” in
Office (Award CRPO-GC3-NTU-001). Any opinions, findings,                          EMNLP, 2023.
conclusions, or recommendations expressed in these materials                 [18] A. Singh, A. Ehtesham, S. Kumar, and T. T. Khoei, “Agentic
                                                                                  retrieval-augmented generation: A survey on agentic RAG,” CoRR, vol.
are those of the author(s) and do not reflect the views of the                    abs/2501.09136, 2025.
National Research Foundation, Singapore, the Cyber Security                  [19] X. Yang, K. Sun, H. Xin, Y. Sun, N. Bhalla, X. Chen, S. Choudhary,
Agency of Singapore, or the CyberSG R&D Programme                                 R. D. Gui, Z. W. Jiang, Z. Jiang, L. Kong, B. Moran, J. Wang, Y. Xu,
                                                                                  A. Yan, C. Yang, E. Yuan, H. Zha, N. Tang, L. Chen, N. Scheffer,
Office. We also thank Jingyi for helpful feedback.                                Y. Liu, N. Shah, R. Wanga, A. Kumar, S. Yih, and X. Dong, “CRAG
                                                                                  - comprehensive RAG benchmark,” in NeurIPS 2024, A. Globersons,
       AI-G ENERATED C ONTENT ACKNOWLEDGMENT                                      L. Mackey, D. Belgrave, A. Fan, U. Paquet, J. M. Tomczak, and
                                                                                  C. Zhang, Eds., 2024.
  We use LLMs solely for language refinement, including                      [20] J. Wang, E. Hanson, G. Li, Y. Papakonstantinou, H. Simhadri, and
grammar checking, sentence rephrasing, and improving clarity.                     C. Xie, “Vector databases: What’s really new and what’s next?” Proc.
                                                                                  VLDB Endow., vol. 17, no. 12, pp. 4505–4506, 2024.
                            R EFERENCES                                      [21] A. Asai, Z. Wu, Y. Wang, A. Sil, and H. Hajishirzi, “Self-rag: Learning
                                                                                  to retrieve, generate, and critique through self-reflection,” in ICLR 2024,
 [1] X. Zhao, X. Zhou, and G. Li, “Chat2data: An interactive data analysis        2024.
     system with rag, vector databases and llms,” Proc. VLDB Endow.,         [22] Z. Qin, R. Jagerman, K. Hui, H. Zhuang, J. Wu, L. Yan, J. Shen, T. Liu,
     vol. 17, no. 12, pp. 4481–4484, 2024.                                        J. Liu, D. Metzler, X. Wang, and M. Bendersky, “Large language models
     are effective text rankers with pairwise ranking prompting,” in Findings      [46] W. Shi, S. Min, M. Yasunaga, M. Seo, R. James, M. Lewis, L. Zettle-
     NAACL 2024, 2024, pp. 1504–1518.                                                   moyer, and W. Yih, “REPLUG: retrieval-augmented black-box language
[23] O. Khattab and M. Zaharia, “Colbert: Efficient and effective passage               models,” in NAACL, 2024, pp. 8371–8384.
     search via contextualized late interaction over BERT,” in SIGIR 2020.         [47] C. Qu, S. Dai, X. Wei, H. Cai, S. Wang, D. Yin, J. Xu, and J. Wen, “To-
     ACM, 2020, pp. 39–48.                                                              wards completeness-oriented tool retrieval for large language models,”
[24] K. Santhanam, O. Khattab, J. Saad-Falcon, C. Potts, and M. Zaharia,                in CIKM, 2024, pp. 1930–1940.
     “Colbertv2: Effective and efficient retrieval via lightweight late interac-   [48] S. Malviya and S. Katsigiannis, “Evidence retrieval for fact verification
     tion,” in NAACL 2022, 2022, pp. 3715–3734.                                         using multi-stage reranking,” in EMNLP (Findings), 2024, pp. 7295–
[25] B. Jin, C. Xie, J. Zhang, K. K. Roy, Y. Zhang, Z. Li, R. Li, X. Tang,              7308.
     S. Wang, Y. Meng, and J. Han, “Graph chain-of-thought: Augmenting             [49] H. Jiang and Q. Li, “Approximation rate of the transformer architecture
     large language models by reasoning on graphs,” in ACL, 2024, pp. 163–              for sequence modeling,” in NeurIPS 2024, 2024.
     184.                                                                          [50] Z. Cao, W. Li, S. Li, and F. Wei, “Retrieve, rerank and rewrite: Soft
[26] X. He, Y. Tian, Y. Sun, N. V. Chawla, T. Laurent, Y. LeCun, X. Bres-               template based neural summarization,” in ACL, 2018, pp. 152–161.
     son, and B. Hooi, “G-retriever: Retrieval-augmented generation for            [51] Z. Wang, B. Gan, and W. Shi, “Multimodal query suggestion with multi-
     textual graph understanding and question answering,” arXiv preprint                agent reinforcement learning from human feedback,” in WWW, 2024, pp.
     arXiv:2402.07630, 2024.                                                            1374–1385.
[27] B. J. Gutierrez, Y. Shu, Y. Gu, M. Yasunaga, and Y. Su, “Hipporag: Neu-       [52] P. Auer, “Using confidence bounds for exploitation-exploration trade-
     robiologically inspired long-term memory for large language models,”               offs,” J. Mach. Learn. Res., vol. 3, pp. 397–422, 2002.
     in NeurIPS, 2024.                                                             [53] P. Khosla, P. Teterwak, C. Wang, A. Sarna, Y. Tian, P. Isola,
[28] X. Ma, Y. Gong, P. He, H. Zhao, and N. Duan, “Query rewriting in                   A. Maschinot, C. Liu, and D. Krishnan, “Supervised contrastive learn-
     retrieval-augmented large language models,” in EMNLP, 2023.                        ing,” in NeurIPS 2020, 2020.
[29] L. Gao, X. Ma, J. Lin, and J. Callan, “Precise zero-shot dense retrieval      [54] J. Chen, S. Xiao, P. Zhang, K. Luo, D. Lian, and Z. Liu, “BGE
     without relevance labels,” in ACL, 2023, pp. 1762–1777.                            m3-embedding: Multi-lingual, multi-functionality, multi-granularity
                                                                                        text embeddings through self-knowledge distillation,” CoRR, vol.
[30] A. Askari, M. Aliannejadi, C. Meng, E. Kanoulas, and S. Verberne,
                                                                                        abs/2402.03216, 2024.
     “Expand, highlight, generate: Rl-driven document generation for passage
                                                                                   [55] M. Douze, A. Guzhva, C. Deng, J. Johnson, G. Szilvasy, P.-E. Mazaré,
     reranking,” in EMNLP, 2023, pp. 10 087–10 099.
                                                                                        M. Lomeli, L. Hosseini, and H. Jégou, “The faiss library,” 2024.
[31] X. Li, Y. Zhu, S. Liu, J. Ju, Y. Qu, and G. Cheng, “Dyrren: A dynamic
                                                                                   [56] “Openrouter,” https://openrouter.ai/, 2025.
     retriever-reranker-generator model for numerical reasoning over tabular
                                                                                   [57] D. Cohen, L. Yang, and W. B. Croft, “Wikipassageqa: A benchmark
     and textual data,” in AAAI, 2023, 2023, pp. 13 139–13 147.
                                                                                        collection for research on non-factoid answer passage retrieval,” in
[32] “Llamaindex,” https://www.llamaindex.ai/, 2025.                                    SIGIR 2018, 2018, pp. 1165–1168.
[33] F. Wang, Y. Li, and H. Xiao, “jina-reranker-v3: Last but not late             [58] T. Nguyen, M. Rosenberg, X. Song, J. Gao, S. Tiwary, R. Majumder,
     interaction for document reranking,” CoRR, vol. abs/2509.25085, 2025.              and L. Deng, “MS MARCO: A human generated machine reading
[34] M. Chen, K. Zhang, Z. He, Y. Jing, and X. S. Wang, “Roargraph: A                   comprehension dataset,” in NeurIPS, ser. CEUR Workshop Proceedings,
     projected bipartite graph for efficient cross-modal approximate nearest            vol. 1773, 2016.
     neighbor search,” Proc. VLDB Endow., vol. 17, no. 11, pp. 2735–2749,          [59] Z. Yang, P. Qi, S. Zhang, Y. Bengio, W. W. Cohen, R. Salakhutdinov, and
     2024.                                                                              C. D. Manning, “HotpotQA: A dataset for diverse, explainable multi-hop
[35] N. F. Liu, K. Lin, J. Hewitt, A. Paranjape, M. Bevilacqua, F. Petroni, and         question answering,” in EMNLP, 2018.
     P. Liang, “Lost in the middle: How language models use long contexts,”        [60] X. He, Y. Tian, Y. Sun, N. V. Chawla, T. Laurent, Y. LeCun, X. Bresson,
     Transactions of the Association for Computational Linguistics, vol. 12,            and B. Hooi, “G-retriever: Retrieval-augmented generation for textual
     pp. 157–173, 2024.                                                                 graph understanding and question answering,” in NeurIPS, 2024.
[36] Y. Lu, M. Bartolo, A. Moore, S. Riedel, and P. Stenetorp, “Fantastically      [61] A. Grattafiori, A. Dubey, A. Jauhri, A. Pandey, A. Kadian, A. Al-Dahle,
     ordered prompts and where to find them: Overcoming few-shot prompt                 A. Letman, A. Mathur, A. Schelten, A. Vaughan et al., “The llama 3
     order sensitivity,” in ACL, 2022, pp. 8086–8098.                                   herd of models,” CoRR, vol. abs/2407.21783, 2024.
[37] R. Zhu, W. Chen, B. Ding, X. Chen, A. Pfadler, Z. Wu, and J. Zhou,            [62] C.-Y. Lin, “ROUGE: A package for automatic evaluation of summaries,”
     “Lero: A learning-to-rank query optimizer,” Proc. VLDB Endow., vol. 16,            in Text Summarization Branches Out, Barcelona, Spain, Jul. 2004, pp.
     no. 6, pp. 1466–1479, 2023.                                                        74–81.
[38] S. Jain, X. Ma, A. Deoras, and B. Xiang, “Lightweight reranking for           [63] M. Post, “A call for clarity in reporting BLEU scores,” in WMT 2018,
     language model generations,” in ACL, 2024, pp. 6960–6984.                          2018, pp. 186–191.
[39] C. Chai, J. Li, Y. Deng, Y. Zhong, Y. Yuan, G. Wang, and L. Cao,              [64] D. M. Powers, “Evaluation: from precision, recall and f-measure
     “Doctopus: Budget-aware structural table extraction from unstructured              to roc, informedness, markedness and correlation,” arXiv preprint
     documents,” Proc. VLDB Endow., vol. 18, no. 11, pp. 3695–3707, 2025.               arXiv:2010.16061, 2020.
[40] Z. Wang, H. Yuan, W. Dong, G. Cong, and F. Li, “Techni-                       [65] DeepSeek-AI, A. Liu, B. Feng, B. Xue, B. Wang et al., “Deepseek-v3
     cal report on carrot: A learned cost-constrained retrieval optimiza-               technical report,” CoRR, vol. abs/2412.19437, 2024.
     tion system for rag,” https://github.com/wang0702/CARROT/blob/main/           [66] “Openai,” https://chat.openai.com/, 2025.
     TechnicalReport.pdf, 2025.                                                    [67] F. Atif, O. E. Khatib, and D. E. Difallah, “Beamqa: Multi-hop knowledge
[41] G. Ausiello, P. Crescenzi, G. Gambosi, V. Kann, A. Marchetti-                      graph question answering with sequence-to-sequence prediction and
     Spaccamela, and M. Protasi, Complexity and approximation: Combi-                   beam search,” in Proceedings of the 46th International ACM SIGIR
     natorial optimization problems and their approximability properties.               Conference on Research and Development in Information Retrieval.
     Springer Science & Business Media, 2012.                                           ACM, 2023, pp. 781–790.
[42] M. Wang, H. Wu, X. Ke, Y. Gao, X. Xu, and L. Chen, “An interactive            [68] E. I. Obilor and E. C. Amadi, “Test for significance of pearson’s cor-
     multi-modal query answering system with retrieval-augmented large                  relation coefficient,” International Journal of Innovative Mathematics,
     language models,” Proc. VLDB Endow., vol. 17, no. 12, pp. 4333–4336,               Statistics & Energy Policies, vol. 6, no. 1, pp. 11–23, 2018.
     2024.
[43] T. Li, X. Yang, Y. Ke, B. Wang, Y. Liu, and J. Xu, “Alleviating the
     inconsistency of multimodal data in cross-modal retrieval,” in ICDE,
     2024, pp. 4643–4656.
[44] M. Y. Eltabakh, Z. A. Naeem, M. S. Ahmad, M. Ouzzani, and N. Tang,
     “Retclean: Retrieval-based tabular data cleaning using llms and data
     lakes,” Proc. VLDB Endow., vol. 17, no. 12, pp. 4421–4424, 2024.
[45] N. Huo, R. Cheng, B. Kao, W. Ning, N. A. H. Haldar, X. Li, J. Li,
     M. M. Najafi, T. Li, and G. Qu, “Zeroea: A zero-training entity
     alignment framework via pre-trained language model,” Proc. VLDB
     Endow., vol. 17, no. 7, pp. 1765–1774, 2024.
