arXiv:2410.17215cs.CL2024-10ICLR被引 35

用教师模型优化训练数据,让小模型预训练更高效、灵活且效果更好。

MiniPLM: Knowledge Distillation for Pre-Training Language Models

  • 离线生成教师模型的预测结果,避免训练时重复计算。
  • 在9个下游任务上提升小模型性能,降低预训练计算量。
  • 支持跨模型家族的知识蒸馏,提升训练数据利用率。

知识蒸馏(KD)常用于通过大模型训练高性能的小型语言模型。然而,预训练阶段的KD面临效率低、灵活性差和效果不佳的问题:现有方法或需在线推理导致计算开销大,或要求师生模型词元化对齐,或使教师生成的数据难度与多样性下降。本文提出MiniPLM,一种通过教师模型知识重构训练数据分布的预训练知识蒸馏框架。为提升效率,采用离线教师推理,可复用于多个学生模型而无需额外训练成本;为增强灵活性,仅作用于原始训练语料,支持跨模型家族的蒸馏;为提升效果,利用大模型与小模型间的差异增强训练数据的难度与多样性,帮助学生模型习得更丰富的能力。大量实验表明,MiniPLM在9个常见下游任务中显著提升学生模型表现,增强语言建模能力,并减少预训练计算量。扩展分析显示,其优势在更大规模训练下仍可持续,且能有效提升预训练数据利用效率。代码、数据与模型详见https://github.com/thu-coai/MiniPLM。

原文摘要 · Abstract (English)

Knowledge distillation (KD) is widely used to train small, high-performing student language models (LMs) using large teacher LMs. While effective in fine-tuning, KD during pre-training faces efficiency, flexibility, and effectiveness issues. Existing methods either incur high computational costs due to online teacher inference, require tokenization matching between teacher and student LMs, or risk losing the difficulty and diversity of the teacher-generated training data. In this work, we propose MiniPLM, a KD framework for pre-training LMs by refining the training data distribution with the teacher LM's knowledge. For efficiency, MiniPLM performs offline teacher inference, allowing KD for multiple student LMs without adding training costs. For flexibility, MiniPLM operates solely on the training corpus, enabling KD across model families. For effectiveness, MiniPLM leverages the differences between large and small LMs to enhance the training data difficulty and diversity, helping student LMs acquire versatile and sophisticated knowledge. Extensive experiments demonstrate that MiniPLM boosts the student LMs' performance on 9 common downstream tasks, improves language modeling capabilities, and reduces pre-training computation. The benefit of MiniPLM extends to larger training scales, evidenced by the scaling curve extrapolation. Further analysis reveals that MiniPLM supports KD across model families and enhances the pre-training data utilization. Our code, data, and models can be found at https://github.com/thu-coai/MiniPLM.

知识蒸馏预训练小模型高效训练

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。