QuaRot: Outlier-Free 4-Bit Inference in Rotated LLMs

Saleh Ashkboos, Amirkeivan Mohtashami, Maximilian L. Croci, Bo Li, Pashmina Cameron, Martin Jaggi, Martin Jaggi, Torsten Hoefler, James Hensman

arXiv:2404.00456 · 2026-07-27 공개 · arXiv · PDF

llm kv-cache quantization rotation-based wiki-text-2 matrix-multiplication llama2 outlier-free

Abstract

We introduce QuaRot, a new Quantization scheme based on Rotations, which is able to quantize LLMs end-to-end, including all weights, activations, and KV cache in 4 bits. QuaRot rotates LLMs in a way that removes outliers from the hidden state without changing the output, making quantization easier. This computational invariance is applied to the hidden state (residual) of the LLM, as well as to the activations of the feed-forward components, aspects of the attention mechanism, and to the KV cache. The result is a quantized model where all matrix multiplications are performed in 4 bits, without any channels identified for retention in higher precision. Our 4-bit quantized LLaMa2-70B model has losses of at most 0.47 WikiText-2 perplexity and retains 99% of the zero-shot performance. We also show that QuaRot can provide lossless 6 and 8 bit LLaMa2 models without any calibration data using round-to-nearest quantization. Code is available at: https://github.com/spcl/QuaRot.

한국어 요약

한 줄 요약

QuaRot는 4비트 정밀도로 LLM을 end-to-end로 양자화하는 새로운 기법으로, 모든 가중치, 활성화, KV 캐시를 4비트로 처리하면서 정확도 손실을 최소화한다.

핵심 기여도

핵심 아이디어

QuaRot는 기존 양자화 기법에서 활성화의 아웃라이어로 인한 성능 저하 문제를 해결하기 위해, **Hadamard 변환**을 통해 입력을 회전시켜 아웃라이어를 제거하는 방식을 도입한다. 이는 **computational invariance** 개념을 기반으로, 모델의 출력을 변경하지 않으면서도 활성화의 분포를 균일하게 만든다. 특히, **residual**, **feed-forward**, **attention**, **KV cache** 등 모든 구성 요소에 적용되며, 이는 기존 양자화 기법에서 고려되지 않았던 부분이다.

이를 통해 QuaRot는 **모든 가중치, 활성화, KV 캐시를 4비트 정수로 처리**할 수 있으며, **GPTQ와 round-to-nearest 양자화**를 결합하여 실시간 활성화 양자화를 가능하게 한다.

기술적 접근법

주요 결과

의의 및 한계

QuaRot는 LLM의 end-to-end 4비트 양자화를 처음으로 실현한 기법으로, **모델의 모든 구성 요소를 균일하게 처리**함으로써 기존 양자화 기법의 한계를 극복한다. 특히, **아웃라이어 제거를 통한 정확도 유지**는 기존 calibration 기반 접근과 차별화된다.

그러나, **Hadamard 변환의 계산 비용**이나 **특정 아키텍처(예: Mixture-of-Experts)에 대한 확장 가능성**은 아직 명시되지 않았으며, **고정 정밀도 채널 없이 처리하는 방식의 안정성**도 추가 연구가 필요할 수 있다.

실용적 활용

QuaRot는 **GPU 메모리 제한이 있는 환경**에서 LLM 추론을 효율적으로 수행할 수 있는 기법으로, **RTX 3090과 같은 상용 GPU**에서도 성능 향상을 기대할 수 있다. 또한, **저비용 하드웨어 구현**이 가능하며, **NVIDIA B200 GPU 아키텍처와 유사한 성능**을 제공할 수 있다. 이는 모바일, 클라우드, 에지 기기 등 다양한 분야에서 활용 가능하다.