[论文解读] HomoDistil: Homotopic Task-Agnostic Distillation of Pre-trained Transformers
HomoDistil 引入了一种迭代剪枝为基础的、任务无关的蒸馏方法,它以教师模型初始化学生模型并在蒸馏的同时逐步裁剪神经元,产生在下游表现强劲的紧凑 BERT 基模型。
Knowledge distillation has been shown to be a powerful model compression approach to facilitate the deployment of pre-trained language models in practice. This paper focuses on task-agnostic distillation. It produces a compact pre-trained model that can be easily fine-tuned on various tasks with small computational costs and memory footprints. Despite the practical benefits, task-agnostic distillation is challenging. Since the teacher model has a significantly larger capacity and stronger representation power than the student model, it is very difficult for the student to produce predictions that match the teacher's over a massive amount of open-domain training data. Such a large prediction discrepancy often diminishes the benefits of knowledge distillation. To address this challenge, we propose Homotopic Distillation (HomoDistil), a novel task-agnostic distillation approach equipped with iterative pruning. Specifically, we initialize the student model from the teacher model, and iteratively prune the student's neurons until the target width is reached. Such an approach maintains a small discrepancy between the teacher's and student's predictions throughout the distillation process, which ensures the effectiveness of knowledge transfer. Extensive experiments demonstrate that HomoDistil achieves significant improvements on existing baselines.
研究动机与目标
- 在延迟和内存约束下,推动对预训练变换器的高效部署。
- 开发一个任务无关的蒸馏框架,在训练过程中保持预测差异尽量小。
- 将迭代神经元剪枝与蒸馏相结合,产出紧凑但泛化良好的学生模型。
- 通过 HomoBERT 变体在 GLUE 和 SQuAD 基准测试上展示对 BERT-base 的有效性。
提出的方法
- 从教师模型初始化学生模型,以确保初期预测差异较小。
- 使用基于灵敏度的分数(由总损失计算)迭代剪裁最不重要的神经元。
- 应用蒸馏方案,使教师和学生的表示(隐藏层、嵌入和注意力)一致,并在输出上使用 KL 散度损失。
- 使用结构化剪枝来裁剪神经元(列/神经元),并将剪枝传播到后续层。
- 优化一个总损失,它将 MLM、KL 蒸馏和 transformer-蒸馏项按固定权重结合起来。
- 以三次方递减函数对剪枝稀疏度 r(t) 进行调度,以在保持性能的同时逐步提高稀疏度。
实验结果
研究问题
- RQ1当学生模型由教师模型逐步剪枝时,任务无关的蒸馏是否能维持低预测差异?
- RQ2将迭代神经元剪枝与蒸馏结合,是否在 GLUE 和 SQuAD 上优于单次剪枝或仅蒸馏的基线?
- RQ3在多种参数规模下,HomoDistil 相较于现有的任务无关蒸馏基线表现如何?
- RQ4在蒸馏中保留中间表示和注意力是否会提升下游微调性能?
主要发现
- 在若干 HomoBERT 尺度下,HomoDistil 在 GLUE 和 SQuAD v1.1/2.0 上实现了最先进的微调性能。
- 蒸馏后的 HomoBERT 变体在 SQuAD v2.0 的参数量相当时,平均在 SQuAD v1.1/2.0 上超过基线 MiniLM 大于 3 点。
- 在整个训练过程中保持较小的预测差异有助于提升跨任务的泛化能力。
- 蒸馏损失(L_total)在任务特定微调方面持续优于仅 MLM 的训练。
- 基于敏感性和基于 PLATON 的重要性度量在此设置中优于幅度剪枝和移动剪枝。
- 从教师初始化的迭代剪枝在实现紧凑模型的同时实现有效知识传递(例如 HomoBERT-tiny 约 14-15M 参数)。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。