Next Article in Journal
Effective Cloud–Edge Workflow Scheduling via Decoupled Offline Learning and Unified Sequence Modeling
Previous Article in Journal
Investigation on Dynamic Formation, Dissociation, and Phase Transition Mechanisms of Natural Gas Hydrates in Complex Pore Structures
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

An Adaptive Multi-Source Retrieval-Augmented Generation Framework Integrating Query Complexity Awareness and Confidence-Aware Fusion

School of Artificial Intelligence, China University of Geosciences Beijing, Beijing 100083, China
*
Author to whom correspondence should be addressed.
Appl. Sci. 2026, 16(5), 2495; https://doi.org/10.3390/app16052495
Submission received: 13 January 2026 / Revised: 12 February 2026 / Accepted: 26 February 2026 / Published: 5 March 2026
(This article belongs to the Topic Applications of NLP, AI, and ML in Software Engineering)

Abstract

Retrieval-Augmented Generation (RAG) has been observed to encounter challenges in heterogeneous query scenarios characterised by varying evidence requirements and reasoning depths. In order to address this limitation, the present paper puts forward a proposal for an Adaptive Multi-Source RAG framework (AMSRAG) that integrates query complexity awareness with confidence-aware fusion. The framework performs query complexity classification with a pretrained language model, calibrates the classification confidence to guide the dynamic scheduling of retrieval paths and the adjustment of fusion weights, and enables a controllable balance between answer quality and retrieval efficiency through hierarchical path selection and cross-source weighting. The experiments conducted on multiple open-domain question-answering datasets demonstrate that the query complexity classifier achieves an accuracy of 85.9% and a Macro-F1 score of 85.4%. These outcomes indicate the potential for the classifier to generate a reliable decision signal, which can subsequently be utilised to guide the process of adaptive retrieval and fusion. The proposed framework demonstrates a marked improvement in terms of both answer accuracy and retrieval relevance when compared to the fixed-pipeline RAG. In scenarios involving high-confidence queries, the system has been shown to effectively avoid redundant retrieval, thereby reducing the average number of retrievals. In instances of low-confidence complex queries, the system has been shown to enhance evidence coverage and completeness of answers through multi-source retrieval and confidence-weighted fusion. This study proposes a novel methodology for enhancing the adaptability and resource efficiency of RAG systems in response to heterogeneous query conditions.

1. Introduction

Retrieval-Augmented Generation (RAG) [1] is a seminal paradigm that has been shown to be effective in mitigating the limitations of large language models (LLMs) with regard to knowledge, timeliness and coverage. By integrating external retrieval with generation, RAG effectively extends the model’s knowledge boundary and enhances its ability for cross-document reasoning [2,3]. Representative methods include Fusion-in-Decoder (FiD), which fuses multi-document evidence during decoding to improve the utilization of long-text information [4]; Retrieval-Enhanced Transformer (RETRO), which deeply embeds retrievable corpora into the Transformer architecture to support large-scale knowledge invocation [5]; and GraphRAG, which organizes cross-document entity relations through graph structures to strengthen multi-hop reasoning [6]. Meanwhile, researchers have combined Dense Passage Retrieval (DPR) with generative models to propose end-to-end RAG frameworks [4,7], and introduced differentiable retrieval during pretraining (REALM, Retrieval-Augmented Language Model Pre-Training) to internalize external knowledge within models [2]. It is evident that these developments have collectively resulted in a substantial advancement in the domains of knowledge augmentation and reasoning capability. However, most frameworks still use a unified and fixed retrieval generation process, applying the same strategy to queries of varying complexity, and thus cannot reach a good tradeoff between speed and the coverage of evidence.
In terms of Query Complexity analysis and adaptive routing, recent studies have evolved from heuristic statistical features (e.g., length, inverse document frequency distribution, Query Clarity) toward semantic modeling and dynamic decision-making. Self-RAG introduces a Critic Token during generation to determine whether retrieval is necessary [8], while Adaptive-RAG employs a lightweight model to predict Query Complexity and switches among “no-retrieval,” “single-step,” and “iterative” modes [9]. These explorations verify the value of complexity and uncertainty signals for retrieval triggering and path selection. However, their impact remains limited to single-stage switches, and a systematic framework that spans “complexity modeling–confidence calibration–end-to-end scheduling” is still lacking. Furthermore, given that the probabilistic outputs of complexity prediction frequently lack calibration, routing decisions demonstrate instability in the presence of distribution shifts. Therefore, how to elevate complexity and uncertainty signals into interpretable, controllable, and transferable scheduling variables throughout the entire process remains an open question.
Regarding multi-source information and confidence levels, the fusion modeling of both factors is crucial for enhancing overall retrieval performance. Early approaches often used score-based linear fusion methods (CombSUM, CombMNZ) [10] and rank-based fusion methods such as Reciprocal Rank Fusion (RRF) [11], among which RRF is widely used for its simplicity and robustness. Subsequent research incorporated learning-to-rank, reinforcement learning, and pseudo-relevance feedback mechanisms [12,13,14] to more precisely capture the importance and complementarity of retrieval sources, while employing Maximal Marginal Relevance (MMR) to suppress redundancy and enhance evidence coverage [15].
Meanwhile, confidence calibration methods such as Temperature Scaling, Platt Scaling, and Isotonic Regression [16,17,18] have been applied to alleviate model confidence bias, forming the foundation for uncertainty-based fusion and scheduling. Beyond post hoc calibration, uncertainty-aware learning can incorporate uncertainty directly into training objectives or regularizers. For example, Incremona et al. [19] propose a differentiable uncertainty-aware mutual-information regularizer, whereas AMSRAG uses calibrated confidence as a lightweight, model-agnostic signal for routing and fusion without retraining the underlying LLM. Despite progress, these methods mainly adopt static weighting or single-source confidence correction and still lack a mechanism that dynamically integrates Query Complexity and global confidence. How to realize an integrated modeling framework of “Complexity Awareness–Confidence Calibration–Fusion Decision” remains an open research problem. This framework should enable the system to balance information efficiency and confidence fusion across different query types.
To address the above three issues, this paper proposes an Adaptive Multi-Source RAG Framework (AMSRAG) based on Query Complexity awareness and confidence fusion. This framework takes the joint “complexity–confidence” signal as the core scheduling variable, connecting retrieval triggering, path selection, and multi-source fusion into a unified and dynamically controllable process.
AMSRAG systematically integrates complexity modeling and confidence estimation into the RAG pipeline. This integration enables the model to balance efficiency and evidence coverage under different query conditions and offers a novel mechanism for improving the adaptability of RAG systems in heterogeneous query environments.

2. Methods

As shown in Figure 1, the overall architecture of the AMSRAG framework consists of four components: the Query Complexity Classifier (C), the Adaptive Router (R), the set of Multi-Source Retrievers (RS), and the Confidence-Aware Fusion Engine (CAF). The framework first uses C to output the query complexity category c and its calibrated confidence α , then R determines the appropriate retrieval path based on this information, selecting the retrievers to be activated in RS to obtain candidate evidence. Finally, CAF performs cross-source fusion and weighting of retrieval results, and the fused evidence set is passed to the generation model to produce the final answer. Here, a retrieval path denotes a routing option (Strategy A/B/C) that specifies the retrieval budget and fusion configuration, rather than a multi-hop evidence path.
The workflow replaces static strategies with query-driven dynamic scheduling: for low-complexity and high-confidence queries, it suppresses unnecessary retrieval calls; for low-confidence or high-complexity queries, it expands the activated retriever set according to the complexity and confidence signals.
Given a query q, the complexity classifier C outputs a pair c , α , where c denotes the predicted query complexity category and α represents the calibrated confidence. Guided by this joint signal, the retriever controller R dynamically activates a subset R S * R S to perform retrieval and construct the candidate evidence set. The CAF module then weights and constrains the diversity of cross-source results according to the complexity and confidence signals, producing the fused context D * . Finally, the large language model generates the final answer conditioned on the query and the fused evidence:
a = f L L M q , D *
D * = C A F R S * q | c , α
where c zero-hop , one-hop , multi-hop , α 0 , 1 , and R S * denote the dynamically activated subset of retrievers conditioned on the joint signal c , α .

2.1. Query Complexity Modeling and Confidence Estimation

This section formalizes the query complexity taxonomy (zero-hop, one-hop, and multi-hop) and introduces a ModernBERT-based classifier that predicts the complexity label and estimates the associated confidence score for downstream strategy selection and fusion.
Query complexity reflects the span of external evidence required to answer a question. It is divided into 3 categories: zero-hop, one-hop, and multi-hop. Zero-hop queries can be directly answered using the model’s internal knowledge; one-hop queries require a single evidence fragment; multi-hop queries involve cross-entity or cross-document reasoning that depends on multiple evidence sources. The definition of query complexity corresponds to different levels of evidence demand and lays the foundation for subsequent classification and strategy selection.
The proposed three-level taxonomy is grounded in the structural requirements of evidence retrieval and reasoning depth: zero-hop queries rely on the internal parametric knowledge of the LLM; one-hop queries require a single piece of external evidence; and multi-hop queries necessitate cross-document reasoning. The discretisation process provides a deterministic mapping from a query’s information demand to an optimised retrieval strategy. This ensures a principled balance between computational efficiency and context sufficiency.
To automatically determine the category of query complexity, a classification model based on ModernBERT is trained. ModernBERT is an improved version of the BERT architecture [20,21], which enhances both representational capacity and computational efficiency, particularly suitable for modeling queries with large semantic spans. Given an input query q, the model first obtains a sentence-level representation vector h C L S through the encoder and maps it through a linear classification layer to a probability distribution over the three complexity categories:
p c = s o f t max W h C L S + b c
c ^ = arg max c   p c
α = max c   p c
where p c denotes the predicted probability that q belongs to complexity category c; W and b are the parameters of the classification layer; c ^ is the predicted label corresponding to the category with the maximum probability; α is the probability of the corresponding category, which is used as the calibrated confidence after post-processing. During training, the classifier adopts Parameter-Efficient Fine-Tuning (PEFT), and in subsequent experiments, the classifier’s accuracy and confidence calibration results are reported.

2.2. Progressive Multi-Source Retrieval Strategy

In order to achieve a dynamic balance between answer quality and retrieval cost, a layered progressive multi-source retrieval scheduling mechanism is designed based on the classifier’s confidence output. The system is organised in such a way that three retrieval paths (Strategies A, B, and C) are defined with different retrieval scales and resource allocations. Strategy A is suitable for high-confidence scenarios (such as explicit zero-hop or one-hop queries), where the system employs only the optimal retriever. For zero-hop cases, the model can directly respond with internal knowledge to reduce computational overhead. Strategy B addresses medium-confidence scenarios where a single path may exhibit insufficient recall. The system therefore activates two complementary retrievers in parallel (e.g., dense retrieval and sparse keyword retrieval) to balance semantic coverage and precision, improving recall quality and robustness. Strategy C targets low-confidence or multi-hop queries, simultaneously invoking semantic, keyword, and structured graph retrieval. This multi-path redundancy enhances evidence coverage, providing robust support for complex reasoning.
These 3 strategies form a progressive transition from high-confidence streamlined retrieval to low-confidence multi-source coverage, enabling the system to adaptively schedule retrieval resources while maintaining answer quality.
To formalize the above strategies as an executable decision function, two confidence threshold parameters, θ h , θ l 0 , 1 are introduced, where θ l < θ h . Based on the interval of the classification confidence α , the query is mapped to the corresponding retrieval strategy:
S α , c = A , α θ h B , θ l α < θ h C , α < θ l
Among these, c denotes the complexity label used to guide the specific selection and configuration of retrievers within the same strategy level. By properly setting θ h and θ l , the higher threshold emphasizes precision, whereas the lower threshold ensures recall, enabling the system to balance retrieval coverage and accuracy. During implementation, thresholds are statistically determined based on the calibration set to optimize overall performance across most query scenarios.
To mitigate the impact of potential misclassifications, AMSRAG incorporates a confidence-aware buffer mechanism. The routing logic is described by the decision process in Equation (6), where the final selection is modulated by the calibrated confidence α rather than relying solely on the predicted label c. In scenarios where the classifier exhibits uncertainty, such as queries positioned at the boundary between one-hop and multi-hop levels, the system prioritizes a more comprehensive retrieval path. This design ensures that the framework remains robust to prediction noise, as path redundancy prevents information deficiency even in the presence of marginal classification errors.

2.3. Confidence-Aware RRF

Conventional RRF treats all retrieval sources equally, with a fixed smoothing constant k, and tends to favor documents ranked high across multiple retrievers. This approach fails to capture source heterogeneity and complexity characteristics, and it may reduce diversity among the fused results. The conventional RRF formula is expressed as:
R R F d = r R S 1 k + r a n k r d
where RS denotes the set of retrievers, r a n k r d is the rank position of document d in retriever r, and k is the smoothing constant.
To address the limitations of conventional RRF in modeling source differences and adaptivity, this paper introduces Confidence-Aware Reciprocal Rank Fusion (CA-RRF) by incorporating both query complexity and confidence signals into the fusion stage. The improved fusion form is defined as:
C A - R R F d = r R S w r c , α k r c + r a n k r d
where c represents the complexity category, and α is the calibrated confidence. The smoothing term k r c is adaptively set according to both the retrieval source scale and the query complexity: a smaller k r c in low-complexity scenarios emphasizes highly relevant results, while a larger k r c in high-complexity scenarios preserves more candidate documents. The weighting function w r c , α employs confidence-based monotonic interpolation to balance stability and dominance across different confidence intervals:
w r c , α = 1 ρ α 1 R S + ρ α β r c
ρ α = σ κ α α 0
Here, β r c denotes the prior weight of retriever r under complexity c, satisfying r R S β r c = 1 , which characterizes the source-importance distribution across different complexity scenarios. σ denotes the sigmoid function, and κ controls its transition steepness. α 0 is the neutral confidence threshold. κ and α 0 are treated as fixed design constants that determine the transition smoothness and neutral point in confidence-aware weighting; the corresponding values are reported in the experimental settings. κ and α 0 are fixed to stabilize the confidence-to-weight mapping and to reduce the risk of overfitting additional coupled hyperparameters given the limited calibration split. The mapping function ρ α 0 , 1 smoothly transforms the model-predicted confidence α into interpolation coefficients: when α is low, the fusion leans toward uniform weighting for stability; when α is high, prior weights are enhanced to highlight dominant retrieval sources.
To prevent the fusion results from being overly concentrated on a single source, MMR [15] is further introduced as a diversity constraint. When selecting the next document from the candidate set, the optimization objective is:
d = arg max d L   C A - R R F d λ max d L   S i m d , d
where L is the set of selected documents, S i m d , d represents document–document similarity, and λ 0 , 1 is the diversity control parameter balancing relevance and redundancy. In our implementation, λ is fixed to a standard default value, and the specific setting is reported in the experimental settings. This constraint suppresses highly similar results while preserving overall relevance, thereby enhancing the diversity of content sources in the fused results.
By jointly incorporating complexity information, confidence signals, and diversity control into the fusion stage, CA-RRF achieves integration of adaptive multi-source evidence without requiring additional supervision, effectively improving the relevance and robustness of the fused results.

3. Experiment

This section presents the experimental protocol and analyses used to evaluate AMSRAG under heterogeneous query conditions. We first introduce the data preparation and annotation procedure, then report the evaluation and calibration results of the query complexity classifier, and finally present end-to-end QA performance along with additional analyses, including ablation studies and case studies.

3.1. Data Preparation and Annotation

3.1.1. Datasets

For data preparation, to evaluate the applicability of the proposed framework, two open-domain question answering datasets, MS MARCO and HotpotQA [22,23], are selected. The former is based on real search logs, primarily featuring factual questions covering zero-hop and single-hop scenarios. The latter emphasizes multi-hop reasoning across paragraphs, requiring the integration of evidence from multiple segments. Together, they cover diverse information needs ranging from simple factual queries to complex reasoning problems.

3.1.2. Complexity Annotation

For data annotation, this paper employs the Large Language Model (GPT-4) to assist in labeling query complexity and performs manual verification to improve label reliability [24]. The GPT-4 model is first provided with clear definitions and examples of zero-hop, one-hop, and multi-hop queries. It then independently reasons over each query and assigns complexity ratings. To reduce randomness in model judgments, a self-consistency strategy is adopted: multiple reasoning outputs are generated for the same query and voted upon [25]. If the majority results agree, the label is accepted; if significant disagreement occurs, the query is marked as “to be reviewed” and subsequently checked by humans. This strategy reduces manual workload while ensuring annotation reliability.
GPT-4 functions as a pre-labeling aid within the fixed hop-based taxonomy of query complexity, categorised into zero-hop, one-hop, and multi-hop. In order to monitor the quality of the annotations, a lightweight auditing protocol is applied. This involves the random selection of 50 queries from every 1000 annotated queries for human verification by two to three reviewers. Discrepancies are resolved through majority adjudication. In the subset that was audited, approximately 8% of queries were the subject of disagreement between reviewers. Across a dataset comprising over 25,000 queries, the estimated human override rate of model-generated labels is approximately 1.0% to 1.5%, corresponding to approximately 10 to 15 incorrect labels per 1000 queries. The complexity classifier is trained on the human-audited labels defined by this taxonomy rather than on raw model outputs. This is intended to reduce potential bias introduced by LLM-assisted pre-labeling.

3.1.3. Data Splits and Statistics

The annotated queries for complexity classification are divided into three distinct splits: training, calibration, and test. These splits are utilised for specific purposes, namely the training of the complexity classifier, the calibration and tuning of confidence-related hyperparameters (including the selection of thresholds), and the reporting of classifier performance, respectively. Concurrently, an end-to-end QA evaluation set is constructed for the purpose of comparing AMSRAG with baselines and conducting ablation studies under the same evaluation protocol. The following section provides a synopsis of the dataset statistics and complexity-class distributions that have been utilised in the present study. Please refer to Table 1 for further information.

3.1.4. Hyperparameter Settings

All routing and fusion hyperparameters are determined on the calibration split and then frozen for all reported results. We select θ h and θ l once on the calibration split with θ h < θ l , while κ   α 0 and λ are fixed design defaults. We performed a lightweight grid search for the routing thresholds on the calibration split. Specifically, θ h { 0.70 , 0.75 , 0.80 , 0.85 , 0.90 } and θ l { 0.50 , 0.55 , 0.60 , 0.65 , 0.70 } with the constraint θ l < θ h , yielding 15 feasible pairs, and selected ( θ h , θ l ) = ( 0.90 , 0.60 ) . Table 2 reports the final settings.

3.2. Evaluation of Query Complexity Classifier

To evaluate the discriminative ability and confidence reliability of the proposed ModernBERT-based query complexity classifier on zero-hop, one-hop, and multi-hop queries, two types of baselines are introduced: random and heuristic rule-based classifiers as lower-bound references, and BERT and RoBERTa variants as model-based references [20,26]. To ensure fair comparisons, all methods use consistent data splits and evaluation procedures. All experiments are conducted on an Ubuntu 22.04 system using Python 3.12 and PyTorch 2.6.0, with CUDA 12.4, running on a single NVIDIA RTX 4090 GPU with 24 GB memory.

3.2.1. Evaluation Metrics and Composite Measure

Accuracy and Macro-F1 are used to assess overall correctness and class balance. The Expected Calibration Error (ECE) quantifies the reliability of predicted probabilities. Additionally, a Reliability-Adjusted Accuracy (RAA) metric is defined to jointly consider accuracy and calibration:
R A A = A c c u r a c y λ   E C E
where Accuracy denotes overall classification accuracy, ECE represents the expected calibration error, and λ is the penalty coefficient. In this experiment, λ = 1 , balancing the contributions of Accuracy and ECE. A higher RAA indicates better overall performance in both accuracy and confidence reliability.
As shown in Table 3, the ModernBERT classifier achieves the best performance in Accuracy, Macro-F1, and ECE, with RoBERTa following closely. Overall, pretrained fine-tuned models significantly outperform heuristic and random baselines, indicating that simple rules or random partitioning fail to capture complexity-level differences effectively.
As demonstrated in Figure 2, the confusion matrix provides a more detailed insight into the classifier’s performance across categories. The multi-hop class demonstrated the highest recognition accuracy of 94.4%, followed by the one-hop class with 83.8%. In contrast, the zero-hop queries exhibited relatively lower distinguishability, with an accuracy of 77.2%. This finding suggests that the model can reliably utilise semantic span and structural cues in multi-hop reasoning yet encounters difficulty differentiating between zero-hop and one-hop queries due to their comparable surface expressions.
Analysis of the confusion matrix in Figure 2 reveals that the system is primarily characterized by ‘upward’ misclassifications, such as the categorization of zero-hop queries as one-hop. While such errors marginally increase latency due to redundant retrieval, they do not compromise the final answer quality. Conversely, ‘downward’ errors that could potentially lead to information loss are significantly less frequent. This asymmetric error profile, combined with the low Expected Calibration Error (ECE) of 1.9% reported in Section 3.2.3, demonstrates that the downstream routing and fusion processes remain stable and effective despite minor classification fluctuations.
From an efficiency perspective, such confusion may route a subset of true zero-hop queries to the one-hop branch, thereby triggering unnecessary retrieval. However, compared with fixed pipelines, correctly identified zero-hop queries still skip retrieval entirely. This helps preserve the overall efficiency gains.

3.2.2. Results and Discussion

By observing misclassifications, it was found that multi-hop questions are mainly confused with one-hop ones (5.6%), reflecting the continuity of information demand between complex reasoning and single-evidence queries. Zero-hop questions are more often misclassified as one-hop (22.5%), showing that the boundary between them is inherently fuzzy and represents the most difficult region for classification.

3.2.3. Calibration Effect

To ensure that the classifier’s output confidence can serve as a reliable decision basis for downstream routing and fusion, a temperature-based probability calibration is applied. The temperature parameter is fitted on the calibration split by minimizing the negative log-likelihood with respect to the human-audited labels. Expected Calibration Error is computed using fifteen fixed-width confidence bins over the interval from 0 to 1. Figure 3 illustrates the reliability curves before and after calibration.
Before calibration, the Expected Calibration Error (ECE) is approximately 7.7%, indicating an overconfidence issue. After applying Temperature Scaling, ECE decreases significantly to about 1.9%, while the classification accuracy and Macro-F1 remain largely unchanged. After calibration, the predicted confidence aligns more closely with the empirical accuracy, confirming the reliability of the confidence signal. Because calibration is applied to the classifier probabilities, it is decoupled from the downstream retriever pool and generator choice. The temperature can be re-estimated on a held-out calibration split when the deployment setting changes.

3.3. End-to-End Experiments

After evaluating and calibrating the upstream classifier, the proposed “Complexity-Aware–Progressive Retrieval–Confidence-Aware Fusion” framework is applied to open-domain QA tasks for end-to-end evaluation. For answer generation, we adopt Qwen-Turbo as the large language model, selected to balance answer quality and computational cost across all end-to-end experiments. The fixed-pipeline RAG employs static retrieval and fusion (global top-k and fixed RRF weights), while AMSRAG conducts adaptive retrieval and dynamic fusion parameter adjustment via CA-RRF based on the combined complexity–confidence signals. The complete process forms a closed loop of complexity prediction, progressive retrieval, confidence-aware fusion, and answer generation.
Considering both output quality and system efficiency, 4 indicators are adopted: Exact Match (EM) and token-level F1 for answer accuracy and consistency, nDCG@5 for retrieval relevance ranking, and retrieval latency (ms) measured as the average time from query trigger to fused retrieval result [27,28].
As demonstrated in Table 4, the adaptive frameworks typically enhance EM, F1, and nDCG@5 in comparison to the fixed-pipeline baseline, accompanied by a modest augmentation in retrieval latency that remains within a feasible range for open-domain QA. Across the evaluated settings, AMSRAG demonstrates competitive performance relative to the other adaptive baselines (EM 50.9, F1 63.5, nDCG@5 0.846), with a moderate latency increase relative to the fixed pipeline (520 ms vs. 460 ms). The findings in EM and F1 indicate that more precise responses are obtained on average. Concurrently, the elevated nDCG@5 is indicative of the intended consequence of confidence-aware fusion, namely the enhancement of the quality of top-ranked evidence across sources. The observed latency overhead can be attributed to adaptive scheduling, which activates additional retrieval for lower-confidence or higher-complexity queries. This is in addition to the extra computation introduced by multi-source fusion (CA-RRF) and diversity-aware reranking (MMR). In order to assess the statistical reliability of the data, AMSRAG improves EM over the fixed-pipeline baseline by +3.8%, with a 95% confidence interval of [1.2%, 6.4%] and p < 0.01 under a paired bootstrap test on per-query EM differences.
Using the same measurement protocol as Table 4 (from query trigger to the fused retrieval result), profiling shows that AMSRAG spends 25 ms on complexity classification (ModernBERT + calibration), 10 ms on CA-RRF, and 15 ms on MMR reranking per query on average. The remaining time is dominated by retrieval execution (including any associated I/O) under the selected strategy, which also accounts for the small residual difference in end-to-end latency relative to the fixed pipeline.
We vary the routing thresholds ( θ h , θ l ) around the calibrated setting (0.90, 0.60) while keeping all other components fixed. As shown in Table 5, the observed differences in EM/F1 across the tested threshold pairs are small and the 95% confidence intervals overlap substantially, while retrieval latency increases with stricter thresholds.

3.4. Ablation Study

The present section is concerned with the quantification of the contributions of the principal components in AMSRAG, via a controlled ablation study. It is evident that the predicted complexity and calibrated confidence jointly control both the process of routing and the process of fusion. In order to address this, the present study employs signal-level ablations that disable or fix how the decision signal is applied. This is achieved while ensuring that the remainder of the pipeline remains unaltered.
All variants are evaluated in accordance with the same protocol as outlined in Table 4. They share the same retriever pool, index/corpus, prompt template, decoding configuration, and answer generator. The measurement of retrieval latency is consistently defined in Table 4. Fixed-routing variants employ the non-adaptive policy of the fixed pipeline, whereas adaptive-routing variants utilise the same progressive retrieval thresholds as in the primary experiments.
The following five variants were evaluated: In the context of vanilla RRF, A0 denotes the fixed baseline. In the context of fixed retrieval, A1 substitutes RRF for CA-RRF. A2 facilitates adaptive progressive retrieval with vanilla RRF. A3 facilitates adaptive retrieval with CA-RRF whilst simultaneously disabling MMR. A4 is the full AMSRAG system with progressive retrieval, CA-RRF, and MMR.
The component-wise effects are obtained through the implementation of paired comparisons. The process of routing is measured by the comparison of A2 with A0, fusion by the comparison of A1 with A0 and A3 with A2, and diversification by the comparison of A4 with A3. The results of the ablation process are presented in Table 6.

3.5. Case Study

In order to provide further elucidation regarding the adaptive scheduling and fusion mechanisms of the AMSRAG framework when faced with different query types, this section will present three test cases that are representative of the framework’s functionality. The first of these is a high-confidence zero-hop query, the second is a low-confidence multi-hop query, and the third is a mis-classified-induced failure scenario, as illustrated in Figure 4.
In situations where confidence is high and the direct path is known (i.e., zero-hop cases), the system has been shown to accurately identify low complexity and respond directly using internal knowledge without the need for external retrieval. This suggests an enhancement in efficiency and precision. The process of avoiding redundant retrieval is achieved through the utilisation of complexity awareness and confidence estimation, thereby ensuring the maintenance of correctness.
In instances of low confidence pertaining to multi-hop cases, the system is able to detect multi-entity reasoning requirements and automatically trigger multi-source parallel retrieval. Various retrievers (sparse, dense, and graph-based) collectively contribute to evidence aggregation, thereby producing more complete and coherent answers. This finding suggests that the framework is effective in leveraging confidence-driven multi-source fusion for complex reasoning tasks.
Conversely, in instances of failure attributable to complexity misclassification, the system erroneously identifies a multi-hop question as one-hop, resulting in the activation of inadequate retrieval paths and the generation of incomplete answers. This observation indicates that classification accuracy and confidence thresholds have a significant impact on overall performance, as errors at the front end can propagate and amplify downstream.
Beyond misclassification failures, AMSRAG may also fail in two cases: high-confidence but wrong routing under distribution shift, which can reduce evidence coverage; and fusion imbalance when one retriever dominates, suppressing complementary sources. Near-duplicate passages can further worsen this via reranking. Simple safeguards such as confidence-aware fallback or cross-source coverage constraints may improve robustness.
The framework demonstrates the capacity to balance retrieval efficiency and answer quality; however, further optimisation of complexity boundary recognition and dynamic threshold adjustment is required to enhance stability and generalisation in real-world scenarios.

4. Conclusions and Future Work

This paper proposed AMSRAG, an Adaptive Multi-Source Retrieval-Augmented Generation framework designed to improve adaptability under heterogeneous query conditions in retrieval-augmented generation. The framework can adaptively select the appropriate retrieval path according to the query’s complexity and confidence, improving both retrieval efficiency and answer quality.
Specifically, AMSRAG establishes a unified scheduling mechanism through complexity classification and confidence calibration, enabling dynamic selection of retrieval paths and fusion strategies. This design overcomes the rigidity of fixed “retrieval-generation” pipelines.
Moreover, to balance retrieval efficiency and evidence coverage across different complexity levels, a progressive multi-source retrieval strategy is proposed. The framework suppresses redundant retrieval in high-confidence scenarios to enhance efficiency, while expanding recall under low-confidence conditions to ensure evidence completeness.
In addition, a CA-RRF method is introduced to fully exploit complexity and confidence signals during fusion. By leveraging complexity and confidence signals with MMR-based diversity control, the fusion results achieve improved relevance and robustness.
The experimental results demonstrate that AMSRAG exhibits consistent superiority over fixed-pipeline RAG systems in open-domain question-answering tasks, enhancing both the quality of the answers provided and the relevance of the retrieved information. In scenarios where confidence is high, the retrieval process is rendered redundant, thereby leading to an optimised trade-off between the quality of the response and its efficiency.
Despite these promising results, several aspects still warrant further exploration. The identification of complexity-boundary cases and the flexibility of threshold strategies require refinement. Additionally, constrained by the types of retrievers and dataset scales employed, the generalization ability of AMSRAG in cross-domain and multimodal scenarios remains to be validated, including the stability of calibration and routing signals under distribution shifts and component changes. Future research may explore dynamic threshold optimization and framework extension to enhance overall robustness and universality.
Although AMSRAG is validated on open-domain QA benchmarks (MS MARCO and HotpotQA), deployment in specialized domains such as medical, legal, or technical QA may require adaptation. The indexed corpus and retriever pool should be replaced with in-domain resources, and calibration parameters and routing thresholds should be re-tuned under distribution shift. In high-stakes settings, stricter grounding and evidence validation may be needed to reduce harmful hallucinations.

Author Contributions

Conceptualization, W.D.; methodology, W.D.; investigation, W.D.; project administration, W.D.; writing—original draft preparation, W.D. and M.D.; data curation, M.D.; software, M.D.; formal analysis, M.D.; funding acquisition, M.D.; writing—review and editing, M.Y.; supervision, M.Y. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported by the National College Students Innovation and Entrepreneurship Training Program of China (Grant No. 2026A279); the Beijing Higher Education Society Approved Research Projects (2024) (Grant No. MS2024149); and the Undergraduate Education Quality Improvement Plan Construction Project of China University of Geosciences (Beijing) (2023) (Grant No. AIKC202302).

Data Availability Statement

The original datasets used in this study, MS MARCO and HotpotQA, are publicly available through their official websites. The processed and adjusted data generated during this study are not publicly available due to project-specific data processing and annotation procedures.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Lewis, P.; Perez, E.; Piktus, A.; Petroni, F.; Karpukhin, V.; Goyal, N.; Küttler, H.; Lewis, M.; Yih, W.T.; Rocktäschel, T.; et al. Retrieval-augmented generation for knowledge-intensive NLP tasks. Adv. Neural Inf. Process. Syst. 2020, 33, 9459–9474. [Google Scholar]
  2. Guu, K.; Lee, K.; Tung, Z.; Pasupat, P.; Chang, M.W. REALM: Retrieval-augmented language model pre-training. In Proceedings of the 37th International Conference on Machine Learning, Vienna, Austria, 13–18 July 2020; pp. 3929–3938. [Google Scholar]
  3. Izacard, G.; Lewis, P.; Lomeli, M.; Hosseini, L.; Petroni, F.; Schick, T.; Dwivedi-Yu, J.; Joulin, A.; Riedel, S.; Grave, E. Atlas: Few-shot learning with retrieval-augmented language models. J. Mach. Learn. Res. 2023, 24, 1–43. [Google Scholar]
  4. Izacard, G.; Grave, E. Leveraging passage retrieval with generative models for open-domain question answering. In Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics, Online, 19–23 April 2021; pp. 874–880. [Google Scholar] [CrossRef]
  5. Borgeaud, S.; Mensch, A.; Hoffmann, J.; Cai, T.; Rutherford, E.; Millican, K.; Van Den Driessche, G.B.; Lespiau, J.B.; Damoc, B.; Clark, A.; et al. Improving language models by retrieving from trillions of tokens. In Proceedings of the 39th International Conference on Machine Learning, Baltimore, MD, USA, 17–23 July 2022; pp. 2206–2240. [Google Scholar]
  6. Edge, D.; Trinh, H.; Newman Cheng, J.B.; Chao, A.; Mody, A.; Truitt, S.; Metropolitansky, D.; Ness, R.O.; Larson, J. From local to global: A graph RAG approach to query-focused summarization. arXiv 2024, arXiv:2404.16130. [Google Scholar] [CrossRef]
  7. Karpukhin, V.; Oguz, B.; Min, S.; Lewis, P.; Wu, L.; Edunov, S.; Chen, D.; Yih, W.T. Dense passage retrieval for open-domain question answering. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing, Online, 16–20 November 2020; pp. 6769–6781. [Google Scholar] [CrossRef]
  8. Asai, A.; Wu, Z.; Wang, Y.; Sil, A.; Hajishirzi, H. Self-RAG: Learning to retrieve, generate, and critique through self-reflection. In Proceedings of the 12th International Conference on Learning Representations, Vienna, Austria, 7–11 May 2024. [Google Scholar]
  9. Jeong, S.; Baek, J.; Cho, S.; Hwang, S.J.; Park, J.C. Adaptive-RAG: Learning to adapt retrieval-augmented large language models through question complexity. In Proceedings of the 2024 Conference of the North American Chapter of the Association for Computational Linguistics, Mexico City, Mexico, 16–21 June 2024; pp. 7036–7050. [Google Scholar] [CrossRef]
  10. Fox, E.A.; Shaw, J.A. Combination of multiple searches. In Proceedings of the Second Text REtrieval Conference (TREC-2), Gaithersburg, MD, USA, 31 August–2 September 1993; pp. 243–252. [Google Scholar]
  11. Cormack, G.V.; Clarke, C.L.A.; Buettcher, S. Reciprocal rank fusion outperforms Condorcet and individual rank learning methods. In Proceedings of the 32nd International ACM SIGIR Conference on Research and Development in Information Retrieval, Boston, MA, USA, 19–23 July 2009; pp. 758–759. [Google Scholar] [CrossRef]
  12. Wu, Q.; Burges, C.J.C.; Svore, K.M.; Gao, J. Adapting boosting for information retrieval measures. Inf. Retr. 2010, 13, 254–270. [Google Scholar] [CrossRef]
  13. Cao, Y.; Xu, J.; Liu, T.Y.; Li, H.; Huang, Y.; Hon, H.W. Adapting ranking SVM to document retrieval. In Proceedings of the 29th International ACM SIGIR Conference on Research and Development in Information Retrieval, Seattle, WA, USA, 6–11 August 2006; pp. 186–193. [Google Scholar] [CrossRef]
  14. Wang, X.; Macdonald, C.; Tonellotto, N.; Ounis, I. Pseudo-relevance feedback for multiple representation dense retrieval. In Proceedings of the 2021 ACM SIGIR International Conference on the Theory of Information Retrieval, Virtual Event, 11–15 July 2021; pp. 297–306. [Google Scholar] [CrossRef]
  15. Carbonell, J.; Goldstein, J. The use of MMR, diversity-based reranking for reordering documents and producing summaries. In Proceedings of the 21st International ACM SIGIR Conference on Research and Development in Information Retrieval, Melbourne, Australia, 24–28 August 1998; pp. 335–336. [Google Scholar] [CrossRef]
  16. Guo, C.; Pleiss, G.; Sun, Y.; Weinberger, K.Q. On calibration of modern neural networks. In Proceedings of the 34th International Conference on Machine Learning, Sydney, Australia, 6–11 August 2017; pp. 1321–1330. [Google Scholar]
  17. Silva Filho, T.M.; Song, H.; Perello-Nieto, M.; Santos-Rodriguez, R.; Kull, M.; Flach, P. Classifier calibration: A survey on how to assess and improve predicted class probabilities. Mach. Learn. 2023, 112, 3211–3260. [Google Scholar] [CrossRef]
  18. Rajaraman, S.; Ganesan, P.; Antani, S. Deep learning model calibration for improving performance in class-imbalanced medical image classification tasks. PLoS ONE 2022, 17, e0262838. [Google Scholar] [CrossRef] [PubMed]
  19. Incremona, A.; Pozzi, A.; Guiscardi, A.; Tessera, D. A differentiable and uncertainty-aware mutual information regularizer for bias mitigation. Neurocomputing 2026, 669, 132498. [Google Scholar] [CrossRef]
  20. Devlin, J.; Chang, M.W.; Lee, K.; Toutanova, K. BERT: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics, Minneapolis, MN, USA, 2–7 June 2019; pp. 4171–4186. [Google Scholar] [CrossRef]
  21. Warner, B.; Chaffin, A.; Clavié, B.; Weller, O.; Hallström, O.; Taghadouini, S.; Gallagher, A.; Biswas, R.; Ladhak, F.; Aarsen, T.; et al. Smarter, better, faster, longer: A modern bidirectional encoder for fast, memory-efficient, and long-context finetuning and inference. In Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (ACL 2025), Vienna, Austria, 27 July–1 August 2025; pp. 2526–2547. [Google Scholar] [CrossRef]
  22. Bajaj, P.; Campos, D.; Craswell, N.; Deng, L.; Gao, J.; Liu, X.; Majumder, R.; McNamara, A.; Mitra, B.; Nguyen, T.; et al. MS MARCO: A human generated machine reading comprehension dataset. In Proceedings of the Neural Information Processing Systems Workshop, Barcelona, Spain, 5–10 December 2016. [Google Scholar]
  23. Yang, Z.; Qi, P.; Zhang, S.; Cohen, W.W.; Salakhutdinov, R.; Manning, C.D. HotpotQA: A dataset for diverse, explainable multi-hop question answering. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, Brussels, Belgium, 31 October–4 November 2018; pp. 2369–2380. [Google Scholar] [CrossRef]
  24. OpenAI; Achiam, J.; Adler, S.; Agarwal, S.; Ahmad, L.; Akkaya, I.; Aleman, F.L.; Almeida, D.; Altenschmidt, J.; Altman, S.; et al. GPT-4 technical report. arXiv 2023, arXiv:2303.08774. [Google Scholar] [CrossRef]
  25. Wang, X.; Wei, J.; Schuurmans, D.; Le, Q.; Chi, E.; Narang, S.; Chowdhery, A.; Zhou, D. Self-consistency improves chain-of-thought reasoning in language models. In Proceedings of the 11th International Conference on Learning Representations, Kigali, Rwanda, 1–5 May 2023. [Google Scholar] [CrossRef]
  26. Liu, Y.; Ott, M.; Goyal, N.; Du, J.; Joshi, M.; Chen, D.; Levy, O.; Lewis, M.; Zettlemoyer, L.; Stoyanov, V. RoBERTa: A robustly optimized BERT pretraining approach. arXiv 2019, arXiv:1907.11692. [Google Scholar] [CrossRef]
  27. Rajpurkar, P.; Zhang, J.; Lopyrev, K.; Liang, P. SQuAD: 100,000+ questions for machine comprehension of text. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, Austin, TX, USA, 1–5 November 2016; pp. 2383–2392. [Google Scholar] [CrossRef]
  28. Karmaker, S.K.; Sondhi, P.; Zhai, C. Empirical analysis of impact of query-specific customization of nDCG: A case-study with learning-to-rank methods. In Proceedings of the 29th ACM International Conference on Information and Knowledge Management, Galway, Ireland, 19–23 October 2020; pp. 3281–3284. [Google Scholar] [CrossRef]
Figure 1. Overall architecture of the AMSRAG framework.
Figure 1. Overall architecture of the AMSRAG framework.
Applsci 16 02495 g001
Figure 2. Confusion matrix of the query complexity classifier.
Figure 2. Confusion matrix of the query complexity classifier.
Applsci 16 02495 g002
Figure 3. Reliability curves of the query complexity classifier before and after calibration. (a) Before calibration (ECE = 0.077). (b) After calibration (ECE = 0.019).
Figure 3. Reliability curves of the query complexity classifier before and after calibration. (a) Before calibration (ECE = 0.077). (b) After calibration (ECE = 0.019).
Applsci 16 02495 g003
Figure 4. Case studies of AMSRAG under different query types.
Figure 4. Case studies of AMSRAG under different query types.
Applsci 16 02495 g004
Table 1. Dataset statistics and complexity-class distributions used in this study.
Table 1. Dataset statistics and complexity-class distributions used in this study.
UsageSplit/SetQueriesZero-Hop (25%)One-Hop (40%)Multi-Hop (35%)
Complexity classifierTrain (80%)18,9914748 75966647
Calibration (10%)2374594950830
Test (10%)2374594950830
AMSRAGEvaluation30075120105
Note: The calibration split is used for confidence calibration and threshold search ( θ h , θ l ). The end-to-end QA evaluation set is separate from the classifier splits and is used for baseline comparison and ablation experiments unless otherwise stated. The end-to-end corpus contains 1892 documents, and the 300 queries are drawn from MS MARCO (162) and HotpotQA (138).
Table 2. Hyperparameter settings for routing and fusion.
Table 2. Hyperparameter settings for routing and fusion.
HyperparameterValueSelection Protocol
θ h 0.90selected once on the calibration split
θ l 0.60selected once on the calibration split
κ 2.0fixed design constant
α 0 0.5fixed design constant
λ 0.5fixed default (MMR)
Table 3. Performance comparison of query complexity classification models.
Table 3. Performance comparison of query complexity classification models.
ModelAccuracy (%) ↑Macro-F1 (%) ↑ECE (%) ↓RAA (%) ↑
Random32.432.219.812.6
Rule-based46.647.227.219.3
BERT84.784.27.477.2
RoBERTa84.784.64.180.5
ModernBERT (Ours)85.985.41.984.0
Table 4. End-to-end results on open-domain QA (95% bootstrap CIs in brackets).
Table 4. End-to-end results on open-domain QA (95% bootstrap CIs in brackets).
FrameworkEM (%)F1 (%)nDCG@5Retrieval Latency (ms)
Fixed-pipeline RAG47.1 [44.3, 49.9]60.3 [57.8, 62.8]0.802 [0.779, 0.825]460
Self-RAG49.6 [46.8, 52.4]62.4 [60.0, 64.8]0.835 [0.813, 0.857]540
Adaptive-RAG50.1 [47.3, 52.9]62.9 [60.5, 65.3]0.838 [0.816, 0.860]505
AMSRAG (Ours)50.9 [48.1, 53.7]63.5 [61.2, 65.8]0.846 [0.825, 0.867]520
Note: Confidence intervals are estimated via non-parametric bootstrap over evaluation queries (B = 1000; percentile method).
Table 5. Sensitivity to routing thresholds.
Table 5. Sensitivity to routing thresholds.
θ h / θ l EM (%)F1 (%)Latency (ms)
0.85/0.5550.3 [47.5, 53.1]62.8 [60.5, 65.1]492
0.90/0.6050.9 [48.1, 53.7]63.5 [61.2, 65.8]520
0.92/0.6250.7 [47.9, 53.5]63.2 [60.9, 65.5]538
0.95/0.6549.9 [47.1, 52.7]62.3 [60.0, 64.6]565
Table 6. Ablation results of AMSRAG components.
Table 6. Ablation results of AMSRAG components.
VariantRoutingFusionMMREMF1nDCG@5Retrieval Latency (ms)
A0FixedRRFOff47.160.30.802460
A1FixedCA-RRFOff48.261.10.824466
A2AdaptiveRRFOff49.662.30.816505
A3AdaptiveCA-RRFOff50.563.10.842512
A4AdaptiveCA-RRFOn50.963.50.846520
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Dong, W.; Diao, M.; Yang, M. An Adaptive Multi-Source Retrieval-Augmented Generation Framework Integrating Query Complexity Awareness and Confidence-Aware Fusion. Appl. Sci. 2026, 16, 2495. https://doi.org/10.3390/app16052495

AMA Style

Dong W, Diao M, Yang M. An Adaptive Multi-Source Retrieval-Augmented Generation Framework Integrating Query Complexity Awareness and Confidence-Aware Fusion. Applied Sciences. 2026; 16(5):2495. https://doi.org/10.3390/app16052495

Chicago/Turabian Style

Dong, Wenxuan, Mingguang Diao, and Meiqi Yang. 2026. "An Adaptive Multi-Source Retrieval-Augmented Generation Framework Integrating Query Complexity Awareness and Confidence-Aware Fusion" Applied Sciences 16, no. 5: 2495. https://doi.org/10.3390/app16052495

APA Style

Dong, W., Diao, M., & Yang, M. (2026). An Adaptive Multi-Source Retrieval-Augmented Generation Framework Integrating Query Complexity Awareness and Confidence-Aware Fusion. Applied Sciences, 16(5), 2495. https://doi.org/10.3390/app16052495

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop