arXiv:2608.27661cs.CLcs.AI2026-08中稿 · COLM

通过解码模型内部信号,判断RAG回答是否可靠

Knowing Before Answering: Decoding Language Models for Reliable RAG

论文配图:Knowing Before Answering: Decoding Language Models for Reliable RAG
图 1 · 摘自论文原文
  • 用隐藏激活和注意力特征训练轻量分类器,判断信息是否充分、不足或冲突
  • 在16个模型上表现优于提示法和专用RAG模型,中间层信号最有效
  • 适合需要提升RAG系统可靠性与鲁棒性的研究人员与工程师

在检索增强生成(RAG)中,检索结果可能不足以回答问题或存在矛盾。系统不仅应知道何时回答,还应识别文档信息是否充足或冲突。本文将此建模为三分类问题,利用模型内部信号判断输入信息是否可回答、不足或冲突。我们构建了一个可控基准数据集,模拟虚构信息场景,并标注为可回答、不足或冲突。采用隐藏激活和注意力衍生特征训练轻量线性分类器,在16种不同架构与规模的语言模型上,该方法均显著优于基于提示的基线及专用RAG模型。进一步分析表明,最具判别力的信号集中在中间层,隐藏状态比注意力值或MLP输出更有效。结果表明,语言模型内部隐含了检索证据是否足够的信号,且可被可靠解码用于RAG任务分诊。

原文摘要 · Abstract (English)

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.

RAG模型可信度语言模型

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。