Papers

SHq:面向大模型权重量化的可学习网格

SHq: Learnable Grids for LLM Weight Quantization

Why we picked it

这篇论文把 NF4、INT 这类固定量化网格换成了带两个参数的 SHq,4 比特下误差全面更低,还比 NVFP4 降了四到六成 KL 散度,做量化部署的值得看。

论文提出 SHq,一种用于块缩放查找表(LUT)量化格式的闭式网格家族,由压缩强度 α 和偏移 c 两个参数定义。偏移可借助 FP8 块缩放的符号位在网格与其镜像之间切换,使每个块可用的取值数量最多翻倍。在 3B 到 35B 参数的五个模型(含 MoE 架构)上,以 RTN 和 GPTQ 在 2-6 比特下评测,SHq 在 3、4 比特的全部设置中取得最低 KL 散度,相比最优固定网格最多提升 34%。在每权重 4.5 比特时,SHq 将 NVFP4 的 KL 散度降低 41-67%,同时提升下游精度。

Original · arXiv cs.LG

SHq: Learnable Grids for LLM Weight Quantization

Block-scaled lookup-table (LUT) formats, which represent weights as indices into a small value set (the grid), have become standard for low-bit LLM quantization, ranging from NF4 and BOF4 to the 3-bit LUT instruction in NVIDIA Rubin. While these formats leave the grid definition flexible, existing implementations rely on fixed grids derived either from numerical data types (INT, FP) or assumed weight distributions (NF, BOF). We demonstrate that no single fixed grid is universally optimal; the best fixed grid varies with bit-width: BOFS at 2 bits, NF at 4 and 5 bits, and INT at 6 bits. We introduce SHq, a closed-form family of grids parameterized by two critical degrees of freedom: a companding strength α that interpolates level spacing from uniform to floating-point-like, and an offset c that introduces asymmetry. This offset allows the sign bit of the FP8 block scale, otherwise unused, to select between the grid and its mirror image, up to doubling the number of distinct values available per block. SHq modifies only the lookup table contents and serves as a drop-in replacement for the grid in any such format. Across five models ranging from 3B to 35B parameters, including a mixture-of-experts architecture, evaluated at 2-6 bits using RTN and GPTQ, SHq achieves the lowest KL divergence in every setting at 3 and 4 bits and in most settings at 2, 5 and 6 bits. It outperforms the best fixed grid by up to 34% and remains superior under mixed-precision configurations. At 4.5 bits per weight, the SHq format reduces the KL divergence of NVFP4 by 41-67% while improving downstream accuracy. Grid families incorporating both spacing and offset parameters perform comparably, whereas those lacking an offset exhibit clearly higher error, confirming that these two degrees of freedom drive the observed gains. We therefore propose SHq as the standard grid for block-scaled lookup-table formats.