AGAI-L05: Deep MARL, Part II

In short

Independent learners ignore each other; one central learner over the joint action does not scale. Centralised training with decentralised execution (CTDE) uses everyone’s information while learning and lets each agent act alone: a centralised critic with decentralised actors, or value decomposition into one utility per agent whose greedy actions give the best joint action (IGM), as a sum (VDN) or a monotonic mix (QMIX). Agents can also model the others’ policies, or shape how the others learn (LOLA). Similar agents can share one network (parameter sharing) or one pool of experience (experience sharing). For two-player zero-sum board games, Monte Carlo tree search plus self-play (AlphaZero) trains one policy against itself.

Feeds mock questions 23 (training modes), 24 (parameter sharing), 25 (agent models), 27 (experience against parameter sharing) and the open question 29 (homogeneous agents). Q22 and Q26 (independent DQN and independent REINFORCE) are in Lecture 4; Q28 (PSRO) is in Lecture 6.

Notation used throughout: is agent ‘s own observation history, is centralised information (anything beyond that is available in training: the global state, the joint history, the other agents’ observations), and are the actions of everyone except .

Who sees what, and when: training and execution modes

Training is optimising the policy and exploring; execution is selecting actions once the policy is in use. A phase is centralised when an agent uses centrally shared information of the others (joint history, observations, global state, joint policy), and decentralised when it relies only on its own experience. That gives three modes.

Centralised training and execution (CTCE). Shared information is used all the time.

  • Advantages: better coordination; in a partially observable stochastic game, pooling everyone’s observations removes much of the partial information.
  • Disadvantages: the joint action space grows exponentially with the number of agents; agents may be distributed entities by design, with no way to share a controller.

Decentralised training and execution (DTDE). No shared information at any point: independent learning, or agent modelling from one’s own observations.

  • Advantages: scales; works for distributed agents that cannot communicate.
  • Disadvantages: training suffers from non-stationarity; agents can settle in suboptimal equilibria; an agent cannot tell which changes are due to the other agents.

Centralised training with decentralised execution (CTDE). Shared information is used only during training; each trained policy needs only the agent’s own history. The standard example is an actor-critic with a centralised critic (training only) and decentralised actors (execution).

  • Advantages: no central controller at execution; suits distributed settings with limited runtime communication; training accounts for the interactions between agents, which improves coordination.
  • Disadvantages: centralised training can still be a bottleneck; coordination is hard when local information is not enough at execution.

Choosing a mode

Autonomous cars cannot exchange all their sensor data while driving, but a simulator provides all the data during training. Execution has to be decentralised, training can be centralised: CTDE. (“Decentralised training with centralised execution” is backwards: it drops shared information where it is free.)

See Centralised Training with Decentralised Execution. CTDE is applied to both families from Lecture 4: policy gradient methods (centralised critics) and value-based methods (value decomposition).

Centralised critics: CTDE for policy gradient

The single-agent policy gradient pushes up the log-probability of an action in proportion to how valuable it is. With several agents, the value of my action depends on what the others do at the same moment, so the evaluation uses the joint action:

Multi-agent policy gradient theorem

The evaluation conditions on the full history and the joint action; the policy conditions only on agent ‘s own history .

The evaluation is only needed to compute gradients during training, so it may use centralised information. The policy is what the agent carries into execution, so it stays decentralised. That split is CTDE. In the centralised actor-critic:

  • Actor : decentralised, used for execution.
  • Critic : takes the agent’s history plus centralised information , used only in training. Its advantage estimate drives the actor’s update, so the actor benefits from without ever seeing it.

Why is a CTDE version of REINFORCE rare? REINFORCE has no critic: it weights the gradient by the sampled return. Its only learned part is the policy, which must stay decentralised, so there is nowhere to put the centralised information.

Value critic or action-value critic. A centralised value critic outputs one number (MAPPO, A2C). A centralised action-value critic also takes the other agents’ actions as input and outputs one value per own action. It can say what would have happened had agent acted differently while the others kept their actions, which supports counterfactual reasoning.

Splitting the team value into utilities

A centralised action-value function over the joint action tackles three MARL problems: non-stationarity, coordination and partial observability. Two things remain in cooperative, common-reward games:

  • Credit assignment: one shared reward never says which agent’s action made the difference.
  • Execution still has to be decentralised, and a max over the joint action grows exponentially.

The ideal is one individual utility per agent, from its own history and action, such that every agent acting greedily on its own utility produces the optimal joint action. This is value decomposition. “Utility” because, once trained through the decomposition, it need not equal any real expected return: only its role in rebuilding the team value matters.

Individual-Global-Max (IGM) property

The joint action that maximises the joint action-value function equals the set of individual actions that maximise the individual utility functions. See Individual-Global-Max Property.

Why IGM matters, two implications:

  1. Decentralised execution: each agent can follow the greedy policy on its own utility, and together they play the greedy joint action.
  2. Efficiency: the greedy joint action is found by small maximisations (one per agent) instead of one over the exponentially many joint actions. Training needs this too, because every Q-learning target contains a max over the next joint action.

How to decompose in practice: linearly (VDN), monotonically (QMIX), or beyond both (QTRAN, named but not covered).

VDN: the team value as a sum

Value decomposition networks (VDN) assume the shared reward is a sum of individual (unobserved) reward terms, . By linearity of expectation the team value then splits into a sum too:

VDN

Learn agent-level utilities whose sum predicts the team value.

Training is DQN on the sum. All agents store transitions in one shared replay buffer; each acts ε-greedily on its own utility; the target is (just at a terminal state), and the loss is . The gradient flows through the sum into every agent’s network, so the networks themselves discover how to split the credit. A sum satisfies IGM: the max of a sum of separately chosen terms is the sum of their maxima.

A game VDN fits

Common reward: (A, A) = 1, (A, B) = (B, A) = 5, (B, B) = 9. VDN learns , , , . Every sum matches (, , and so on), both agents greedily pick B, and (B, B) is the best joint action.

Limitation: additivity is restrictive. Some tasks depend on specific combinations of actions, for example two agents that must choose matching actions to succeed. There the value of my action depends on the partner’s action, and a sum of individual values cannot capture that interaction.

QMIX: any monotonic mix

IGM does not need linearity. Monotonicity is enough: if raising any agent’s utility can never lower the joint value, then each agent maximising its own utility maximises the joint value.

QMIX

is the mixing network, monotonic in every utility.

QMIX is VDN with the sum replaced by a learned mix, in the target and in the estimate. The mixing weights come from a hypernetwork (a network that outputs another network’s weights) whose input is the centralised information , typically the global state. So the mix can change from state to state while staying monotonic. VDN is the special case where is the sum, so QMIX can represent everything VDN can, and more (it can combine utilities nonlinearly).

So QMIX is the answer to VDN’s restrictive additivity: a monotonic mix captures interactions between the agents that a plain sum cannot.

Limitation (MARL book, not in the lecture): monotonicity still cannot represent a game where one agent’s best action flips depending on the other agent’s action, such as a strict matching task. Both VDN and QMIX keep each agent’s preference over its own actions independent of what the others pick.

Modelling the other agents

Centralised critics and decompositions infer the other agents’ behaviour only implicitly, from training data. Agent modelling makes it explicit: model the other agents’ policies, so an agent can condition on them and adapt when their behaviour changes.

In deep joint-action learning, agent keeps one model per other agent :

  • Input: agent ‘s own observation history .
  • Output: a probability distribution over agent ‘s actions.
  • Training: supervised, on the actions was actually seen taking, with loss (“according to the model, are the observed actions likely?”).

Agent also learns a value over joint actions and scores its own action by averaging that value over what its models predict the others will do (MARL book). This costs extra networks per agent, and the agent must observe the others’ actions. In return it reacts to their current behaviour.

Shaping how the others learn: LOLA

Opponent shaping goes one step further: the others are learning, so steer their learning to your advantage. LOLA (Learning with Opponent-Learning Awareness) assumes the opponent will take its own gradient step, and differentiates its own return through that anticipated step:

A naive learner treats as fixed. LOLA’s extra term says how its own parameters change the opponent’s next update. It needs to know or estimate the opponent’s parameters and learning rule.

Many similar agents: sharing parameters or experience

Every method so far gives each agent its own network, and one DQN-sized network already has millions of parameters. When agents are similar, they can share. Agents are homogeneous when their policies can be interchanged while still preserving the overall result, regardless of which agent executes which policy.

Weakly and strongly homogeneous agents

  • Weakly homogeneous: for any joint policy, permuting the policies between agents leads to exactly the same outcomes (returns).
  • Strongly homogeneous: the optimal joint policy consists of identical policies for all agents.

One landmark or two

Two agents with the same actions and observations, and swapping their policies does not change the return. In environment A both must reach the same landmark: the optimal policies are identical, so A is strongly homogeneous. In environment B they must reach two different landmarks: the optimal policies differ (one agent per landmark), so B is only weakly homogeneous.

Parameter sharing (strongly homogeneous agents)

All agents use the same set of parameter values in their networks: one network instead of . Each agent runs its own copy on its own observations, so nothing is exchanged at execution. See Parameter Sharing.

  • Benefits: the number of parameters stays constant as agents are added; the shared parameters are updated with the experience of all agents, more diverse experience per update, which improves sample efficiency.
  • Limitation: all agents are constrained to the same policy. Agents with different observations still act differently, but in symmetric situations they act identically. In environment B a shared policy cannot reliably send the two agents to different landmarks. The usual fix (MARL book) is to add the agent index to each agent’s observation, so one network can behave differently per agent.

Experience sharing (weakly homogeneous agents)

Each agent keeps its own network, but all train on a centralised buffer of experiences collected by every agent. Weak homogeneity is what makes this valid: since swapping policies does not change outcomes, agent ‘s experience is relevant experience for agent .

  • Benefits: each agent learns from every agent’s experience, which improves sample efficiency; applies to less restrictive domains, because the learned policies can differ (environment B).
  • Limitation: more expensive, since there are still networks to train. On-policy algorithms need a correction when learning from another agent’s trajectories, because a different policy generated them (MARL book: importance sampling weights).

Large zero-sum games: search and self-play

The last setting: two-player zero-sum games with fully observable states and actions, the turn-taking board games chess, shogi, backgammon and Go. They are hard because of a sparse reward (win or lose only at the end), a large action space (many legal moves per position, a large branching factor) and a long horizon. Learning needs an efficient way to explore the game tree.

MCTS builds a partial tree from the current position by repeated simulations of the game, and keeps value estimates of the actions at each state it visits. Each simulation:

  1. Selection (and simulation): walk down the tree from the root, choosing an action at each node, until reaching a state not yet in the tree.
  2. Expansion: add that state as a new leaf. In plain MCTS a random rollout then plays the game to the end, giving an outcome .
  3. Backpropagation: send back up the visited path and update every on it:

counts how often was tried in , and the update keeps equal to the average outcome of the simulations through . Selection uses ε-greedy or UCB on these statistics (UCB prefers actions that look good or have been tried rarely), so effort concentrates on promising lines.

Self-play: AlphaZero

Self-play: the same policy chooses the actions for each agent, so the agent trains against itself. This needs agents with symmetrical roles that can build egocentric observations (the board from the mover’s side: “my pieces” and “the opponent’s pieces”), so one policy can play either side. Zero-sum board games usually fit: the agents are direct opponents with the same types of actions.

AlphaZero = MCTS + self-play + deep learning: a network guides the tree search, the games it plays against itself are the training data, and the improved network makes the next search stronger. How AlphaGo’s networks plug into MCTS, what happens when roles are not symmetric (population-based training, PSRO) and AlphaStar are in Lecture 6.

How the methods compare

MethodModeWhat is shared or centralisedWhat it addresses
Independent learnersDTDEnothingscalability
Centralised critic (A2C, MAPPO)CTDE in the criticnon-stationarity, coordination
VDNCTDEteam loss over a sumcredit assignment, IGM
QMIXCTDEteam loss, mix from same, richer than a sum
Agent modelsDTDEnothing (observes others’ actions)adapting to others
Parameter sharingCTDEone networkparameters, sample efficiency
Experience sharingCTDEone replay buffersample efficiency, distinct policies
MCTS + self-playself-playone policy for both sidessparse reward, huge game trees

What to be able to answer

  • Pick CTCE, DTDE or CTDE for a scenario; the advantages and disadvantages of each.
  • What a centralised critic sees and why the actor does not; why CTDE REINFORCE is rare.
  • IGM and its two implications; VDN (sum) and QMIX (monotonic mix, hypernetwork on ); what each cannot represent.
  • What a deep agent model learns (input, output, loss); LOLA in one line.
  • Weak and strong homogeneity; parameter sharing against experience sharing (mock Q29).
  • MCTS steps and update; what self-play needs.

Exam questions

Flashcards