LoTA-QAF:用于量化感知微调的无损三进制适应
摘要
量化和 fine-tuning 是将大型语言模型 (LLM) 部署到 resource-constrained edge devices 的关键步骤。然而,fine-tuning 量化模型 presents significant challenges,主要源于:首先,低精度量化权重(例如 4 位)与高精度 adaptation weights(例如 16 位)之间的数据类型不匹配。这限制了量化权重在推理期间提供的计算效率优势。其次,在将这些 high-precision adaptation weights 合并到 low-precision 量化权重时可能出现 accuracy degradation,由于 adaptation weights 常常需要 approximation 或截断。第三,据我们所知,现有方法不支持在调整 all 量化权重的同时进行无损合并 adaptation。为解决这些挑战,我们引入 lossless ternary adaptation for quantization-aware fine-tuning (LoTA-QAF)。这是一个 novel fine-tuning method specifically designed for quantized LLMs, enabling the lossless merging of ternary adaptation weights into quantized weights and the adjustment of all quantized weights。LoTA-QAF 通过以下方式运行:i) 定制的 ternary adaptation (TA) 将 ternary weights 与 quantization grid 对齐,并使用这些 ternary weights 来调整 quantized weights。ii) 基于 TA 的 mechanism 使 adaptation weights 的无损合并成为可能。iii) 用于更新 TA weights 的 ternary signed gradient descent (t-SignSGD)。我们将 LoTA-QAF 应用于 Llama-3.1/3.3 和 Qwen-2.5 model families,并在 several downstream tasks 上验证其有效性。在 MMLU benchmark 上,我们的方法有效恢复了 quantized models 的性能,超过 16-bit LoRA 最高可达 5.14%。对于 task-specific fine-tuning,16-bit LoRA 实现了优异结果,但 LoTA-QAF 仍优于其他方法。代码:https://github.com/KingdalfGoodman/LoTA-QAF。
引用
@article{arxiv.2505.18724,
title = {LoTA-QAF: Lossless Ternary Adaptation for Quantization-Aware Fine-Tuning},
author = {Junyu Chen and Junzhuo Li and Zhen Peng and Wenjie Wang and Yuxiang Ren and Long Shi and Xuming Hu},
journal= {arXiv preprint arXiv:2505.18724},
year = {2025}
}