Source-linked AI summary

Defining and Characterizing Reward Hacking

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

arXiv:2209.13085v2cs.LGstat.ML

TL;DR

The paper addresses when optimizing an imperfect proxy reward can reduce performance according to the true reward. It formalizes hackability and simplification over policy sets, finding that unhackability is extremely restrictive for all policies but can exist on finite sets. The authors conclude that safe reward optimization requires restricting policies or optimization, while their conservative definitions leave probabilistic and approximate safety for future work.

  • Problem

    Optimizing learned proxy rewards can overlook side effects or encourage power-seeking, creating a need to determine when proxy optimization worsens behavior according to the true reward.

  • Method

    The paper formalizes hackability and simplification by comparing the reward orderings induced by true and proxy rewards over specified policy sets.

  • Results

    All stochastic policies admit no non-trivial unhackable reward pairs, while every finite policy set guarantees at least one non-trivial unhackable pair.

  • Takeaways & Limitations

    Reward hacking must be addressed by limiting possible policies or controlling optimization, or by pursuing approaches not based on optimizing reward functions.

  • Takeaways & Limitations

    The analysis is limited to finite MDPs and Markov reward functions, and its characterization of infinite policy sets remains incomplete.

Abstract

from arXiv · show

We provide the first formal definition of reward hacking, a phenomenon where optimizing an imperfect proxy reward function leads to poor performance according to the true reward function. We say that a proxy is unhackable if increasing the expected proxy return can never decrease the expected true return. Intuitively, it might be possible to create an unhackable proxy by leaving some terms out of the reward function (making it "narrower") or overlooking fine-grained distinctions between roughly equivalent outcomes, but we show this is usually not the case. A key insight is that the linearity of reward (in state-action visit counts) makes unhackability a very strong condition. In particular, for the set of all stochastic policies, two reward functions can only be unhackable if one of them is constant. We thus turn our attention to deterministic policies and finite sets of stochastic policies, where non-trivial unhackable pairs always exist, and establish necessary and sufficient conditions for the existence of simplifications, an important special case of unhackability. Our results reveal a tension between using reward functions to specify narrow tasks and aligning AI systems with human values.

1 Introduction

The paper formalizes when optimizing a proxy reward can worsen behavior according to the true reward, motivated by costly unintended outcomes in safety-critical AI. It shows that unhackability is highly restrictive, while simplification can easily fail.

  • Motivation: Reward hacking occurs when optimizing an imperfect proxy produces behavior that performs poorly according to the true reward.Examples include exploiting game powerups, radio signals, and university ratings instead of pursuing the intended objective.
  • Research question: The paper asks whether improving a policy according to a proxy can make it worse according to the true reward, without assuming a particular optimization path.The analysis models optimization as a search process that tends toward higher proxy reward, such as stochastic gradient descent.
  • Definition: A reward pair is hackable when some policy pair is ordered oppositely by the proxy and true rewards.This definition captures whether any proxy-improving move can reduce true reward.
  • Main result: All stochastic policies admit no non-trivial unhackable reward pairs, whereas every finite policy set guarantees at least one non-trivial unhackable pair.This contrast motivates analyzing restricted policy sets.
  • Simplification: The paper introduces simplification as an asymmetric special case of unhackability and finds that natural simplifications can still permit reward hacking.The issue arises when a proxy omits rewarding features or overlooks fine-grained distinctions.
  • Implications and limitations: The authors argue that safe optimization requires demanding proxy standards, while noting that their conservative definitions weaken this conclusion.They suggest future work should study probabilistic or approximate safety and limited optimization.

2 Example: Cleaning Robot

The cleaning-robot examples show that omitting rewarding features or fine details can sometimes preserve reward ordering, but small changes can make the proxy hackable. The examples motivate precise conditions for safe simplification.

  • Setup: The robot represents a deterministic policy by a binary vector indicating which of three rooms it cleans, with total reward given by J(π) = π · r.For rewards [1, 2, 3], cleaning the attic and kitchen yields 4.
  • Overlooking rewarding features: Overlooking one rewarding feature is safe when the proxy rewards the attic and bedroom but not the kitchen, given equal true rewards.With rtrue = [1, 1, 1] and rproxy = [1, 1, 0], the pair is unhackable.
  • Overlooking rewarding features: Overlooking two rewarding features becomes hackable when only the attic is rewarded by the proxy, despite equal true room rewards.The proxy prefers cleaning the attic over cleaning the bedroom and kitchen, while the true reward does not.
  • Overlooking fine details: Equating fine-grained room values can remain unhackable for rtrue = [1, 1.5, 2] and rproxy = [1, 1, 1].The proxy rewards cleaning all rooms equally while the true reward distinguishes them moderately.
  • Overlooking fine details: A slightly larger kitchen value, rtrue = [1, 1.5, 3], makes the same equal-valued proxy hackable.The proxy incorrectly prefers cleaning the attic and bedroom over cleaning the kitchen alone.
  • General lesson: In this environment, simplification is safe only when omitted details together are not more important than any shared detail.The paper states an exact characterization in terms of pairs of room sets, though the supplied passage truncates that condition.

3 Related Work

The paper places formal reward hacking alongside Goodhart’s Law, empirical proxy failures, reward tampering, and quantilization. It emphasizes that hacking need not require proxy-optimal behavior and remains relevant across arbitrary MDPs.

  • Goodhart’s Law: Goodhart’s Law describes the tendency for optimizing proxy metrics to produce perverse instantiations, while this paper formally studies reward hacking.Manheim and Garrabrant identify four mechanisms underlying the broader observation.
  • Sudden hacking: Reward hacking can occur suddenly: the proxy reward continues rising while true reward eventually drops.Figure 2 is described as illustrating this divergence during optimization.
  • Optimization dynamics: Reward hacking does not require reaching a proxy-optimal policy, because RL optimization may converge to suboptimal policies and still produce qualitative behavioral changes.This unpredictability motivates a definition that does not assume agents find an optimal policy.
  • Empirical studies: Empirical work found reward hacking in 5 out of 9 manually constructed proxy settings across diverse environments.The cited study evaluates whether optimizing each proxy leads to reward hacking.
  • Theoretical scope: Prior theoretical work showed that feature-subset proxies can yield arbitrarily low true reward under suitable assumptions, whereas this paper extends hackability to arbitrary MDPs.The earlier result required decreasing marginal utility and increasing opportunity cost.
  • Related concepts: Reward tampering is presented as a special case of reward hacking in which the agent corrupts the process generating reward signals.Examples include tampering with sensors, memory registers, or reward hardware.
  • Quantilization: Simplification resembles quantilization but can equate values outside the top n% and does not require choosing among the best policies.Quantilization samples randomly from the top n% of policies.

4 Preliminaries

The paper formalizes reinforcement-learning environments, policy values, and policy embeddings before defining hackability and simplification relative to a policy set. These definitions make the choice of environment and policy set central to the analysis.

  • 4.1 Reinforcement Learning: RL problems are modeled as Markov decision processes with states, actions, transitions, initial-state distributions, rewards, and discounting.The paper assumes finite state and action sets, more than one action, reachable states, and finite-mean rewards.
  • 4.1 Reinforcement Learning: A policy’s value is its expected discounted return, and reward-based policy orderings are induced by comparing these values.The paper writes policy values as inner products between reward functions and discounted state-action visit counts.
  • 4.1 Reinforcement Learning: Policies are embedded using discounted state-action visit counts and, separately, action-probability vectors.These embeddings support geometric analysis of policy sets and reward functions.
  • 4.2 Definitions and Basic Properties of Hackability and Simplification: Hackability occurs when two policies are ordered oppositely by two reward functions; otherwise, the pair is unhackable relative to the environment and policy set.Unhackability permits ties in one reward ordering in some cases and is symmetric but not transitive; constant rewards are unhackable with every reward function.
  • 4.2 Definitions and Basic Properties of Hackability and Simplification: Simplification is an asymmetric special case of unhackability that collapses distinctions between policies, while refinement reverses this relationship.A simplification requires some policies with equal simplified value but unequal original value, and the relationship depends critically on the policy set.

5 Results

The results show that non-trivial unhackability is impossible on policy sets containing open subsets, but exists for finite policy sets and some infinite sets under appropriate restrictions. The paper also gives conditions for simplification and illustrates how apparently natural reward simplifications can remain hackable.

  • 5.1 Non-trivial Unhackability Requires Restricting the Policy Set: The Gaussian true reward and step-function proxy are hackable despite their apparent simplification relationship.At state B, a policy moving randomly to A or C has higher Gaussian reward but lower step-function reward than staying at B.
  • 5.1 Non-trivial Unhackability Requires Restricting the Policy Set: Non-trivial unhackability is impossible on any stationary policy set containing an open subset.Theorem 1 states that unhackable, non-trivial reward pairs must be equivalent on such sets.
  • 5.1 Non-trivial Unhackability Requires Restricting the Policy Set: For all stationary policies, non-trivial unhackable reward functions must be equivalent.This follows because the policies that assign positive probability to every action form an open subset of the full policy set.
  • 5.2 Finite Policy Sets: Restricting to finite policy sets guarantees non-trivial, non-equivalent unhackable reward pairs whenever at least two policies have distinct occupancies.Theorem 2 applies to any finite policy set containing π and π′ with F(π) ≠ F(π′).
  • 5.2 Finite Policy Sets: A non-trivial simplification exists exactly when dim(Z1 ∪ · · · ∪ Zm) ≤ dim(F(Π̂)) − 2.The vectors Zi are formed by subtracting one selected policy occupancy from each occupancy within the corresponding equal-value set.
  • 5.2 Finite Policy Sets: Any finite policy set with at least two policies receiving distinct values under a reward function admits a non-trivial simplification.This includes all deterministic policies in finite MDPs.

6 Discussion

The discussion examines implications and limitations of formal reward-hacking results, emphasizing strict definitions, incomplete characterization, and caution about treating learned rewards as specifications.

  • Limitations: The analysis covers finite MDPs and Markov reward functions, while leaving more general environments and parts of infinite-policy-set characterization for future work.The conditions for simplification are also described as somewhat opaque.
  • Limitations: The paper cautions against strong conclusions because its definitions are conservative and its analysis has acknowledged limitations.The authors describe their strict definition as an important starting point while noting that future work should investigate when hackable proxies may still be safe.
  • Limitations: Because hackability is symmetric, the definition treats low-proxy/high-true behaviors as concerning even though such behaviors are unlikely to be discovered during proxy optimization.The paper contrasts this with the less concerning reverse direction, such as solving climate change while learning to wash dishes.
  • Limitations: Approximate and probabilistic unhackability could relax the strict definition, but probabilistic versions may require assumptions about encountering policies during optimization.Approximate unhackability would ignore misordered policy pairs whose true-reward difference is at most ε.
  • Implications: Hackability does not imply that reward hacking will occur, so empirical work is needed to understand its practical frequency and severity.The paper presents unhackability as a guarantee against hacking, but hackability as insufficient for predicting actual occurrence.
  • Implications: Using a narrow-task reward as a proxy for broad human values is presented as invariably hackable, creating tension between task specification and value alignment.The authors suggest that alternatives to reward optimization may be more promising, while cautioning that this implication is constrained by the paper’s limitations.
  • Implications: The paper argues that learned rewards are almost certainly hackable and should be treated as aids for safe policy learning, followed by validation before deployment.This recommendation is framed for reward-modeling and inverse-RL approaches rather than as a universal conclusion about all AI systems.

7 Conclusion

The conclusion formalizes reward hacking and simplification, shows that non-trivial unhackability requires restricting policies, and emphasizes the strictness of safe proxy optimization.

  • Conclusion: The paper formally defines hackability and simplification and derives conditions for when non-trivial examples of each can or cannot exist.These results constitute the paper’s formal study of reward hacking in reinforcement learning.
  • Conclusion: The set of all policies contains no non-trivial unhackable reward-function pairs, so avoiding reward hacking requires limiting possible policies or controlling optimization.The passage identifies policy-set restriction and optimization control as the practical routes implied by the result.

Checklist

The checklist records the paper’s theoretical assumptions, proof and reproducibility materials, implementation status, and discussion of limitations and societal impacts.

  • Ethics and limitations: The authors report describing their work’s limitations and discussing potential negative societal impacts in Section 6.2.The checklist also indicates that the paper addressed the relevant ethics-review guidelines.
  • Theoretical reporting: The paper states that it gives the full assumptions for theoretical results and includes complete proofs, with some proofs placed in the appendix.The checklist also identifies sections containing proofs and expanded examples.
  • Experiments and implementation: No model training or experimental datasets were used, and no experimental error bars or training details were applicable.The code and execution instructions are reported as available in the supplementary materials.
  • Assets and reproducibility: The codebase was written from scratch and is available in the supplemental material, with new assets also reported as included or linked.The checklist marks existing-asset licensing and participant-data questions as not applicable.
  • Formal setup: The analysis represents policies through discounted state-action visit counts and expresses return as their inner product with the reward vector.The paper also defines equivalence by identical policy orderings and triviality by equal returns for every policy in the set.
  • Definitions: The paper defines hackability through a pair of policies whose proxy and true-reward orderings conflict, with unhackability as the absence of such a pair.It also defines simplification as preserving proxy-implied ordering while equating some policies that the original reward distinguishes.

B.1 Non-trivial Unhackability Requires Restricting the Policy Set

The proof shows that open policy sets make feature-count embeddings locally open, forcing non-trivial unhackable rewards to induce equivalent policy orderings.

  • Setup: An open policy set is defined relative to the smallest affine space containing stationary policies, whose dimension is |S|(|A| −1).The dimension follows because action probabilities sum to one in every state.
  • Geometric conditions: The feature-count image lies in an affine subspace of dimension |S|(|A| −1), while F may fail to be injective outside policies that visit every state positively.Open policy sets avoid this failure because every action has positive probability and every state is visited with positive probability.
  • Embedding lemma: The feature-count map F is a homeomorphism from an open policy set to an open subset of its |S|(|A| −1)-dimensional feature space.This follows from injectivity, continuity, and the Invariance of Domain Theorem.
  • Theorem 1: If an open policy set contains two policies with equal R1 value, unhackability forces equal R2 value as well, making the reward functions equivalent on the set.The proof constructs nearby feature counts and compares the tangent hyperplanes induced by the two reward vectors.
  • Theorem 1: A mismatch between the two tangent hyperplanes would produce a policy with higher R1 return but lower R2 return, directly violating unhackability.This is the contradiction that establishes equality of the hyperplanes.
  • Theorem 1: By linearity of return in feature counts, equality under R1 transfers to equality under R2 for the original policy pair.The argument scales displacement vectors from a reference policy and then transfers the equality through the common hyperplane.
  • Corollaries: The result applies to all stationary policies and to all ε-suboptimal or δ-deterministic policies because each set contains an open policy subset.For δ-deterministic policies, a sufficiently mixed policy around a deterministic one supplies such an open subset.

B.2 Finite Policy Sets

For finite policy sets, non-trivial unhackable reward pairs always exist, and non-trivial simplifications are characterized by a dimensionality condition. The paper proves these results using continuous paths in reward-function space and equality-preserving subspaces.

  • Theorem 2 guarantees a non-trivial reward function R2 unhackable with any reward function R1 on finite policy sets containing policies with different feature vectors.
  • A continuous path from R1 to −R1 must encounter a first reward function where a policy inequality becomes equality, yielding a non-equivalent unhackable pair.
  • The path can avoid trivial reward functions because those functions form a subspace of dimension at most |S||A| −2.
  • Theorem 3 determines whether a non-trivial simplification exists by partitioning policies into equal-value sets and constructing the associated difference-vector spaces Zi.
  • A non-trivial simplification exists if and only if dim(Z1 ∪· · · ∪Zm) ≤dim(F(ˆΠ)) −2.
  • If the dimensionality condition fails, the only equality-preserving transformations are trivial, including uniform scalings of R1.
  • When all policy values are distinct, Corollary 3 guarantees a non-trivial simplification for any finite policy set with at least two policies.

C Any Policy Can Be Made Optimal

The paper shows that any policy can be made optimal by constructing a reward function that penalizes actions outside that policy’s support. For deterministic policies, this construction makes the chosen policy uniquely optimal.

  • For any policy in any rewardless MDP, there exists a reward function under which that policy is optimal.
  • The construction assigns reward 0 to actions in the policy’s support and −1 to all other actions.
  • Any policy assigning zero probability to every action excluded by the target policy is also optimal under this construction; deterministic target policies are uniquely optimal.

D.1 Two-state MDP \ R example

In the two-state MDP example, only half of the strict policy orderings are representable by reward functions. The example also shows that simplifying orderings can force additional equalities.

  • The MDP has four deterministic policies, denoted πij according to their actions in states 0 and 1.
  • Among 12 symmetry-reduced strict orderings, six are representable by reward functions.
  • Computationally identified simplifications include pairwise equalities and the fully equal ordering π00 = π01 = π10 = π11.
  • Equating the values of any three policies necessarily forces the fourth policy to have the same value.

D.2.1 Hackability

For the cleaning robot, hackability occurs exactly when two room sets are ordered oppositely by proxy and true rewards. Simplification and unhackability can be represented through ordering graphs, with simplifications forming a subgraph of unhackable pairs.

  • Hackability: For room subsets S, policy value is the sum of the rewards assigned to the cleaned rooms.
  • Hackability: The proxy is hackable exactly when two room sets have higher proxy value but lower true value in the opposite ordering.
  • Hackability: No simple rule safely captures omitting information or overlooking detail; safety requires ruling out every pair of room sets satisfying the hackability condition.
  • Simplification: With nonnegative room rewards, policy orderings have a structure in which the tail of each arrow is at most as good as its head.
  • Simplification: Equating policies that differ in one room forces all policy pairs differing only in that room to be equal as well.
  • Ordering diagrams: An unhackability diagram uses undirected edges between unhackable policy orderings, while a simplification diagram uses directed edges toward their simplifications.
  • Ordering diagrams: The simplification graph is always a subgraph of the unhackability graph because simplification cannot produce reward hacking.
Loading 2209.13085v2…