Lune

ACL2020Top-tier venue

The Right Tool for the Job: Matching Model and Instance Complexities

Roy Schwartz, Gabriel Stanovsky, Swabha Swayamdipta, Jesse Dodge, Noah A. Smith

Abstract

As NLP models become larger, executing a trained model requires significant computational resources incurring monetary and environmental costs. To better respect a given inference budget, we propose a modification to contextual representation fine-tuning which, during inference, allows for an early (and fast) "exit" from neural network calculations for simple instances, and late (and accurate) exit for hard instances. To achieve this, we add classifiers to different layers of BERT and use their calibrated confidence scores to make early exit decisions. We test our proposed modification on five different datasets in two tasks: three text classification datasets and two natural language inference benchmarks. Our method presents a favorable speed/accuracy tradeoff in almost all cases, producing models which are up to five times faster than the state of the art, while preserving their accuracy. Our method also requires almost no additional training resources (in either time or parameters) compared to the baseline BERT model. Finally, our method alleviates the need for costly retraining of multiple models at different levels of efficiency; we allow users to control the inference speed/accuracy tradeoff using a single trained model, by setting a single variable at inference time. We publicly release our code. 1 * Research completed during an internship at AI2.

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.

53 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

  • TinyBERT: Distilling BERT for Natural Language Understanding cites Depth-Adaptive Transformer
  • TinyBERT: Distilling BERT for Natural Language Understanding cites Q-BERT: Hessian Based Ultra Low Precision Quantization of BERT
  • TinyBERT: Distilling BERT for Natural Language Understanding cites Reducing Transformer Depth on Demand with Structured Dropout
  • BERT Loses Patience: Fast and Robust Inference with Early Exit cites Reducing Transformer Depth on Demand with Structured Dropout
  • Think before you speak: Training Language Models With Pause Tokens cites Confident Adaptive Language Modeling
  • A-ViT: Adaptive Tokens for Efficient Vision Transformer cites TinyBERT: Distilling BERT for Natural Language Understanding
  • A-ViT: Adaptive Tokens for Efficient Vision Transformer cites BERT Loses Patience: Fast and Robust Inference with Early Exit
  • A-ViT: Adaptive Tokens for Efficient Vision Transformer cites Depth-Adaptive Transformer
  • Confident Adaptive Language Modeling cites BERT Loses Patience: Fast and Robust Inference with Early Exit
  • Confident Adaptive Language Modeling cites Depth-Adaptive Transformer
  • Confident Adaptive Language Modeling cites Q-BERT: Hessian Based Ultra Low Precision Quantization of BERT
  • Confident Adaptive Language Modeling cites Reducing Transformer Depth on Demand with Structured Dropout
  • Fast Inference from Transformers via Speculative Decoding cites Depth-Adaptive Transformer
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers53

  1. Fast Inference from Transformers via Speculative DecodingYaniv Leviathan, Matan Kalman, Yossi MatiasICML 2023 · 1,472 citations
  2. BERT Loses Patience: Fast and Robust Inference with Early ExitWangchunshu Zhou, Canwen Xu, Tao Ge, Julian J. McAuley et al.NeurIPS 2020 · 473 citations
  3. Confident Adaptive Language ModelingTal Schuster, Adam Fisch, Jai Gupta, Mostafa Dehghani et al.NeurIPS 2022 · 394 citations
  4. A-ViT: Adaptive Tokens for Efficient Vision TransformerHongxu Yin, Arash Vahdat, José M. Álvarez, Arun Mallya et al.CVPR 2022 · 288 citations
  5. Think before you speak: Training Language Models With Pause TokensSachin Goyal, Ziwei Ji, Ankit Singh Rawat, Aditya Krishna Menon et al.ICLR 2024 · 240 citations

Builds on6

  1. WinoGrande: An Adversarial Winograd Schema Challenge at ScaleKeisuke Sakaguchi, Ronan Le Bras, Chandra Bhagavatula, Yejin ChoiAAAI 2020 · 3,037 citations
  2. TinyBERT: Distilling BERT for Natural Language UnderstandingXiaoqi Jiao, Yichun Yin, Lifeng Shang, Xin Jiang et al.EMNLP Findings 2020 · 1,787 citations
  3. Reducing Transformer Depth on Demand with Structured DropoutAngela Fan, Edouard Grave, Armand JoulinICLR 2020 · 695 citations
  4. Q-BERT: Hessian Based Ultra Low Precision Quantization of BERTSheng Shen, Zhen Dong, Jiayu Ye, Linjian Ma et al.AAAI 2020 · 656 citations
  5. Depth-Adaptive TransformerMaha Elbayad, Jiatao Gu, Edouard Grave, Michael AuliICLR 2020 · 264 citations

Related papers

  1. Finding the SWEET Spot: Analysis and Improvement of Adaptive Inference in Low Resource SettingsDaniel Rotem, Michael Hassid, Jonathan Mamou, Roy SchwartzACL 2023 · 1 citation
  2. SkipBERT: Efficient Inference with Shallow Layer SkippingJue Wang, Ke Chen, Gang Chen, Lidan Shou et al.ACL 2022
  3. CascadeBERT: Accelerating Inference of Pre-trained Language Models via Calibrated Complete Models CascadeLei Li, Yankai Lin, Deli Chen, Shuhuai Ren et al.EMNLP Findings 2021 · 33 citations
  4. LeeBERT: Learned Early Exit for BERT with cross-level optimizationWei ZhuACL 2021
  5. CeeBERT: Cross-Domain Inference in Early Exit BERTDivya Jyoti Bajpai, Manjesh K. HanawalACL Findings 2024 · 11 citations
Dusk over the sea between two cliffs drawn in fine vertical lines