File size: 3,504 Bytes
0025178
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d7b8746
 
 
 
0025178
 
d7b8746
0025178
d7b8746
 
0025178
 
 
 
 
 
e1a922e
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
---
dataset_info:
  features:
  - name: uuid
    dtype: string
  - name: model
    dtype: string
  - name: gen_input_config
    struct:
    - name: temperature
      dtype: float64
    - name: top_p
      dtype: float64
  - name: input
    dtype: string
  - name: output
    dtype: string
  - name: conversations
    list:
    - name: from
      dtype: string
    - name: value
      dtype: string
  - name: task_category
    dtype: string
  - name: difficulty
    dtype: string
  - name: intent
    dtype: string
  - name: knowledge
    dtype: string
  - name: input_quality
    dtype: string
  - name: quality_explanation
    dtype: string
  - name: llama_guard_2
    dtype: string
  - name: reward_model
    dtype: string
  - name: instruct_reward
    dtype: float64
  - name: base_output
    dtype: string
  - name: base_reward
    dtype: float64
  - name: reward_difference
    dtype: float64
  - name: min_neighbor_distance
    dtype: float64
  - name: repeat_count
    dtype: int64
  - name: min_similar_uuid
    dtype: string
  - name: input_length
    dtype: int64
  - name: output_length
    dtype: int64
  splits:
  - name: train
    num_bytes: 19031408037
    num_examples: 3000000
  download_size: 9936635779
  dataset_size: 19031408037
configs:
- config_name: default
  data_files:
  - split: train
    path: data/train-*
---

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>