RetroInfer: Een Vector-Opslagbenadering voor Schaalbare Inferentie van LLM's met Lange Context
RetroInfer: A Vector-Storage Approach for Scalable Long-Context LLM Inference
May 5, 2025
Auteurs: Yaoqi Chen, Jinkai Zhang, Baotong Lu, Qianxi Zhang, Chengruidong Zhang, Jingjia Luo, Di Liu, Huiqiang Jiang, Qi Chen, Jing Liu, Bailu Ding, Xiao Yan, Jiawei Jiang, Chen Chen, Mingxing Zhang, Yuqing Yang, Fan Yang, Mao Yang
cs.AI
Samenvatting
De toenemende contextlengtes van grote taalmodellen (LLMs) vormen aanzienlijke uitdagingen voor efficiënte inferentie, voornamelijk door beperkingen in GPU-geheugen en bandbreedte. Wij presenteren RetroInfer, een nieuw systeem dat de key-value (KV) cache herconceptualiseert als een vectoropslagsysteem dat gebruikmaakt van de inherente aandachtssparsheid om inferentie van LLMs met lange context te versnellen. De kern hiervan is de wave index, een Attention-aWare VEctor index die efficiënte en nauwkeurige retrievel van kritieke tokens mogelijk maakt door technieken zoals tripartite aandacht benadering, nauwkeurigheidsgebonden aandachtsschatting en gesegmenteerde clustering. Dit wordt aangevuld met de wave buffer, die de plaatsing van de KV cache coördineert en berekening en gegevensoverdracht tussen GPU en CPU overlapt om een hoge doorvoer te behouden. In tegenstelling tot eerdere op sparsheid gebaseerde methoden die moeite hebben met tokenselectie en hardwarecoördinatie, levert RetroInfer robuuste prestaties zonder de modelnauwkeurigheid in te leveren. Experimenten op benchmarks met lange context tonen een versnelling tot 4,5x ten opzichte van volledige aandacht binnen de GPU-geheugenlimieten en tot 10,5x ten opzichte van sparse aandacht baselines wanneer de KV cache wordt uitgebreid naar CPU-geheugen, allemaal terwijl de nauwkeurigheid op het niveau van volledige aandacht behouden blijft.
English
The growing context lengths of large language models (LLMs) pose significant
challenges for efficient inference, primarily due to GPU memory and bandwidth
constraints. We present RetroInfer, a novel system that reconceptualizes the
key-value (KV) cache as a vector storage system which exploits the inherent
attention sparsity to accelerate long-context LLM inference. At its core is the
wave index, an Attention-aWare VEctor index that enables efficient and accurate
retrieval of critical tokens through techniques such as tripartite attention
approximation, accuracy-bounded attention estimation, and segmented clustering.
Complementing this is the wave buffer, which coordinates KV cache placement and
overlaps computation and data transfer across GPU and CPU to sustain high
throughput. Unlike prior sparsity-based methods that struggle with token
selection and hardware coordination, RetroInfer delivers robust performance
without compromising model accuracy. Experiments on long-context benchmarks
show up to 4.5X speedup over full attention within GPU memory limits and up to
10.5X over sparse attention baselines when KV cache is extended to CPU memory,
all while preserving full-attention-level accuracy.