arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2610.20588cs.LGcs.AI
收藏

你的Transformer其实是弹性的

Your Transformer Is Secretly Elastic

University of Amsterdam(阿姆斯特丹大学);TNO, Intelligent Imaging(荷兰应用科学研究组织,智能成像)

Walter Simoncini, Dheeraj Varghese, Gertjan J. Burghouts, Cees G. M. Snoek

AI总结:

本研究提出无需重训的弹性化预训练Transformer方法,通过联合排序神经元与注意力头实现动态适配,在27个Transformer模型上验证其剪枝性能优于基线,可提升吞吐量并降低延迟。

摘要:

扩大Transformer规模已产生具备广泛能力的模型,被部署在异构硬件和波动的工作负载中。然而,模型家族仅提供少数固定规模(如S、B、L),迫使用户根据硬件和延迟约束选择模型,这种刚性在查询负载变化时往往并非最优。我们提出一种无需重新训练的方法,将预训练Transformer弹性化为单个模型,可在连续计算预算下动态适配。我们的核心贡献是对功能单元排序问题的可微松弛:与以往每个MLP块或注意力头仅优化单个重要性权重的工作不同,我们通过在多个稀疏度目标下同时最小化模型在软剪枝时的损失,在统一尺度上联合对每个MLP神经元和注意力头排序。在27个参数规模从2200万到80亿的视觉和文本Transformer编码器上,我们的方法在稀疏度达60%时性能平滑下降,且在深度剪枝下优于一次性基线。例如,将DINOv3 ViT-H+/16剪枝至50%稀疏度,会移除4.27亿参数,仅使ImageNet-1k线性探测准确率下降0.8%,无需权重校正或重新训练。在A100 GPU上,60%稀疏度的剪枝后AugReg ViT-B/16模型吞吐量提升达1.80倍,单查询延迟降低1.26倍。弹性模型可在数分钟内生成,构建时间随参数规模呈亚线性增长。

英文摘要:

Scaling up transformers has produced models with broad capabilities, deployed across heterogeneous hardware and fluctuating workloads. Yet, model families offer only a few fixed sizes (e.g., S, B, L), forcing users to commit to a model based on hardware and latency constraints. This rigidity is often suboptimal under varying query loads. We introduce a retraining-free method that elastifies pre-trained transformers into a single model that adapts on-the-fly across a continuum of computational budgets. Our key contribution is a differentiable relaxation of the functional unit-ranking problem: unlike prior work, which optimizes a single importance weight per MLP block or attention head, we rank every individual MLP neuron and attention head jointly, on a common scale, by minimizing the model's loss under soft pruning across many sparsity targets, all at once. Across 27 vision and text transformer encoders ranging from 22M to 8B parameters, our method yields smooth degradation up to 60% sparsity and outperforms one-shot baselines under deep pruning. For example, pruning DINOv3 ViT-H+/16 to 50% sparsity removes 427M parameters while reducing ImageNet-1k linear-probing accuracy by only 0.8%, without the need for weight correction or retraining. At 60% sparsity, a pruned AugReg ViT-B/16 model achieves up to $1.80\times$ higher throughput and $1.26\times$ lower single-query latency on an A100 GPU. Elastic models are produced in minutes, with construction time scaling sub-linearly with parameter count.

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

↑