FIRP: Faster LLM inference via future intermediate representation prediction

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Wu, Pengfei, Liu, Jiahao, Gong, Zhuocheng, Wang, Qifan, Li, Jinpeng, Wang, Jingang, Cai, Xunliang, Zhao, Dongyan
Natura: Preprint
Pubblicazione: 2024
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866916456739897344
author Wu, Pengfei
Liu, Jiahao
Gong, Zhuocheng
Wang, Qifan
Li, Jinpeng
Wang, Jingang
Cai, Xunliang
Zhao, Dongyan
author_facet Wu, Pengfei
Liu, Jiahao
Gong, Zhuocheng
Wang, Qifan
Li, Jinpeng
Wang, Jingang
Cai, Xunliang
Zhao, Dongyan
contents Recent advancements in Large Language Models (LLMs) have shown remarkable performance across a wide range of tasks. Despite this, the auto-regressive nature of LLM decoding, which generates only a single token per forward propagation, fails to fully exploit the parallel computational power of GPUs, leading to considerable latency. To address this, we introduce a novel speculative decoding method named FIRP which generates multiple tokens instead of one at each decoding step. We achieve this by predicting the intermediate hidden states of future tokens (tokens have not been decoded yet) and then using these pseudo hidden states to decode future tokens, specifically, these pseudo hidden states are predicted with simple linear transformation in intermediate layers of LLMs. Once predicted, they participate in the computation of all the following layers, thereby assimilating richer semantic information. As the layers go deeper, the semantic gap between pseudo and real hidden states is narrowed and it becomes feasible to decode future tokens with high accuracy. To validate the effectiveness of FIRP, we conduct extensive experiments, showing a speedup ratio of 1.9x-3x in several models and datasets, analytical experiments also prove our motivations.
format Preprint
id arxiv_https___arxiv_org_abs_2410_20488
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle FIRP: Faster LLM inference via future intermediate representation prediction
Wu, Pengfei
Liu, Jiahao
Gong, Zhuocheng
Wang, Qifan
Li, Jinpeng
Wang, Jingang
Cai, Xunliang
Zhao, Dongyan
Computation and Language
Recent advancements in Large Language Models (LLMs) have shown remarkable performance across a wide range of tasks. Despite this, the auto-regressive nature of LLM decoding, which generates only a single token per forward propagation, fails to fully exploit the parallel computational power of GPUs, leading to considerable latency. To address this, we introduce a novel speculative decoding method named FIRP which generates multiple tokens instead of one at each decoding step. We achieve this by predicting the intermediate hidden states of future tokens (tokens have not been decoded yet) and then using these pseudo hidden states to decode future tokens, specifically, these pseudo hidden states are predicted with simple linear transformation in intermediate layers of LLMs. Once predicted, they participate in the computation of all the following layers, thereby assimilating richer semantic information. As the layers go deeper, the semantic gap between pseudo and real hidden states is narrowed and it becomes feasible to decode future tokens with high accuracy. To validate the effectiveness of FIRP, we conduct extensive experiments, showing a speedup ratio of 1.9x-3x in several models and datasets, analytical experiments also prove our motivations.
title FIRP: Faster LLM inference via future intermediate representation prediction
topic Computation and Language
url https://arxiv.org/abs/2410.20488