arXiv:2604.03190cs.LGcs.AI2026-04被引 1

在单个注意力层内用梯度提升思想改进预测,显著降低语言模型困惑度。

Gradient Boosting within a Single Attention Layer

  • 引入梯度提升机制于单层注意力,通过二次注意力修正首次预测误差。
  • 在WikiText-103和OpenWebText上分别降低困惑度6.0%和5.6%,优于基线方法。
  • 适用于预归一化结构的Transformer,对后归一化结构反而有害。

Transformer注意力通过一次softmax加权平均计算输出,无法自我修正错误。本文提出梯度提升注意力,在单个注意力层内应用梯度提升思想:第二轮注意力使用独立投影,关注第一轮的预测误差并施加门控修正。在平方重建目标下,该结构对应Friedman的梯度提升机,每轮注意力作为基学习器,各维度门控相当于收缩参数。我们证明,一次霍普菲尔德式更新会抹除与存储模式子空间正交的查询信息,后续局部收缩迭代可使同一区域的不同查询收敛至相同固定点。独立投影设计能恢复共享投影法(如Tukey's twicing)无法捕捉的残差信息。在10M token的WikiText-103和OpenWebText子集上,梯度提升注意力分别将测试困惑度降低6.0%和5.6%,超越了Twicing Attention和参数匹配的更宽基线,两轮迭代已捕获大部分增益。理论与实证均表明,该机制依赖Pre-LN Transformer的加性残差结构;在Post-LN结构下,相同架构导致困惑度上升9.6%。

原文摘要 · Abstract (English)

Transformer attention computes a single softmax-weighted average over values -- a one-pass estimate that cannot correct its own errors. We introduce \emph{gradient-boosted attention}, which applies the principle of gradient boosting \emph{within} a single attention layer: a second attention pass, with its own learned projections, attends to the prediction error of the first and applies a gated correction. Under a squared reconstruction objective, the construction maps onto Friedman's gradient boosting machine, with each attention pass as a base learner and the per-dimension gate as the shrinkage parameter. We show that a single Hopfield-style update erases all query information orthogonal to the stored-pattern subspace, and that further iteration under local contraction can collapse distinct queries in the same region to the same fixed point. We also show that separate projections for the correction pass can recover residual information inaccessible to the shared-projection approach of Tukey's twicing. On 10M-token subsets of WikiText-103 and OpenWebText, gradient-boosted attention improves test perplexity by $6.0\%$ and $5.6\%$ over standard attention, outperforming both Twicing Attention and a parameter-matched wider baseline on both benchmarks, with two rounds capturing most of the benefit. We further show, both theoretically and empirically, that the mechanism requires the additive residual structure of Pre-LN transformers: under Post-LN, the same architecture degrades perplexity by $9.6\%$.

注意力机制梯度提升Transformer优化语言建模

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