ALMA: ALIGNMENT WITH MINIMAL ANNOTATION
Meta FAIR
preprint, Dec 2024, citation 9
1/19
Introduction
2/19
Language model alignment : model이 user instruction에 정확하고 도움이 되게끔 response를 제공하도록 학습
* Instruction dataset : 명령어와 그에 따른 출력이 포함된 데이터셋
| Llama 3 8B Base | Llama 3 8B Instruct |
pretraining | pretrained on over 15 trillion tokens of data from publicly available sources | |
fine-tuning | X | fine-tuning data includes publicly available instruction datasets, �as well as over 10M human-annotated examples |
description | 단순히 텍스트에서 다음 token이 무엇일지 예측 자유로운 텍스트 생성에 적합 | user - assistant 사이의 대화 내용을 학습 명령을 이해하고 응답하는데에 더 최적화 되어 있음 |
많은, 사람이 생성한 instruction data를 필요로 함
Introduction
3/19
최소한의 human annotation으로 alignment training 시도하여, instruct model과 유사한 성능의 model 생성 (ALMA)
Method
4/19
Pipeline Overview
Aligned LLM
Judge LLM
base LLM
instruct LLM
Seed Data for Fine Tuning (4k)
real-value scoring
self-distillation
vanilla prompting
base LLM
Prompt Synthesis
Response Synthesis
seed SFT data (5k)
Large human annotated dataset
( >10M )
scoring response
Method
5/19
Prompt Synthesis
5000건의 seed prompt (already annotated, initial SFT용) 에서 랜덤하게 3~5개의 prompt 추출�이를 few-shot 예시로 제공하여 새 prompt를 생성하도록 base LLM에 지시�→ 반복 과정을 통해 총 1억(100M)건의 unique synthetic prompt set 얻음
그러나 생성된 synthetic prompt의 경우,
“시애틀로 3일간의 여행 계획을 짜줘” 와 같은 일반적이고 짧은 prompt가 주를 이뤘으며,�medical과 같은 특정 도메인이나 길고 복잡한 prompt는 상대적으로 적었음
→ 단순히 random하게 데이터를 추출하여 학습에 사용하면 일반적인 prompt에만 익숙해짐
⇒ diversified sampling
Aligned LLM
Judge LLM
Seed Data for Fine Tuning (4k)
real-value scoring
self-distillation
vanilla prompting
base LLM
Prompt Synthesis
Response Synthesis
seed SFT data (5k)
scoring response
Method
6/19
Response Synthesis
Best-of-n SFT 적용함 (간단하고 효과적이기에)
*다만 DPO-style도 적용가능하며 해당 내용도 결과에서 확인함
Best-of-n 을 진행할 때, response가 많고 다양할 수록 더 좋은 response를 선택할 수 있음
Aligned LLM
Judge LLM
Seed Data for Fine Tuning (4k)
real-value scoring
self-distillation
vanilla prompting
base LLM
Prompt Synthesis
Response Synthesis
seed SFT data (5k)
scoring response
Method
7/19
Judge
LLM 학습 진행 시, 주어진 prompt에 대해 response가 적절한 지에 대한 scoring 필요 → LLM-as-Judge 방법 선택
Seed Data for Fine Tuning
base LLM도 충분히 judge를 잘 진행할 수 있지만
몇천건의 적당한 양의 데이터로 SFT하면 좀 더 성능이 좋아짐
1 ~ 5점 사이로 점수를 매기라고 하면 response 간 점수 차이를 확인하기 어려움
→ 0 (unusable) ~ 10 (outstanding)점 사이 scoring
2000개의 seed prompt에 대해, Llama models로 prompt당 2개의 responses 생성
human annotator들이 직접 점수를 매겨, 총 4000개의 prompt-response-score triplet 데이터셋 얻음
→ 해당 데이터로 base LLM을 SFT 하여 Judge용 LLM 모델을 만듦
Method
8/19
Judge
LLM-as-a-Judge with real-value scoring
0~10점 scale로 scoring하게 시킨다고 하여도, 많은 response가 동일한 최고 점수를 받아 �최고 response 1개를 선택하기가 어려운 경우 존재
그리하여, 0에서 10까지 LLM이 해당 점수 토큰을 생성할 확률을 곱한 뒤 합산을 구함
Ex) real-value score = 0 x 0.00 + 1 x 0.00 + 2 x 0.01 + … + 10 x 0.03 = 7.24
self-distillation
prompt / response synthetic 과정에서 생성된 데이터 중 20k개의 synthetic prompt-response pair의 score를 judge SFT된 LLM으로 얻음
해당 20k개의 synthetic prompt-response-score triplet으로 추가로 judge SFT LLM을 SFT 시킴
*스스로 data synthetic하여 그걸 다시 학습에 사용하였기에 self-distillation
Aligned LLM
Judge LLM
Seed Data for Fine Tuning (4k)
real-value scoring
self-distillation
vanilla prompting
base LLM
Prompt Synthesis
Response Synthesis
seed SFT data (5k)
scoring response
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
0.00 | 0.00 | 0.01 | 0.02 | 0.04 | 0.08 | 0.20 | 0.25 | 0.23 | 0.14 | 0.03 |
Method
9/19
Judge
vanilla prompting vs chain-of-thought prompting
vanilla prompting : 바로 score 생성하도록 지시
chain-of-thought prompting : score 생성 전에 reasoning step 진행
→ vanilla prompting 선택하여 사용
Aligned LLM
Judge LLM
Seed Data for Fine Tuning (4k)
real-value scoring
self-distillation
vanilla prompting
base LLM
Prompt Synthesis
Response Synthesis
seed SFT data (5k)
scoring response
Method
10/19
Model training (K=50k, R=10)
base LLM
initial SFT LLM 1
initial SFT LLM 2
base LLM
Judge SFT LLM
K new prompts from 100M synthetic prompt
200 x K prompt-response pair
initial SFT LLM 1
initial SFT LLM 2
K best prompt-response pair in round r
Judge LLM
base LLM
LLM for round r
LLM for round r-1
Judge LLM
for each round r (r = 2, 3, …, R )
4k seed judge SFT data
20k synthetic judge data
5k seed SFT data
K best prompt-response pair in round 2
5k seed SFT data
… in round r
in different seed
①
②
③
④
100M synthetic prompt
Experimental setup
11/19
Data
5k seed SFT data : Daring-Anteater dataset에서 randomly sampled
Model : Llama3 8B Base (Llama3 8B Instruct 모델과 추후 성능 비교)
Evaluation
*alignment benchmark : evaluation시 GPT-4o & Armo reward model로 response score
*judge evaluation
Result
12/19
Instruct 모델과 ALMA 모델 사이의 성능 비교
단순히 initial SFT 만으로는 Instruct 모델과의 성능 차이가 존재하며,
최종 ALMA 모델의 경우 두 score 종류와 여러 benchmark에 대해 Instruct과 비슷한 성능을 보임
그래프 : Armo avg score 기준으로 training round 마다의 성능 확인
Result
13/19
GPT-4 Turbo가 생성한 응답과 모델이 생성한 응답을 비교하여 win rate 계산
Result
14/19
Prompt 및 response sampling 기법의 효과
* r = 2 (첫 synthetic data sft)
Result
15/19
N, K, R hyper-parameter 조정
* r = 2
* r = 4
Result
16/19
Judge improvement 효과
Judge LLM의 경우, fine-tuning이 꼭 필요함
real-value scoring이 judge 성능을 향상시키며, self-distillation도 조금의 성능 향상을 도움
Result
17/19
+) DPO에도 ALMA를 적용하였을 때 효과 확인
DPO도 같은 학습 방법을 적용하였을 때, best-of-n SFT와 같이 round가 올라갈 수록 성능이 향상되는 것을 확인할 수 있음
*DPO: chosen data = 가장 score 높은 response, rejected data = 그 외의 response 중 random
Summary / To applicate
18/19
Summary
To applicate
ABS_SYSTEM_PROMPT You are a fair judge assistant tasked with providing clear, objective feedback based on specific criteria, ensuring each assessment reflects the absolute standards set for performance. |
ABSOLUTE_PROMPT_WO_REF ###Task Description: An instruction (might include an Input inside it), a response to evaluate, and a score rubric representing a evaluation criteria are given. 1. Write a detailed feedback that assess the quality of the response strictly based on the given score rubric, not evaluating in general. 2. After writing a feedback, write a score that is an integer between 1 and 5. You should refer to the score rubric. 3. The output format should look as follows: "(write a feedback for criteria) [RESULT] (an integer number between 1 and 5)" 4. Please do not generate any other opening, closing, and explanations. ###The instruction to evaluate: {instruction} ###Response to evaluate: {response} ###Score Rubrics: {rubric} ###Feedback: |
Thank you
19/19