Source-linked AI summary

Inverse Reward Design

Dylan Hadfield-Menell, Smitha Milli, Pieter Abbeel, Stuart Russell, Anca Dragan

arXiv:1711.02827v2cs.AIcs.LG

TL;DR

Reward functions are difficult-to-design proxies that can produce harmful behavior when agents encounter situations absent from training. The paper introduces Bayesian inverse reward design, which infers intended rewards from proxy rewards and their training context, then uses approximate inference with risk-averse planning. Experiments report robustness to misspecification, negative side effects, and reward hacking, while the authors note limitations from planning complexity and linear reward assumptions.

  • Problem

    Reward specifications can omit important aspects of intended behavior, causing capable agents to behave poorly in novel situations such as unfamiliar terrain.

  • Method

    IRD infers a distribution over the true reward from a proxy reward, its intended decision problem, and possible reward functions, then applies risk-averse planning.

  • Results

    The approach substantially outperforms literal reward interpretation and produces behavior robust to misspecified rewards, negative side effects, and reward hacking.

  • Takeaways & Limitations

    Interpreting designed rewards as contextual observations can help agents avoid unforeseen scenarios and detect distributional shift in high-dimensional reward evaluations.

  • Takeaways & Limitations

    The approach relies on explicitly solving planning problems during inference and on a prior containing a reasonable approximation to the true linear reward.

Abstract

from arXiv · show

Autonomous agents optimize the reward function we give them. What they don't know is how hard it is for us to design a reward function that actually captures what we want. When designing the reward, we might think of some specific training scenarios, and make sure that the reward will lead to the right behavior in those scenarios. Inevitably, agents encounter new scenarios (e.g., new types of terrain) where optimizing that same reward may lead to undesired behavior. Our insight is that reward functions are merely observations about what the designer actually wants, and that they should be interpreted in the context in which they were designed. We introduce inverse reward design (IRD) as the problem of inferring the true objective based on the designed reward and the training MDP. We introduce approximate methods for solving IRD problems, and use their solution to plan risk-averse behavior in test MDPs. Empirical results suggest that this approach can help alleviate negative side effects of misspecified reward functions and mitigate reward hacking.

1 Introduction

Reward misspecification can cause capable agents to pursue harmful behavior in unfamiliar situations because designed rewards omit aspects of the intended objective. Inverse reward design treats the designed reward as contextual evidence about the intended reward and combines this inference with risk-averse planning.

  • Motivation: Out-of-distribution terrain can make an implicitly specified reward assign arbitrary values, causing a robot to drive into lava.The failure arises when the deployed environment differs from the grass-and-dirt scenarios considered during reward design.
  • Motivation: Negative side effects and reward hacking arise when reward specifications omit important aspects of desired behavior.Examples include traversing lava, ejecting collected dust, and looping to collect game points instead of winning.
  • Approach: IRD interprets the designed reward in its design context, giving agents uncertainty shaped by the environment in which the reward was specified.This uncertainty can support risk-averse planning or requests for help in situations where the correct action is unclear.
  • Approach: Inverse reward design infers a distribution over the true reward from a proxy reward, an intended decision problem, and possible reward functions.The paper models the proxy as an approximate solution to a reward design problem.
  • Results: The proposed inference approach combined with risk-averse planning is reported to be robust to misspecified rewards and to substantially outperform literal reward interpretation.The system also detects and avoids distributional shift in high-dimensional reward evaluations.

2 Inverse Reward Design

Inverse reward design formalizes recovery of an unobserved true reward from a proxy reward created for a related decision problem. Its Bayesian formulation uses a prior and an agent model to infer reward uncertainty that can guide behavior under misspecification.

  • Formal setup: An MDP specifies states, actions, transitions, rewards, and a finite planning horizon, while a world model omits the reward function.A policy maps the current timestep and state to a distribution over actions.
  • Formal setup: Rewards for trajectories are modeled as linear combinations of feature vectors, r(ξ; w) = w⊤φ(ξ).The weight vector w determines the reward assigned to trajectory features.
  • Reward design: A reward design problem selects a proxy reward for an agent operating in a world model so that behavior receives high true reward.The MDP formalism defines optimal behavior once the reward is given, but not how the reward was produced.
  • Inverse reward design: IRD treats the proxy reward as an approximate solution to a reward design problem and seeks the unobserved true reward.The Bayesian approach places a prior over the true reward and infers its posterior from the observed proxy and design context.

3 Related Work

IRD extends reward inference by treating a written reward function as an observation about a designer’s intended utility. It is related to inverse reinforcement learning and pragmatic language interpretation but differs in what is observed.

  • Optimal reward design: Optimal reward-design research studies how bounded agents select proxy rewards for distributions of environments and fitness functions.This paper instead models the system designer as the bounded agent whose mistakes make the proxy differ from true utility.
  • Inverse reinforcement learning: Inverse reinforcement learning infers rewards from approximately optimal behavior, whereas IRD infers rewards from a directly observed reward function.The approaches are presented as complementary strategies for value alignment.
  • Pragmatics: Pragmatic language interpretation uses context and alternatives to infer intended meaning beyond literal wording.The paper connects this contextual inference pattern to IRD’s interpretation of designed rewards.

4 Approximating the Inference over True Rewards

The paper approximates inference over true rewards by replacing an intractable normalizing constant with tractable alternatives, including sampling candidate weights and trajectories. These approximations preserve calibration properties and support interpreting proxy rewards through training behavior.

  • Inference difficulty: The IRD posterior requires a normalizing constant that is difficult to compute because evaluating it involves solving a planning problem.This difficulty is described as a doubly-intractable likelihood.
  • Empirical motivation: In Lavaland, interpreting the proxy in its training context helps the IRD agent avoid lava and sensor-disagreement cells that literal optimization selects.The test environments introduce unmodeled lava or break correlations between sensor indicators; the IRD agent hedges against unreliable distinctions.
  • Approximate inference: One approximation samples a finite set of candidate weights to estimate the normalizing constant.The candidate sample w can be included in the sum, with feature counts computed from trajectories optimized under each weight.
  • Approximate inference: A second approximation directly integrates over possible trajectories in the training MDP to obtain similar calibration.The proxy reward is treated as evidence about behavior in the training environment rather than as an unquestionable objective.
  • Calibration and invariance: The IRD and inverse-reinforcement-learning posteriors are invariant to linear translations of features in the training MDP.Shifting the feature encoding does not change the induced posterior over the true reward weights.
  • Approximate inference: The maximum-entropy approximation interprets the proxy reward as feature counts from hypothetical expert demonstrations, with β controlling their effective dataset size.Higher assumed reward-design competence corresponds to more imagined demonstrations.

5 Evaluation

The Lavaland evaluation tests whether inverse reward design and risk-averse planning reduce negative side effects and reward hacking when training rewards are misspecified. Across binary-feature and latent-observation settings, IRD avoids lava and deceptive target-like states, though classifier features remain difficult.

  • Evaluation setup: IRD is evaluated in a gridworld where training excludes lava but testing introduces it, with the true objective requiring rapid target-reaching, grass avoidance, and lava avoidance.The experiments include proof-of-concept domains with direct terrain indicators and challenge domains where the relevant features are latent.
  • Side effects in Lavaland: In the proof-of-concept side-effect condition, IRD recognizes that lava-related reward weights are unconstrained by lava-free training behavior, unlike literal proxy optimization.All weights on the unseen lava indicator produce the same behavior in the training MDP, so IRD treats them as uncertain.
  • Reward hacking in Lavaland: When sensor correlations break at test time, IRD with risk-averse planning favors target cells where both sensors agree instead of closer cells that deceptively resemble the target.At test time, lava appears target-like to one sensor and grass-like to the other.
  • Results: IRD alleviates both negative side effects and reward hacking, but classifier-feature conditions are harder than raw-observation conditions because classification introduces nonlinear transformations and misclassification risk.The proxy can misclassify lava as target, while IRD must infer both a matching linear reward and its uncertainty after classification.
  • Latent rewards: In the latent-reward setting, IRD avoids lava despite no lava indicator because rewards that implicitly penalize latent lava remain plausible under the observed training behavior.The challenge setting uses latent terrain categories that induce raw multivariate-Gaussian observations.

6 Discussion

The discussion presents IRD as a way to mitigate misspecified objectives, while emphasizing boundaries around risk-averse planning, computational complexity, reward-function representation, and the designer error model.

  • Findings: IRD inference can enable avoidance of side effects and reward hacking in simple binary-terrain problems and in a high-dimensional setting with rare catastrophic terrain.The high-dimensional evaluation does not provide a binary indicator for the catastrophic terrain.
  • Risk-averse planning: Risk-averse planning may avoid potentially good outcomes as well as bad ones, such as avoiding a giant pot of gold along with lava.The authors identify follow-up queries to the reward designer as a possible way to address misspecified objectives.
  • Scope and scalability: The inference approaches explicitly solve planning problems, creating a bottleneck for scaling to complex environments and reward functions.Future work proposes approximately planning agents or meta-learning to improve scalability.
  • Scope and scalability: IRD depends on a prior containing a reasonable approximation to the true reward, so linear reward hypotheses may fail when the representation cannot express that reward well.The authors give RGB terrain encodings as an example where the hypothesis space may lack a suitable reward function.
  • Error modeling: The work uses a relatively simple designer error model with implicit assumptions such as IID errors, leaving systematic biased errors for future study.The authors also propose human-subject studies to evaluate more sophisticated error models empirically.

Appendix: Risk Averse Trajectory Optimization

The paper plans under reward uncertainty by selecting trajectories that perform well under sampled worst-case reward functions. It compares time-step-independent and trajectory-wide minimization, and examines reward baselines to make risk-averse planning meaningful.

  • Risk-averse planning: Risk-averse planning penalizes trajectories with high variance in utility rather than maximizing expected reward under the posterior.Maximizing expected reward under a reward distribution is equivalent to planning with its mean.
  • Worst-case planning: The method samples weights from the posterior and chooses a trajectory maximizing reward under the worst sampled weight.Worst-case minimization can be performed independently at each time step or across the entire trajectory.
  • Worst-case planning: Time-step-independent minimization is more conservative because it permits a different reward weight at each time step.This formulation takes the minimum over weights on a per-state basis.
  • Reward baselines: Risk-averse planning is sensitive to feature encoding because shifting all features by a constant can change the selected trajectory.Unlike expected-reward maximization, the risk-averse solution is not invariant to feature shifts.
  • Reward baselines: Reward baselines provide a reference point by comparing w⊤φ(ξ) with initial-state, training-feature, or trajectory-based offsets.The trajectory-based offset uses log P(ξ|w_i) and controls for the total reward available in the MDP.
  • Evaluation: Independently minimizing per time step was substantially more robust, while training-MDP average feature counts performed best as the common comparison point.The authors attribute the first result to approximate posterior inference and hypothesize that the best baseline depends on the situation.
Loading 1711.02827v2…