State-based episodic memory for multi-agent reinforcement learning

Xiao Ma, Wu-Jun LiMachine Learning 2021

Abstract

Multi-Agent Reinforcement Learning (MARL) often suffers from poor sample efficiency due to the complexity of joint action spaces. While episodic memory has improved single-agent RL, its application to MARL is hindered by the exponential growth of state-action pairs. This paper proposes State-based Episodic Memory (SEM), which stores only the maximum historical returns for global states, bypassing the joint action space bottleneck. SEM improves sample efficiency and training stability across various StarCraft II benchmarks, demonstrating significant performance gains with minimal memory overhead.

Introduction: The Challenge of Sample Efficiency in MARL

Multi-Agent Reinforcement Learning (MARL) is notoriously difficult because agents must learn to cooperate in a shared environment where everything is constantly changing. While the Centralized Training and Decentralized Execution (CTDE) paradigm has helped, these algorithms are still "sample inefficient"—they require millions of trial-and-error interactions to learn effective behaviors.

In single-agent RL, "Episodic Memory" (EM) helps by acting like a "cheat sheet" of the best experiences the agent has ever had. However, bringing EM to the multi-agent world faces a massive hurdle: the joint action space. If you have 27 agents each with 36 possible actions, the number of possible combined actions is astronomical ($36^{27}$). Traditional episodic memory, which tracks every state-action pair, would require more storage than exists on Earth.

State-based Episodic Memory (SEM)

The authors propose SEM (State-based Episodic Memory). The core innovation is a shift from tracking what action led to a reward to simply tracking the best reward ever seen in a specific state.

Comparison of SAEM and SEM architectures.
  1. State-Only Lookup: Instead of a massive table for every joint action, SEM maintains a single lookup table that records the highest discounted return ever achieved for a given global state.
  2. Supervised Training: During the centralized training phase, the algorithm doesn't just rely on its neural network's guesses (which are often overestimated and unstable). It uses the "best hits" from the SEM table as a stable target to supervise the learning process.
  3. Random Projection: To handle high-dimensional game states (like those in StarCraft II), SEM uses a mathematical technique called random projection to compress complex states into a small, 4-dimensional vector. This keeps the lookup table fast and memory-efficient.
  4. Integration: SEM is designed to be a "plug-and-play" module. The authors successfully combined it with popular MARL baselines like VDN, QMIX, and QPLEX.

Experimental Setup

The researchers evaluated SEM using the StarCraft Multi-Agent Challenge (SMAC), a popular and difficult benchmark for cooperative MARL. They tested on eight different maps ranging from "Easy" to "Hard" and "Super Hard," including:

  • 2c_vs_64zg: 2 Colossi vs. 64 Zerglings (requires extreme micromanagement).
  • 27m_vs_30m: 27 Marines vs. 30 Marines (massive action space).
  • bane_vs_bane: 20 Zerglings and 4 Banelings vs. the same (highly volatile).

Core Innovations

  • Action-Agnosticism: By ignoring the specific joint actions in the memory table, SEM avoids the exponential complexity of multi-agent systems. It essentially tells the network, "I don't care exactly how you did it, but we know this state can yield this high of a reward—aim for that."
  • Stability Over Raw Speed: Neural networks in RL often suffer from "moving target" problems where their own estimates fluctuate wildly. SEM provides a "stable anchor" by retrieving actual historical returns from a table, preventing the network from drifting into bad strategies.
  • Theoretical Efficiency: The authors proved that SEM has $O(1)$ time complexity for updates, compared to the $O(|M|)$ complexity of state-action-based methods.

Performance and Efficiency

SEM consistently outperformed vanilla baselines. For example, on the "Super Hard" 27m_vs_30m map, SEM-VDN achieved a significant win rate, while standard VDN failed to win a single battle.

Win rates on the 27m_vs_30m 'Super Hard' map.
  • Massive Storage Savings: In the 2c_vs_64zg scenario, a traditional state-action memory would require 142GB of storage. SEM achieved better results using only 0.029GB.
  • Faster Training: SEM reduced the "wall-clock" training time by about 14% compared to state-action episodic memory while reaching higher win rates sooner.
  • Smarter Policies: Qualitative analysis showed that SEM-trained agents learned more sophisticated tactics, such as "kiting" enemies or positioning units more evenly to maximize firepower.

Discussion and Future Directions

While SEM offers significant improvements, it has limitations. Its performance depends on the balance coefficient ($\lambda$) and the size of the lookup table. If the table is too small, it forgets valuable experiences; if $\lambda$ is poorly tuned, the memory might mislead the network.

Future work could investigate more advanced state representation learning to replace random projection, or explore how episodic memory might be used to encourage agents to explore new parts of the environment rather than just exploiting known best experiences.

Summary updated

BibTeX
@article{ma2021state,
  author = {Xiao Ma and Wu-Jun Li},
  title = {{State-based episodic memory for multi-agent reinforcement learning}},
  journal = {Machine Learning},
  year = {2021},
  doi = {10.1007/s10994-023-06365-2},
}
Figure