NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Utility-Constrained Policy Optimization

Mehrdad Moghimi, Bernardo Avila Pires

TL;DR

Standard safe reinforcement learning enforces safety on average, meaning an agent can behave catastrophically once in a while as long as it is overly cautious the rest of the time. This paper introduces Utility-Constrained Policies (UCP), a practical method for enforcing risk-sensitive safety constraints that prevents extreme tail-end disasters. Better yet, because the safety budget is fed directly into the agent as an input, you can dial the agent's risk tolerance up or down at test time without ever retraining it.

What Problem Does This Paper Address?

When we want Reinforcement Learning (RL) agents to follow safety rules, the standard mathematical blueprint is the Constrained Markov Decision Process (CMDP). Alongside rewards, the agent accumulates "costs" for unsafe actions and must keep its expected (average) total cost below a set budget.

The catch? Expectations are "risk-neutral." If your self-driving car has a safety budget of 25 minor infractions per trip, an agent that drives flawlessly 99 times and causes a 2,500-point pileup on the 100th trip technically passes the test—its average cost is 25.

Researchers previously proposed Utility-Constrained MDPs (UCMDPs) to apply nonlinear "utility" functions to costs—allowing us to heavily penalize any single run that crosses the budget. However, solving UCMDPs required policies that remember their entire life history, making them intractable to train in practice.

Methods

To make UCMDPs practical, the authors introduce a primal-dual actor-critic algorithm called Utility-Constrained Policies (UCP). Instead of forcing the agent to remember its entire trajectory, they use stock augmentation: keeping a running tally of accumulated costs (the "stock") and appending it directly to the agent's current state.

UCP modifies the standard Soft Actor-Critic (SAC) algorithm with four key ingredients:

  1. Undiscounted Stock Tracking: The agent initializes its stock at negative the safety budget ($-b$) and adds raw, undiscounted costs as the episode unfolds. This acts as a live tracker of the remaining safety budget.
  2. Risk-Sensitive Utility: Rather than constraining average cost, UCP constrains excess cost using a rectified utility function, $(x)_+ = \max(x, 0)$. Safe runs below the budget aren't penalized at all, while runs that blow past the budget are penalized directly by their excess.
  3. Distributional Critics & Dual Updates: Because expected utility depends on the whole shape of future outcomes—not just the mean—UCP uses quantile regression to estimate the full distribution of future rewards and costs, paired with a learned Lagrange multiplier that dynamically scales the safety penalty.
  4. Initial Stock Randomization: During training, the starting budget is randomly sampled from a range (e.g., $[0, 30]$). Because both the actor and the Lagrange multiplier condition on this value, a single trained policy learns to adapt to any budget within that range on the fly.

Datasets

Because this is an interactive RL study rather than supervised learning, there are no static datasets. Instead, agents are trained and evaluated on Safety Gymnasium, a standard suite of continuous-control safe RL environments:

  • 6 Safety Velocity tasks (e.g., Ant, HalfCheetah, Humanoid, Walker2d), where agents move fast subject to velocity limits.
  • 16 Safety Navigation tasks (e.g., PointGoal, CarGoal, CarButton, CarPush), where agents navigate around hazards and fragile vases to reach targets.

No new benchmarks were introduced, though the authors also unpack Safety Gymnasium's aggregated cost signal to test multi-constraint variants (separately tracking hazards, vase contact, and vase velocity).

Key Insights and Ideas

  • Dial-a-Budget Flexibility: Conditioning on randomized initial stock turns a fixed-constraint policy into a universal one. At deployment, you can test different safety budgets instantly to inspect the marginal trade-off between reward and risk, with zero retraining.
Episodic return and cost across different test-time budgets without retraining.
  • Chopping Off the Dangerous Tail: A risk-neutral agent satisfying a budget of 25 will frequently exceed 25—sometimes incurring over 50 in cost—balancing those out with ultra-low-cost runs. UCP's risk-sensitive constraint aggressively trims the upper tail above the budget while sacrificing very little reward.
Empirical densities of episodic returns and costs comparing risk-neutral and risk-sensitive UCP.
  • Stricter Constraints Can Yield Better Rewards: Counterintuitively, UCP often beats risk-neutral baselines even on standard risk-neutral metrics. Combining initial budget randomization (which boosts state-space exploration) with strict excess-cost penalties guides the agent toward cleaner, higher-performing behaviors.
  • Keep the Past Undiscounted: Prior theory required reverse-discounting the stock, which exponentially inflates early costs as an episode drags on and destabilizes training. Leaving the stock undiscounted aligns directly with real-world cumulative safety budgets and dramatically improves learning.

Key Results

Evaluated against seven strong baselines (including PPO, SAC, and TD3 paired with Lagrangian, PID, Sauté, and Early-Termination methods):

  • Benchmark Dominance: UCP matches or outperforms all baselines across all 6 Safety Velocity tasks and outperforms all baselines by a large margin across all 16 Safety Navigation tasks, while respecting the benchmark cost limit of 25.
  • Sharp Reduction in Violations: On CarGoal1 (budget 25), a risk-neutral variant (UCP-Mean) exceeded the budget 36.4% of the time (averaging a cost of 46.0 when it violated) for a return of 34.0. Risk-sensitive UCP cut the violation frequency to 9.4% (average cost of 11.0, conditional violation cost of 31.4) while still achieving a 33.3 return—outperforming prior state-of-the-art model-based (29.08) and model-free (22.09) results.
  • Multi-Constraint Control: On CarGoal2, multi-constraint UCP (MC-UCP) independently controlled three distinct cost types, achieving a higher return (14.15) at a lower total cost (12.45) than single-constraint UCP (12.5 return at 17.2 cost).

Limitations and Future Work

  • Theory-Practice Gap: Using undiscounted stock alongside discounted future returns works remarkably well empirically, but breaks away from existing dynamic programming theory. Establishing formal optimality guarantees for this decoupled setup remains an open question.
  • Approximation Errors: Imperfect distributional value estimates and optimization challenges require introducing a small tolerance hyperparameter ($\epsilon$) in the Lagrange multiplier update, meaning minor constraint violations can still slip through in the extreme tail.
  • Future Directions: The authors note that UCP's recipe is modular: future work could swap SAC for on-policy algorithms like PPO or MPO, test sharper distributional critics, or stabilize the outer dual updates using control-theoretic PID-Lagrangian methods.

Summary updated

BibTeX
@inproceedings{moghimi2026utility,
  author = {Mehrdad Moghimi and Bernardo Avila Pires},
  title = {{Utility-Constrained Policy Optimization}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=bNRLgYY6QD},
}
Figure