Learned Token Pruning for Transformers

By Sehoon Kim, Sheng Shen, David Thorsley, A. Gholami, Joseph Hassoun, Kurt Keutzer. 2021

225 citations recorded by the source corpus.

Efficient deployment of transformer models in practice is challenging due to their inference cost including memory footprint, latency, and power consumption, which scales quadratically with input sequence length. To address this, we present a novel token reduction method dubbed Learned Token Pruning (LTP) which adaptively removes unimportant tokens as an input sequence passes through transformer layers. In particular, LTP prunes tokens with an attention score below a threshold, whose value is learned for each layer during training. Our threshold-based method allows the length of the pruned sequence to vary adaptively based on the input sequence, and avoids algorithmically expensive operations such as top-k token selection. We extensively test the performance of LTP on GLUE and SQuAD tasks and show that our method outperforms the prior state-of-the-art token pruning methods by up to ∽2.5% higher accuracy with the same amount of FLOPs. In particular, LTP achieves up to 2.1× FLOPs reduction with less than 1% accuracy drop, which results in up to 1.9× and 2.0× throughput improvement on Intel Haswell CPUs and NVIDIA V100 GPUs. Furthermore, we demonstrate that LTP is more robust than prior methods to variations in input sequence lengths. Our code has been developed in PyTorch and open-sourced

Subfields: Computer Networks and Communications, Computer Vision and Pattern Recognition, Hardware and Architecture

How researchers see this paper

The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.

In Computer Networks and Communications

  1. Christoph Feichtenhofer
  2. Julian McAuley
  3. Matthieu Cord

In Computer Vision and Pattern Recognition

  1. Luc Van Gool
  2. Matthieu Cord
  3. Ming-Hsuan Yang
  4. Dacheng Tao
  5. Bernt Schiele
  6. Trevor Darrell
  7. Xiaogang Wang
  8. Jitendra Malik

In Hardware and Architecture

  1. Judy Hoffman

Citations in the corpus