Entropy based Independent Learning in Anonymous Multi-Agent Settings
Tanvi Verma Pradeep Varakantham Hoong Chuin Lau






Entropy Based Independent Learning in Anonymous Multi-Agent Settings
    Tanvi Verma, Pradeep Varakantham and Hoong Chuin Lau

	School of Information Systems, Singapore Management University, Singapore 

	tanviverma.2015@phdis.smu.edu.sg, pradeepv@smu.edu.sg, hclau@smu.edu.sg 
    December 30, 2023
================================================================================================================================================================================================================


Efficient sequential matching of supply and demand is a problem of interest in many online to offline services. For instance, Uber, Lyft, Grab for matching taxis to customers; Ubereats, Deliveroo, FoodPanda etc for matching restaurants to customers. In these online to offline service problems, individuals who are responsible for supply (e.g., taxi drivers, delivery bikes or delivery van drivers) earn more by being at the "right" place at the "right" time. We are interested in developing approaches that learn to guide individuals to be in the "right" place at the "right" time (to maximize revenue) in the presence of other similar "learning" individuals and only local aggregated observation of other agents states (e.g., only number of other taxis in same zone as current agent).

Existing approaches in Multi-Agent Reinforcement Learning (MARL) are either not scalable (e.g., about 40000 taxis/cars for a city like Singapore) or assumptions of common objective or action coordination or centralized learning are not viable. 
A key characteristic of the domains of interest is that the interactions between individuals are anonymous, i.e., the outcome of an interaction (competing for demand) is dependent only on the number and not on the identity of the agents. We model these problems using the Anonymous MARL (AyMARL) model.  To ensure scalability and individual learning, we focus on improving performance of independent reinforcement learning methods, specifically Deep Q-Networks (DQN) and Advantage Actor Critic (A2C) for AyMARL. The key contribution of this paper is in employing principle of maximum entropy to provide a general framework of independent learning that is both empirically effective (even with only local aggregated information of agent population distribution) and theoretically justified.  

Finally, our approaches provide a significant improvement with respect to joint and individual revenue on a generic simulator for online to offline services and a real world taxi problem over existing approaches.  More importantly, this is achieved while having the least variance in revenues earned by the learning individuals, an indicator of fairness. 




§ INTRODUCTION

Systems that aggregate supply to ensure a better matching of demand and supply have significantly improved performance metrics in taxi services, food delivery, grocery delivery and other such online to offline services. These systems continuously and sequentially match available supply with demand. We refer to these problems as Multi-agent Sequential Matching Problems (MSMPs). For the individuals (taxi drivers, delivery boys, delivery van drivers) that are responsible for supply, learning to be at the "right" place at the "right" time is essential to maximizing their revenue. This learning problem is challenging because of:


  * Uncertainty about demand (which will determine the revenue earned) 

  * To ensure business advantage over competitors, centralized applications (e.g., Uber, Deliveroo, Lyft etc.) limit access for individuals to only aggregated and local information about the locations of other individuals (which will determine whether the demand is assigned to the current individual).


Given the presence of multiple selfish learning agents in MSMPs, Multi-Agent Reinforcement Learning (MARL) <cit.> is of relevance. In MARL, multiple agents are learning to maximize their individual rewards. There are two main issues with using MARL approaches in case of  sequential matching problems of interest: (a) The definition of fairness when learning for multiple agents is unclear as the agent actions may or may not be synchronised. Furthermore, agents can have different starting beliefs and demand is dynamic or non-stationary. (b) The scale of matching problems is typically very large (e.g., 40000 taxis in a small city like Singapore) and hence joint learning is computationally infeasible with no guarantee of convergence (due to non-stationarity).     

An orthogonal thread of MARL has focussed on teams of agents that maximize the global reward <cit.> or agents cooperate to achieve a common goal <cit.> or make assumptions of centralized learning <cit.>. The learning approaches are also limited in scalability with respect to the number of agents or the types of agents. More importantly, the problems of interest in this paper are focused on individual agents that are maximizing their own revenue rather than a team revenue and hence centralized learning is not viable. Therefore, this thread of MARL approaches are not suitable for MSMPs of interest in this paper.

Existing work <cit.> in MSMPs has employed Reinforcement Learning (RL) for each individual to learn a decision making policy. However, this line of work has assumed that other agents employ stationary and fixed strategies, rather than adaptive strategies. Due to the non-stationarity introduced when multiple agents learn independently, the performance of traditional table based Q-learning approaches is extremely poor. 

The use of deep neural networks has become hugely popular in the RL community <cit.>. 

In this paper, we improve the leading independent RL methods, specifically DQN (Deep Q-Networks) and A2C (Advantage Actor Critic) for solving problems of interest. Specifically:


  * Extending on past work on interaction anonymity in multi-agent planning under uncertainty <cit.>, we describe AyMARL for representing interaction anonymity in the context of MARL.  

  * To account for limited information about other agents states and actions while exploiting interaction anonymity, we  develop a framework for independent learning (in AyMARL) that employs principle of maximum entropy . 

  * We then use the independent learning framework to extend the leading single agent reinforcement learning approaches namely DQN (Deep Q-Network) and A2C (Advantage Actor-Critic) methods.  

  * To demonstrate the utility of our approaches, we performed extensive experiments on a synthetic data set (that is representative of many problems of interest) and a real taxi data set. We observe that our individual learners based on DQN and A2C are able to learn policies that are fair (minor variances in values of learning individuals) and most importantly, the individual and joint (social welfare) values of the learning agents are significantly higher than the existing benchmarks. 




§ MOTIVATING PROBLEMS (MSMPS)



This paper is motivated by Multi-agent Sequential Matching Problems (MSMPs) where there are multiple agents and there is a need for these agents to be matched to customer demand. Aggregation systems (Uber, Lyft, Deliveroo etc.) maximize the overall system wide revenue in MSMPs.  A key characteristic of these domains is that interactions between individual agents are anonymous. While there are many such domains, here we describe three popular MSMPs: 

Taxi Aggregation:
Companies like Uber, Lyft, Didi, Grab etc. all provide taxi supply aggregation systems. The goal is to ensure wait times for customers is minimal or amount of revenue earned is maximized by matching taxi drivers to customers.  However, these goals of the aggregation companies may not be correlated to the individual driver objective of maximizing their own revenue. The methods provided in this paper will be used to guide individual drivers to "right" locations at "right" times based on their past experiences of customer demand and taxi supply (obtained directly/indirectly from the aggregation company), while also considering that other drivers are learning simultaneously to improve their revenue. Interactions between taxi drivers are anonymous, because the probability of a taxi driver being assigned to a customer is dependent on the number of other taxi drivers being in the same zone (and not on specific taxis being in the zone) and customer demand.

Food or Grocery Delivery:
Aggregation systems have also become very popular for food delivery (Deliveroo, Ubereats, Foodpanda, DoorDarsh etc.) and grocery delivery (AmazonFresh, Deliv, RedMart etc.) services. They offer access to multiple restaurants/grocery stores to the customers and use services of delivery boys/delivery vans to deliver the food/grocery.  
 Similar to taxi case, there is anonymity in interactions as the probability of a delivery boy/van being assigned a job is dependent on number of other delivery boys/vans being in the same zone and customer demand. 

Supply Aggregation in Logistics:
More and more on-line buyers now prefer same day delivery services and tradition logistic companies which maximize usage of trucks, drivers and other resources are not suitable for it. Companies like Amazon Flex, Postmates, Hitch etc. connect shippers with travelers/courier personnel to serve same day/on-demand delivery requests. The courier personnel in this system can employ the proposed method to learn to be at "right" place at "right" time by learning from the past experiences. Interactions between couriers are anonymous due to dependence on number of other couriers (and not on specific couriers).



§ RELATED WORK

Researchers have proposed various methods to tackle the non-stationarity of the environment due to the presence of multiple agents. foerster2017stabilising provided multi-agent variant of importance sampling and proposed use of fingerprint to track the quality of other agents' policy to tackle the non-stationarity.  lanctot2017unified used a game-theoretic  approach to learn the best responses to a distribution over set of policies of other agents. 
Learning with Opponent-Learning Awareness (LOLA) was introduced by  foerster2017learning which explicitly accounts for the fact that the opponent is also learning. 
Another thread of work in multi-agent domains focus of centralized training with decentralized execution <cit.>, where actor-critic method is used with a central critic which can observe the joint state and actions of all the agents. These approaches require access to more information such as joint state, joint action, opponents' parameters, a centralized payoff table etc.,  which is not feasible for our problem domain where there are self interested agents. 

A comprehensive survey on MARL dealing with non-stationarity has been provided by  hernandez2017survey where based on how the algorithms cope up with the non-stationarity they are categorised into five groups: ignore, forget, respond to target opponents, learn opponent models and theory of mind. The first two categories do not represent other agents, while  the last three categories explicitly represent other agents (in increasing order of richness in models used to represent other agents). Our approach falls in the third category, where we respond to a summary (represented using the agent population distribution) of target opponent strategies. 

Mnih et al. mnih2016asynchronous and Haarnoja et al. haarnoja2017soft use policy entropy regularizer to improve performance of policy gradient approaches to Reinforcement Learning. Our approaches are also based on the use of entropy, however, there are multiple significant differences.  Policy entropy is entropy on policy that is relevant for single agent learning. We employ density entropy, which is entropy on joint state configuration in multi-agent settings. Unlike policy entropy which is a regularization term, considering density entropy requires fundamental changes to the network and loss functions (as explained in future sections). Policy entropy is used to encourage exploration, while density entropy helps in improving predictability of joint state configuration and reduces non-stationarity (by moving all learning agents to high entropy joint states) due to other agents' strategies. Finally, since policy entropy is for single agent exploration, it is complementary to density entropy. 



§ BACKGROUND: REINFORCEMENT LEARNING


In this section, we briefly describe the Reinforcement Learning (RL) problem and leading approaches (of relevance to this paper) for solving large scale RL problems. 

The RL problem for an agent is to maximize the long run reward while operating in an environment represented as a Markov Decision Process (MDP). Formally, an MDP is represented by the tuple ⟨S,A,T,R ⟩, where S is the set of states encountered by the agent, A is the set of actions, T(s,a,s') represents the probability of transitioning from state s to state s' on taking action a and R(s,a) represents the reward obtained on taking action a in state s. The RL problem is to learn a policy that maximizes the long term reward while only obtaining experiences (and not knowing the full reward and transition models) of transitions and reinforcements. An experience is defined as (s, a, s', r). 

We now describe three approaches that are of relevance to the work described in this paper. 



 §.§ Q-Learning


One of the most popular approaches for RL is Q-learning <cit.>, where the Q function is represented as a table (and initialised to arbitrary fixed values) with an entry in the table for each state and action combination. Q-values are updated based on each experience given by (s,a,s',r):

    Q(s,a) ←Q(s,a) + α [r + γ·max_a' Q (s',a') - Q(s,a)]
 
Where α is the learning rate and γ is the discount factor. To ensure a good explore-exploit tradeoff, an ϵ-greedy policy is typically employed. Q-learning is guaranteed to converge to the optimal solution for stationary domains <cit.>. 



 §.§ Deep Q-Networks (DQN)



Instead of a tabular representation for Q function employed by Q-Learning, the DQN approach <cit.> employs a deep network to represent the Q function. Unlike with the tabular representation that is exhaustive (stores Q-value for every state, action pair), a deep network predicts Q-values based on similarities in state and action features. This deep network for Q-values is parameterized by a set of parameters, θ and the goal is to learn values for θ so that a good Q-function is learnt. 

We learn θ using an iterative approach that employs gradient descent on the loss function. Specifically, the loss function at each iteration is defined as follows:
 
    ℒ_θ = 𝔼_(e ∼ U(𝒥)) [(y^DQN - Q(s,a;θ))^2]

where y^DQN = r + γmax_a' Q(s', a'; θ^-) is the target value computed by a target network parameterized by previous set of parameters, θ^-. Parameters θ^- are frozen for some time while updating the current parameters θ. To ensure independence across experiences (a key property required by Deep Learning methods to ensure effective learning), this approach maintains a replay memory 𝒥 and then experiences e ∼ U(𝒥) are drawn uniformly from the replay memory. 
Like with traditional Q-Learning, DQN also typically employs an ϵ-greedy policy. 



 §.§ Advantage Actor Critic (A2C)



DQN learns the Q-function and then computes policy from the learnt Q-function. A2C is a policy gradient method that directly learns the policy while ensuring that the expected value is maximized. To achieve this, A2C employs two deep networks, a policy network to learn policy, π(a|s;θ_p) parameterized by θ_p and a value network to learn value function of the computed policy, V^π(s; θ_v) parameterized by θ_v. 

The policy network parameters are updated based on the policy loss, which in turn is based on the advantage (A(s,a;θ_v)) associated with the value function. Formally, the policy loss is given by:
 

    ℒ_θ_p   = ∇_θ_plogπ(a|s;θ_p) A(s,a;θ_v)   where,
    
    
       A(s,a;θ_v) = R - V(s;θ_v)

Here R is the k-step discounted reward following the current policy and using a discount factor γ.



§ ANONYMOUS  MULTI-AGENT REINFORCEMENT LEARNING (AYMARL)


The generalization of MDP to the multi-agent case with special interested agents is the stochastic game model <cit.>. The underlying model in AyMARL is a specialization of the stochastic game model that considers interaction anonymity and is represented using the Dynamic Bayes Network (DBN) in Figure <ref>. Formally, it is represented using the tuple: 

    <𝒩, 𝒮, {𝒜_i}_i ∈𝒩, 𝒯, {ℛ_i}_i ∈𝒩>

𝒩 is the number of agents. 𝒮 is the set of states, which is factored over individual agent states in MSMPs. For instance in the taxi problem of interest, an environment state s is the vector of locations (zone) of all agents, i.e., s (∈𝒮) =  (z_1, …, z_i, …, z_𝒩).
𝒜_i is the action set of each individual agent. In case of the taxi problem, an action a_i (∈𝒜_i) represents the zone to move to if there is no customer on board.  

𝒯 is the transitional probability of environment states given joint actions. 

    p(s'|s, a) = 𝒯(s,a,s') = 𝒯(s, (a_1,…, a_𝒩), s')

As shown in the DBN of Figure <ref>, individual agent transitions are not dependent on other agents' states and actions directly but through agent population distribution, d. That is to say, given d, individual agent transitions are independent of each other in AyMARL. 

 
    p(s'|s, a)= ∏_i𝒯_i(z_i, a_i, z'_i, d_z_i(s))

where d_z_i (s) = #_z_i(s), is the number of agents in zone z_i in joint state s and d(s) = <d_z_1 (s),..., d_z_i (s),...d_z_𝒩 (s)>.  Equation <ref> can be rewritten in terms of p(d'(s'_-i) | d(s), a_-i), which is the probability of other agents (except agent i) having an agent population distribution d'(s'_-i) given current distribution d(s) and joint action of the other agents a_-i

    p(s'|s, a)=𝒯_i(z_i,a_i,z'_i, d_z_i(s)) · p(d'(s'_-i) | d(s), a_-i)

 
ℛ_i(s, a_i) is the reward obtained by agent i if the joint state is s and action taken by i is a_i. Like with transitions, as shown in DBN, agent rewards are independent given agent population distribution, d. In AyMARL,  it is given by ℛ_i(z_i, a_i, d_z_i(s)). 

Extensions to AyMARL:   For purposes of explainability, we will employ the  model described above in the rest of the paper. However, we wish to highlight that multiple extensions are feasible for AyMARL and can be readily addressed with minor modifications to learning approaches.  First extension is the dependence of transition and reward on d(s) (or some subset of d given by d_{z_j,z_k,…,}(s)) and not just on d_z_i(s). A second extension is considering dependence of transition and reward on agent state, action distributions and not just on agent population distributions.  That is to say, reward and transitions are dependent on d_z_i, a_i (s, a) or more generally d(s,a).



§ ENTROPY BASED INDEPENDENT LEARNING IN AYMARL


Due to the independent and selfish nature of agents (maximizing their own revenue) coupled with the lack of access to specific state and action information of other agents, we focus on independent learning approaches for AyMARL problems. In this section, we provide mathematical intuition and a general framework for independent learning based on the use of principle of maximum entropy in settings of interest. 
 
 Q-function expression for a given agent i in stochastic games <cit.> is given by: 

    𝒬_i(s, a)    = ℛ_i(s, a_i) + γ·∑_s' p(s'| s, a) ·max_a'𝒬_i(s', a')


In MSMPs of interest, individual agents (e.g., taxis, truck drivers or delivery boys) do not get access [Centralized entities (like Uber) decide the accessibility of state and action spaces. Typically, to avoid giving away key statistics to competitors, they do not reveal specific information of demand and supply to drivers and choose to reveal aggregate local statistics in the region of taxi driver.] to the joint state s, or joint action a. Q-function expression for an individual agent i that can observe number of other agents in the zone of agent i, i.e., d_z_i(s) in stochastic games setting will then be:

    𝒬_i(z_i, d_z_i(s), a_i)    = ℛ_i(z_i, d_z_i(s),a_i) + 
       γ∑_z'_i, d'_z'_i(s')[p(z'_i,d'_z'_i(s') | z_i, d_z_i(s), a_i)  
       · max_a'_i𝒬_i(z'_i, d^'_z'_i(s'),a'_i) ]

The above expression is obtained by  considering (z_i, d_z_i(s)) as the state of agent i in Equation <ref>. 

The probability term in Equation <ref> is a joint prediction of next zone and number of agents in next zone for agent i. Assuming a Naive Bayes approximation for p(z'_i,d'_z'_i(s') | z_i, d_z_i(s), a_i), we have:

    p(z'_i,d'_z'_i(s') | z_i, d_z_i(s), a_i)     ≈ p(z'_i | z_i, d_z_i(s), a_i) ·
       · p(d'_z'_i(s') | z_i, d_z_i(s), a_i)

While  the term p(z'_i | z_i, d_z_i(s), a_i) is stationary, the term 

p(d'_z'_i(s') | z_i, d_z_i(s), a_i) is non-stationary.  d'_z'_i(s') is dependent not only on action of agent i but also on actions of other agents (as shown in Figure <ref>) and hence p(d'_z'_i(s') | z_i, d_z_i(s), a_i) is non-stationary. 

Directly adapting the Q-learning expression of Equation <ref> to the settings of interest, we have:

    𝒬_i(z_i,    d_z_i(s), a_i) ←𝒬_i(z_i, d_z_i(s), a_i) + α [r + 
       γ·max_a'_i𝒬_i(z'_i, d_z'_i(s'), a'_i) - 𝒬_i(z_i, d_z_i(s), a_i) ]

Since a part of the transition dynamics are non-stationary, this Q value update results in significantly inferior performance (as shown in experimental results) for existing approaches (Q-learning, DQN, A2C).  This is primarily because prediction of d'_z'_i can become biased due to not representing actions of other agents. 
We  account for such non-stationarity by ensuring that prediction of d'_z'_i(s') does not get biased and all options for number of agents in a state (that are viable given past data) are feasible. 

The principle of maximum entropy <cit.> is employed in problems where we have some piece(s) of information about a probability distribution but not enough to characterize it fully. In fact, this is the  case with the underlying probability distribution of p(d'_z'_i(s') | z_i, d_z_i(s), a_i) for all z'_i or in other words normalized d'(s').   For purposes of easy explainability, we abuse the notation and henceforth refer to the normalized agent population distribution as d' ( i.e., ∑_z'_id'_z'_i = 1) corresponding to actual agent population distribution, d'(s'). 

The principle of maximum entropy states that the best model of a probability distribution is one that assigns an unbiased non-zero probability to every event that is not ruled out by the given data. Intuitively, anything that cannot be explained is assigned as much uncertainty as possible.  Concretely, when predicting a probability distribution, principle of maximum entropy requires that entropy associated with the distribution be maximized subject to the normalization (sum of all probabilities is 1) and known expected value constraints observed in data (for example average density d̅'_z' observed in K_z' experiences). In case of d', this corresponds to:

    max   -∑_z' d'_z' log(d'_z')     :: [Maximize Entropy]
    s.t.   ∑_z' d'_z' = 1     :: [Normalization]
       1/K_z'∑_k ∈ K_z' d'_z'(k)  = d̅'_z'   :: [Expected Value]


The key challenge is in performing this constrained maximization of entropy for normalized agent density distribution, d' along with a reinforcement learning method.  We achieve this by making two major changes to existing RL methods:

[MaximizeEntropy]: Including a term for entropy of d' referred to as ℋ_d' as part of the reward term. This will ensure entropy is maximized along with the expected value. 

 [Normalization]: Normalized prediction is achieved through softmax computation on p(d'_z'_i(s') | z_i, d_z_i(s), a_i) prediction. 

 [Expected Value]: We predict normalized d' given observed  experiences of d'_z'_i(s'). The objective of the prediction is to minimize mean square loss between predicted and observed value of d'_z'_i.  Due to minimizing mean square loss, we approximately satisfy the expected value constraint. 

In domains of interest, there are two other key advantages to constrained entropy maximization of d':
 

  * Controlling the non-stationarity: The domains mentioned in Section <ref> have reward/expected reward values that decrease with increasing number of agents (e.g., chances of taxis getting assigned to customers and hence earning revenue are higher when there are fewer taxis in the same zone) . Due to this property, it is beneficial for agents to spread out across zones with demand rather than assemble only in zones with high demand. In other words,  agents taking actions that will maximize the entropy of d' introduces predictability in agent actions and therefore reduces non-stationarity. 

  * Reduced variance in learned policies: In MSMPs, there is homogeneity and consistency in learning experiences of agents because the rewards (revenue model) and transitions (allocation of demand to individuals) are determined consistently by a centralized entity (e.g., Uber, Deliveroo ). The only non-stationarity experienced by an agent is due to other agent policies and/or potentially demand, so the impact of better predicting d' and controlling non-stationarity through maximizing entropy minimizes variance experienced by different learning agents.


Given their ability to handle non-stationarity better than tabular Q-learning, we implement this idea in the context of DQN <cit.> and A2C <cit.> methods. It should be noted that an experience e in AyMARL is more extensive than in normal RL and is given by (z_i, d_z_i, a_i, r_i, z'_i, d'_z'_i).



 §.§ Density Entropy based Deep Q-Networks, DE-DQN



We now operationalize the general idea of applying principle of maximum entropy in the context of Deep Q-Networks by modifying the architecture of the neural network and also the loss functions.  We refer to entropy for the predicted future agent population distribution as density entropy. We use d to denote the predicted density distribution while d is the true density distribution.

As indicated in Equation <ref>, there are three key considerations while applying principle of maximum entropy: (a) maximizing entropy alongside expected reward; (b) ensuring expected value of the computed distribution follows the expected observed samples of d'; and (c) finally ensure prediction of d' is normalized. We achieve these considerations using three key steps:


  * Including entropy in the Q-loss: This step enables us to maximize entropy alongside expected reward. The Q-loss, ℒ_θ^𝒬 is updated to include entropy of the predicted agent density for the next step, i.e., d'. Extending from the description of DQN in Section <ref>, ℒ_θ^𝒬 is given by:


    .86!ℒ_θ^𝒬 = 𝔼_(e ∼ U(𝒥))[(y^DE-DQN - 𝒬(z_i, d_z_i,a_i;θ))^2]


To maximize entropy of d' alongside the expected reward, the target value is: 

    .9!y^DE-DQN = r + βℋ_d' + γmax_a'_i𝒬(z'_i, d_z'_i, a'_i; θ^-)


Here ℋ is the density entropy and β is a hyperparameter which controls the strength of the entropy.  

  * Softmax on output layer: We modify the architecture of the neural network as shown in Figure <ref>. This involves introducing a new set of outputs corresponding to prediction of d'(s'). By computing softmax on the output, we ensure d' is normalized.

  * Introduce a new density loss, ℒ_θ^𝒟: This step enables us to minimize loss in prediction of agent density for the next step. Specifically, by minimizing loss we ensure that density entropy maximization occurs subject to observed samples of d'.  The independent learner (IL) agent gets to observe only the local density, d_z'_i(s') and not the full density distribution d'. Hence, we compute mean squared error (MSE) loss, ℒ^𝒟_θ for the local observation.


    ℒ_θ^𝒟 = 𝔼_(e ∼ U(𝒥)) [(d_z'_i -𝒟(z'_i|z_i, d_z_i, a_i;θ))^2]


𝒟(z_i,d_z_i, a_i; θ) is the density prediction vector and 𝒟(z'_i|z_i,d_z_i, a_i; θ) is the predicted density in zone z'_i if action a_i is taken in state (z_i, d_z_i). DE-DQN optimizes a single combined loss with respect to the joint parameter θ, ℒ_θ = ℒ_θ^𝒬 + λℒ_θ^𝒟. λ is the weightage term used for the density prediction loss. 




 §.§ Density Entropy based A2C, DE-A2C

Figure <ref> depicts how A2C network can be modified to DE-A2C network. Similar to DE-DQN, DE-A2C also considers density entropy in value function and  a density loss. In addition, DE-A2C has to consider policy network loss and this is the main difference between DE-A2C and DE-DQN. 

DE-A2C maintains a policy network π(.|z_i, d_z_i;θ_p) parameterized by θ_p and a value network parameterized  by θ_v. Value network maintains a value function output V(z_i,d_z_i;θ_v) and a density prediction output 𝒟(z_i,d_z_i, a_i; θ_v).  R is k-step return from the experience. While computing the value function loss ℒ_θ_v^V, density entropy is included as follows


    ℒ_θ_v^V = 𝔼_(e ∼ U(𝒥) [(R +  βℋ_d' - V(z_i,d_z_i;θ_v))^2]
 
Density prediction loss ℒ_θ_v^𝒟 can be computed as given in equations <ref>. The value network loss ℒ_θ_v is the combination of value loss and density loss, ℒ_θ_v = ℒ_θ_v^V + λℒ_θ_v^𝒟. Similarly, density entropy is included in the policy network loss as follows.

    ℒ_θ_p = 𝔼_(e ∼ U(𝒥) [∇_θ_plogπ (a_i|z_i, d_z_i;θ_p) 
     (R + βℋ_d' - V(z_i,d_z_i;θ_v))]




§ EXPERIMENTS

In this section, we demonstrate that our approaches that employ density entropy alongside Q-function or value function are able to outperform leading independent RL approaches (DQN, A2C, Q-Learning) on Multi-agent Sequential Matching Problems (MSMPs).  DQN, A2C and Q-Learning serve as lower bound baselines on performance. 
We also compare our results with Mean Field Q (MF-Q) learning algorithm <cit.> which is a centralized learning decentralized execution algorithm. MF-Q computes target values by using previous iteration's mean action (mean of actions taken by neighboring agents), but in our experimental domain the previous mean actions are different for different zones, hence we use the modified MF-Q algorithm (MMF-Q) where agents present in same zone are considered neighbors and previous iteration's mean actions of every zone is available to the all the learning agents. As MMF-Q agents have more information than our DE algorithms, it serves as the upper bound baseline on performance. 

We first provide results on a taxi simulator that is validated on a real world taxi dataset. Second, we provide results on a synthetic online to offline matching simulator (that is representative of problems in Section <ref>) under various conditions.


Taxi Simulator:
Figure <ref> shows the map of Singapore where road network is divided into zones.  First, based on the GPS data of a large taxi-fleet, we divided the map of Singapore into 111 zones <cit.>. Then we used the real world data to compute the demand between two zones and the time taken to travel between the zones. Since we focus on independent learners, our learning is very scalable. However, simulating thousands of learning agents at the same time requires extensive computer resources and with the academic resources available, we could not perform a simulation with thousands of agents. Hence, we computed proportional demand for 100 agents and simulated for 100 agents.   

Synthetic Online to Offline Service Simulator:  We generated synthetic data to simulate various combinations of demand and supply scenarios in online to offline service settings described in Section <ref>. We used grid world and each grid is treated as a zone. Demands are generated with a time-to-live value and the demand expires if it is not served within time-to-live time periods. Furthermore, to emulate the real-world jobs, the revenues are generated based on distance of the trip (distance between the origin and destination grids). There are multiple agents in the domain and they learn to select next zones to move to such that their long term payoff is maximized. At every time step, the simulator assigns a trip to the agents based on the agent population density at the zone and the customer demand. In our experiments, we make a realistic assumption that agents do not take action at every time step and they can go to any zone from any zone and time taken to travel between zones is proportional to the distance between the grids.
The revenue of an agent can be affected by features of the domain such as 


  * Demand-to-Agent Ratio (DAR): The average number of customers per time step per agent.

  * Trip pattern: The average length of trips can be uniform for all the zones or there can be few zones which get longer trips (for ex. airports which are usually outside the city) whereas few zones get relatively shorter trips (city center).

  * Demand arrival rate: The arrival rate of demand can be either static w.r.t. the time or it can vary with time (dynamic arrival rate).

We performed exhaustive experiments on the synthetic dataset where we simulated different combinations of these features.



 §.§ Implementation Details

For DQN algorithms we used Adam optimizer <cit.> with a learning rate of 1e-4, whereas for A2C algorithms we used RMSprop optimizer <cit.> with learning rate of 1e-5 for policy network and 1e-4 for value network. Two hidden layers were used with 256 nodes per layer. Both β and λ were set to 1e-2. To prevent the network from overfitting, we also used dropout layer with 50% dropout between hidden layers. For DQN algorithms, we performed ϵ-greedy exploration and ϵ was decayed exponentially. Training is stopped once ϵ decays to 0.05.




  §.§.§ Computing Density Entropy from Local Observation

The independent learner agent gets to observe only the local density, d_z'_i and not the full density distribution d'. This makes computing a cross-entropy loss (or any other relevant loss) for density prediction difficult. Hence, as shown in Equation <ref>, we compute MSE loss and to get normalized density prediction d', we apply softmax to the density output 𝒟(z_i, d_z_i, a_i;θ). Density entropy can be computed as ℋ_d' = - d' ·log(d')








 §.§ Results

We now benchmark the performance of our learning approaches (DE-DQN and DE-A2C) with respect to DQN, A2C and MMF-Q.  One evaluation period consists of 1000 (1e3) time steps[A time step represents a decision and evaluation point in the simulator.] and revenue of all the agents is reset after every evaluation period. All the graphs plotted in the upcoming sub-sections provide running average of revenue over 100 evaluation periods (1e5 time steps). 

We evaluated the performance of all learning methods on two key metrics: 

(1) Average payoff of all the individual ILs. This indicates social welfare. Higher values imply better performance.  

(2) Variation in payoff of individual ILs after the learning has converged. This is to understand if agents can learn well irrespective of their initial set up and experiences. This in some ways represents fairness of the learning approach.  We use box plots to show the variation in individual revenues, so smaller boxes are better.  


To provide a lower benchmark, we first compared our approaches with tabular Q-Learning. We also performed experiments with DQN and A2C algorithms when density input is not provided to the neural network. Figure <ref> shows the comparison between tabular Q-learning; DQN with and without agent density input and A2C with and without agent density input where we plot average payoff of all the ILs (social welfare). We used non-uniform trip pattern with DAR=0.6 for this experiment.
We can see that DQN with agent density input and A2C with agent density input perform significantly better than the other three algorithms. For other demand/supply experimental setups also we obtained similar results. Hence, for our remaining experiments we used DQN and A2C with agent density input as our lower baseline algorithm.

In Figure <ref> we empirically show that the MSE loss between predicted density d and true density distribution d converges to a low value (≈ 0.2).

For synthetic service simulator, we used multiple combinations of agent population and number of zones (20 agents-10 zones, 50 agents-15 zones, 50-agents-25 zones etc.). 
First plots in Figure <ref> provide comparison of average payoff of all the ILs for the respective experimental setups[The demand arrival rate is static and trip pattern is uniform for the experimental setups until stated otherwise.]. Second plots uses boxplots to show the variation in the individual average revenues after the learning has converged. Here are the key conclusions:


  * Experiment on real-world dataset (Figure <ref>) show that DE-DQN and DE-A2C outperformed DQN and A2C approaches by ≈10%.

  * For low DAR (Figure <ref>) there is no overall improvement in the social welfare which is expected as with too many agents and too less demand, random action of some or the other agent will serve the demand. However, the variance is lower than the baseline algorithms.

  * With increase in DAR, the performance gap starts increasing (≈ 7% for DAR=0.4, ≈10% for DAR=0.6 and ≈15% for DAR=0.75) 

  * DE-DQN and DE-A2C were able to perform as well as MMF-Q even with local observations on the real world dataset validated simulator.  Even on the synthetic simulator, the gap was quite small (about 5% for DAR=0.75). The gap is lesser for lower values of DAR. 

  * The variation in revenues was significantly[Differences between DE algorithm and their counterpart base algorithm are statistically significant at 5% level.] lower for DE-DQN and DE-A2C compared to other approaches, thus emphasizing no unfair advantage for any agents. 




§ CONCLUSION

Due to the key advantages of predicting agent density distribution (required for accurate computation of Q-value) and controlling non-stationarity (due to agents changing policies), our key idea of maximizing agent density entropy is extremely effective in Anonymous Multi Agent Reinforcement Learning settings. We were able to demonstrate the utility of our new approaches on a simulator validated on real world data set and two other generic simulators both with respect to overall value for all agents and fairness in values obtained by individual agents.



§ ACKNOWLEDGEMENTS

This research is supported by the National Research Foundation Singapore under its Corp Lab @ University scheme and Fujitsu Limited as part of the A*STAR-Fujitsu-SMU Urban Computing and Engineering Centre of Excellence.

aaai  
  

