一次微调适配多种精度,让手机端大模型灵活切换且性能不降。
OTARo: Once Tuning for All Precisions toward Robust On-Device LLMs
- 用共享指数浮点机制,通过截断尾数生成不同精度版本。
- 在多个比特位下保持稳定表现,8B模型在4比特时仍接近全精度效果。
- 适合需要动态调整精度的移动端大模型应用,如手机端问答与生成。
大语言模型(LLMs)的微调不仅能提升对下游任务的适应性,还能缓解量化带来的负面影响。然而,传统量化方法存在结构限制,难以在微调和部署阶段灵活支持不同精度。实际设备任务对精度需求各异:理解类任务对低精度容忍度更高,而生成任务则更敏感。传统量化依赖各比特位不兼容的缩放因子,无法实现设备端灵活切换。为此,我们提出OTARo,一种只需一次微调即可支持多精度、保持性能鲁棒的方案。OTARo引入共享指数浮点(SEFP)机制,通过单一模型的尾数截断生成不同比特宽度。为实现多精度鲁棒性,其采用针对不同比特位损失的学习策略,包含两项关键设计:(1) 利用评分机制迭代更新的探索-利用比特路径搜索(BPS);(2) 在低比特下进行异步梯度累积与延迟更新的低精度异步累加(LAA)。在主流模型如LLaMA3.2-1B、LLaMA3-8B上的实验表明,OTARo在所有精度下均表现出一致强健的性能。
原文摘要 · Abstract (English)
Large Language Models (LLMs) fine-tuning techniques not only improve the adaptability to diverse downstream tasks, but also mitigate adverse effects of model quantization. Despite this, conventional quantization suffers from its structural limitation that hinders flexibility during the fine-tuning and deployment stages. Practical on-device tasks demand different quantization precisions (i.e. different bit-widths), e.g., understanding tasks tend to exhibit higher tolerance to reduced precision compared to generation tasks. Conventional quantization, typically relying on scaling factors that are incompatible across bit-widths, fails to support the on-device switching of precisions when confronted with complex real-world scenarios. To overcome the dilemma, we propose OTARo, a novel method that enables on-device LLMs to flexibly switch quantization precisions while maintaining performance robustness through once fine-tuning. OTARo introduces Shared Exponent Floating Point (SEFP), a distinct quantization mechanism, to produce different bit-widths through simple mantissa truncations of a single model. Moreover, to achieve bit-width robustness in downstream applications, OTARo performs a learning process toward losses induced by different bit-widths. The method involves two critical strategies: (1) Exploitation-Exploration Bit-Width Path Search (BPS), which iteratively updates the search path via a designed scoring mechanism; (2) Low-Precision Asynchronous Accumulation (LAA), which performs asynchronous gradient accumulations and delayed updates under low bit-widths. Experiments on popular LLMs, e.g., LLaMA3.2-1B, LLaMA3-8B, demonstrate that OTARo achieves consistently strong and robust performance for all precisions.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。