LinQuant:面向低精度线性递推的功能不变性
LinQuant: Functional Invariances for Low-Precision Linear Recurrences
AI总结:
LinQuant是基于7种功能不变性的低精度递推预填充框架,扩展SSDi8后在多款大模型匹配延迟下提升了困惑度,验证了其实用价值。
摘要:
线性递推正成为大语言模型中softmax注意力的实用替代方案,出现在独立架构与混合架构中。然而,尽管发展迅速,这类模型的低精度推理仍远不如softmaxattention成熟。预填充阶段,分块并行算法将大部分递推转化为稠密矩阵乘法,为低精度执行提供了自然路径。但直接对这些操作进行原生量化可能效果不佳。本研究中,我们识别出能保持全精度计算同时使操作数更适合量化的功能不变性。基于此,我们提出LinQuant——一种基于7种此类不变性(包括旋转、对角重缩放、递推衰减与写入因子的替代放置)的低精度递推预填充框架。我们推导了这些变换在涵盖线性、门控、δ规则更新的常见递推族中何时有效,并证明它们为提升低精度精度提供了互补自由度。最后,我们将该框架应用于生产,通过添加适用的不变性扩展了现有针对Mamba-2的低精度预填充流水线SSDi8。LinQuant在Mamba-2 1.3B、2.7B、8B及Nemotron-H 8B上,在匹配延迟的情况下提升了困惑度,证明了基于不变性的量化在递推模型中的实用价值。
英文摘要:
Linear recurrences are emerging as practical alternatives to softmax attention in large language models, appearing in both standalone and hybrid architectures. However, despite their rapid emergence, low-precision inference remains much less developed for these models than for softmax attention. During prefill, chunkwise-parallel algorithms cast much of the recurrence as dense matrix multiplications, suggesting a natural path to low-precision execution. Simply quantizing these operations in their native form, however, can be fragile. In this work, we identify functional invariances that preserve the full-precision computation while making the operands more amenable to quantization. Building on this observation, we introduce LinQuant, a framework for low-precision recurrent prefill based on seven such invariances, including rotations, diagonal rescalings, and alternative placements of recurrent decay and write factors. We derive when these transformations remain valid across common recurrence families spanning linear, gated, and delta-rule updates, and show that they provide complementary degrees of freedom for improving low-precision accuracy. We implement these transformations in INT8 and INT4 kernels and evaluate them on the recurrences of Nemotron-H, Qwen3.5, and Kimi Linear, recovering most of the accuracy lost to quantization while accelerating recurrent prefill. We also augment SSDi8, an existing low-precision prefill pipeline for Mamba-2, improving perplexity at matched prefill latency on pretrained Mamba-2 and Nemotron-H models. Altogether, these results demonstrate the practical utility of invariance-based quantization for recurrent models.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。