RL for LLM Agents · 5 min read
A pretrained model predicts text. Reinforcement learning from human feedback, or RLHF, is the recipe that turns it into an assistant people actually prefer. It has three stages, and each one has its own failure modes.
Stage one: supervised fine-tuning
Start with a pretrained model and fine-tune it on demonstrations of good responses. This gives a reasonable starting policy that follows instructions and uses the right format. It also becomes the reference model used later to keep the policy from drifting too far.
Stage two: a reward model
Collect comparisons: for a prompt, people (or a trusted judge) pick the better of two responses. Train a reward model to assign higher scores to the preferred responses, typically with a pairwise loss based on the Bradley–Terry model. The reward model is a learned proxy for what people want, and it is imperfect.
Stage three: reinforcement learning
Sample responses from the current policy, score them with the reward model, and update the policy to increase expected reward. A penalty on the divergence from the reference model keeps the policy close to where the reward model is trustworthy. Algorithms such as PPO or group-based methods perform the update.
Where it goes wrong
- The reward model is a proxy, so pushing hard on it can improve its score while true quality falls.
- Preference data reflects who labeled it and what they were asked.
- Without a divergence penalty, the policy can drift into text the reward model has never seen.
- Evaluating only with the same reward model that you optimized hides all of these problems.
Keep an independent check
Hold out human or separate-judge evaluations that the training loop never touches. Track them alongside the reward during training, and stop when they diverge.
