Magpie: Alignment Data Synthesis from Scratch by Prompting Aligned LLMs
  with Nothing
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.
666a4c1165a06c5745d71a5c
Zhangchen Xu
claimed_verified
2024-06-14T07:24:06.092Z
653df1323479e9ebbe3eb6cc
https://cdn-avatars.huggingface.co/v1/production/uploads/653df1323479e9ebbe3eb6cc/K_g-r1iMRNKj99LXPuYF3.jpeg
Zhangchen Xu
user
zhangchenxu
666a4c1165a06c5745d71a5d
Fengqing Jiang
claimed_verified
2024-06-13T09:31:14.539Z
6531e1021dd8ebbdc1a6fd8e
https://cdn-avatars.huggingface.co/v1/production/uploads/6531e1021dd8ebbdc1a6fd8e/lIcl7zCPtzRsfiUh6uY1o.jpeg
Fengqing Jiang
user
fqjiang
666a4c1165a06c5745d71a5e
Luyao Niu
claimed_verified
2024-06-15T21:29:06.971Z
666dfd4770f5a2cb4aefd12f
/avatars/fa0e0dbc203a21e58dda8fdb4cbc67ad.svg
Luyao Niu
user
LNIU
666a4c1165a06c5745d71a5f
Yuntian Deng
claimed_verified
2025-04-30T09:57:09.774Z
63081e15a670ed10f9d44229
https://cdn-avatars.huggingface.co/v1/production/uploads/63081e15a670ed10f9d44229/w1b9uq-9774bMMgJbSPsS.jpeg
Yuntian Deng
user
yuntian-deng
666a4c1165a06c5745d71a60
Radha Poovendran
666a4c1165a06c5745d71a61
Yejin Choi
666a4c1165a06c5745d71a62
Bill Yuchen Lin
claimed_verified
2024-06-13T09:31:16.691Z
607f666a4ad99100d63ce35c
https://cdn-avatars.huggingface.co/v1/production/uploads/607f666a4ad99100d63ce35c/QxhxnvfeV6efkxwUFHwjI.png
Bill Yuchen Lin
user
yuchenlin
Magpie: Alignment Data Synthesis from Scratch by Prompting Aligned LLMs
  with Nothing
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.
Magpie, a self-synthesis method, generates high-quality instruction data from aligned LLMs, enabling competitive performance in alignment benchmarks compared to models fine-tuned with larger, supervised datasets.
large language models LLMs Llama-3-Instruct auto-regressive instruction data Magpie alignment datasets fine-tuning performance evaluation AlpacaEval ArenaHard WildBench supervised fine-tuning SFT preference optimization UltraFeedback