通过分析模型中间层不一致性,减少大模型幻觉生成。
Listen to the Layers: Mitigating Hallucinations with Inter-Layer Disagreement
- 利用中间层表示不稳定性识别潜在幻觉内容
- 在多个任务中显著提升事实正确率,如问答、代码生成等
- 无需训练,适配多种大模型,适合追求可靠输出的场景
预训练大语言模型容易生成流畅但事实错误的内容,即幻觉,影响其在下游任务中的可靠性。我们假设生成文本的事实性与其在模型内部各层间的表征不稳定性相关。基于此,提出 CoCoA(Confusion and Consistency Aware)解码器,一种无需训练的推理阶段算法,通过监听中间层信号来缓解幻觉。提出两种度量中间层不稳定性指标,并对高内部分歧输出施加惩罚,引导模型生成更内在一致且事实准确的结果。进一步提出自信息门控变体 CoCoA-SIG,动态调节惩罚力度,精准作用于高意外性、不稳定生成。在问答、摘要、数学推理和代码生成等多样化任务上实验表明,CoCoA 显著提升 Llama-3、Qwen-2.5、Mistral 等多类模型的事实正确性。通过利用模型内生信号,CoCoA 提供了一种高效、普适的推理阶段增强可信度方法,无需模型重训。
原文摘要 · Abstract (English)
Pretrained Large Language Models (LLMs) are prone to generating fluent yet factually incorrect text-a phenomenon known as hallucinations, undermining their reliability and utility in downstream tasks. We hypothesize that a generated text span's factuality is correlated with its representational instability across the model's internal layers. Based on this, we propose the CoCoA (Confusion and Consistency Aware) decoder, a novel, training-free decoding algorithm that mitigates hallucinations at inference time by listening to these signals in the middle layers. We propose two metrics to quantify this instability in the middle layers and use it to penalize outputs that exhibit high internal confusion, thereby steering the model towards more internally consistent and factually grounded outputs. We further propose a self-information gated variant, CoCoA-SIG, that dynamically modulates this penalty to selectively target high-surprise, unstable generations. Extensive experiments on diverse tasks, including question-answering, summarization, mathematical reasoning and code generation, demonstrate that CoCoA significantly improves factual correctness across multiple model families (e.g., Llama-3, Qwen-2.5, Mistral). By leveraging model-intrinsic signals, CoCoA offers an effective and broadly applicable method for enhancing the trustworthiness of LLMs at inference time, without requiring any model retraining.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。