扩展器:一种日志结构化的Transformer

·

研究论文 · 2026/10/06

我们提出了 Extender,一种标准 Transformer 架构的对数结构化变体。在标准 Transformer 中,每一层仅通过残差 h(一个叠加通道)与后续层通信。Extender 增加了一个拼接通道 x:每一层 ell 既发出一个加到 h 上的残差更新 δ_ell,也发出一个追加到 x 上的小得多的扩展 ε_ell。FFN 和 q 都读取 h,而注意力 kv 投影仅以 x 为输入。因此,完全扩展的 x 包含所有层 kv 投影的完整输入,将持久注意力内存占用从 2Ld_{model} 降至 sum|ε_ell|。我们发现,当 |ε_ell|=32 时,Extender 在 199M-924M 参数规模下于短上下文(CORE)任务上达到与 Transformer 相当的准确率,并在 924M 参数规模下于长上下文(RULER)工作负载上超过 Transformer 的准确率。对于我们的 1664 宽、924M 模型,Extender 的持久注意力内存占用比 MHA 小 104 倍。内存节省随模型宽度增长。

该工作通过架构创新显著降低长上下文注意力的持久内存占用,同时保持或提升准确率,对高效 Transformer 与长上下文建模具有参考价值。

We introduce the Extender, a log-structured variant of the standard Transformer architecture. In a standard Transformer, each layer communicates with subsequent layers exclusively via the residual h, a superposition channel. The Extender adds a concatenation channel x: each layer ell emits both a residual update δ_ell which is added to h, and a much smaller extension ε_ell which is appended to x. While both the FFN and q see h, the attention kv projections take only x as input. As a result, the fully extended x contains the complete input for the kv projections of all layers, reducing the persistent attention memory footprint from 2Ld_{model} to sum|ε_ell|. We find that with |ε_ell|=32, the Extender matches Transformer accuracy on short-context (CORE) tasks at 199M-924M parameters, and exceeds Transformer accuracy on long-context (RULER) workloads, again at 924M parameters. For our 1664-wide, 924M model, the Extender's persistent attention memory footprint is 104times smaller than MHA. The memory savings grow with model width.

阅读原文

参与讨论