How Does the Lagrangian Guide Safe Reinforcement Learning through Diffusion Models?
Xiaoyuan Cheng, Wenxuan Yuan, Boyang Li, Yuanchao Xu, Yiming Yang, Hao Liang, Bei Peng, Robert Loftin, Zhuo Sun, Yukun Hu
TL;DR
This work tackles safe online reinforcement learning with expressive diffusion policies. It reframes safety as an energy-based constraint via a Lagrangian and introduces an augmented Lagrangian $\mathcal{L}_A$ to locally convexify the energy landscape, preserving the optimal Boltzmann policy $\pi^*(a|s) \propto \exp(-\mathcal{L}(s,a,\lambda^*)/\beta)$. The proposed ALGD framework guides the reverse diffusion with an energy-aware score, employing an ensemble of cost critics and Monte Carlo score estimation to achieve stable training and reduced constraint violations. Empirical results on Safety-Gym and velocity-constrained MuJoCo demonstrate competitive rewards with improved safety, and ablations validate the roles of Monte Carlo sampling, critic ensembles, and the convexification strength. Overall, ALGD provides a principled, scalable approach to online safe RL with diffusion-based policies, enabling safer, multimodal action exploration in robotics and autonomous systems.
Abstract
Diffusion policy sampling enables reinforcement learning (RL) to represent multimodal action distributions beyond suboptimal unimodal Gaussian policies. However, existing diffusion-based RL methods primarily focus on offline settings for reward maximization, with limited consideration of safety in online settings. To address this gap, we propose Augmented Lagrangian-Guided Diffusion (ALGD), a novel algorithm for off-policy safe RL. By revisiting optimization theory and energy-based model, we show that the instability of primal-dual methods arises from the non-convex Lagrangian landscape. In diffusion-based safe RL, the Lagrangian can be interpreted as an energy function guiding the denoising dynamics. Counterintuitively, direct usage destabilizes both policy generation and training. ALGD resolves this issue by introducing an augmented Lagrangian that locally convexifies the energy landscape, yielding a stabilized policy generation and training process without altering the distribution of the optimal policy. Theoretical analysis and extensive experiments demonstrate that ALGD is both theoretically grounded and empirically effective, achieving strong and stable performance across diverse environments.
