Skip to main content
QUICK REVIEW

[Paper Review] Finding Fast Transformers: One-Shot Neural Architecture Search by Component Composition

Henry Tsai, Jayden Ooi|arXiv (Cornell University)|Aug 15, 2020
Topic ModelingComputer Science21 references12 citations
TL;DR

This paper proposes a one-shot neural architecture search method that composes fast Transformer models by sampling from component-level architectural choices, optimizing for inference speed while maintaining high accuracy. By reparameterizing BERT into modular components and using a sampling-based search with profiling-aware objectives, the method achieves 10–30% speedup on BERT-base and up to 70% speedup on distilled models with minimal accuracy drop.

ABSTRACT

Transformer-based models have achieved stateof-the-art results in many tasks in natural language processing. However, such models are usually slow at inference time, making deployment difficult. In this paper, we develop an efficient algorithm to search for fast models while maintaining model quality. We describe a novel approach to decompose the Transformer architecture into smaller components, and propose a sampling-based one-shot architecture search method to find an optimal model for inference. The model search process is more efficient than alternatives, adding only a small overhead to training time. By applying our methods to BERT-base architectures, we achieve 10% to 30% speedup for pre-trained BERT and 70% speedup on top of a previous state-of-the-art distilled BERT model on Cloud TPU-v2 with a generally acceptable drop in performance.

Motivation & Objective

  • To develop an efficient method for searching fast Transformer architectures without sacrificing model quality.
  • To address the challenge of slow inference in state-of-the-art Transformer models, especially in real-world deployment scenarios.
  • To enable one-shot architecture search that minimizes training overhead while directly optimizing for inference speed.
  • To explore how architectural components can be composed to yield faster models across diverse NLP tasks.
  • To demonstrate that component-wise search outperforms traditional search methods in speed and efficiency.

Proposed method

  • The Transformer architecture is decomposed into modular components, including attention heads, feedforward layers, and normalization layers, each of which can be independently scaled or pruned.
  • A sampling-based one-shot search algorithm is proposed to explore architectural combinations in a single training run, avoiding the need for multiple training cycles.
  • The search objective integrates external computation profiling data to directly optimize for inference speed, rather than relying on proxy metrics like FLOPs.
  • Component-level hyperparameters (e.g., width and depth) are sampled simultaneously, enabling joint optimization of model depth and width.
  • The method supports both training from scratch and integration with knowledge distillation, allowing for efficient fine-tuning of distilled models.
  • The search process uses a differentiable sampling strategy with regularization to encourage efficient, high-speed architectures.

Experimental results

Research questions

  • RQ1Can a one-shot architecture search method be designed to efficiently explore depth and width trade-offs in Transformers while minimizing training overhead?
  • RQ2How effective is component-wise architectural composition in achieving faster inference without significant accuracy degradation?
  • RQ3Does integrating real hardware profiling data into the search objective lead to better inference speed compared to FLOP-based objectives?
  • RQ4Can the proposed method improve both pre-trained and distilled BERT models across diverse NLP tasks?
  • RQ5How do architectural choices differ across tasks with varying complexity, such as part-of-speech tagging versus morphology?

Key findings

  • The method achieves 10–30% inference speedup on pre-trained BERT-base models with only a 0.5–1.0% drop in accuracy on downstream tasks.
  • On a distilled BERT model, the method achieves up to 70% speedup (3.5x faster than the baseline) while maintaining comparable accuracy.
  • The selected architectures vary significantly across tasks: morphology tasks requiring 1000+ classes require larger models than part-of-speech tagging, which demands smaller, faster models.
  • The SDO (sampling-based direct optimization) algorithm outperforms DO (dropout-based) in speedup, achieving 36x speedup on morphology tasks versus 33x with DO, with similar accuracy.
  • The search process adds only 1.4x training time overhead and minimal memory cost, making it practical for large models.
  • The method enables a 1.7x speedup over the previous state-of-the-art distilled BERT model, with no need for retraining when using SDO-R, saving 2x training resources.

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.