Skip to main content
QUICK REVIEW

[Paper Review] AdaBERT: Task-Adaptive BERT Compression with Differentiable Neural Architecture Search

Daoyuan Chen, Yaliang Li|arXiv (Cornell University)|Jan 13, 2020
Topic ModelingComputer Science41 references24 citations
TL;DR

AdaBERT proposes a task-adaptive BERT compression method using differentiable neural architecture search (NAS) that jointly optimizes for model efficiency and task-specific performance. By incorporating task-oriented knowledge distillation and an efficiency-aware loss, AdaBERT achieves 12.7x to 29.3x faster inference and 11.5x to 17.0x smaller model size than BERT while maintaining comparable accuracy across multiple NLP tasks.

ABSTRACT

Large pre-trained language models such as BERT have shown their effectiveness in various natural language processing tasks. However, the huge parameter size makes them difficult to be deployed in real-time applications that require quick inference with limited resources. Existing methods compress BERT into small models while such compression is task-independent, i.e., the same compressed BERT for all different downstream tasks. Motivated by the necessity and benefits of task-oriented BERT compression, we propose a novel compression method, AdaBERT, that leverages differentiable Neural Architecture Search to automatically compress BERT into task-adaptive small models for specific tasks. We incorporate a task-oriented knowledge distillation loss to provide search hints and an efficiency-aware loss as search constraints, which enables a good trade-off between efficiency and effectiveness for task-adaptive BERT compression. We evaluate AdaBERT on several NLP tasks, and the results demonstrate that those task-adaptive compressed models are 12.7x to 29.3x faster than BERT in inference time and 11.5x to 17.0x smaller in terms of parameter size, while comparable performance is maintained.

Motivation & Objective

  • To address the inefficiency of deploying large pre-trained BERT models in real-time applications with limited resources.
  • To overcome the limitation of existing BERT compression methods that produce task-independent models unsuitable for task-specific optimization.
  • To develop an automated, efficient, and effective method for compressing BERT into task-adaptive small models using neural architecture search.
  • To balance model efficiency and performance by integrating task-specific knowledge distillation and efficiency-aware constraints during search.

Proposed method

  • AdaBERT employs differentiable neural architecture search (NAS) to automatically discover task-adaptive BERT compression architectures.
  • It uses a task-oriented knowledge distillation loss based on intermediate hidden states and logits from a fine-tuned BERT model to guide architecture search.
  • An efficiency-aware loss term is introduced to constrain the search space based on model size and inference speed, explicitly modeling efficiency metrics.
  • The search space is hierarchically reduced using probe models that extract task-specific knowledge from BERT’s general representations.
  • Discrete architecture parameters are relaxed into continuous distributions, enabling gradient-based optimization for efficient architecture search.
  • The overall loss function combines cross-entropy loss (for task accuracy), knowledge distillation loss (for knowledge transfer), and efficiency-aware loss (for model efficiency).

Experimental results

Research questions

  • RQ1Can differentiable neural architecture search be effectively applied to compress BERT into task-adaptive models that outperform task-independent compression?
  • RQ2How does incorporating task-specific knowledge distillation improve the performance of compressed BERT models across diverse NLP tasks?
  • RQ3What is the impact of efficiency-aware loss on the trade-off between model size, inference speed, and accuracy in compressed BERT models?
  • RQ4To what extent can AdaBERT reduce model size and inference time while maintaining competitive performance on downstream NLP tasks?

Key findings

  • AdaBERT achieves 12.7x to 29.3x faster inference speed compared to BERT across multiple NLP tasks.
  • The compressed models are 11.5x to 17.0x smaller in parameter count than BERT, significantly reducing model footprint.
  • With a moderate efficiency coefficient (β=4), AdaBERT achieves a balanced trade-off between model size and performance, outperforming both unconstrained and overly aggressive efficiency settings.
  • The ablation study confirms that combining knowledge distillation with supervised label loss improves performance, especially on low-resource tasks like MRPC and RTE.
  • Data augmentation further enhances performance on small-scale datasets by enriching task-oriented knowledge during distillation.
  • The method successfully identifies task-specific optimal architectures, demonstrating the effectiveness of task-adaptive compression over static compression approaches.

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.