arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2510.13876cs.CLcs.AI
收藏

层何时启用:通过残差门学习跳过计算在LLMs中

What Layers When: Learning to Skip Compute in LLMs with Residual Gates

Humboldt University Berlin(洪堡大学柏林);Qualcomm-UvA Lab, University of Amsterdam(高通-乌得勒支实验室,阿姆斯特丹大学);FunAI Lab, University of Technology Nuremberg(FunAI实验室,纽伦堡技术大学)

Filipe Laitenberger, Dawid Kopiczko, Cees G. M. Snoek, Yuki M. Asano

AI总结:

通过残差门机制实现LLMs中按token跳过层,节省计算并保持高准确性,适用于大模型和指令调优场景。

摘要:

我们介绍了GateSkip,一种简单的残差流门控机制,使解码器-only语言模型能够实现按token跳过层。每个注意力/MLP分支都配备了一个sigmoid-linear门,该门在分支的输出重新进入残差流之前对其进行压缩。在推理过程中,我们通过门值对token进行排序,并使用每层预算跳过重要性低的token。虽然早退或基于路由的混合深度模型已知不稳定且需要大量重新训练,但我们的平滑、可微门控能够在预训练模型上稳定微调。在长形式推理中,我们节省了高达15%的计算量,同时保持超过90%的基线准确性。对于日益庞大的模型,这种权衡显著改善。在指令调优模型中,我们能够在全计算量下获得准确性提升,并在接近50%的计算节省下达到基线质量。所学的门控提供了对transformer信息流的见解(例如,BOS token充当锚点),并且该方法可以轻松与量化、剪枝和自我推测解码相结合。

英文摘要:

We introduce GateSkip, a simple residual-stream gating mechanism that enables token-wise layer skipping in decoder-only LMs. Each Attention/MLP branch is equipped with a sigmoid-linear gate that condenses the branch's output before it re-enters the residual stream. During inference we rank tokens by the gate values and skip low-importance ones using a per-layer budget. While early-exit or router-based Mixture-of-Depths models are known to be unstable and need extensive retraining, our smooth, differentiable gates fine-tune stably on top of pretrained models. On long-form reasoning, we save up to 15% compute while retaining over 90% of baseline accuracy. For increasingly larger models, this tradeoff improves drastically. On instruction-tuned models we see accuracy gains at full compute and match baseline quality near 50% savings. The learned gates give insight into transformer information flow (e.g., BOS tokens act as anchors), and the method combines easily with quantization, pruning, and self-speculative decoding.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑