Enabling Early Exit Inference and Self-Speculative Decoding


View a PDF of the paper titled LayerSkip: Enabling Early Exit Inference and Self-Speculative Decoding, by Mostafa Elhoushi and 12 other authors

View PDF
HTML (experimental)

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 types of training: pretraining from scratch, continual pretraining, finetuning on specific data domain, and finetuning on specific task. We implement our inference solution and show speedups of up to 2.16x on summarization for CNN/DM documents, 1.82x on coding, and 2.0x on TOPv2 semantic parsing task. We open source our code and checkpoints at this https URL.

Submission history

From: Mostafa Elhoushi [view email]
[v1]
Thu, 25 Apr 2024 16:20:23 UTC (1,295 KB)
[v2]
Mon, 29 Apr 2024 15:02:36 UTC (1,295 KB)
[v3]
Thu, 17 Oct 2024 13:50:46 UTC (1,295 KB)
[v4]
Fri, 18 Oct 2024 04:02:31 UTC (1,297 KB)

Source link

#Enabling #Early #Exit #Inference #SelfSpeculative #Decoding

ai improve text ai text generator tools best ai text generators blues metronome brain bravida comfyui ndi data governance failures fivetran blind h&r block taxes generative ai insurance denials builds aipowered for fighting
Unlock the potential of cutting-edge AI solutions with our comprehensive offerings. As a leading provider in the AI landscape, we harness the power of artificial intelligence to revolutionize industries. From machine learning and data analytics to natural language processing and computer vision, our AI solutions are designed to enhance efficiency and drive innovation. Explore the limitless possibilities of AI-driven insights and automation that propel your business forward. With a commitment to staying at the forefront of the rapidly evolving AI market, we deliver tailored solutions that meet your specific needs. Join us on the forefront of technological advancement, and let AI redefine the way you operate and succeed in a competitive landscape. Embrace the future with AI excellence, where possibilities are limitless, and competition is surpassed.

Leave a Comment