arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2606.07618cs.LGcs.AIcs.CV
收藏

ScaleSweep: 通过块尺度初始化实现LLM的精确NVFP4训练后量化

ScaleSweep: Accurate NVFP4 Post-Training Quantization of LLMs via Block Scale Initialization

Wangxuan Institute of Computer Technology, Peking University(北京大学王选计算机技术研究所)

Li Lin, Xiaojun Wan

AI总结:

提出ScaleSweep方法,通过扫描可行块尺度候选并选择最小化目标函数的候选,优化NVFP4量化中的尺度初始化,理论推导扫描范围边界,在Llama和Qwen模型上提升量化性能,缩小与全精度的差距。

摘要:

NVFP4是一种最近引入的硬件支持的FP4格式,通过细粒度块尺度提高了4位量化的保真度。然而,现有的NVFP4尺度初始化方法仍然主要依赖于AbsMax初始化,这与最优解之间存在明显差距。为了解决这个问题,我们提出了ScaleSweep,一种简单高效的尺度优化方法,它扫描可行的块尺度候选,并选择最小化目标函数的候选。我们进一步提供了NVFP4量化的理论分析,并推导了在原始张量与量化重建张量之间的均方误差(MSE)和加权均方误差(WMSE)下所需扫描范围的上下界。所提出的界限大幅减少了扫描空间,同时保留了最优候选,使得与基线量化算子相比开销可忽略。在Llama和Qwen模型上的实验表明,ScaleSweep持续优于现有的初始化方法,并进一步缩小了与全精度的差距。特别是在对权重、激活、KV缓存和查询状态进行激进的全端到端量化时,ScaleSweep保留了超过93%的全精度性能。

英文摘要:

NVFP4 is a recently introduced hardware-supported FP4 format that improves the fidelity of 4-bit quantization through fine-grained block scales. However, existing NVFP4 scale initialization methods still primarily rely on AbsMax initialization, which leaves a noticeable gap to the optimal solution. To address this, we propose ScaleSweep, a simple and efficient scale optimization method that sweeps over feasible block scale candidates and selects the candidate that minimizes a target objective. We further provide a theoretical analysis of NVFP4 quantization and derive both lower and upper bounds for the required sweep range under mean square error (MSE) and weighted mean square error (WMSE) between the original tensor and the quantized reconstructed tensor. The proposed bounds substantially reduce the sweep space while preserving the optimal candidate, enabling negligible overhead compared with the baseline quantization operators. Experiments on Llama and Qwen models demonstrate that ScaleSweep consistently improves quantization performance over existing initialization methods and further narrows the gap to full precision. In particular, under aggressive end-to-end quantization of weights, activations, KV cache, and query states, ScaleSweep preserves more than 93% of the full-precision performance.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑