Testing for Coordination Failures in Cooperative Multi-Agent Reinforcement Learning
Organizations: Simula Research Laboratory, Oslo, Norway
Abstract
Deep parallel cooperative multi-agent reinforcement learning (CMARL)} trains multiple agents that all act at every time step to optimize a common objective. Like single-agent RL, CMARL can produce unsafe behaviors that violate implicit safety requirements not captured by the reward, and these behaviors are hard to explain. However, testing CMARL policies for safety has received less attention than the safety testing of single-agent RL policies. In this paper, we propose DisQ, a test case selection method that identifies failure-revealing states in value-based CMARL by exploiting a signal specific to trained Q-learning agents. The signal is the Q-value gap, an explainable metric that flags a state when the agents' estimates of the achievable return diverge by more than a calibrated threshold. DisQ selects such states for execution and skips those without a gap. Our experiments in four CMARL benchmark environments show that, in most of the evaluated configurations, DisQ improves failure detection over single-agent RL testing methods applied to CMARL, namely random testing and search-based testing with genetic algorithms. Our main contributions are the Q-value gap, an indicator of potential miscoordination computable from a single state without executing the system, and DisQ, a test case selection method that adapts existing single-agent testing methods to CMARL.
Figures & tables
| Rel. err. | Selection rate (target ) | |||
|---|---|---|---|---|
| 0.90 | 25 | 0.128 | [0.044, 0.246] | |
| 50 | 0.115 | [0.053, 0.194] | ||
| 100 | 0.108 | [0.063, 0.161] | ||
| 250 | 0.103 | [0.074, 0.137] | ||
| 0.95 | 25 | 0.083 | [0.018, 0.182] | |
| 50 | 0.067 | [0.022, 0.128] | ||
| Hyperparameter | Value / Description |
|---|---|
| Population size | individuals |
| Initialization | Uniform random sampling within valid initial-state bounds |
| Fitness | Episode reward, minimized |
| Selection | Two best individuals in the current population |
| Crossover | Uniform per-gene crossover |
| Crossover rate |
| Reward | Failures | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Environment | Method | Avg. | % | Sig. | Fail./Exec. | Rate | OR | Sig. | |
| Coin Collector (2) | Random Testing | 21.41 | +0.0 | – | – | 2,145/25,000 | 0.086 | – | – |
| Random DisQ Testing | 23.56 | +10.0 | 0.91 | 470/3,570 | 0.132 | 1.62 | |||
| Genetic Testing | 23.71 | +10.7 | 0.84 | 3,826/25,000 | 0.153 | 1.93 | |||
| Genetic DisQ Testing | 27.55 | +28.7 | 0.93 | 1,983/7,941 | 0.250 | 3.55 | |||
| Knight Wizard Zombies (2) | Random Testing | -446.71 | +0.0 | – | – | 1,307/25,000 | 0.052 | – | – |
| Reward | Failures | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Environment | Method | Avg. | % | Sig. | Fail./Exec. | Rate | OR | Sig. | |
| Coin Collector (2) | Random Testing | 93.84 | +0.0 | – | – | 1,391/25,000 | 0.056 | – | – |
| Random DisQ Testing | 95.36 | +1.6 | 0.65 | n.s. | 203/3,920 | 0.052 | 0.93 | n.s. | |
| Genetic Testing | 93.20 | -0.7 | 0.45 | n.s. | 1,677/25,000 | 0.067 | 1.22 | ||
| Genetic DisQ Testing | 94.55 | +0.8 | 0.62 | n.s. | 188/3,813 | 0.049 | 0.88 | n.s. | |
| Knight Wizard Zombies (2) | Random Testing | -451.03 | +0.0 | – | – | 1,481/25,000 | 0.059 | – | – |
| Setting | Method | ||
|---|---|---|---|
| Centralized | Genetic DisQ Testing | -0.65 | 4.25e-02 |
| Genetic Testing | 0.60 | 6.67e-02 | |
| Random DisQ Testing | -0.95 | 2.28e-05 | |
| Random Testing | -0.04 | 9.07e-01 | |
| Decentralized | Genetic DisQ Testing | -0.82 | 3.81e-03 |
| Genetic Testing | -0.16 | 6.51e-01 |
| Method | 0.0 | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 | 0.6 | 0.7 | 0.8 | 0.9 | 1.0 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Centralized | Random Testing | -56.5 | -47.5 | -45.2 | -40.4 | -38.8 | -30.5 | -25.0 | -18.1 | -12.8 | -6.4 | -0.1 |
| Random DisQ Testing | -59.3 | -48.2 | -45.5 | -43.4 | -40.2 | -32.1 | -25.4 | -20.8 | -13.2 | -6.8 | -0.0 | |
| Genetic Testing | -60.6 | -48.7 | -50.0 | -43.4 | -42.7 | -36.7 | -27.4 | -22.1 | -15.4 | -8.3 | -0.9 | |
| Genetic DisQ Testing | -61.8 | -46.9 | -49.2 | -43.7 | -43.3 | -35.9 | -27.4 | -25.9 | -14.4 | -7.1 | -0.2 | |
| Decentralized | Random Testing | -34.5 | -31.9 | -27.8 | -25.6 | -21.7 | -17.1 | -14.6 | -11.3 | -7.7 | -4.2 | -0.2 |
| Random DisQ Testing | -38.4 | -35.5 | -31.2 | -28.7 | -24.8 | -19.5 | -15.5 | -12.5 | -8.9 | -5.0 | -0.4 |
| Reward | Failures | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Train episodes | Method | Avg. | % | Sig. | Fail./Exec. | Rate | OR | Sig. | |
| 100 | Random Testing | -166.67 | +0.0 | – | – | 1,250/25,000 | 0.050 | – | – |
| Random DisQ Testing | -174.58 | -4.8 | 0.06 | 306/3,855 | 0.079 | 1.64 | |||
| Genetic Testing | -237.32 | -42.4 | 0.00 | 7,698/24,983 | 0.308 | 8.46 | |||
| Genetic DisQ Testing | -248.32 | -49.0 | 0.00 | 3,135/7,589 | 0.413 | 13.37 | |||
| 1,000 | Random Testing | -190.84 | +0.0 | – | – | 1,250/25,000 | 0.050 | – | – |
| Reward | Failures | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Train episodes | Method | Avg. | % | Sig. | Fail./Exec. | Rate | OR | Sig. | |
| 2,000 | Random Testing | -99.78 | +0.0 | – | – | 1,250/25,000 | 0.050 | – | – |
| Random DisQ Testing | -105.73 | -6.0 | 0.05 | 257/3,615 | 0.071 | 1.45 | |||
| Genetic Testing | -126.48 | -26.8 | 0.00 | 5,098/25,000 | 0.204 | 4.87 | |||
| Genetic DisQ Testing | -124.40 | -24.7 | 0.00 | 1,086/6,977 | 0.156 | 3.50 | |||
| 4,000 | Random Testing | -70.76 | +0.0 | – | – | 1,250/25,000 | 0.050 | – | – |
| Environment | Setting | Failures | Mid-episode only | Never | |
|---|---|---|---|---|---|
| Knight Wizard Zombies | centralized | 261 | 28 (10.7%) | 10 (3.8%) | 223 (85.4%) |
| Knight Wizard Zombies | decentralized | 266 | 16 (6.0%) | 83 (31.2%) | 167 (62.8%) |
| Simple Spread (2) | centralized | 233 | 38 (16.3%) | 23 (9.9%) | 172 (73.8%) |
| Simple Spread (2) | decentralized | 291 | 65 (22.3%) | 173 (59.5%) | 53 (18.2%) |
Multi-Agent Reinforcement Learning
Multi-agent reinforcement learning studies how interacting agents learn coordinated or competitive policies through shared experience and rewards.
See all 415 papers