1 of 19

ALMA: ALIGNMENT WITH MINIMAL ANNOTATION

Meta FAIR

preprint, Dec 2024, citation 9

1/19

2 of 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를 필요로 함

3 of 19

Introduction

3/19

최소한의 human annotation으로 alignment training 시도하여, instruct model과 유사한 성능의 model 생성 (ALMA)

4 of 19

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

5 of 19

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

  • base LLM으로 각 synthetic prompt의 hidden representation 추출
  • hidden representation 을 바탕으로 k-means clustering을 진행, 1M cluster 생성
  • K개의 synthetic prompt를 사용하여 LLM 학습 진행할 경우, �K개의 cluster를 random하게 선택하여 그 안에서 이전 단계에서 사용되지 않은 1개 prompt를 각각 추출하여 사용

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

6 of 19

Method

6/19

Response Synthesis

  • Best-of-n SFT : prompt마다 모델이 생성한 N개의 응답 중 best response 선정 후, � 해당 데이터만 추가 SFT
  • PPO : reward score가 높아지도록 LLM 학습
  • DPO / SimPO : 선호하는 응답을 생성할 확률이 높아지도록 LLM 학습

Best-of-n SFT 적용함 (간단하고 효과적이기에)

*다만 DPO-style도 적용가능하며 해당 내용도 결과에서 확인함

Best-of-n 을 진행할 때, response가 많고 다양할 수록 더 좋은 response를 선택할 수 있음

  • 기존에는 10~20개의 response 중 best를 선택했다면, 본 연구에서는 200개의 response 중에서 best response를 선택
  • 3개의 모델 checkpoint에서 response를 얻음
    • latest checkpoint, 2개의 다른 seed에서 학습된 initial SFT checkpoints
    • 3개의 모델 checkpoint에서 1:1:1 비율로 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

7 of 19

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 모델을 만듦

8 of 19

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

9 of 19

Method

9/19

Judge

vanilla prompting vs chain-of-thought prompting

vanilla prompting : 바로 score 생성하도록 지시

chain-of-thought prompting : score 생성 전에 reasoning step 진행

→ vanilla prompting 선택하여 사용

  1. 실제 처음에 human-annotated score dataset으로 Judge LLM 학습시켰을 때, 두 prompting 성능이 유사했음
  2. real-value scoring을 진행할 때, chain-of-thought prompting을 사용할 경우�reasoning 과정에 따라서 score를 출력할 확률값이 달라지기에, 여러번 reasoning을 시킨 뒤 점수를 평균 내야 함 → 계산량 증가

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

10 of 19

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

11 of 19

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

  • LIMA (300 prompts)
  • MT-Bench (80 prompts) : 수학·코딩·논리·글쓰기 등 8개 카테고리 평가
  • Self-Reward (SR, 250 prompts)
  • Arena-Hard (500 prompts) : 수학·추론·장문 작성 등 난이도 높은 문제들로 평가
  • AlpacaEval (600 prompts)

*judge evaluation

  • Reward-Bench : 2개의 응답 중 사람이 더 선호하는 응답을 reward model도 똑같이 더 선호한다고 평가하는지 확인

12 of 19

Result

12/19

Instruct 모델과 ALMA 모델 사이의 성능 비교

단순히 initial SFT 만으로는 Instruct 모델과의 성능 차이가 존재하며,

최종 ALMA 모델의 경우 두 score 종류와 여러 benchmark에 대해 Instruct과 비슷한 성능을 보임

그래프 : Armo avg score 기준으로 training round 마다의 성능 확인

13 of 19

Result

13/19

GPT-4 Turbo가 생성한 응답과 모델이 생성한 응답을 비교하여 win rate 계산

14 of 19

Result

14/19

Prompt 및 response sampling 기법의 효과

* r = 2 (첫 synthetic data sft)

15 of 19

Result

15/19

N, K, R hyper-parameter 조정

* r = 2

* r = 4

16 of 19

Result

16/19

Judge improvement 효과

Judge LLM의 경우, fine-tuning이 꼭 필요함

real-value scoring이 judge 성능을 향상시키며, self-distillation도 조금의 성능 향상을 도움

17 of 19

Result

17/19

+) DPO에도 ALMA를 적용하였을 때 효과 확인

DPO도 같은 학습 방법을 적용하였을 때, best-of-n SFT와 같이 round가 올라갈 수록 성능이 향상되는 것을 확인할 수 있음

*DPO: chosen data = 가장 score 높은 response, rejected data = 그 외의 response 중 random

18 of 19

Summary / To applicate

18/19

Summary

  • base LLM을 Instruct LLM과 유사하게, 하지만 Instruct LLM을 생성하기 위해 사용한 human-annotated data 보다 적은 data를 사용하여 alignment learning 진행
  • prompt synthesis, response synthesis,�real-value scoring, self-distillation 등을 활용하여�Llama 3 8B Instruct 과 성능 유사한 Aligned LLM 생성 가능

To applicate

  • 인계요약지 생성 연구
    • 22건의 데이터에 대해 사람이 생성한 인계요약지 텍스트 존재
    • 2736건의 데이터로 synthetic 인계요약지 생성 및 학습
      • 여러 모델로 synthetic data 생성 필요성 확인
      • synthetic data 생성하여 preference judge 시�real-value scoring 적용

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:

19 of 19

Thank you

19/19