Introduction
Multi-agent reinforcement learning (MARL) has seen significant progress in cooperative tasks. However, a persistent challenge remains: the "credit assignment" problem in environments with sparse or delayed rewards. In such settings, agents receive feedback only at the end of an episode, making it difficult to determine which specific actions at which time steps contributed to the final outcome. STAS (Spatial-Temporal Attention with Shapley) addresses this by decomposing global episodic rewards into dense, per-agent signals.
The Credit Assignment Challenge
In complex cooperative scenarios, rewards are often delayed. For instance, in a team-based navigation task, a "success" signal might only be triggered once all agents reach their respective goals. This creates two hurdles:
- Temporal Credit Assignment: Identifying which time steps in a long trajectory were critical to success.
- Spatial Credit Assignment: Determining the individual contribution of each agent within those critical time steps.
Standard algorithms like QMIX or COMA struggle in these "extreme delayed reward" scenarios, often failing to learn effective coordination patterns due to high variance in the sparse reward signal.
Methodology: The STAS Framework
STAS introduces a dual-transformer architecture designed to bridge the gap between global episodic rewards and individual agent actions through a two-stage decomposition process.
The framework operates as follows:
- Temporal Decomposition: A temporal attention module analyzes the entire episode trajectory. Using causality masks, it identifies "key frames"—moments with the highest impact on the final outcome—and redistributes the global reward back to these specific time steps.
- Spatial Decomposition via Shapley Values: Once a reward is assigned to a time step, STAS employs the Shapley Value from cooperative game theory to distribute it among agents. By calculating an agent's marginal contribution across various sub-group coalitions, the model ensures a fair and mathematically grounded credit assignment.
- Efficiency through Approximation: To mitigate the exponential computational cost of exact Shapley values, STAS uses Monte Carlo sampling and a random masked attention mechanism. This allows for efficient estimation of agent contributions during the training phase.
Experimental Evaluation
The researchers evaluated STAS against several baselines, including QMIX, COMA, and SQDDPG, across two primary benchmarks:
- Alice & Bob: A custom environment designed for extreme delayed rewards. Alice and Bob must perform a sequence of interdependent tasks (finding keys to unlock each other's doors) before reaching a treasure. No intermediate rewards are provided.
- Multi-agent Particle Environment (MPE): Standard cooperative navigation and predator-prey tasks were used to test scalability with up to 15 agents.
Key Results and Insights
STAS demonstrated a significant performance advantage in environments with sparse rewards. In the Alice & Bob task, STAS achieved a 90% success rate within 30,000 episodes, whereas baseline methods like QMIX and COMA failed to learn the task entirely.
Beyond raw performance, STAS showed superior scalability. In 15-agent MPE scenarios, it maintained high rewards and low variance, while baseline performance degraded as the number of agents increased. Furthermore, a correlation analysis between assigned credits and actual agent proximity to targets revealed that STAS (0.3592 correlation) more accurately identifies contributing agents than SQDDPG (0.2672) or QMIX (-0.1572).
Conclusion
STAS effectively transforms non-Markovian delayed reward problems into Markovian dense reward problems. By treating credit assignment as a two-dimensional spatial-temporal problem, it provides a robust framework for training agents in complex, cooperative environments where feedback is scarce. Future work will look into extending this decomposition to competitive or mixed-motive environments and integrating STAS as a modular component for other MARL architectures.
Summary updated