techlist.io

Multi Agent Reinforcement Learning

3 posts

OpenAI2017-09-133 min readCurated summary

Learning to model other minds

# Learning with Opponent-Learning Awareness OpenAI and the University of Oxford introduced LOLA, an algorithm that lets reinforcement learning agents account for the fact that other agents are learning at the same time. Instead of treating other learners as part of a static environment, a LOLA agent shapes how its opponents update their policies, which allows self-interested agents to discover cooperative strategies such as tit-for-tat in the iterated prisoner's dilemma. The authors present it as a small step toward agents that model other minds. ## Motivation: Learning Without a Theory of Mind - Humans collaborate well because they reason about how their actions will change others' future behavior and often find win-win arrangements. - Standard deep multi-agent RL lacks this capacity. A state-of-the-art agent treats another learning agent as no different from a tree in the environment. - Methods such as Independent PPO tend to converge on selfish behavior that ignores other agents' objectives. ## How LOLA Works - Each LOLA agent, "Alice," models how another agent's ("Bob's") parameter update depends on Alice's policy, and how Bob's update in turn affects Alice's expected future reward. - Alice optimizes her return after one anticipated learning step of Bob, differentiating through that step to shape Bob's update in a direction that benefits her. - The key term is a second-order correction. Its left-hand side captures how Alice's return depends on Bob's policy change, and its right-hand side captures how Bob's learning step depends on Alice's policy. Multiplying the two measures how Alice can steer Bob's learning toward higher rewards for herself. - With access to the true gradients and Hessians, the terms can be computed exactly. In practice, the second-order term is estimated from samples using the policy gradient theorem, which makes LOLA applicable to general deep RL settings. - LOLA requires access to the other agents' policies. LOLA-OM (opponent modeling) instead fits a model of the opponent from observed trajectories, predicting its parameters from its actions. The authors plan to extend this to infer opponents' architectures and rewards. ## Results - **Iterated prisoner's dilemma and coin game:** LOLA agents discover reciprocal strategies, while Independent PPO learns selfish behavior. - **Coin game:** Two agents, red and blue, collect coins. Any agent earns a point for collecting a coin, but collecting a coin of the other agent's color costs that agent 2 points. If both agents greedily collect every coin, both average zero. LOLA agents learn to mostly collect coins of their own color, earning high scores. - Both LOLA and LOLA-OM collect more coins and score substantially higher than the baselines. ## Limitations - LOLA performs best with large batch sizes and full roll-outs for variance reduction, which makes it memory- and compute-intensive. - Under opponent modeling, LOLA can be unstable, which the authors plan to address in future work.

OpenAI2017-09-122 min readCurated summary

Learning with opponent-learning awareness

Learning with Opponent-Learning Awareness (LOLA) is a multi-agent reinforcement learning method in which each agent accounts for how its own policy will shape the other agents' anticipated learning updates. Unlike independent learners, LOLA agents that encounter each other learn to cooperate, even in social dilemmas where self-interest would otherwise lead to defection. The method is practical for model-free RL and scales to large parameter spaces and nonlinear function approximators. ## The Problem with Multi-Agent Learning - When multiple agents learn at once, each agent's environment becomes non-stationary, which often causes unstable training or poor final outcomes. - The post frames this as a general issue across deep multi-agent RL, hierarchical RL, generative adversarial networks, and decentralised optimisation. ## The LOLA Learning Rule - Each agent anticipates the other agents' parameter updates and adds a term that measures how its own policy affects those updates. - This lets an agent shape the learning of its opponents rather than treating them as fixed. - The method can be computed efficiently with an extension of the policy gradient estimator, so it works without a model of the environment. ## Results on Benchmark Games - **Iterated prisoners' dilemma:** Two LOLA agents converge to tit-for-tat and cooperate, while independent learners do not. LOLA agents also earn higher payouts than naive learners and resist exploitation by higher-order gradient methods. - **Repeated matching pennies:** LOLA agents converge to the Nash equilibrium. - **Round-robin tournament:** LOLA agents shape the learning of a range of multi-agent algorithms from the literature and achieve the highest average returns on the iterated prisoners' dilemma. ## Grid World with Embedded Social Dilemma - The authors test LOLA on a grid world containing a social dilemma, using recurrent policies and opponent modelling. - By explicitly modelling the other agent's learning, LOLA agents learn to cooperate out of self-interest. ## Practical Takeaway For multi-agent settings where agents learn simultaneously, explicitly modelling how other agents will update can turn competitive dynamics into cooperative outcomes. The authors have released their code.

OpenAI2017-06-073 min readCurated summary

Learning to cooperate, compete, and communicate

# Multi-Agent Reinforcement Learning with MADDPG OpenAI's MADDPG (Multi-Agent Deep Deterministic Policy Gradient) is a reinforcement learning algorithm for training multiple agents that must cooperate or compete in shared environments. The authors argue that multiagent environments are important stepping stones toward AGI because they generate a natural curriculum and never settle into a stable equilibrium. Their approach, centralized training with decentralized execution, lets agents learn coordinated and adversarial behaviors that traditional decentralized methods fail to learn. ## Why Multiagent Environments Matter - The difficulty of the environment scales with the skill of competitors, so agents face a natural curriculum. Competing against clones of oneself produces an environment matched exactly to one's own skill level. - No stable equilibrium exists, so there is constant pressure to improve regardless of how capable an agent already is. ## How MADDPG Works - MADDPG extends DDPG and draws on actor-critic reinforcement learning. - Each agent is an "actor" that selects actions, while a "critic" evaluates those actions by predicting expected future reward, which is more stable than using raw rewards directly. - Each critic can access the observations and actions of all agents during training, enabling globally coordinated behavior. - At test time, agents act only on their own observations plus predictions of others' behavior, so the central critic is not needed during execution. - Because each agent's critic is learned independently, the method also handles arbitrary reward structures, including fully adversarial ones. ## Experimental Results - MADDPG outperformed DDPG on every task tested. - Demonstrated behaviors include two agents learning to split up to hide their intended destination from an opponent, one agent communicating a landmark's name to another, and three agents coordinating to reach landmarks without colliding. - In a predator-prey setup, four red agents learned to team up to chase a single green agent, while green agents learned to split up and use the water to evade them. ## Limitations of Traditional Decentralized RL - Each agent must simultaneously predict others' actions while learning its own, which makes the environment non-stationary and hard to learn, especially in competitive settings. - Policy gradient methods show high variance when rewards are inconsistent. Adding a critic improved stability but still failed on tasks like cooperative communication, suggesting that modeling other agents' actions during training is essential for cooperation. - In early experiments, listener agents learned to ignore speakers that sent inconsistent messages, setting the speaker's weights to zero. Once this happened, the speaker received no feedback and could not recover. Forcing listeners to attend to the speaker did not help, because the speaker still had no signal about which messages were relevant. The centralized critic addresses this by letting speakers learn which utterances matter to other agents' actions. ## Future Directions - Agent modeling has a long history in AI, but earlier work mostly considered games with few time steps and small state spaces. - Deep learning handles complex visual inputs, and RL handles long-horizon behavior. Combined, they allow training multiple agents without requiring knowledge of environment dynamics. - The authors suggest this opens the door to problems involving communication and language learned from high-dimensional environment data.