InfiniteHiP: Extending Language Model Context Up to 3 Million Tokens on a Single GPU

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Lee, Heejun, Park, Geon, Suh, Jaduk, Hwang, Sung Ju
Natura: Preprint
Pubblicazione: 2025
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866909490699304960
author Lee, Heejun
Park, Geon
Suh, Jaduk
Hwang, Sung Ju
author_facet Lee, Heejun
Park, Geon
Suh, Jaduk
Hwang, Sung Ju
contents In modern large language models (LLMs), handling very long context lengths presents significant challenges as it causes slower inference speeds and increased memory costs. Additionally, most existing pre-trained LLMs fail to generalize beyond their original training sequence lengths. To enable efficient and practical long-context utilization, we introduce InfiniteHiP, a novel, and practical LLM inference framework that accelerates processing by dynamically eliminating irrelevant context tokens through a modular hierarchical token pruning algorithm. Our method also allows generalization to longer sequences by selectively applying various RoPE adjustment methods according to the internal attention patterns within LLMs. Furthermore, we offload the key-value cache to host memory during inference, significantly reducing GPU memory pressure. As a result, InfiniteHiP enables the processing of up to 3 million tokens on a single L40s 48GB GPU -- 3x larger -- without any permanent loss of context information. Our framework achieves an 18.95x speedup in attention decoding for a 1 million token context without requiring additional training. We implement our method in the SGLang framework and demonstrate its effectiveness and practicality through extensive evaluations.
format Preprint
id arxiv_https___arxiv_org_abs_2502_08910
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle InfiniteHiP: Extending Language Model Context Up to 3 Million Tokens on a Single GPU
Lee, Heejun
Park, Geon
Suh, Jaduk
Hwang, Sung Ju
Computation and Language
Machine Learning
In modern large language models (LLMs), handling very long context lengths presents significant challenges as it causes slower inference speeds and increased memory costs. Additionally, most existing pre-trained LLMs fail to generalize beyond their original training sequence lengths. To enable efficient and practical long-context utilization, we introduce InfiniteHiP, a novel, and practical LLM inference framework that accelerates processing by dynamically eliminating irrelevant context tokens through a modular hierarchical token pruning algorithm. Our method also allows generalization to longer sequences by selectively applying various RoPE adjustment methods according to the internal attention patterns within LLMs. Furthermore, we offload the key-value cache to host memory during inference, significantly reducing GPU memory pressure. As a result, InfiniteHiP enables the processing of up to 3 million tokens on a single L40s 48GB GPU -- 3x larger -- without any permanent loss of context information. Our framework achieves an 18.95x speedup in attention decoding for a 1 million token context without requiring additional training. We implement our method in the SGLang framework and demonstrate its effectiveness and practicality through extensive evaluations.
title InfiniteHiP: Extending Language Model Context Up to 3 Million Tokens on a Single GPU
topic Computation and Language
Machine Learning
url https://arxiv.org/abs/2502.08910