无需教师模型,用前一批次输出动态自蒸馏,提升小模型微调效果
Dynamic Self-Distillation via Previous Mini-batches for Fine-tuning Small Language Models
- 利用前批次生成的预测结果作为伪标签,实现无教师自蒸馏
- 动态调节温度与蒸馏权重,改善早期训练不准确问题
- 兼容现有自纠错与自训练方法,适用于各类小语言模型
知识蒸馏(KD)广泛用于压缩大语言模型以降低计算成本和内存占用,但传统方法依赖复杂教师模型,使用商业模型如GPT4时成本高昂且不可行。自蒸馏(SelfD)可避免此问题,但多数现有方法需修改模型结构且依赖开源模型,实用性受限。本文提出一种模型无关、任务无关的方法:动态自蒸馏(DynSDPB),通过前一批次生成的logits进行当前迭代的蒸馏。为应对早期预测不准问题,动态调整蒸馏强度与温度。该方法可无缝集成现有自纠错与自训练技术,适用于编码器型(如BERT系列)和解码器型(如LLaMA系列)小语言模型,在自然语言理解(NLU)与生成(NLG)基准上均表现优异。
原文摘要 · Abstract (English)
Knowledge distillation (KD) has become a widely adopted approach for compressing large language models (LLMs) to reduce computational costs and memory footprints. However, the availability of complex teacher models is a prerequisite for running most KD pipelines. Thus, the traditional KD procedure can be unachievable or budget-unfriendly, particularly when relying on commercial LLMs like GPT4. In this regard, Self-distillation (SelfD) emerges as an advisable alternative, enabling student models to learn without teachers' guidance. Nonetheless, existing SelfD approaches for LMs often involve architectural modifications, assuming the models are open-source, which may not always be practical. In this work, we introduce a model-agnostic and task-agnostic method named dynamic SelfD from the previous minibatch (DynSDPB), which realizes current iterations' distillation from the last ones' generated logits. Additionally, to address prediction inaccuracies during the early iterations, we dynamically adjust the distillation influence and temperature values to enhance the adaptability of fine-tuning. Furthermore, DynSDPB is a novel fine-tuning policy that facilitates the seamless integration of existing self-correction and self-training techniques for small language models (SLMs) because they all require updating SLMs' parameters. We demonstrate the superior performance of DynSDPB on both encoder-only LMs (e.g., BERT model families) and decoder-only LMs (e.g., LLaMA model families), validating its effectiveness across natural language understanding (NLU) and natural language generation (NLG) benchmarks.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。