ChatPaper.aiChatPaper

Magpie:透過提示對齊的LLM從頭開始合成對齊數據

Magpie: Alignment Data Synthesis from Scratch by Prompting Aligned LLMs with Nothing

June 12, 2024
作者: Zhangchen Xu, Fengqing Jiang, Luyao Niu, Yuntian Deng, Radha Poovendran, Yejin Choi, Bill Yuchen Lin
cs.AI

摘要

高質量的指導數據對於調整大型語言模型(LLMs)至關重要。儘管一些模型,如Llama-3-Instruct,具有公開權重,但它們的對齊數據仍然保持私有,這阻礙了人工智慧的民主化。高昂的人力成本和有限的預定範圍限制了現有的開源數據創建方法的有效擴展,可能會限制公共對齊數據集的多樣性和質量。通過直接從對齊的LLM中提取,合成大規模高質量的指導數據是否可能?我們提出了一種名為Magpie的自我合成方法,用於生成大規模的對齊數據。我們的關鍵觀察是,像Llama-3-Instruct這樣的對齊LLMs可以在僅輸入左側模板直到保留給用戶消息的位置時生成用戶查詢,這要歸功於它們的自回歸性質。我們使用這種方法提示Llama-3-Instruct並生成了400萬條指導以及相應的回應。我們對提取的數據進行了全面分析並選擇了30萬個高質量實例。為了將Magpie數據與其他公共指導數據集進行比較,我們使用每個數據集對Llama-3-8B-Base進行微調,並評估微調模型的性能。我們的結果表明,在某些任務中,使用Magpie進行微調的模型在性能上與官方的Llama-3-8B-Instruct相當,儘管後者通過監督微調(SFT)和隨後的反饋學習增強了1000萬數據點。我們還表明,僅使用Magpie進行SFT可以超越以往用於SFT和偏好優化的公共數據集的性能,例如使用UltraFeedback進行直接偏好優化。這種優勢在AlpacaEval、ArenaHard和WildBench等對齊基準上是顯而易見的。
English
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.

Summary

AI-Generated Summary

PDF705December 8, 2024