TL;DR
ReMax is a streamlined alternative to Proximal Policy Optimization (PPO) for aligning Large Language Models (LLMs) via Reinforcement Learning from Human Feedback (RLHF). By leveraging the unique deterministic nature of text generation, ReMax eliminates the need for a costly "Value Model," reducing GPU memory usage by nearly 50% and speeding up training by 1.6x while achieving state-of-the-art results on 7B-parameter models.
What Problem Does This Paper Address?
The standard approach for aligning LLMs with human preferences is RLHF, typically powered by the PPO algorithm. However, PPO was originally designed for general reinforcement learning in complex, stochastic environments (like robotics or video games). When applied to LLMs, PPO is "overkill"—it is computationally expensive, memory-intensive, and notoriously difficult to tune due to a plethora of hyper-parameters.
The primary bottleneck in PPO is the Value Model, a secondary neural network (often the same size as the LLM itself) used to estimate future rewards. Training this model consumes massive amounts of GPU memory and adds significant overhead. The authors of ReMax argue that we don't actually need this complexity because LLM environments are deterministic and rewards are typically provided only at the end of a generated sequence (trajectory-level).
Methods
ReMax is built upon the classic REINFORCE policy gradient algorithm but introduces a novel variance reduction technique tailored for LLMs.
- Ditching the Value Model: As shown above, ReMax removes the Value Model and its associated optimizer states, which are responsible for nearly half of PPO's memory footprint.
- The Greedy Baseline: To solve the high-variance issues inherent in REINFORCE, ReMax uses a "greedy" rollout as a baseline. For every prompt, the model generates two responses: one by sampling (stochastic) and one by picking the most likely tokens (greedy).
- Reward Normalization: The reward of the greedy response is subtracted from the reward of the sampled response. This effectively "centers" the reward, ensuring that the model is penalized if its random sample is worse than its best guess and rewarded if it finds something better.
- Simplicity: ReMax is significantly easier to implement, requiring only about 6 lines of core code compared to 30+ for PPO, and it eliminates at least four sensitive hyper-parameters (like GAE coefficients and clipping ranges).
Datasets
The authors evaluated ReMax using several prominent datasets:
- Training:
full-hh-rlhf(Anthropic),ultrafeedback,lmsys-chat-1m, andsharegpt-en. - Evaluation:
- AlpacaEval: A benchmark of 805 diverse prompts where models are judged by GPT-4 against a baseline (
text-davinci-003).
- AlpacaEval: A benchmark of 805 diverse prompts where models are judged by GPT-4 against a baseline (
- MT-bench: A set of 80 multi-turn questions designed to test conversational flow and reasoning.
Key Insights and Ideas
- LLMs aren't StarCraft: In traditional RL, the environment is unpredictable and slow to simulate. In LLMs, the "environment" is just the text generated so far, which is fast and deterministic. Because transitions are deterministic, the sophisticated machinery PPO uses to handle environmental uncertainty is unnecessary.
- Trajectory-Level Rewards: Since LLMs usually receive a single reward score for an entire response rather than a reward for every single word, the "temporal difference" learning used in PPO's value model provides less utility than it does in other RL domains.
- Memory as a Feature: By saving ~46% of GPU memory, ReMax allows researchers to train 7B models on standard hardware (like a single A800-80GB) without needing complex "offloading" techniques that slow down training.
Key Results
- Efficiency: ReMax is roughly 1.6x faster than PPO and reduces memory consumption by 46%.
- Performance: When applied to a Mistral-7B model, ReMax achieved a 94.78% win rate on AlpacaEval and a score of 7.739 on MT-bench. This set a new state-of-the-art (SOTA) for open-source 7B models at the time of publication.
- Stability: Unlike standard REINFORCE, which often diverges during training, ReMax's greedy baseline provides stable gradients comparable to (or better than) PPO.
- DPO Complement: The authors found that using a model pre-trained with Direct Preference Optimization (DPO) as an initialization for ReMax led to even higher performance (84.7% win rate on AlpacaEval), suggesting the two methods can be used together.
Limitations and Future Work
- Over-optimization: The authors noted that performance can degrade if the model is trained on too much data without proper regularization, a common issue in RLHF known as "reward hacking."
- Generation Overhead: While ReMax saves memory by removing the value model, it requires two generations per training step (sampled and greedy). The authors suggest "ReMax-fast"—using truncated greedy responses—as a way to mitigate this, showing it can push the speedup to 2.1x with minimal performance loss.
- Prompt Engineering: The paper highlights that we still don't fully understand which types of prompts are most effective for the RL stage of alignment, leaving this as an open question for future research.
Summary updated