Interpreting Primal-Dual Algorithms for Constrained MARL

Daniel Tabas, Ahmed S. Zamzam, Baosen Zhang

Abstract

Constrained multiagent reinforcement learning (C-MARL) is essential for real-world applications like energy systems and drone swarms. Most C-MARL algorithms utilize a primal-dual approach to enforce constraints via penalty functions. This paper investigates the structural effects of these penalties. We demonstrate that standard penalty functions often lead to weak safety notions, but can be modified to enforce rigorous probabilistic constraints such as Chance and Conditional Value at Risk (CVaR). Furthermore, we introduce a "Structured Critic" that leverages the known affine relationship between rewards and costs to improve value estimation. Simulations in multiagent environments show that our approach accelerates convergence to safe joint policies and significantly reduces estimation error.

Introduction

As reinforcement learning (RL) transitions from simulated games to physical systems—such as power grids and autonomous fleets—safety becomes a primary requirement rather than an auxiliary goal. In multiagent settings, agents must maximize collective rewards while adhering to system-wide constraints, such as avoiding transformer overloads or preventing collisions.

Multiagent coordination in a building energy management system with grid constraints.

The prevailing method for handling these constraints is the primal-dual (Lagrangian) approach, which augments the reward function with a penalty term proportional to constraint violations. However, this method suffers from two main drawbacks: a lack of interpretability regarding real-world safety guarantees and instability during training due to the constantly shifting weight (dual variable) of the penalty term.

Safety via the Occupation Measure

To address the interpretability issue, we utilize the concept of the occupation measure, which represents the probability distribution of agent states over a discounted horizon. By reinterpreting standard penalty terms through this lens, we show that specific modifications to the penalty function can enforce rigorous risk metrics:

  • Chance Constraints: By using an indicator function as a penalty, we can ensure the probability of violation remains below a defined threshold.
  • Conditional Value at Risk (CVaR): By employing a ReLU-like penalty function, we can control the severity of worst-case violations (tail risk).

This framework allows practitioners to translate high-level safety requirements into precise mathematical constraints within the RL objective.

The Structured Critic

A significant challenge in primal-dual RL is the instability of the "critic," which must estimate the value of a state while the penalty weight (λ) changes. Standard critics attempt to learn this complex relationship from scratch. We observe that the total value function V is actually an affine combination of reward-based value ($V_{reward}$) and cost-based value ($V_{cost}$): $V = V_{reward} - \lambda \cdot V_{cost}$.

We propose a Structured Critic architecture that trains two separate neural networks—one for rewards and one for costs. These are then combined using the known affine formula. This "informed" architecture ensures that the critic's estimates remain mathematically consistent even as λ fluctuates, leading to more stable and efficient learning.

Experimental Results

We evaluated our approach using a modified Multiagent Particle Environment (MPE) and motivated our work with Building Energy Management (BEM) scenarios. In MPE, agents were required to reach landmarks while staying within a shared "safety zone."

Comparison of Mean Squared Temporal Difference Error (MS TDE) for Generic (GC) and Structured (SC) critics.

Our results demonstrate that the C-MAA2C (Constrained Multiagent Advantage Actor Critic) algorithm equipped with a Structured Critic (SC) converges to safe policies significantly faster than generic implementations. As shown in the error analysis, the Structured Critic drastically reduces the Mean Squared Temporal Difference Error (MS TDE) compared to generic critics (GC). Specifically, the error in estimating the CVaR upper bound was reduced from 18.3% to just 3.7%, allowing agents to operate more efficiently near safety boundaries without violating them.

Conclusion

By reinterpreting primal-dual penalties through occupation measures and introducing a structured critic, we provide a more interpretable and stable framework for C-MARL. These innovations allow for the enforcement of meaningful safety guarantees like Chance and CVaR constraints while accelerating the learning process. Future work will explore the fair distribution of safety costs among agents and the scaling of these methods to higher-dimensional environments.

Summary updated

BibTeX
@inproceedings{tabas2023interpreting,
  author = {Daniel Tabas and Ahmed S. Zamzam and Baosen Zhang},
  title = {{Interpreting Primal-Dual Algorithms for Constrained MARL}},
  booktitle = {L4DC},
  year = {2023},
}
Figure