通过分解模型组件,找出4位量化中误差主因并针对性修复。
Depth Registers Unlock W4A4 on SwiGLU: A Reader/Generator Decomposition

- 将线性层分为残差读取和块内生成两类,定位误差来源
- 引入深度寄存器方法使量化后困惑度降至119(原为1727)
- 适合关注模型量化优化与训练干预的工程师与研究者
我们在一个3亿参数的SwiGLU解码器模型上,研究了在50亿条细粒度网页数据训练后的后训练W4A4量化。朴素四舍五入的W4A4导致验证困惑度从FP16的23.6飙升至1727。通过训练时引入残差轴深度寄存器与寄存器幅度铰链损失(DR+sink),困惑度降至119(约14倍改善),且保持与FP16相当的零样本能力。该方法可与SmoothQuant结合,进一步降至39.9困惑度。我们发现,残差轴上的输入激活主导了误差:在每个SwiGLU模块中,五个可训练线性层分为残差轴读取器(qkv, w1, w3)和块内生成器(o_proj, w2)。理论分析表明,残差轴幅度控制能紧约束读取器,但对生成器的双线性输入仅能给出平凡乘积边界。实验显示,DR+sink有效降低读取器的峰度,而生成器几乎不变;修复后残留熵稳定在约0.28纳特,且在三个匹配检查点上Δ移除(w2)占主导。本工作将DR+sink作为训练时探针,而非部署方案;事后替代方法Per-Linear QuaRot近似达成其读取轴效果。全量QuaRot虽增加在线头值哈达玛与w2输入旋转,仍无法弥合差距,直接验证了正交旋转无法约束双线性尾部的预测。结论限于300M参数、5B token、单种子设置,且未分离分区与铰链作用。
原文摘要 · Abstract (English)
We study post-training W4A4 quantization in a controlled 300M-parameter SwiGLU decoder-only language model trained on 5B tokens of FineWeb-Edu, and ask which input-activation sites dominate the error. Naive round-to-nearest W4A4 collapses validation perplexity from FP16 23.6 to 1727. A simple residual-axis training-time intervention -- Depth Registers with a register-magnitude hinge loss (DR+sink) -- reduces this to 119 (about 14x) at matched FP16 PPL and matched zero-shot capacity, and composes with SmoothQuant to 39.9 PPL. The residual ~2 PPL gap to FP16 is the diagnostic core. We decompose W4A4 damage by input-activation site: the five trainable linears in a SwiGLU block split into residual-axis readers (qkv, w1, w3) and block-internal generators (o_proj, w2). Elementary norm arguments show residual-axis magnitude control bounds readers tightly but leaves w2's bilinear input bounded only by the trivial product of factor bounds; empirically, DR+sink collapses reader kurtosis while leaving generators essentially unchanged, and the reader-rescued W4A4 residue is flat at ~0.28 nats across three matched checkpoints with Delta-remove(w2) dominating. We present DR+sink as a training-time probe rather than a deployment proposal: a post-hoc alternative (Per-Linear QuaRot) nearly matches it on the reader axis. Full QuaRot -- adding online per-head value Hadamard plus online w2-input rotation -- does not close the gap either, directly testing the prediction that orthogonal rotation cannot bound the bilinear SwiGLU tail. Claims are specific to our 300M, 5B-token, single-seed setting, and our experiments do not isolate the partition from the hinge.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。