reinforcement-learning language-models policy-optimization rlhf ppo alpacaeval dpo preference-learning
Abstract
In the classical Reinforcement Learning from Human Feedback (RLHF) framework, Proximal Policy Optimization (PPO) is employed to learn from sparse, sentence-level rewards -- a challenging scenario in traditional deep reinforcement learning. Despite the great successes of PPO in the alignment of large language models, its open-source implementation is still largely sub-optimal. To address these issues, we introduce a framework that models RLHF problems as a Markov decision process (MDP), enabling the capture of fine-grained token-wise information. Under this framework, we introduce an algorithm Reinforced Token Optimization (\texttt{RTO}), which learns the token-wise reward function from preference data and performs policy optimization based on this learned token-wise reward signal. Theoretically, \texttt{RTO} is proven to have the capability of finding the near-optimal policy sample-efficiently. For its practical implementation, \texttt{RTO} innovatively integrates Direct Preference Optimization (DPO) and PPO. DPO, originally derived from sparse sentence rewards, surprisingly provides us with a token-wise characterization of response quality, which is seamlessly incorporated into our subsequent PPO training stage. Extensive experiments demonstrate that \texttt{RTO} performs better than PPO and other direct preference learning algorithms. In particular, RTO outperforms PPO by 7.5 points on the AlpacaEval 2 benchmark and by 4.1 points on Arena-Hard. Our code and models are available at \href{https://github.com/zkshan2002/RTO}{https://github.com/zkshan2002/RTO}.
한국어 요약
한 줄 요약
RTO는 DPO와 PPO를 결합한 토큰 수준 보상 학습을 통해 RLHF 성능을 7.5점 개선한 새로운 알고리즘이다.
핵심 기여도
- RTO는 토큰 수준 보상 함수를 학습하여 RLHF 문제를 MDP로 모델링함.
- DPO를 활용해 토큰 수준 품질 정보를 추출하고 PPO 학습에 통합함.
- AlpacaEval 2에서 PPO 대비 7.5점, Arena-Hard에서 4.1점 개선됨.
- RTO는 샘플 효율성과 이론적 보장성을 갖춤.
핵심 아이디어
기존 RLHF는 문장 수준 보상만 사용하여 토큰 수준 정보를 활용하지 못했다. RTO는 토큰 수준 보상을 학습하여 MDP 기반 PPO 학습에 통합함으로써 보다 세밀한 정책 최적화를 가능하게 한다. DPO는 원래 문장 수준 보상에서 유도되지만, RTO에서는 이를 토큰 수준으로 확장하여 품질을 캡처하고, 이는 PPO 학습 단계에서 자연스럽게 활용된다. 이는 기존 PPO가 마지막 토큰에만 보상을 할당하는 방식과 대비되며, 토큰 수준 보상 분포를 통해 학습 효율성을 높인다.
기술적 접근법
- **RTO 알고리즘**: 토큰 수준 보상 함수를 학습하고, 이를 기반으로 정책 최적화를 수행함.
- **DPO 활용**: DPO는 문장 수준 보상에서 토큰 수준 품질 정보를 추출하여 PPO 학습에 통합됨.
- **PPO 최적화**: 토큰 수준 보상이 각 단계에 할당되어, 기존 PPO가 마지막 토큰에만 보상을 주는 방식과 달리 보다 밀집된 학습이 가능함.
- **KL 정규화**: 정책 최적화 시 KL-regularized term을 사용하여 기준 모델과의 차이를 제어함.
- **데이터셋**: 학습에는 (x, y^w, y^l) 형태의 선호 데이터셋이 사용됨.
주요 결과
- **AlpacaEval 2**: RTO는 PPO 대비 7.5점 개선됨.
- **Arena-Hard**: RTO는 PPO 대비 4.1점 개선됨.
- **온도 실험**: 다양한 온도 설정에서도 RTO는 다른 베이스라인 대비 안정적인 성능을 보임.
의의 및 한계
RTO는 기존 PPO의 샘플 비효율성과 보상 분포 문제를 해결하며, 토큰 수준 정보를 활용한 새로운 RLHF 프레임워크를 제시한다. 이론적으로 샘플 효율성과 최적 정책 탐색 가능성을 보장하며, 실용적 구현에서도 성능 향상이 입증되었다. 그러나 DPO를 기반으로 한 토큰 수준 보상 학습이 여전히 제한적일 수 있으며, 다른 보상 학습 방법론과의 비교는 추가 연구가 필요하다.
실용적 활용
RTO는 대형 언어 모델의 정책 최적화, 특히 인간 선호에 기반한 대화 시스템 개선에 적용 가능하다. ChatGPT, Claude, Gemini 등과 같은 상용 모델의 정책 학습 과정에서 샘플 효율성과 성능을 동시에 향상시킬 수 있다.