Lossless Acceleration of Large Language Model via Adaptive N-gram Parallel Decoding

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Ou, Jie, Chen, Yueming, Tian, Wenhong
Format: Preprint
Publié: 2024
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866929415456292864
author Ou, Jie
Chen, Yueming
Tian, Wenhong
author_facet Ou, Jie
Chen, Yueming
Tian, Wenhong
contents While Large Language Models (LLMs) have shown remarkable abilities, they are hindered by significant resource consumption and considerable latency due to autoregressive processing. In this study, we introduce Adaptive N-gram Parallel Decoding (ANPD), an innovative and lossless approach that accelerates inference by allowing the simultaneous generation of multiple tokens. ANPD incorporates a two-stage approach: it begins with a rapid drafting phase that employs an N-gram module, which adapts based on the current interactive context, followed by a verification phase, during which the original LLM assesses and confirms the proposed tokens. Consequently, ANPD preserves the integrity of the LLM's original output while enhancing processing speed. We further leverage a multi-level architecture for the N-gram module to enhance the precision of the initial draft, consequently reducing inference latency. ANPD eliminates the need for retraining or extra GPU memory, making it an efficient and plug-and-play enhancement. In our experiments, models such as LLaMA and its fine-tuned variants have shown speed improvements up to 3.67x, validating the effectiveness of our proposed ANPD.
format Preprint
id arxiv_https___arxiv_org_abs_2404_08698
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Lossless Acceleration of Large Language Model via Adaptive N-gram Parallel Decoding
Ou, Jie
Chen, Yueming
Tian, Wenhong
Computation and Language
Machine Learning
While Large Language Models (LLMs) have shown remarkable abilities, they are hindered by significant resource consumption and considerable latency due to autoregressive processing. In this study, we introduce Adaptive N-gram Parallel Decoding (ANPD), an innovative and lossless approach that accelerates inference by allowing the simultaneous generation of multiple tokens. ANPD incorporates a two-stage approach: it begins with a rapid drafting phase that employs an N-gram module, which adapts based on the current interactive context, followed by a verification phase, during which the original LLM assesses and confirms the proposed tokens. Consequently, ANPD preserves the integrity of the LLM's original output while enhancing processing speed. We further leverage a multi-level architecture for the N-gram module to enhance the precision of the initial draft, consequently reducing inference latency. ANPD eliminates the need for retraining or extra GPU memory, making it an efficient and plug-and-play enhancement. In our experiments, models such as LLaMA and its fine-tuned variants have shown speed improvements up to 3.67x, validating the effectiveness of our proposed ANPD.
title Lossless Acceleration of Large Language Model via Adaptive N-gram Parallel Decoding
topic Computation and Language
Machine Learning
url https://arxiv.org/abs/2404.08698