AD-KD: Attribution-Driven Knowledge Distillation for Language Model Compression

Siyue Wu, Hongzhan Chen, Xiaojun Quan, Qifan Wang, Rui Wang

Abstract

Pre-trained Language Models (PLMs) like BERT have revolutionized Natural Language Processing but remain computationally expensive for edge deployment. While Knowledge Distillation (KD) is a common compression strategy, traditional methods often fail to capture the underlying reasoning of the teacher model. We present Attribution-Driven Knowledge Distillation (AD-KD), a novel framework that transfers token-level attribution scores from a teacher to a student. By teaching the "why" behind predictions using Integrated Gradients, AD-KD achieves state-of-the-art performance on the GLUE benchmark, particularly on smaller datasets where rationales provide critical guidance.

Introduction

The deployment of large-scale models like BERT in low-latency environments is hindered by their massive parameter counts. Knowledge Distillation (KD) addresses this by training a compact "student" model to mimic a larger "teacher." However, existing KD techniques typically focus on matching output logits (response-based) or internal hidden states (feature-based), often ignoring the data-specific rationales that drive the teacher's decisions.

AD-KD addresses this gap by focusing on attribution knowledge. Instead of just matching what the teacher predicts, the student learns which specific parts of the input text were most influential in making that prediction. This approach shifts the focus from model-specific internal structures to data-specific rationales, which tend to generalize better across different model architectures.

Methodology

The core of AD-KD is the distillation of attribution maps generated via Integrated Gradients (IG). IG is a gradient-based technique that assigns an importance score to every dimension of every input token, highlighting the features that most significantly impacted the final output.

The AD-KD framework architecture, illustrating the distillation of attribution maps from teacher to student.

Key Components of AD-KD:

  • Multi-view Attribution: Unlike standard methods that only look at the winning class, AD-KD distills attribution maps for all possible labels. This provides the student with a comprehensive understanding of the entire decision space, including why certain labels were rejected.
  • Top-K Filtering: To mitigate noise, the framework filters out embedding dimensions with low attribution scores. This ensures the student focuses on the most significant signals within the teacher's embeddings.
  • L2 Normalization: To bridge the gap between a well-trained teacher's sharp attributions and a student's initial flat scores, the authors apply L2 normalization. This prevents the student from getting stuck in local optima during the early stages of training.
  • Input Layer Focus: Interestingly, the authors found that distilling attribution from the input layer is more effective than from intermediate layers. Intermediate features are often too model-specific, whereas input-level rationales are more transferable.

Experimental Results

The researchers evaluated AD-KD across the GLUE benchmark and the MultiRC task from SuperGLUE. The results demonstrate that AD-KD consistently outperforms previous state-of-the-art (SOTA) distillation methods such as CKD and MGSKD.

Performance comparison between AD-KD and Vanilla KD across various model depths and widths on MRPC and QNLI datasets.

Performance Highlights:

  • GLUE Benchmark: AD-KD achieved an average improvement of 1.0 to 1.9 points over previous SOTA methods.
  • Small Dataset Resilience: The method proved exceptionally effective on smaller datasets like CoLA (+3.2 points) and RTE (+3.6 points). In these data-scarce scenarios, the teacher's rationale acts as a vital "hint" that helps the student learn more efficiently.
  • Efficiency Trade-offs: While the training process is 1.2x to 3x slower due to the computational cost of calculating Integrated Gradients, the resulting student model maintains the same inference speed as any other model of its size, making it ideal for deployment.

Conclusion and Future Work

AD-KD demonstrates that teaching the "rationale" behind a prediction is a powerful way to compress language models without sacrificing accuracy. By focusing on attribution maps, the student gains a deeper understanding of the task that transcends simple pattern matching.

Future work may involve extending AD-KD to "black-box" distillation scenarios where gradients are unavailable, potentially using occlusion-based attribution methods. Additionally, applying attribution-driven techniques to the task-agnostic pre-training phase could further enhance the robustness of compressed language models.

Summary updated

BibTeX
@inproceedings{wu2023ad,
  author = {Siyue Wu and Hongzhan Chen and Xiaojun Quan and Qifan Wang and Rui Wang},
  title = {{AD-KD: Attribution-Driven Knowledge Distillation for Language Model Compression}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2023},
  doi = {10.18653/v1/2023.acl-long.471},
}
Figure