arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2410.02498cs.LGcs.CL
收藏

面向在线数据混合的动态梯度对齐

Dynamic Gradient Alignment for Online Data Mixing

Apple(苹果公司);EPFL(洛桑联邦理工学院)

Simin Fan, David Grangier, Pierre Ablin

AI总结:

本文提出动态梯度对齐算法DGA,以极低开销在线估计与特定任务梯度最对齐的预训练数据混合,在数据受限场景下显著优于重要性采样,无需重新训练模型。

摘要:

训练数据混合的构成对于有效训练大型语言模型(LLMs)至关重要,因为它直接影响模型在下游任务上的表现。我们的目标是确定一种最优数据混合,以便在仅能访问少量示例的情况下,使LLM针对特定任务进行专门化。针对这一问题的传统方法包括临时性重新加权方法、重要性采样和梯度对齐技术。本文聚焦于梯度对齐,并提出了动态梯度对齐(DGA),一种可扩展的在线梯度对齐算法。DGA动态估计预训练数据混合,使模型在该混合上的梯度尽可能与模型在特定任务上的梯度对齐。DGA是首个梯度对齐方法,与标准预训练相比仅产生极小的额外开销,并能输出具有竞争力的模型,从而无需对模型进行重新训练。在实验中,我们在两个关键场景下证明了相较于重要性采样的显著改进:(i)当预训练集较小且重要性采样因数据有限而过拟合时;(ii)当专门化数据不足,导致重要性采样被困在狭窄的数据区域时。我们的发现强调了梯度对齐方法在优化训练数据混合方面的有效性,尤其是在数据受限的环境中,并为在数据可用性有限的情况下提升LLM在特定任务上的性能提供了一种实用解决方案。

英文摘要:

The composition of training data mixtures is critical for effectively training large language models (LLMs), as it directly impacts their performance on downstream tasks. Our goal is to identify an optimal data mixture to specialize an LLM for a specific task with access to only a few examples. Traditional approaches to this problem include ad-hoc reweighting methods, importance sampling, and gradient alignment techniques. This paper focuses on gradient alignment and introduces Dynamic Gradient Alignment (DGA), a scalable online gradient alignment algorithm. DGA dynamically estimates the pre-training data mixture on which the models' gradients align as well as possible with those of the model on the specific task. DGA is the first gradient alignment approach that incurs minimal overhead compared to standard pre-training and outputs a competitive model, eliminating the need for retraining the model. Experimentally, we demonstrate significant improvements over importance sampling in two key scenarios: (i) when the pre-training set is small and importance sampling overfits due to limited data; and (ii) when there is insufficient specialized data, trapping importance sampling on narrow pockets of data. Our findings underscore the effectiveness of gradient alignment methods in optimizing training data mixtures, particularly in data-constrained environments, and offer a practical solution for enhancing LLM performance on specific tasks with limited data availability.

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

↑