five

Magpie-Qwen-Air-300K-Filtered

收藏
魔搭社区2025-11-27 更新2025-01-18 收录
下载链接:
https://modelscope.cn/datasets/Magpie-Align/Magpie-Qwen-Air-300K-Filtered
下载链接
链接失效反馈
官方服务:
资源简介:
![Magpie](magpie_logo.png) Project Web: [https://magpie-align.github.io/](https://magpie-align.github.io/) Arxiv Technical Report: [https://arxiv.org/abs/2406.08464](https://arxiv.org/abs/2406.08464) Codes: [https://github.com/magpie-align/magpie](https://github.com/magpie-align/magpie) ## Abstract <details><summary>Click Here</summary> High-quality instruction data is critical for aligning large language models (LLMs). Although some models, such as Llama-3-Instruct, have open weights, their alignment data remain private, which hinders the democratization of AI. High human labor costs and a limited, predefined scope for prompting prevent existing open-source data creation methods from scaling effectively, potentially limiting the diversity and quality of public alignment datasets. Is it possible to synthesize high-quality instruction data at scale by extracting it directly from an aligned LLM? We present a self-synthesis method for generating large-scale alignment data named Magpie. Our key observation is that aligned LLMs like Llama-3-Instruct can generate a user query when we input only the left-side templates up to the position reserved for user messages, thanks to their auto-regressive nature. We use this method to prompt Llama-3-Instruct and generate 4 million instructions along with their corresponding responses. We perform a comprehensive analysis of the extracted data and select 300K high-quality instances. To compare Magpie data with other public instruction datasets, we fine-tune Llama-3-8B-Base with each dataset and evaluate the performance of the fine-tuned models. Our results indicate that in some tasks, models fine-tuned with Magpie perform comparably to the official Llama-3-8B-Instruct, despite the latter being enhanced with 10 million data points through supervised fine-tuning (SFT) and subsequent feedback learning. We also show that using Magpie solely for SFT can surpass the performance of previous public datasets utilized for both SFT and preference optimization, such as direct preference optimization with UltraFeedback. This advantage is evident on alignment benchmarks such as AlpacaEval, ArenaHard, and WildBench. </details><be> ## Dataset Details This dataset is generated by [Qwen/Qwen2-7B-Instruct](https://huggingface.co/Qwen/Qwen2-7B-Instruct) using [Magpie](https://huggingface.co/Magpie-Align). Please refer to our [paper](https://arxiv.org/abs/2406.08464) and [codebase](https://github.com/magpie-align/magpie) for implementation details. ### Available Labels - **Input Length**: The total number of characters in the instructions. - **Output Length**: The total number of characters in the responses. - **Task Category**: The specific category of the instructions. - **Input Quality**: The clarity, specificity, and coherence of the instructions, rated as 'very poor', 'poor', 'average', 'good', and 'excellent'. - **Input Difficulty**: The level of knowledge required to address the task described in the instruction, rated as 'very easy', 'easy', 'medium', 'hard', or 'very hard'. - **Minimum Neighbor Distance**: The embedding distance to the nearest neighbor within the dataset. It can be used for filtering out repetitive or similar instances. - **Safety**: Safety tags marked by [meta-llama/Meta-Llama-Guard-2-8B](https://huggingface.co/meta-llama/Meta-Llama-Guard-2-8B) - **Reward**: The output of the reward model given the specific instruction-response pair. - **Language**: The language of the instruction. ## Filter Setups - **Input Quality**: >= good - **Input Difficulty**: >= medium - **Instruction Reward**: >=-10 - Remove repetition and incomplete instructions (e.g., end with :) - Choose 300K data with the longest responses ## Dataset Navigation 🧭 |Model Name | Dataset | Type | Description | |-------------|:-------|:-------|:-------| | [Qwen2 72B Instruct](https://huggingface.co/Qwen/Qwen2-72B-Instruct) | [Magpie-Qwen2-Pro-1M](https://huggingface.co/datasets/Magpie-Align/Magpie-Qwen2-Pro-1M-v0.1) | SFT | 1M Raw conversations built with Qwen2 72B Instruct. | [Qwen2 72B Instruct](https://huggingface.co/Qwen/Qwen2-72B-Instruct) | [Magpie-Qwen2-Pro-300K-Filtered](https://huggingface.co/datasets/Magpie-Align/Magpie-Qwen2-Pro-300K-Filtered) | SFT | Apply a filter and select 300K high quality conversations. | [Qwen2 72B Instruct](https://huggingface.co/Qwen/Qwen2-72B-Instruct) | [Magpie-Qwen2-Pro-200K-Chinese](https://huggingface.co/datasets/Magpie-Align/Magpie-Qwen2-Pro-200K-Chinese) | SFT | Apply a filter and select 200K high quality Chinese conversations. | [Qwen2 72B Instruct](https://huggingface.co/Qwen/Qwen2-72B-Instruct) | [Magpie-Qwen2-Pro-200K-English](https://huggingface.co/datasets/Magpie-Align/Magpie-Qwen2-Pro-200K-English) | SFT | Apply a filter and select 200K high quality English conversations. | [Qwen2 7B Instruct](https://huggingface.co/Qwen/Qwen2-7B-Instruct) | [Magpie-Qwen2-Air-3M](https://huggingface.co/datasets/Magpie-Align/Magpie-Qwen2-Air-3M-v0.1) | SFT | 3M Raw conversations built with Qwen2 7B Instruct. | [Qwen2 7B Instruct](https://huggingface.co/Qwen/Qwen2-7B-Instruct) | [Magpie-Qwen2-Air-300K-Filtered](https://huggingface.co/datasets/Magpie-Align/Magpie-Qwen-Air-300K-Filtered) | SFT | Apply a filter and select 300K high quality conversations.

![Magpie](magpie_logo.png) 项目官网:[https://magpie-align.github.io/](https://magpie-align.github.io/) Arxiv 技术报告:[https://arxiv.org/abs/2406.08464](https://arxiv.org/abs/2406.08464) 代码仓库:[https://github.com/magpie-align/magpie](https://github.com/magpie-align/magpie) ## 摘要 <details><summary>点击展开</summary> 高质量指令数据对于对齐大语言模型(Large Language Model,以下简称LLM)至关重要。尽管部分模型(如 Llama-3-Instruct)已开放权重,但其对齐数据仍处于私有状态,这阻碍了人工智能的民主化进程。现有开源数据构建方法面临人工成本高昂、提示范围预定义且有限的问题,难以有效扩展,进而可能限制了公开对齐数据集的多样性与质量。能否直接从已对齐的大语言模型中提取信息,大规模合成高质量指令数据?我们提出了一种用于生成大规模对齐数据的自合成方法,命名为 Magpie。我们的核心观察是:得益于自回归特性,当仅向 Llama-3-Instruct 这类已对齐大语言模型输入用户消息预留位置之前的左侧模板时,模型能够生成用户查询。我们利用该方法对 Llama-3-Instruct 进行提示,生成了包含对应响应的400万条指令数据。我们对提取的数据进行了全面分析,并筛选出30万条高质量样本。为了将 Magpie 数据集与其他公开指令数据集进行对比,我们分别使用每个数据集对 Llama-3-8B-Base 进行微调,并评估微调后模型的性能。结果表明,在部分任务中,使用 Magpie 数据集微调的模型性能可与官方 Llama-3-8B-Instruct 相媲美——尽管后者通过监督微调(Supervised Fine-Tuning,简称SFT)与后续反馈学习,使用了1000万条数据进行增强。我们还证实,仅使用 Magpie 数据集进行监督微调,其性能可超越此前同时用于监督微调与偏好优化的公开数据集(如结合 UltraFeedback 的直接偏好优化)。这一优势在 AlpacaEval、ArenaHard 与 WildBench 等对齐基准测试中均有体现。 </details> <be> ## 数据集详情 本数据集由 [Qwen/Qwen2-7B-Instruct](https://huggingface.co/Qwen/Qwen2-7B-Instruct) 借助 [Magpie](https://huggingface.co/Magpie-Align) 生成。有关实现细节,请参阅我们的 [论文](https://arxiv.org/abs/2406.08464) 与 [代码仓库](https://github.com/magpie-align/magpie)。 ### 可用标签 - **输入长度(Input Length)**:指令的总字符数。 - **输出长度(Output Length)**:响应的总字符数。 - **任务类别(Task Category)**:指令所属的具体任务类别。 - **指令质量(Input Quality)**:指令的清晰度、特异性与连贯性,评级分为「极差(very poor)」、「较差(poor)」、「一般(average)」、「良好(good)」与「优秀(excellent)」。 - **输入难度(Input Difficulty)**:完成指令描述任务所需的知识水平,评级分为「极易(very easy)」、「容易(easy)」、「中等(medium)」、「困难(hard)」与「极难(very hard)」。 - **最小邻域距离(Minimum Neighbor Distance)**:数据集中与当前样本最近邻的嵌入距离,可用于过滤重复或相似样本。 - **安全性(Safety)**:由 [meta-llama/Meta-Llama-Guard-2-8B](https://huggingface.co/meta-llama/Meta-Llama-Guard-2-8B) 标记的安全性标签。 - **奖励得分(Reward)**:针对特定指令-响应对的奖励模型输出结果。 - **语言(Language)**:指令所使用的语言。 ## 筛选设置 - **指令质量**:≥ 良好 - **输入难度**:≥ 中等 - **指令奖励得分**:≥ -10 - 移除重复及不完整指令(例如以冒号结尾的指令) - 选取响应长度最长的30万条数据 ## 数据集导航 🧭 | 模型名称 | 数据集 | 类型 | 描述 | |-------------|:-------|:-------|:-------| | [Qwen2 72B 指令版](https://huggingface.co/Qwen/Qwen2-72B-Instruct) | [Magpie-Qwen2-Pro-1M](https://huggingface.co/datasets/Magpie-Align/Magpie-Qwen2-Pro-1M-v0.1) | 监督微调(SFT) | 基于Qwen2 72B 指令版构建的100万条原始对话数据。 | [Qwen2 72B 指令版](https://huggingface.co/Qwen/Qwen2-72B-Instruct) | [Magpie-Qwen2-Pro-300K-Filtered](https://huggingface.co/datasets/Magpie-Align/Magpie-Qwen2-Pro-300K-Filtered) | 监督微调(SFT) | 经过筛选后选取的30万条高质量对话数据。 | [Qwen2 72B 指令版](https://huggingface.co/Qwen/Qwen2-72B-Instruct) | [Magpie-Qwen2-Pro-200K-Chinese](https://huggingface.co/datasets/Magpie-Align/Magpie-Qwen2-Pro-200K-Chinese) | 监督微调(SFT) | 经过筛选后选取的20万条高质量中文对话数据。 | [Qwen2 72B 指令版](https://huggingface.co/Qwen/Qwen2-72B-Instruct) | [Magpie-Qwen2-Pro-200K-English](https://huggingface.co/datasets/Magpie-Align/Magpie-Qwen2-Pro-200K-English) | 监督微调(SFT) | 经过筛选后选取的20万条高质量英文对话数据。 | [Qwen2 7B 指令版](https://huggingface.co/Qwen/Qwen2-7B-Instruct) | [Magpie-Qwen2-Air-3M](https://huggingface.co/datasets/Magpie-Align/Magpie-Qwen2-Air-3M-v0.1) | 监督微调(SFT) | 基于Qwen2 7B 指令版构建的300万条原始对话数据。 | [Qwen2 7B 指令版](https://huggingface.co/Qwen/Qwen2-7B-Instruct) | [Magpie-Qwen-Air-300K-Filtered](https://huggingface.co/datasets/Magpie-Align/Magpie-Qwen-Air-300K-Filtered) | 监督微调(SFT) | 经过筛选后选取的30万条高质量对话数据。
提供机构:
maas
创建时间:
2025-01-15
5,000+
优质数据集
54 个
任务类型
进入经典数据集
二维码
社区交流群

面向社区/商业的数据集话题

二维码
科研交流群

面向高校/科研机构的开源数据集话题

数据驱动未来

携手共赢发展

商业合作