通过动态正交化抑制大模型幻觉,提升生成内容与上下文一致性。
Hallucinations as Orthogonal Noise: Inference-Time Manifold Alignment via Dynamic Contextual Orthogonalization

- 将幻觉视为残差流语义流形上的正交噪声,从几何角度建模问题。
- 在推理时对注意力输出进行动态正交分解,有效降低幻觉率。
- 不牺牲知识性任务表现,适合需高可信度的部署场景。
大型语言模型中的幻觉问题——即生成与上下文事实或逻辑约束不一致的内容——仍是可靠部署的主要挑战。本文基于线性表示假设,提出一个几何框架:幻觉表现为相对于残差流语义流形的正交噪声。我们假设注意力头本应传播与上下文子空间一致的信息,但部分头会引入正交于该子空间的成分,破坏潜在表示的一致性。基于此,我们提出动态上下文正交化(DCO),一种推理时干预方法。DCO利用输入残差流作为动态上下文锚点,对注意力头输出进行正交分解,并采用逐层Z-score抑制机制,依据统计分布选择性衰减异常的正交分量。在Llama-3-8B和70B上,针对XSum、NQ-Swap和IFEval等基准测试的结果表明,DCO在上下文忠实性方面优于现有最优干预方法。同时,其在TriviaQA和TruthfulQA等知识密集型任务中保持高性能,有效缓解了现有方法常见的幻觉抑制与参数知识保留之间的权衡。研究验证了幻觉的几何解释,并确立了DCO为一种计算高效的流形对齐方法。代码已开源。
原文摘要 · Abstract (English)
Hallucination in Large Language Models (LLMs), characterized by the generation of content inconsistent with contextual facts or logical constraints -- remains a persistent challenge for reliable deployment. In this work, we address this issue through a geometric framework rooted in the linear representation hypothesis. We propose that hallucinations manifest as orthogonal noise relative to the semantic manifold of the residual stream. Specifically, we hypothesize that while attention heads ideally propagate information congruent with the context subspace, hallucinations arise when specific heads introduce components orthogonal to this subspace, disrupting the coherence of the latent representation. Based on this formulation, we introduce Dynamic Contextual Orthogonalization (DCO), an inference-time intervention method. DCO utilizes the input residual stream as a dynamic context anchor to perform orthogonal decomposition on attention head outputs. To distinguish between context-aligned semantic updates and divergent noise, DCO employs a layer-wise Z-score suppression mechanism that selectively attenuates outlier orthogonal components based on statistical distributions. Evaluations on Llama-3-8B and 70B across benchmarks such as XSum, NQ-Swap, and IFEval demonstrate that DCO achieves superior contextual faithfulness compared to state-of-the-art intervention baselines. Furthermore, DCO maintains high performance on knowledge-intensive tasks like TriviaQA and TruthfulQA, effectively mitigating the trade-off between hallucination suppression and parametric knowledge retention often observed in existing methods. Our findings validate the geometric interpretation of hallucinations and establish DCO as a computationally efficient approach for enforcing manifold alignment.Our code is available at https://github.com/Harry-Miral/DCO
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。