Skip to content

Back to Basics: Revisiting REINFORCE Style Optimization for Learning from Human Feedback in LLMs

optionalcorefrontierpaperrubric 11/122024 · ~45 min

Arash Ahmadian, Chris Cremer, Matthias Gallé, …, Sara Hooker

Status

TL;DR. In RLHF the reward comes once, at the end of a response, and the policy starts as a strong pretrained model. So treat the whole response as one action and use plain REINFORCE. For variance reduction, sample kk responses per prompt and use, for each one, the average reward of the other k−1k-1 as its baseline. This is RLOO (REINFORCE Leave-One-Out). It needs no critic network and no GAE. In the paper it beats PPO, DPO and RAFT on TL;DR summarisation and Anthropic-HH.

Why it matters now. RLOO is one of the simplest “PPO without the critic” methods, and its argument underlies GRPO and most reasoning-RL recipes. GRPO uses the same group-of-samples idea with a different normalisation. Knowing exactly how RLOO, a critic and GRPO build their baselines lets you read Dr. GRPO, DAPO and similar papers as small changes to one formula.

With the sequence-level reward R(y,x)=rϕ(x,y)−β KLR(y,x)=r_\phi(x,y)-\beta\,\mathrm{KL} treated as a bandit reward, REINFORCE with a baseline bb is E[(R(y,x)−b) ∇log⁡πθ(y∣x)]\mathbb E\big[(R(y,x)-b)\,\nabla\log\pi_\theta(y\mid x)\big]. RLOO samples y(1),…,y(k)y_{(1)},\dots,y_{(k)} i.i.d. and uses (paper Eq. 9)

1k∑i=1k[R(y(i),x)−1k−1∑j≠iR(y(j),x)]∇log⁡π(y(i)∣x).\frac1k\sum_{i=1}^{k}\Big[R(y_{(i)},x)-\frac{1}{k-1}\sum_{j\ne i}R(y_{(j)},x)\Big]\nabla\log\pi(y_{(i)}\mid x).

The baseline for sample ii uses only the other samples, so it is independent of y(i)y_{(i)} and the estimator stays unbiased. Algebraically, the advantage is kk−1(Ri−Rˉ)\tfrac{k}{k-1}(R_i-\bar R): the group mean, rescaled to undo the bias from including the sample itself.

Worked example: three ways to build an advantage

Section titled “Worked example: three ways to build an advantage”

One prompt, k=4k=4 samples, rewards R=(1.0, 0.0, 2.0, 1.0)R=(1.0,\,0.0,\,2.0,\,1.0):

SampleRiR_iRLOO baseline (mean of others)RLOO advantageCritic V(x)=0.6V(x)=0.6GRPO (Ri−Rˉ)/std(R_i-\bar R)/\mathrm{std}
11.01.0000+0.40
20.01.333−1.333−0.6−1.22
32.00.667+1.333+1.4+1.22
41.01.0000+0.40
  • RLOO advantages sum to zero and keep the reward’s scale.
  • The critic is a learned network that predicts one number. If it is off (here by −0.4), every sample is shifted, and three of four are pushed up. In PPO the critic is also per token and trained alongside the policy.
  • GRPO divides by the group standard deviation (sample std ≈ 0.82). Prompts with tiny reward spread get large advantages. Dr. GRPO criticises this, along with GRPO’s per-token length normalisation.
  • All equal rewards (e.g. all 1.0): RLOO and GRPO both give zero advantage, so the prompt gives no learning signal.

Also note sequence vs token level. RLOO multiplies one sequence advantage by log⁡π(y∣x)=∑tlog⁡π(yt∣y<t,x)\log\pi(y\mid x)=\sum_t\log\pi(y_t\mid y_{\lt t},x). PPO gives each token its own GAE advantage from the critic. GRPO gives every token the same sequence-level advantage but keeps PPO’s per-token clipped ratio and averages over tokens.

Three ways to build an advantage for one prompt One prompt with four sampled responses whose rewards are 1, 0, 2 and 1. Three panels show their advantages. PPO with a learned critic predicting 0.6 gives plus 0.4, minus 0.6, plus 1.4 and plus 0.4; it needs an extra trained network; used as a Monte Carlo baseline it stays unbiased if action-independent, even when the critic is off, and only the variance suffers. RLOO uses the mean of the other three samples as the baseline, 1, 1.33, 0.67 and 1, giving advantages 0, minus 1.33, plus 1.33 and 0; it needs no extra model, is unbiased, and sums to zero. GRPO standardises by the group mean and standard deviation, giving 0, minus 1.22, plus 1.22 and 0; its scale is set by one over the standard deviation. Same four rewards, three baselines prompt x, k = 4 rewards R y1: R = 1.0 y2: R = 0.0 y3: R = 2.0 y4: R = 1.0 PPO: learned critic A = R − V, V = 0.6 +0.4 −0.6 +1.4 +0.4 extra trained net MC baseline: unbiased if action-independent RLOO: leave-one-out baseline → advantage 1.00 → 0 1.33 → −1.33 0.67 → +1.33 1.00 → 0 no extra model unbiased, sums to 0 GRPO (R − mean) / std 0 −1.22 +1.22 0 no extra model scale set by 1/std
Original sketch. For one prompt, PPO uses a learned per-token critic, RLOO uses the mean reward of the other samples, and GRPO standardises within the group. The numbers are this page's worked example.

GPT-4-judged win rate (%, Table 1). TL;DR is against SFT completions; HH is against the preferred completion.

MethodTL;DR (Pythia)HH (Pythia)HH (Llama)
RLOO k = 477.943.764.1
RLOO k = 274.247.662.2
RAFT k = 473.242.163.3
REINFORCE + baseline70.737.955.3
Vanilla PG70.436.452.3
PPO67.629.232.0
DPO66.639.061.9
  • Size of the gains. RLOO with k = 4 beats PPO by 10.3, 14.5 and 32.1 points. Even plain REINFORCE with a moving-average baseline beats PPO in all three settings.
  • Fluency. RLOO, RAFT and REINFORCE have much lower perplexity than PPO and vanilla PG (Table 2).
  • Robustness. With Gaussian reward noise of σ = 3 or 5, RAFT’s training reward drops far more than RLOO’s.
  • Scale and scope. Only 7B models, two datasets and one RM per setting. PPO’s very low HH-Llama score suggests the baseline may be under-tuned.
  • Judge-based evaluation. Win rates come from a GPT-4 judge (LLM-as-judge caveats), with greedy decoding.
  • Cost. k samples per prompt cost k generations; check whether a comparison with PPO matches total generation compute before reading too much into the gaps.
  • When token credit matters. With process rewards, tool calls or very long reasoning traces, a per-token or per-step signal may again help (outcome vs process rewards).

Questions to think through

These questions have no single right answer. Write or say your answer before you open the hints. Mark a question once you could defend your answer in a reading group.

  1. Derive / compute

    For one prompt you sample k = 4 responses with KL-penalised rewards R = (1.0, 0.0, 2.0, 1.0). Compute the RLOO advantage of each sample, show that they equal k/(k − 1) times the reward minus the batch mean, and compare with a critic that predicts V(x) = 0.6 and with GRPO's group-standardised advantage.

    What a strong answer covers
    • Leave-one-out baselines are the means of the other three: 1.0, 1.333, 0.667 and 1.0. Advantages are 0, −1.333, +1.333 and 0.
    • The batch mean is 1.0, so R_i − mean is (0, −1, 1, 0). Multiplying by 4/3 gives the same advantages, because R_i − (kR̄ − R_i)/(k − 1) = k(R_i − R̄)/(k − 1).
    • With a critic V(x) = 0.6, advantages are 0.4, −0.6, 1.4 and 0.4. A wrong critic shifts every advantage: three samples receive positive policy-gradient weights; the zero-reward sample has advantage −0.6 and receives a negative weight. Because V(x) is action-independent and the returns are full Monte Carlo, the shift changes variance, not the expected gradient.
    • GRPO divides R − mean by the group standard deviation (sample std 0.82), giving about 0, −1.22, +1.22 and 0. The sign pattern is the same, but the scale depends on how spread out the rewards are.
    • RLOO advantages always sum to zero within the group, so the update pushes some samples up and others down.
  2. Derive / compute

    Show that the leave-one-out baseline keeps the REINFORCE gradient unbiased, while using the plain group mean (including the sample itself) would not. What property of the k samples does the argument rely on?

    What a strong answer covers
    • For sample i, the baseline b_i is a function only of y_j for j ≠ i, which are drawn independently of y_i.
    • So E[b_i ∇log π(y_i|x)] = E[b_i]·E[∇log π(y_i|x)] = E[b_i]·0, using the score-function identity E[∇log π] = 0.
    • If the mean includes R_i, the baseline depends on y_i, so the cross term no longer vanishes. The bias is a factor (k − 1)/k on the gradient, which is why RLOO's k/(k − 1) scaling corrects it.
    • The argument needs the k samples to be i.i.d. from the current policy for the same prompt.
  3. Mechanism

    PPO for RLHF treats every token as an action and every partial sequence as a state. Explain why the paper argues that this is unnecessary when the reward arrives only at the end, and what is lost and gained by treating the whole response as one bandit action.

    What a strong answer covers
    • Token transitions are deterministic: appending a token defines the next state exactly, so the "environment" adds nothing beyond the policy's own choices.
    • The reward model gives one score per full response. There is no true intermediate reward, so a learned per-token value has nothing real to fit and adds bias.
    • Treating the response as one action uses log π(y|x), the sum of token log-probs, times one sequence-level advantage. The critic and GAE are gone.
    • Lost: token-level credit assignment, which might matter with process rewards or very long outputs. Gained: fewer models, no value bias and simpler tuning.
    • In the paper REINFORCE (sequence-level) beats vanilla PG (token-level) on every dataset, even with a single sample.
  4. What if…

    The paper strips PPO down in steps: GAE λ from 0 to 1, then removing clipping, then removing the importance ratio. Report what happened at each step and the explanation the authors give about the starting point of the policy.

    What a strong answer covers
    • Reward rises monotonically as λ goes from 0 to 1. The unbiased, high-variance λ = 1 (vanilla PG) is best, so the bias from bootstrapping costs more than the variance it saves.
    • Clipping is active in under 5% of each batch on average, so training is nearly on-policy. Removing clipping, then the ratio, does not hurt and slightly helps.
    • Explanation: a pretrained and SFT-tuned LM is a very strong starting policy, and conditioning on the prompt concentrates probability on a few tokens at each step. The high-variance problems that motivated PPO in deep RL from scratch are mostly absent.
    • The result is limited to 7B models, two datasets, and reward models with sequence-level scores.
  5. Critique

    RLOO with k = 4 beats PPO by 10.3, 14.5 and 32.1 win-rate points. Critique the evidence: how is win rate measured, how was PPO tuned, what is the compute cost of k, and what would you need to see before adopting RLOO for a new task?

    What a strong answer covers
    • Win rates are simulated with GPT-4 as judge (AlpacaFarm protocol) against SFT completions for TL;DR and preferred completions for HH, so judge bias can affect them.
    • PPO's 32.0 on HH-Llama is lower than DPO and vanilla PG, which suggests PPO was hard to tune here. One strong PPO baseline per setting is limited evidence.
    • k samples per prompt cost k generations. RLOO and RAFT are compared at equal k, but you should check whether the comparison with PPO and REINFORCE matches total generation compute.
    • Before adopting: same-compute comparisons, several seeds, a held-out human or second-judge evaluation, and checks on length and reward hacking.
  6. Design

    You train a query-rewriting policy for a search engine. The reward is nDCG@10 of the rewritten query's results minus a KL penalty. Decide between PPO, RLOO and GRPO-style advantages. What k would you use, and what happens to the RLOO update for a prompt where all k rewrites get the same nDCG?

    What a strong answer covers
    • The reward is one number per full rewrite and rewrites are short, so a sequence-level, critic-free method fits. A critic would have to predict nDCG from partial queries.
    • Choose k from cost: each sample needs a retrieval run. The paper found k = 2 RLOO matched or beat k = 4 RAFT, so start small.
    • If all k rewards are equal, every leave-one-out advantage is zero and the prompt gives no gradient (GRPO gives the same, and has to avoid dividing by a zero std).
    • Common with graded metrics: many queries are already solved (all 1) or impossible (all 0). Filter or up-weight prompts with mixed outcomes, or use a denser reward.
    • GRPO's std scaling inflates tiny reward differences on easy prompts. RLOO keeps the raw scale, which matters when nDCG gaps are meaningful.

Done with this page?

Status