ChatPaper.aiChatPaper

XQuant: KV 캐시 재구성을 통한 LLM 추론의 메모리 벽 극복

XQuant: Breaking the Memory Wall for LLM Inference with KV Cache Rematerialization

August 14, 2025
저자: Aditya Tomar, Coleman Hooper, Minjae Lee, Haocheng Xi, Rishabh Tiwari, Wonjun Kang, Luca Manolache, Michael W. Mahoney, Kurt Keutzer, Amir Gholami
cs.AI

초록

LLM 추론은 많은 다운스트림 애플리케이션에서 중요한 워크로드로 부상했지만, 상당한 메모리 공간과 대역폭 요구 사항으로 인해 LLM을 효율적으로 추론하는 것은 어려운 과제입니다. 동시에, 지난 수십 년 동안 컴퓨팅 능력은 메모리 용량과 대역폭을 꾸준히 앞질러 왔으며, 이는 현대 GPU 하드웨어에서도 여전히 뚜렷하게 나타나며 LLM 추론의 어려움을 더욱 가중시키고 있습니다. 이에 따라, 메모리 연산을 줄이기 위해 계산량을 늘리는 새로운 알고리즘들이 등장하고 있습니다. 이러한 맥락에서, 우리는 XQuant를 제안합니다. XQuant는 이러한 추세를 활용하여 저비트 양자화를 통해 메모리 소비를 크게 줄이고, 최신 KV 캐시 양자화 방법 대비 상당한 정확도 이점을 제공합니다. 이를 위해, 우리는 표준 KV 캐싱 대신 레이어 입력 활성화 X를 양자화하고 캐싱한 다음, 추론 중에 Keys와 Values를 실시간으로 재구성합니다. 이는 KV 캐싱에 비해 즉각적인 2배의 메모리 절약을 가져옵니다. XQuant를 적용함으로써, FP16 기준 대비 <0.1의 perplexity 저하로 최대 약 7.7배의 메모리 절약을 달성합니다. 또한, 우리의 접근 방식은 X 값이 레이어 간에 유사하다는 사실을 활용합니다. 이 관찰을 바탕으로, 우리는 X 임베딩의 크로스 레이어 유사성을 극단적인 압축에 활용하는 XQuant-CL을 소개합니다. 다양한 모델에서 XQuant-CL은 FP16 기준 대비 단 0.01의 perplexity 저하로 최대 10배의 메모리 절약을 달성하며, 0.1의 perplexity 저하로는 12.5배의 메모리 절약을 달성합니다. XQuant는 하드웨어 플랫폼의 빠르게 증가하는 컴퓨팅 능력을 활용하여 메모리 병목 현상을 제거하고, 최신 KV 캐시 양자화 방법을 능가하며 다양한 모델에서 거의 FP16 수준의 정확도를 달성합니다.
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.
PDF312August 18, 2025