[Paper Review] Accelerating Pre-trained Language Models via Calibrated Cascade.
This paper proposes CascadeBERT, a calibrated cascade method that accelerates pre-trained language models by dynamically selecting a complete, progressively larger model in a cascading manner, using a difficulty-aware objective to improve prediction reliability. Experiments show it outperforms dynamic early exiting and knowledge distillation baselines in speed-accuracy trade-offs.
Dynamic early exiting aims to accelerate pre-trained language models' (PLMs) inference by exiting in shallow layer without passing through the entire model. In this paper, we analyze the working mechanism of dynamic early exiting and find it cannot achieve a satisfying trade-off between inference speed and performance. On one hand, the PLMs' representations in shallow layers are not sufficient for accurate prediction. One the other hand, the internal off-ramps cannot provide reliable exiting decisions. To remedy this, we instead propose CascadeBERT, which dynamically selects a proper-sized, complete model in a cascading manner. To obtain more reliable model selection, we further devise a difficulty-aware objective, encouraging the model output class probability to reflect the real difficulty of each instance. Extensive experimental results demonstrate the superiority of our proposal over strong baseline models of PLMs' acceleration including both dynamic early exiting and knowledge distillation methods.
Motivation & Objective
- To address the limitations of dynamic early exiting in pre-trained language models, which suffers from insufficient representation in shallow layers and unreliable exit decisions.
- To improve the reliability of model selection during inference by replacing ad hoc early exits with a cascading selection of complete, progressively larger models.
- To design a difficulty-aware objective that aligns model confidence with the true instance difficulty, enhancing prediction reliability.
- To achieve a better balance between inference speed and model performance than existing acceleration techniques like dynamic early exiting and knowledge distillation.
Proposed method
- Proposes a cascading inference framework where each stage uses a complete, progressively larger pre-trained model instead of early exits at shallow layers.
- Introduces a difficulty-aware objective that encourages model output probabilities to reflect the true difficulty of input instances, improving exit decision reliability.
- Calibrates the confidence of predictions across cascade stages to ensure that higher-confidence outputs correspond to more difficult instances.
- Trains the cascade model end-to-end with a loss function that combines standard cross-entropy and a difficulty-aware regularization term.
- Uses a confidence thresholding mechanism to select the smallest complete model in the cascade that achieves sufficient prediction confidence.
- Employs a multi-stage inference pipeline where each stage processes the input through a full transformer block stack, avoiding partial inference.
Experimental results
Research questions
- RQ1Can a cascading selection of complete models outperform dynamic early exiting in balancing inference speed and accuracy?
- RQ2How does incorporating a difficulty-aware objective improve the reliability of model selection decisions in accelerated inference?
- RQ3To what extent does the proposed method reduce inference time while maintaining or improving model performance compared to knowledge distillation?
- RQ4Does the calibrated confidence output across cascade stages correlate with actual instance difficulty?
- RQ5How does the method scale across different model sizes and downstream NLP tasks?
Key findings
- CascadeBERT achieves a better speed-accuracy trade-off than dynamic early exiting methods, which often sacrifice accuracy for speed due to shallow representations.
- The difficulty-aware objective improves the reliability of model selection by aligning prediction confidence with actual instance difficulty.
- The method outperforms knowledge distillation baselines in both inference speed and accuracy across multiple downstream NLP tasks.
- The cascading mechanism with complete models reduces the risk of incorrect early exits compared to shallow-layer early exiting.
- Empirical results show significant speedups with minimal accuracy drop, especially on harder instances where higher-stage models are selected.
- The calibrated confidence scores across cascade stages demonstrate strong correlation with instance difficulty, validating the design objective.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.