让大模型每层能主动选择前面层的有用信息,提升推理效果且不增加计算负担。
Depth-Attention: Cross-Layer Value Mixing for Language Models

- 在注意力机制内实现跨层信息选择,用查询混合早期层值。
- 1.5B到3B模型上困惑度最低,平均准确率提升最高达2.3点。
- 无需额外参数或缓存,适合部署在压缩缓存的现代大模型中。
自注意力可自由选择序列信息,但深度方向上,Transformer仅将各层输出累加至残差流,导致后期无法选择性复用早期表示。现有跨层方法虽有改进,但作用于注意力外的隐藏状态,推断时引入额外状态,随分组查询与多头潜在注意力压缩缓存而代价凸显。我们提出Depth-Attention,将此选择操作嵌入注意力模块内部:在某层进行序列注意力前,其查询先在相同标记位置对前期层的键进行注意力,并将对应值混合进该层的值,供后续自注意力读取。由于重用标准注意力的查询、键与值缓存槽,仅以深度混合后的值替换原值,无需新增参数,也不引入除标准键值缓存外的持久状态——缓存大小与普通解码器一致,小于基于隐藏状态的跨层方法。在1.5B和3B参数量的Qwen3型解码器上,Depth-Attention达到最低困惑度与最高平均下游准确率,相比原始Transformer最高提升2.3个准确率点,超越强基线在困惑度与平均准确率上的表现,额外算术浮点运算量低于0.01%,无额外持久化推断状态。增益在360M至3B参数量范围内稳定,亦适用于循环式Transformer。
原文摘要 · Abstract (English)
Self-attention selects information freely across the sequence, but across depth, Transformers merely add each layer's output to the residual stream, so later layers cannot selectively reuse earlier-layer representations. Recent cross-layer methods improve this flow but operate on hidden states outside attention, adding state beyond the key-value cache at inference--a cost that becomes increasingly salient as modern LLMs compress the cache with grouped-query and multi-head latent attention. We introduce Depth-Attention, which performs this selection inside the attention module itself: before a layer attends over the sequence, its query attends over the keys of earlier layers at the same token position and mixes their values into the value that self-attention then reads. Because Depth-Attention reuses the standard attention queries, keys, and value-cache slots, storing depth-mixed values in place of the original values, it adds no parameters and introduces no persistent inference state beyond the standard key-value cache--the same cache size as a vanilla decoder and less than hidden-state-based cross-layer methods. On Qwen3-style decoders at 1.5B and 3B parameters, Depth-Attention attains the lowest perplexity and the highest average downstream accuracy, improving over the vanilla Transformer by up to 2.3 accuracy points and surpassing strong cross-layer baselines in perplexity and average accuracy, while adding under 0.01% extra arithmetic FLOPs and no additional persistent inference state. The gains hold from 360M to 3B parameters and extend to looped Transformers.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。