사전으로 돌아가기

RLHF

Reinforcement Learning from Human Feedback
대규모 언어 모델

RLHF는 사람의 선호를 이용해 언어 모델의 행동을 사람이 원하는 방향에 맞추는 학습 방법이다. 사전학습을 마친 모델이 같은 프롬프트에 여러 응답을 내놓으면 사람이 그 응답의 순위를 매기고, 이 순위 데이터로 사람의 선호를 예측하는 별도의 보상 모델을 학습시킨다. 그다음 이 보상 신호를 기준으로 언어 모델을 최적화하며 흔히 PPO 알고리즘을 쓴다. 그 결과 단순한 텍스트 예측기가 지시를 따르고 유해한 요청을 거절하며 답변 형식을 다듬는 비서로 바뀐다. ChatGPT가 그 이전의 기본 모델보다 훨씬 쓸 만하게 느껴진 이유의 상당 부분이 여기에 있고, 주요 비서 모델은 모두 변형된 형태를 쓴다. Anthropic의 Constitutional AI는 사람 라벨링의 상당 부분을 문서화된 원칙으로 대체해 모델이 스스로 출력을 비평하고 고치게 한다. DPO는 보상 모델 없이 선호 쌍으로 바로 학습하는 더 단순한 대안이다. 약점은 보상 해킹과 아첨이다. 정답 대신 점수를 잘 받는 답, 사용자에게 맞장구치는 답으로 기울 수 있다.

Reinforcement learning from human feedback (RLHF) is a training method that uses human preferences to align a language model's behavior with what people actually want. After pretraining, the model produces multiple responses to the same prompt, human annotators rank them, and those rankings train a separate reward model that predicts human preference. The language model is then optimized against that reward signal, commonly with the PPO algorithm, so it favors responses people rate highly. The result is the shift from a raw text predictor into an assistant that follows instructions, declines harmful requests, and formats answers usefully. RLHF is a large part of why ChatGPT felt usable compared with the base models that preceded it, and every major assistant uses some version of it. Anthropic's Constitutional AI substitutes a written set of principles for much of the human labeling, having the model critique and revise its own outputs. Direct preference optimization (DPO) skips the separate reward model and trains directly on preference pairs, which is simpler and now widely used. The known weaknesses are reward hacking, where the model learns to produce answers that score well rather than answers that are correct, and sycophancy, where it agrees with the user because agreement was rated favorably.

사용 예시

  • RLHF를 거친 모델은 거절해야 할 요청을 훨씬 일관되게 구분한다
  • Anthropic은 사람 라벨링 대신 문서화된 원칙을 활용하는 방식을 결합해 쓴다
  • DPO는 별도의 보상 모델 없이 선호 데이터로 바로 학습하는 대안으로 자리 잡았다

관련 용어