AMXFP4:利用非对称微缩放浮点数抑制激活异常值以实现4-bit LLM推理
AMXFP4: Taming Activation Outliers with Asymmetric Microscaling Floating-Point for 4-bit LLM Inference
AI总结:
本文提出AMXFP4,一种无需校准的4-bit非对称浮点数格式,通过非对称共享缩放因子同时解决激活异常值和组内非对称性问题,在极低硬件成本下显著提升了LLM推理精度并超越现有方法。
摘要:
随着大型语言模型(LLMs)的参数规模和上下文长度不断增长,计算精度已从16-bit降至4-bit以提高推理效率。然而,这种降低会导致由于激活异常值引起的精度下降。基于旋转的INT4方法通过矩阵校准解决了这一问题,但它们引入了数小时的开销,并将关键计算保留在全精度。微缩放(Microscaling, MX)浮点数(FP)格式通过共享缩放因子提供了细粒度的表示,使得无需校准即可通过直接转换实现全量化矩阵乘法。然而,现有研究表明MXFP4推理的实验结果并不理想,且MX格式的鲁棒性在很大程度上尚未被探索。在本研究中,我们揭示了MX格式的基本权衡:虽然它有效地抑制了激活异常值,但代价是增加了组内非对称性。为了解决这一问题,我们提出了AMXFP4,这是一种4-bit非对称FP格式,它使用非对称共享缩放因子同时处理这两个问题,且无需校准。我们定制的MAC引擎增加了可忽略不计的硬件成本,同时提高了精度:AMXFP4在VQA上比MXFP4高出3%,在CSQA上比基于旋转的方法高出1.6%。它还超越了最近部署的商业MXFP4变体。代码:https://github.com/aiha-lab/MX-QLLM
英文摘要:
As large language models (LLMs) grow in parameter size and context length, computation precision has been reduced from 16-bit to 4-bit to improve inference efficiency. However, this reduction causes accuracy degradation due to activation outliers. Rotation-based INT4 methods address this via matrix calibration, but they introduce multi-hour overheads and leave key computations in full precision. Microscaling (MX) floating-point (FP) formats offer fine-grained representation with a shared scale, enabling fully quantized matrix multiplications through direct casting without calibration. However, existing research shows unsatisfactory empirical results for MXFP4 inference, and the robustness of MX formats remains largely unexplored. In this work, we uncover the fundamental tradeoffs of the MX format: while it effectively suppresses activation outliers, it does so at the cost of increased group-wise asymmetry. To address this, we propose AMXFP4, a 4-bit asymmetric FP format that handles both issues using asymmetric shared scales, without requiring calibration. Our custom MAC engine adds negligible hardware cost while improving accuracy: AMXFP4 outperforms MXFP4 by 3% on VQA and exceeds rotation-based methods by 1.6% on CSQA. It also surpasses recently deployed commercial MXFP4 variants. Code: https://github.com/aiha-lab/MX-QLLM
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。