InfiniteHiP: 단일 GPU에서 최대 3백만 토큰까지 언어 모델 컨텍스트 확장
InfiniteHiP: Extending Language Model Context Up to 3 Million Tokens on a Single GPU
February 13, 2025
저자: Heejun Lee, Geon Park, Jaduk Suh, Sung Ju Hwang
cs.AI
초록
현대의 대규모 언어 모델(LLM)에서는 매우 긴 문맥 길이를 처리하는 것이 느린 추론 속도와 증가된 메모리 비용을 유발하여 중요한 도전을 제기합니다. 게다가 대부분의 기존 사전 훈련된 LLM은 원래 훈련 시퀀스 길이를 넘어 일반화하는 데 실패합니다. 효율적이고 실용적인 긴 문맥 활용을 위해 우리는 InfiniteHiP을 소개합니다. 이는 새로운 LLM 추론 프레임워크로, 모듈화된 계층적 토큰 가지치기 알고리즘을 통해 불필요한 문맥 토큰을 동적으로 제거하여 처리 속도를 가속화합니다. 우리의 방법은 또한 LLM 내부의 주의 패턴에 따라 다양한 RoPE 조정 방법을 선택적으로 적용하여 더 긴 시퀀스로의 일반화를 허용합니다. 더불어 추론 중에 키-값 캐시를 호스트 메모리로 옮겨 GPU 메모리 압력을 크게 줄입니다. 결과적으로 InfiniteHiP은 단일 L40s 48GB GPU에서 최대 3백만 토큰의 처리를 가능하게 하며, 어떠한 영구적인 문맥 정보 손실도 없이 3배 더 큰 처리가 가능합니다. 우리의 프레임워크는 추가 훈련이 필요하지 않은 100만 토큰 문맥에 대해 18.95배의 주의 디코딩 속도 향상을 달성합니다. 우리는 SGLang 프레임워크에서 우리의 방법을 구현하고 광범위한 평가를 통해 그 효과와 실용성을 입증합니다.
English
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.Summary
AI-Generated Summary