Skip to content
advanced

Markov Games and Moving Learning Targets in Multi-Agent RL

The game never changes. Your experience of it changes every time another agent updates.

Published 2026-10-02Updated 2026-10-0413 min read
From below of long thin identical blue cables connected to small round electrical connectors
From below of long thin identical blue cables connected to small round electrical connectors. Photo by Brett Sayles on Pexels.

The game never changes. Your experience of it changes every time another agent updates.

That contradiction is the whole subject of this article. A Markov game is a fixed mathematical object: the transition kernel and reward functions are written down once and stay put. But the process a single learner actually samples from is a marginal of that object, and the marginal is computed through other agents' policies. When those policies move, the marginal moves. The tuple is constant. The induced process is not.

If you have already internalized that other learners make the environment non-stationary, you have the intuition. What you probably do not yet have is the derivation that says exactly which term carries the time dependence. That is what follows.

The Game Is Fixed. Your Experience Is Not.

Start with the visible symptom. A Q-target that was accurate for the last thousand gradient steps is now wrong. Nothing in the environment code changed. No bug was introduced. The reward function is the same function. The transition table is the same table. And yet the regression target has drifted.

The weak model most people reach for is: multi-agent non-stationarity means the environment is noisy or random. That model is wrong in a way that matters. Randomness is stationary. A fixed probability distribution over outcomes does not move; it just refuses to be predicted. If the environment were merely stochastic, standard single-agent theory would still apply, and your Q-learning would still converge. It does not.

The stronger model is this: the game's transition and reward functions are fixed functions of the joint action. Your learner never conditions on the joint action. It conditions on its own action and observes the consequence. So it experiences a marginal of the true dynamics, and that marginal is a weighted average over the other agents' actions, weighted by their policies. When their policies change, the weights change, and the marginal changes with them.

One sentence: the tuple is constant, the induced process is not, and the gap between them is the entire problem.

Notation: The Markov Game Tuple

Before anything moves, let us fix what does not. A Markov game for NN agents is the tuple

M=⟨S,{Ai}i=1N,P,{Ri}i=1N,γ,H⟩\mathcal{M} = \langle \mathcal{S}, \{\mathcal{A}_i\}_{i=1}^{N}, P, \{R_i\}_{i=1}^{N}, \gamma, H \rangle

where:

  • S\mathcal{S} is the shared state space.
  • Ai\mathcal{A}_i is agent ii's action space. The joint action space is the product A=A1×⋯×AN\mathcal{A} = \mathcal{A}_1 \times \cdots \times \mathcal{A}_N, and a joint action is written a=(a1,…,aN)a = (a_1, \dots, a_N).
  • P(s′∣s,a)P(s' \mid s, a) is the transition kernel. Its domain is the joint action. This is the single most important structural fact in the whole article: the kernel does not accept a single agent's action as an argument.
  • Ri(s,a)R_i(s, a) is agent ii's reward. It is a function of the joint action, which is why your payoff is not fully under your control.
  • γ\gamma is the discount factor, HH the horizon.

Each agent's policy maps states to distributions over its own actions: πi(ai∣s)\pi_i(a_i \mid s). The joint policy is the product π(a∣s)=∏j=1Nπj(aj∣s)\pi(a \mid s) = \prod_{j=1}^{N} \pi_j(a_j \mid s). Agent ii's value function under a joint policy is

Viπ(s)=Eπ[∑t=0HγtRi(st,at) | s0=s].V_i^{\pi}(s) = \mathbb{E}_{\pi}\left[\sum_{t=0}^{H} \gamma^t R_i(s_t, a_t) \,\middle|\, s_0 = s\right].

Read that expectation subscript carefully. It is taken under π\pi, the joint policy. Agent ii's value is a function of every other agent's policy parameters, not just its own. Those parameters are not noise. They are arguments.

Note: This article assumes full observability of the shared state, simultaneous action selection, and a common state variable. Partial observability changes the formal object — you would be working with a partially observable stochastic game — and the marginalization argument below would need to be redone over belief states. That is out of scope here.

Knowledge check

Check your understanding

Answer this question before you continue.

In the Markov game tuple, what action input does the transition kernel P(s′ | s, a) take?
Single Choice

Focus: Identify the action variables on which a Markov game's transition kernel is defined.

Marginalizing Out the Other Agents

Here is the derivation the article exists to deliver. Write a−ia_{-i} for the joint action of all agents except ii, and π−i(a−i∣s)=∏j≠iπj(aj∣s)\pi_{-i}(a_{-i} \mid s) = \prod_{j \neq i} \pi_j(a_j \mid s) for their joint policy.

Step 1. The true transition depends on the full joint action:

P(s′∣s,ai,a−i).P(s' \mid s, a_i, a_{-i}).

Step 2. Agent ii does not choose a−ia_{-i} and does not observe it. From its perspective, the next state is a random variable whose distribution is obtained by averaging over the others' actions, weighted by how likely they are to take them:

Piπ−i(s′∣s,ai)=∑a−iπ−i(a−i∣s) P(s′∣s,ai,a−i).P_i^{\pi_{-i}}(s' \mid s, a_i) = \sum_{a_{-i}} \pi_{-i}(a_{-i} \mid s) \, P(s' \mid s, a_i, a_{-i}).

Step 3. The same marginalization applies to the reward:

Riπ−i(s,ai)=∑a−iπ−i(a−i∣s) Ri(s,ai,a−i).R_i^{\pi_{-i}}(s, a_i) = \sum_{a_{-i}} \pi_{-i}(a_{-i} \mid s) \, R_i(s, a_i, a_{-i}).

Step 4. Name the result. Both Piπ−iP_i^{\pi_{-i}} and Riπ−iR_i^{\pi_{-i}} are functions of the other agents' policy parameters. If those parameters carry a time index — and they do, because they are being updated — then the effective transition and reward inherit that index:

Piπ−i(t)(s′∣s,ai),Riπ−i(t)(s,ai).P_i^{\pi_{-i}^{(t)}}(s' \mid s, a_i), \qquad R_i^{\pi_{-i}^{(t)}}(s, a_i).

That superscript is the moving target. It is not a metaphor. It is a term in the equation.

Interpretation. The marginal is a weighted average, so it moves smoothly when policies move smoothly. But it can move sharply when a policy collapses onto one action: if πj\pi_j becomes nearly deterministic, the weights concentrate, and the effective transition can jump discontinuously from one mixture to another. This is why some multi-agent runs degrade gradually and others fall off a cliff.

A Worked Example

Two side-by-side snapshots show the same fixed transition probabilities to X: 0.9 when the opponent chooses L and 0.2 when it chooses R. The opponent’s weights change from 0.5/0.5 to 0.9/0.1, shifting the learner’s marginal probability of X from 0.55 to 0.83.
The joint-action kernel stays fixed; changing the opponent’s policy changes the weighted transition the learner experiences.

Two agents, two actions each. Agent ii chooses ai∈{L,R}a_i \in \{L, R\}. The opponent chooses aj∈{L,R}a_j \in \{L, R\}. The true transition kernel, for a fixed state ss and agent ii's action ai=La_i = L, is:

aja_jP(s′=X∣s,L,aj)P(s' = X \mid s, L, a_j)P(s′=Y∣s,L,aj)P(s' = Y \mid s, L, a_j)
LL0.90.1
RR0.20.8

Now suppose the opponent's policy is πj(L∣s)=0.5\pi_j(L \mid s) = 0.5. The effective transition is:

Pi(s′=X∣s,L)=0.5⋅0.9+0.5⋅0.2=0.55.P_i(s' = X \mid s, L) = 0.5 \cdot 0.9 + 0.5 \cdot 0.2 = 0.55.

The opponent learns. Its policy shifts to πj(L∣s)=0.9\pi_j(L \mid s) = 0.9. The same state, the same action LL, produces:

Pi(s′=X∣s,L)=0.9⋅0.9+0.1⋅0.2=0.83.P_i(s' = X \mid s, L) = 0.9 \cdot 0.9 + 0.1 \cdot 0.2 = 0.83.

Nothing about the game changed. The kernel is the same table. But the distribution agent ii samples from moved from 0.550.55 to 0.830.83 for an identical (s,ai)(s, a_i) pair. If agent ii's value estimate was calibrated to the first number, it is now wrong by a wide margin — and it has no way to tell from the state alone which world it is in.

Knowledge check

Check your understanding

Answer this question before you continue.

Using the transition probabilities shown, what is the effective probability of reaching X when the opponent chooses L with probability 0.9?
Output Prediction

Focus: Compute an agent’s effective transition probability by marginalizing over another agent’s policy.

For agent i choosing L:
Opponent chooses L: P(X) = 0.9
Opponent chooses R: P(X) = 0.2

Stationary, Time-Varying, or Non-Markov?

The slogan "the Markov property fails" is too coarse to be useful, and it hides the distinction that determines which fix you need. Three cases have to be separated.

Case 1: Stationary Markov. The other policies are frozen. π−i\pi_{-i} is a fixed distribution, so Piπ−iP_i^{\pi_{-i}} is a fixed kernel. Agent ii faces an ordinary MDP, and single-agent theory applies without modification. This is the regime where treating the environment as an MDP is not sloppy — it is correct.

Case 2: Time-inhomogeneous Markov. The other policies change, but they change as a function of time (or of a training step counter) rather than as a function of the state or history. Then Piπ−i(t)P_i^{\pi_{-i}^{(t)}} depends on tt, but conditional on (s,ai,t)(s, a_i, t) the next state is still independent of everything earlier. The process is Markov once you augment the state with time. It is non-stationary, but it is not non-Markov. This is the case the marginalization derivation establishes under its stated assumptions.

Case 3: History-dependent, genuinely non-Markov. The other policies adapt to the history of play — they are themselves learning from the trajectory. Now π−i(t)\pi_{-i}^{(t)} depends on what has happened, and the state-only marginal Pi(s′∣s,ai)P_i(s' \mid s, a_i) is no longer a sufficient statistic for the future. The hidden policy state carries information the state does not. This is where the Markov property genuinely fails from agent ii's local viewpoint, and where the process becomes partially observable rather than merely time-varying.

The practical consequence is direct. In Case 2, you can restore Markov-ness by conditioning on time or on a training-phase variable. In Case 3, you cannot — you have to condition on the others' behavior, or fold an estimate of it back into the observation. The two cases look identical in a loss curve and demand different remedies.

Common mistake: Treating every policy update as proof that the Markov property broke. A policy schedule that changes over time gives you a time-varying but still Markov process. Reserve the non-Markov claim for when hidden policy state or history affects the conditional transition beyond the current state, action, and time.

Knowledge check

Check your understanding

Answer this question before you continue.

An opponent’s policy follows a schedule based only on the training-step counter. Which description matches the article’s classification, assuming the shared state is fully observed?
Misconception Check

Focus: Distinguish time-varying Markov dynamics from genuinely history-dependent dynamics.

What the Formal View Predicts

The derivation is only useful if it makes falsifiable claims about your training runs. It does.

Replay buffers hold stale joint policies. Every transition in the buffer was sampled under some π−i(t′)\pi_{-i}^{(t')} with t′<tt' < t. The empirical distribution in the buffer diverges from the current effective process. Staleness is not a separate bug you can patch; it is a direct consequence of the marginalization. The buffer is a museum of policies that no longer exist.

Drift scales with policy change per update. The size of the shift in Piπ−iP_i^{\pi_{-i}} is bounded by how much π−i\pi_{-i} changes between updates. Slower co-learning and larger batches reduce per-step drift, because they reduce the distance the weights travel per gradient step.

Fixed-kernel convergence guarantees do not apply. The theorems that promise Q-learning converges assume a stationary transition kernel. Your effective kernel is not stationary. This is why you see oscillation and cycling instead of clean convergence — not because your learning rate is wrong, but because the object you are converging toward is being redefined.

A stable-looking policy can be a compromise. A learner can appear to settle on a policy that is actually a weighted average of responses to opponents that have since changed. It looks converged. It is not; it is stranded.

Three diagnostics worth instrumenting:

  • Target-value variance across updates. If the TD target's variance is high even with a fixed batch, the target is moving.
  • Buffer age distribution. Track how old the transitions in each batch are, in units of opponent updates. A long tail means you are training on ancient policies.
  • Frozen-snapshot versus live evaluation. Score your learner against a frozen copy of the other agents, then against the live population. A large gap is the signature of endogenous drift.

Two Kinds of Moving Target

Not every moving target is the same moving target, and conflating them leads to the wrong fix.

Source of driftWhat movesCan one agent cause it?Class of remedy
Endogenous — other agents' policiesPiπ−iP_i^{\pi_{-i}}, Riπ−iR_i^{\pi_{-i}}No; requires other learnersCondition on the joint action, reshape the target, redefine the state
Exogenous — the environment itselfPP, RR directlyYes; exists even with one agentForgetting, windowing, change detection, tracking

Endogenous drift is the subject of this article. It is caused by learning inside the system. Exogenous drift is studied in non-stationary MDP settings and would exist even if you were the only agent in the world.

The distinction matters because the remedies do not transfer. Forgetting old experience helps with exogenous drift — the old data is genuinely from a different world. But forgetting does not fix endogenous drift, because the drift is not in the data's age; it is in the fact that the data was generated under a joint policy that no longer exists. You can have perfectly fresh data and still be chasing a target that moved between collection and update.

In practice both are often present. A measurement that cannot separate them will misattribute the cause, and you will spend a week tuning a forgetting rate for a problem that needed joint-action conditioning.

Knowledge check

Check your understanding

Answer this question before you continue.

The game’s P and R remain fixed, but another agent learns and changes its policy, shifting the learner’s effective transition and reward. How does the article classify this drift?
Scenario Interpretation

Focus: Classify drift caused by another learner’s policy change while the game’s transition and reward functions remain fixed.

When the Fixed-Game View Is Still the Right Tool

The theory is not free, and applying it where it does not belong is its own failure mode.

Use the fixed-game view when the other agents are frozen, scripted, or changing on a much slower timescale than your learner. If the opponent updates once per thousand of your updates, the effective process is approximately stationary over your learning window, and standard single-agent reasoning holds.

Use the moving-target view when policies update on comparable timescales, when your own updates feed back into the others' experience, or when evaluation depends on which opponent snapshot you happen to face.

The practical test is a timescale comparison, and it is a heuristic, not a theorem. Measure two things: how often your learner updates, and how much the other policies actually change per update. The second measurement is the one that matters, because update frequency alone says nothing about how far the weights travel. A slow-updating opponent that jumps between near-deterministic policies can move your effective kernel more than a fast-updating opponent that nudges its logits. Anchor the decision in measured policy change — or better, in measured change of the induced kernel Piπ−iP_i^{\pi_{-i}} over your learner's update window. When that change is small relative to the noise in your value estimates, the fixed view is a reasonable approximation and you should not pay the complexity cost of the moving-target machinery. When it is comparable, treat the target as moving.

Common mistake: Assuming that a frozen opponent makes the problem single-agent. It does not — it makes the effective process stationary, which is what single-agent theory actually requires. The distinction is worth keeping straight, because it tells you exactly what you bought by freezing.

Where the theory stops being exact: the marginalization argument assumes the other agents' policies are well-defined distributions at each step. When policies are being updated mid-episode, or when exploration is heavy enough that the "policy" is really a transient, that assumption is a modeling convenience rather than a fact. The derivation still tells you the direction of the drift; it just stops being a precise prediction of its magnitude.

And an honest boundary: this article formalizes the problem. It does not derive a specific algorithm's fix. Do not expect the derivation alone to hand you a stable training recipe — it hands you the term that has to be dealt with, and the choice of how to deal with it is the next article's problem.

Where to Go Next

The tuple is fixed. The induced process is not. The derivation shows exactly which term carries the time dependence: the marginalization over π−i\pi_{-i}, and its inheritance of that policy's time index.

The concrete next move is to instrument one training run. Log the buffer age distribution in units of opponent updates. Log the variance of your TD targets across a fixed batch. Then evaluate the same checkpoint twice — once against a frozen snapshot of the other agents, once against the live population. If the two scores diverge, you have measured endogenous drift directly, and you know which regime you are in.

From there, the natural question is how algorithms condition on the joint action or reshape the learning target to restore a stationary objective. That is where the fixes live: centralized critics that take the joint action as input, target networks that lag the moving policy, and state augmentations that fold the others' behavior back into the observation. Each is a different answer to the same equation.

Knowledge check

Final check

Finish the article by checking the ideas you just learned.

An opponent is frozen while a learner trains. Which conclusion best follows from the article’s fixed-game view?
Question 1 of 2Comparison Reasoning

Focus: Explain why a frozen opponent can make single-agent reasoning appropriate without changing the underlying game.

A learner collects very recent transitions, but another agent’s policy changes between collection and the learner’s update. Which interpretation is most consistent with the article?
Question 2 of 2Scenario Interpretation

Focus: Recognize why fresh data and forgetting alone do not eliminate endogenous drift.

References

  1. Reinforcement Learning for Non-Stationary Markov Decision ...proceedings.mlr.press
  2. Empirical Nash-Value Regret and Non-Stationarity ...arxiv.org
Practical resource

Build a stronger RL mental model

Use structured resources to connect equations, algorithms, and observable agent behavior.

Browse resources
Related sites

Continue across related AI foundations

Use LearnPyFast for Python foundations and LearnLLMFast for practical language-model and agent application concepts.

Python tutorialstutorial

LearnPyFast

Beginner-friendly Python tutorials, examples, and learning paths for practical programming foundations.

PythonProgrammingBeginners
Visit LearnPyFast
LLM tutorialstutorial

LearnLLMFast

Practical LLM tutorials for builders who want to understand prompting, workflows, agents, and AI applications.

LLMAIBuilders
Visit LearnLLMFast

Keep learning

Related reinforcement learning tutorials

Continue with nearby RL concepts, algorithms, and experiments that build on the same decision process.