arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2610.21808cs.AIcs.CL
收藏

RoleQ:用于将语言模型转换为三值模型的角色对齐缩放方案

RoleQ: Role-Aligned Scales for Converting Language Models to Ternary

Harvard University(哈佛大学);Georgia Tech(佐治亚理工学院)

Johannes Knittel, Alec Helbling, Hanspeter Pfister

AI总结:

本文提出RoleQ量化框架,依据Transformer单元功能角色设置缩放因子,可高效将语言模型转为三值模型,在多规模模型上降低困惑度、提升MMLU,性能优于现有后训练三值方法。

摘要:

低于4位的权重量化可在保持困惑度可接受的情况下缩减内存与带宽,但通常会以事实知识和任务精度为代价。三值权重大多通过从头训练或长时间微调获得。本文提出RoleQ量化框架,该框架依据Transformer单元的功能角色而非传统格式的权重矩阵布局来设置缩放因子:从残差流读取的向量每个输出单元对应一个缩放因子,写入残差流的向量每个输入单元对应一个缩放因子。该规则具有结构性,无需搜索、校准或存储状态,且适用于整数和三值网格。在旋转基下,其求解器工作量仅为按层轴搜索的一半;在三值场景中,针对0.6B至14B各规模的两类模型,与基于布局的缩放方式相比,其困惑度最多降低一半,而按行缩放会使MMLU降至随机水平。本文的轻量级后训练流水线可在数GPU小时内将现有检查点转换为每权重1.59位,成本仅为学习型三值化的一小部分,且在困惑度、零样本精度和MMLU(尤其在知识任务上)方面,在匹配或更低的内存驻留位宽下优于所有后训练三值方法。通过按单元Fisher显著性放置的稀疏第二三值平面可保持矩阵乘法无开销,恢复三值化首先损失的内容:在8B规模下,仅需一小部分位宽即可恢复约为转换成本一半的MMLU,在相同位宽下远超随机或基于Hessian的放置方式。

英文摘要:

Weight quantization below four bits shrinks memory and bandwidth at a perplexity that looks acceptable, but often at the cost of factual knowledge and task accuracy. Ternary weights have mostly been obtained by training from scratch or long fine-tuning. We introduce RoleQ, a quantization framework that places scales by the functional roles of Transformer units rather than by the layout of the weight matrix, as conventional formats do. Vectors that read from the residual stream take one scale per output unit; those that write to it, one per input unit. The rule is structural, needs no search, calibration or stored state, and holds on integer and ternary grids. In a rotated basis it matches a per-layer axis search at half the solver work, and at ternary it cuts perplexity by up to half against layout-based placement in two families at every size from 0.6B to 14B, where per-row scales leave MMLU at chance. Our lightweight post-training pipeline converts an existing checkpoint to 1.59 bits per weight in a few GPU-hours, a fraction of the cost of learned ternarization, and leads every post-training ternary method at matched or lower memory-resident bits on perplexity, zero-shot accuracy and MMLU, most widely on knowledge. A sparse second ternary plane placed by a per-unit Fisher saliency keeps the matmul multiplication-free and recovers what ternary loses first: at 8B, a fraction of a bit returns about half the MMLU that conversion costs, well ahead of random or Hessian-based placement at equal bits.

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

↑