倾听各层:通过层间分歧缓解幻觉
Listen to the Layers: Mitigating Hallucinations with Inter-Layer Disagreement
AI总结:
CoCoA通过监听模型内部层间分歧信号,有效缓解大语言模型的幻觉问题,提升推理时的事实准确性。
摘要:
预训练的大语言模型(LLMs)容易生成流畅但事实错误的文本,这种现象称为幻觉,影响了它们在下游任务中的可靠性和实用性。我们假设生成文本片段的事实性与其在模型内部各层中的表示稳定性相关。基于此,我们提出了CoCoA(困惑和一致性意识)解码器,这是一种新的、无需训练的解码算法,在推理过程中通过倾听中间层的信号来缓解幻觉。我们提出了两个指标来量化中间层的不稳定性,并利用这些指标对表现出高内部困惑的输出进行惩罚,从而引导模型朝着更一致和事实基础的输出发展。我们进一步提出了一个自信息门控变体CoCoA-SIG,它动态调节此惩罚以选择性地针对高惊喜、不稳定的生成。在多种任务上进行了广泛的实验,包括问答、总结、数学推理和代码生成,结果表明CoCoA在多个模型家族(如Llama-3、Qwen-2.5、Mistral)中显著提高了事实正确性。通过利用模型内在信号,CoCoA提供了一种有效且广泛适用的方法,在推理过程中增强LLMs的可信度,而无需任何模型再训练。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。