让大模型在量化后仍保持高性能,通过动态旋转优化训练过程。
RoSTE: An Efficient Quantization-Aware Supervised Fine-Tuning Approach for Large Language Models
- 引入旋转直通估计器,边微调边适应量化,提升低比特精度。
- 在多个模型上实现比传统方法更高的性能,如Pythia、Qwen和Llama。
- 适合需要高效部署大模型的场景,尤其关注量化压缩与性能平衡者。
监督微调是将预训练大语言模型(LLMs)适配下游任务的标准方法。量化作为高效的模型部署后处理技术近年受到关注。传统流程先微调再量化,常因忽略微调与量化之间的协同效应导致性能下降。为有效实现权重、激活值和键值缓存的低比特量化,本文提出旋转直通估计器(RoSTE),结合量化感知微调(QA-SFT)与自适应旋转策略,识别有效旋转配置以减少激活异常值。理论分析表明,在过参数化最小二乘量化训练问题中,预测误差与收敛权重的量化误差成正比,可通过优化旋转配置有效控制。在Pythia、Qwen和Llama等不同规模模型上的实验验证了该方法的有效性,相比现有后微调量化基线,本方法在各类任务和架构下均表现更优。代码已开源:https://github.com/OptimAI-Lab/RoSTE。
原文摘要 · Abstract (English)
Supervised fine-tuning is a standard method for adapting pre-trained large language models (LLMs) to downstream tasks. Quantization has been recently studied as a post-training technique for efficient LLM deployment. To obtain quantized fine-tuned LLMs, conventional pipelines would first fine-tune the pre-trained models, followed by post-training quantization. This often yields suboptimal performance as it fails to leverage the synergy between fine-tuning and quantization. To effectively realize low-bit quantization of weights, activations and KV caches in LLMs, we propose an algorithm named Rotated Straight-Through-Estimator (RoSTE), which combines quantization-aware supervised fine-tuning (QA-SFT) with an adaptive rotation strategy that identifies an effective rotation configuration to reduce activation outliers. We provide theoretical insights on RoSTE by analyzing its prediction error when applied to an overparameterized least square quantized training problem. Our findings reveal that the prediction error is directly proportional to the quantization error of the converged weights, which can be effectively managed through an optimized rotation configuration. Experiments on Pythia, Qwen and Llama models of different sizes demonstrate the effectiveness of RoSTE. Compared to existing post-SFT quantization baselines, our method consistently achieves superior performances across various tasks and different LLM architectures. Our code is available at https://github.com/OptimAI-Lab/RoSTE.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。