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
초록
고품질의 명령어 데이터는 대규모 언어 모델(LLM)을 정렬(alignment)하는 데 있어 매우 중요합니다. Llama-3-Instruct와 같은 일부 모델은 가중치를 공개하고 있지만, 정렬 데이터는 여전히 비공개 상태로 남아 있어 AI의 민주화를 저해하고 있습니다. 높은 인적 노동 비용과 제한적이며 미리 정의된 프롬프트 범위로 인해 기존의 오픈소스 데이터 생성 방법은 효과적으로 확장되지 못하고 있으며, 이는 공개 정렬 데이터셋의 다양성과 품질을 제한할 가능성이 있습니다. 정렬된 LLM에서 직접 고품질의 명령어 데이터를 대규모로 추출하여 합성하는 것이 가능할까요? 우리는 Magpie라는 대규모 정렬 데이터를 생성하기 위한 자기 합성(self-synthesis) 방법을 제시합니다. 우리의 핵심 관찰은 Llama-3-Instruct와 같은 정렬된 LLM이 사용자 메시지를 위한 위치까지의 왼쪽 템플릿만 입력해도 자동 회귀(autoregressive) 특성 덕분에 사용자 쿼리를 생성할 수 있다는 것입니다. 우리는 이 방법을 사용하여 Llama-3-Instruct를 프롬프트하고 400만 개의 명령어와 그에 상응하는 응답을 생성했습니다. 추출된 데이터에 대해 포괄적인 분석을 수행한 후 30만 개의 고품질 인스턴스를 선별했습니다. Magpie 데이터를 다른 공개 명령어 데이터셋과 비교하기 위해, 각 데이터셋으로 Llama-3-8B-Base를 미세 조정(fine-tune)하고 미세 조정된 모델의 성능을 평가했습니다. 우리의 결과는 일부 작업에서 Magpie로 미세 조정된 모델이 1천만 개의 데이터 포인트를 지도 학습(supervised fine-tuning, SFT)과 후속 피드백 학습을 통해 강화된 공식 Llama-3-8B-Instruct와 비슷한 성능을 보인다는 것을 나타냅니다. 또한, Magpie를 SFT에만 사용하는 것이 UltraFeedback를 이용한 직접 선호 최적화(direct preference optimization)와 같은 이전의 공개 데이터셋을 SFT와 선호 최적화에 모두 사용한 경우를 능가할 수 있음을 보여줍니다. 이러한 이점은 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.