XQuant: Het doorbreken van de geheugenbarrière voor LLM-inferentie met KV-cache-rematerialisatie
XQuant: Breaking the Memory Wall for LLM Inference with KV Cache Rematerialization
August 14, 2025
Auteurs: Aditya Tomar, Coleman Hooper, Minjae Lee, Haocheng Xi, Rishabh Tiwari, Wonjun Kang, Luca Manolache, Michael W. Mahoney, Kurt Keutzer, Amir Gholami
cs.AI
Samenvatting
Hoewel LLM-inferentie is opgekomen als een kritieke workload voor veel downstreamtoepassingen, is het efficiënt uitvoeren van LLM-inferentie uitdagend vanwege het aanzienlijke geheugenverbruik en de bandbreedtevereisten. Tegelijkertijd hebben rekenmogelijkheden de afgelopen decennia gestaag de geheugencapaciteit en bandbreedte overtroffen, een trend die duidelijk zichtbaar blijft in moderne GPU-hardware en de uitdaging van LLM-inferentie verergert. Als gevolg hiervan ontstaan er nieuwe algoritmen die meer rekenkracht inruilen voor minder geheugenoperaties. In dat kader presenteren we XQuant, dat gebruikmaakt van deze trend en een orde-van-grootte-reductie in geheugenverbruik mogelijk maakt door middel van low-bit-kwantisatie, met aanzienlijke nauwkeurigheidsvoordelen ten opzichte van state-of-the-art KV-cache-kwantisatiemethoden. Dit bereiken we door de laaginvoeractivaties X te kwantiseren en cachen, in plaats van standaard KV-caching te gebruiken, en vervolgens de Keys en Values on-the-fly te hermaterialiseren tijdens de inferentie. Dit resulteert direct in een 2x geheugenbesparing vergeleken met KV-caching. Door XQuant toe te passen, bereiken we tot ~7.7x geheugenbesparing met <0.1 perplexiteitsverslechtering vergeleken met de FP16-basislijn. Bovendien maakt onze aanpak gebruik van het feit dat X-waarden vergelijkbaar zijn over verschillende lagen. Op basis van deze observatie introduceren we XQuant-CL, dat de cross-layer gelijkenis in de X-embeddings benut voor extreme compressie. Over verschillende modellen behaalt XQuant-CL tot 10x geheugenbesparing ten opzichte van de FP16-basislijn met slechts 0.01 perplexiteitsverslechtering, en 12.5x geheugenbesparing met slechts 0.1 perplexiteitsverslechtering. XQuant maakt gebruik van de snel toenemende rekenmogelijkheden van hardwareplatforms om het geheugenknelpunt te elimineren, terwijl het state-of-the-art KV-cache-kwantisatiemethoden overtreft en bijna-FP16-nauwkeurigheid bereikt over een breed scala aan modellen.
English
Although LLM inference has emerged as a critical workload for many downstream
applications, efficiently inferring LLMs is challenging due to the substantial
memory footprint and bandwidth requirements. In parallel, compute capabilities
have steadily outpaced both memory capacity and bandwidth over the last few
decades, a trend that remains evident in modern GPU hardware and exacerbates
the challenge of LLM inference. As such, new algorithms are emerging that trade
increased computation for reduced memory operations. To that end, we present
XQuant, which takes advantage of this trend, enabling an order-of-magnitude
reduction in memory consumption through low-bit quantization with substantial
accuracy benefits relative to state-of-the-art KV cache quantization methods.
We accomplish this by quantizing and caching the layer input activations X,
instead of using standard KV caching, and then rematerializing the Keys and
Values on-the-fly during inference. This results in an immediate 2times
memory savings compared to KV caching. By applying XQuant, we achieve up to
sim 7.7times memory savings with <0.1 perplexity degradation compared to
the FP16 baseline. Furthermore, our approach leverages the fact that X values
are similar across layers. Building on this observation, we introduce
XQuant-CL, which exploits the cross-layer similarity in the X embeddings for
extreme compression. Across different models, XQuant-CL attains up to
10times memory savings relative to the FP16 baseline with only 0.01
perplexity degradation, and 12.5times memory savings with only 0.1
perplexity degradation. XQuant exploits the rapidly increasing compute
capabilities of hardware platforms to eliminate the memory bottleneck, while
surpassing state-of-the-art KV cache quantization methods and achieving
near-FP16 accuracy across a wide range of models.