esc
  • WorkflowsPages
  • Case studiesPages
  • Machine Learning FoundationsLearn
  • AI EngineeringLearn
  • AI Guardrails & Red TeamingLearn
  • UI/UXLearn
  • Design SystemsLearn
  • Production System DesignLearn
  • AI papersPages
  • Interview KitPages
  • Book a callContact
Let’s talk

I’ll build the agent for it.

What Is PPO in RLHF, Simply?

What PPO is, how its capped steps and drift penalty fit into RLHF, and where newer methods differ, for your AI interview.

In short

PPO, short for proximal policy optimisation, is the reinforcement learning method that does the update step in RLHF (reinforcement learning from human feedback). It nudges a language model toward replies a reward model scores highly, in small capped steps, and keeps the model close to where it started.

11 min readAdvancedOccasional · estimateFacts checked 27 November 2026

Say it out loud

Read it once, then say it without looking. Start with the short one; use the long one when they ask you to go deeper.

PPO stands for proximal policy optimisation. In RLHF it is the step that actually changes the model. The model writes replies, a reward model scores them, and PPO nudges the model toward the high scores. It moves in small steps, and a penalty stops it drifting far from where it started. Newer methods such as DPO avoid sampling fresh replies, but PPO is still the classic method to explain.

What is PPO, in plain words?

In RLHF (reinforcement learning from human feedback), the language model is a policy: a set of settings that decides what it writes next. Training changes those settings. PPO, short for proximal policy optimisation, is the method that makes that change safely. Proximal means near, so each update stays near the last one.

Think of a bank's quality team fixing a support script. They change a few lines, test them on real calls, and keep the change only if the scores go up. They never rewrite the whole script after one bad week. PPO works the same way on a model: small changes, a score check, then repeat.

Here is the real case behind it. A support bot answers fee questions. It writes four replies, and a reward model, a second model trained to score replies, gives each one a score. PPO raises the odds of the better replies and lowers the odds of the bad ones, but only by a capped amount, so one lucky batch cannot wreck the bot.

Key words

Policy
The model's settings, seen as a rule for what it writes next.
Advantage
How much better a reply turned out than the baseline the training expects for that prompt.
Ratio
For each word the model writes, how much more or less likely the new model is to pick it than the old one.
Drift penalty
A charge for moving too far from the model's starting version.

Where does PPO fit into RLHF?

RLHF has three stages: people write good answers, people rank replies to train a reward model, and the model is then tuned against that reward model. PPO is the tool for the third stage. The InstructGPT paper from 2022 names it directly.

  • “Step 3: Optimize a policy against the reward model using PPO.”

    InstructGPT paper, step 3

One PPO round in RLHF

A customer's question

e.g. a late fee on a card

Model

writes four replies

Reward model

gives each reply a score

PPO update

Nudge the weights

a small step up the score

Drift penalty

Charges drift from the start

Updated model

next round starts here

  1. 1A customer's question starts the round.
  2. 2The four replies go to the reward model.
  3. 3The scores feed the update step.
  4. 4The nudge moves the model toward higher scores.
  5. 5The penalty pulls the update back toward the start.
  6. 6The next round samples from the updated model.
One round of PPO in RLHF. A question gets replies, the reward model scores them, and PPO nudges the model toward higher scores. The drift penalty keeps each nudge small, and the updated model starts the next round.
  1. 1

    Sample

    The current model writes several replies to real prompts.

  2. 2

    Score

    The reward model gives each reply a score, learned from people's earlier rankings.

  3. 3

    Compare

    Each score is set against a baseline estimate for its prompt. Above the baseline means a positive advantage.

  4. 4

    Update

    PPO nudges the weights toward the better replies, with the clip and the drift penalty holding the step back.

Then the loop starts again from the updated model. Each round needs fresh replies, which adds real cost to that stage.

What do the clip and the drift penalty do?

The clip works on the ratio. Word by word, it compares how likely the new model is to write each word with how likely the old one was. If the ratio moves past a small range, PPO stops giving extra credit for the change. The PPO paper was submitted in July 2017. OpenAI's PPO post describes its variant as a novel objective function not typically found in other algorithms.

Schulman's paper says PPO keeps some of the benefits of trust region policy optimization (TRPO), but is much simpler to implement.

The clip version of PPO drops the separate KL penalty of the earlier variant. InstructGPT's RLHF setup added one back: a per-token KL penalty against the starting model. KL is a score for how different two models' outputs are, so the penalty charges the model for moving too far. In RLHF, this drift penalty is the second brake.

  • “we add a per-token KL penalty from the SFT model at each token to mitigate over-optimization of the reward model.”

    InstructGPT paper, on the penalty

The DPO paper describes the RL step as maximising a learned reward "without drifting too far from the original model". It also calls RLHF "a complex and often unstable procedure". The cost is the catch: PPO samples fresh replies every round, and DPO's paper says it avoids "eliminating the need for sampling from the LM during fine-tuning".

What does the clip do to four bank replies?

Say the new model has changed how often it writes four replies, and the reward model rates each one against a baseline. The clip keeps the ratio in a small range, so a big jump earns less credit, and a big drop is not softened, because the clip keeps the larger penalty. The example uses one ratio per reply to keep the numbers small, and the numbers are made up.

Python
# A simplified PPO clip for a bank's support bot. Each reply has a ratio (how much
# more the new model likes it than the old one) and an advantage (how much better
# than its expected baseline, as the reward model rates it). The clip stops one update from earning
# extra credit for a big jump.
EPS = 0.2  # made-up clip range: the ratio is kept between 0.8 and 1.2

REPLIES = [
    ("Explains the fee, offers a review", 1.5, 1.0),
    ("Blames the customer", 1.4, -1.0),
    ("Quotes an old fee", 0.5, -0.8),
    ("Short polite reply", 1.0, 0.2),
]

def clipped(ratio, adv):
    # Keep the smaller value: a big gain is capped, and a big drop is never softened.
    clip_ratio = max(1 - EPS, min(ratio, 1 + EPS))
    return min(ratio * adv, clip_ratio * adv)

total = 0
for text, ratio, adv in REPLIES:
    value = clipped(ratio, adv)
    total += value
    print(f"{text}: ratio {ratio:.2f}, advantage {adv:+.1f}, objective {value:+.2f}")
print(f"Average objective: {total / len(REPLIES):+.2f}")

Output

Explains the fee, offers a review: ratio 1.50, advantage +1.0, objective +1.20
Blames the customer: ratio 1.40, advantage -1.0, objective -1.40
Quotes an old fee: ratio 0.50, advantage -0.8, objective -0.64
Short polite reply: ratio 1.00, advantage +0.2, objective +0.20
Average objective: -0.16

Tip

In an interview, say the clip caps the credit for a change in one batch. Don't say it makes the reward model right. It only limits how fast the model can chase the scores.

How would you stop a PPO-tuned bot from gaming its reward model?

Suppose the scores keep rising, but customers complain more and the replies grow long and fawning. The reward model has become the target, and the bot is gaming it. This failure has a name: reward hacking, and it is what the drift penalty and human review are there to catch.

  1. 1

    Check the goal, not the score

    Score a fixed set of real calls with people, and track complaints and resolution, not only the reward.

  2. 2

    Raise the drift penalty

    A stronger penalty holds the model nearer its start, which limits how far it can chase the scorer.

  3. 3

    Refresh the reward model

    Add new human rankings from recent calls, so the scorer stops rewarding the new habit.

What does the interviewer want to hear?

A strong answer covers

  • PPO is the optimiser in RLHF's third stage, in plain words.
  • The loop: sample, score, compare with the average, update.
  • The clip and the drift penalty, and what each one stops.
  • The cost: fresh samples every round, and possible instability.
  • Honest limits: a higher score can be gamed, so check with people.
  • Newer options, such as DPO, and what they skip.

Common traps

  • Trap"PPO is the whole of RLHF."

    BetterIt is one step. People's rankings of replies train the reward model first.

  • Trap"The clip makes the model always correct."

    BetterThe clip only limits how far one update moves. It can't fix a bad reward model.

  • Trap"A higher reward score means a better bot."

    BetterNot always. The model can learn to please the scorer, so check replies with people.

Can you spot the wrong step?

Spot the wrong step

Which sentence about PPO in RLHF is wrong?

Quick check

A bank's bot gets a higher reward score each week, but its replies grow longer and more fawning. What is the best first fix?

Can you answer these from memory?

Flash cards · tap a card to flip it

1 / 6

What will they ask next?

  1. Q288What is RLHF?10 min
  2. Q289What is a reward model?11 min
  3. Q291What is DPO?11 min
  4. Q292What is RL from verifiable rewards?10 min
  5. Q241What is reward hacking?11 min

Last updated on 27 November 2026

Tuning a model on your own feedback data?

I design and build AI products and agents, including the system around the model. Book a short call and tell me what you need, and I'll say honestly whether a tuning step is worth it.