Resonant Context Anchoring: Decoupling Attention Routing and Signal Gain at Inference Time

📄 arXiv: 2606.01923v1 📥 PDF

作者: Mingkuan Zhao, Yide Gao, Wentao Hu, Suquan Chen, Tianchen Huang, Zhenhua An, Zetao Chang, Xiayu Sun, Yuheng Min

分类: cs.CL, cs.LG

发布日期: 2026-06-01


💡 一句话要点

提出共振上下文锚定(RCA),在推理时解耦注意力路由和信号增益,提升LLM的事实一致性。

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 大型语言模型 上下文学习 事实一致性 幻觉抑制 自注意力机制 推理优化 残差流 信号处理

📋 核心要点

  1. 大型语言模型常因“上下文忽视”产生幻觉,现有抑制神经元或对比解码的方法计算成本高或影响流畅性。
  2. RCA通过解耦自注意力模块中的路由逻辑和信息幅度,动态放大上下文token的value向量范数,提升信噪比。
  3. 实验表明,RCA在Llama-3系列模型上显著提升了上下文忠实度,有效抑制幻觉,且计算成本低。

📝 摘要(中文)

大型语言模型(LLMs)在面对与其内部参数记忆相冲突的输入证据时,经常表现出“上下文忽视”,导致持续的事实幻觉。现有的缓解策略主要依赖于抑制特定神经元激活或采用计算成本高昂的对比解码机制,这通常会导致困惑度增加或显著提高推理延迟。为了解决这些限制,我们提出了共振上下文锚定(RCA),这是一种基于残差流信号动力学的轻量级推理时干预方法。RCA旨在解决外部证据在通过深度网络传播过程中的信号衰减问题。其核心机制包括在自注意力模块中正交解耦路由逻辑和信息幅度。通过利用原始的pre-softmax注意力分数作为语义对齐的瞬时度量,我们通过非线性整流构建动态增益场,以选择性地放大与上下文token相对应的value向量的范数,而不改变注意力概率分布。这种机制有效地提高了残差流混合中输入证据的信噪比(SNR),从而在推理过程中将生成轨迹稳健地锚定到真实上下文中。在Llama-3模型系列上的大量实验表明,RCA显著提高了多个事实一致性和强知识冲突任务中的上下文忠实度,有效地抑制了参数幻觉。此外,结果证实,作为一个无需训练且计算量可忽略的即插即用模块,RCA在忠实度和流畅性方面实现了帕累托改进,同时保持了模型的一般语言理解能力。

🔬 方法详解

问题定义:大型语言模型在推理时,容易受到内部参数记忆的影响,忽略输入上下文中的信息,产生与上下文不一致的幻觉。现有的缓解方法,如抑制特定神经元或使用对比解码,要么计算量大,要么会影响模型的流畅性。

核心思路:RCA的核心思路是增强上下文中关键信息的信号强度,使其在模型的残差流中占据主导地位,从而引导生成过程。通过解耦注意力机制中的路由逻辑(注意力权重)和信息幅度(value向量),可以独立地调整上下文信息的强度,而不会影响模型的注意力分布。

技术框架:RCA主要在自注意力模块中进行操作。首先,利用pre-softmax的注意力分数作为语义对齐的度量。然后,基于这些分数构建一个动态增益场,通过非线性整流函数,选择性地放大与上下文token相关的value向量的范数。最后,将调整后的value向量用于后续的计算。

关键创新:RCA的关键创新在于解耦了注意力机制中的路由逻辑和信息幅度。传统的注意力机制将两者耦合在一起,难以独立地控制上下文信息的强度。RCA通过动态增益场,实现了对上下文信息强度的精细控制,从而有效地抑制了幻觉。

关键设计:RCA的关键设计在于动态增益场的构建。具体来说,使用pre-softmax的注意力分数经过一个非线性整流函数(例如ReLU或Sigmoid)来生成增益系数。这些系数用于放大对应的value向量的范数。增益函数的具体形式和参数需要根据具体的模型和任务进行调整。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

在Llama-3模型系列上的实验表明,RCA显著提高了上下文忠实度,有效抑制了参数幻觉。在多个事实一致性和强知识冲突任务中,RCA均取得了显著的性能提升。作为一个无需训练且计算量可忽略的即插即用模块,RCA在忠实度和流畅性方面实现了帕累托改进,同时保持了模型的一般语言理解能力。

🎯 应用场景

RCA可广泛应用于需要高可靠性和事实一致性的LLM应用场景,例如:智能客服、知识问答、文档摘要、代码生成等。通过提高模型对上下文的敏感度,RCA可以减少错误信息的生成,提升用户体验,并降低因幻觉带来的风险。未来,RCA有望成为LLM推理时的事实性增强的标准模块。

📄 摘要(原文)

Large Language Models (LLMs) frequently exhibit "contextual disregard" when faced with input evidence that conflicts with their internal parametric memory, leading to persistent factual hallucinations. Existing mitigation strategies primarily rely on suppressing specific neuron activations or employing computationally expensive contrastive decoding mechanisms, which often result in increased perplexity or significantly elevated inference latency. To address these limitations, we propose Resonant Context Anchoring (RCA), a lightweight inference-time intervention method grounded in the perspective of residual stream signal dynamics. RCA aims to resolve the signal attenuation of external evidence during its propagation through deep networks. The core mechanism involves the orthogonal decoupling of routing logic and information magnitude within the self-attention module. By utilizing raw pre-softmax attention scores as an instantaneous metric of semantic alignment, we construct a dynamic gain field via non-linear rectification to selectively amplify the norms of value vectors corresponding to context tokens, without altering the attention probability distribution. This mechanism effectively elevates the signal-to-noise ratio (SNR) of input evidence within the residual stream mixture, thereby robustly anchoring the generation trajectory to the truthful context during inference. Extensive experiments on the Llama-3 model series demonstrate that RCA significantly improves contextual faithfulness across multiple factual consistency and strong knowledge-conflict tasks, effectively suppressing parametric hallucinations. Furthermore, results confirm that as a training-free and computationally negligible plug-and-play module, RCA achieves a Pareto improvement in faithfulness and fluency while maintaining the model's general language understanding capabilities.