NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Quantifying Differences in Reward Functions

Adam Gleave, Michael Dennis, Shane Legg, Stuart Russell, Jan Leike

TL;DR

Evaluating learned reward functions usually requires the expensive step of training a reinforcement learning (RL) agent from scratch. This paper introduces EPIC (Equivalent-Policy Invariant Comparison), a distance metric that directly compares two reward functions without any policy optimization. EPIC is computationally efficient, theoretically grounded, and provides a reliable way to predict how well a learned reward will actually perform in deployment.

What Problem Does This Paper Address?

In many complex tasks, we can't write down a reward function by hand; instead, we learn it from human demonstrations or preferences. Traditionally, researchers evaluate these learned rewards using the "rollout method": they train a new RL policy on the learned reward and see how well it performs on the "true" hidden reward.

This approach has three major flaws:

  1. Computational Cost: Training an RL agent to convergence just to evaluate a single reward model is incredibly slow and expensive.
  2. Confounding Errors: If the policy performs poorly, you don't know if the reward was bad or if the RL algorithm simply failed to optimize it.
  3. Fragility: A reward might work perfectly in a training environment but fail catastrophically if the environment's dynamics change slightly (e.g., a robot encountering a different floor surface), because the reward didn't truly capture the user's intent.

Methods

The authors propose EPIC, a distance metric that operates directly on the reward functions. To make this work, they had to solve a fundamental problem: many different-looking reward functions are "equivalent" because they induce the same optimal behavior.

EPIC uses two clever tricks to handle this:

  • Canonicalization: It transforms rewards into a "canonical form" that is invariant to potential-based shaping. In RL, you can add certain terms to a reward (shaping) to help an agent learn faster without changing what the optimal behavior is. EPIC's transformation effectively "strips away" this shaping so equivalent rewards look the same.
  • Pearson Correlation: After canonicalization, it calculates the correlation between the two reward functions over a coverage distribution of transitions. Using correlation makes the metric invariant to positive rescaling (e.g., doubling all rewards), which also doesn't change optimal behavior.

The authors also compare EPIC against two baselines: ERC (Episode Return Correlation) and NPEC (Nearest Point in Equivalence Class).

Datasets

The researchers evaluated EPIC across several environments, ranging from simple toy problems to complex continuous control tasks:

Gridworld Reward Variations
  • Gridworld (3x3): A simple environment to visualize how different rewards (Sparse, Dense, Path, Cliff) relate to each other.
  • PointMass: A 1D task used as a proof-of-concept for continuous control.
  • MuJoCo Benchmarks: They used standard locomotion tasks including HalfCheetah and Hopper, as well as PointMaze (where an agent navigates a maze to a goal).
  • Learned Models: They trained reward models using common techniques like Adversarial Inverse RL (AIRL), preference comparisons, and simple regression to see if EPIC could distinguish between them.

Key Insights and Ideas

  • Direct Comparison is Possible: You don't need to see an agent act to know if a reward function is "correct." By mathematically accounting for reward equivalence classes, we can compare the functions themselves.
  • Regret Bounds: The most significant theoretical contribution is proving that EPIC distance provides an upper bound on policy regret. If the EPIC distance between a learned reward and the true reward is small, a policy optimized for the learned reward is guaranteed to perform well on the true reward, even if the environment's transition dynamics change.
  • Robustness to Sampling: While EPIC requires a "coverage distribution" (a way to sample states and actions), the authors found it is remarkably robust. Even using a simple random policy to sample transitions provides enough information for EPIC to be accurate, whereas baseline metrics were highly sensitive to the choice of distribution.

Key Results

  • Identifying Equivalence: In the PointMass task, EPIC correctly assigned a distance of near-zero to equivalent rewards (like "Sparse" vs. "Dense" versions of the same goal), while baselines like NPEC and ERC incorrectly saw them as different.
Distance Metric Comparisons
  • Speed: EPIC is orders of magnitude faster than the alternatives. In one experiment, EPIC provided results in 17 seconds, while the NPEC baseline took 31 hours.
  • Predictive Power: EPIC distance strongly correlates with actual policy performance. In the PointMaze task, reward models with low EPIC distance to the ground truth resulted in agents that successfully reached the goal, even in a "test" version of the maze where a wall had been moved.

Limitations and Future Work

  • The Coverage Requirement: EPIC relies on a coverage distribution. If this distribution doesn't sample "plausible" transitions (e.g., it only looks at a tiny corner of the state space), the distance metric might miss misalignments elsewhere.
  • The Constant Factor: The theoretical regret bound depends on a constant (the ratio between the agent's state occupancy and the coverage distribution). In high-dimensional spaces, this could be very large, making the theoretical bound loose, even if the empirical results remain strong.
  • Future Directions: The authors suggest EPIC could be used to cluster different reward models to see which methods produce similar intents, or even used as a training objective itself to "distill" complex rewards into simpler, more interpretable ones.

Summary updated

BibTeX
@inproceedings{gleave2021quantifying,
  author = {Adam Gleave and Michael Dennis and Shane Legg and Stuart Russell and Jan Leike},
  title = {{Quantifying Differences in Reward Functions}},
  booktitle = {International Conference on Learning Representations},
  year = {2021},
}
Figure