A benchmark environment for fully cooperative human-AI performance.
While we would like agents that can coordinate with humans, current algorithms such as self-play and population-based training create agents that can coordinate with themselves. Agents that assume their partner to be optimal or similar to them can converge to coordination protocols that fail to understand and be understood by humans. To demonstrate this, we introduce a simple environment that requires challenging coordination, based on the popular game Overcooked, and learn a simple model that mimics human play. We evaluate the performance of agents trained via self-play and population-based training. These agents perform very well when paired with themselves, but when paired with our human model, they are significantly worse than agents designed to play with the human model. An experiment with a planning algorithm yields the same conclusion, though only when the human-aware planner is given the exact human model that it is playing with. A user study with real humans shows this pattern as well, though less strongly. Qualitatively, we find that the gains come from having the agent adapt to the human's gameplay. Given this result, we suggest several approaches for designing agents that learn about humans in order to better coordinate with them. Code is available at https://github.com/HumanCompatibleAI/overcooked_ai.READ FULL TEXT VIEW PDF
A benchmark environment for fully cooperative human-AI performance.
Code for "On the Utility of Learning about Humans for Human-AI Coordination"
An increasingly effective way to tackle two-player games is to train an agent to play with a set of other AI agents, often past versions of itself. This powerful approach has resulted in impressive performance against human experts in games like Go (Silver et al., 2017), Quake (Jaderberg et al., 2019), Dota (OpenAI, 2019b), and Starcraft (Vinyals et al., 2019).
Since the AI agents never encounter humans during training, when evaluated against human experts, they are undergoing a distributional shift. Why doesn’t this cause the agents to fail? We hypothesize that it is because of the competitive nature of these games. Consider the canonical case of a two-player zero-sum game, as shown in Figure 1 (left). When humans play the minimizer role but take a branch in the search tree that is suboptimal, this only increases the maximizer’s score.
However, not all settings are competitive. Arguably, one of the main goals of AI is to generate agents that collaborate, rather than compete, with humans. We would like agents that help people with the tasks they want to achieve, augmenting their capabilities (Engelbart, 1962; Carter and Nielsen, 2017). Looking at recent results, it is tempting to think that self-play-like methods extend nicely to collaboration: AI-human teams performed well in Dota OpenAI (2019a) and Capture the Flag Jaderberg et al. (2019). However, in these games, the advantage may come from the AI system’s individual ability, rather than from coordination with humans. We claim that in general, collaboration is fundamentally different from competition, and will require us to go beyond self-play to explicitly account for human behavior.
Consider the canonical case of a common-payoff game, shown in Figure 1 (right): since both agents are maximizers, a mistake on the human’s side is no longer an advantage, but an actual problem, especially if the agent did not anticipate it. Further, agents that are allowed to co-train might converge onto opaque coordination strategies. For instance, agents trained to play the collaborative game Hanabi learned to use the hint “red” or “yellow” to indicate that the newest card is playable, which no human would immediately understand (Foerster et al., 2018). When such an agent is paired with a human, it will execute the opaque policy, which may fail spectacularly when the human doesn’t play their part.
We thus hypothesize that in true collaborative scenarios agents trained to play well with other AI agents will perform much more poorly when paired with humans. We further hypothesize that incorporating human data or models into the training process will lead to significant improvements.
To test this hypothesis, we introduce a simple environment based on the popular game Overcooked (Ghost Town Games, 2016), which is specifically designed to be challenging for humans to coordinate in (Figure 2).We use this environment to compare agents trained with themselves to agents trained with a learned human model. For the former, we consider self-play (Silver et al., 2017), population-based training (Jaderberg et al., 2017)
, and coupled planning with replanning. For the latter, we collect human-human data and train a behavior cloning human model; we then train a reinforcement learning and a planning agent to collaborate well with this model. We evaluate how well these agents collaborate with a held-out “simulated” human model (henceforth the “proxy human”), trained on a different data set, as well as in a user study.
We find that the agents which did not leverage human data in training perform very well with themselves, and drastically worse when paired with the proxy human. This is not explained only by human suboptimality, because the agent also significantly underperforms a “gold standard” agent that has access to the proxy human. The agent trained with the behavior-cloned human model is drastically better, showing the benefit of having a relatively good human model. We found the same trends even when we paired these agents with real humans, for whom our model has much poorer predictive power but nonetheless helps the agent be a better collaborator. We also experimented with using behavior cloning directly for the agent’s policy, and found that it also outperforms self-play-like methods, but still underperforms relative to methods that that leverage planning (with respect to the actual human model) or reinforcement learning with a proxy human model.
Overall, we learned a few important lessons in this work. First, our results showcase the importance of accounting for real human behavior during training: even using a behavior cloning model prone to failures of distributional shift seems better than treating the human as if they were optimal or similar to the agent. Second, leveraging planning or reinforcement learning to maximize the collaborative reward, again even when using such a simple human model, seems to already be better than vanilla imitation. These results are a cautionary tale against relying on self-play or vanilla imitation for collaboration, and advocate for methods that leverage models of human behavior, actively improve them, or even use them as part of a population to be trained with.
Human-robot interaction (HRI). The field of human robot interaction has already embraced our main point that we shouldn’t model the human as optimal. Much work focuses on achieving collaboration by planning and learning with (non-optimal) models of human behavior Nikolaidis and Shah (2013); Javdani et al. (2015); Sadigh et al. (2016), as well as on specific properties of robot behavior that aid collaboration Alami et al. (2006); Gielniak and Thomaz (2011); Dragan et al. (2013). However, to our knowledge, ours is the first work to analyze the optimal human assumption in the context of deep reinforcement learning, and to test potential solutions such as population-based training (PBT).
Choudhury et al. (2019)
is particularly related to our work. It evaluates whether it is useful to learn a human model using deep learning, compared to a more structured “theory of mind” human model. We are instead evaluating how useful it is to have a human modelat all.
Multiagent reinforcement learning. Deep reinforcement learning has also been applied to multiagent settings, in which multiple agents take actions in a potentially non-competitive game Lowe et al. (2017); Gupta et al. (2017). Some work tries to teach agents collaborative behaviors (Leibo et al., 2017; Hughes et al., 2018) in environments where rewards are not shared across agents. The Bayesian Action Decoder (Foerster et al., 2018) learns communicative policies that allow two agents to collaborate, and has been applied to the cooperative card game Hanabi. However, most multiagent RL research focuses on AI-AI interaction, rather than the human-AI setting.
Lerer and Peysakhovich (2019)
starts from the same observation that self-play will perform badly in general-sum games, and aims to do better given some data from agents that will be evaluated on at test time (analogous to our human data). However, they assume that the test time agents have settled into an equilibrium that their agent only needs to replicate, and so they train their agent with Observational Self-Play (OSP): a combination of imitation learning and MARL. In contrast, we allow for the case where humans do not play an equilibrium strategy (because they are suboptimal), and so we only use imitation learning to create human models, and train our agent using pure RL.
Imitation learning. Imitation learning (Abbeel and Ng, 2004; Ho and Ermon, 2016) aims to train agents that mimic the policies of a demonstrator. In our work, we use behavior cloning (Pomerleau, 1991) to imitate demonstrations collected from humans, in order to learn human models to collaborate with. However, the main focus of our work is in the design of agents that can collaborate with these models, and not the models themselves.
A multiagent Markov decision processBoutilier (1996) is defined by a tuple . is a finite set of states, and is a real-valued reward function. is a finite set of agents; is the finite set of actions available to agent . is a transition function that determines the next state given all of the agents’ actions.
One of the simplest approaches to imitation learning is given by behavior cloning, which learns a policy from expert demonstrations by directly learning a mapping from observations to actions with standard supervised learning methods(Bain and Sammut, 1999)
. Since we have a discrete action space, this is a traditional classification task. Our model takes an encoding of the state as input, and outputs a probability distribution over actions, and is trained using the standard cross-entropy loss function.
Population Based Training. Population Based Training (PBT) Jaderberg et al. (2017)
is an online evolutionary algorithm which periodically adapts training hyperparameters and performs model selection. In multiagent RL, PBT maintains a population of agents, whose policies are parameterized by neural networks, and trained with a DRL algorithm. In our case, we use Proximal Policy Optimization (PPO)Schulman et al. (2017). During each PBT iteration, pairs of agents are drawn from the population, trained for a number of timesteps, and have their performance recorded. At the end of each PBT iteration, the worst performing agents are replaced with copies of the best agents with mutated hyperparameters.
To test our hypotheses, we would like an environment in which coordination is challenging, and where deep RL algorithms work well. Existing environments have not been designed to be challenging for coordination, and so we build a new one based on the popular video game Overcooked (Ghost Town Games, 2016), in which players control chefs in a kitchen to cook and serve dishes. Each dish takes several high-level actions to deliver, making strategy coordination difficult, in addition to the challenge of motion coordination.
We implement a simplified version of the environment, in which the only objects are onions, dishes, and soups (Figure 2). Players place 3 onions in a pot, leave them to cook for 20 timesteps, put the resulting soup in a dish, and serve it, giving all players a reward of 20. The six possible actions are: up, down, left, right, noop, and "interact", which does something based on the tile the player is facing, e.g. placing an onion on a counter. Each layout has one or more onion dispensers and dish dispensers, which provide an unlimited supply of onions and dishes respectively. Most of our layouts (Figure 3) were designed to lead to either low-level motion coordination challenges or high-level strategy challenges.
Agents should learn how to navigate the map, interact with objects, drop the objects off in the right locations, and finally serve completed dishes to the serving area. All the while, agents should be aware of what their partner is doing and coordinate with them effectively.
We created a web interface for the game, from which we were able to collect trajectories of humans playing with other humans for the layouts in Figure 3. In preliminary experiments we found that human models learned through behavior cloning performed better than ones learned with Generative Adversarial Imitation Learning (GAIL) Ho and Ermon (2016), so decided to use the former throughout our experiments. To incentivize generalization in spite of the scarcity of human data, we perform behavior cloning over a manually designed featurization of the underlying game state.
For each layout we gathered ~16 human-human trajectories (for a total of 18k environment timesteps). We partition the joint trajectories into two subsets, and split each trajectory into two single-agent trajectories. For each layout and each subset, we learn a human model through behavior cloning. We treat one model, BC, as a human model we have access to, while the second model is treated as the ground truth human proxy to evaluate against at test time. On the first three layouts, when paired with themselves, most of these models perform similarly to an average human. Performance is significantly lower for the last two layouts (Forced Coordination and Counter Circuit).
The learned models sometimes got “stuck”: they would perform the same action over and over again (such as walking into each other), without changing the state. We added a simple rule-based mechanism to get the agents unstuck by taking a random action. For more details see Appendix A.
We consider two DRL algorithms that train agents designed for self-play, and one planning algorithm.
DRL algorithms. For DRL we consider PPO trained in self-play (SP) and PBT. Since PBT involves training agents to perform well with a population of other agents, we might expect them to be more robust to potential partners compared to agents trained via self-play, and so PBT might coordinate better with humans. For PBT, all of the agents in the population used the same network architecture.
Planning algorithm. Working in the simplified Overcooked environment enables us to also compute near-optimal plans for the joint planning problem of delivering dishes. This establishes a baseline for performance and coordination, and is used to perform coupled planning with re-planning. With coupled planning, we compute the optimal joint plan for both agents. However, rather than executing the full plan, we only execute the first action of the plan, and then replan the entire optimal joint plan after we see our partner’s action (since it may not be the same as the action we computed for them).
To achieve this, we pre-compute optimal joint motion plans for every possible starting and desired goal locations for each agent. We then create high-level actions such as “get an onion”, “serve the dish”, etc. and use the motion plans to compute the cost of each action. We use search to find the optimal joint plan in this high-level action space. This planner does make some simplifying assumptions, detailed in Appendix E, making it near-optimal instead of optimal.
We seek the simplest possible solution to having an agent that actually takes advantage of the human model. We embed our learned human model BC in the environment, treating it’s choice of action as part of the dynamics. We then directly train a policy on this single-agent environment with PPO. We found empirically that the policies achieved best performance by initially training them in self-play, and then linearly annealing to training with the human model (see Appendix C).
For planning, we implemented a model-based planner that uses hierarchical search to act near-optimally, assuming access to the policy of the other player (see Appendix F). In order to preserve near-optimality we make our training and test human models deterministic, as dealing with stochasticity would be too computationally expensive.
– in orange, and imitation agents – BC – in gray), with standard error over 5 different seeds, paired with the proxy human H. The white bars correspond to what the agents trained with themselves expect to achieve, i.e. their performance when paired with itself (SP+SP and PBT+PBT). First, these agents perform much worse with the proxy human than with themselves. Second, the PPO agent that trains with human data performs much better, as hypothesized. Third, imitation tends to perform somewhere in between the two other agents. The red dotted lines show the "gold standard" performance achieved by a PPO agent with direct access to the proxy model itself – the difference in performance between this agent and PPO stems from the innacuracy of the BC human model with respect to the actual . The hashed bars show results with the starting position of the agents switched. This most makes a difference for asymmetric layouts such as Asymmetric Advantages or Forced Coordination.
We pair each agent with the proxy human model and evaluate the team performance.
Independent variables. We vary the type of agent used. We have agents trained with themselves: self-play (SP), population-based training (PBT), coupled planning (CP); agents trained with the human model BC: reinforcement learning based (PPO), and planning-based P; and the imitation agent BC itself. Each agent is paired with H in each of the layouts in Figure 3.
Dependent measures. As good coordination between teammates is essential to achieve high returns in this environment, we use cumulative rewards over a horizon of 400 timesteps for our agents as a proxy for coordination ability. For all DRL experiments, we report average rewards across 100 rollouts and standard errors across 5 different seeds. To aid in interpreting these measures, we also compute a "gold standard" performance by training the PPO and planning agents not with BC, but with H itself, essentially giving them access to the ground truth human they will be paired with.
Analysis. We present quantitative results for DRL in Figure 4. Even though SP and PBT achieve excellent performance in self-play, when paired with a human model they struggle to even meet the performance of the imitation agent. There is a large gap between the imitation agent and gold standard performance. Note that the gold standard reward is lower than self-play methods paired with themselves, due to human suboptimality affecting the highest possible reward the agent can get. We then see that PPO outperforms the agents trained with themselves, getting closer to the gold standard. This supports our hypothesis that 1) self-play-like agents perform drastically worse when paired with humans, and 2) it is possible to improve performance significantly by taking the human into account. We show this holds (for these layouts) even when using an unsophisticated, behavior-cloning based model of the human.
Due to computational complexity, model-based planning was only feasible on two layouts. Figure 5 shows the results on these layouts, demonstrating a similar trend. As expected, coupled planning achieves better self-play performance than reinforcement learning. But when pairing it with the human proxy, performance drastically drops, far below the gold standard. Qualitatively, we notice that a lot of this drop seems to happen because the agent expects optimal motion, whereas actual human play is much slower. Giving the planner access to the true human model and planning with respect to it is sufficient to improve performance (the dotted line above P). However, when planning with BC but evaluating with H, the agent gets stuck in loops (see Appendix G).
Overall, these results showcase the benefit of getting access to a good human model – BC is in all likelihood closer to H than to a real human. Next, we study to what extent the benefit is still there with a poorer model, i.e. when still using BC, but this time testing on real users.
Design. We varied the AI agent (SP vs. PBT vs. PPO) and measured the average reward per episode when the agent was paired with a human user. We recruited 60 users (38 male, 19 female, 3 other, ages 20-59) on Amazon Mechanical Turk and used a between-subjects design, meaning each user was only paired with a single AI agent. Each user played all 5 task layouts, in the same order that was used when collecting human-human data for training. See Appendix H for more information.
Analysis. We present results in Figure 6. PPO outperforms the self-play methods in three of the layouts, and is roughly on par with the best one of them in the other two. While the effect is not as strong as in simulation, it follows the same trend, where PPO is overall preferable.
An ANOVA with agent type as a factor and layout and player index as covariates showed a significant main effect for agent type on reward (, ), and the post-hoc analysis with Tukey HSD corrections confirmed that PPO performed significantly better than SP ( and PBT (). This supports our hypothesis.
In some cases, PPO also significantly outperforms human-human performance. Since imitation learning typically cannot exceed the performance of the demonstrator it is trained on, this suggests that in these cases PPO would also outperform imitation learning.
We speculate that the differences across layouts are due to differences in the quality of BC and DRL algorithms across layouts. In Cramped Room, Coordination Ring, and the second setting of Asymmetric Advantages, we have both a good BC model as well as good DRL training, and so PPO outperforms both self-play methods and human-human performance. In the first setting of Asymmetric Advantages, the DRL training does not work very well, and the resulting policy lets the human model do most of the hard work. (In fact, in the second setting of Asymmetric Advantages in Figure 3(a), the human-AI team beats the AI-AI team, suggesting that the role played by the human is hard to learn using DRL.) In Forced Coordination and Counter Circuit, BC is a very poor human model, and so PPO still has an incorrect expectation, and doesn’t perform as well.
We also guess that the effects are not as strong in simulation because humans are able to adapt to agent policies and figure out how to get the agent to perform well, a feat that our simple is unable to do. This primarily benefits self-play based methods, since they typically have opaque coordination policies, and doesn’t help PPO as much, since there is less need to adapt to PPO. We describe some particular scenarios in Section 7.
Figure 7 shows how well each model performs as a predictive model of the human, averaged across all human-AI data, and unsurprisingly finds that SP and PBT are poor models, while BC and are decent. Since SP and PBT expect the other player to be like themselves, they are effectively using a bad model of the human, explaining their poor performance with real humans. PPO instead expects the other player to be BC, a much better model, explaining its superior performance.
Here, we speculate on some qualitative behaviors that we observed. We found similar behaviors between simulation and real users, and SP and PBT had similar types of failures, though the specific failures were different.
Adaptivity to the human. We observed that over the course of training the SP agents became very specialized, and so suffered greatly from distributional shift when paired with human models and real humans. For example, in Asymmetric Advantages, the SP agents only use the top pot, and ignore the bottom one. However, humans use both pots. The SP agent ends up waiting unproductively for the human to deliver a soup from the top pot, while the human has instead decided to fill up the bottom pot. In contrast, PPO learns to use both pots, depending on the context.
Leader/follower behavior. In Coordination Ring, SP and PBT agents tend to be very headstrong: for any specific portion of the task, they usually expect either clockwise or counterclockwise motion, but not both. Humans have no such preference, and so the SP and PBT agents often collide with them, and keep colliding until the human gives way. The PPO agent instead can take on both leader and follower roles. If it is carrying a plate to get a soup from the pot, it will insist on following the shorter path, even if a human is in the way. On the other hand, when picking which route to carry onions to the pots, it tends to adapt to the human’s choice of route.
Adaptive humans. Real humans learn throughout the episode to anticipate and work with the agent’s particular coordination protocols. For example, in Cramped Room, after picking up a soup, SP and PBT insist upon delivering the soup via right-down-interact instead of down-right-down-interact – even when a human is in the top right corner, blocking the way. Humans can figure this out and make sure that they are not in the way. Notably, PPO cannot learn and take advantage of human adaptivity, because the BC model is not adaptive.
Summary. While agents trained via general DRL algorithms in collaborative environments are very good at coordinating with themselves, they are not able to handle human partners well, since they have never seen humans during training. We introduced a simple environment based on the game Overcooked that is particularly well-suited for studying coordination, and demonstrated quantitatively the poor performance of such agents when paired with a learned human model, and with actual humans. Agents that were explicitly designed to work well with a human model, even in a very naive way, achieved significantly better performance. Qualitatively, we observed that agents that learned about humans were significantly more adaptive and able to take on both leader and follower roles than agents that expected their partners to be optimal (or like them).
Limitations and future work. An alternative hypothesis for our results is that training against BC simply forces the trained agent to be robust to a wider variety of states, since BC is more stochastic than an agent trained via self-play, but it doesn’t matter whether BC models real humans or not. We do not find this likely a priori, and we did try to check this: PBT is supposed to be more robust than self-play, but still has the same issue, and planning agents are automatically robust to states, but still showed the same broad trend. Nonetheless, it is possible that DRL applied to a sufficiently wide set of states could recoup most of the lost performance. One particular experiment we would like to run is to rain a single agent that works on arbitrary layouts. Since agents would be trained on a much wider variety of states, it could be that such agents require more general coordination protocols, and self-play-like methods will be more viable since they are forced to learn the same protocols that humans would use.
In contrast, in this work, we trained separate agents for each of the layouts in Figure 3. We limited the scope of each agent because of our choice to train the simplest human model, in order to showcase the importance of human data: if a naive model is already better, then more sophisticated ones will be too. Our findings open the door to exploring such models and algorithms:
Better human models: Using imitation learning for the human model is prone to distributional shift that reinforcement learning will exploit. One method to alleviate this would be to add inductive bias to the human model that makes it more likely to generalize out of distribution, for example by using theory of mind (Choudhury et al., 2019) or shared planning (Ho et al., 2016). However, we could also use the standard data aggregation approach, where we periodically query humans for a new human-AI dataset with the current version of the agent, and retrain the human model to correct any errors caused by distribution shift.
Biasing population-based training towards humans: Agents trained via PBT should be able to coordinate well with any of the agents that were present in the population during training. So, we could train multiple human models using variants of imitation learning or theory of mind, and inject these human models as agents in the population. The human models need not even be accurate, as long as in aggregate they cover the range of possible human behavior. This becomes a variant of domain randomization Andrychowicz et al. (2018) applied to interaction with humans.
Adapting to the human at test time: So far we have been assuming that we must deploy a static agent at test time, but we could have our agent adapt online. One approach would be to learn multiple human models (corresponding to different humans in the dataset). At test time, we can select the most likely human model (Ohn-Bar et al., 2018), and choose actions using a model-based algorithm such as model predictive control (Nagabandi et al., 2018). We could also use a meta-learning algorithm such as MAML (Finn et al., 2017) to learn a policy that can quickly adapt to new humans at test time.
Humans who learn: We modeled the human policy as stationary, preserving the Markov assumption. However, in reality humans will be learning and adapting as they play the game, which we would ideally model. We could take this into account by using recurrent architectures, or by using a more explicit model of how humans learn.
We thank the researchers at the Center for Human Compatible AI and the Interact lab for valuable feedback. This work was supported by the Open Philanthropy Project, AFOSR, the NSF VeHICaL project (CNS-1545126), and National Science Foundation Graduate Research Fellowship Grant No. DGE 1752814.
Proceedings of the twenty-first international conference on Machine learning, pp. 1. Cited by: §2.
Using artificial intelligence to augment human intelligence. Distill. Note: https://distill.pub/2017/aia External Links: Cited by: §1.
We collected trajectories from Amazon Mechanical Turk. We removed trajectories that fell short of the intended human-human trajectory length of and very suboptimal ones (with reward roughly below to what could be achieved by one human on their own – i.e. less than 220 for Cramped Room, 280 for Asymmetric Advantages Ring, 150 for Coordination Ring, 160 for Forced Coordination, and 180 for Counter Circuit). After removal, we had 16 joint human-human trajectories for Cramped Room environment, 17 for Asymmetric Advantages, 16 for Coordination Ring, 12 for Forced Coordination, and 15 for Counter Circuit.
We divide the joint trajectories into two groups randomly, and split each joint trajectory into two single agent trajectories: and . At the end of this process we have twice as many single-agent trajectories than the joint human-human trajectories we started with, for a total of approximately 36k environment timesteps for each layout.
We then use the two sets of single-agent human trajectories to train two human models, BC and H, for each of the five layouts. We evaluate these trained behavior cloning models by pairing them with themselves averaging out reward across 100 rollouts with horizon .
In each subgroup, we used 85% of the data for training the behavior cloning model, and 15% for validation. To learn the policy, we used a feed-forward fully-connected neural network with 2 layers of hidden size 64. We report the hyperparameters used in Table 1. We run each experiment with 5 different seeds, leading to 5 BC and 5 H models for each layout. We then manually choose one BC and one H
model based on the heuristic that the Hmodel should achieve slightly higher reward than the BC model – to make our usage of H as a human proxy more realistic (as we would expect BC to underperform compared to the expert demonstrator).
Behavior cloning, unlike all other methods in this paper, is trained on a manually designed -dimensional featurization the state to incentivize learning policies that generalize well in spite of the limited amount of human-human data. Such featurization contains the relative positions to each player of: the other player, the closest onion, dish, soup, onion dispenser, dish dispenser, serving location, and pot (one for each pot state: empty, 1 onion, 2 onions, cooking, and ready). It also contains boolean values encoding the agent orientation and indicating whether the agent is adjacent to empty counters. We also include the agent’s own absolute position in the layout.
To correct for a tendency of the learnt models to sometimes get stuck when performing low level action tasks, we added a hardcoded the behavior cloning model to take a random action if stuck in the same position for 3 or more consecutive timesteps. As far as we could tell, this does not significantly affect the behavior of the human models except in the intended way.
|Behavior cloning hyperparameters|
|Parameter||Cramped Rm.||Asym. Adv.||Coord. Ring||Forced Coord.||Counter Circ.|
Unlike behavior cloning, PPO and other DRL methods were trained with a lossless state encoding consisting of 20 masks, each a matrix of size corresponding to the environment terrain grid size. Each mask contains information about a specific aspect of the state: the player’s own position, the player’s own orientation, location of dispensers of various types, location of objects on counters, etc.
In order to speed up training, we shaped the reward function to give agents some reward when placing an onion into the pot, when picking up a dish while a soup is cooking, and when picking up a soup with a dish. The amount of reward shaping is reduced to 0 over the course of training with a linear schedule.
We parameterize the policy with a convolutional neural network with 3 convolutional layers (of sizes, , and respectively), each of which has 25 filters, followed by 3 fully-connected layers with hidden size 32. Hyperparameters used and training curves are reported respectively in Table 2 and Figures 8.
We use 5 seeds for our experiments, with respect to which we report all our standard errors.
|Parameter||Cramped Rm.||Asym. Adv.||Coord. Ring||Forced Coord.||Counter Circ.|
|Rew. shaping horizon||2.5e6||2.5e6||3.5e6||2.5e6||2.5e6|
To train PPO with an embedded human model we use the same network structure as in the PPO case in Appendix B and similar hyperparameters, reported in Table 3. As in the PPO case, we use reward shaping and anneal it linearly throughout training.
Empirically, we found that – for most layouts – agents trained directly with competent human models to settle in local optima, never developing good game-play skills and letting the human models collect reward alone. Therefore, on all layouts except Forced Coordination, we initially train in pure self-play, and then anneal the amount of self-play linearly to zero, finally continuing training purely with the human model. We found this to improve the trained agents’ performance. In Forced Coordination, both players need to learn game-playing skills in order to achieve any reward, so this problem doesn’t occur.
|PPO and PPO hyperparameters|
|Parameter||Cramped Rm.||Asym. Adv.||Coord. Ring||Forced Coord.||Counter Circ.|
|LR annealing factor||3||3||1.5||2||3|
|Rew. shaping horizon||1e6||6e6||5e6||4e6||4e6|
|Self-play annealing||[5e5, 3e6]||[1e6, 7e6]||[2e6, 6e6]||N/A||[1e6, 4e6]|
We trained population based training using a population of 3 agents, each of which is parameterized by a neural network trained with PPO, with the same structure as in C.
During each PBT iteration, all possible pairings of the 3 agents are trained using PPO, with each agent training on a embedded single-agent MDP with the other PPO agent fixed. PBT selection was conducted by replacing the worst performing agent with a mutated version of the hyperparameters. The parameters that could be mutated are lambda (initialized ), clipping (initialized ), learning rate (initialized ), gradient steps per minibatch per PPO update (initialized ), entropy coefficient (initialized ), and value function coefficient (initialized ). At each PBT step, each parameter had a chance of being mutated by either a factor of or (and clipped to the closest integer if necessary). For the lambda parameter, we mutate by where is the distance to the closest of or , to ensure that it will not go out of bounds.
As for the other DRL algorithms, we use reward shaping and anneal it linearly throughout training, and evaluate PBT reporting means and standard errors over 5 seeds. Hyperparameters and training reward curves are reported respectively in Table 4 and Figure 11.
|Parameter||Cramped Rm.||Asym. Adv.||Coord. Ring||Forced Coord.||Counter Circ.|
|Rew. shaping horizon||3e6||5e6||4e6||7e6||4e6|
|Env. steps per agent||8e6||1.1e7||5e6||8e6||6e6|
|PPO iter. timesteps||40000||40000||40000||40000||40000|
As mentioned in 4.3, to perform optimal planning we pre-compute optimal joint motion plans for every possible starting and desired goal location for each agent. This enables us to quickly query the cost of each motion plan when performing search.
We then define the high-level actions: “get an onion”, “serve the dish”, etc, and map each joint high-level action onto specific joint motion plans. We then use search to find the optimal joint plan in this high-level action space.
This planner does make some assumptions for computational reasons, making it near-optimal instead of optimal. In order to reduce the number of required joint motion plans by a factor of 16, we only consider position-states for the players, and not their orientations. This adds the possibility of wasting one timestep when executing certain motion plans, in order to get into the correct orientation. We have added a set of additional conditions to check for such a case and reduce the impact of such an approximation, but they are not general.
Another limitation of the planning logic is that counters are not considered when selecting high level action, as it would increase the runtime of by a large amount (since the number of actions available when holding an item would greatly increase). This is not of large importance in the two layouts we run planning experiments on. The use of counters in such scenarios is also minimal in human gameplay.
Another approximation made by the planner is only considering a 3 dish delivery look-ahead. Analyzing the rollouts, we would expect that increasing the horizon to 4 would not significantly impact the reward for the two layouts used in Section 5.
Given a fixed partner model, we implement a near-optimal model-based planner that plays with the fixed partner. The planner uses a two-layered search in which:
1) on a low level we use in the game state space with edges being basic player joint actions (one of which is obtained by querying the partner model). To reduce the complexity of such search, we remove stochasticity from the partner model by taking the argmax probability action.
2) on a higher level we use search in the state space in which edges are high level actions, similarly to those of the near-optimal joint planner described in Appendix E. Unlike in that case, it is unfeasible to pre-compute all low-level motion plans, as each motion plan does not only depend on the beginning positions and orientations of the agents, but also on other features of the state (since they could influence the actions returned by the partner model).
Due to computational constrains, when evaluating planning methods (such as in Figure 5), we evaluated on a horizon of 100 timesteps, and then multiplied by 4 to make the environment horizon comparable to all other experiments. This is another source of possible suboptimality in the planning experiments.
When observing Figure 5, we see that P+H performs much worse than the red dotted line (representing planning with respect to the actual test model H). This is due to the fact that in the planning experiments all agents are set to choose actions deterministically (in order reduce the planning complexity – as mentioned in appendix F), leading the agents to get often stuck in loops that last the whole remaining part of the trajectory, leading to little or no reward.
The human-AI trajectories were collected with a horizon of 400 timesteps. The agents used in this experiment were trained with slightly different hyperparameters than those in the previous appendices: after we had results in simulation and from this user study, we improved the hyperparameters and updated the simulation results, but did not rerun the user study.
After manually inspecting the collected human-AI data, we removed all broken trajectories (human not performing any actions, and trajectories shorted than intended horizon). We also noticed that in a large amount of trajectories, humans were extremely non-cooperative, not trying to perform the task well, and mainly just observing the AI agent and interacting with it (e.g. getting in its way). Our hypothesis was that these participants were trying to "push the boundaries" of the AI agents and test where they would break – as they were told that they would be paired with AI agents. We also removed these non-cooperative trajectories before obtaining our results. Cumulatively across all layouts, we removed 15, 11, and 15 trajectories of humans paired with PBT, PPO, and PPO agents respectively.
In Figure 12 we report human-AI performance without these trajectories removed. Performing an ANOVA on all the data with agent type as a factor and layout and player index as a covariates showed a significant main effect for agent type on reward (, ), and the post-hoc analysis with Tukey HSD corrections confirmed that PPO performed significantly better than for PBT (), while fell just short of statistical significance for SP (.
We also report the results of using various agents as predictive models of human behavior in Figure 13. This is the same setup as in Figure 7, except we are reporting accuracies here instead of cross-entropy losses.
Another thing to note is that in order to obtain Figure 7, to prevent numerical overflows in the calculation of cross-entropy for the PBT and PPO models, we lower-bounded the probability outputted by all models for the correct action to . This reduces the loss of all models, but empirically affects PBT and PPO the most, as they are the models that are most commonly confidently-incorrect in predicting the human’s action. We chose this as it is about 1 order of magnitude smaller than the smallest predictions assigned to the correct actions by the human models (i.e. the worst mistakes of the human models).