让大模型各层用不同精度,自动优化部署效率与准确率。
dMX: Differentiable Mixed-Precision Assignment for Low-Precision Floating-Point Formats

- 用可微分方法动态分配每层浮点精度,避免硬切换。
- 在多个大模型上降低困惑度,比传统方法提升性能。
- 适合关注模型压缩与推理效率的开发者使用。
将大语言模型(LLM)量化为低精度浮点表示是高效部署的关键,但对所有层采用统一位宽会损害性能与精度。本文提出dMX,一种用于可学习浮点位宽分配的可微分混合精度量化框架,应用于开放计算项目(OCP)定义的微缩浮点(MXFP)数据类型。每层的位宽分配被建模为连续优化问题,通过标量参数表示,将多维设计空间简化为单一可学习偏移量。训练时该偏移量取连续值,避免离散量化格式间的突变。采用温度退火策略逐步将学习到的偏移量离散化,确保最终配置映射至硬件兼容的MXFP格式,且训练与推理行为无突变。引入目标感知正则项,引导平均位宽接近用户指定预算,作为推理成本的粗粒度代理,平衡模型质量与部署效率。我们在Llama、Qwen3和SmolLM2等模型上进行实验,评估其在WikiText-2上的困惑度及四个零样本推理基准的准确率。结果表明,dMX始终生成帕累托占优模型,优于基于KL散度的层选择启发式方法,高效权衡模型质量与平均位宽。
原文摘要 · Abstract (English)
Quantizing large language models (LLMs) to low-precision floating-point representations is central to efficient deployment, yet applying a single bit-width uniformly across all layers is sub-optimal in terms of both performance and accuracy. This work introduces dMX, a differentiable mixed-precision quantization framework for learnable floating-point bit-width assignment. We study its application for the microscaling floating-point (MXFP) family of data types defined by the Open Compute Project (OCP) standard. The per-layer bit-width assignment is formulated as a continuous optimization problem in which each layer's floating-point format format is parameterized by a scalar parameter, folding the multi-variate design space into a single learnable offset. During training this offset takes continuous values, avoiding sudden oscillations between discrete quantization formats. A temperature-based annealing schedule progressively discretizes the learned offsets, ensuring that the final configuration maps to hardware-compatible MXFP formats without abrupt transitions between training and inference behavior. A target-aware regularization term steers the average bit-width toward a user-specified budget, serving as a coarse-grained proxy for inference cost and balancing model quality against deployment efficiency. We performed experiments on different families of LLM, such as Llama, Qwen3, and SmolLM2, evaluating perplexity on WikiText-2 and accuracy on four zero-shot reasoning benchmarks. Across these settings, dMX consistently yields Pareto-dominating models and improves over Kullback-Leibler (KL) divergence-based layer-selection heuristics, efficiently navigating trade-offs between model quality and average bit-width.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。