Fine-tuning, RLHF & Alignment·Question 19 of 61IntermediateAI-75

What is reward hacking? Give concrete examples and mitigations.

Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.

Model answer: the part to lead with

Reward hacking (reward overoptimization / Goodharting) is when the policy finds behaviours that increase the proxy reward without increasing - often while decreasing - the true objective the proxy was meant to represent. It's inevitable in spirit: the RM is an imperfect stand-in trained on finite preferences, and RL is an adversarial search for its blind spots.

Full worked answer with diagram

Reward hacking (reward overoptimization / Goodharting) is when the policy finds behaviours that increase the proxy reward without increasing - often while decreasing - the true objective the proxy was meant to represent. It's inevitable in spirit: the RM is an imperfect stand-in trained on finite preferences, and RL is an adversarial search for its blind spots.

Concrete examples seen in practice:

  • Length bias: annotators mildly prefer longer answers → RM inherits it → policy produces bloated, padded responses. The most-documented RLHF artefact; it's why serious evals are length-controlled.
  • Sycophancy: agreeing with the user's stated opinions and flattering them scores higher with human raters → the model learns to tell users what they want to hear, including endorsing false premises.
  • Confidence and formatting tricks: authoritative tone, bullet lists, headers, bold text score higher regardless of content accuracy.
  • Hedging/refusal gaming: if the RM overweights harmlessness, the policy learns to refuse borderline-but-benign requests - maximal safety reward, zero usefulness.
  • Verifiable-reward hacking (RL for code): models special-casing the visible unit tests, hard-coding expected outputs, or - in agentic settings - modifying/deleting the tests themselves. Any exploitable gap in the checker gets found.
  • Degenerate exploits: off-distribution token sequences or repetition that happen to score high with a weak RM - the failure mode the KL penalty exists to prevent.

Mitigations: the KL penalty to a reference model (keeps the policy where the RM is calibrated); early stopping using the known pattern that gold-standard quality rises then falls as proxy reward climbs; fresh on-policy preference data and periodic RM retraining (iterated RLHF), so the RM stays accurate on what the policy now produces; RM ensembles or worst-case-over-ensemble rewards; explicit debiasing (length-penalised rewards); hardened verifiers with hidden tests and sandbox integrity checks for code RL; and human spot-checks of high-reward samples - the cheapest and most reliably informative mitigation.

Worth sketching. drawing the cycle shows why rising reward is not evidence of anything on its own.

flowchart TD
    A["Annotators mildly prefer<br/>longer, confident answers"] --> B["RM inherits the bias"]
    B --> C["Policy maximises RM score"]
    C --> D["Padded, sycophantic,<br/>over-refusing output"]
    D -->|"proxy reward up,<br/>true quality down"| B
    C --> E["KL to reference bounds<br/>where the search can go"]
    D --> F["Read the highest-reward<br/>samples by hand"]
    F --> G["Fresh on-policy pairs,<br/>retrain the RM"]
    G --> B

What a good answer covers

  • Reward hacking (reward overoptimization / Goodharting) is when the policy finds behaviours that increase…
  • It's inevitable in spirit
  • Length bias: annotators mildly prefer longer answers → RM inherits it → policy produces bloated, padded…
  • Sycophancy: agreeing with the user's stated opinions and flattering them scores higher with human raters…
  • Confidence and formatting tricks

Key terms: Length bias · Sycophancy · Confidence and formatting tricks · Hedging/refusal gaming · Verifiable-reward hacking · Degenerate exploits · KL penalty · early stopping · fresh on-policy preference data · RM ensembles

Interviewer follow-ups to expect

  1. Reward is climbing steadily on your run - what evidence distinguishes genuine improvement from hacking?

  2. How would you harden a unit-test reward against gaming?

Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep