Gradient Knowledge Distillation for Pre-trained Language Models

Lean Wang, Lei Li, Xu Sun
11/2/2022
cs.CLcs.LG
distillation

Official code: lancopku/GKD (5 stars, Python, last commit 2022-12-02).

Abstract

Knowledge distillation (KD) is an effective framework to transfer knowledge from a large-scale teacher to a compact yet well-performing student. Previous KD practices for pre-trained language models mainly transfer knowledge by aligning instance-wise outputs between the teacher and student, while neglecting an important knowledge source, i.e., the gradient of the teacher.

Show full abstract

The gradient characterizes how the teacher responds to changes in inputs, which we assume is beneficial for the student to better approximate the underlying mapping function of the teacher. Therefore, we propose Gradient Knowledge Distillation (GKD) to incorporate the gradient alignment objective into the distillation process. Experimental results show that GKD outperforms previous KD methods regarding student performance. Further analysis shows that incorporating gradient knowledge makes the student behave more consistently with the teacher, improving the interpretability greatly.

View on arXivView PDF

Code Implementations(1)

lancopku/GKDOfficial100%
50Python, ShellDec 2, 20224 years ago

Similar Papers

Cite this paper

@article{wang2022gradient,
  title  = {Gradient Knowledge Distillation for Pre-trained Language Models},
  author = {Lean Wang and Lei Li and Xu Sun},
  year   = {2022},
  eprint = {2211.01071},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2211.01071}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2211.01071.svg)](https://codeofpaper.com/paper/2211.01071)

Discussion