paper-with-me

Papers

FlatQuant: Flatness Matters for LLM Quantization

2024-10-12 · Yuxuan Sun, Ruikang Liu, Haoli Bai, Han Bao, Kang Zhao, Yuening Li, Jiaxin Hu, Xianzhi Yu, Lu Hou, Chun Yuan, Xin Jiang, Wulong Liu, Jun Yao

Recently, quantization has been widely used for the compression and acceleration of large language models~(LLMs). Due to the outliers in LLMs, it is crucial to flatten weights and activations to minimize quantization error with the equally spaced quantization points. Prior research explores various pre-quantization transformations to suppress outliers, such as per-channel scaling and Hadamard transformation. However, we observe that these transformed weights and activations can still remain steep and outspread. In this paper, we propose FlatQuant (Fast and Learnable Affine Transformation), a new post-training quantization approach to enhance flatness of weights and activations. Our approach identifies optimal affine transformations tailored to each linear layer, calibrated in hours via a lightweight objective. To reduce runtime overhead, we apply Kronecker decomposition to the transformation matrices, and fuse all operations in FlatQuant into a single kernel. Extensive experiments show that FlatQuant sets up a new state-of-the-art quantization benchmark. For instance, it achieves less than $\textbf{1}\%$ accuracy drop for W4A4 quantization on the LLaMA-3-70B model, surpassing SpinQuant by $\textbf{7.5}\%$. For inference latency, FlatQuant reduces the slowdown induced by pre-quantization transformation from 0.26x of QuaRot to merely $\textbf{0.07x}$, bringing up to $\textbf{2.3x}$ speedup for prefill and $\textbf{1.7x}$ speedup for decoding, respectively. Code is available at: \url{https://github.com/ruikangliu/FlatQuant}.

📄 PDF Abstract BibTeX arXiv:2410.09426

Code (1)

ruikangliu/flatquant 공식 구현 pytorch

Tasks

Quantization

Similar Papers 제목 키워드 기반

Theory-optimal Quantization Based on Flatness

2026-05-11 · Xiusheng Huang, Zhe Li, Xuanwu Yin, Lu Wang 외 arxiv

Post-training quantization has emerged as a widely adopted technique for compressing and accelerating the inference of Large Language Models (LLMs). The primary challenges in LLMs quantization stem from activation outlie…

Understanding Flatness in Generative Models: Its Role and Benefits

2025-03-14 · Taehwan Lee, Kyeongkook Seo, Jaejun Yoo, Sung Whan Yoon

Flat minima, known to enhance generalization and robustness in supervised learning, remain largely unexplored in generative models. In this work, we systematically investigate the role of loss surface flatness in generat…

Noise EstimationQuantization

A Case Study of Selected PTQ Baselines for Reasoning LLMs on Ascend NPU

2026-02-06 · Yuchen Luo, Fangyue Zhu, Ruining Zhou, Mingzhe Huang 외 arxiv

Post-Training Quantization (PTQ) is crucial for efficient model deployment, yet its effectiveness on Ascend NPU remains under-explored compared to GPU architectures. This paper presents a case study of representative PTQ…

Quantization Meets OOD: Generalizable Quantization-aware Training from a Flatness Perspective

2025-08-31 · Jiacheng Jiang, Yuan Meng, Chen Tang, Han Yu 외 arxiv

Current quantization-aware training (QAT) methods primarily focus on enhancing the performance of quantized models on in-distribution (I.D) data, while overlooking the potential performance degradation on out-of-distribu…

Image Classification

DynamicPTQ: Mitigating Activation Quantization Collapse via Residual-Stream Dynamics

2026-06-10 · Zimo Zhao, Maolin Wang, Bowen Yu, Bowen Liu 외 arxiv

Post-training quantization (PTQ) is essential for efficient large language model inference, but reliably quantizing activations remains challenging when weights, activations, and KV caches are all quantized to 4-bit prec…