用少量样本让大模型自选最优训练数据,省时省力效果更好。
Data Whisperer: Efficient Data Selection for Task-Specific LLM Fine-Tuning via Few-Shot In-Context Learning
- 利用模型自身做少样本上下文学习,无需额外训练评分模型。
- 仅用GSM8K数据集10%的样本,性能超过全量数据。
- 速度快7.4倍,适合资源有限但追求高效率的模型微调场景。
在任务特定数据上微调大语言模型对实际部署至关重要。随着数据集规模扩大,高效选取最优训练子集成为平衡性能与计算成本的关键。传统数据选择方法通常需要在目标数据集上微调评分模型,耗时且资源消耗大;或依赖启发式规则,未能充分利用模型的预测能力。为此,我们提出Data Whisperer,一种无需训练、基于注意力机制的高效方法,通过目标模型自身的少样本上下文学习实现数据选择。在多种任务和模型上的全面评估显示,Data Whisperer在Llama-3-8B-Instruct模型上,仅使用GSM8K数据集10%的样本,性能即超越全量数据,并相较现有方法提升3.1分,速度提升7.4倍。代码已开源:https://github.com/gszfwsb/Data-Whisperer。
原文摘要 · Abstract (English)
Fine-tuning large language models (LLMs) on task-specific data is essential for their effective deployment. As dataset sizes grow, efficiently selecting optimal subsets for training becomes crucial to balancing performance and computational costs. Traditional data selection methods often require fine-tuning a scoring model on the target dataset, which is time-consuming and resource-intensive, or rely on heuristics that fail to fully leverage the model's predictive capabilities. To address these challenges, we propose Data Whisperer, an efficient, training-free, attention-based method that leverages few-shot in-context learning with the model to be fine-tuned. Comprehensive evaluations were conducted on both raw and synthetic datasets across diverse tasks and models. Notably, Data Whisperer achieves superior performance compared to the full GSM8K dataset on the Llama-3-8B-Instruct model, using just 10% of the data, and outperforms existing methods with a 3.1-point improvement and a 7.4$\times$ speedup. The code is available at https://github.com/gszfwsb/Data-Whisperer.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。