arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2607.08170cs.LG
收藏

理解模型大小插值中的层修补

Understanding Layer Patching in Model Size Interpolation

Harvard University(哈佛大学);Kempner Institute(肯普纳研究所);IST Austria(奥地利科学技术研究所)

Sara Kangaslahti, Jonathan Geuter, Nihal V. Nayak, Marco Fumero, Francesco Locatello, David Alvarez-Melis

AI总结:

研究零样本模型大小插值中如何选择学生层,将其转化为优化问题并证明可看作无环图最短路径问题。通过实验揭示修补对插值行为的影响,介绍KLPatch算法,为模型大小插值提供理解与实用指导。

摘要:

零样本模型大小插值旨在通过组合现有模型来创建中间目标大小的新模型,而无需额外训练。近期关于回飞镖蒸馏的工作表明,从较大教师模型蒸馏得到的学生语言模型可通过迭代修补其层来扩展,即用教师层的连续块替换学生层,以获得在大小和性能上介于学生和教师模型之间的模型。在这项工作中,我们首次对模型大小插值的学生层选择进行了系统研究。我们将为每个模型大小找到最优层子集视为一个优化问题,并证明它可看作是某个无环图中的最短路径问题。实验表明,修补对插值行为有很大影响,且在不同模型家族中的效果差异显著。我们发现简单的顺序策略(从第一层到最后一层或从最后一层到第一层进行修补)在实际中通常能取得惊人的良好性能。我们还引入了基于KL散度的贪婪修补算法KLPatch,它通常比从最后到第一的修补方法有所改进,并近似解决了优化问题。我们的结果为层修补如何影响模型大小插值提供了有原则的理解,并为构建接近最优的插值模型提供了实用指导。

英文摘要:

Layer patching is a key technique for model size interpolation in large language models (LLMs), in which a subset of a distilled student model's layers is replaced with corresponding teacher-model layers to construct intermediate-sized models without additional training. Prior work largely ignores the order in which layers are patched, which we show can dramatically affect the performance and reliability of the resulting models. In this work, we study the role of layer patching in model size interpolation. We cast finding the optimal layer subset for each model size as an optimization problem and prove it can be viewed as a shortest-path problem in a certain acyclic graph. In experiments, we show that patching strongly shapes interpolation behavior, with effects that vary substantially across model families. We find that simple sequential strategies---patching either from the first layer to the last or from the last to the first---often achieve surprisingly strong performance in practice. We further introduce KLPatch, a greedy patching algorithm based on KL divergence, which often improves over last-to-first patching and approximately solves the optimization problem. Together, our results provide a principled understanding of how layer patching affects model size interpolation and offer practical guidance for constructing near-optimal interpolated models. The code and models are available at https://github.com/dcml-lab/boomerang-distillation.

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

↑