Skip to content

Defining and Characterizing Reward Hacking

optionalcorefundamentalpaperrubric 10/122022 · NeurIPS 2022 · ~60 min

Joar Skalse, Nikolaus H. R. Howe, Dmitrii Krasheninnikov, David Krueger

Status

TL;DR. The first formal definition of reward hacking. A proxy reward and a true reward are hackable if some pair of policies is ordered one way by the proxy and the opposite way by the true reward. Because return is linear in state–action visit counts, this is a very strong condition. Over all stochastic policies, two rewards are unhackable only if they are equivalent or one is trivial. Under the paper’s assumptions, finite policy sets (such as the deterministic policies of a finite MDP) always admit non-trivial unhackable pairs; any set containing an open subset of policies forces the strong equivalence restriction; and infinite sets without interior can go either way and need separate analysis (§5.3).

Why it matters now. Every RLHF and RLVR pipeline optimises a proxy: a reward model, a verifier or an LLM judge. This paper says you should not expect any such proxy to be safe to optimise without limits. Its practical message is to treat learned rewards as auxiliaries to policy learning rather than as specifications to maximise. That is the theoretical justification for KL penalties, early stopping and ensembles, and for measuring a gold metric alongside the proxy in your search-agent training.

Fix an MDP without reward. Write Fπ(s,a)\mathcal F^\pi(s,a) for the discounted visit count of (s,a)(s,a) under policy π\pi. Then the value of π\pi under reward R\mathcal R is linear:

JR(π)=∑s,aR(s,a) Fπ(s,a)=⟨R,Fπ⟩.J_{\mathcal R}(\pi) = \sum_{s,a} \mathcal R(s,a)\,\mathcal F^\pi(s,a) = \langle \mathcal R, \mathcal F^\pi \rangle .

Definition 1 (hackability). Rewards R1,R2\mathcal R_1, \mathcal R_2 are hackable relative to a policy set Π\Pi if there exist π,π′∈Π\pi, \pi' \in \Pi with

J1(π)<J1(π′)andJ2(π)>J2(π′).J_1(\pi) \lt J_1(\pi') \quad\text{and}\quad J_2(\pi) \gt J_2(\pi').

Otherwise they are unhackable. Ties are allowed: the proxy may rank two policies equally while the true reward separates them, or the reverse. The definition is symmetric and not transitive.

Definition 2 (simplification). R2\mathcal R_2 simplifies R1\mathcal R_1 if every strict preference of R1\mathcal R_1 becomes a weak preference of R2\mathcal R_2, every tie stays a tie, and at least one strict preference becomes a tie. A simplification can only collapse distinctions.

Toy example: a hackable proxy with two policies. In the paper’s cleaning robot, a policy is the set of rooms it cleans. Take rtrue=[1,1,1]r_\text{true} = [1,1,1] (attic, bedroom, kitchen) and the proxy rproxy=[1,0,0]r_\text{proxy} = [1,0,0], which asks only for the attic. Compare π\pi = clean attic and π′\pi' = clean bedroom and kitchen:

JproxyJ_\text{proxy}JtrueJ_\text{true}
π\pi (attic)11
π′\pi' (bedroom + kitchen)02

The proxy prefers π\pi and the true reward prefers π′\pi', so the pair is hackable. Dropping only the kitchen, rproxy=[1,1,0]r_\text{proxy} = [1,1,0], is unhackable against [1,1,1][1,1,1].

IR version. Let the features be “retrieves a judged relevant document”, “retrieves an unjudged relevant document” and “retrieves a non-relevant document”. True reward [1,1,0][1,1,0]; a judged-only nDCG-style proxy is [1,0,0][1,0,0], because unjudged documents count as non-relevant. Ranker A returns 2 judged-relevant documents and 1 non-relevant (proxy 2, true 2). Ranker B returns 1 judged-relevant and 2 unjudged-relevant (proxy 1, true 3). The pair is hackable, and the proxy will push a new system towards the old pool.

Hackability in the cleaning-robot example: proxy value against true value for every deterministic policy Each deterministic policy cleans a subset of three rooms: attic A, bedroom B and kitchen K. The true reward is 1 per room, so true value is the number of rooms cleaned. Left panel, proxy [1, 0, 0] that only counts the attic: policy A has proxy value 1 and true value 1, while policy BK has proxy value 0 and true value 2, so the proxy and the true reward order this pair in opposite directions and the pair is hackable. Right panel, proxy [1, 1, 0] that drops only the kitchen: no policy lies strictly to the right of and strictly below another, so the proxy never reverses a strict true preference; it only creates ties. This pair is unhackable over the deterministic policies. Hackable = some policy is strictly right of and strictly below another Proxy [1, 0, 0]: hackable true reward [1, 1, 1] 0 1 2 0 1 2 3 J_proxy → J_true → ∅ B, K BK A AB, AK ABK Proxy [1, 1, 0]: unhackable true reward [1, 1, 1] 0 1 2 0 1 2 3 J_proxy → J_true → ∅ K A, B AK, BK AB ABK Dashed: π = A beats π′ = BK on the proxy (1 > 0) but loses on the true reward (1 < 2).
Original sketch. Every deterministic policy in the cleaning-robot example plotted by proxy value and true value. Proxy [1, 0, 0] has a pair whose order the proxy reverses, so it is hackable; proxy [1, 1, 0] only creates ties, so on this finite policy set it is unhackable.

The results are theorems, not experiments.

“two reward functions can only be unhackable if one of them is constant.” (Skalse et al., abstract, for the set of all stochastic policies)

Read this quotation with Theorem 1’s exception: equivalent rewards (which order every pair of policies the same way) are also unhackable. The theorem statement, not the abstract sentence, is the precise result.

  • Infinite policy sets with volume (§5.1). A step-function proxy of a Gaussian true reward on a line looks like a harmless coarsening. Yet a policy that randomises between two neighbours beats staying put under the true reward and loses under the proxy (Figure 3).
  • Finite sets (§5.2). In a two-state, two-action MDP with γ=0.5\gamma = 0.5, 12 of the 24 possible orderings of the four deterministic policies can be realised by some reward. In each, exactly two policies can be made equal without making the reward trivial, and making three equal always does.
  • Infinite sets without open subsets (§5.3) can go either way. The paper gives one example that admits a simplification and one that does not.
  • The authors release code that lists every ordering a reward can realise for a given environment and policy set (Appendix D.3).
  • Too strict, by the authors’ own account. Symmetry counts misorderings that an optimiser would never reach. They suggest approximate (only count reversals larger than ε\varepsilon) and probabilistic (weight by the chance of meeting the pair during optimisation) versions as future work.
  • Finite MDPs and Markov rewards only. LLM generation has a vast state space, and LLM-judge rewards are not Markov in any simple sense.
  • No account of the optimiser. The definition ignores which policies SGD actually visits. Gao et al.’s over-optimisation curves are the empirical counterpart.
  • Theorem 3 is opaque. There is no simple rule for designers about which simplifications are safe.

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

    Cleaning robot with three rooms and deterministic policies (any subset of rooms). Proxy reward r_proxy = [1, 1, 1]; true reward r_true = [1, 1.5, k] with k ≥ 0. For which values of k is the pair unhackable? Show the binding pairs of room sets, and check the paper's two cases k = 2 and k = 3.

    What a strong answer covers
    • The proxy only counts rooms. A hack needs sets S₁, S₂ where S₁ has more rooms but strictly lower true value.
    • Binding pair at large k: the single room {kitchen} (value k) against the cheapest pair {attic, bedroom} (value 2.5). Hackable iff k > 2.5.
    • Binding pair at small k: the most valuable single room {bedroom} (1.5) against the cheapest pair {attic, kitchen} (1 + k). Hackable iff 1 + k < 1.5, i.e. k < 0.5. Pairs against the full set and single rooms against the empty set never reverse.
    • So the pair is unhackable iff 0.5 ≤ k ≤ 2.5 (ties are allowed by Definition 1). k = 2 is unhackable and k = 3 is hackable, matching §2.
  2. Derive / compute

    The paper's two-state MDP: S = A = {0, 1}, T(s, a) = a, uniform start state, γ = 0.5, and reward R(0,0)=0, R(0,1)=3, R(1,0)=2, R(1,1)=1. Write π_ij for "action i in state 0, action j in state 1". Compute J for all four deterministic policies and check that this reward realises the simplification π00 = π01 < π11 < π10.

    What a strong answer covers
    • π00: V(0) = 0 (stay at 0 forever), V(1) = 2 + 0.5·0 = 2, so J = 1. π01: V(0) = 0, V(1) = 1/(1 − 0.5) = 2, so J = 1.
    • π11: V(1) = 2, V(0) = 3 + 0.5·2 = 4, so J = 3.
    • π10: V(0) = 3 + 0.5·V(1) and V(1) = 2 + 0.5·V(0). Solving gives V(0) = 16/3, V(1) = 14/3, so J = 5.
    • Ordering 1 = 1 < 3 < 5, as stated in §5.2. Of the 24 orderings of four policies, only 12 are realisable by some reward in this MDP.
  3. Mechanism

    Theorem 1 says that on any policy set containing an open set, two non-trivial unhackable rewards must be equivalent. Explain the mechanism using the fact that J_R(π) = ⟨R, F(π)⟩ is linear in the visit-count vector F(π). Why does this argument fail for a finite set of deterministic policies?

    What a strong answer covers
    • Each reward is a linear functional on occupancy space. Its level sets are parallel hyperplanes.
    • If R₁ and R₂ are not equivalent on an open set of occupancies, their gradients point in different directions. Then there is a small move d inside the open set with ⟨R₁, d⟩ > 0 and ⟨R₂, d⟩ < 0, which is exactly a hackable pair.
    • An open set lets you move in every direction locally, so any angle between the two reward vectors can be exploited.
    • With finitely many policies there are only finitely many difference vectors. A reward can be rotated until it ties some pairs without reversing any, so non-trivial, non-equivalent unhackable pairs exist (Theorem 2).
  4. Critique

    The authors concede that their definition may be too strict because it is symmetric. Explain why symmetry is a problem for judging real proxies such as a reward model, and propose a weaker, measurable notion of hackability plus the experiment you would run to estimate it for a reward model used in RLHF.

    What a strong answer covers
    • Definition 1 counts any misordered pair, including complex high-true, low-proxy behaviours that an optimiser would never find (the paper's example: solving climate change while learning to wash dishes).
    • What matters is misordering along the optimisation path. The paper suggests weighting pairs by the probability of meeting them while optimising the proxy, or only counting reversals where the true values differ by more than ε.
    • Measurable version: along an RL run, sample checkpoint pairs (π_t, π_t+k), score both with the proxy RM and a gold judge, and estimate the probability that the proxy prefers the later checkpoint while gold prefers the earlier one by more than ε.
    • Compare this rate across RM sizes or KL budgets. It is the empirical counterpart of the gold-score peak in over-optimisation curves.
  5. Design

    You must choose between 6 checkpoints of an RL-trained search agent using a cheap proxy (nugget recall from an LLM judge), with a budget for gold human evaluation of 2 checkpoints. Using the paper's finite-policy-set view, describe how you would test whether the proxy is unhackable relative to this set, and what you would do if it is not.

    What a strong answer covers
    • Relative to a finite set, unhackable means no pair is strictly reversed. With 6 checkpoints there are 15 pairs.
    • You cannot gold-score all of them. Spend the gold budget on the pair most likely to be reversed: the proxy's top checkpoint and the checkpoint just before the proxy curve's late rise.
    • Supplement with cheaper gold proxies (a second judge, citation-support checks) and compute Kendall discordance against the main proxy.
    • If hackable, restrict the policy set (for example, stop early, or only allow checkpoints within a KL budget). The paper's result is that unhackability depends on the policy set, so shrinking it is a legitimate fix.
  6. Connect

    Skalse et al. relate simplification to quantilization (return a random policy from the top n% by proxy). Compare the two, and say how a KL penalty to a reference policy in RLHF fits into the picture of "restricting the policy set".

    What a strong answer covers
    • Quantilization equates the values of the top n% of policies. A simplification can collapse distinctions anywhere in the ordering, so it can get a similar effect without assuming you choose only among the best.
    • Both reduce how much the final choice depends on fine distinctions where proxy and true reward may disagree.
    • A KL penalty does not restrict to a finite set; KL balls around a stochastic reference policy contain open sets, so Theorem 1 says non-trivial unhackability is still impossible there.
    • So the KL penalty limits how far hacking goes but cannot rule it out in this strict sense. That fits the empirical picture of a gold-score peak rather than a guarantee.

Done with this page?

Status