Skip to content

A Long Way to Go: Investigating Length Correlations in RLHF

optionalcorefrontierpaperrubric 10/122023 · COLM 2024 · ~40 min

Prasann Singhal, Tanya Goyal, Jiacheng Xu, Greg Durrett

Status

TL;DR. In three open RLHF setups (WebGPT, Stack, RLCD), PPO raises reward mostly by making outputs longer. A reward that only scores closeness to a target length reproduces most of PPO’s downstream gain. Reward models learn length because it is the easiest reliable signal in the preference data.

Why it matters now. Length is the reward hack practitioners meet most often. It affects RLHF rewards, LLM-judge leaderboards and agent reports alike. If you grade RAG answers or deep-research reports with an LLM judge, you need to separate “better” from “longer” before you trust any gain.

Split the reward gain into two parts: the gain from moving to longer outputs, and the gain within outputs of similar length. The paper buckets outputs into 20-token bins and defines the non-length reward gain (NRG) as the average within-bucket gain, weighted by bucket counts (§3.1). It then trains PPO with a reward that only looks at length (§3.2):

R∗(y)=1−∣len(y)L−1∣,R^*(y) = 1 - \left|\frac{\mathrm{len}(y)}{L} - 1\right|,

with LL = 156 (WebGPT), 120 (RLCD) and 250 (Stack) tokens. Setup: LLaMA-7B with LoRA, TRL’s PPO with KL coefficient λ = 0.04. Evaluation uses AlpacaFarm-style simulated preferences on 500 examples.

How much of the RLHF reward gain is explained by length alone Top: the reward gain from PPO is split into a part explained by moving to longer outputs and a non-length remainder. NRG divided by the total reward gain is 2.0 percent on WebGPT, 27.2 percent on RLCD and 53.4 percent on Stack, so on WebGPT almost the whole gain is length. On WebGPT the reward rises by 0.82 but the non-length gain is only 0.02, while mean length grows from about 100 to 230 tokens. Bottom: a reward that only scores length, one minus the absolute value of length over target length minus one, called lppo, reaches simulated win rates against SFT of 56, 59 and 64 percent, close to the 58, 58 and 63 percent of PPO with the learned reward model. Share of PPO reward gain NOT explained by length (NRG / ΔR) rest of each bar = gain recovered just by shifting to longer outputs WebGPT 2.0% RLCD 27.2% Stack 53.4% non-length gain length-explained gain WebGPT: ΔR 0.82, NRG 0.02, ~100 → 230 tokens A reward that only scores length nearly matches PPO with the learned RM lppo reward = 1 − | len / L − 1 | · simulated win rate vs SFT WebGPT lppo 56 PPO 58 Stack lppo 59 PPO 58 RLCD lppo 64 PPO 63
Original sketch. Top: how much of each PPO reward gain survives after controlling for length (Table 1). Bottom: a reward that only scores length against a target, compared with PPO on the learned reward model, in simulated preference against SFT (Table 2).
  • Length explains most PPO gains on WebGPT and RLCD. On WebGPT, standard PPO has ΔR = 0.82 but NRG = 0.02. Mean output length grows from 100 tokens (SFT) to 230 (PPO). On Stack, SFT outputs are already near the length limit, so more of the gain comes from other features (§3.1).
  • lppo beats a longer SFT model. On WebGPT, sft-long (141 tokens) wins 48% against SFT, while lppo (118 tokens) wins 56%. Without the KL term (λ = 0), lppo falls to 53%. The authors credit the KL term for keeping the extra content sensible (§3.2).
  • PPO interventions (Table 3): higher λ, dropping long outputs, reward scaling and a length penalty all still increased length relative to SFT. All of them gave lower reward than standard PPO.
  • RM interventions (Table 4): length-balanced data cut WebGPT’s length–reward correlation from 0.72 to −0.13, but accuracy fell from 61.5% to 52.6%. Reward data augmentation (random pairing with another prompt’s output) lowered the correlation to 0.35 and kept accuracy at 62.5%.

In the authors’ words, “even a purely length-based reward reproduces most downstream RLHF improvements over supervised fine-tuned models” (Singhal et al., abstract).

  • 7B policies and three datasets. It is unclear how much of this holds for larger models or modern preference data.
  • The evaluator may share the bias. The downstream metric is itself LLM-simulated preference, so a length-biased evaluator would inflate both PPO and lppo.
  • Length is one shortcut among many. Formatting, lists and hedging are not studied. A length-only fix can push the policy onto these.
  • Open: can we tell legitimate length (more content) from padding, for example by measuring reward per unit of information?
  • Related fix on the evaluation side: length-controlled AlpacaEval (Dubois et al., 2404.04475) fits a GLM of judge preference on length difference and predicts at zero difference. It reports Spearman correlation with Chatbot Arena rising from 0.94 to 0.98.

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

    Compute the paper's non-length reward gain (NRG) on a toy example with two 20-token buckets. SFT: 60 outputs in the short bucket with mean reward 0.0, and 40 in the long bucket with mean 0.5. PPO: 20 in the short bucket with mean 0.1, and 80 in the long bucket with mean 0.6. Give ΔR, NRG and the NRG/ΔR ratio, and say what share of the gain is explained by length.

    What a strong answer covers
    • SFT mean = 0.6·0.0 + 0.4·0.5 = 0.20. PPO mean = 0.2·0.1 + 0.8·0.6 = 0.50. So ΔR = 0.30.
    • The within-bucket gain is +0.1 in both buckets. NRG weights these by bucket counts (SFT and PPO combined), so NRG = 0.1 whatever the weights.
    • Ratio = 0.1 / 0.3 ≈ 33%. About two thirds of the gain comes from moving mass into the long bucket.
    • Compare Table 1: WebGPT standard PPO has ΔR = 0.82 and NRG = 0.02 (ratio 2.0%), so almost all of its gain is a length shift. Stack reaches 53.4%.
    • Limitation: if SFT and PPO lengths barely overlap, few buckets contain both, and NRG is estimated from little data. The paper adds a high-λ PPO run partly for this reason.
  2. Derive / compute

    The length-only reward is R*(y) = 1 − |len(y)/L − 1|, with target L = 156 tokens for WebGPT. Compute R* for the measured mean lengths of SFT (100), lppo (118) and standard PPO (230). Then explain how a policy trained on this reward, which never looks at content, can still win 56% against SFT in simulated preference.

    What a strong answer covers
    • SFT: 1 − |0.641 − 1| ≈ 0.64. lppo: 1 − |0.756 − 1| ≈ 0.76. PPO: 1 − |1.474 − 1| ≈ 0.53. Any output of exactly 156 tokens scores 1.
    • The reward has a peak, so it pushes toward the target length and penalises going past it. Standard PPO's 230-token outputs would score worse than SFT on it.
    • The KL penalty keeps the policy near SFT, so it gets longer by adding plausible content of the kind SFT would write, not padding. The authors credit the KL term: lppo with λ = 0 drops to 53%.
    • sft-long (141 tokens, longer than lppo) wins only 48%, so length alone is not the whole story. How the extra tokens are produced matters.
    • The simulated-preference annotators may themselves favour length, so part of the win could be judge bias rather than quality.
  3. Mechanism

    Why do reward models trained with Bradley–Terry on these datasets latch onto length? Use the paper's numbers for "always pick the longer answer" versus RM accuracy, and its dataset-cartography analysis (§5), to explain what signal the RM gradient actually sees.

    What a strong answer covers
    • Picking the longer answer is already 55.7% / 59.6% / 63.1% accurate on WebGPT / Stack / RLCD. RM accuracies are 61.5% / 70% / 80%, so length is a large share of the learnable signal on WebGPT.
    • Bradley–Terry gives large gradients to pairs it can separate. Length is easy to read from the representation, so it is learned early and reduces loss on many pairs.
    • Cartography: most pairs stay near zero confidence throughout training, i.e. they are hard or noisy. The few high-confidence pairs mostly follow the length heuristic.
    • So the RM fits a small set of easy, length-biased pairs. Within a batch of 8 samples its scores correlate strongly with length (Pearson 0.72 on WebGPT).
    • PPO then follows the easiest direction that raises this reward, which is to write more.
  4. What if…

    The paper tries PPO-side fixes (higher KL λ, dropping long outputs, reward scaling, a length penalty) and RM-side fixes (length-balanced data, confidence-based truncation, reward data augmentation by random pairing). Summarise what each family achieved and why balancing the data hurt WebGPT so much more than RLCD.

    What a strong answer covers
    • PPO-side (Table 3): length still went up compared with SFT in every setting, and reward stayed below standard PPO. The length penalty R + (1 − len/N)·σ often failed to converge.
    • Balanced data (bal) removes the length shortcut: WebGPT length–reward correlation falls from 0.72 to −0.13, but accuracy drops from 61.5% to 52.6%, close to chance.
    • On RLCD, bal keeps 73.1% accuracy but the correlation stays at 0.62. RLCD preferences carry more non-length signal, so balancing leaves useful pairs and does not remove the length dependence.
    • Reward data augmentation (r-da), which pairs a response with an output from a different prompt as a negative, lowers the correlation (0.72 → 0.35 on WebGPT) and keeps or improves accuracy, so it is the gentler fix.
    • Lesson: there is no single setting that controls length. Each fix trades accuracy, correlation and downstream quality differently on each dataset.
  5. Design

    You evaluate deep-research agents with an LLM judge and also use that judge as an RL reward. Design a length-controlled version for both uses: one for reporting (an evaluation metric) and one for training (a reward). For each, name a way it can fail.

    What a strong answer covers
    • Evaluation: the regression approach of length-controlled AlpacaEval. Fit a GLM that predicts judge preference from the length difference and other features, then predict preferences at zero length difference. Report win rate both raw and length-controlled.
    • Training: reward minus its within-prompt regression on length, or a length-stratified reward that compares only responses in the same length bucket (an online version of NRG).
    • Failure 1: length can be a real mediator of quality. A report that covers more nuggets needs more words, so regressing it out penalises real recall. Control for nugget coverage, or measure length per nugget.
    • Failure 2: the policy moves to a proxy you did not control for, such as lists, headers, citation count or confident tone. Controlling for tokens does not control for these.
    • Failure 3: within-batch statistics are noisy for small groups and can be gamed by varying length within a group. Check by plotting reward against length on fresh rollouts during training.
  6. Critique

    The headline claim is that a length-only reward "reproduces most downstream RLHF improvements". What would have to be true about the evaluator for this to say something about RLHF rather than about the evaluator? Propose an experiment that separates the two.

    What a strong answer covers
    • The downstream metric is simulated preference from AlpacaFarm API annotators (12 annotators, 500 examples). LLM annotators are known to prefer longer answers, so lppo may be exploiting the evaluator too.
    • If the evaluator were length-neutral, the lppo win would show that RLHF gains are mostly length. If it is length-biased, the result shows that the RLHF reward and the evaluator share the same bias.
    • Experiment: compare lppo and PPO with length-matched human pairwise judgments, or with a length-controlled judge. Also compare them on a task with verifiable correctness, where length cannot fake a win.
    • A second check: train with a reward whose target is shorter than SFT and see whether simulated preference falls. That would show the evaluator rewards length directly.

Done with this page?

Status