arXiv:2409.19458cs.CLcs.LG2024-09EMNLP被引 15

用梯度近似快速筛选最优辅助任务,30倍提速且误差仅1%。

Scalable Fine-tuning from Multiple Data Sources: A First-Order Approximation Approach

  • 基于元初始化的梯度近似,无需重复训练即可评估微调效果。
  • 在12个Transformer模型上验证,预测误差仅1%,速度提升30倍。
  • 适合需要高效选择训练数据的任务,如指令微调和思维链微调。

我们研究如何通过最优利用n个辅助任务的信息来微调语言模型(LM)以完成目标任务。该问题在自然语言处理中有广泛应用,如定向指令微调和思维链微调中的数据选择。关键挑战在于并非所有辅助任务都对目标任务有益,因此选择合适的子集至关重要。传统方法如前向/后向逐步选择不适用于语言模型微调,因其需对每个子集重复训练。本文提出一种新算法,在无需重复训练的情况下估算微调性能。首先使用所有任务的数据进行多任务训练,获得元初始化;随后利用元初始化的函数值和梯度,近似子集的微调损失。实证发现,该梯度近似在12个基于Transformer的模型上具有极高的准确性,使性能估计可在数秒内于CPU上完成。最后,仅对选定任务子集进行一次预训练模型微调。大量实验验证该方法,相比传统子集选择实现30倍加速,且真实微调性能误差仅为1%。在下游评估中,包括指令微调和思维链微调,该基于损失的选取方法相较以往梯度或表示相似性方法,最多提升3.8%。

原文摘要 · Abstract (English)

We study the problem of fine-tuning a language model (LM) for a target task by optimally using the information from $n$ auxiliary tasks. This problem has broad applications in NLP, such as targeted instruction tuning and data selection in chain-of-thought fine-tuning. The key challenge of this problem is that not all auxiliary tasks are beneficial in improving the performance of the target task. Thus, selecting the right subset of auxiliary tasks is crucial. Conventional subset selection methods, such as forward and backward stepwise selection, are unsuitable for LM fine-tuning because they require repeated training on subsets of auxiliary tasks. This paper introduces a new algorithm for estimating model fine-tuning performance without requiring repeated training. Our algorithm first performs multitask training using data from all tasks to obtain a meta initialization. Then, we approximate the model fine-tuning loss of a subset using functional values and gradients from the meta initialization. Empirically, we find that this gradient-based approximation holds with remarkable accuracy for twelve transformer-based LMs. Thus, we can now estimate fine-tuning performances on CPUs within a few seconds. Finally, we fine-tune the pretrained base model once on the selected subset of tasks. We conduct extensive experiments to validate this approach, delivering a speedup of $30\times$ over conventional subset selection while incurring only $1\%$ error of the true fine-tuning performances. In downstream evaluations involving both instruction tuning and chain-of-thought fine-tuning, this loss-based selection approach improves over prior gradient or representation similarity-based methods for subset selection by up to $3.8\%$.

微调多任务学习效率优化语言模型

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。