English

Constraint-aware and Ranking-distilled Token Pruning for Efficient Transformer Inference

Computation and Language 2023-06-27 v1

Abstract

Deploying pre-trained transformer models like BERT on downstream tasks in resource-constrained scenarios is challenging due to their high inference cost, which grows rapidly with input sequence length. In this work, we propose a constraint-aware and ranking-distilled token pruning method ToP, which selectively removes unnecessary tokens as input sequence passes through layers, allowing the model to improve online inference speed while preserving accuracy. ToP overcomes the limitation of inaccurate token importance ranking in the conventional self-attention mechanism through a ranking-distilled token distillation technique, which distills effective token rankings from the final layer of unpruned models to early layers of pruned models. Then, ToP introduces a coarse-to-fine pruning approach that automatically selects the optimal subset of transformer layers and optimizes token pruning decisions within these layers through improved L0L_0 regularization. Extensive experiments on GLUE benchmark and SQuAD tasks demonstrate that ToP outperforms state-of-the-art token pruning and model compression methods with improved accuracy and speedups. ToP reduces the average FLOPs of BERT by 8.1x while achieving competitive accuracy on GLUE, and provides a real latency speedup of up to 7.4x on an Intel CPU.

Keywords

Cite

@article{arxiv.2306.14393,
  title  = {Constraint-aware and Ranking-distilled Token Pruning for Efficient Transformer Inference},
  author = {Junyan Li and Li Lyna Zhang and Jiahang Xu and Yujing Wang and Shaoguang Yan and Yunqing Xia and Yuqing Yang and Ting Cao and Hao Sun and Weiwei Deng and Qi Zhang and Mao Yang},
  journal= {arXiv preprint arXiv:2306.14393},
  year   = {2023}
}

Comments

KDD 2023

R2 v1 2026-06-28T11:14:05.236Z