用少量代表性样本挑选最优数据,提升模型微调效果
TSDS: Data Selection for Task-Specific Model Finetuning
- 基于最优传输构建分布对齐损失,精准匹配目标任务数据分布
- 1%数据筛选率下,指令微调F1得分超越全量数据集和基线方法
- 适合资源有限但需高效微调的NLP任务,尤其语言模型定制场景
针对特定任务微调基础模型已成为现代机器学习的重要范式。微调效果高度依赖于训练数据的选择。本文提出TSDS(任务特定数据选择)框架,利用目标任务中少量代表性样本来指导数据筛选。我们将任务微调的数据选择建模为优化问题,采用基于最优传输的分布对齐损失以捕捉所选数据与目标分布之间的差异,并引入正则项鼓励数据多样性,结合核密度估计缓解候选数据中的近似重复问题。我们还将该优化问题与最近邻搜索关联,设计基于近似最近邻搜索技术的高效算法求解。在语言模型的持续预训练和指令微调任务上评估本方法,结果显示:使用本方法以1%的筛选比例进行指令微调,性能常优于使用完整数据集,且平均比基线方法高出1.5个F1分点。
原文摘要 · Abstract (English)
Finetuning foundation models for specific tasks is an emerging paradigm in modern machine learning. The efficacy of task-specific finetuning largely depends on the selection of appropriate training data. We present TSDS (Task-Specific Data Selection), a framework to select data for task-specific model finetuning, guided by a small but representative set of examples from the target task. To do so, we formulate data selection for task-specific finetuning as an optimization problem with a distribution alignment loss based on optimal transport to capture the discrepancy between the selected data and the target distribution. In addition, we add a regularizer to encourage the diversity of the selected data and incorporate kernel density estimation into the regularizer to reduce the negative effects of near-duplicates among the candidate data. We connect our optimization problem to nearest neighbor search and design efficient algorithms to compute the optimal solution based on approximate nearest neighbor search techniques. We evaluate our method on data selection for both continued pretraining and instruction tuning of language models. We show that instruction tuning using data selected by our method with a 1% selection ratio often outperforms using the full dataset and beats the baseline selection methods by 1.5 points in F1 score on average.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。