Skip to main content
QUICK REVIEW

[Paper Review] HomoDistil: Homotopic Task-Agnostic Distillation of Pre-trained Transformers

Liang Chen, Haoming Jiang|arXiv (Cornell University)|Feb 19, 2023
Topic ModelingComputer Science9 citations
TL;DR

HomoDistil introduces an iterative pruning-based, task-agnostic distillation method that initializes a student from a teacher and progressively prunes neurons while distilling, yielding compact BERT-based models with strong downstream performance.

ABSTRACT

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.

Motivation & Objective

  • Motivate efficient deployment of pre-trained transformers under latency and memory constraints.
  • Develop a task-agnostic distillation framework that keeps prediction discrepancy low during training.
  • Combine iterative neuron pruning with distillation to produce compact yet well-generalized students.
  • Demonstrate effectiveness on BERT-base via HomoBERT variants across GLUE and SQuAD benchmarks.

Proposed method

  • Initialize the student from the teacher to ensure small early-stage prediction discrepancy.
  • Iteratively prune the least important neurons using a sensitivity-based score computed from the total loss.
  • Apply a distillation regime that matches teacher and student representations (hidden, embedding, and attention) and a Kullback–Leibler loss on outputs.
  • Use structured pruning to prune neurons (columns/neurons) and propagate pruning to subsequent layers.
  • Optimize a total loss that combines MLM, KL distillation, and transformer-distillation terms with fixed weights.
  • Schedule pruning sparsity r(t) with a cubically decreasing function to gradually increase sparsity while maintaining performance.

Experimental results

Research questions

  • RQ1Can task-agnostic distillation maintain low prediction discrepancy when the student is progressively pruned from the teacher?
  • RQ2Does iterative neuron pruning combined with distillation outperform single-shot pruning or distillation-only baselines on GLUE and SQuAD?
  • RQ3How does HomoDistil compare to existing task-agnostic distillation baselines across multiple parameter scales?
  • RQ4Does preserving intermediate representations and attention in distillation improve downstream fine-tuning performance?

Key findings

  • HomoDistil achieves state-of-the-art fine-tuning performance on GLUE and SQuAD v1.1/2.0 for several HomoBERT sizes.
  • Distilled HomoBERT variants outperform the best baseline MiniLM at comparable parameter counts on SQuAD v2.0 by over 3 points (Avg on SQuAD v1.1/2.0).
  • Maintaining a small prediction discrepancy throughout training leads to better generalization across tasks.
  • Distillation losses (L_total) consistently improve task-specific fine-tuning performance over MLM-only training.
  • Sensitivity-based and PLATON-based importance metrics outperform magnitude pruning and movement pruning in this setting.
  • Iterative pruning with initialization from the teacher enables effective knowledge transfer while achieving compact models (e.g., HomoBERT-tiny at ~14-15M params).

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.