通过阶段级权重共享探索 Learngene 以初始化可变尺寸模型
Exploring Learngene via Stage-wise Weight Sharing for Initializing Variable-sized Models
AI总结:
本文提出 SWS(阶段级权重共享)方法,通过构建辅助模型并共享阶段层权重学习 learngene 层,再扩展以初始化可变尺寸模型,在 ImageNet-1K 上实现更优性能并显著降低训练与预训练成本及存储参数量。
摘要:
在实践中,我们通常需要构建适应不同应用场景中多样化资源约束的可变尺寸模型,其中权重初始化是训练前的重要步骤。最近引入的 Learngene 框架首先从训练良好的大型模型中学习一个称为 learngene 的紧凑部分,随后将其扩展以初始化可变尺寸模型。在本文中,我们从分析指导对训练良好的 learngene 层扩展的重要性出发,启发了一种简单但高效的 Learngene 方法的设计,称为 SWS(阶段级权重共享),其中 learngene 层及其学习过程为初始化不同规模的模型提供了关键的知识和指导。具体而言,为学习 learngene 层,我们构建一个包含多个阶段的辅助模型,每个阶段的层权重被共享,随后通过蒸馏进行训练。接着,我们在对应阶段扩展这些包含阶段信息的 learngene 层,以初始化可变深度的模型。在 ImageNet-1K 上的大量实验表明,SWS 相比许多从零开始训练的模型实现了一致更优的性能,同时减少了约 6.6 倍的总训练成本。在某些情况下,SWS 仅需 1 个 epoch 的微调即可表现更佳。当初始化适应不同资源约束的可变尺寸模型时,与预训练加微调方法相比,SWS 在获得更优结果的同时,减少了约 20 倍用于初始化这些模型的存储参数量以及约 10 倍的预训练成本。
英文摘要:
In practice, we usually need to build variable-sized models adapting for diverse resource constraints in different application scenarios, where weight initialization is an important step prior to training. The Learngene framework, introduced recently, firstly learns one compact part termed as learngene from a large well-trained model, after which learngene is expanded to initialize variable-sized models. In this paper, we start from analysing the importance of guidance for the expansion of well-trained learngene layers, inspiring the design of a simple but highly effective Learngene approach termed SWS (Stage-wise Weight Sharing), where both learngene layers and their learning process critically contribute to providing knowledge and guidance for initializing models at varying scales. Specifically, to learn learngene layers, we build an auxiliary model comprising multiple stages where the layer weights in each stage are shared, after which we train it through distillation. Subsequently, we expand these learngene layers containing stage information at their corresponding stage to initialize models of variable depths. Extensive experiments on ImageNet-1K demonstrate that SWS achieves consistent better performance compared to many models trained from scratch, while reducing around 6.6x total training costs. In some cases, SWS performs better only after 1 epoch tuning. When initializing variable-sized models adapting for different resource constraints, SWS achieves better results while reducing around 20x parameters stored to initialize these models and around 10x pre-training costs, in contrast to the pre-training and fine-tuning approach.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。