# NestQuant: Nested Lattice Quantization for Matrix Products and LLMs

NestQuant: 행렬 곱과 LLM을 위한 중첩 격자 양자화

Semyon Savkin, Eitan Porat, Or Ordentlich, Yury Polyanskiy · arXiv · 2025년 2월 13일

- **연구 문제** 기존 LLM 양자화는 가중치, KV 캐시, 활성값을 균일 스칼라 양자화로 줄이면서 행렬곱의 정보 효율에 한계가 있습니다. NestQuant는 중첩 격자 양자화를 실용적인 Gosset 격자 블록 양자화로 구현하려 합니다.
- **연구 방법** NestQuant는 8차원 Gosset 격자 기반 Voronoi 코드와 여러 스케일 계수 β를 사용하며, 활성값과 KV 캐시에 블록 양자화를 적용하고 가중치에는 QA-LDLQ를 적용합니다.
- **주요 결과** Llama-3-8B에서 가중치·KV 캐시·활성값을 4비트로 양자화했을 때 wikitext2 perplexity 6.6을 보고하며, 이는 같은 설정의 SpinQuant 7.3과 비교됩니다. LDLQ를 제거하면 W+KV+A perplexity가 6.849로 악화됩니다.

## LLM 행렬곱의 저비트 양자화 문제

대규모 언어 모델을 저비트로 양자화하면 가중치뿐 아니라 KV 캐시와 활성값까지 줄여야 메모리 대역폭과 계산 병목을 함께 해소할 수 있습니다. 기존 방법 중 널리 쓰이는 SpinQuant와 QuaRot은 주로 균일(uniform) 스칼라 양자화를 사용하며, 고차원에서 cubic shaping을 쓰는 경우 Gaussian 질량을 잘 포착하지 못합니다. 이 논문은 행렬곱 근사에서 정보이론적 하한에 가까운 중첩 격자(nested lattice) 기반 양자화를 실용적인 복잡도로 구현하는 것을 목표로 합니다.

## Gosset 격자 기반 NestQuant 양자화

NestQuant는 8차원 Gosset 격자 E8을 기반 격자로 사용합니다. 입력 벡터를 L2 노름으로 정규화한 뒤 8차원 블록으로 나누고, 여러 스케일 계수 β 중 하나를 골라 Voronoi 코드로 인코딩합니다. 이 방식은 격자의 Voronoi 영역 안에 있는 점만 사용해 희귀한 큰 벡터에 비트를 낭비하지 않도록 합니다. 활성값과 KV 캐시는 추론 중 이 블록 양자화를 거치며, 가중치에는 Hadamard 회전을 병합한 뒤 QA-LDLQ로 양자화합니다.

![Figure 2: Demonstrating advantage of NestQuant in 2D. Typical weights and activations are vectors inside the black circle. Uniform quantization wastes about 32…](https://refivu.com/papers/fcf33004-4ca4-4b0c-bd9b-474a77e2a35d/figures/figure-df0c5a03f2358e8f82871ebe5731c32c.png?thumb=512)

**Figure 2** : Demonstrating advantage of NestQuant in 2D. Typical weights and activations are vectors inside the black circle. Uniform quantization wastes about 32% of allocated bitstrings for vectors outside of the circle, while nested hexagonal lattices only wastes 15% (explicitly enumerating points inside the circle to avoid the waste is too slow to do at runtime). This allows NestQuant to use finer grid while quantizing to the same rate R. The gain becomes much more dramatic in higher dimensions.

[원문](https://arxiv.org/abs/2502.09720v3) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Semyon Savkin, Eitan Porat, Or Ordentlich, Yury Polyanskiy · NestQuant: Nested Lattice Quantization for Matrix Products and LLMs · 원문 그림 인용 · 원본 PDF 4쪽에서 그림 영역을 추출했습니다.

![Figure 4: The quantization scheme of multi-head attention. H is Hadamard rotation described in 4.3. Q is the quantization function described in 4.2](https://refivu.com/papers/fcf33004-4ca4-4b0c-bd9b-474a77e2a35d/figures/figure-199fc5a5de8902cf06827f32fc1e0bd2.png?thumb=512)

**Figure 4** : The quantization scheme of multi-head attention. H is Hadamard rotation described in 4.3. Q is the quantization function described in 4.2

[원문](https://arxiv.org/abs/2502.09720v3) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Semyon Savkin, Eitan Porat, Or Ordentlich, Yury Polyanskiy · NestQuant: Nested Lattice Quantization for Matrix Products and LLMs · 원문 그림 인용 · 원본 PDF 9쪽에서 그림 영역을 추출했습니다.

![Figure 5: Complement Gaussian measure of a 8-dimensional cube (corresponding to shaping using an ℓ∞ ball), a V oronoi region of the Gosset lattice E8 (correspo…](https://refivu.com/papers/fcf33004-4ca4-4b0c-bd9b-474a77e2a35d/figures/figure-cc08f8aa02828d47e3fba127a9d9e685.png?thumb=512)

**Figure 5** : Complement Gaussian measure of a 8-dimensional cube (corresponding to shaping using an ℓ∞ ball), a V oronoi region of the Gosset lattice E8 (corresponding to shaping using V oronoi codes with base latticeE8), and a Euclidean ball (corresponding to shaping with a ball, which does not admit efficient implementation)

[원문](https://arxiv.org/abs/2502.09720v3) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Semyon Savkin, Eitan Porat, Or Ordentlich, Yury Polyanskiy · NestQuant: Nested Lattice Quantization for Matrix Products and LLMs · 원문 그림 인용 · 원본 PDF 14쪽에서 그림 영역을 추출했습니다.

## 활성값 양자화를 고려한 가중치 보정

활성값까지 양자화하면 기존 LDLQ와 GPTQ가 최소화하는 손실이 실제 출력 오차를 충분히 반영하지 못합니다. 논문은 활성값 양자화 잡음 Z를 평균 0이고 X와 독립인 잡음으로 모델링하고, 보정 가중치 W̃ = W H(H+J)^{-1}을 계산한 뒤 H+J를 Hessian으로 하여 LDLQ를 수행하는 QA-LDLQ를 제안합니다. 이 보정은 Llama-3-70B의 일부 층에서 나타나는 큰 증폭 비율을 줄이는 목적을 가집니다.

## Llama-3-8B 4비트 결과와 절제 실험

Llama-3-8B를 q=14, k=4 설정으로 양자화했을 때 wikitext2 perplexity는 가중치만 양자화한 경우 6.3, 가중치와 KV 캐시를 양자화한 경우 6.4, 가중치·KV 캐시·활성값을 모두 양자화한 경우 6.6으로 보고됩니다. 같은 4비트 전체 양자화 설정에서 SpinQuant는 7.3으로 보고됩니다. 절제 실험에서 LDLQ를 제거하면 W+KV+A 설정의 perplexity가 6.633에서 6.849로 올라가며, 이는 LDLQ 보정의 효용을 보여주는 비교입니다. 이 값들은 wikitext2 validation 분할과 context length 2048 조건의 결과입니다.

![Table 1: 4-bit quantization of Llama-3-8B. The bits column for NestQuant corresponds to actually measured average number of bits per entry (when a vector of au…](https://refivu.com/papers/fcf33004-4ca4-4b0c-bd9b-474a77e2a35d/figures/figure-c1e1fdcc82e5fb5d213013ed61cb1806.png?thumb=512)

**Table 1** : 4-bit quantization of Llama-3-8B. The bits column for NestQuant corresponds to actually measured average number of bits per entry (when a vector of auxiliary scaling coefficientsβ is compressed via zstd) and the second column shows quantization rate when no compression step is used.

[원문](https://arxiv.org/abs/2502.09720v3) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Semyon Savkin, Eitan Porat, Or Ordentlich, Yury Polyanskiy · NestQuant: Nested Lattice Quantization for Matrix Products and LLMs · 원문 그림 인용 · 원본 PDF 2쪽에서 그림 영역을 추출했습니다.

![Table 3: Wikitext2 perplexity of NestQuant quantization of Llama-3-8B at different rates. The "bits" column is the bit rate per entry with zstd compression of…](https://refivu.com/papers/fcf33004-4ca4-4b0c-bd9b-474a77e2a35d/figures/figure-c3720420d43a06fb6a0420b00baeb32a.png?thumb=512)

**Table 3** : Wikitext2 perplexity of NestQuant quantization of Llama-3-8B at different rates. The "bits" column is the bit rate per entry with zstd compression of scaling coefficients, and "bits (no zstd)" is the bit rate without compression. The "W", "W+KV", and "W+KV+A" describe the quantization regime (whether weights, KV cache, or activations are quantized). The perplexity of non-quantized model is 6.139

[원문](https://arxiv.org/abs/2502.09720v3) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Semyon Savkin, Eitan Porat, Or Ordentlich, Yury Polyanskiy · NestQuant: Nested Lattice Quantization for Matrix Products and LLMs · 원문 그림 인용 · 원본 PDF 10쪽에서 그림 영역을 추출했습니다.

![Table 6: Effect of LDLQ on NestQuant (q = 14 and k = 4) wikitext2 perplexity](https://refivu.com/papers/fcf33004-4ca4-4b0c-bd9b-474a77e2a35d/figures/figure-558711fed90a2926a97e1d7884b0a76a.png?thumb=512)

**Table 6** : Effect of LDLQ on NestQuant (q = 14 and k = 4) wikitext2 perplexity

[원문](https://arxiv.org/abs/2502.09720v3) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Semyon Savkin, Eitan Porat, Or Ordentlich, Yury Polyanskiy · NestQuant: Nested Lattice Quantization for Matrix Products and LLMs · 원문 그림 인용 · 원본 PDF 21쪽에서 그림 영역을 추출했습니다.

## 적용 범위와 남은 제약

이 논문은 PTQ의 기본 프리미티브를 보이는 것을 목적으로 하며, 회전 행렬 최적화나 후처리 학습 같은 비용이 큰 미세 조정은 수행하지 않습니다. 또한 본문 결과는 주로 Llama-3-8B와 wikitext2 perplexity에 대한 것이며, 다른 모델 계열이나 다른 과제로 일반화한 결과는 이 논문의 주된 근거가 아닙니다. 빠른 복호와 CUDA 구현은 제시되지만, 실행 시간 비교는 GEMV 커널 설정과 A100 GPU 조건에 한정됩니다.

![Table 4: Runtime comparison of GEMV kernels on an 8192 × 8192 matrix using an NVIDIA A100 GPU](https://refivu.com/papers/fcf33004-4ca4-4b0c-bd9b-474a77e2a35d/figures/figure-4cb4f0c32d59196bf91b753886194417.png?thumb=512)

**Table 4** : Runtime comparison of GEMV kernels on an 8192 × 8192 matrix using an NVIDIA A100 GPU.

[원문](https://arxiv.org/abs/2502.09720v3) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Semyon Savkin, Eitan Porat, Or Ordentlich, Yury Polyanskiy · NestQuant: Nested Lattice Quantization for Matrix Products and LLMs · 원문 그림 인용 · 원본 PDF 19쪽에서 그림 영역을 추출했습니다.

## 논문 정보

- **저자**: Semyon Savkin, Eitan Porat, Or Ordentlich, Yury Polyanskiy
- **학회·저널**: arXiv · 프리프린트
- **최초 공개일**: 2025년 2월 13일
- **등록일**: 2026년 10월 31일
- **수정일**: 2025년 7월 26일
- **버전**: v3
- **arXiv**: 2502.09720
- **분류**: cs.LG · cs.AI · cs.IT
- **원문 이용 조건**: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
- **제공 범위**: 논문 정보, 해설, 허용된 원문 그림

[논문 원문 ↗](https://arxiv.org/abs/2502.09720v3) · [원문 PDF ↗](https://arxiv.org/pdf/2502.09720v3)

AI 해설은 논문 원문과 별개의 설명이며 오류가 있을 수 있습니다. 원문과 그림은 각 출처의 이용 조건과 따로 표시된 권리를 따릅니다.

## 초록

Post-training quantization (PTQ) has emerged as a critical technique for efficient deployment of large language models (LLMs). This work proposes NestQuant, a novel PTQ scheme for weights and activations that is based on self-similar nested lattices. Recent works have mathematically shown such quantizers to be information-theoretically optimal for low-precision matrix multiplication. We implement a practical low-complexity version of NestQuant based on Gosset lattice, making it a drop-in quantizer for any matrix multiplication step (e.g., in self-attention, MLP etc). For example, NestQuant quantizes weights, KV-cache, and activations of Llama-3-8B to 4 bits, achieving perplexity of 6.6 on wikitext2. This represents more than 55% reduction in perplexity gap with respect to unquantized model (perplexity of 6.14) compared to state-of-the-art Metas SpinQuant (perplexity 7.3), OstQuant (7.3) and QuaRot (8.2). Comparisons on bigger models (up to 70B) and on various LLM evaluation benchmarks confirm uniform superiority of NestQuant.

## 원문 인용

Semyon Savkin, Eitan Porat, Or Ordentlich, Yury Polyanskiy (2025). NestQuant: Nested Lattice Quantization for Matrix Products and LLMs. arXiv:2502.09720v3. https://arxiv.org/abs/2502.09720v3

**BibTeX**

```
@misc{savkin2025nestquant,
  title = {{NestQuant: Nested Lattice Quantization for Matrix Products and LLMs}},
  author = {Semyon Savkin and Eitan Porat and Or Ordentlich and Yury Polyanskiy},
  year = {2025},
  eprint = {2502.09720},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2502.09720v3}
}
```

## 이 논문의 용어

- [Perplexity](https://refivu.com/terms/2b204e513801-perplexity)
- [Hessian](https://refivu.com/terms/cb53640b58ff-hessian)
- [KV cache](https://refivu.com/terms/cbf2f6d2bcc1-kv-cache)
- [dynamic programming](https://refivu.com/terms/07dfa7510a84-dynamic-programming)
- [WikiText2](https://refivu.com/terms/d68c6ead5039-wikitext2)
- [SpinQuant](https://refivu.com/terms/4bc195dd6ed7-spinquant)
- [QuIP#](https://refivu.com/terms/4c05a089cb90-quip)

## 다른 논문 해설

- [Generalists vs. Specialists: Evaluating LLMs on Highly-Constrained Biophysical Sequence Optimization Tasks](https://refivu.com/papers/90537ca5-09a6-4938-a0b2-cf8bcdd9bf45-generalists-vs-specialists-evaluating-llms-on-highly.md)
- [Speak Easy: Eliciting Harmful Jailbreaks from LLMs with Simple Interactions](https://refivu.com/papers/a94528b0-df05-4b76-91b4-955819162496-speak-easy-eliciting-harmful-jailbreaks-from-llms-with.md)
- [InfAlign: Inference-aware language model alignment](https://refivu.com/papers/c8a29ed9-8ab2-4e59-9865-5055bb8ee487-infalign-inference-aware-language-model-alignment.md)
- [Harnessing Uncertainty: Entropy-Modulated Policy Gradients for Long-Horizon LLM Agents](https://refivu.com/papers/e4b272e4-871e-408d-8fc3-3c7807a16367-harnessing-uncertainty-entropy-modulated-policy-gradients.md)
- [Memorization Sinks: Isolating Memorization during LLM Training](https://refivu.com/papers/94b8907e-d8e1-4ea1-8a9a-e62a36d359f5-memorization-sinks-isolating-memorization-during-llm.md)
- [Causes and Consequences of Representational Similarity in Machine Learning Models](https://refivu.com/papers/6b0ad684-cf72-44f6-a000-907b3bc08461-causes-and-consequences-of-representational-similarity-in.md)
- [Lightweight Online Adaption for Time Series Foundation Model Forecasts](https://refivu.com/papers/c00f0a05-872f-48a7-b6ca-19b0ce066ed1-lightweight-online-adaption-for-time-series-foundation-model.md)
- [BOOD: Boundary-based Out-Of-Distribution Data Generation](https://refivu.com/papers/e31ca2cc-2e5c-41cd-8320-3f730d24ffc5-bood-boundary-based-out-of-distribution-data-generation.md)
- [Kandinsky Conformal Prediction: Beyond Class- and Covariate-Conditional Coverage](https://refivu.com/papers/8ccec71d-2d82-4cf2-a00a-e6d8a8619c91-kandinsky-conformal-prediction-beyond-class-and-covariate.md)
- [Machines and Mathematical Mutations: Using GNNs to Characterize Quiver Mutation Classes](https://refivu.com/papers/41e2e0a5-75f6-4f8d-8cb3-0beaf8189b50-machines-and-mathematical-mutations-using-gnns-to.md)
- [EQ-VAE: Equivariance Regularized Latent Space for Improved Generative Image Modeling](https://refivu.com/papers/fab7b7ee-5523-498a-a636-595696465569-eq-vae-equivariance-regularized-latent-space-for-improved.md)
- [Efficient Time Series Processing for Transformers and State-Space Models through Token Merging](https://refivu.com/papers/637aada4-e7da-4070-87f0-b4b06a053937-efficient-time-series-processing-for-transformers-and-state.md)

---

AI 해설에는 오류가 있을 수 있습니다. [Refivu](https://refivu.com/papers/fcf33004-4ca4-4b0c-bd9b-474a77e2a35d-nestquant-nested-lattice-quantization-for-matrix-products)
