2025-06-27 · 进阶 · 机器学习 · 自然语言处理

Learning to Skip the Middle Layers of Transformers

这篇论文提出了一种新的Transformer架构,通过动态跳过中间层来提高模型效率。

更新于 2026-02-08。作者:Tim Lawson、Laurence Aitchison。

中文摘要

条件计算是一种提高Transformer效率的流行策略。现有方法通常针对单个模块(例如,专家混合层)或跳层独立地进行优化。然而,可解释性研究已经证明,Transformer的中间层存在更大的冗余性,并且早期层会将信息聚合到标记位置。受这些见解的启发,我们提出了一种新的架构,该架构可以动态地跳过从中间向外的一定数量的层。具体来说,一个学习的门控机制根据输入决定是否跳过中心块对称范围的跳过,并且一个门控注意力机制防止后续标记关注跳过的标记位置。残差范数通过“三明治”或“逐层规范”方案进行控制,而门控稀疏性通过自适应正则化损失进行控制。我们原本旨在减少“更简单”标记的计算需求,并可能促进多级表示层次结构的涌现,但在所研究的规模上,我们的方法在验证交叉熵与估计的FLOPs之间没有比层更少的密集基线实现改进。我们将在https://github.com/tim-lawson/skip-middle发布我们的代码。

英文摘要

Conditional computation is a popular strategy to make Transformers more efficient. Existing methods often target individual modules (e.g., mixture-of-experts layers) or skip layers independently of one another. However, interpretability research has demonstrated that the middle layers of Transformers exhibit greater redundancy, and that early layers aggregate information into token positions. Guided by these insights, we propose a novel architecture that dynamically skips a variable number of layers from the middle outward. In particular, a learned gating mechanism determines whether to bypass a symmetric span of central blocks based on the input, and a gated attention mechanism prevents subsequent tokens from attending to skipped token positions. Residual norms are controlled with a 'sandwich' or 'perilayernorm' scheme and gate sparsity with an adaptive regularization loss. We had aimed to reduce compute requirements for 'simpler' tokens and potentially foster an emergent multi-level representational hierarchy but, at the scales investigated, our approach does not achieve improvements in the trade-off between validation cross-entropy and estimated FLOPs compared to dense baselines with fewer layers. We release our code at https://github.com/tim-lawson/skip-middle.

解读

一句话总结

这篇论文提出了一种新的Transformer架构,通过动态跳过中间层来提高模型效率。

问题1:这篇论文想要解决什么具体问题?

问题2:论文的核心创新点是什么?

问题3:实验结果如何验证了方法的有效性?

问题4:这个研究的实际应用价值是什么?

来源

机器可读索引:llms.txt