Skip to main content
QUICK REVIEW

[Paper Review] Lite Transformer with Long-Short Range Attention

Zhanghao Wu, Zhijian Liu|arXiv (Cornell University)|Apr 24, 2020
Topic ModelingComputer Science130 citations
TL;DR

Lite Transformer introduces a two-branch Long-Short Range Attention (LSRA) to model local and global context separately, delivering mobile-friendly NLP with BLEU gains over the Transformer under constrained compute. It also enables significant model size reductions and outperforms AutoML-searched baselines without heavy design costs.

ABSTRACT

Transformer has become ubiquitous in natural language processing (e.g., machine translation, question answering); however, it requires enormous amount of computations to achieve high performance, which makes it not suitable for mobile applications that are tightly constrained by the hardware resources and battery. In this paper, we present an efficient mobile NLP architecture, Lite Transformer to facilitate deploying mobile NLP applications on edge devices. The key primitive is the Long-Short Range Attention (LSRA), where one group of heads specializes in the local context modeling (by convolution) while another group specializes in the long-distance relationship modeling (by attention). Such specialization brings consistent improvement over the vanilla transformer on three well-established language tasks: machine translation, abstractive summarization, and language modeling. Under constrained resources (500M/100M MACs), Lite Transformer outperforms transformer on WMT'14 English-French by 1.2/1.7 BLEU, respectively. Lite Transformer reduces the computation of transformer base model by 2.5x with 0.3 BLEU score degradation. Combining with pruning and quantization, we further compressed the model size of Lite Transformer by 18.2x. For language modeling, Lite Transformer achieves 1.8 lower perplexity than the transformer at around 500M MACs. Notably, Lite Transformer outperforms the AutoML-based Evolved Transformer by 0.5 higher BLEU for the mobile NLP setting without the costly architecture search that requires more than 250 GPU years. Code has been made available at https://github.com/mit-han-lab/lite-transformer.

Motivation & Objective

  • Motivate efficient NLP inference on edge devices under strict compute constraints.
  • Design a lightweight transformer architecture that preserves or improves performance under 500M Mult-Adds.
  • Introduce LSRA to replace bottleneck attention with specialized local and global branches.
  • Demonstrate that LSRA enables compression (pruning/quantization) with substantial size reductions.
  • Compare performance and costs against AutoML-based baselines (Evolved Transformer) under mobile settings.

Proposed method

  • Propose Long-Short Range Attention (LSRA) with two parallel branches: a global-attention branch and a local-convolution branch.
  • Split input channels to feed the two branches, then fuse via an FFN, effectively halving the per-branch computation.
  • Replace the conventional bottleneck in Transformer blocks by flattening channel dimensions to emphasize attention in the model capacity.
  • Use a lightweight convolutional module in the local branch (depthwise-like, parameter-efficient) to capture local context.
  • Train and evaluate Lite Transformer on MT (IWSLT, WMT) and additional tasks (abstractive summarization, language modeling) with mobile-constraint budgets (≤500M Mult-Adds).
  • Compare against Transformer baselines and Evolved Transformer, and analyze compression via pruning and quantization.

Experimental results

Research questions

  • RQ1Can LSRA improve efficiency of transformer-based models under mobile resource constraints without sacrificing MT and language tasks performance?
  • RQ2How does Lite Transformer perform on MT, summarization, and language modeling compared to the standard Transformer and AutoML-based baselines under similar compute budgets?
  • RQ3What are the effects of combining Lite Transformer with standard compression techniques (pruning, quantization) on model size and performance?

Key findings

  • Lite Transformer achieves BLEU improvements over the Transformer under mobile settings across key MT benchmarks: +1.2 BLEU on WMT En-De under 500M Mult-Adds and +1.7 BLEU under 100M Mult-Adds; +1.7 BLEU on WMT En-Fr under 100M Mult-Adds and +1.2 BLEU under 500M Mult-Adds.
  • On IWSLT De-En, Lite Transformer outperforms the Transformer baseline by about 1.6 BLEU at around 100M Mult-Adds.
  • Lite Transformer reduces computation by up to ~2.4x for CNN-DailyMail summarization and by ~1.8x perplexity for language modeling at ~500M Mult-Adds, compared to Transformer baselines.
  • When combined with pruning and 8-bit quantization, the model size can be compressed by up to 18.2x with negligible BLEU degradation on WMT En-Fr.
  • Against AutoML-based Evolved Transformer, Lite Transformer delivers 0.5 BLEU higher on WMT En-De under mobile settings, without the large search cost (GPU years and CO2 emissions).
  • Overall, LSRA’s specialization into global and local context improves efficiency and scalability for mobile NLP while maintaining or exceeding baseline performance.

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.