SlimInfer: Accelerating Long-Context LLM Inference via Dynamic Token Pruning

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Long, Lingkun, Yang, Rubing, Huang, Yushi, Hui, Desheng, Zhou, Ao, Yang, Jianlei
Format: Preprint
Publié: 2025
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866917099303075840
author Long, Lingkun
Yang, Rubing
Huang, Yushi
Hui, Desheng
Zhou, Ao
Yang, Jianlei
author_facet Long, Lingkun
Yang, Rubing
Huang, Yushi
Hui, Desheng
Zhou, Ao
Yang, Jianlei
contents Long-context inference for Large Language Models (LLMs) is heavily limited by high computational demands. While several existing methods optimize attention computation, they still process the full set of hidden states at each layer, limiting overall efficiency. In this work, we propose SlimInfer, an innovative framework that aims to accelerate inference by directly pruning less critical prompt tokens during the forward pass. Our key insight is an information diffusion phenomenon: As information from critical tokens propagates through layers, it becomes distributed across the entire sequence. This diffusion process suggests that LLMs can maintain their semantic integrity when excessive tokens, even including these critical ones, are pruned in hidden states. Motivated by this, SlimInfer introduces a dynamic fine-grained pruning mechanism that accurately removes redundant tokens of hidden state at intermediate layers. This layer-wise pruning naturally enables an asynchronous KV cache manager that prefetches required token blocks without complex predictors, reducing both memory usage and I/O costs. Extensive experiments show that SlimInfer can achieve up to $\mathbf{2.53\times}$ time-to-first-token (TTFT) speedup and $\mathbf{1.88\times}$ end-to-end latency reduction for LLaMA3.1-8B-Instruct on a single RTX 4090, without sacrificing performance on LongBench. Our code is available at https://github.com/Longxmas/SlimInfer.
format Preprint
id arxiv_https___arxiv_org_abs_2508_06447
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle SlimInfer: Accelerating Long-Context LLM Inference via Dynamic Token Pruning
Long, Lingkun
Yang, Rubing
Huang, Yushi
Hui, Desheng
Zhou, Ao
Yang, Jianlei
Computation and Language
Long-context inference for Large Language Models (LLMs) is heavily limited by high computational demands. While several existing methods optimize attention computation, they still process the full set of hidden states at each layer, limiting overall efficiency. In this work, we propose SlimInfer, an innovative framework that aims to accelerate inference by directly pruning less critical prompt tokens during the forward pass. Our key insight is an information diffusion phenomenon: As information from critical tokens propagates through layers, it becomes distributed across the entire sequence. This diffusion process suggests that LLMs can maintain their semantic integrity when excessive tokens, even including these critical ones, are pruned in hidden states. Motivated by this, SlimInfer introduces a dynamic fine-grained pruning mechanism that accurately removes redundant tokens of hidden state at intermediate layers. This layer-wise pruning naturally enables an asynchronous KV cache manager that prefetches required token blocks without complex predictors, reducing both memory usage and I/O costs. Extensive experiments show that SlimInfer can achieve up to $\mathbf{2.53\times}$ time-to-first-token (TTFT) speedup and $\mathbf{1.88\times}$ end-to-end latency reduction for LLaMA3.1-8B-Instruct on a single RTX 4090, without sacrificing performance on LongBench. Our code is available at https://github.com/Longxmas/SlimInfer.
title SlimInfer: Accelerating Long-Context LLM Inference via Dynamic Token Pruning
topic Computation and Language
url https://arxiv.org/abs/2508.06447