arXiv is now an independent nonprofit! Learn more
License: arXiv.org perpetual non-exclusive license
arXiv:1810.00147v3 [cs.AI] 07 Mar 2019

M3RL: Mind-aware Multi-agent Management Reinforcement Learning

Tianmin Shu Thanks:  Work done while interning at Facebook AI Research. Affiliation: University of California, Los Angeles Email: tianmin.shu@ucla.edu    Yuandong Tian Affiliation: Facebook AI Research Email: yuandong@fb.com
Abstract

Most of the prior work on multi-agent reinforcement learning (MARL) achieves optimal collaboration by directly learning a policy for each agent to maximize a common reward. In this paper, we aim to address this from a different angle. In particular, we consider scenarios where there are self-interested agents (i.e., worker agents) which have their own minds (preferences, intentions, skills, etc.) and can not be dictated to perform tasks they do not want to do. For achieving optimal coordination among these agents, we train a super agent (i.e., the manager) to manage them by first inferring their minds based on both current and past observations and then initiating contracts to assign suitable tasks to workers and promise to reward them with corresponding bonuses so that they will agree to work together. The objective of the manager is to maximize the overall productivity as well as minimize payments made to the workers for ad-hoc worker teaming. To train the manager, we propose Mind-aware Multi-agent Management Reinforcement Learning (M3RL), which consists of agent modeling and policy learning. We have evaluated our approach in two environments, Resource Collection and Crafting, to simulate multi-agent management problems with various task settings and multiple designs for the worker agents. The experimental results have validated the effectiveness of our approach in modeling worker agents’ minds online, and in achieving optimal ad-hoc teaming with good generalization and fast adaptation.11 1 Code is available at https://github.com/facebookresearch/M3RL.

1 Introduction

As the main assumption and building block in economics, self-interested agents play a central roles in our daily life. Selfish agents, with their private beliefs, preferences, intentions, and skills, could collaborate (ad-hoc teaming) effectively to make great achievement with proper incentives and contracts, an amazing phenomenon that happens every day in every corner of the world.

However, most existing multi-agent reinforcement learning (MARL) methods focus on collaboration when agents selflessly share a common goal, expose its complete states and are willing to be trained towards the goal. While this is plausible in certain games, few papers address the more practical situations, in which agents are self-interested and inclined to show off, and only get motivated to work with proper incentives.

Refer to caption
Figure 1: Illustration of our problem setup. Workers have different skills (abilities for completing tasks) and preferences (which tasks they like) indicated by the bar charts. They are self-interested and perform the tasks they prefer the most. To achieve optimal collaboration, a manager has to first infer workers’ minds, and assigns right bonuses to workers for finishing specified tasks in the form of contracts. Consequently, workers will adjust their intentions and work together accordingly. E.g., workers in the figure initially all want to do task B. To finish all tasks, the manager has to pay more bonus to worker 1 and 2 so that they will perform A and C respectively.

In this paper, we try to model such behaviors. We have multiple workers and a manager, together to work on a set of tasks. The manager gets an external reward upon the completion of some tasks, or one specific task. Each worker has a skill set and preference over the tasks. Note that their skills and preferences may not align with each other (Fig. 1(a)), and are not known to the manager (Fig. 1(b)). Furthermore, manager may not get any external reward until a specific task is complete, which depends on other tasks.

By default, the self-interested workers simply choose the most preferred tasks, which is often unproductive from the perspective of the entire project. Therefore, the manager gives additional incentives in the form of contracts. Each contract assigns a goal and a bonus for achieving the goal to a worker. With the external incentives, workers may choose different goals than their preferences. Upon completion of assigned goals, the manager receives the rewards associated with those goals and makes the promised payments to the workers. To generate optimal contracts, the manager must infer the workers’ minds and learn a good policy of goal and reward assignment.

Conventional approaches of mechanism design tackle similar problems by imposing strong assumptions (e.g., skill/preference distributions, task dependencies, etc) to find an analytic solution. In contrast, we aim to train a manager using reinforcement learning to i) assess minds of workers (skills, preferences, intentions, etc.) on the fly, ii) to optimally assign contracts to maximize a collaborative reward, and iii) is adapted to diverse and even evolving workers and environments.

For this, we propose a novel framework – Mind-aware Multi-agent Management Reinforcement Learning (M3RL), which entails both agent modeling for estimating workers’ minds and policy learning for contract generation. For agent modeling, we infer workers’ identities by their performance history, and track their internal states with a mind tracker trained by imitation learning (IL). For contract generation, we apply deep reinforcement learning (RL) to learn goal and bonus assignment policies. To improve the learning efficiency and adaptation, we also propose high-level successor representation (SR) learning (Kulkarni et al. 2016) and agent-wise ϵ\epsilon-greedy exploration.

As a proof of concept, we evaluate our approach in two environments: Resource Collection and Crafting in 2D Minecraft, to simulate multi-agent management problems. The setup and underlying assumptions are designed to mimic real world problems, where workers are not compelled to reveal their true preferences and skills, and there may be dependency between tasks resulting in delayed and sparse reward signals. Workers may also be deceitful (e.g., accepting a contract even when the assigned goal is unreachable). Our experiments demonstrate that the manager trained by our approach can i) estimate the mind of each worker from the recent behaviors, ii) motivate the workers to finish less preferable or intermediate tasks by assigning the right bonuses, iii) is adaptive to changing teams, e.g., change of members and/or change of workers’ skills and preferences, iv) and has good generalization in different team sizes and novel environments.

We have conducted substantial ablation studies by removing the key components, including IL, SR, agent-wise ϵ\epsilon-greedy exploration, and performance history. Our approach shows a consistent performance in standard settings as well as in more challenging ones where workers’ policies are stochastic and sub-optimal, or there are multiple levels of bonuses required to motivate workers.

2 Related Work

Multi-agent reinforcement learning. For collaboration problems, common multi-agent reinforcement learning (Littman 1994; Busoniu et al. 2008) usually trains agents (Oliehoek et al. 2008; Foerster et al. 2016; Peng et al. 2017; Omidshafiei et al. 2017; Lowe et al. 2017) so that they will jointly maximize a shared reward. There also have been work on contributing different credits to agents by factorized value functions (Koller & Parr 1999; Guestrin et al. 2001; Sunehag et al. 2018; Rashid et al. 2018), but the spontaneous collaboration assumption is still required. In contrast, we instead train a manager to manage multiple self-interested workers for an optimal collaboration.

Principal-agent problems. Our problem setup is closely related to principal-agent problems (Laffont & Martimort 2002) (or moral hazard problems (Hölmstrom 1979)) in economics. Our manager and workers can be considered as the principal and agents respectively, where agents and principal have different objectives, and the principal needs to provide the right incentives to ensure that the agents make the best choices for what the principal delegates. These problems face similar technical challenges as our problem setup, e.g., information asymmetry between principals and agents, how to setup incentive cost, how to infer agents’ types, how to monitor their behaviors, etc. Traditional approaches in economics (Myerson 1982; Hölmstrom & Milgrom 1991; Sannikov 2008) build mathematical models to address these issues separately in stateless games, often with the assumption that the utility functions and the behavior patterns of the agents are known, leading to complicated models with many tunable parameters. In comparison, our paper provides a practical end-to-end computational framework to address this problem in a data-driven way without any assumption about the agents’ utilities and their decision making processes. Moreover, this framework is adaptive to changes of agents’ preferences and capabilities, which very few papers in economics have addressed. We also evaluate our approach in more complex game settings than the ones in the current economics literature.

Mechanism design. Similar to our problem setting, mechanism design also tackles problems where agents have different and private preferences (Myerson 1981; Conitzer & Sandholm 2002). Its core idea is to set up rules so that the agents will truthfully reveal their preferences for their own interests, and ultimately an optimal collective outcome can be achieved. Our work differs from mechanism design in several ways. First, in addition to preferences, we also acknowledge the fact that agents may have different skills. Second, mechanism design does not consider sequential decision problems, whereas we have to dynamically change the contracts over time.

Optimal reward design. The contract generation in our work can be seen as reward design. Some prior work has proposed optimal reward design approaches (Zhang et al. 2009; Zhang & Parkes 2008; Sorg et al. 2010; Ratner et al. 2018), where a teacher designs the best reward so that the student will learn faster or alter its policy towards the target policy. In contrast, we try to use deep RL to train optimal reward design policies to manage multi-agents in more complex tasks.

Meta-learning. Our work also resembles meta-learning (Wang et al. 2016; Finn et al. 2017), which typically aims at learning a meta strategy for multiple tasks (Maclaurin et al. 2015; Duan et al. 2017; Hariharan & Girshick 2017; Wichrowska et al. 2017; Yu et al. 2018; Baker et al. 2017) with good sample efficiency, or for a fast adaptation (Al-Shedivat et al. 2018). The meta-learning in this paper is for addressing the problem of ad-hoc teaming (Bowling & McCracken 2005; Stone et al. 2010) by training from a limited set of worker population.

Theory of Mind. Our agent modeling is inspired by the prior work on computational theory of mind, where both Bayesian inference (Baker et al. 2009) and end-to-end training (Rabinowitz et al. 2018) have been applied to understand a single agent’s decision making by inferring their minds. In this work, we extend this to optimal multi-agent management by understanding agents’ minds.

3 Problem Setup

In an environment, there is a set of goals 𝒢\mathcal{G} corresponding to several tasks, NN self-interested workers with different minds, and a manager which can observe workers’ behaviors but is agnostic of their true minds. Different from the common Markov game setting for MARL in prior work (Littman 1994), we use an independent Markov Decision Process (MDP), i.e., 𝒮i,𝒜i,Ri,𝒯i\langle\mathcal{S}_{i},\mathcal{A}_{i},R_{i},\mathcal{T}_{i}\rangle, iN\forall i\in N, to model each worker, where 𝒮i\mathcal{S}_{i} and 𝒜i\mathcal{A}_{i} are the state space and action space, Ri:𝒮i×𝒢iR_{i}:\mathcal{S}_{i}\times\mathcal{G}_{i}\rightarrow{\mathbb{R}} is the reward function, and 𝒯i:𝒮i×𝒜i𝒮i\mathcal{T}_{i}:\mathcal{S}_{i}\times\mathcal{A}_{i}\rightarrow\mathcal{S}_{i} is the state transition probabilities. For achieving goals, a worker has its own policy πi:𝒮i×𝒢i𝒜i\pi_{i}:\mathcal{S}_{i}\times\mathcal{G}_{i}\rightarrow\mathcal{A}_{i}. We define the key concepts in this work as follows.

Contract. A contract is a combination of goal and bonus assignment initiated by the manager to a specific worker. For simplicity, we consider discrete bonuses sampled from a finite set \mathcal{B}. Thus, for worker ii at time tt, it will receive a contract defined as (git,bit)(g_{i}^{t},b_{i}^{t}), where git𝒢g_{i}^{t}\in\mathcal{G} is the goal and bitb_{i}^{t}\in\mathcal{B} is the corresponding bonus for achieving the goal. Note that the contract will change over time.

Worker’s mind. We model a worker’s mind by its preferences, intentions, and skills. We do not study worker agents’ beliefs in this paper, which we leave as future work.

Preference. A worker’s preference is formally defined as its bounded internal utilities of achieving different goals, 𝒖i=(uig:g𝒢){\bm{u}}_{i}=(u_{ig}:g\in\mathcal{G}), where 0uigumax0\leq u_{ig}\leq u_{\text{max}}. Combined with received contract, the worker agent’s reward function can be defined as

rigt=Ri(sit,g)=(uig+𝟙(g=git)bit)𝟙(sit=sg),g𝒢.r_{ig}^{t}=R_{i}(s_{i}^{t},g)=(u_{ig}+\mathds{1}(g=g_{i}^{t})b_{i}^{t})\mathds{1}(s_{i}^{t}=s_{g}),\quad g\in\mathcal{G}. (1)

where sgs_{g} is the goal state.

Intention. The intention of a worker is the goal it is pursuing at any time, i.e., it𝒢\mathcal{I}_{i}^{t}\in\mathcal{G}, which is not fully revealed to the manager. Based on the reward defined in Eq. (1), there are multiple ways to choose the goal. For a rational worker who is clear about its skills, it will choose the goal by maximizing expected return. I.e., it=argmaxg𝔼[t=0γitrigt]\mathcal{I}_{i}^{t}=\argmax_{g}\mathbb{E}[\sum_{t=0}^{\infty}\gamma_{i}^{t}r_{ig}^{t}], where 0<γi10<\gamma_{i}\leq 1 is its discount factor. However, this requires a worker to have a good estimate of its skills and to be honest, which is not always true. E.g., a worker may want to pursue some valuable goal that it can not reach. So an alternative way is to maximize the utility instead: it=argmaxguig+𝟙(g=git)bit\mathcal{I}_{i}^{t}=\argmax_{g}u_{ig}+\mathds{1}(g=g_{i}^{t})b_{i}^{t}. This will make a worker’s behavior more deceptive as it may agree to pursue a goal but will rarely produce a fruitful result. In this work, we focus on the second way to achieve a more realistic simulation. After determine which goal to pursue, a worker will decide whether to sign the assigned contact. We denote this by dit{0,1}d_{i}^{t}\in\{0,1\}, where dit=1d_{i}^{t}=1 means that worker ii signs the contract given at time tt.

Skill. The skill of a worker is jointly determined by its state transition probabilities 𝒯i\mathcal{T}_{i} and its policy conditioned on its intention, i.e., πi(|sit,it)\pi_{i}(\cdot|s_{i}^{t},\mathcal{I}_{i}^{t}).

Manager’s objective. The manager in our setting has its own utility 𝒗=(vg:g𝒢){\bm{v}}=(v_{g}:g\in\mathcal{G}), where vg0v_{g}\geq 0 is the utility of achieving goal gg. To maximize its gain, the manager needs to assign contracts to workers optimally. For the sake of realism, we do not assume that the manager knows for sure if a worker agent is really committed to the assignment. The only way to confirm this is to check whether the goal achieved by the worker is consistent with its last assigned goal. If so, then the manager will gain certain reward based on its utility of that goal and pay the promised bonus to the worker. Thus, we may define the manager’s reward function as:

rt=RM(St+1)=g𝒢i=1N𝟙(sit+1=sg)𝟙(g=git)(vgbit),r^{t}=R^{M}(S^{t+1})=\sum_{g\in\mathcal{G}}\sum_{i=1}^{N}\mathds{1}(s_{i}^{t+1}=s_{g})\mathds{1}(g=g_{i}^{t})(v_{g}-b_{i}^{t}), (2)

where St+1={sit+1:i=1,,N}S^{t+1}=\{s_{i}^{t+1}:i=1,\cdots,N\} is the collective states of all present worker agents at time t+1t+1. The objective of the manager is to find optimal contract generation to maximize its expected return 𝔼[t=0γtrt]\mathbb{E}[\sum_{t=0}^{\infty}\gamma^{t}r^{t}], where 0<γ10<\gamma\leq 1 is the discount factor for the manager. Note that the manager may get the reward of a goal for multiple times if workers reach the goal respectively.

Population of worker agents. The trained manager should be able to manage an arbitrary composition of workers rather than only specific teams of workers. For this, we maintain a population of worker agents during training, and sample several ones from that population in each episode as the present workers in each episode. The identities of these workers are tracked across episodes. In testing, we will sample workers from a new population that has not been seen in training.

4 Approach

Figure 2: Overview of our network architecture.

Our approach has three main components as shown in Figure 2: i) performance history module for identification, ii) mind tracker module for agent modeling, and iii) manager module for learning goal and bonus assignment policies. We introduce the details of these three components as follows.

4.1 Performance History Module and Mind Tracker Module

To model a worker’s mind, we first need to infer its identity so that the manager can distinguish it from other agents. Previous work (Rabinowitz et al. 2018) typically identifies agents via their trajectories in recent episodes. This only works when diverse past trajectories of agents are available beforehand. However, this is impractical in our problem as the past trajectories of a worker depends on the manager’s policy, and thus are highly correlated and can hardly cover all aspects of that agent.

In this work, we propose performance history for agent identification, which is inspired by the upper confidence bound (UCB) algorithm (Auer et al. 2002) for multi-bandit arm (MAB) problems. Formally, the performance history of worker ii is a set of matrices i={𝑷it=(ρigbt):t=1,,T}{\mathbb{P}}_{i}=\{{\bm{P}}_{i}^{t}=(\rho_{igb}^{t}):t=1,\cdots,T\}, where 0ρigbt10\leq\rho_{igb}^{t}\leq 1 is an empirical estimation of the probability of worker ii finishing goal gg within tt steps after signing the contract if promised with a bonus of bb. We discuss how to update this estimate in Algorithm 1. These matrices are then flatten into a vector and we encode it to a history representation, hih_{i}, for worker ii.

With identification, the manager uses an independent mind tracker module with shared weights to update its belief of a worker’s current mental state online by encoding both current and past information: M(Γit,hi)M(\Gamma_{i}^{t},h_{i}), where Γit={(siτ,aiτ,giτ,biτ):τ=1,,t}\Gamma_{i}^{t}=\{(s_{i}^{\tau},a_{i}^{\tau},g_{i}^{\tau},b_{i}^{\tau}):\tau=1,\cdots,t\} is a trajectory of the worker’s behavior and the contracts it has received upon current time tt in the current episode.

4.2 Manager Module

For contract generation, the manager has to consider all present workers as a context. Thus, we encode each worker’s information and pool them over to obtain a context representation, i.e., ct+1=C({(sit+1,mit,hi):i=1,,N})c^{t+1}=C(\{(s_{i}^{t+1},m_{i}^{t},h_{i}):i=1,\dots,N\}). With both individual information and the context, we define goal policy, πg(|sit+1,mit,hi,ct+1)\pi^{g}(\cdot|s_{i}^{t+1},m_{i}^{t},h_{i},c^{t+1}), and bonus policy, πb(|sit+1,mit,hi,ct+1)\pi^{b}(\cdot|s_{i}^{t+1},m_{i}^{t},h_{i},c^{t+1}), for each worker.

In addition to learning policies for individual workers, we also want the manager to estimate the overall productivity of a team. A common choice in previous literature (e.g., Lowe et al. 2017) is to directly learn a centralized value function based on the context. However, this is not informative in our case, as the final return depends on achieving multiple goals and paying different bonuses. It is necessary to disentangle goal achievements, bonus payments, and the final net gain.

To this end, we adopt the idea of successor representation (SR) (Kulkarni et al. 2016; Zhu et al. 2017; Barreto et al. 2017; Ma et al. 2018), but use it to estimate the expectation of accumulated goal achievement and bonus payment in the future instead of expected state visitation. By defining two vectors ϕg(ct)\phi^{g}(c^{t}) and ϕb(ct)\phi^{b}(c^{t}) indicating goal achievement and bonus payment at time tt respectively, we may define our high-level SR, Φg\Phi^{g} and Φb\Phi^{b}, as Φg(ct)=𝔼[τ=0γτϕg(ct+τ)]\Phi^{g}(c^{t})=\mathbb{E}[\sum_{\tau=0}^{\infty}\gamma^{\tau}\phi^{g}(c^{t+\tau})] and Φb(ct)=𝔼[τ=0γτϕb(ct+τ)]\Phi^{b}(c^{t})=\mathbb{E}[\sum_{\tau=0}^{\infty}\gamma^{\tau}\phi^{b}(c^{t+\tau})]. We discuss the details in Appendix A.1.

4.3 Learning

For a joint training of these three modules, we use advantage actor-critic (A2C) (Mnih et al. 2016) to conduct on-policy updates, and learn SR similar to Kulkarni et al. 2016. In addition, we also use imitation learning (IL) to improve the mind tracker. In particular, we predict a worker’s policy based on its mental state representation, i.e., π^(|sit,git,bit,mit1)\hat{\pi}(\cdot|s_{i}^{t},g_{i}^{t},b_{i}^{t},m_{i}^{t-1}), which is learned by an additional cross-entropy loss for action prediction. Section A.2 summarizes the details. As our experimental results in Section 5 and Appendix C show, in difficult settings such as random preferences and multiple bonus levels, the policies based on the mental state representation trained with IL have a much better performance than the ones without it.

As the manager is agnostic of workers’ minds, it is important to equip the manager with a good exploration strategy to fully understand each worker’s skills and preferences. A common exploration strategy in RL is ϵ\epsilon-greedy, where an agent has a chance of ϵ\epsilon to take random actions. However, this may cause premature ending of contracts where a worker does not have sufficient amount of time to accomplish anything. Therefore, we adopt an agent-wise ϵ\epsilon-greedy exploration, where a worker has as a chance of ϵ\epsilon to be assigned with a random goal at the beginning of an episode and the manager will never change that goal assignment throughout the whole episode. In this way, it is easier for a manager to understand why or why not a worker is able to reach an assigned goal. The details can be seen from the rollout procedure (Algorithm 1) in Appendix B.

5 Experiments

5.1 General Task Settings

We introduce the general task settings as follows. Note that without additional specification, workers are implemented as rule-based agents (detailed in Appendix D.2).

(a) Resource Collection.
Refer to caption
(b) Crafting.
Figure 3: (a) Resource Collection environment, where the colored blocks are the resources and the arrows are the workers. (b) Crafting environment (left) and the recipe (right), where the numbers indicate item categories, and the colored block beside an item shows where this item can be crafted.

5.1.1 Resource Collection

In Resource Collection, the goals are defined as collecting certain type of resources. There are 4 types of resources on a map (Figure 3(a)) and the total quantity is 10. A worker can find any resources but only has the skills to dig out certain types of resources. Note that it may not be skilled at collecting its preferred resources. We consider three different settings:

  • S1: Each agent can collect up to three types of resources including its preferred type.

  • S2: Each agent can only collect one type of resource which may or may not be its preferred one.

  • S3: Similar to S2, except that an agent has a different random preference in each episode and thus its preference can not be inferred from history.

A worker can take five actions: “move forward”, “turn left”, “turn right”, “collect”, and “stop”, and its skill is reflected by the effect of taking the “collect’ action. For workers, the internal utility of a resource is 1 if it is preferred; otherwise it is 0. The manager receives a reward of 3 for every resource collected under the contracts, and can choose to pay a worker with a bonus of 1 or 2.

5.1.2 Crafting

Different from previous work (Andreas et al. 2017) where all items can be directly crafted from raw materials, we consider three-level recipes (Figure 3(b)): crafting a top-level item requires crafting certain intermediate item first. There are four work stations (colored blocks) for crafting the four types of items respectively. For the manager, each top-level item is worth a reward of 10, but collecting raw materials and crafting intermediate items do not have any reward. Note that certain materials are needed for crafting both top-level items, so the manager must strategically choose which one to craft. In each episode, there are raw materials sufficient for crafting one to two top-level items. All collected materials and crafted items are shared in a common inventory.

We define 8 goals including collecting raw materials and crafting items. Each worker prefers one of the collecting goals (the internal utility is 1), and is only capable of crafting one type of items. We expands the action space in Section 5.1.1 to include “craft”, which will only take effect if it has the ability of crafting the intended item and there are sufficient materials and/or intermediate items. The manager can choose a bonus from 0 to 2 for the contracts, where 0 means no employment.

5.2 Baselines

For comparison, we have evaluated the following baselines:

  • Ours w/o SR: Learning a value function directly w/o successor representations.

  • Ours w/o IL: Removing action prediction loss.

  • Temporal ϵ\epsilon-greedy: Replacing the agent-wise exploration with conventional ϵ\epsilon-greedy exploration.

  • Agent identification using recent trajectories: Encoding an agent’s trajectories in the most recent 20 episodes instead of its performance history, which is adopted from Rabinowitz et al. 2018.

  • UCB: Applying UCB (Auer et al. 2002) by defining the management problem as NN multi-armed bandit sub-problems, each of which is for a worker agent. In each MAB sub-problem, pulling an arm is equivalent to assigning a specific goal and payment combination to a worker agent (i.e., there are |𝒢||||\mathcal{G}|\cdot|\mathcal{B}| arms for each worker agent).

  • GT types known: Revealing the ground-truth skill and preference of each worker and removing the performance history module, which serves as an estimation of the upper bound performance.

5.3 Learning Efficiency

Refer to caption
(a) Resource Collection (S1)
Refer to caption
(b) Resource Collection (S2)
Refer to caption
(c) Resource Collection (S3)
Refer to caption
(d) Crafting
Figure 4: Learning curves of all approaches in Resource Collection and Crafting. The rewards here are not rescaled and we show results from 5 runs in all experiments.

During training, we maintain a population of 40 worker agents. In each episode, we sample a few of them (4 workers in Resource Collection and 8 workers in Crafting). All approaches we have evaluated follow the same training protocol. The learning curves shown in Figure 4 demonstrate that ours consistently performs the best in all settings, and its converged rewards are comparable to the one trained using ground-truth agent types as part of the observations. Moreover, in more difficult settings, e.g., S3 of Resource Collection and Crafting, the benefits of IL, SR, agent-wise ϵ\epsilon-greedy exploration, and the history representations based on the performance history are more significant. In particular, when there are tasks that do not have any reward themselves such as in Crafting, SR and IL appear to offer the most critical contributions. Without them, the network hardly gets any training signals. In all cases, the agent identification by encoding recent trajectories learns extremely slowly in Resource Collection and fails to learn anything at all in Crafting.

Refer to caption
(a) Resource Collection
Refer to caption
(b) Crafting
Figure 5: Comparison of the adaption capabilities of different exploration strategies during training. The dashed lines indicate the changing points of the worker agents’ skills. The histograms show how the skill distribution in the same population evolve over time.
Refer to caption
(a) Res. Collection (S1)
Refer to caption
(b) Res. Collection (S2)
Refer to caption
(c) Res. Collection (S3)
Refer to caption
(d) Crafting
Figure 6: Testing performance when old team members are constantly replaced by new ones.

5.4 Adaptation and Generalization

In real world scenarios, the population of worker agents and their skills may evolve over time, which requires the manager to continuously and quickly adapt its policy to the unforeseeable changes through a good exploration. Thus we compare our agent-wise ϵ\epsilon-greedy exploration with the temporal ϵ\epsilon-greedy exploration in two cases: i) training with a population where workers’ skills change drastically after 100,000 episodes (the manager does not know when and which workers’ skill sets have been updated), and ii) testing with a team where 75% of the workers will be replaced with new ones after every 2,000 episodes. Both strategies keep the same constant exploration coefficient, i.e., ϵ=0.1\epsilon=0.1. To have a better sense of the upper bound in the testing case, we also show the performance of the baseline that knows ground-truth agent information where no exploration is need. The results of the two cases are demonstrated in Figure 5 and in Figure 6 respectively.

In the first case, there are moments when the significant change in a population’s skill distribution (i.e., how many workers can reach a specific goal) will need the manager to greatly change its policy. E.g., the first two changes in Figure 5(a) result in new types of resources being collected; the changes in Figure 5(b) force the team to craft a different type of top-level item. In such cases, our agent-wise ϵ\epsilon-greedy exploration significantly improves the learning efficiency and increases the converged rewards. When the change is moderate, the policy learned by ours is fairly stable.

In the second case, the managers trained by the three methods achieve similar converged rewards in training. While the converged reward of our approach is slightly lower than the upper bound due to exploration, it allows the manager to quickly adapt itself to a new team where it has never seen the most team members. The temporal ϵ\epsilon-greedy on the other hand never achieves a comparable reward even though its performance is comparable to ours when managing a fixed population.

Refer to caption
(a) Res. Collection (S1)
Refer to caption
(b) Res. Collection (S2)
Refer to caption
(c) Res. Collection (S3)
Refer to caption
(d) Crafting
Figure 7: Average rewards when different numbers of worker agents are present. The policies are trained with 4 worker agents in Resource Collection and with 8 worker agents in Crafting.

We also want the manager’s policy to have good generalization in novel scenarios unseen in training, which, in our problems, has two aspects: i) generalization in different numbers of present worker agents, and ii) generalization in new environments. It can be seen from Figure 7 that as the number of workers increases, the manager achieves higher reward until it hits a plateau. Our approach consistently performs better in all settings. It even gains higher rewards than the one with ground-truth does when there are fewer workers. We also add a few walls to create novel environments unseen in training. With the additional obstacles, workers’ paths become more complex, which increases the difficulty of inferring their true minds. As suggested by Figure 8, the performance indeed decreases the most in S3 of Resource Collection where online intention inference is critical as the workers do not have fixed preferences.

Refer to caption
Figure 8: Testing in novel environments.
Refer to caption
Figure 9: Performance with random actions.

So far, we have only considered rule-based worker agents with deterministic plans. To see if our approach can handle stochastic and sub-optimal worker policies, we may randomize certain amount of actions taken by the workers (Figure 9) and train a manager with these random policies. When the randomness is moderate (e.g., 20%\leq 20\%), the performance is still comparable to the one without random actions. As randomness increases, we start to see larger decrease in reward. In Crafting specifically, random policies make the workers unlikely to achieve assigned goals within the time limit, thus the manager may never get top-level items if the policies are too random.

More results. In addition to the main experimental results discussed above, we further test our approach from different perspectives: i) showing the effect of the minimum valid period of a contract (i.e., constraints for the manager’s commitment), ii) multiple bonus levels, and iii) training RL agents as workers. We summarize these results in Appendix C.

6 Conclusions

In this paper, we propose Mind-aware Multi-agent Management Reinforcement Learning (M3RL) for solving the collaboration problems among self-interested workers with different skills and preferences. We train a manager to simultaneously infer workers’ minds and optimally assign contracts to workers for maximizing the overall productivity, for which we combine imitation learning and reinforcement learning for a joint training of agent modeling and management policy optimization. We also improve the model performance by a few techniques including learning high-level successor representation, agent-wise ϵ\epsilon-greedy exploration, and agent identification based on performance history. Results from extensive experiments demonstrate that our approach learns effectively, generalizes well, and has a fast and continuous adaptation.

References

  • Al-Shedivat et al. (2018) Maruan Al-Shedivat, Trapit Bansal, Yuri Burda, Ilya Sutskever, Igor Mordatch, and Pieter Abbeel. Continuous adaptation via meta-learning in nonstationary and competitive environments. In The Sixth International Conference on Learning Representations (ICLR), 2018.
  • Andreas et al. (2017) Jacob Andreas, Dan Klein, and Sergey Levine. Modular multitask reinforcement learning with policy sketches. In International Conference on Machine Learning (ICML), 2017.
  • Auer et al. (2002) Peter Auer, Nicolo Cesa-Bianchi, and Paul Fischer. Finite-time analysis of the multiarmed bandit problem. Machine Learning, 47(2-3):235–256, 2002.
  • Baker et al. (2017) Bowen Baker, Otkrist Gupta, Nikhil Naik, and Ramesh Raskar. Designing neural network architectures using reinforcement learning. In The Fifth International Conference on Learning Representations (ICLR), 2017.
  • Baker et al. (2009) Chris L Baker, Rebecca Saxe, and Joshua B Tenenbaum. Action understanding as inverse planning. Cognition, 113(3):329–349, 2009.
  • Barreto et al. (2017) André Barreto, Will Dabney, Rémi Munos, Jonathan J. Hunt, Tom Schaul, Hado van Hasselt, and David Silver. Successor features for transfer in reinforcement learning. In Advances in Neural Information Processing Systems (NIPS), 2017.
  • Bowling & McCracken (2005) Michael Bowling and Peter McCracken. Coordination and adaptation in impromptu teams. In The Twentieth National Conference on Artificial Intelligence (AAAI), 2005.
  • Busoniu et al. (2008) Lucian Busoniu, Robert Babuska, and Bart De Schutter. A comprehensive survey of multiagent reinforcement learning. IEEE Trans. Systems, Man, and Cybernetics, Part C, 38(2):156–172, 2008.
  • Conitzer & Sandholm (2002) Vincent Conitzer and Tuomas Sandholm. Complexity of mechanism design. In The Eighteenth conference on Uncertainty in artificial intelligence (UAI), 2002.
  • Duan et al. (2017) Yan Duan, Marcin Andrychowicz, Bradly Stadie, OpenAI Jonathan Ho, Jonas Schneider, Ilya Sutskever, Pieter Abbeel, and Wojciech Zaremba. One-shot imitation learning. In Advances in neural information processing systems (NIPS), pp. 1087–1098, 2017.
  • Finn et al. (2017) Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In International Conference on Machine Learning (ICML), 2017.
  • Foerster et al. (2016) Jakob Foerster, Ioannis Alexandros Assael, Nando de Freitas, and Shimon Whiteson. Learning to communicate with deep multi-agent reinforcement learning. In Advances in Neural Information Processing Systems (NIPS), 2016.
  • Guestrin et al. (2001) Carlos Guestrin, Daphne Koller, and Ronald Parr. Multiagent planning with factored mdps. In Advances in Neural Information Processing Systems (NIPS), 2001.
  • Hariharan & Girshick (2017) Bharath Hariharan and Ross Girshick. Low-shot visual recognition by shrinking and hallucinating features. In IEEE International Conference on Computer Vision (ICCV), 2017.
  • Hölmstrom (1979) Bengt Hölmstrom. Moral hazard and observability. The Bell journal of economics, pp. 74–91, 1979.
  • Hölmstrom & Milgrom (1991) Bengt Hölmstrom and Paul Milgrom. Multitask principal-agent analyses: Incentive contracts, asset ownership, and job design. Journal of Law, Economics, and Organization, 7:24–52, 1991.
  • Koller & Parr (1999) Daphne Koller and Ronald Parr. Computing factored value functions for policies in structured mdps. In International Joint Conference on Aritificial Intelligence (IJCAI), 1999.
  • Kulkarni et al. (2016) Tejas D. Kulkarni, Ardavan Saeedi, Simanta Gautam, and Samuel J Gershman. Deep successor reinforcement learning. arXiv preprint arXiv:1606.02396, 2016.
  • Laffont & Martimort (2002) Jean-Jacques Laffont and D. Martimort. The theory of incentives: the principal-agent model. Princeton University Press, 2002.
  • Littman (1994) Michael L Littman. Markov games as a framework for multi-agent reinforcement learning. In The 11th International Conference on Machine Learning (ICML), pp. 157–163, 1994.
  • Lowe et al. (2017) Ryan Lowe, Yi Wu, Aviv Tamar, Jean Harb, Pieter Abbeel, and Igor Mordatch. Multi-agent actor-critic for mixed cooperative-competitive environments. In Advances in Neural Information Processing Systems (NIPS, 2017.
  • Ma et al. (2018) Chen Ma, Junfeng Wen, and Yoshua Bengio. Universal successor representations for transfer reinforcement learning. arXiv preprint arXiv:1804.03758, 2018.
  • Maclaurin et al. (2015) Dougal Maclaurin, David Duvenaud, and Ryan P. Adams. Gradient-based hyperparameter optimization through reversible learning. In International Conference on Machine Learning (ICML), 2015.
  • Mnih et al. (2016) Volodymyr Mnih, Adria Puigdomenech Badia, Mehdi Mirza, Alex Graves, Timothy Lillicrap, Tim Harley, David Silver, and Koray Kavukcuoglu. Asynchronous methods for deep reinforcement learning. In International Conference on Machine Learning (ICML), 2016.
  • Myerson (1981) Roger B. Myerson. Optimal auction design. Mathematics of operations research, 6(1):58–73, 1981.
  • Myerson (1982) Roger B. Myerson. Optimal coordination mechanisms in generalized principal–agent problems. Journal of mathematical economics, 10(1):67–81, 1982.
  • Oliehoek et al. (2008) Frans A. Oliehoek, Matthijs TJ Spaan, and Nikos Vlassis. Optimal and approximate q-value functions for decentralized pomdps. Journal of Artificial Intelligence Research, 32:289–353, 2008.
  • Omidshafiei et al. (2017) Shayegan Omidshafiei, Jason Pazis, Christopher Amato, Jonathan P. How, and John Vian. Deep decentralized multi-task multi-agent reinforcement learning under partial observability. In International Conference on Machine Learning (ICML), 2017.
  • Peng et al. (2017) Peng Peng, Ying Wen, Yaodong Yang, Yuan Quan, Zhenkun Tang, Haitao Long, and Jun Wang. Multiagent bidirectionally-coordinated nets emergence of human-level coordination in learning to play starcraft combat games. arXiv preprint arXiv:1703.10069, 2017.
  • Rabinowitz et al. (2018) Neil C. Rabinowitz, Frank Perbet, H. Francis Song, Chiyuan Zhang, S.M. Ali Eslami, and Matthew Botvinick. Machine theory of mind. arXiv preprint arXiv:1802.07740, 2018.
  • Rashid et al. (2018) Tabish Rashid, Mikayel Samvelyan, Christian Schroeder de Witt, Gregory Farquhar, Jakob Foerster, and Shimon Whiteson. Qmix: Monotonic value function factorisation for deep multi-agent reinforcement learning. In International Conference on Machine Learning (ICML), 2018.
  • Ratner et al. (2018) Ellis Ratner, Dylan Hadfield-Menell, and Anca D. Dragan. Simplifying reward design through divide-and-conquer. In Robotics: Science and Systems (RSS), 2018.
  • Sannikov (2008) Yuliy Sannikov. A continuous-time version of the principal-agent problem. The Review of Economic Studies, 75(3):957–984, 2008.
  • Sorg et al. (2010) Jonathan Sorg, Richard L. Lewis, and Satinder P. Singh. Reward design via online gradient ascent. In Advances in Neural Information Processing Systems (NIPS), 2010.
  • Stone et al. (2010) Peter Stone, Gal A. Kaminka, Sarit Kraus, and Jeffrey S. Rosenschein. Ad hoc autonomous agent teams: Collaboration without pre-coordination. In The Twenty-Fourth Conference on Artificial Intelligence (AAAI), 2010.
  • Sunehag et al. (2018) Peter Sunehag, Guy Lever, Audrunas Gruslys, Wojciech Marian Czarnecki, Vinicius Zambaldi, Max Jaderberg, Marc Lanctot, Nicolas SOnnerat, Joel Z. Leibo, Karl Tuyls, and Thore Graepel. Value-decomposition networks for cooperative multi-agent learning based on team reward. In International Conference on Autonomous Agents and MultiAgent Systems (AAMAS), 2018.
  • Tieleman & Hinto (2012) Tijmen Tieleman and Geoffrey Hinto. Lecture 6.5—rmsprop: Divide the gradient by a running average of its recent magnitude. COURSERA: Neural Networks for Machine Learning, 2012.
  • Wang et al. (2016) Jane X Wang, Zeb Kurth-Nelson, Dhruva Tirumala, Hubert Soyer, Joel Z Leibo, Remi Munos, Charles Blundell, Dharshan Kumaran, and Matt Botvinick. Learning to reinforcement learn. arXiv preprint arXiv:1611.05763, 2016.
  • Wichrowska et al. (2017) Olga Wichrowska, Niru Maheswaranathan, Matthew W Hoffman, Sergio Gomez Colmenarejo, Misha Denil, Nando de Freitas, and Jascha Sohl-Dickstein. Learned optimizers that scale and generalize. arXiv preprint arXiv:1703.04813, 2017.
  • Yu et al. (2018) Tianhe Yu, Chelsea Finn, Annie Xie, Sudeep Dasari, Pieter Abbeel, and Sergey Levine. One-shot imitation from observing humans via domain-adaptive meta-learning. In Robotics: Science and Systems (RSS), 2018.
  • Zhang & Parkes (2008) Haoqi Zhang and David Parkes. Value-based policy teaching with active indirect elicitation. In AAAI Conference on Artificial Intelligence (AAAI), 2008.
  • Zhang et al. (2009) Haoqi Zhang, David C. Parkes, and Yiling Chen. Policy teaching through reward function learning. In The 10th ACM conference on Electronic commerce, 2009.
  • Zhu et al. (2017) Yuke Zhu, Daniel Gordon, Eric Kolve, Dieter Fox, Li Fei-Fei, Abhinav Gupta, Roozbeh Mottaghi, and Ali Farhadi. Visual semantic planning using deep successor representations. In International Conference on Computer Vision (ICCV), 2017.

Appendix A Details of Approach

A.1 High-level Successor Representation

We define two vectors indicating the goal achievement and bonus payment at time tt: ϕg(ct)=(i𝟙(sit+1=sg)𝟙(git=g):g𝒢)\phi^{g}(c^{t})=(\sum_{i}\mathds{1}(s_{i}^{t+1}=s_{g})\mathds{1}(g_{i}^{t}=g):g\in\mathcal{G}) and ϕb(ct)=(i𝟙(sit+1=sgit)𝟙(bit=b):b)\phi^{b}(c^{t})=(\sum_{i}\mathds{1}(s_{i}^{t+1}=s_{g_{i}^{t}})\mathds{1}(b_{i}^{t}=b):b\in\mathcal{B}). Let 𝒘=(b:b){\bm{w}}=(b:b\in\mathcal{B}) be the weights for different bonus payments, then the reward for the manager at the current moment can be written as rt=𝒗ϕg(ct)𝒘ϕb(ct)r^{t}={{\bm{v}}}^{\top}\phi^{g}(c^{t})-{\bm{w}}^{\top}\phi^{b}(c^{t}). Following the typical SR definition, we define our high-level SR as

Φg(ct)=𝔼[τ=0γτϕg(ct+τ)],\Phi^{g}(c^{t})=\mathbb{E}\left[\sum_{\tau=0}^{\infty}\gamma^{\tau}\phi^{g}(c^{t+\tau})\right], (3)

and

Φb(ct)=𝔼[τ=0γτϕb(ct+τ)].\Phi^{b}(c^{t})=\mathbb{E}\left[\sum_{\tau=0}^{\infty}\gamma^{\tau}\phi^{b}(c^{t+\tau})\right]. (4)

Thus, the value function can be written as

V(ct)=𝒗Φg(ct)𝒘Φb(ct).V(c^{t})={{\bm{v}}}^{\top}\Phi^{g}(c^{t})-{\bm{w}}^{\top}\Phi^{b}(c^{t}). (5)

A.2 Details of Learning

The policy gradient for the goal assignment is:

θgJ(θg)=1Ni=1Nθg[logπg(git|sit,mit1,hi,ct;θg)A(ct)+λ(πg)],\nabla_{\theta_{g}}J(\theta_{g})=\frac{1}{N}\sum_{i=1}^{N}\nabla_{\theta_{g}}\left[\log\pi^{g}(g_{i}^{t}|s_{i}^{t},m_{i}^{t-1},h_{i},c^{t};\theta_{g})A(c^{t})+\lambda\mathcal{H}(\pi^{g})\right], (6)

where A(ct)A(c^{t}) is the advantage estimation defined as A(ct)=τ=0γτrt+τ(𝒗Φg(ct)𝒘Φb(ct))A(c^{t})=\sum_{\tau=0}^{\infty}\gamma^{\tau}r^{t+\tau}-({\bm{v}}^{\top}\Phi^{g}(c^{t})-{\bm{w}}^{\top}\Phi^{b}(c^{t})) and ()\mathcal{H}(\cdot) is the entropy regularization weighted by the constant λ=0.01\lambda=0.01 for encouraging exploration. Similarly, the policy gradient for the bonus assignment is

θbJ(θb)=1Ni=1Nθb[logπb(bit|sit,mit1,hi,ct;θb)A(ct)+λ(πb)].\nabla_{\theta_{b}}J(\theta_{b})=\frac{1}{N}\sum_{i=1}^{N}\nabla_{\theta_{b}}\left[\log\pi^{b}(b_{i}^{t}|s_{i}^{t},m_{i}^{t-1},h_{i},c^{t};\theta_{b})A(c^{t})+\lambda\mathcal{H}(\pi^{b})\right]. (7)

The successor representations may be updated by the following gradient:

θΦg12(τ=0γτϕg(ct+τ)Φg(ct,θϕg))2+θΦb12(τ=0γτϕb(ct+τ)Φb(ct,θϕb))2.\nabla_{\theta_{\Phi^{g}}}\frac{1}{2}\left(\sum_{\tau=0}^{\infty}\gamma^{\tau}\phi^{g}(c^{t+\tau})-\Phi^{g}(c^{t};\theta_{\phi^{g}})\right)^{2}+\nabla_{\theta_{\Phi^{b}}}\frac{1}{2}\left(\sum_{\tau=0}^{\infty}\gamma^{\tau}\phi^{b}(c^{t+\tau})-\Phi^{b}(c^{t};\theta_{\phi^{b}})\right)^{2}. (8)

For imitation learning, we use the following cross-entropy loss:

IL=𝔼[1Ni=1Nlogπ^(ait|sit,git,bit,mit1)].\mathcal{L}_{\text{IL}}=\mathbb{E}\left[-\frac{1}{N}\sum_{i=1}^{N}\log\hat{\pi}(a_{i}^{t}|s_{i}^{t},g_{i}^{t},b_{i}^{t},m_{i}^{t-1})\right]. (9)

Note that the gradient from IL will be combined with Eq. 6, Eq. 7, and Eq. 8 to update corresponding parameters (see Algorithm 2 in Appendix B for details).

In tasks where there the unknown dependency may introduce a large cost in the beginning of training, the manager’s exploration may be restricted as the policy becomes too conservative in spending, which is common in many real world scenarios. To encourage exploration in these tasks, we adopt a two-phase learning curriculum. Namely, we optionally conduct a warm-up phase before the standard learning described above. In this warm-up phase, we give loans to the manager to cover its cost (i.e., setting the total payments to be zero when optimizing the networks). In practice, we apply this only to Crafting, where we set a fixed number of episodes at the beginning of training to be the warm-up phase. Note that this only apply to the optimization; we still need to deduct the payments from the rewards as the actually outcomes (this is equivalent to paying back the loans).

Appendix B Pseudo Code of Our Algorithms

We summarize the rollout algorithm and the learning algorithm in Algorithm 1 and Algorithm 2 respectively.

Algorithm 1 Rollout(Tmax,Tc,ϵ,{i:i=1,,N}T_{\text{max}},T_{c},\epsilon,\{{\mathbb{P}}_{i}:i=1,\cdots,N\})
1: Maximum steps TmaxT_{\text{max}}, commitment constraint TcT_{c}, exploration coefficient ϵ\epsilon, and the performance history of the present worker agents {i:i=1,,N}\{{\mathbb{P}}_{i}:i=1,\cdots,N\}
2: Trajectories of all workers {ΓiT:i=1,,N}\{\Gamma_{i}^{T}:i=1,\cdots,N\}, and the rewards for the manager RR
3: Initialize the environment
4: Set performance history update rate η=0.1\eta=0.1.
5: t0t\leftarrow 0
6: Γi1\Gamma_{i}^{1}\leftarrow\emptyset, i=1,,N\forall i=1,\cdots,N
7: repeat
8:   Observe current states (sit,ait)(s_{i}^{t},a_{i}^{t}), i=1,,N\forall i=1,\cdots,N, from the environment
9:   Encode i{\mathbb{P}}_{i} to hih_{i}, i=1,,N\forall i=1,\cdots,N
10:   if t=0t=0 then
11:    for i=1,,Ni=1,\cdots,N do
12:      Γi0\Gamma_{i}^{0}\leftarrow\emptyset
13:      Sample a random goal gi0𝒢g_{i}^{0}\sim\mathcal{G}, and set a minimum bonus bi0b_{i}^{0} as the initial contract.
14:      eiU(0,1)e_{i}\sim U(0,1)
15:      Assign the contract (gi0,bi0)(g_{i}^{0},b_{i}^{0}) to worker ii and receive ditd_{i}^{t} (signing decision)
16:      τidit\tau_{i}\leftarrow d_{i}^{t}
17:      Γit{(sit,ait,git,bit)}\Gamma_{i}^{t}\leftarrow\{(s_{i}^{t},a_{i}^{t},g_{i}^{t},b_{i}^{t})\}
18:    end for
19:    rt0r^{t}\leftarrow 0
20:   else
21:    rt=g𝒢i=1N𝟙(sit=sg)𝟙(g=git1)(vgbit1)r^{t}=\sum_{g\in\mathcal{G}}\sum_{i=1}^{N}\mathds{1}(s_{i}^{t}=s_{g})\mathds{1}(g=g_{i}^{t-1})(v_{g}-b_{i}^{t-1})
22:    mit1M(Γit1,hi)m_{i}^{t-1}\leftarrow M(\Gamma_{i}^{t-1},h_{i}), i=1,,N\forall i=1,\cdots,N
23:    ctC({(sit,mit1,hi):i=1,,N})c^{t}\leftarrow C(\{(s_{i}^{t},m_{i}^{t-1},h_{i}):i=1,\dots,N\})
24:    for i=1,,Ni=1,\cdots,N do
25:      τi=τi\tau^{\prime}_{i}=\tau_{i}
26:      if (t1)%Tc0(t-1)\%T_{c}\neq 0 or ei<ϵe_{i}<\epsilon then # Commitment constraint and agent-wise ϵ\epsilon-greedy
27:       gitgit1g_{i}^{t}\leftarrow g_{i}^{t-1}
28:      else
29:       Sample a new goal gitπg(|sit,mit1,hi,ct)g_{i}^{t}\sim\pi^{g}(\cdot|s_{i}^{t},m_{i}^{t-1},h_{i},c^{t})
30:       τiτi𝟙(git=git1)\tau_{i}\leftarrow\tau_{i}\mathds{1}(g_{i}^{t}=g_{i}^{t-1})
31:      end if
32:      Sample a new bonus bitπb(|sit,mit1,hi,ct)b_{i}^{t}\sim\pi^{b}(\cdot|s_{i}^{t},m_{i}^{t-1},h_{i},c^{t}) (w/ temporal ϵ\epsilon-greedy)
33:      Assign the contract (git,bit)(g_{i}^{t},b_{i}^{t}) to worker ii and receive ditd_{i}^{t}
34:      τiτi+dit\tau_{i}\leftarrow\tau_{i}+d_{i}^{t}
35:      ΓitΓit1{(sit,ait,git,bit)}\Gamma_{i}^{t}\leftarrow\Gamma_{i}^{t-1}\cup\{(s_{i}^{t},a_{i}^{t},g_{i}^{t},b_{i}^{t})\}
36:      if τi>τi\tau^{\prime}_{i}>\tau_{i} or sit=sgit1s_{i}^{t}=s_{g_{i}^{t-1}} then # the last contract was accepted and has been terminated now
37:       ρigt1bt1τi(1η)ρigt1bt1τi+η𝟙(sit=sgit1)\rho_{ig^{t-1}b^{t-1}}^{\tau^{\prime}_{i}}\leftarrow(1-\eta)\rho_{ig^{t-1}b^{t-1}}^{\tau^{\prime}_{i}}+\eta\mathds{1}(s_{i}^{t}=s_{g_{i}^{t-1}})
38:      end if
39:    end for
40:   end if
41:   RR{rt}R\leftarrow R\cup\{r^{t}\}
42:   tt+1t\leftarrow t+1
43: until t=Tmaxt=T_{\text{max}} or the task is finished
44: TtT\leftarrow t
Algorithm 2 Learning Algorithm
1: Initialize parameters
2: Set the maximum steps of an episode to be TmaxT_{\text{max}}, maximum training episodes to be NtrainN_{\text{train}}, and the number of worker agents in an episode to be NN
3: The coefficient for the agent-wise ϵ\epsilon-greedy exploration to be ϵ\epsilon
4: Initialize a population of worker agents and set their performance history {\mathbb{P}} to be all zeros.
5: for i=1,,Nmaxi=1,\cdots,N_{\text{max}} do
6:   Sample NN worker agents from the training population and obtain their performance history {i:i=1,,N}\{{\mathbb{P}}_{i}:i=1,\cdots,N\}
7:   # Run an episode
8:   {ΓiT:i=1,,N},RRollout(Tmax,Tc,ϵ,{i:i=1,,N})\{\Gamma_{i}^{T}:i=1,\cdots,N\},R\leftarrow\text{Rollout}(T_{\text{max}},T_{c},\epsilon,\{{\mathbb{P}}_{i}:i=1,\cdots,N\})
9:   Update parameters based on the IL loss IL\mathcal{L}_{IL} defined in Eq. (9) and the gradients defined Eq. (6), Eq. (7), and Eq. (8) jointly.
10: end for

Appendix C More Experimental Results

C.1 Constraining the Manager’s Commitment

Refer to caption
(a) Res. Collection (S1)
Refer to caption
(b) Res. Collection (S2)
Refer to caption
(c) Res. Collection (S3)
Refer to caption
(d) Crafting
Figure 10: Learning curves in three settings of Resource Collection and in Crafting when applying different commitment constraints for the manager. The numbers indicate how many steps a contract must holds.

The manager’s commitment is defined as the shortest time a contract must remain unchanged, which essentially constrains how frequent the manager can change its goal and bonus assignment. While short-term commitment allows the manager to quickly update contracts once it has a better mind estimation or once a goal has been reached, long-term commitment often leads to a more accurate skill assessment when the tasks are difficult (e.g., crafting high-level items depends on the results of other tasks and thus needs a longer time). This is supported by the results in Figure 10: shorter commitment works better in Resource Collection while Crafting needs a longer commitment. Note that the commitment constraint is 1 step and 10 steps for Resource Collection and Crafting respectively in all other experiments.

C.2 Multiple Bonus Levels

Refer to caption
(a) Res. Collection (3 skills)
Refer to caption
(b) Res. Collection (1 skill)
Refer to caption
(c) Crafting
Figure 11: Learning curves when there are multiple bonus levels. In (a), a worker can reach 3 goals; in (b), a worker can reach 1 goal; in (c), a worker can collect raw materials and craft one type of items.

In previous experiments, the internal utility of goals for a worker agent is either 0 or 1. Here, we sample the internal utility from 0 to 3. Consequently, the manager needs to select the right bonus from multiple choices to pay each worker (i.e., a bonus from 1 to 4 for Resource Collection and a bonus from 0 to 4 for Crafting). In Resource Collection, the manager will get a reward of 5 for every collected resource; in crafting, the reward for a top-level item is still 10. As shown in Figure 11, the advantage of our approach is even more significant compared to the ones in single payment level.

C.3 RL Agents as Workers

Refer to caption
Figure 12: Comparing training with rule-based worker agents and with RL worker agents in Resource Collection.

Finally, we train a population of 40 RL worker agents for Resource Collection, where each one is trained with only one goal, and for each goal we train 10 agents using different random seeds. This creates a population with similar skill distributions as in S2, but with very different policies. Figure 12 suggests that training to manage RL agents is slower as their policies are less predictable and less rational, but our approach can still gradually learn a good policy whose performance is comparable to the one using rule-based worker agents.

Appendix D Implementation Details

D.1 Network Architecture

Performance History Module. We flatten the matrices in worker’s performance history i{\mathbb{P}}_{i} and concatenate them together to get a single vector. We then encode this vector into a 128-dim history representation hih_{i}.

Mind Tracker Module. We represent the state of a worker by multiple channels corresponding to different types of items. We also use four channels to indicate its orientation. We augment the state with additional |𝒜𝒢||\mathcal{A}||\mathcal{G}||\mathcal{B}| channels, where a channel is either all ones or all zeros for indicating the action it takes, and the goal and bonus it receives. We then encode the state into a 128-dim hidden state by a convolutional layer with 64 channels and kernels of 1×11\times 1, a fully connected (FC) layer (128-dim), and an LSTM with 128 hidden units. We fuse this vector with the history representation hih_{i}. Specifically, we adopt an attention-based mechanism for the fusion, where we first get an attention vector (128-dim) from the history representation by an FC layer with sigmoid activation, and then do element-wise product between the attention vector and the hidden state from the LSTM. The fused vector becomes mitm_{i}^{t}. This can be formally written as mit=f(it,hi)=itσ(hi)m_{i}^{t}=f(\ell_{i}^{t},h_{i})=\ell_{i}^{t}\odot\sigma(h_{i}), where σ()\sigma(\cdot) is an FC layer with sigmoid activation, it\ell_{i}^{t} is the hidden state from the LSTM, and \odot is element-wise product. We fuse it with the state using the same mechanism: f(ϕ(sit+1,git+1,bit+1),mit)=ϕ(sit+1,git+1,bit+1)σ(mit)f(\phi(s_{i}^{t+1},g_{i}^{t+1},b_{i}^{t+1}),m_{i}^{t})=\phi(s_{i}^{t+1},g_{i}^{t+1},b_{i}^{t+1})\odot\sigma(m_{i}^{t}), where ϕ(sit+1,git+1,bit+1)\phi(s_{i}^{t+1},g_{i}^{t+1},b_{i}^{t+1}) is the state encoding. By feeding the fused vector to an FC layer with softmax activation, we may get the predicted worker policy.

Manager Module. For each worker, we concatenate its mind representation and history representation together and fuse it with the worker’s state using the attention-based mechanism where the attention vector comes from the concatenated vector. By pooling over these fused vectors of individual workers, we can get the context vector, from which we construct the two successor representations by two separate FC layers. Here, we use average pooling, but one may also use other pooling mechanisms. Finally, for each worker, we concatenate the context vector with its fused vector we obtained before pooling, and consequently get the goal policy and bonus policy by two FC layers with softmax activation.

All modules are trained with RMSProp (Tieleman & Hinto 2012) using a learning rate of 0.0004.

D.2 Rule-based Worker Agents

Each rule-based worker finds a shortest path to the nearest location related to a goal, and its skill is defined as the post effect of its “collect” and “craft” actions. In particular, for collecting certain resource/material, it will go to the closest one that has the same type as the goal indicates and is currently not being collected by other agents, whereas for crafting an item, it will go to the corresponding work station if it is currently unoccupied. If a worker can perform collecting tasks, then after it takes “collect” action, the item will be collected from the map and appears in the inventory; otherwise no real effect will appear. This applies to crafting tasks as well, except in crafting, task dependencies must also be satisfied before “craft” action can take real effect.

When considering random actions, for each step, we sample a random action with the specified chance to replace the action from the rule-based plan.

D.3 RL Worker Agents

We implement all RL worker agents using the same network architecture, where an agent’s state is augmented by additional channels to include the reward for each goal (i.e., |𝒢||||\mathcal{G}||\mathcal{B}| channels). We use a convolution layer with 64 channels and kernels of 1×11\times 1 to encode the state, and feed it to an 128-dim FC layer and then an LSTM with a 128-dim hidden state. We then predict the policy using an FC layer with softmax activation based on the hidden state from the LSTM. For each goal, we train 10 RL worker agents using 10 random seeds. For each episode, we randomly assign a reward from bb\in\mathcal{B} to an agent as the hypothetical reward it may receive from a manager. We then set the corresponding channel to be all ones and set the remaining |𝒢|||1|\mathcal{G}||\mathcal{B}|-1 channels to be all zeros. Note that we assume all RL workers have the ability to perform “collect” and “craft” actions.