arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2606.08105cs.LG
收藏

注意力汇聚的统一视角:两种算法,两种解决方案

A Unifying View of Attention Sinks: From Mechanisms to Architectural Interventions

Kempner Institute(肯普纳研究所);Harvard University(哈佛大学)

Lukas Fesser*, Mozes Jacobs*, Thomas Fel*, Andy Keller, Sham Kakade

AI总结:

本文揭示注意力汇聚(attention sink)可对应两种不同机制:自适应空操作(adaptive nop)和广播(broadcast),并据此提出诊断方法,证明门控(gating)和寄存器(register)等干预分别针对不同机制,组合使用效果更佳。

摘要:

当注意力集中在一个单一标记(即汇聚)上时,模型实际上在计算什么?注意力汇聚在softmax transformer中普遍存在,然而这种共享的视觉特征可能隐藏着根本不同的算法。我们表明,视觉上相似的汇聚模式可以反映两种不同的机制:{i}自适应空操作,其中注意力头通过路由到空标记来抑制其更新;以及{ii}广播,其中汇聚聚合并重新分配全局信息。在这种情况下,汇聚扮演着类似的作用:当没有有用信息可计算时,作为一个安全的目的地。提出的干预措施如门控或寄存器之所以有效,是因为它们隐式地针对其中一种机制,揭示了方法与假设机制之间的对偶性:门控隐式假设空操作;寄存器隐式假设广播。每种机制都会留下不同的痕迹(空操作汇聚的值范数可忽略;广播汇聚导致低秩输出),我们在合成任务上形式化这些痕迹,并用于推导实用的诊断方法。应用于预训练视觉transformer时,这些诊断表明两种机制在大规模模型中均存在:汇聚从早期层的CLS标记过渡到深层层的块标记,并集中在专门的注意力头中。引人注目的是,为广播设计的寄存器标记被重新用于服务空操作,证实了单独任何一种干预都不足够。将门控与寄存器结合使用在稳定性和性能上带来互补的提升。总体而言,我们发现相同的注意力模式可以反映两种截然不同的计算,有效的干预需要首先询问模型实际在计算什么。

英文摘要:

When attention concentrates on a single token, a sink, what is the model actually computing? Attention sinks are ubiquitous in softmax transformers, yet this shared visual signature can hide fundamentally different algorithms. We show that visually similar sink patterns can reflect two distinct mechanisms: (i) adaptive nop, where a head suppresses its update by routing to a null token, and (ii) broadcast, where a sink aggregates and redistributes global information. Each mechanism leaves distinct traces (nop-sinks exhibit negligible value norms; broadcast sinks induce low-rank outputs), which we formalize on synthetic tasks and use to derive practical diagnostics. Applied to pretrained vision transformers, these diagnostics reveal that both mechanisms exist at scale: sinks transition from CLS in early layers to patches in deeper layers and concentrate in specialized heads. Causal interventions further connect these signatures to near-null suppression and shared residual contributions. We then use architectural interventions to show how these computations can be reorganized: gating eliminates detected nop-like sinks but increases broadcast-like sinks, registers relocate rather than remove sink computation, and our position-free global pathway provides an explicit route for shared communication that reduces the broadcast-like sinks induced by gating. On dense probes, combining gating with the global pathway gives the strongest results among the tested variants, despite retaining some broadcast-like sinks. Overall, we find that the same attention pattern can reflect two very different computations, and that effective intervention depends not only on identifying the computation, but also on providing architectural alternatives through which the model can reorganize it.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑