arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2603.10123cs.LGcs.AIcs.CL
收藏

出生时便迷失在中间:变换器位置偏置的精确理论

Lost in the Middle at Birth: An Exact Theory of Transformer Position Bias

Borun D Chowdhury

AI总结:

本文提出变换器位置偏置的精确理论,揭示U形性能曲线源于初始化时因果解码器的几何属性,证明中间上下文检索和训练在结构上具有敌意。

摘要:

"迷失在中间"现象——一种U形性能曲线,其中LLM在上下文的开始和结束处表现良好,但在中间失败——通常归因于学习到的Softmax残差或如RoPE之类的定位编码的距离衰减。本文提出一个明确的主张:U形在初始化时已经存在,即使在任何训练或位置编码生效之前。这是因果解码器中残差连接的固有几何属性。我们把多层因果注意力建模为Cesàro矩阵的迭代幂,并在连续极限下推导出精确的闭合形式影响密度。因果掩码迫使提示开始处的梯度影响出现对数发散(Primacy Tail),而残差连接在最后的token处创造了一个孤立的O(1)锚点(Recency Delta)。在这些极端之间,存在一个阶为O(1/(H−1)!)的阶乘死区,其中H是网络深度,使中间上下文的检索和训练在结构上具有敌意。我们实证地证明,未经训练的Qwen2和GPT-2架构在Step~0时就表现出这种U形,并且无论是否使用RoPE都相同。比较初始化和预训练的网络,我们显示标准训练无法克服这个拓扑山谷,确认U形作为标准预训练目标下的架构基准持续存在。我们不声称这种偏差不可克服,也不声称如RoPE修改等干预措施是无用的。我们确立了基准是什么以及它来自哪里,以便未来克服它的努力可以被精确地针对。

英文摘要:

The ``Lost in the Middle'' phenomenon -- a U-shaped performance curve where LLMs retrieve well from the beginning and end of a context but fail in the middle -- is widely attributed to learned Softmax artifacts or the distance-decay of positional encodings like RoPE. This paper makes a single, precise claim: \emph{the U-shape is already present at initialization, before any training or positional encoding takes effect.} It is an inherent geometric property of the causal decoder with residual connections. We model multi-layer causal attention as iterated powers of the Cesàro matrix and derive the exact closed-form influence density in the continuous limit. Causal masking forces a logarithmic divergence of gradient influence at the start of the prompt (the Primacy Tail), while residual connections create an isolated $\mathcal{O}(1)$ anchor at the final token (the Recency Delta). Between these extremes lies a factorial dead zone of order $\mathcal{O}(1/(H{-}1)!)$, where $H$ is the network depth, making middle-context retrieval and training structurally hostile. We validate empirically that untrained Qwen2 and GPT-2 architectures exhibit this U-shape at Step~0, and that it is identical with or without RoPE. Comparing initialized and pretrained networks, we show that standard training does not overcome the topological valley, confirming that the U-shape persists as an architectural baseline under standard pretraining objectives. We do not claim that this bias is insurmountable, nor that interventions such as RoPE modifications are useless. We establish what the baseline is and where it comes from, so that future efforts to overcome it can be precisely targeted.

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

↑