NF4并非信息论最优(而这是件好事)
NF4 Isn't Information Theoretically Optimal (and that's Good)
AI总结:
本文指出NF4数据类型并非表示正态分布权重的信息论最优方案,因待量化值分布受块大小影响,进而提出基于最小化期望L1重构误差的改进编码,在大块尺寸下性能更优。
摘要:
本说明分享了与Dettmers等人2023年提出的基于absmax的分块量化相关的一些简单计算与实验。他们提出的NF4数据类型据称在表示正态分布权重时具备信息论最优性。本文表明该说法并不完全成立,因为待量化值的分布取决于块大小。本文尝试应用这些见解,基于最小化期望L1重构误差推导改进编码,而非采用基于分位数的方法。实验显示,在较大的量化块尺寸下该方法性能更优,而在较小块尺寸下两种编码表现相近。
英文摘要:
This note shares some simple calculations and experiments related to absmax-based blockwise quantization, as used in Dettmers et al., 2023. Their proposed NF4 data type is said to be information theoretically optimal for representing normally distributed weights. I show that this can't quite be the case, as the distribution of the values to be quantized depends on the block-size. I attempt to apply these insights to derive an improved code based on minimizing the expected L1 reconstruction error, rather than the quantile based method. This leads to improved performance for larger quantization block sizes, while both codes perform similarly at smaller block sizes.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。