Lune

ACL2021Top-tier venue

Length-Adaptive Transformer: Train Once with Length Drop, Use Anytime with Search

Gyuwan Kim, Kyunghyun Cho

Abstract

Despite transformers' impressive accuracy, their computational cost is often prohibitive to use with limited computational resources. Most previous approaches to improve inference efficiency require a separate model for each possible computational budget. In this paper, we extend PoWER-BERT (Goyal et al., 2020) and propose Length-Adaptive Transformer that can be used for various inference scenarios after one-shot training. We train a transformer with LengthDrop, a structural variant of dropout, which stochastically determines a sequence length at each layer. We then conduct a multi-objective evolutionary search to find a length configuration that maximizes the accuracy and minimizes the efficiency metric under any given computational budget. Additionally, we significantly extend the applicability of PoWER-BERT beyond sequence-level classification into tokenlevel classification with Drop-and-Restore process that drops word-vectors temporarily in intermediate layers and restores at the last layer if necessary. We empirically verify the utility of the proposed approach by demonstrating the superior accuracy-efficiency trade-off under various setups, including span-based question answering and text classification. Code is available at https://github.com/clovaai/length- adaptive-transformer.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

31 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Learned Token Pruning for Transformers cites Big Bird: Transformers for Longer Sequences
  • Deberta: decoding-Enhanced Bert with Disentangled Attention cites Language Models are Few-Shot Learners
  • An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale cites Language Models are Few-Shot Learners
  • A Survey on Model Compression and Acceleration for Pretrained Language Models cites Learned Token Pruning for Transformers
  • Confident Adaptive Language Modeling cites Language Models are Few-Shot Learners
  • Training data-efficient image transformers & distillation through attention cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Token Merging: Your ViT But Faster cites Learned Token Pruning for Transformers
  • Token Merging: Your ViT But Faster cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Token Merging: Your ViT But Faster cites Training data-efficient image transformers & distillation through attention
  • LLMLingua: Compressing Prompts for Accelerated Inference of Large Language Models cites Learned Token Pruning for Transformers
  • LLMLingua: Compressing Prompts for Accelerated Inference of Large Language Models cites Token Merging: Your ViT But Faster
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers31

  1. Confident Adaptive Language ModelingTal Schuster, Adam Fisch, Jai Gupta, Mostafa Dehghani et al.NeurIPS 2022 · 394 citations
  2. Learned Token Pruning for TransformersSehoon Kim, Sheng Shen, David Thorsley, Amir Gholami et al.KDD 2022 · 97 citations
  3. A Survey on Model Compression and Acceleration for Pretrained Language ModelsCanwen Xu, Julian J. McAuleyAAAI 2023 · 96 citations
  4. LLMLingua: Compressing Prompts for Accelerated Inference of Large Language ModelsHuiqiang Jiang, Qianhui Wu, Chin-Yew Lin, Yuqing Yang et al.EMNLP 2023 · 94 citations
  5. Token Merging: Your ViT But FasterDaniel Bolya, Cheng-Yang Fu, Xiaoliang Dai, Peizhao Zhang et al.ICLR 2023 · 62 citations

Builds on22

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
  2. An Image is Worth 16x16 Words: Transformers for Image Recognition at ScaleAlexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn et al.ICLR 2021 · 21,477 citations
  3. Training data-efficient image transformers & distillation through attentionHugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa et al.ICML 2021 · 8,974 citations
  4. Deberta: decoding-Enhanced Bert with Disentangled AttentionPengcheng He, Xiaodong Liu, Jianfeng Gao, Weizhu ChenICLR 2021 · 3,729 citations
  5. Big Bird: Transformers for Longer SequencesManzil Zaheer, Guru Guruganesh, Kumar Avinava Dubey, Joshua Ainslie et al.NeurIPS 2020 · 3,159 citations

Related papers

  1. Token Dropping for Efficient BERT PretrainingLe Hou, Richard Yuanzhe Pang, Tianyi Zhou, Yuexin Wu et al.ACL 2022
  2. Learning What to Remember: Adaptive Probabilistic Memory Retention for Memory-Efficient Language ModelsS. M. Rafiuddin, Muntaha Nujat KhanEMNLP Findings 2025 · 1 citation
  3. Adaptive Computation Modules: Granular Conditional Computation for Efficient InferenceBartosz Wójcik, Alessio Devoto, Karol Pustelnik, Pasquale Minervini et al.AAAI 2025 · 8 citations
  4. Accelerating Training of Transformer-Based Language Models with Progressive Layer DroppingMinjia Zhang, Yuxiong HeNeurIPS 2020 · 126 citations
  5. Effective Pretraining Objectives for Transformer-based AutoencodersLuca Di Liello, Matteo Gabburo, Alessandro MoschittiEMNLP Findings 2022 · 5 citations
Dusk over the sea between two cliffs drawn in fine vertical lines