跳转至

文章背景与核心概要

在检索增强生成(RAG)系统中,检索到的文档有时可能信息不足或包含互相矛盾的内容。传统系统往往难以区分这些场景,导致语言模型产生幻觉或给出错误答案。本文引入了一种新颖的框架,将RAG证据分类(triage)构建为一个三分类问题:判断检索到的信息是充分的(sufficient)不充分的(insufficient),还是冲突的(conflicting)

通过利用轻量级线性模型提取语言模型的内部信号(隐藏层激活值和注意力特征),作者证明了语言模型本质上已经编码了这些可靠性数据。在跨越不同架构和多种规模的16个模型上的实验表明,这种基于特征的路由方法 consistently 持续优于传统的提示词基线(prompting baselines)和专门的RAG模型。该研究为提高RAG系统的可靠性和减少大模型幻觉提供了新的技术路径。


Knowing Before Answering: Decoding Language Models for Reliable RAG

  • arXiv ID: arXiv:2608.27661 [cs.CL]
  • Published / Submitted: August 27, 2026
  • Conference: Accepted at the Third Conference on Language Modeling (COLM 2026)
  • Authors: Syed Mahbubul Huq, Christopher Child, Tillman Weyde, Pranava Madhyastha

在检索增强生成(Retrieval-Augmented Generation, RAG)系统中,检索到的文档有时可能信息不足或包含互相矛盾的内容。传统系统往往难以区分这些场景,从而促使语言模型产生幻觉或给出错误答案。

本文引入了一种新颖的框架,将RAG证据分类(triage)构建为一个三分类问题:确定检索到的信息是充分的(sufficient)不充分的(insufficient)还是冲突的(conflicting)。通过使用轻量级线性模型提取模型的内部信号(隐藏激活值和注意力特征),作者证明了语言模型本质上编码了这些可靠性数据。在跨越不同架构和一系列模型规模的16个不同模型中,这种基于特征的路由方法持续优于传统的提示词基线以及专门的RAG模型。


Executive Summary

在检索增强生成(RAG)系统中,检索可能会提供回答问题所需的不充分或冲突的信息。系统不仅应该知道何时回答,还应该能够识别RAG中提供的文档不足或包含冲突信息的情况。这可以被构建为一个三分类问题,我们利用模型的内部信号来确定输入中提供的信息可以被分类为充分、不充分还是冲突。

我们创建了一个受控的基准数据集,该数据集使用虚构信息复制了RAG设置,并将每个实例标记为可回答、不充分或冲突。我们使用隐藏激活值和注意力导出的特征作为输入,训练一个轻量级的线性模型来区分这三类。在跨越不同架构和一系列模型规模的16个语言模型中,我们的基于特征的路由器的性能一致地优于基于提示词的基线和专门RAG模型的性能。

我们进一步对模型的底层信息动态进行了分析。我们表明,分类最具信息量的信号存在于中间层,在大多数测试模型中,隐藏激活状态比注意力值或MLP特征输出更有效。总体而言,我们的结果表明,语言模型在内部编码了检索到的证据是否足以支持回答,并且可以可靠地解码该信号用于RAG分类。


Key Details & Metadata


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.