Skip to main content
QUICK REVIEW

[Paper Review] A Survey of Techniques for Optimizing Transformer Inference

Krishna Teja Chitty-Venkata, Sparsh Mittal|arXiv (Cornell University)|Jul 16, 2023
Neural Networks and ApplicationsComputer Science8 citations
TL;DR

This survey compiles and categorizes methods to optimize transformer inference, covering algorithmic compression (distillation, pruning, quantization, NAS) and hardware accelerators, with tradeoffs in accuracy, latency, and energy.

ABSTRACT

Recent years have seen a phenomenal rise in performance and applications of transformer neural networks. The family of transformer networks, including Bidirectional Encoder Representations from Transformer (BERT), Generative Pretrained Transformer (GPT) and Vision Transformer (ViT), have shown their effectiveness across Natural Language Processing (NLP) and Computer Vision (CV) domains. Transformer-based networks such as ChatGPT have impacted the lives of common men. However, the quest for high predictive performance has led to an exponential increase in transformers' memory and compute footprint. Researchers have proposed techniques to optimize transformer inference at all levels of abstraction. This paper presents a comprehensive survey of techniques for optimizing the inference phase of transformer networks. We survey techniques such as knowledge distillation, pruning, quantization, neural architecture search and lightweight network design at the algorithmic level. We further review hardware-level optimization techniques and the design of novel hardware accelerators for transformers. We summarize the quantitative results on the number of parameters/FLOPs and accuracy of several models/techniques to showcase the tradeoff exercised by them. We also outline future directions in this rapidly evolving field of research. We believe that this survey will educate both novice and seasoned researchers and also spark a plethora of research efforts in this field.

Motivation & Objective

  • Motivate the need for efficient transformer inference due to increasing model sizes and deployment demands.
  • Survey algorithmic techniques for reducing model size and compute (distillation, pruning, quantization, NAS, lightweight design).
  • Survey hardware-aware optimization and accelerator design for transformers.
  • Provide taxonomy, practical tradeoffs, and quantitative insights on parameters, FLOPs, and accuracy.
  • Outline future directions for co-design and benchmarks in transformer inference.

Proposed method

  • Present background on transformer fundamentals including embedding, self-attention, MHA, and FFN.
  • Classify and survey distillation, pruning, quantization, NAS, and lightweight architecture methods for NLP and vision transformers.
  • Discuss hardware optimization and design of accelerators (ASIC/FPGA/GPU) for transformers and co-design considerations.
  • Provide taxonomies and tradeoffs with quantitative results (parameters/FLOPs vs accuracy).
  • Summarize challenges and future research directions in hardware-software co-design and benchmarks.

Experimental results

Research questions

  • RQ1What are the main algorithmic techniques for reducing transformer inference cost and their respective tradeoffs in accuracy and latency?
  • RQ2How do pruning, quantization, knowledge distillation, and NAS compare in terms of hardware compatibility and deployment efficiency?
  • RQ3What are the hardware acceleration strategies and co-design opportunities to optimize transformer inference on modern devices?
  • RQ4What future directions and benchmarks are needed to advance efficient transformer inference?

Key findings

  • Knowledge distillation can yield smaller models with substantial speedups (e.g., DistilBERT preserves ~97% of language capabilities with ~40% smaller size).
  • Pruning can achieve significant latency reductions (e.g., oBERT 10× speedup on Intel CPU with <1% accuracy loss) while hardware-aware strategies improve real-world gains.
  • Quantization can reduce model size by up to 4× (e.g., Q8BERT from 32-bit to 8-bit) with minimal accuracy loss.
  • Hardware-aware neural architecture search (HW-NAS) can yield transformers with better validation metrics and lower latency across CPU/GPU/mobile.
  • The survey emphasizes that naive pruning without hardware-conscious design may fail to deliver latency/energy benefits, underscoring the need for co-design.
  • The paper provides a taxonomy of optimization techniques and discusses future directions such as new hardware architectures and benchmarks.

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.