arXiv:2603.28765cs.CL2026-03被引 3

针对4位量化误差分布不均问题,提出可自适应选择整数/浮点表示的IF4格式。

Adaptive Block-Scaled Data Types

  • 按每16个值分组动态选择整数或浮点表示,提升精度
  • 在语言模型上实现更低训练损失和更高推理准确率
  • 适配下一代硬件,支持高效乘加运算,适合部署优化

NVFP4作为4比特量化大语言模型的流行格式,得益于硬件支持及保留有效信息的能力。然而,其存在误差分布不均的问题:每16个值一组中,接近最大值的数值会引入大量量化误差。本文基于此发现,设计了自适应块缩放数据类型。针对4比特量化,提出IF4(Int/Float 4)数据类型,对每组16个值动态选择FP4或INT4表示,并沿用NVFP4的E4M3缩放因子。通过缩放因子符号位标识所选类型(该位在NVFP4中未使用)。基于相同思路,扩展至其他位宽,如IF3和IF6。实验表明,使用IF4量化语言模型时,在量化训练中损失更低,后训练量化任务上准确率更高。此外,设计并评估了支持IF4的乘加(MAC)单元,验证其在下一代硬件加速器中的高效实现可行性。代码已开源:https://github.com/mit-han-lab/fouroversix。

原文摘要 · Abstract (English)

NVFP4 has grown increasingly popular as a 4-bit format for quantizing large language models due to its hardware support and its ability to retain useful information with relatively few bits per parameter. However, the format is not without limitations: recent work has shown that NVFP4 suffers from its error distribution, resulting in large amounts of quantization error on near-maximal values in each group of 16 values. In this work, we leverage this insight to design new Adaptive Block-Scaled Data Types that can adapt to the distribution of their input values. For four-bit quantization, our proposed IF4 (Int/Float 4) data type selects between FP4 and INT4 representations for each group of 16 values, which are then scaled by an E4M3 scale factor as is done with NVFP4. The selected data type is denoted using the scale factor's sign bit, which is currently unused in NVFP4, and we apply the same insight to design formats for other bit-widths, including IF3 and IF6. When used to quantize language models, we find that IF4 outperforms existing 4-bit block-scaled formats, achieving lower loss during quantized training and achieving higher accuracy on many tasks in post-training quantization. We additionally design and evaluate an IF4 Multiply-Accumulate (MAC) unit to demonstrate that IF4 can be implemented efficiently in next-generation hardware accelerators. Our code is available at https://github.com/mit-han-lab/fouroversix.

量化4比特自适应硬件加速

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。