Constrained Reinforcement Learning with Average Reward Objective: Model-Based and Model-Free Algorithms

Vaneet Aggarwal, Washim Uddin Mondal, Qinbo Bai · DOI

Introduction

Reinforcement Learning (RL) has traditionally been categorized into two primary paradigms: episodic tasks, which have a defined termination point, and discounted reward tasks, where immediate gains are prioritized over future outcomes. However, many critical real-world applications—ranging from autonomous driving and supply chain management to data center cooling—operate continuously over long horizons. In these scenarios, the most relevant metric is the average reward per time step.

Beyond simply maximizing performance, these systems must operate within strict safety and resource boundaries. This necessitates a framework for Constrained Reinforcement Learning (CRL) within Constrained Markov Decision Processes (CMDPs). This paper addresses the theoretical and practical challenges of learning optimal policies in unknown environments while ensuring that safety constraints are not violated during the learning process.

The Challenge of Average Reward Constraints

In an average reward setting, the goal is to maximize the long-term expected reward while ensuring that the long-term expected costs remain below a specific threshold. This is significantly more complex than the discounted setting because the "value" of a state cannot be easily calculated using a discount factor. Furthermore, ensuring safety during the learning phase—rather than just in the final policy—requires the agent to be cautious about its exploration of unknown dynamics.

Model-Based Algorithms: C-UCRL and C-PSRL

The authors introduce two model-based approaches designed to achieve sublinear regret and zero constraint violations in ergodic environments:

  1. Constrained Upper Confidence Bound for RL (C-UCRL): This algorithm utilizes the principle of "optimism in the face of uncertainty." It maintains a confidence set of possible transition models and selects the most optimistic model and policy that satisfies a conservative version of the constraints.
  2. Constrained Posterior Sampling for RL (C-PSRL): This Bayesian alternative samples a transition model from a posterior distribution (e.g., a Dirichlet distribution) and solves for the optimal policy under conservative constraints.

The Conservative Slack Mechanism

A key innovation in both algorithms is the use of an epoch-dependent "slack" variable ($\epsilon_e$). By solving for a policy that is slightly more restrictive than the actual constraint, the agent creates a safety buffer. This buffer accounts for the agent's uncertainty regarding the environment's dynamics, effectively ensuring zero constraint violations with high probability as the agent learns.

Model-Free Policy Optimization

For systems with large state spaces where building an explicit transition model is computationally prohibitive, the paper proposes a Primal-Dual Policy Gradient algorithm. This model-free approach uses a Lagrange multiplier (a dual variable) to penalize constraint violations.

To handle the unique difficulties of the average reward objective without a simulator, the authors developed a subtrajectory-based advantage estimator. By analyzing disjoint subtrajectories that originate from the same state, the algorithm generates an unbiased estimate of the advantage function, allowing for stable policy updates in a continuous-running environment.

Theoretical Contributions and Results

The paper provides rigorous theoretical guarantees across different environment classes:

  • Ergodic Environments: In environments where every state is reachable from every other state, the model-based algorithms achieve $\tilde{O}(\sqrt{T})$ regret, matching the theoretical lower bound for unconstrained RL. The model-free algorithm achieves $\tilde{O}(T^{4/5})$ regret and violation, a marked improvement over the previous state-of-the-art bound of $\tilde{O}(T^{5/6})$.
  • Weakly Communicating MDPs: The authors extend their model-based framework to weakly communicating MDPs—a broader class of environments where some states may be transient. In these more complex settings, the proposed methods achieve $\tilde{O}(T^{2/3})$ regret and violation.

Empirical Validation

The algorithms were benchmarked using a simulated single-server queue system. The agent's task was to manage customer flow and service rates to maximize rewards (linked to low queue length) while adhering to constraints on power consumption and service costs. The results confirmed that the conservative slack mechanism successfully prevents constraint violations while the agent converges toward an optimal control policy.

Conclusion and Future Directions

This research bridges a significant gap in CRL by providing robust algorithms for the average reward setting. While the model-based methods achieve optimal regret, the model-free approach offers a scalable alternative for complex systems. Future work remains to close the theoretical gap between model-based and model-free regret bounds and to develop "parameter-free" versions of these algorithms that do not require prior knowledge of environment mixing times.

Summary updated

Abstract

Publishers of Foundations and Trends, making research accessible
BibTeX
@article{aggarwal2024constrained,
  author = {Vaneet Aggarwal and Washim Uddin Mondal and Qinbo Bai},
  title = {{Constrained Reinforcement Learning with Average Reward Objective: Model-Based and Model-Free Algorithms}},
  journal = {Found. Trends Optim.},
  year = {2024},
  doi = {10.1561/2400000038},
}
Figure