5.2.12 · D4Deep & Advanced RL

Exercises — Multi-agent reinforcement learning

2,215 words10 min readBack to topic

Parent: Multi-agent reinforcement learning. This page is a self-test ladder. Each problem is graded by cognitive level: L1 Recognition (can you name it?) → L2 Application (can you plug in?) → L3 Analysis (can you break it apart?) → L4 Synthesis (can you combine ideas?) → L5 Mastery (can you invent/prove?).

Every solution is hidden inside a collapsible callout — try first, then reveal. After each level there is a [!mistake] callout showing the trap most people fall into there.

Before we start, one reminder of notation so nothing here is used before it is defined:


Level 1 — Recognition

Recall Solution L1.1

The generalization is the Stochastic (Markov) Game: . The ingredient whose meaning changes most is the transition : it now depends on the joint action , not a single action. Rewards also become per-agent. When it collapses back to an MDP.

Recall Solution L1.2
  • (a) Fully cooperative — shared reward, .
  • (b) Fully competitive / zero-sum.
  • (c) Mixed / general-sum — each driver is self-interested yet crashes hurt everyone.
Recall Solution L1.3

It is replaced by a Nash Equilibrium: a joint policy where no agent gains by unilaterally deviating. We can't "just maximize reward" because there is no single reward — each agent has its own , and they may conflict. See Game Theory & Nash Equilibrium.


Level 2 — Application

Recall Solution L2.1

Your expected payoff for each pure move (Rock beats Scissors, loses to Paper): At a mixed NE you must be indifferent between your moves (else you'd shift all weight to the best one). Set them equal: With the unique solution is . By symmetry both players play and the game value = 0 (fair game). See figure below.

Figure — Multi-agent reinforcement learning
Recall Solution L2.2

Start from the single-agent Deterministic Policy Gradient and apply the chain rule through the critic: Because takes all actions as explicit inputs, its target is stationary — no hidden moving parts. See Policy Gradient Methods and Actor-Critic Methods.

Recall Solution L2.3

It is weighted by . As agent 2 learns, changes, so changes over time — the Markov property is violated for agent 1. This is exactly why Q-Learning's convergence proof breaks in MARL.


Level 3 — Analysis

Recall Solution L3.1

Say early on agent 2 mostly picked action A. Agent 1's buffer fills with transitions where "picking A → reward ", so agent 1 learns "A is good." Now agent 2 shifts to B. The pair that pays off is now , but agent 1's buffer still says "A good" — that data was generated under an old and is now stale/wrong. Agent 1 chases a target that no longer exists. Fix: a centralized critic conditions on both actions, so each transition is correctly explained and never becomes stale.

Recall Solution L3.2

Let each agent pick . Take any joint action . Change agents one at a time toward their local maximiser. Each such change raises (or keeps equal) that agent's , and since is non-decreasing in every , each change cannot lower . After all swaps we reach with . Hence is the global argmax. ∎ This is what lets decentralized greedy action selection match centralized greedy.

Recall Solution L3.3

Local maximisers: (value beats ). So IGM demands the joint argmax be . (a) Sum: values over are . Max at ✔ — IGM holds. (b) Product: . Max at ✘ — IGM violated. Cause: the product is not monotone when a (two negatives multiply to a large positive). That is exactly why QMIX forces non-negative mixing weights.


Level 4 — Synthesis

Recall Solution L4.1

Recipe (CTDE + factorization):

  1. Centralized training: use a joint critic so the target is stationary (all actions are explicit inputs). Kills non-stationarity.
  2. Monotonic mixing (QMIX): enforce so IGM holds and greedy decentralized action = centralized action.
  3. Decentralized execution: each agent acts with using only local observation — deployable without a coach.
  4. Replay hygiene: because the joint critic sees , stored transitions are no longer stale (contrast L3.1). Each step directly targets a failure mode we diagnosed above. See Self-Play for the competitive analogue.
Recall Solution L4.2

Let the row player play with probability , column player play with probability . Column player's indifference (make row's payoff independent of column's move) forces the row mix so that column is indifferent; by symmetry each plays . Check row payoff at : . NE: for both; value = 0.


Level 5 — Mastery

Recall Solution L5.1

Pure NE = joint actions where neither can improve alone.

  • : payoff . If either deviates to B alone → mismatch → . NE.
  • : payoff . Deviating alone → . NE.
  • : payoff ; deviating to match gives . Not NE. So there are two pure NE. is a NE yet Pareto-dominated by . Lesson: NE only guarantees no unilateral improvement, not global optimality — agents can get stuck in a worse equilibrium. This is why coordination (and Self-Play / communication) matters.
Recall Solution L5.2

Use . Partials and → monotone, and it's not a plain sum. Evaluate on the L3.3 grid ():

  • Max at = the per-agent argmaxes → IGM holds ✔. Any positive weights work; monotonicity is what matters, not the exact numbers.
Recall Solution L5.3

A pure profile is one deterministic move each, e.g. (Rock, Rock) → tie, payoff . But the column player can switch to Paper and get — a profitable unilateral deviation. Every pure profile has such a beating response (each move is beaten by exactly one other). Since some player can always deviate profitably, no pure NE exists. The best-response cycle Rock→Paper→Scissors→Rock never settles, so equilibrium must be mixed — recovering the answer of L2.1.