arXiv:2603.10123cs.LGcs.AI2026-03被引 3

Transformer模型在初始化时就存在中间信息遗忘的固有缺陷。

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

  • 从初始化开始,因果解码器的结构导致中间位置信息影响力极弱。
  • 数学推导显示中间区域影响力低至1/(H-1)!量级,深度越高越严重。
  • 该现象与训练无关,适用于所有标准Transformer架构,需针对性改进。

大型语言模型在上下文中间部分的信息召回能力差,呈现‘头尾好、中间差’的U形性能曲线,常被归因于训练后的Softmax特性或位置编码的距离衰减。本文提出一个精确论断:该U形现象在模型初始化时即已存在,且不依赖任何训练或位置编码。通过将多层因果注意力建模为Cesàro矩阵的迭代幂,并在连续极限下推导出精确的影响密度,发现因果掩码导致提示开头梯度影响对数发散(先验尾),残差连接则在末尾形成孤立的O(1)锚点(近期差)。二者之间存在阶为O(1/(H−1)! )的阶乘死区,使中间内容的检索与训练在结构上极为不利。实验证明,未训练的Qwen2和GPT-2在步骤0即出现相同U形曲线,且是否使用RoPE无影响。对比初始与预训练模型表明,标准训练无法消除此拓扑洼地,确认其为架构基准。我们不认为该偏差不可克服,但强调必须先明确其来源,以便精准干预。

原文摘要 · Abstract (English)

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.

Transformer位置偏差初始化注意力机制

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。