Paper Reading AI Learner

LoTA-QAF: Lossless Ternary Adaptation for Quantization-Aware Fine-Tuning

2025-05-24 14:47:28
Junyu Chen, Junzhuo Li, Zhen Peng, Wenjie Wang, Yuxiang Ren, Long Shi, Xuming Hu

Abstract

Quantization and fine-tuning are crucial for deploying large language models (LLMs) on resource-constrained edge devices. However, fine-tuning quantized models presents significant challenges, primarily stemming from: First, the mismatch in data types between the low-precision quantized weights (e.g., 4-bit) and the high-precision adaptation weights (e.g., 16-bit). This mismatch limits the computational efficiency advantage offered by quantized weights during inference. Second, potential accuracy degradation when merging these high-precision adaptation weights into the low-precision quantized weights, as the adaptation weights often necessitate approximation or truncation. Third, as far as we know, no existing methods support the lossless merging of adaptation while adjusting all quantized weights. To address these challenges, we introduce lossless ternary adaptation for quantization-aware fine-tuning (LoTA-QAF). This is a 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 operates through a combination of: i) A custom-designed ternary adaptation (TA) that aligns ternary weights with the quantization grid and uses these ternary weights to adjust quantized weights. ii) A TA-based mechanism that enables the lossless merging of adaptation weights. iii) Ternary signed gradient descent (t-SignSGD) for updating the TA weights. We apply LoTA-QAF to Llama-3.1/3.3 and Qwen-2.5 model families and validate its effectiveness on several downstream tasks. On the MMLU benchmark, our method effectively recovers performance for quantized models, surpassing 16-bit LoRA by up to 5.14\%. For task-specific fine-tuning, 16-bit LoRA achieves superior results, but LoTA-QAF still outperforms other methods.

Abstract (translated)

量化和微调对于在资源受限的边缘设备上部署大型语言模型(LLMs)至关重要。然而,对量化模型进行微调带来了显著的挑战,主要原因是: 首先,低精度量化权重(例如4位)与高精度适应权重(例如16位)之间存在数据类型不匹配的问题。这种不匹配限制了在推理过程中量化权重提供的计算效率优势。 其次,在将这些高精度适应权重合并到低精度量化权重时可能出现准确度下降的情况,因为适应权重往往需要近似或截断处理。 第三,据我们所知,目前尚无任何方法支持在调整所有量化权重的同时进行无损融合适应过程。 为解决上述挑战,我们提出了一种面向量化感知微调(QAT)的无损三值适应技术(LoTA-QAF)。这是一种专门针对量化LLMs设计的新颖微调方法,它能够实现将三值适应权重无损地合并到量化权重中,并调整所有量化权重。LoTA-QAF通过以下组合方式运行: i) 设计了一种自定义的三值适应(TA),该机制使三值权重与量化网格对齐,并使用这些三值权重来调整量化权重。 ii) 基于TA的机制,使得可以无损地融合适应权重。 iii) 用于更新TA权重的三值有符号梯度下降法(t-SignSGD)。 我们将LoTA-QAF应用于Llama-3.1/3.3和Qwen-2.5模型家族,并在多个下游任务上验证了其有效性。在MMLU基准测试中,我们的方法有效恢复了量化模型的性能,比16位低秩适应(LoRA)高出最多5.14%。对于特定任务的微调而言,虽然16位LoRA表现出色,但LoTA-QAF仍然优于其他方法。 这种方法在保持计算效率的同时提高了量化LLMs的精度和灵活性,在资源受限设备上的应用前景广阔。

URL

https://arxiv.org/abs/2505.18724

PDF

https://arxiv.org/pdf/2505.18724.pdf


Tags
3D Action Action_Localization Action_Recognition Activity Adversarial Agent Attention Autonomous Bert Boundary_Detection Caption Chat Classification CNN Compressive_Sensing Contour Contrastive_Learning Deep_Learning Denoising Detection Dialog Diffusion Drone Dynamic_Memory_Network Edge_Detection Embedding Embodied Emotion Enhancement Face Face_Detection Face_Recognition Facial_Landmark Few-Shot Gait_Recognition GAN Gaze_Estimation Gesture Gradient_Descent Handwriting Human_Parsing Image_Caption Image_Classification Image_Compression Image_Enhancement Image_Generation Image_Matting Image_Retrieval Inference Inpainting Intelligent_Chip Knowledge Knowledge_Graph Language_Model LLM Matching Medical Memory_Networks Multi_Modal Multi_Task NAS NMT Object_Detection Object_Tracking OCR Ontology Optical_Character Optical_Flow Optimization Person_Re-identification Point_Cloud Portrait_Generation Pose Pose_Estimation Prediction QA Quantitative Quantitative_Finance Quantization Re-identification Recognition Recommendation Reconstruction Regularization Reinforcement_Learning Relation Relation_Extraction Represenation Represenation_Learning Restoration Review RNN Robot Salient Scene_Classification Scene_Generation Scene_Parsing Scene_Text Segmentation Self-Supervised Semantic_Instance_Segmentation Semantic_Segmentation Semi_Global Semi_Supervised Sence_graph Sentiment Sentiment_Classification Sketch SLAM Sparse Speech Speech_Recognition Style_Transfer Summarization Super_Resolution Surveillance Survey Text_Classification Text_Generation Time_Series Tracking Transfer_Learning Transformer Unsupervised Video_Caption Video_Classification Video_Indexing Video_Prediction Video_Retrieval Visual_Relation VQA Weakly_Supervised Zero-Shot