Abstract
Early-exit mechanisms allow Large Language Models (LLMs) to terminate computation at intermediate layers when confidence is high, offering significant inference speedups. However, integrating these mechanisms into large-scale models (10B+ parameters) trained with 3D parallelism introduces significant challenges, including training overhead and KV cache management. We present EE-LLM, the first framework to scale early-exit LLMs to tens of billions of parameters. By utilizing idle "bubbles" in pipeline parallelism for auxiliary training and implementing a novel inference strategy to maintain KV cache consistency, EE-LLM achieves up to 2x speedup with negligible training cost and minimal impact on model quality.
Introduction
Standard LLMs process every token through all layers, regardless of complexity. Early-exit architectures aim to reduce this redundancy by allowing "easy" tokens—such as punctuation or common suffixes—to exit early. While effective for smaller models, scaling this to modern 10B+ parameter models requires 3D parallelism (tensor, pipeline, and data parallelism). Existing frameworks like Megatron-LM struggle with the communication overhead of multiple exit points and the disruption of the KV cache during early-exit inference. EE-LLM addresses these bottlenecks to bring early-exit efficiency to the largest models.
Architecture and Training Methodology
EE-LLM introduces minimalistic exit layers consisting of an output embedding and an optional layer norm. To minimize training overhead, the framework employs a lightweight backpropagation strategy where each GPU calculates local gradients for its early exits, avoiding expensive cross-stage communication.
A key innovation is "Bubble Filling." In pipeline parallelism, GPUs often experience idle periods or "bubbles" due to load imbalances. EE-LLM schedules the forward and backward passes of early-exit layers to occur during these bubbles, rendering the additional training cost nearly zero. This approach transforms idle hardware time into productive training for the auxiliary exit branches.
Efficient Inference and the KV Cache Conflict
Early exiting typically breaks the KV cache, as skipped layers do not generate the data needed for subsequent tokens. EE-LLM solves this with a novel pipeline-parallel inference strategy: when an early exit is triggered, the next token begins processing immediately on the first GPU. Simultaneously, the remaining layers for the current token continue in the background solely to populate the KV cache, ensuring future tokens have access to necessary historical data without stalling the pipeline.
Experimental Results
The framework was tested on models up to 30B parameters. Pre-training was conducted on the Data-Juicer corpus, and evaluation spanned the HELM benchmark, including tasks like question answering (BoolQ, TruthfulQA) and summarization (XSUM, CNN/DailyMail).
- Scale: Successfully trained models up to 30B parameters, a significant jump from previous 13B caps.
- Inference Speedup: Achieved 2x or higher speedup across various tasks while maintaining comparable evaluation scores.
- Training Efficiency: A 7B model with two early exits showed only a ~1% increase in training time per iteration compared to a standard model.
- Quality Preservation: Deep supervision from early exits often maintained or slightly improved final model accuracy.
Conclusion
EE-LLM successfully scales early-exit efficiency to large-scale LLMs. By harmonizing architectural exits with pipeline parallelism, it provides a "free lunch" in training and significant gains in inference throughput. Future work will explore more sophisticated, learnable exit policies and complex exit module architectures to further optimize the speed-to-quality trade-off.
Summary updated