Back to research
ICML 2024 · PMLR 2352024

Langevin Policy for Safe Reinforcement Learning

Fenghao Lei · Long Yang · Shiting Wen · Zhixiong Huang · Zhiwang Zhang · Chaoyi Pang

Sample actions that balance reward and constraints, then distill the Langevin Policy into a generator for practical reinforcement learning.

Safe reinforcement learning must maximize reward while keeping cumulative cost below a defined limit. Langevin Policy approaches this as a sampling problem: desirable actions should become more likely, unsafe actions less likely, without changing the policy uncontrollably.

Sampling for safe improvement

The energy function combines reward advantage, cost advantage and the current policy probability. Reward favors useful actions, the cost term suppresses unsafe ones, and the policy term keeps each update controlled.

Making sampling practical

LAC starts each short Langevin chain from an action proposed by the current actor, rather than unrelated noise. This makes refinement efficient enough to serve as a training signal.

Actor proposal

The current policy supplies an informed initial action, avoiding a long sampling chain from unrelated Gaussian noise.

Energy-guided refinement

Reward and cost critics reshape the sample together: useful regions attract it, while unsafe regions are suppressed without removing exploration.

Policy distillation

The refined action becomes a learning target for an actor that executes in one pass; sampling improves the policy during training without slowing deployment.

LAC uses the Langevin sampler as a policy-improvement teacher and the actor as its efficient deployable approximation.

The refined action becomes a target for the actor. The sampler acts as a policy-improvement teacher, while the actor distills that result into a policy that executes in one forward pass.

Reward and safety

The evaluation covers four constrained MuJoCo tasks and four randomized Safety Gym tasks. Every method trains for 2.5 million environment steps.

4 / 4

MuJoCo tasks within the reported cost limit

4 / 4

Safety Gym tasks within the reported cost limit

2.5M

environment steps in each evaluation

Scope. The deployed actor approximates the sampled policy, and the Gaussian generator limits expressiveness; the reported evaluation is simulation-based.

Langevin Policy reframes safe policy improvement as sampling from a reward- and constraint-aware energy landscape. LAC then turns that theoretically motivated but expensive sampler into a practical actor-critic algorithm by using short chains, conservative critics and policy distillation.

Abstract and citation

Existing safe reinforcement learning methods are predominantly optimization-based, leaving the potential of sampling-based safe policies underexplored. This work formulates a Langevin Policy that directly infers actions through a numerical solver for continuous-time Langevin dynamics. It further proposes Langevin Actor-Critic (LAC), which accumulates transitions induced by the Langevin Policy and reproduces them with a generator for efficient inference. Experiments on MuJoCo and Safety Gym demonstrate an effective balance between reward and safety constraints.

@inproceedings{lei2024langevin,
  title={Langevin Policy for Safe Reinforcement Learning},
  author={Lei, Fenghao and Yang, Long and Wen, Shiting and Huang, Zhixiong and Zhang, Zhiwang and Pang, Chaoyi},
  booktitle={Proceedings of the 41st International Conference on Machine Learning},
  pages={27174--27190},
  year={2024},
  volume={235},
  series={Proceedings of Machine Learning Research}
}