LayerSkip: Enabling Early Exit Inference and Self-Speculative Decoding
Mostafa Elhoushi, Akshat Shrivastava, Diana Liskovich, Basil Hosmer,, Bram Wasti, Liangzhen Lai, Anas Mahmoud, Bilge Acun, Saurabh Agarwal, Ahmed, Roman, Ahmed A Aly, Beidi Chen, Carole-Jean Wu

TL;DR
LayerSkip introduces a training and inference method for large language models that enables early exit during inference, significantly speeding up tasks like summarization and coding without extra model complexity.
Contribution
The paper proposes a novel training recipe and a self-speculative decoding approach that allow early exit inference in LLMs, improving speed without additional model modules.
Findings
Achieved up to 2.16x speedup on summarization tasks
Improved early exit accuracy during training
Reduced memory footprint compared to other speculative decoding methods
Abstract
We present LayerSkip, an end-to-end solution to speed-up inference of large language models (LLMs). First, during training we apply layer dropout, with low dropout rates for earlier layers and higher dropout rates for later layers, and an early exit loss where all transformer layers share the same exit. Second, during inference, we show that this training recipe increases the accuracy of early exit at earlier layers, without adding any auxiliary layers or modules to the model. Third, we present a novel self-speculative decoding solution where we exit at early layers and verify and correct with remaining layers of the model. Our proposed self-speculative decoding approach has less memory footprint than other speculative decoding approaches and benefits from shared compute and activations of the draft and verification stages. We run experiments on different Llama model sizes on different…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
- 🤗facebook/layerskip-llama2-7Bmodel· 127 dl· ♡ 15127 dl♡ 15
- 🤗facebook/layerskip-llama2-13Bmodel· 298 dl· ♡ 5298 dl♡ 5
- 🤗facebook/layerskip-codellama-7Bmodel· 38 dl· ♡ 638 dl♡ 6
- 🤗facebook/layerskip-codellama-34Bmodel· 53 dl· ♡ 453 dl♡ 4
- 🤗facebook/layerskip-llama3-8Bmodel· 642 dl· ♡ 20642 dl♡ 20
- 🤗facebook/layerskip-llama3.2-1Bmodel· 4.6k dl· ♡ 244.6k dl♡ 24
- 🤗facebook/layerskip-llama2-70Bmodel· 76 dl· ♡ 576 dl♡ 5
- 🤗RichardErkhov/facebook_-_layerskip-llama3.2-1B-ggufmodel· 141 dl141 dl
- 🤗alvanlii/canto-llasa-1bmodel· 14 dl14 dl
- 🤗Ram07/bitskip-v1-earlyexitmodel
Videos
Taxonomy
TopicsParallel Computing and Optimization Techniques
MethodsLayerDrop · Early exiting using confidence measures · LLaMA · Dropout
