Knowing Before Answering: Decoding Language Models for Reliable RAG
Organizations: City St George’s, University of London · The Alan Turing Institute
Abstract
In Retrieval-Augmented Generation (RAG), retrieval may provide insufficient or conflicting information needed to answer a question. The system should not only know when to answer but also be able to identify cases in which the documents provided in RAG are insufficient or contain conflicting information. This can be framed as a three-way classification problem, where we use the model's internal signals to determine whether the provided information in the input can be classified as sufficient, insufficient, or conflicting. We create a controlled benchmark dataset that replicates a RAG setup with fictitious information and labels each instance as answerable, insufficient, or conflicting. We use hidden activations and attention-derived features as inputs to train a lightweight linear model to distinguish among the three classes. Across 16 language models spanning different architectures and a range of model sizes, our feature-based router consistently outperforms prompting-based baselines and the performance of specialised RAG-models. We further conduct analyses into the information dynamics of the models. We show that the most informative signals for the classification are available in the middle layers, with hidden activation states being more effective than attention values or the MLP-feature outputs in most of the tested models. Overall, our results suggest that language models internally encode whether retrieved evidence is sufficient to support answering, and that this signal can be decoded reliably for RAG triage.
Figures & tables
| Prompt-based Techniques | Ours | ||||||||
| Model | ATTR [ Zhou et al., 2023 ] | KRE [ Ying et al., 2024 ] | FaithRAG [ Zhang et al., 2025b ] | OPIN_INSTR [ Zhou et al., 2023 ] | Vanilla | NO_CTX | Acc. | Macro-F1 | FAR |
| Falcon-H1-Tiny-90M | 0.34 | 0.34 | 0.35 | 0.34 | 0.33 | 0.33 | 0.69 | 0.68 | 0.13 |
| Falcon3-7B-1.58bit | 0.35 | 0.35 | 0.31 | 0.33 | 0.22 | 0.32 | 0.76 | 0.73 | 0.12 |
| OLMo-2-1B | 0.31 | 0.36 | 0.33 | 0.33 | 0.29 | 0.33 | 0.75 | 0.73 | 0.14 |
| OLMo-2-1B-SFT | 0.35 | 0.32 | 0.31 | 0.35 | 0.27 | 0.32 | 0.77 | 0.76 | 0.11 |
| OLMo-2-1B-DPO | 0.35 | 0.32 | 0.31 | 0.35 | 0.27 | 0.32 | 0.77 | 0.76 | 0.11 |
| Model | Overall | Answer | Refuse | Conflict | ||||||||
| Acc. | Macro-F1 | FAR | ||||||||||
| Base | RA | Base | RA | Base | RA | Base | RA | Base | RA | Base | RA | |
| gpt-oss-20b | 0.73 | 0.82 | 0.75 | 0.81 | 0.19 | 0.07 | 0.66 | 0.69 | 0.94 | 0.93 | 0.58 | 0.84 |
| Qwen3-4B-Instruct | 0.70 | 0.88 | 0.70 | 0.88 | 0.28 | 0.08 | 0.73 | 0.85 | 0.66 | 0.87 | 0.76 | 0.94 |
| Olmo-3.1-32B-Instruct | 0.61 | 0.90 | 0.70 | 0.90 | 0.19 | 0.06 | 0.41 | 0.86 | 0.97 | 0.93 | 0.44 | 0.90 |
Appendix figures & tables13 assets
Supplementary material from the paper’s appendix.
Appendix
| Setting | Granite-3.1-8B-Instruct | OLMo-2-1B | Qwen3-4B-Instruct |
| Previous Val Acc (baseline) | 0.90 | 0.73 | 0.91 |
| Layer aggregation | |||
| Top3-H | 0.91 | 0.80 | 0.89 |
| Top3-M | 0.90 | 0.81 | 0.91 |
| All-H | 0.90 | 0.78 | 0.91 |
| All-M | 0.90 | 0.80 | 0.90 |
| Model Family | Variant | Parameters | Type | Architecture |
| Falcon | Falcon-H1-Tiny-90M | 90M | Instruct | Hybrid |
| OLMo | OLMo-2-1B | 1B | Base | Dense |
| OLMo | OLMo-2-1B-SFT | 1B | SFT | Dense |
| OLMo | OLMo-2-1B-DPO | 1B | DPO | Dense |
| OLMo | OLMo-2-1B-Instruct | 1B | Instruct | Dense |
| Qwen | Qwen3.5-2B | 2B | Base | Dense |
| Model | Accuracy | Macro-F1 |
| Falcon3-7B-1.58bit | 0.91 | 0.63 |
| Granite-3.1-8B-Instruct | 0.92 | 0.65 |
| Llama-3.2-3B | 0.84 | 0.65 |
| Qwen3-4B-Instruct | 0.91 | 0.63 |
| Model | Acc.@80% | FAR@80% | Acc.@50% | FAR@50% |
| Falcon-H1-Tiny-90M | 0.754 | 0.064 | 0.833 | 0.021 |
| Falcon3-7B-1.58bit | 0.819 | 0.080 | 0.901 | 0.032 |
| Llama-3.2-3B | 0.904 | 0.046 | 0.957 | 0.012 |
| Phi-mini-MoE-Instruct | 0.904 | 0.054 | 0.964 | 0.017 |
| OLMo-2-1B | 0.827 | 0.058 | 0.890 | 0.024 |
| OLMo-2-1B-SFT | 0.860 | 0.055 | 0.922 | 0.012 |
| Model | Setting | Feature | Acc. | Acc. | Acc. | Acc. | FAR | Conflict-F1 |
| Qwen3-4B-Instruct | matched- | Last token | 0.858 | 0.842 | 0.804 | 0.821 | 0.113 | 0.843 |
| Qwen3-4B-Instruct | matched- | Doc-end mean | 0.575 | 0.554 | 0.454 | 0.500 | 0.312 | 0.639 |
| Qwen3-4B-Instruct | matched- | Doc-token mean | 0.637 | 0.550 | 0.533 | 0.454 | 0.325 | 0.608 |
| Llama-3.2-3B | matched- | Last token | 0.838 | 0.825 | 0.746 | 0.717 | 0.169 | 0.724 |
| Llama-3.2-3B | matched- | Doc-end mean | 0.588 | 0.537 | 0.487 | 0.517 | 0.312 | 0.616 |
| Llama-3.2-3B | matched- | Doc-token mean | 0.613 | 0.537 | 0.487 | 0.450 | 0.350 | 0.646 |
| Model | Real-label Acc. | Random-label Acc. |
| Granite-3.1-8B-Instruct | 0.88 | |
| OLMo-3.1-32B-Instruct | 0.90 | |
| gpt-oss-20b | 0.82 | |
| Qwen3.5-27B | 0.91 | |
| Qwen3.5-2B | 0.85 | |
| Qwen3.5-9B | 0.91 |
| Three-Way | Binary | Three-Way | |||||
| Model | Acc. | Macro-F1 | FAR | Acc. | Macro-F1 | FAR | CONFLICT Acc. |
| Granite-3.1-8b-Ins | 0.879 | 0.870 | 0.072 | 0.877 | 0.863 | 0.099 | 0.900 |
| OLMo-32B | 0.904 | 0.904 | 0.062 | 0.900 | 0.887 | 0.072 | 0.919 |
| GPT-OSS | 0.823 | 0.814 | 0.075 | 0.874 | 0.859 | 0.097 | 0.915 |
| Qwen-27B | 0.912 | 0.902 | 0.080 | 0.896 | 0.884 | 0.091 | 0.919 |
| Qwen-2B | 0.846 | 0.803 | 0.083 | 0.833 | 0.813 | 0.125 | 0.852 |
RAG Robustness
Retrieval-augmented generation robustness studies how to keep systems reliable when retrieved evidence is noisy, misleading, incomplete, or malicious.
See all 128 papers