Deep Bayesian Reward Learning from Preferences

Daniel S. Brown, Scott NiekumarXiv 2019

Abstract

Bayesian inverse reinforcement learning (IRL) methods are ideal for safe imitation learning, as they allow a learning agent to reason about reward uncertainty and the safety of a learned policy. However, Bayesian IRL is computationally intractable for high-dimensional problems because each sample from the posterior requires solving an entire Markov Decision Process (MDP). We propose Bayesian Reward Extrapolation (B-REX), a highly efficient, preference-based Bayesian reward learning algorithm that scales to high-dimensional, visual control tasks. Our approach uses successor feature representations and preferences over demonstrations to efficiently generate samples from the posterior distribution over the demonstrator's reward function without requiring an MDP solver. Using samples from the posterior, we demonstrate how to calculate high-confidence bounds on policy performance in the imitation learning setting, in which the ground-truth reward function is unknown. We evaluate our proposed approach on the task of learning to play Atari games via imitation learning from pixel inputs, with no access to the game score. We demonstrate that B-REX learns imitation policies that are competitive with a state-of-the-art deep imitation learning method that only learns a point estimate of the reward function. Furthermore, we demonstrate that samples from the posterior generated via B-REX can be used to compute high-confidence performance bounds for a variety of evaluation policies. We show that high-confidence performance bounds are useful for accurately ranking different evaluation policies when the reward function is unknown. We also demonstrate that high-confidence performance bounds may be useful for detecting reward hacking.

Introduction

In imitation learning, an agent aims to learn a task by observing human demonstrations. Standard Inverse Reinforcement Learning (IRL) typically seeks a single reward function that best explains the observed behavior. However, for safety-critical applications, a point estimate is insufficient; understanding the agent's uncertainty about the reward is paramount. Bayesian IRL addresses this by generating a posterior distribution of possible reward functions.

Traditionally, Bayesian IRL has been computationally intractable for complex, high-dimensional problems like Atari games. The primary bottleneck is the requirement to solve a complete Markov Decision Process (MDP) for every proposed reward function during MCMC sampling. We introduce Bayesian Reward Extrapolation (B-REX) to overcome this limitation, enabling practical Bayesian inference for visual tasks by decoupling reward learning from MDP solving.

Methodology

B-REX achieves efficiency through three key technical innovations:

  1. Preference-based Likelihood: Instead of matching exact state-action pairs, B-REX utilizes pairwise rankings of demonstrations. Using the Bradley-Terry model, it evaluates the likelihood of a reward function based on whether it assigns higher returns to preferred trajectories.
  2. Successor Features (SFs): SFs decouple environment dynamics from the reward function. By pre-calculating SFs for an evaluation policy, the expected value under any linear reward function becomes a simple dot product, eliminating the need for an MDP solver in the inner loop.
  3. Linear Reward over Deep Features: We utilize a pre-trained deep neural network to extract features $\phi(s)$ from raw pixels. The reward function is defined as a linear combination $R = w^T\phi$. By freezing the feature extractor and only sampling the weight vector $w$, we can evaluate thousands of reward hypotheses nearly instantaneously.

Experimental Setup

We evaluated B-REX on five games from the Arcade Learning Environment (Atari 2600): Beam Rider, Breakout, Enduro, Seaquest, and Space Invaders. To simulate a realistic imitation learning scenario, game scores and life counts were masked. The agent learned solely from visual observations and rankings of 12 suboptimal demonstrations.

Results and Analysis

B-REX demonstrates performance competitive with state-of-the-art non-Bayesian methods like T-REX, while being significantly more efficient than traditional Bayesian IRL. It can generate 100,000 reward hypotheses in approximately 5 minutes on a standard laptop.

Table 1: Average performance of B-REX (Mean and MAP) compared to ranked demonstrations and T-REX across five Atari games.

As shown in Table 1, B-REX learns policies that often exceed the performance of the best human demonstrations. Furthermore, the posterior distribution generated by B-REX accurately reflects the relative quality of different evaluation policies.

Figure 2: Comparison between the B-REX posterior distribution of returns (a) and the ground-truth returns (b) for four policies (A-D).

Figure 2 illustrates how the modes of the predicted distributions align with the ground-truth game scores, despite the agent never having access to those scores during training. This alignment confirms that B-REX can effectively rank policies under reward uncertainty.

Safety and Uncertainty

The ability to sample from the reward posterior enables the calculation of high-confidence safety bounds, such as the 0.05-Value at Risk (VaR). This metric provides a lower bound on performance, helping to identify risky policies that might have high average rewards but fail in specific scenarios. Additionally, B-REX can detect "reward hacking." For instance, a "No-Op" policy might appear optimal under a point-estimate reward that is slightly positive for every timestep. However, B-REX's distribution reveals that many valid reward functions would penalize such behavior, resulting in a low confidence bound that flags the anomaly.

Conclusion and Limitations

B-REX makes Bayesian reward learning practical for high-dimensional visual tasks. While successful, the approach depends on the quality of the pre-trained feature extractor. Future work will explore more robust auxiliary tasks for feature learning and the integration of high-confidence bounds into risk-aware policy improvement algorithms.

Summary updated

BibTeX
@misc{brown2019deep,
  author = {Daniel S. Brown and Scott Niekum},
  title = {{Deep Bayesian Reward Learning from Preferences}},
  year = {2019},
  eprint = {1912.04472},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1912.04472},
}
Figure