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

Transformer中位置偏差的结构理论

A Structural Theory of Position Bias in Transformers

University of Hamburg(汉堡大学)

Hanna Herasimchyk, Robin Labryga, Tomislav Prusina, Sören Laue

AI总结:

本文通过残差感知累积注意力展开,提出一种结构理论解释因果Transformer中位置偏差的起源,并揭示残差连接如何改变无限深度下的注意力动力学,从而解释Lost-in-the-Middle现象。

摘要:

Transformer模型系统性地偏好某些token位置,但这一位置偏差的架构起源仍知之甚少。这种偏差与“中间丢失”现象密切相关,即模型未能充分利用上下文中间位置的信息。我们证明,中间丢失类型的行为可能源于因果Transformer本身的架构。为此,我们基于残差感知累积注意力展开,发展了一种位置偏差的结构理论。在有限深度下,因果掩码和残差连接导致广泛的、通常是U形的影响分布。在无限深度下,我们的框架解决了先前仅注意力的坍缩理论与实际Transformer行为之间的差异:残差连接从根本上改变了累积注意力动力学。实验上,预测的影响分布与预训练语言模型中测量的输入token影响高度吻合。

英文摘要:

Transformer models systematically favor certain token positions, yet the architectural origins of this position bias remain poorly understood. This bias is closely connected to the Lost-in-the-Middle phenomenon, where models underutilize information placed in the middle of the context. We show that causal Transformer architectures induce a systematic position-bias prior that can help explain the influence profiles associated with Lost-in-the-Middle. To characterize this prior, we develop a structural theory based on cumulative attention rollout with layerwise residual mixing. At finite depth, we isolate the competing positional drifts induced by causal masking, residual mixing, and positional encoding. Their interaction produces broad, often U-shaped profiles. At infinite depth, prior work predicts inevitable collapse under attention-only theory and identifies the discrepancy with observed Transformer behavior as an open problem. Under the stated boundedness assumptions, our residual-aware analysis replaces inevitable collapse with a dichotomy governed by cumulative attention mixing. Empirically, across 30 model-dataset settings, our adaptive residual-aware rollout closely matches measured input-token influence and reduces the average profile discrepancy by approximately 85% relative to both the attention-only and fixed-residual rollout baselines.

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

↑