Abstract
Deep Neural Networks (DNNs) have become the backbone of modern Natural Language Processing (NLP), yet their computational demands pose significant challenges for real-world deployment. This survey explores Early Exit (EE) strategies, a dynamic inference paradigm that allows models to bypass unnecessary computations for simpler inputs. By integrating intermediate classifiers, Early Exit DNNs (EEDNNs) mitigate "overthinking" and reduce latency, offering a flexible alternative to static model compression techniques.
Introduction: The Computational Tax of Modern NLP
Large-scale models like BERT, GPT, and Llama have revolutionized NLP but come with a heavy "computational tax." Currently, most models treat every input—from a simple greeting to a complex legal document—with the same fixed amount of processing. Researchers at IIT Bombay have surveyed the landscape of Early Exit (EE) strategies, which allow models to "stop thinking" once they reach a sufficient confidence level.
The Problem: Resource Constraints and Overthinking
The authors identify two primary hurdles in deploying modern NLP models:
- Resource Constraints: Large models are difficult to run on mobile or edge devices due to memory and power limitations.
- Overthinking: Standard DNNs are "static," passing every input through every layer. For simple inputs, deep processing is not only inefficient but can lead to "overthinking," where the model overfits to irrelevant features in later layers, potentially reducing accuracy or increasing vulnerability to adversarial attacks.
While techniques like pruning and quantization help, they remain static. EEDNNs offer a dynamic, input-adaptive alternative, tailoring computational effort to the complexity of each specific input.
Methodology of Early Exit DNNs
The core idea of an EEDNN is to attach "side branches" (intermediate classifiers) to various layers of a backbone model. The survey categorizes the methodology into three main pillars:
Training Strategies
- Separate Training: The backbone is trained first and then frozen while intermediate exits are trained, preserving the original model's quality.
- Joint Training: The backbone and all exits are trained simultaneously using a weighted loss function.
Defining Confidence (The "When to Exit" Logic)
Models must decide when an intermediate prediction is "good enough." Common strategies include:
- Individual Confidence: Evaluating the softmax output (max probability) or entropy of a single exit.
- Patience-based: Exiting only when multiple consecutive layers agree on the prediction (e.g., PABEE).
- Ensemble/Similarity-based: Exiting based on aggregated scores or when internal representations (hidden states) stabilize between layers.
Thresholding
Models use a threshold ($\alpha$) to decide if confidence is high enough. The survey highlights a shift from static thresholds to dynamic thresholds that use Multi-Armed Bandits (MAB) to optimize the speed-accuracy trade-off in real-time.
Key Insights and Performance
- The 80/20 Rule: In datasets like SST-2, roughly 80% of samples are "easy" and can be accurately predicted in the earliest layers.
- Efficiency: EEDNNs frequently achieve 2x to 3x speedups in inference latency with negligible (often <1%) loss in accuracy.
- Robustness: By acting as an ensemble of classifiers, EEDNNs are often more robust against adversarial noise targeting specific deep layers.
- The Semantic Gap: Early layers typically capture syntax (grammar), while deeper layers capture semantics (meaning). This explains why Early Exit is highly successful for classification but more challenging for complex generative tasks like summarization.
Limitations and Future Frontiers
Despite their success, several challenges remain:
- Exit Placement: There is no universal formula for optimal exit placement. Adding classifiers to every layer of a massive model like OPT-2.7B can significantly increase the parameter count.
- Generative Complexity: Most research focuses on classification. Applying EE to autoregressive generation (token-by-token output) is difficult due to the high-level semantic requirements of every token.
- "Fake Confidence": A critical risk is when a model becomes highly confident in an incorrect answer at an early layer. Developing "risk-aware" exit strategies is a priority for future research.
Summary updated