arXiv:2502.01697cs.CLcs.AI2025-02被引 8

用3个例子生成高质量数据,让小样本也能训练出强模型。

BARE: Leveraging Base Language Models for Few-Shot Synthetic Data Generation

  • 用基础模型生成多样数据,再用指令模型优化质量。
  • 仅用3个种子样本,生成数据使模型性能接近顶尖水平。
  • 适合数据稀缺场景,尤其适合资源有限的开发者。

随着大模型训练对高质量数据需求的增长,研究者越来越依赖合成数据。然而现有方法需数万条种子样本才能有效生成,而高质量样本的构建成本高昂。本文探索少样本合成数据生成新范式:仅用少量示例生成高质量数据集。我们发现,当前依赖指令微调模型的方法在少样本下生成数据多样性不足;相比之下,未经过后训练的基础模型虽指令遵循能力弱,但输出多样性显著更高。基于此,提出Base-Refine(BARE)两阶段方法,融合基础模型的多样性与指令模型的质量保障。BARE在少样本下表现卓越:仅用3个种子样本即可生成多样化、高质量数据集,显著提升下游任务性能。使用1,000个BARE生成样本微调Llama 3.1 8B,在LiveCodeBench任务上达到与最先进同规模模型相当的性能;在GSM8K任务上,使微调后的Llama 3.2 1B性能提升101%;在RAG数据生成任务中,相比RAFT方法,使微调后的Llama 3.1 8B性能提升18.4%。

原文摘要 · Abstract (English)

As the demand for high-quality data in model training grows, researchers and developers are increasingly generating synthetic data to tune and train LLMs. However, current data generation methods rely on seed sets containing tens of thousands of examples to prompt instruction-tuned models. This reliance can be especially problematic when the curation of high-quality examples is expensive or difficult. In this paper we explore the novel few-shot synthetic data generation setting -- generating a high-quality dataset from a few examples. We show that when working with only a few seed examples, instruction-tuned models used in current synthetic data methods produce insufficient diversity for downstream tasks. In contrast, we show that base models without post-training, largely untapped for synthetic data generation, offer substantially greater output diversity, albeit with lower instruction following abilities. Leveraging this insight, we propose Base-Refine (BARE), a novel two-stage method that combines the diversity of base models with the quality assurance of instruction-tuned models. BARE excels in few-shot synthetic data generation: using only 3 seed examples it generates diverse, high-quality datasets that significantly improve downstream task performance. We show that fine-tuning Llama 3.1 8B with 1,000 BARE-generated samples achieves performance comparable to state-of-the-art similarly sized models on LiveCodeBench tasks. Furthermore, data generated with BARE enables a 101% improvement for a fine-tuned Llama 3.2 1B on GSM8K over data generated by only instruction-models, and an 18.4% improvement for a fine-tuned Llama 3.1 8B over the state-of-the-art RAFT method for RAG data generation.

合成数据少样本学习LLM训练数据生成

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