OpenBezoar: Small, Cost-Effective and Open Models Trained on Mixes of Instruction Data
作者: Chandeepa Dissanayake, Lahiru Lowe, Sachith Gunasekara, Yasiru Ratnayake
分类: cs.CL, cs.LG
发布日期: 2024-04-18
备注: 25 pages, 27 Figures, 8 Tables
🔗 代码/项目: HUGGINGFACE
💡 一句话要点
提出OpenBezoar以解决小型模型训练成本高的问题
🎯 匹配领域: 支柱二:RL算法与架构 (RL & Architecture)
关键词: 小型模型 指令微调 合成数据 QLoRA RLHF DPO 成本效益 自然语言处理
📋 核心要点
- 现有的指令微调方法在模型规模和训练成本上存在挑战,尤其是在小型模型的应用场景中。
- 本文提出了一种基于OpenLLaMA 3Bv2的微调方案,通过生成合成数据和多阶段微调来降低成本。
- 实验结果表明,最终模型OpenBezoar-HH-RLHF-DPO在多个任务上表现优异,超越了许多同类模型。
📝 摘要(中文)
对预训练大型语言模型(LLMs)进行指令微调已取得显著成功,吸引了学术界和业界的关注。为了确保这些微调后的LLMs与人类偏好一致,出现了如RLHF和DPO等技术。同时,模型参数数量较小的需求日益增加。本文以OpenLLaMA 3Bv2为基础模型,描述了微调OpenBezoar模型系列的过程。首先,利用Falcon-40B模型生成合成指令微调数据,并通过GPT-4进行过滤。接着,采用基于QLoRA的监督微调方法,最后通过HH-RLHF数据集和DPO损失进行进一步微调。评估结果显示,最终模型在3B参数规模下的表现优于许多同类模型,并在Huggingface Open LLM Leaderboard的某些类别中超越了顶级模型。我们在HuggingFace上发布了相关模型检查点和生成的数据集。
🔬 方法详解
问题定义:本文旨在解决小型语言模型在指令微调过程中的高成本和低效问题。现有方法通常依赖于大型模型,导致训练资源和时间的消耗较大。
核心思路:通过生成合成的指令微调数据,并结合QLoRA和RLHF等技术,优化小型模型的训练过程,以实现高效且经济的微调。
技术框架:整体流程包括数据生成、数据过滤、QLoRA监督微调和最终的RLHF-DPO微调。首先生成合成数据,然后使用GPT-4进行过滤,接着进行QLoRA微调,最后通过HH-RLHF数据集和DPO损失进行优化。
关键创新:最重要的创新在于使用合成数据和多阶段微调策略,使得小型模型在保持较低参数量的同时,仍能达到较高的性能水平。这种方法与传统依赖大型模型的微调方式本质上不同。
关键设计:在微调过程中,采用QLoRA作为主要的训练策略,并在最后阶段引入HH-RLHF数据集以减少分布偏移,使用DPO损失函数来优化模型输出。
🖼️ 关键图片
📊 实验亮点
实验结果显示,最终模型OpenBezoar-HH-RLHF-DPO在3B参数规模下的表现超越了许多同类模型,尤其在Huggingface Open LLM Leaderboard的某些类别中,甚至超过了顶级模型,展示了显著的性能提升。
🎯 应用场景
该研究的潜在应用领域包括教育、客服和内容生成等多个场景,尤其适合资源有限的环境中使用小型模型进行高效的任务处理。未来,该方法可能推动小型语言模型在更多实际应用中的普及与发展。
📄 摘要(原文)
Instruction fine-tuning pretrained LLMs for diverse downstream tasks has demonstrated remarkable success and has captured the interest of both academics and practitioners. To ensure such fine-tuned LLMs align with human preferences, techniques such as RLHF and DPO have emerged. At the same time, there is increasing interest in smaller parameter counts for models. In this work, using OpenLLaMA 3Bv2 as a base model, we describe the recipe used to fine-tune the OpenBezoar family of models. In this recipe: We first generate synthetic instruction fine-tuning data using an open and commercially non-restrictive instruction fine-tuned variant of the Falcon-40B model under three schemes based on: LaMini-LM, WizardLM/Evol-Instruct (with databricks-dolly-15k as a seed dataset) and Orca (with the Flan Collection as a seed dataset), then filter these generations using GPT-4 as a human proxy. We then perform cost-effective QLoRA-based supervised fine-tuning sequentially with each scheme. The resulting checkpoint is further fine-tuned with a subset of the HH-RLHF dataset to minimize distribution shift prior to using the DPO loss to obtain the final checkpoint. Evaluation is done with the LM Eval Harness tasks/metrics as well as on MT-Bench using the "LLM-as-a-judge" framework with Claude 2.1, with the finding that the final checkpoint, "OpenBezoar-HH-RLHF-DPO", demonstrates superior performance over many models at the 3B parameter scale, even outperforming the top model in one of the categories on the Huggingface Open LLM Leaderboard. We release "OpenBezoar-SFT", "OpenBezoar-HH-RLHF-SFT", "OpenBezoar-HH-RLHF-DPO" checkpoints, alongside our generated datasets on HuggingFace at https://huggingface.co/collections/SurgeGlobal/open-bezoar-6620a24923e12127e9e2b9cc and our codebase at https://bitbucket.org/paladinanalytics/workspace/projects/OP.