动态调整数据混合比例,用少量样本高效优化大模型特定任务表现
Dynamic Gradient Alignment for Online Data Mixing
- 基于梯度对齐思想,实时动态估计最优预训练数据组合
- 在小样本和数据稀缺场景下,性能显著优于重要性采样方法
- 无需重新训练,计算开销极低,适合资源受限的模型微调
训练数据混合方式对大语言模型(LLM)的下游任务性能有直接影响。本文旨在仅用少量示例的情况下,通过优化数据混合来使LLM适应特定任务。传统方法包括随意重加权、重要性采样和梯度对齐技术。本文聚焦梯度对齐,提出可扩展的在线梯度对齐算法Dynamic Gradient Alignment (DGA)。DGA动态估计使模型梯度与目标任务梯度对齐最好的预训练数据混合比例。DGA是首个与标准预训练相比开销极小且无需重训练即可输出竞争力模型的梯度对齐方法。实验表明,在两种关键场景下,DGA显著优于重要性采样:(i) 预训练集较小时,重要性采样因数据有限而过拟合;(ii) 特定任务数据不足时,重要性采样陷入狭窄数据区域。结果证明梯度对齐在数据受限环境下优化数据混合的有效性,并为有限数据条件下提升LLM性能提供实用解决方案。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。