Inferring Reward Functions from Demonstrators with Unknown Biases

1 INTRODUCTION . Our ultimate goal is to enable the design of agents that optimize for the right reward function . Unfortunately , designing reward functions is challenging ( Amodei et al. , 2017 ) and can have unintended side-effects ( Hadfield-Menell et al. , 2017 ) . Inverse Reinforcement Learning ( Russell , 1998 ; Ng et al. , 2000 ; Abbeel & Ng , 2004 ) aims to bypass the need for reward design by learning the reward from observed demonstrations of good behavior . Existing IRL algorithms typically make the assumption that the demonstrator is either optimal , or Boltzmann rational , i.e . taking better actions with higher probability ( Ziebart et al. , 2008 ; Finn et al. , 2016 ) . However , there is a rich literature showing that humans are not optimal , and are biased in systematic ways . Consider a grad student who starts writing a paper a month in advance , expecting it to take two weeks , but then misses the deadline . Should we infer that they prefer to lose sleep to pursue a deadline that they then miss ? Of course not – this is a classic case of the planning fallacy ( Buehler et al. , 1994 ) . It is not clear what exactly went wrong – perhaps the grad student did not have a good dynamics model ( not realizing that Amazon spot instances can be suddenly terminated ) , or they failed to account for the uncertainty in their dynamics model ( expecting that it wouldn ’ t happen to them ) , or they optimized too much for short term reward ( watching Netflix ) , and so on – we do not know what the bias is . Ideally , even with this unknown bias , we would like our system to infer that the grad student failed to plan appropriately , and that they would prefer to meet the deadline . This leads to a tradeoff between the expressivity of our model of the demonstrator , and the ability of the algorithm to learn the true reward function with few samples . On one extreme , if we know exactly what bias the demonstrator has , we can account for it to infer the true reward function quickly and accurately , as in Evans et al . ( 2016 ) ; Evans & Goodman ( 2015 ) ; Zheng et al . ( 2014 ) ; Majumdar et al . ( 2017 ) ( myopia and hyperbolic time discounting , sparse noise , and risk-sensitivity respectively ) . Even suboptimal trajectories or failures ( Shiarlis et al. , 2016 ) can be thought of as a biased demonstrator , where the bias is the specific model of failure . Unfortunately , people are complex , and it is unlikely that we will know exactly which bias a person is displaying , or even the space of possible biases that people might have . If we are incorrect about the bias , we will have a mis-specified model , and the reward function will get garbage values that explain the `` noise '' resulting from the mis-specification ( Steinhardt , 2017 ; Steinhardt & Evans , 2017 ) . On the other extreme , when the demonstrator could be any function mapping reward functions to policies , it is impossible to learn the true reward function even with infinite data , because there are always alternative explanations for the observed policy ( Armstrong & Mindermann , 2017 ; Christiano , 2015 ) . We could consider asking the human to rate each demonstration ( Burchfiel et al. , 2016 ) , but the human could be biased in these ratings as well . In this paper , we focus on learning rewards when the demonstrator ’ s bias is unknown . We seek to avoid impossibility results by introducing a set of assumptions that are weaker than assuming a known bias , the core of which is that the demonstrator plans their actions similarly in similar tasks . This leads us to investigate the idea that one could actually learn , rather than assume , the demonstrator ’ s planning algorithm across multiple tasks , including any biases they may have . We analyze the feasibility of this idea in two settings , via two algorithms . In both algorithms , we can navigate the tradeoff between model expressivity and sample efficiency through the choice of architecture for the differentiable planner we learn , and the space of reward functions to consider . In the first setting , we assume that we have access to the true reward functions in some subset of tasks – that means we can learn the demonstrator ’ s planning algorithm on those tasks , after which we can infer rewards from demonstrations in new tasks . In the more realistic setting where we have no access to any reward function , we assume that the demonstrator is `` close '' to optimal . This is a weaker version of the assumption of Boltzmann rationality that still allows us to learn particular systematic biases . We operationalize this assumption by initializing the differentiable planner to mimic the optimal agent , and then finetuning it to allow it to account for specific biases . We show that this initialization is essential for good performance , as we would expect from the impossibility result . In summary , this paper makes three contributions : 1 . Assumptions that are more realistic than the assumption of Boltzmann rationality that allow us to avoid known pitfalls of reward inference . 2 . Algorithms that leverage these assumptions to infer reward functions from suboptimal demonstrations . 3 . An experimental evaluation demonstrating there is hope in the idea of learning better rewards by learning biases too , despite the theoretical difficulty of the problem . 2 EXAMPLES OF BIASES . To put this work in context , we start with some examples of the kind of biases a general algorithm should be able to capture and account for . While we use these for illustrative purposes , the whole point of our work is that humans might have systematic suboptimalities completely different from these examples . We don ’ t know all the possible biases a priori . Running Example . We illustrate the effects of these biases on a simple 2D navigation task in figure 1 . There are multiple salient locations , each of which has a desirability score ( which can be negative , in which case the agent wants to avoid those locations ) . The agent can move in any of the four cardinal directions , or stay in its current position . Every movement action has a chance of failing and causing the agent to move in a direction orthogonal to the one it chose . Despite their simplicity , there are several ways in which human-like suboptimal behavior can manifest in these environments . Time inconsistency . Would you prefer to get $ 100 in 30 days , or $ 110 in 31 days ? Faced with this question , people typically choose the latter . However , thirty days later , when faced with the choice of getting $ 100 now , or $ 110 tomorrow , they sometimes choose to take the $ 100 . This reversal of preferences over time would never happen with an optimal agent that maximizes expected sum of discounted rewards . Researchers model this phenomenon using hyperbolic time discounting , in which future rewards are discounted more aggressively than exponentially . This leads to a followup question – how do humans make long-term plans , given that their future self will have different preferences ? Prior work has considered a spectrum from naive agents that assume their future self will have the same preferences as they do , to sophisticated agents that perfectly understand how their preferences will change over time and make plans that take such change into account ( Frederick et al. , 2002 ) . In figure 1 , when going to a high reward , both the naive and sophisticated hyperbolic time discounters can be `` tempted '' by a proximate smaller reward . The naive agent fails to anticipate the temptation , and so once it gets near the smaller positive reward , it caves in to the temptation and stays there . The sophisticated agent explicitly plans to avoid the temptation – it does not collect the smaller reward and instead takes a longer , more dangerous path around the smaller reward to get to the large reward . Incorrect estimates of probabilities . Humans are notoriously bad at judging probabilities . The availability heuristic ( Tversky & Kahneman , 1973 ) refers to the human tendency to rate events as more likely if they are easier to recall . The recency effect is a similar effect where recent events are judged to be more probable . These biases are complicated and depend heavily on context and don ’ t obviously transfer to our task . So , we use two simplified models – an overconfident agent , which expects that the most likely next state is more likely than it actually is , leading it to take risks , and an underconfident agent , which is overly cautious . In figure 1 , the overconfident agent takes the shortest path to the reward , underestimating the risk of slipping into the large region of negative reward , while the underconfident agent plans a circuitous route around negative reward that it is unlikely to have actually encountered . Bounded computation . Researchers have studied models of bounded rationality , where humans are assumed to be rational subject to the constraint that they have a bounded amount of computation . This can be thought of as an explanation that many other heuristics and biases are actually computational shortcuts that allow us to reach reasonably good decisions without too much cost ( Kahneman , 2003 ) . In our task , we model computation bounds as a small time horizon for planning , leading to myopic behavior . In figure 1 , the myopic agent can only see close rewards , and goes directly to them , never even realizing the possibility of going to the highest reward . 3 PROBLEM : LEARNING REWARDS OF DEMONSTRATORS WITH UNKNOWN BIASES . Notation . A ( finite-horizon ) Markov Decision Process ( MDP ) ( Puterman , 2014 ) is a tuple 〈S , A , T , r , H〉 . S is a set of states . A is a set of actions . T is a probability distribution over the next state , given the previous state and action . We write this as T ( st+1|st , a ) . r is a reward function that maps states and actions to rewards r : S × A → R. H ∈ Z+ is the finite planning horizon for the agent . Since we are interested in the setting where the reward function r is unknown , we will factor MDPs into world models w = 〈S , A , T , H〉 and reward functions r. Instead of having access to a reward function , we observe the behavior of an demonstrator , who performs the task well but may be suboptimal in systematic ways . In particular , we observe the demonstrator ’ s policy π : S → A. Estimating Biases and Rewards . Given a world model w and the demonstrator ’ s policy πD which may exhibit an unknown bias , determine the reward r∗ that the demonstrator is optimizing . We might hope to solve this problem without any additional assumptions . However , this problem is unsolvable – Armstrong & Mindermann ( 2017 ) prove an impossibility result showing that for any potential reward function r′ , there is some planner D′ such that D′ ( w , r′ ) = D ( w , r∗ ) . The proof is simple – simply set D′ ( w , r′ ) = π for any r′ , that is D′ always returns π regardless of reward . Inverse reinforcement learning assumes that the demonstrator is ( approximately ) optimal to get around this issue . It is common to assume Boltzmann rationality , where the probability of an action is proportional to the exponent of its expected value ( Baker et al. , 2006 ) , i.e . P ( a|s ) ∝ eQ ( s , a ) , where Q is the optimal Q function that satisfies the Bellman equation : Q ( s , a ) = R ( s , a ) + γ ∑ s′ [ T ( s′|s , a ) max a′ Q ( s′ , a′ ) ] ( 1 ) However , we know that humans are systematically suboptimal , and so we would like to relax this assumption and try other , more realistic assumptions . The pathological solutions in the impossibility result occur partly because the demonstrator can have arbitrary behavior on different environments . While we certainly want the demonstrator to adapt to different environments , the algorithm that the demonstrator uses to determine their policy should stay fixed across similar environments . This imposes structure on the demonstrator ’ s planner that can eliminate some possibilities . Assumption 1 : The demonstrator plans in the same way for sufficiently similar environments . To formalize this , we assume that there is a space of world models W with the same set of states S and actions A , and a space of reward functions R ⊆ S × A → R. The demonstrator can plan a stochastic policy given a world model and reward , that is , they are modeled as D : ( W× R ) → ( S → A→ [ 0 , 1 ] ) . We call D the planning algorithm used by the demonstrator , or planner for short . Of course , if D can be any function with this type signature , it can still map any arbitrary ( w , r ) pair to any arbitrary policy D ( w , r ) , but we will further ensure that D is simple ( through regularization ) . Given a list of world models W = [ w1 . . . wn ] and reward functions R = [ r1 . . . rn ] , we define D ( W , R ) to be the list of the demonstrator ’ s policies [ D ( w1 , r1 ) . . . D ( wn , rn ) ] . Note that this is a strong assumption and it does limit the scope of our work : while it is reasonable to believe that people plan in the same way for variations of the same task , they likely have different biases for different tasks , because they may have domain-specific heuristics . The setting of multiple tasks has been studied before ( Gleave & Habryka , 2018 ; Dimitrakakis & Rothkopf , 2011 ; Choi & Kim , 2012 ) , though not for the purpose of inferring systematic biases . This assumption leads to a slightly easier problem , of recovering rewards from multiple tasks : Estimating Biases and Rewards for Multiple Tasks . Given a list of world models W and the demonstrator ’ s policies ΠD = D ( W , R ) which may exhibit an unknown bias , determine the list of reward functions R ( one for each w ∈W ) that the demonstrator was optimizing . Since the person uses the same planner across all tasks , an agent can have an easier time recovering rewards for each task by leveraging the common structure across the tasks . This is especially appealing for agents that would get to observe people for some period of time before trying to assist them . Unfortunately , Assumption 1 is not sufficient to solve this problem . Consider the case where the demonstrator is optimal . Given the assumptions so far , we could infer that the demonstrator is minimizing expected reward , i.e . that the reward they are optimizing is −r∗ , since that perfectly predicts πD . This is very bad , as we could infer a reward that incentivizes the worst possible behavior ! When humans take action , we typically assume that they are doing something that is reasonable for achieving their goals , even if it is not optimal : Assumption 2a : The demonstrator is `` close '' to optimal . We explore this assumption in section 4.3 to solve the problem of estimating biases and rewards for multiple tasks . We also explore an alternative approach , based on the fact that we have strong priors about what humans are trying to optimize for , which allow us to infer how good they are at achieving their goals . If we see some tasks where we know the demonstrator ’ s reward function and policy , we can infer that the demonstrator is not minimizing expected reward . Assumption 2b : We know what reward function the demonstrator is optimizing for some tasks . Estimating Biases and Rewards with Access to Tasks with Known Rewards . Given a list of world models W , a list of the demonstrator ’ s policies ΠD = D ( W , R ) , a list of world models Wknown with known rewards Rknown and a list of the demonstrator ’ s policies Πknown = D ( Wknown , Rknown ) , determine the reward functions R that D was optimizing . We will present algorithms for both settings in the next section . While our problem formulations above assume that we have access to full policies ΠD , none of our algorithms rely on this assumption – it is easy to modify them to work with trajectories instead .

Summary: This paper addresses the interesting and challenging problem of learning the reward function from demonstrators which have unknown biases. As this is in general impossible, the authors consider two special cases in which either the reward function is observed on a subset of tasks or in which the observations are assumed to be close to optimal. They propose algorithms for both cases and evaluate these in basic experiments.