Key ideas
Agents. An agent is an entity that lives in an environment, perceives it and acts on it1. Reactive agents have simple request–response behaviour; deliberative (cognitive) agents reason and plan, e.g. with the belief–desire–intention (BDI) architecture1.
Emergence. In flocking each bird sees only its neighbours and follows three local rules — alignment (match their heading), cohesion (move towards their centre), separation (avoid crowding) — yet a realistic flock appears with no central controller1. Typical uses: game NPCs, crowds in films, epidemic and traffic simulation1.
Kinds of interaction. Cooperative: agents maximise a common reward. Competitive (zero-sum): each maximises its own reward, which is the opponent's loss. Mixed: both at once.
Multi-agent RL.
- Decentralised / independent learners (e.g. independent Q-learning): each agent treats the others as part of the environment. Because the others keep learning, the environment is non-stationary — old replay-buffer transitions describe opponents that no longer exist, and there is no convergence guarantee6.
- Centralised learning of joint actions (one common policy, a global reward) avoids non-stationarity but the joint action space grows exponentially with the number of agents6.
- Centralised training, decentralised execution (CTDE): during training a critic may use all agents' observations and actions (MADDPG, Lowe et al. 2017); at test time each actor uses only its own observation6. COMA gives each agent a counterfactual advantage6: the value of the joint action it took minus the policy-weighted average over its own alternative actions, the others' actions held fixed.
- Value factorisation for a shared team reward: VDN sets ; QMIX allows any mixing that is monotonic, (non-negative weights produced by hypernetworks that see the state ), so each agent's greedy action also maximises 6.
Self-play trains an agent against earlier copies of its own policy, so the opponent stays at about its level2. Keeping few, slowly changing opponents is stable but risks overfitting to them; a larger, more varied pool gives a more general policy2. Progress is measured with Elo, not reward: points won equal points lost, and an upset moves more points than an expected result2.
Game theory (simultaneous moves, payoff tables).
- A strategy is strictly dominated if another is better against every opponent choice; it is never part of a Nash equilibrium, so iteratively removing such strategies never removes an equilibrium7.
- Nash equilibrium: no player gains by changing only their own strategy3. Every finite game has one, possibly in mixed strategies (Nash); a pure one may not exist (matching pennies). Equilibria need not be Pareto optimal3.
- Prisoner's dilemma: defect strictly dominates, so (D, D) is the unique equilibrium, though (C, C) is better for both7.
- Mixed equilibrium: each player mixes so that the other player is indifferent between the pure strategies they use3.
- Zero-sum (Row receives , Column pays it): von Neumann's minimax theorem says over mixed strategies8; a pure saddle point exists when (in general only holds)8.
- Correlated equilibrium: a mediator draws a joint action and privately tells each player their part; following the advice must be a best response4. Every Nash equilibrium is one; they are found by linear programming and can be reached by simple learning dynamics4. No player is ever told to play a strictly dominated action, since obeying would not be a best response.
Adversarial search (two players, alternate moves): minimax, made faster by alpha–beta, which returns the same value and move; good move ordering prunes more, and the best case evaluates about leaves5. Progressive (iterative) deepening returns the minimax value for each depth and supplies a usually good order for the next one5 — usually, because shallow values only estimate deeper ones.
Formulas
Expected payoff of mixed strategies (row) and (column) with payoff matrix : 8. Entropy-regularised best response (multiplicative weights / Hedge): maximising over the simplex gives , a softmax of the cumulative utilities (set the gradient of the Lagrangian to zero).
Worked example
Payoffs (Row, Column): (U, L) = (3, 0), (U, R) = (0, 2), (D, L) = (0, 1), (D, R) = (1, 0). Each cell has a player who wants to deviate, so there is no pure equilibrium. Row plays U with probability that makes Column indifferent: . Column plays L with that makes Row indifferent: . Equilibrium payoffs: Row , Column .
Common pitfalls
- Nash ≠ best outcome: it only rules out unilateral improvements3.
- Not every finite game has a pure equilibrium; mixed ones always exist3.
- Your mixing probability is set by the opponent's payoffs, not your own.
- Independent learners face a moving target, so their stored experience goes stale6.
- Alpha–beta does not change the minimax value; only ordering changes how much is pruned5. Its cut-offs compare values only by order, so any strictly increasing transform of the static evaluator prunes exactly the same leaves; a decreasing one (e.g. a sign flip) reverses MAX's preferences and can prune different leaves.
- Elo is relative: ratings depend on the opponents' ratings, and an expected win earns few points2.
References
- AI for Beginners — Lesson: Multi-Agent Systems — introduction (agent types); Flocking; Deliberative Agents
- Hugging Face Deep Reinforcement Learning Course — Unit 7, Self-Play: What is Self-Play?; Self-Play in MLAgents; The ELO Score to evaluate our agent
- Wikipedia: Nash equilibrium — Definitions; Existence; Rationality; Computing Nash equilibria
- Wikipedia: Correlated equilibrium — Formal definition; An example; Learning correlated equilibria
- Wikipedia: Alpha–beta pruning — Core idea; Improvements over naive minimax
- Rashid et al., QMIX — Monotonic Value Function Factorisation for Deep Multi-Agent Reinforcement Learning (ICML 2018) — Sec. 2 Related Work; Sec. 3.3 Independent Q-Learning; Sec. 3.4 Value Decomposition Networks; Sec. 4 QMIX
- Wikipedia: Strategic dominance — Dominance and Nash equilibria; Iterated elimination of strictly dominated strategies
- Wikipedia: Minimax theorem — Introduction; Bilinear functions and zero-sum games