根据梯度动态选择更新层数,让小模型微调更快更省显存。
AdaGradSelect: An adaptive gradient-guided layer selection method for efficient fine-tuning of SLMs
- 按梯度大小自适应选层更新,初期探索、后期聚焦关键层。
- 比全量微调快12%,显存减少35%,性能接近全量微调。
- 适合资源受限场景,尤其对小语言模型效率提升显著。
大型语言模型(LLMs)能胜任多种自然语言任务,但全量微调成本高且占用大量内存。参数高效微调(PEFT)方法如LoRA通过在冻结权重上添加小规模低秩更新来降低成本,但限制了训练空间,可能影响性能。针对更注重效率的小语言模型(SLMs),本文提出AdaGradSelect,一种基于梯度引导的自适应层选择方法。早期发现仅更新梯度范数最高的变换器层即可接近全量微调效果。基于此,AdaGradSelect结合狄利克雷采样(依赖历史更新频率)与epsilon-贪婪探索策略,在训练初期广泛探索各层,后期逐步聚焦重要层。实验表明,该方法比全量微调快约12%,节省35% GPU内存,且在GSM8K数据集上平均优于LoRA(rank 256)约3个百分点,涵盖Qwen2.5-0.5B、LLaMA3.2-1B和Phi4-mini-3.8B等模型;在MATH数据集上也达到相当准确率。整体上,AdaGradSelect为传统微调提供了更高效、更省资源的替代方案。
原文摘要 · Abstract (English)
Large Language Models (LLMs) can perform many NLP tasks well, but fully fine-tuning them is expensive and requires a lot of memory. Parameter-Efficient Fine-Tuning (PEFT) methods such as LoRA reduce this cost by adding small low-rank updates to frozen model weights. However, these methods restrict the training to a limited subspace, which can sometimes reduce performance. For Small Language Models (SLMs), where efficiency gains matter even more, we introduce AdaGradSelect, an adaptive method that selects which transformer blocks to update based on gradients. Early observations showed that updating only the transformer blocks with the highest gradient norms can achieve performance close to full fine-tuning. Building on this insight, AdaGradSelect adaptively chooses which blocks to train. It uses a combination of Dirichlet-based sampling, which depends on how frequently blocks were updated in the past, and an epsilon-greedy exploration strategy. This lets the method explore different blocks in early training and gradually focus on the most important ones in later epochs. Experiments show that AdaGradSelect trains about 12 percent faster and uses 35 percent less GPU memory while delivering performance very close to full fine-tuning. On the GSM8K dataset, it outperforms LoRA (rank 256) by about 3 percent on average across models such as Qwen2.5-0.5B, LLaMA3.2-1B, and Phi4-mini-3.8B. It also achieves similar accuracy on the MATH dataset. Overall, AdaGradSelect provides a more effective and resource-efficient alternative to traditional fine-tuning methods.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。