arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2505.21930cs.LGcs.CL
收藏

在多个数据集上微调语言模型的高效集成方法

Efficient Ensemble for Fine-tuning Language Models on Multiple Datasets

Northeastern University(东北大学);University of Michigan(密歇根大学)

Dongyue Li, Ziniu Zhang, Lu Wang, Hongyang R. Zhang

AI总结:

本文提出一种高效集成方法,通过将多个数据集分组训练适配器并加权组合,利用低秩适应的一阶近似特性加速微调,在保持计算效率的同时显著提升模型在多数据集上的测试准确率。

摘要:

本文开发了一种用于在多个数据集上微调语言模型的集成方法。现有方法(如量化LoRA(QLoRA))在适应单一数据集时非常高效。然而,当在不同任务的多个数据集上训练时(这是实际应用中的常见设置),如何为微调语言模型设计高效的适应方法仍不明确。我们建议使用多个较小适配器的集成,而不是每个任务使用单一适配器。我们设计了一种高效算法,将$n$个数据集划分为$m$组(实际中$m$通常远小于$n$),并为每组训练一个适配器,最后通过加权组合形成集成。该算法利用低秩适应的一阶近似特性,快速获取数据集组合的微调性能,因为LoRA等方法会保持接近基模型的状态。因此,我们使用基模型的梯度来估计其在微调过程中的行为。实验表明,该近似在参数量高达$34$亿的模型上误差小于$1\%$,从而在误差低于$5\%$的情况下估计真实微调性能,同时计算速度比基线微调快$105$倍。当应用于在十个文本分类任务上微调Llama和GPT模型时,我们的方法平均测试准确率比QLoRA高出$10\%$,仅增加$9\%$的FLOPs。在$34$亿参数的Llama模型上,QLoRA集成相比QLoRA测试准确率提升$3\%$,仅增加$8\%$的FLOPs。

英文摘要:

This paper develops an ensemble method for fine-tuning a language model to multiple datasets. Existing methods, such as quantized LoRA (QLoRA), are efficient when adapting to a single dataset. When training on multiple datasets of different tasks, a common setup in practice, it remains unclear how to design an efficient adaptation for fine-tuning language models. We propose to use an ensemble of multiple smaller adapters instead of a single adapter per task. We design an efficient algorithm that partitions $n$ datasets into $m$ groups, where $m$ is typically much smaller than $n$ in practice, and train one adapter for each group before taking a weighted combination to form the ensemble. The algorithm leverages a first-order approximation property of low-rank adaptation to quickly obtain the fine-tuning performances of dataset combinations since methods like LoRA stay close to the base model. Hence, we use the gradients of the base model to estimate its behavior during fine-tuning. Empirically, this approximation holds with less than $1\%$ error on models with up to $34$ billion parameters, leading to an estimation of true fine-tuning performances under $5\%$ error while speeding up computation compared to base fine-tuning by $105$ times. When applied to fine-tune Llama and GPT models on ten text classification tasks, our approach provides up to $10\%$ higher average test accuracy over QLoRA, with only $9\%$ more FLOPs. On a Llama model with $34$ billion parameters, an ensemble of QLoRA increases test accuracy by $3\%$ compared to QLoRA, with only $8\%$ more FLOPs.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑