Skip to main content
QUICK REVIEW

[Paper Review] Less is More: Task-aware Layer-wise Distillation for Language Model Compression

Liang Chen, Simiao Zuo|arXiv (Cornell University)|Oct 4, 2022
Topic ModelingComputer Science14 citations
TL;DR

This paper proposes Task-aware Layer-wise Distillation (TED), a method that uses task-specific filters to distill only relevant knowledge from teacher model hidden representations into student models, reducing redundancy and improving distillation efficiency. TED achieves state-of-the-art performance in both continual pre-training and fine-tuning scenarios, outperforming existing distillation methods on GLUE and SQuAD benchmarks.

ABSTRACT

Layer-wise distillation is a powerful tool to compress large models (i.e. teacher models) into small ones (i.e., student models). The student distills knowledge from the teacher by mimicking the hidden representations of the teacher at every intermediate layer. However, layer-wise distillation is difficult. Since the student has a smaller model capacity than the teacher, it is often under-fitted. Furthermore, the hidden representations of the teacher contain redundant information that the student does not necessarily need for the target task's learning. To address these challenges, we propose a novel Task-aware layEr-wise Distillation (TED). TED designs task-aware filters to align the hidden representations of the student and the teacher at each layer. The filters select the knowledge that is useful for the target task from the hidden representations. As such, TED reduces the knowledge gap between the two models and helps the student to fit better on the target task. We evaluate TED in two scenarios: continual pre-training and fine-tuning. TED demonstrates significant and consistent improvements over existing distillation methods in both scenarios. Code is available at https://github.com/cliang1453/task-aware-distillation.

Motivation & Objective

  • To address the challenge of knowledge redundancy in layer-wise distillation, where student models struggle to learn useful representations due to irrelevant information in teacher hidden states.
  • To reduce the knowledge gap between large teacher and small student models by focusing distillation on task-relevant features.
  • To improve student model generalization and performance in low-resource settings by aligning only the most predictive knowledge from intermediate layers.
  • To develop a two-stage training framework that first identifies task-relevant features and then distills them efficiently.
  • To demonstrate consistent improvements over existing distillation methods in both continual pre-training and fine-tuning settings.

Proposed method

  • TED introduces task-aware filters for each layer of the student and teacher models, implemented as neural networks with task-specific heads (e.g., softmax for classification).
  • In Stage I, filters are trained to predict the target task’s loss using frozen teacher and student model parameters, learning to extract task-relevant features from hidden representations.
  • In Stage II, the filters are frozen (without task heads), and the student model is jointly fine-tuned with its filters to minimize the MSE between filtered representations of teacher and student at each layer.
  • The distillation loss is defined as the mean squared error between filtered outputs of corresponding teacher and student layers, encouraging alignment on task-specific knowledge.
  • The overall training objective combines the task-specific loss, prediction distillation loss, and the task-aware layer-wise distillation loss with learnable weights.
  • Filters can be implemented as linear projections, MLPs, or Transformer layers, with ablation studies showing performance trade-offs.

Experimental results

Research questions

  • RQ1Can task-aware filtering of intermediate hidden representations improve knowledge distillation efficiency in small student models?
  • RQ2Does filtering out redundant information from teacher representations lead to better student performance compared to standard layer-wise distillation?
  • RQ3How does TED perform across different training paradigms, such as continual pre-training and fine-tuning?
  • RQ4Can the two-stage training framework of filter pre-training followed by distillation yield better alignment and generalization than end-to-end distillation?
  • RQ5What is the impact of different filter architectures (e.g., linear vs. MLP vs. Transformer) on distillation performance?

Key findings

  • TED significantly outperforms standard knowledge distillation and existing layer-wise distillation methods on the GLUE benchmark, especially in low-data regimes.
  • On the SQuAD v1.1 and v2.0 question-answering datasets, TED achieves state-of-the-art results with a DeBERTaV3-xsmall student model distilled from a DeBERTaV3-base teacher.
  • In continual pre-training, TED improves zero-shot and few-shot transfer performance on Lambada and WikiText-103, demonstrating strong generalization.
  • The ablation study shows that task-aware filters reduce the negative impact of redundant knowledge, improving distillation efficiency and student fit.
  • The two-stage training process leads to better convergence and performance than joint training of filters and student from the start.
  • Using more complex filters (e.g., MLPs or Transformers) improves performance over simple linear projections, though with increased computational cost.

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.