What Makes Good Data for Alignment? A Comprehensive Study of Automatic Data Selection in Instruction Tuning

LLM SFT DPO
2023年12月25日
指导调整是一种标准技术,用于在初始预训练阶段后将大型语言模型与最终任务和用户偏好对齐。最近的研究表明,数据工程在指导调整中起着至关重要的作用——当选择适当的数据时,只需要有限的数据就能实现卓越的性能。然而,我们仍然缺乏对于什么样的指导调整数据是好的以及如何自动有效地选择数据的原则性理解。在这项工作中,我们深入探讨了用于对齐的自动数据选择策略。我们从控制研究开始,测量数据的三个维度:复杂性、质量和多样性,沿着这些维度,我们检查现有方法并引入新的增强数据测量的技术。随后,我们提出了一种基于这些测量的简单策略来选择数据样本。我们展示了deita(Data-Efficient Instruction Tuning for Alignment),这是一系列使用我们提出的方法自动选择数据样本,从LLaMA和Mistral模型微调的模型。实证结果表明,deita仅使用6K SFT训练数据样本,就可以表现得比最先进的开源对齐模型更好或相当——比基准模型使用的数据少了10倍以上。当使用直接优化偏好(DPO)进一步训练时,使用6K SFT和10K DPO样本训练的deita-Mistral-7B + DPO实现了7.55 MT-Bench和90.06%的AlpacaEval得分。我们预计这项工作将提供自动数据选择工具,促进数据有效对齐。我们发布我们的模型以及所选的数据集,供未来的研究人员更有效地对齐模型。
Instruction tuning is a standard technique employed to align large language models to end tasks and user preferences after the initial pretraining phase. Recent research indicates the critical role of data engineering in instruction tuning -- when appropriately selected, only limited data is necessary to achieve superior performance. However, we still lack a principled understanding of what makes good instruction tuning data for alignment, and how we should select data automatically and effectively. In this work, we delve deeply into automatic data selection strategies for alignment. We start with controlled studies to measure data across three dimensions: complexity, quality, and diversity, along which we examine existing methods and introduce novel techniques for enhanced data measurement. Subsequently, we propose a simple strategy to select data samples based on the measurement. We present deita (short for Data-Efficient Instruction Tuning for Alignment), a series of models fine-tuned from LLaMA and Mistral models using data samples automatically selected with our proposed approach. Empirically, deita performs better or on par with the state-of-the-art open-source alignment models with only 6K SFT training data samples -- over 10x less than the data used in the baselines. When further trained with direct preference optimization (DPO), deita-Mistral-7B + DPO trained with 6K SFT and 10K DPO samples achieve 7.55 MT-Bench and 90.06% AlpacaEval scores. We anticipate this work to provide tools on automatic data selection, facilitating data-efficient alignment. We release our models as well as the selected datasets for future researches to effectively align models more efficiently.
许愿