An Efficient Inference Framework for Early-exit Large Language Models

Ruijie Miao, Yihan Yan, Xinshuo Yao, Tong Yang
7/25/2024
cs.CLcs.AIcs.LG

No confident code implementation found for this paper. 5 possible matches can be shown below.

Abstract

Building efficient inference framework has gained increasing interests for research community. Early-exit models, a variant of LLMs, improves the inference efficiency of LLMs by skipping rest layers and directly generate output tokens when they are confident enough. However, there is no work of LLM inference framework that takes early-exit models into consideration. This is non-trivial as prior art on LLM inference cannot be directly applied to early-exit models. In this work, we solves two key challenges in building efficient inference framework for early-exit models: (1) batch inference at iteration-level granularity; and (2) KV cache management. For the former, we propose to process the batch until all sequences surpass the early-exit confidence threshold. For the latter, we propose to fill the KV cache of rest layers before the iteration terminates. Our evaluation shows that, compared with the original vLLM operating at full layers, our solution achieves up to 1.25x speed up.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 5 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{miao2024efficient,
  title  = {An Efficient Inference Framework for Early-exit Large Language Models},
  author = {Ruijie Miao and Yihan Yan and Xinshuo Yao and Tong Yang},
  year   = {2024},
  eprint = {2407.20272},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2407.20272v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2407.20272.svg)](https://codeofpaper.com/paper/2407.20272)

Discussion