Investigating Acceleration of LLaMA Inference by Enabling Intermediate Layer Decoding via Instruction Tuning with ‘LITE

Neeraj Varshney, Agneet Chatterjee, Mihir Parmar, Chitta Baral


Abstract
Large Language Models (LLMs) have achieved remarkable performance across a wide variety of tasks; however, their large size makes their inference slow and computationally expensive. Focusing on this problem, we study instruction tuning LLMs with additional explicit Losses from the Intermediate layers (LITE) and show that it enables these layers to acquire ‘good’ generation ability without affecting the generation ability of the final layer. We then perform ‘dynamic confidence-based early exiting’ at token level from the intermediate layers which improves the computational efficiency of text generation without sacrificing the quality of the generation. We conduct comprehensive experiments by instruction tuning LLaMA-2 models on the Alpaca dataset and evaluate on four different instruction test sets. We show that dynamic early exiting achieves consistent and considerable inference cost improvements (37.86% for 7B and 46.35% for 13B model) while maintaining the generation quality. We further conduct a thorough analysis of the results and dissect the efficiency improvements which reveals several important findings.
Anthology ID:
2024.findings-naacl.232
Volume:
Findings of the Association for Computational Linguistics: NAACL 2024
Month:
June
Year:
2024
Address:
Mexico City, Mexico
Editors:
Kevin Duh, Helena Gomez, Steven Bethard
Venue:
Findings
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
3656–3677
Language:
URL:
https://aclanthology.org/2024.findings-naacl.232
DOI:
Bibkey:
Cite (ACL):
Neeraj Varshney, Agneet Chatterjee, Mihir Parmar, and Chitta Baral. 2024. Investigating Acceleration of LLaMA Inference by Enabling Intermediate Layer Decoding via Instruction Tuning with ‘LITE’. In Findings of the Association for Computational Linguistics: NAACL 2024, pages 3656–3677, Mexico City, Mexico. Association for Computational Linguistics.
Cite (Informal):
Investigating Acceleration of LLaMA Inference by Enabling Intermediate Layer Decoding via Instruction Tuning with ‘LITE’ (Varshney et al., Findings 2024)
Copy Citation:
PDF:
https://aclanthology.org/2024.findings-naacl.232.pdf
Copyright:
 2024.findings-naacl.232.copyright.pdf