Skip to content

Split View: 최신 LLM 양자화 기술 총정리 — GPTQ·AWQ부터 FP8·MXFP4·KV 캐시 양자화까지

|

최신 LLM 양자화 기술 총정리 — GPTQ·AWQ부터 FP8·MXFP4·KV 캐시 양자화까지

들어가며 — 왜 비트를 줄이는가, 왜 버티는가

70B 모델을 fp16으로 올리면 가중치만 140GB — H100 두 장이 필요합니다. 같은 모델을 4비트로 양자화하면 약 35GB — 한 장에 들어가고도 남습니다. 양자화(quantization) 는 이렇게 파라미터를 표현하는 비트 수를 줄여 메모리·대역폭·비용을 깎는 기술이며, 모델 개발 생애주기의 서빙 절에서 말한 "학습보다 오래가는 싸움"의 제1 무기입니다.

놀라운 것은 품질이 생각보다 버틴다는 점입니다. 이유는 두 가지입니다. 첫째, 신경망 가중치의 분포는 대부분 0 주변에 몰려 있어 적은 비트로도 촘촘히 표현할 수 있습니다. 둘째, 진짜 문제는 소수의 이상치(outlier) — 유난히 큰 값들 — 인데, 최신 기법들은 전부 "이상치를 어떻게 대접할 것인가"에 대한 서로 다른 답입니다. 이 관점 하나를 쥐고 있으면 아래의 기법들이 한 계보로 읽힙니다.

용어 두 가지만 먼저: 학습이 끝난 모델을 그대로 변환하면 PTQ(Post-Training Quantization), 낮은 정밀도를 견디도록 재학습까지 하면 QAT(Quantization-Aware Training)입니다. 이 글의 대부분은 실무의 주류인 PTQ입니다.

표기법 먼저 — W4A16이 무슨 뜻인가

양자화 논의에는 W{비트}A{비트} 표기가 계속 나옵니다.

W4A16  = 가중치(Weight) 4비트, 활성값(Activation) 16비트
         → 저장·로드는 4비트, 계산 직전에 복원해 16비트로 연산
W8A8   = 가중치도 활성값도 8비트 → 연산 자체가 8비트 (하드웨어 가속 필요)
W4A4KV4 = 가중치·활성값·KV 캐시까지 전부 4비트

가중치만 줄이는 W4A16류는 메모리·대역폭을 절약하고(작은 배치의 추론 속도도 개선 — decode는 memory-bound이므로), 활성값까지 줄이는 W8A8/W4A4류는 연산 처리량까지 끌어올립니다. 대신 활성값은 이상치가 심해 훨씬 다루기 어렵습니다 — 이것이 아래 SmoothQuant가 푸는 문제입니다.

INT 계열의 고전들 — 이상치 대접의 역사

LLM.int8() (2022) — "이상치 채널만 fp16으로 따로 계산하고 나머지는 INT8로"라는 혼합 분해로, 거대 모델의 8비트 추론이 품질 손실 없이 가능함을 처음 보였습니다. 이상치 문제의 존재를 공식화한 출발점입니다.

GPTQ (2022) — 4비트 시대를 연 PTQ입니다. 가중치를 한 열씩 양자화하면서, 그 열에서 생긴 오차를 아직 양자화하지 않은 나머지 가중치에 보정해 누적 오차를 억제합니다(2차 근사·헤시안 기반). 소량의 캘리브레이션 데이터만으로 W4를 실용권에 올렸습니다.

AWQ (2023) — 관점을 뒤집었습니다. 모든 가중치가 평등하지 않다 — 활성값이 큰 채널과 곱해지는 소수(~1%)의 가중치가 품질을 좌우한다는 관찰에서, 그 "중요한" 채널을 스케일링으로 보호하고 나머지를 과감히 4비트로 낮춥니다. 재학습 없이 빠르고, GPU 추론 커널과 궁합이 좋아 vLLM류 서빙에서 INT4의 사실상 표준이 됐습니다.

SmoothQuant (2022) — W8A8을 위한 다리입니다. 활성값의 이상치 스케일을 수학적으로 가중치 쪽으로 이월시켜(활성값을 매끈하게, 가중치를 약간 험하게) 둘 다 8비트로 계산 가능하게 만듭니다.

로컬 진영 — GGUF와 k-quant, 그리고 QLoRA의 NF4

GGUF (llama.cpp) 는 로컬 추론 생태계(Ollama, LM Studio)의 공용 포맷입니다. 특징은 k-quant 혼합 정밀도: 하나의 모델 안에서 층·텐서별로 중요도에 따라 다른 비트를 섞습니다. 파일명이 곧 스펙입니다.

Q4_K_M  = 4비트 k-quant, Medium 믹스 — 품질/크기 균형의 대표 선택
Q5_K_M  = 5비트 — 여유가 있으면 이쪽
Q8_0    = 8비트 — 거의 무손실, 크기 절약은 절반 수준
Q2_K    = 2비트 — 극단 압축, 품질 타협 큼
(최근에는 중요도 행렬 기반 i-quant 계열 IQ4_XS 등도 추가)

CPU+GPU 혼합 추론을 전제로 설계되어, "게이밍 PC에서 70B를 굴린다" 같은 시나리오의 주역입니다.

NF4 (QLoRA, 2023) — 파인튜닝 쪽의 양자화입니다. 정규분포를 따르는 가중치에 정보이론적으로 최적인 4비트 격자(NormalFloat4)로 베이스 모델을 얼려 두고, 그 위에 LoRA 어댑터만 학습합니다. "48GB GPU 한 장으로 65B 파인튜닝"을 연 기법으로, 모델 개발 글에서 다룬 LoRA와 한 세트로 기억하면 됩니다.

2026년의 중심축 — FP8과 마이크로스케일링 FP4

최근 지형의 가장 큰 변화는 정수(INT)에서 저정밀 부동소수점(FP)으로의 이동입니다. 부동소수점은 지수부 덕분에 큰 값과 작은 값을 동시에 표현하는 능력이 좋아, 이상치에 정수보다 관대합니다.

FP8 — Hopper(H100)부터 하드웨어 가속되는 8비트 부동소수점입니다(범위형 E5M2와 정밀형 E4M3). fp16 대비 메모리 절반에 품질 저하가 거의 없는 수준이라, 데이터센터 서빙 스택(vLLM, TensorRT-LLM)의 사실상 표준 기본값이 됐습니다. "하드웨어가 Hopper/Blackwell이면 일단 FP8"이 현재의 상식입니다.

마이크로스케일링 FP4 — MXFP4와 NVFP4 — 4비트 부동소수점을 실용화한 열쇠는 블록 단위 스케일입니다. 32개 안팎의 값 블록마다 공유 스케일 팩터를 따로 두어, 4비트의 좁은 표현 범위를 블록별로 최적 위치에 "이동"시킵니다. OCP 표준의 MXFP4는 공개 모델 배포에까지 쓰이기 시작했고(OpenAI의 gpt-oss가 MXFP4로 공개된 것이 상징적), NVIDIA NVFP4는 Blackwell 세대의 하드웨어 가속과 함께 W4A4, 나아가 KV 캐시까지 4비트로 미는 구성(W4A4KV4)을 겨냥합니다. "FP4는 Blackwell 시대의 FP8"이라는 요약이 업계의 공감대입니다.

다음 병목 — KV 캐시 양자화

가중치를 다 줄이고 나면 남는 큰 메모리 소비자는 KV 캐시입니다 — LLM 캐싱 편에서 봤듯 긴 컨텍스트에서는 캐시가 가중치보다 커질 수 있습니다. 그래서 최근 서빙 엔진들은 KV 캐시 자체를 FP8(나아가 INT4/FP4)로 저장하는 옵션을 제공합니다. 효과는 이중입니다: 같은 GPU에 더 긴 컨텍스트·더 많은 동시 사용자를 태울 수 있고, decode가 memory-bound이므로 토큰 생성 속도 자체가 빨라집니다. 긴 컨텍스트 서비스라면 가중치 다음에 반드시 검토할 항목입니다.

선택 가이드 — 하드웨어 × 목적 매트릭스

상황                                   추천 출발점
─────────────────────────────────    ─────────────────────────────
데이터센터, H100/Blackwell 보유        FP8 (서빙 엔진 기본 경로)
Blackwell + 최대 처리량                NVFP4/MXFP4 (W4A4 계열) 검토
VRAM 부족한 GPU 서빙 (A100/4090)       AWQ INT4 (W4A16), GPTQ 대안
로컬 PC / CPU 혼합 / Ollama            GGUF Q4_K_M부터, 여유 시 Q5_K_M
파인튜닝을 싸게                        QLoRA (NF4 + LoRA)
긴 컨텍스트가 병목                     KV 캐시 양자화(FP8부터) 추가
품질이 최우선, 메모리 여유             W8A8(FP8/INT8)까지만

그리고 어떤 선택이든 마지막 단계는 같습니다 — 자기 과제의 평가 셋으로 검증하세요. 퍼플렉시티 지표는 참고일 뿐, 양자화 손상은 과제별로 불균등하게 나타납니다(특히 수학·코드·긴 추론에서 먼저 무너집니다). 모델 개발 글의 eval-first 원칙이 여기서도 그대로 적용됩니다. 캘리브레이션 데이터(GPTQ/AWQ가 쓰는 소량 샘플)도 실제 사용 분포와 비슷해야 안전합니다.

마치며 — 이상치와의 전쟁사

돌아보면 양자화 기법의 역사는 한 문장으로 요약됩니다: "이상치를 어떻게 대접할 것인가." LLM.int8()은 따로 모셨고, GPTQ는 오차를 이웃에 보정했고, AWQ는 중요한 채널을 보호했고, SmoothQuant는 험한 쪽에서 매끈한 쪽으로 이월했고, FP8은 지수부로 품었고, MXFP4/NVFP4는 블록마다 스케일을 맞춰 정면 돌파했습니다. 다음 전장은 KV 캐시와 4비트 활성값입니다. 비트는 계속 줄어들 것이고 — 검증 습관만 있다면, 그 절약은 대부분 공짜에 가깝습니다.

참고 자료

The State of LLM Quantization — From GPTQ and AWQ to FP8, MXFP4, and KV-Cache Quantization

Introduction — Why Shrink Bits, and Why Does It Hold Up?

Load a 70B model in fp16 and the weights alone take 140 GB — two H100s. Quantize the same model to 4 bits and it's about 35 GB — it fits on one card with room to spare. Quantization cuts the bits used to represent parameters, slashing memory, bandwidth, and cost — the number-one weapon in the "fight that outlives training" from the serving section of the model development lifecycle.

The surprise is how well quality holds. Two reasons. First, neural-network weights cluster around zero, so few bits can represent them densely. Second, the real problem is a small number of outliers — unusually large values — and every modern technique is a different answer to "how shall we treat the outliers?" Hold that one lens and the methods below read as a single lineage.

Two terms first: converting a finished model as-is is PTQ (Post-Training Quantization); retraining the model to tolerate low precision is QAT (Quantization-Aware Training). Most of this article is PTQ — the practical mainstream.

Notation First — What Does W4A16 Mean?

Quantization discussions constantly use W{bits}A{bits} notation.

W4A16   = Weights 4-bit, Activations 16-bit
          → stored/loaded at 4 bits, dequantized to compute at 16 bits
W8A8    = weights AND activations 8-bit → arithmetic itself is 8-bit (needs HW support)
W4A4KV4 = weights, activations, and the KV cache all at 4 bits

Weight-only schemes (W4A16) save memory and bandwidth (and speed up small-batch inference, since decode is memory-bound); quantizing activations too (W8A8/W4A4) also raises compute throughput. But activations have far nastier outliers — that's the problem SmoothQuant solves below.

The INT Classics — a History of Outlier Diplomacy

LLM.int8() (2022) — a mixed decomposition: "compute the outlier channels separately in fp16, everything else in INT8." It first showed lossless 8-bit inference for large models and formalized the outlier problem.

GPTQ (2022) — the PTQ that opened the 4-bit era. It quantizes weights column by column, and compensates each column's error into the not-yet-quantized remaining weights (second-order, Hessian-based), suppressing error accumulation. With only a small calibration set, it made W4 practical.

AWQ (2023) — flipped the perspective. Not all weights are equal: the ~1% of weights multiplied by large activations dominate quality. AWQ protects those salient channels via scaling and boldly drops the rest to 4 bits. No retraining, fast, and kernel-friendly — the de facto INT4 standard in vLLM-style GPU serving.

SmoothQuant (2022) — the bridge to W8A8. It mathematically migrates the activation outlier scale into the weights (smoothing activations, roughening weights slightly) so both can be computed in 8 bits.

The Local Camp — GGUF k-quants, and QLoRA's NF4

GGUF (llama.cpp) is the common format of the local-inference ecosystem (Ollama, LM Studio). Its signature is k-quant mixed precision: different bit-widths per layer/tensor by importance, inside one model. The filename is the spec:

Q4_K_M  = 4-bit k-quant, Medium mix — the classic quality/size balance
Q5_K_M  = 5-bit — take this if you have headroom
Q8_0    = 8-bit — near-lossless, half the size savings
Q2_K    = 2-bit — extreme compression, big quality trade
(newer importance-matrix i-quants like IQ4_XS also exist)

Designed for CPU+GPU mixed inference — the workhorse of "run a 70B on a gaming PC" scenarios.

NF4 (QLoRA, 2023) — quantization on the fine-tuning side. It freezes the base model in NormalFloat4 — an information-theoretically optimal 4-bit grid for normally distributed weights — and trains only LoRA adapters on top. The technique that enabled "fine-tune a 65B on one 48 GB GPU"; remember it as a set with LoRA from the model development post.

2026's Center of Gravity — FP8 and Microscaling FP4

The biggest recent shift is the move from integers (INT) to low-precision floating point (FP). Thanks to the exponent, floating point represents large and small values simultaneously — more forgiving of outliers than integers.

FP8 — 8-bit floating point, hardware-accelerated since Hopper (H100), in range-flavored E5M2 and precision-flavored E4M3. Half the memory of fp16 with nearly no quality loss, it has become the de facto default in datacenter serving stacks (vLLM, TensorRT-LLM). "On Hopper/Blackwell, start with FP8" is today's common sense.

Microscaling FP4 — MXFP4 and NVFP4 — the key that made 4-bit floating point practical is block-level scaling: each block of ~32 values carries its own shared scale factor, shifting FP4's narrow range to the optimal position per block. The OCP-standard MXFP4 has reached public model distribution (OpenAI's gpt-oss shipping in MXFP4 was the symbolic moment), while NVIDIA's NVFP4 targets Blackwell-generation hardware acceleration with W4A4 — and even W4A4KV4, quantizing the KV cache too. "FP4 is the FP8 of the Blackwell era" is the emerging consensus.

The Next Bottleneck — KV-Cache Quantization

Once weights are shrunk, the remaining big memory consumer is the KV cache — as seen in the LLM caching post, at long context it can outgrow the weights. Hence serving engines now offer storing the KV cache itself in FP8 (or even INT4/FP4). The payoff is double: more context and more concurrent users per GPU, and since decode is memory-bound, token generation itself gets faster. For long-context services, it's the mandatory next checkbox after weights.

Selection Guide — Hardware × Goal Matrix

Situation                              Recommended starting point
─────────────────────────────────    ─────────────────────────────
Datacenter with H100/Blackwell         FP8 (the serving engines' default path)
Blackwell + maximum throughput         consider NVFP4/MXFP4 (W4A4 family)
VRAM-constrained GPU (A100/4090)       AWQ INT4 (W4A16); GPTQ as alternative
Local PC / CPU-mixed / Ollama          GGUF Q4_K_M first, Q5_K_M with headroom
Cheap fine-tuning                      QLoRA (NF4 + LoRA)
Long context is the bottleneck         add KV-cache quantization (start FP8)
Quality first, memory to spare         stop at W8A8 (FP8/INT8)

Whatever you pick, the last step is the same — validate on your own task's eval set. Perplexity is only a hint; quantization damage is uneven across tasks (math, code, and long reasoning crumble first). The eval-first principle from the model development post applies verbatim. Calibration data (the small sample GPTQ/AWQ use) should also resemble your real usage distribution.

Closing — A War History Against Outliers

In hindsight, the history of quantization compresses to one sentence: "how shall we treat the outliers?" LLM.int8() gave them a separate room; GPTQ compensated their error onto neighbors; AWQ bodyguarded the salient channels; SmoothQuant migrated roughness from the hard side to the smooth side; FP8 absorbed them with an exponent; MXFP4/NVFP4 charged head-on with per-block scales. The next battlefields are the KV cache and 4-bit activations. Bits will keep shrinking — and with a validation habit, those savings are very nearly free.

References