Multi-agent reinforcement learning explained

Multi-agent reinforcement learning (MARL) is a sub-field of reinforcement learning. It focuses on studying the behavior of multiple learning agents that coexist in a shared environment.[1] Each agent is motivated by its own rewards, and does actions to advance its own interests; in some environments these interests are opposed to the interests of other agents, resulting in complex group dynamics.

Multi-agent reinforcement learning is closely related to game theory and especially repeated games, as well as multi-agent systems. Its study combines the pursuit of finding ideal algorithms that maximize rewards with a more sociological set of concepts. While research in single-agent reinforcement learning is concerned with finding the algorithm that gets the biggest number of points for one agent, research in multi-agent reinforcement learning evaluates and quantifies social metrics, such as cooperation,[2] reciprocity,[3] equity,[4] social influence,[5] language[6] and discrimination.[7]

Definition

Similarly to single-agent reinforcement learning, multi-agent reinforcement learning is modeled as some form of a Markov decision process (MDP). For example,

S

of environment states.

lAi

of actions for each of the agents

i\inI=\{1,...,N\}

.

P\overrightarrow{a}(s,s')=\Pr(st+1=s'\midst=s,\overrightarrow{a}t=\overrightarrow{a})

is the probability of transition (at time

t

) from state

s

to state

s'

under joint action

\overrightarrow{a}

.

\overrightarrow{R}\overrightarrow{a}(s,s')

is the immediate joint reward after the transition from

s

to

s'

with joint action

\overrightarrow{a}

.

In settings with perfect information, such as the games of chess and Go, the MDP would be fully observable. In settings with imperfect information, especially in real-world applications like self-driving cars, each agent would access an observation that only has part of the information about the current state. In the partially observable setting, the core model is the partially observable stochastic game in the general case, and the decentralized POMDP in the cooperative case.

Cooperation vs. competition

When multiple agents are acting in a shared environment their interests might be aligned or misaligned. MARL allows exploring all the different alignments and how they affect the agents' behavior:

Pure competition settings

When two agents are playing a zero-sum game, they are in pure competition with each other. Many traditional games such as chess and Go fall under this category, as do two-player variants of modern games like StarCraft. Because each agent can only win at the expense of the other agent, many complexities are stripped away. There's no prospect of communication or social dilemmas, as neither agent is incentivized to take actions that benefit its opponent.

The Deep Blue[8] and AlphaGo projects demonstrate how to optimize the performance of agents in pure competition settings.

One complexity that is not stripped away in pure competition settings is autocurricula. As the agents' policy is improved using self-play, multiple layers of learning may occur.

Pure cooperation settings

MARL is used to explore how separate agents with identical interests can communicate and work together. Pure cooperation settings are explored in recreational cooperative games such as Overcooked,[9] as well as real-world scenarios in robotics.[10]

In pure cooperation settings all the agents get identical rewards, which means that social dilemmas do not occur.

In pure cooperation settings, oftentimes there are an arbitrary number of coordination strategies, and agents converge to specific "conventions" when coordinating with each other. The notion of conventions has been studied in language[11] and also alluded to in more general multi-agent collaborative tasks.[12] [13] [14] [15]

Mixed-sum settings

Most real-world scenarios involving multiple agents have elements of both cooperation and competition. For example, when multiple self-driving cars are planning their respective paths, each of them has interests that are diverging but not exclusive: Each car is minimizing the amount of time it's taking to reach its destination, but all cars have the shared interest of avoiding a traffic collision.[16]

Zero-sum settings with three or more agents often exhibit similar properties to mixed-sum settings, since each pair of agents might have a non-zero utility sum between them.

Mixed-sum settings can be explored using classic matrix games such as prisoner's dilemma, more complex sequential social dilemmas, and recreational games such as Among Us,[17] Diplomacy[18] and StarCraft II.[19] [20]

Mixed-sum settings can give rise to communication and social dilemmas.

Social dilemmas

As in game theory, much of the research in MARL revolves around social dilemmas, such as prisoner's dilemma,[21] chicken and stag hunt.[22]

While game theory research might focus on Nash equilibria and what an ideal policy for an agent would be, MARL research focuses on how the agents would learn these ideal policies using a trial-and-error process. The reinforcement learning algorithms that are used to train the agents are maximizing the agent's own reward; the conflict between the needs of the agents and the needs of the group is a subject of active research.[23]

Various techniques have been explored in order to induce cooperation in agents: Modifying the environment rules,[24] adding intrinsic rewards, and more.

Sequential social dilemmas

Social dilemmas like prisoner's dilemma, chicken and stag hunt are "matrix games". Each agent takes only one action from a choice of two possible actions, and a simple 2x2 matrix is used to describe the reward that each agent will get, given the actions that each agent took.

In humans and other living creatures, social dilemmas tend to be more complex. Agents take multiple actions over time, and the distinction between cooperating and defecting is not as clear cut as in matrix games. The concept of a sequential social dilemma (SSD) was introduced in 2017[25] as an attempt to model that complexity. There is ongoing research into defining different kinds of SSDs and showing cooperative behavior in the agents that act in them.[26]

Autocurricula

An autocurriculum[27] (plural: autocurricula) is a reinforcement learning concept that's salient in multi-agent experiments. As agents improve their performance, they change their environment; this change in the environment affects themselves and the other agents. The feedback loop results in several distinct phases of learning, each depending on the previous one. The stacked layers of learning are called an autocurriculum. Autocurricula are especially apparent in adversarial settings,[28] where each group of agents is racing to counter the current strategy of the opposing group.

The Hide and Seek game is an accessible example of an autocurriculum occurring in an adversarial setting. In this experiment, a team of seekers is competing against a team of hiders. Whenever one of the teams learns a new strategy, the opposing team adapts its strategy to give the best possible counter. When the hiders learn to use boxes to build a shelter, the seekers respond by learning to use a ramp to break into that shelter. The hiders respond by locking the ramps, making them unavailable for the seekers to use. The seekers then respond by "box surfing", exploiting a glitch in the game to penetrate the shelter. Each "level" of learning is an emergent phenomenon, with the previous level as its premise. This results in a stack of behaviors, each dependent on its predecessor.

Autocurricula in reinforcement learning experiments are compared to the stages of the evolution of life on Earth and the development of human culture. A major stage in evolution happened 2-3 billion years ago, when photosynthesizing life forms started to produce massive amounts of oxygen, changing the balance of gases in the atmosphere.[29] In the next stages of evolution, oxygen-breathing life forms evolved, eventually leading up to land mammals and human beings. These later stages could only happen after the photosynthesis stage made oxygen widely available. Similarly, human culture could not have gone through the Industrial Revolution in the 18th century without the resources and insights gained by the agricultural revolution at around 10,000 BC.[30]

Applications

Multi-agent reinforcement learning has been applied to a variety of use cases in science and industry:

AI alignment

Multi-agent reinforcement learning has been used in research into AI alignment. The relationship between the different agents in a MARL setting can be compared to the relationship between a human and an AI agent. Research efforts in the intersection of these two fields attempt to simulate possible conflicts between a human's intentions and an AI agent's actions, and then explore which variables could be changed to prevent these conflicts.[31] [32]

Limitations

There are some inherent difficulties about multi-agent deep reinforcement learning.[33] The environment is not stationary anymore, thus the Markov property is violated: transitions and rewards do not only depend on the current state of an agent.

Further reading

Notes and References

  1. Stefano V. Albrecht, Filippos Christianos, Lukas Schäfer. Multi-Agent Reinforcement Learning: Foundations and Modern Approaches. MIT Press, 2024. https://www.marl-book.com/
  2. Lowe . Ryan . Wu . Yi . Multi-Agent Actor-Critic for Mixed Cooperative-Competitive Environments . 1706.02275v4 . 2020 . cs.LG .
  3. Baker . Bowen . Emergent Reciprocity and Team Formation from Randomized Uncertain Social Preferences . NeurIPS 2020 proceedings . 2020 . 2011.05373.
  4. Hughes . Edward . Leibo . Joel Z. . etal . Inequity aversion improves cooperation in intertemporal social dilemmas . NeurIPS 2018 proceedings . 2018 . 1803.08884.
  5. Jaques . Natasha . Lazaridou . Angeliki . Hughes . Edward . etal . Social Influence as Intrinsic Motivation for Multi-Agent Deep Reinforcement Learning . Proceedings of the 35th International Conference on Machine Learning . 2019 . 1810.08647 .
  6. Lazaridou . Angeliki . Multi-Agent Cooperation and The Emergence of (Natural) Language . ICLR 2017 . 2017 . 1612.07182.
  7. Duéñez-Guzmán . Edgar . etal . Statistical discrimination in learning agents . 2110.11404v1 . 2021 . cs.LG .
  8. Campbell . Murray . Hoane . A. Joseph Jr. . Hsu . Feng-hsiung . 2002 . Deep Blue . Artificial Intelligence . 134 . 1–2 . 57–83 . 10.1016/S0004-3702(01)00129-1 . 0004-3702 . Elsevier.
  9. Micah . Carroll . etal . 1910.05789 . On the Utility of Learning about Humans for Human-AI Coordination . 2019. cs.LG .
  10. Xie . Annie . Losey . Dylan . Tolsma . Ryan . Finn . Chelsea . Chelsea Finn . Sadigh . Dorsa . November 2020 . Learning Latent Representations to Influence Multi-Agent Interaction . CoRL.
  11. Clark . Herbert . Wilkes-Gibbs . Deanna . Referring as a collaborative process . Cognition . February 1986 . 22 . 1 . 1–39 . 10.1016/0010-0277(86)90010-7 . 3709088 . 204981390 .
  12. Planning, learning and coordination in multiagent decision processes . Proceedings of the 6th Conference on Theoretical Aspects of Rationality and Knowledge . Boutilier . Craig . 17 March 1996 . 195–210.
  13. Ad Hoc Autonomous Agent Teams: Collaboration without Pre-Coordination. Peter. Stone. Gal A.. Kaminka. Sarit. Kraus. Jeffrey S.. Rosenschein. July 2010 . AAAI 11.
  14. Bayesian action decoder for deep multi-agent reinforcement learning . Jakob N.. Foerster. H. Francis. Song. Edward. Hughes. Neil. Burch. Iain. Dunning. Shimon. Whiteson. Matthew M. Botvinick. Michael H.. Bowling. 1811.01458 . ICML 2019.
  15. On the Critical Role of Conventions in Adaptive Human-AI Collaboration. Andy. Shih. Arjun. Sawhney. Jovana. Kondic. Stefano. Ermon. Dorsa. Sadigh. 2104.02871 . ICLR 2021.
  16. 1610.03295 . Safe, Multi-Agent, Reinforcement Learning for Autonomous Driving . 2016 . Shalev-Shwartz . Shai . Shammah . Shaked . Shashua . Amnon . cs.AI .
  17. Kopparapu . Kavya . Duéñez-Guzmán . Edgar A. . Matyas . Jayd . Vezhnevets . Alexander Sasha . Agapiou . John P. . McKee . Kevin R. . Everett . Richard . Marecki . Janusz . Leibo . Joel Z. . Graepel . Thore . 2201.01816 . Hidden Agenda: a Social Deduction Game with Diverse Learned Equilibria . 2022 . cs.AI .
  18. Bakhtin. Anton . Brown. Noam . Human-level play in the game of Diplomacy by combining language models with strategic reasoning . Science . 2022 . 378 . 6624 . 1067–1074 . Springer. 10.1126/science.ade9097 . 36413172 . 2022Sci...378.1067M . 253759631 . etal.
  19. Mikayel . Samvelyan . Tabish . Rashid . Christian Schroeder . de Witt . Gregory . Farquhar . Nantas . Nardelli . Tim G. J. . Rudner . Chia-Man . Hung . Philip H. S. . Torr . Jakob . Foerster . Shimon . Whiteson . 1902.04043 . The StarCraft Multi-Agent Challenge . 2019. cs.LG .
  20. Ellis . Benjamin . Moalla . Skander . Samvelyan . Mikayel . Sun . Mingfei . Mahajan . Anuj . Foerster . Jakob N. . Whiteson . Shimon . 2212.07489 . SMACv2: An Improved Benchmark for Cooperative Multi-Agent Reinforcement Learning . 2022 . cs.LG .
  21. Sandholm . Toumas W. . Crites . Robert H. . Multiagent reinforcement learning in the Iterated Prisoner's Dilemma . Biosystems . 1996 . 37 . 1–2 . 147–166 . 10.1016/0303-2647(95)01551-5 . 8924633 . 1996BiSys..37..147S .
  22. Alexander . Peysakhovich . Adam . Lerer . Prosocial Learning Agents Solve Generalized Stag Hunts Better than Selfish Ones . AAMAS 2018 . 1709.02865 . 2018 .
  23. Dafoe . Allan . Hughes . Edward . Bachrach . Yoram . etal . Open Problems in Cooperative AI . NeurIPS 2020 . 2012.08630 . 2020 .
  24. Raphael . Köster . Dylan . Hadfield-Menell . Gillian K. . Hadfield . Joel Z. . Leibo . Silly rules improve the capacity of agents to learn stable enforcement and compliance behaviors . AAMAS 2020 . 2001.09318 .
  25. Joel Z. . Leibo . Vinicius . Zambaldi . Marc . Lanctot . Janusz . Marecki . Thore . Graepel . Multi-agent Reinforcement Learning in Sequential Social Dilemmas . AAMAS 2017 . 1702.03037 . 2017 .
  26. Pinkesh . Badjatiya . Mausoom . Sarkar . 2001.05458 . Inducing Cooperative behaviour in Sequential-Social dilemmas through Multi-Agent Reinforcement Learning using Status-Quo Loss . 2020 . cs.AI .
  27. Leibo . Joel Z. . Hughes . Edward . etal . Autocurricula and the Emergence of Innovation from Social Interaction: A Manifesto for Multi-Agent Intelligence Research . 2019 . cs.AI . 1903.00742v2 .
  28. Baker . Bowen . etal . Emergent Tool Use From Multi-Agent Autocurricula . ICLR 2020 . 2020 . 1909.07528.
  29. Kasting . James F . Siefert . Janet L . Life and the evolution of earth's atmosphere . Science . 2002 . 296 . 5570 . 1066–1068 . 10.1126/science.1071184 . 12004117 . 2002Sci...296.1066K . 37190778 .
  30. Book: Clark . Gregory . A farewell to alms: a brief economic history of the world . 2008 . Princeton University Press . 978-0-691-14128-2.
  31. 1711.09883 . Leike . Jan . Martic . Miljan . Krakovna . Victoria . Ortega . Pedro A. . Everitt . Tom . Lefrancq . Andrew . Orseau . Laurent . Legg . Shane . 2017 . AI Safety Gridworlds . cs.AI .
  32. 1611.08219 . Hadfield-Menell . Dylan . Dragan . Anca . Abbeel . Pieter . Russell . Stuart . cs.AI . The Off-Switch Game . 2016 .
  33. Hernandez-Leal. Pablo. Kartal. Bilal. Taylor. Matthew E.. 2019-11-01. A survey and critique of multiagent deep reinforcement learning. Autonomous Agents and Multi-Agent Systems. en. 33. 6. 750–797. 10.1007/s10458-019-09421-1. 1573-7454. 1810.05587. 52981002.