JJava Stack Lab
论文雷达 · arXiv AI

Model Carving:训练能够优化自身拓扑的 Transformer

摘要

论文提出 Model Carving,在单次训练中同时学习 Transformer 的权重与架构:对每个子层施加可学习的标量门控,让训练损失在训练过程中移除模型自身的组件,从而得到一个更小的异构网络。作者从 140M 到 2.7B 参数预训练标准 Transformer,并训练 140M 到 1.3B 的 looped Transformer;在相同训练算力下,carved 模型的验证损失低于用最多 1.7 倍算力训练的稠密模型,且优于剪枝或蒸馏得到的同尺寸模型。由于被移除的子层不再运行,每 token FLOPs 最多减少 34%,解码速度最多提升 1.6 倍且质量不受影响。

查看原始标题和摘要

Model Carving: Training Transformers That Optimize Their Own Topology

Machine learning has largely kept separate the choice of architecture and the process of training. A classic Transformer, for instance, trains a fixed set of attention and MLP sublayers at every layer, in the same order, and optimizes the weights within. This uniformity is a convention rather than a principled design choice, and it is likely suboptimal: the best architecture for a given task may be smaller, more efficient, and far from uniform. We believe that, ideally, training itself should shape the model's topology. To this end, we introduce Model Carving, which learns both a Transformer's weights and its architecture in a single run. By applying learnable, scalar gates to each sublayer, we allow the training loss to remove the model's own components during training -- freeing a smaller heterogeneous network inside. We evaluate Model Carving by pre-training standard Transformers from 140M to 2.7B parameters and looped Transformers from 140M to 1.3B. At equal training compute, carved models reach a lower validation loss than dense models trained with up to 1.7 times more compute. Furthermore, carved models also outperform size-matched models produced by pruning or distillation,

核心要点

  • 训练中通过可学习标量门控同时学习权重和架构,得到更小的异构网络
  • 相同训练算力下验证损失更低,并可胜过剪枝/蒸馏得到的同尺寸模型
  • 每 token FLOPs 最多减少 34%,解码最多快 1.6 倍
  • 实验覆盖 140M–2.7B 标准 Transformer 与 140M–1.3B looped Transformer
  • 优势随规模增长,并可迁移到 few-shot 评估和生成等下游任务

为什么值得后端工程师关注

对后端工程师而言,这项工作指向更低的推理成本:更少 FLOPs 和更快解码可直接影响服务吞吐与延迟,尤其适合边缘设备部署。不过它目前是研究论文,尚未给出工程实现或生产落地细节,短期价值主要在于跟踪模型压缩与推理优化方向。