TL;DR
Training a robot or AI agent to be safe without letting it crash in the real world requires learning from static, pre-collected data—a setup called offline safe reinforcement learning. Existing algorithms permanently bake the trade-off between "getting high rewards" and "playing it safe" into the model during training, often leaving the agent either recklessly aggressive or paralyzed by caution. This paper introduces Co3G, a generative framework that decouples reward and safety during training so you can dynamically dial an agent's conservatism up or down at deployment time.
What Problem Does This Paper Address?
Reinforcement Learning (RL) thrives on trial and error, which is great for video games, but terrible for autonomous cars or surgical robots. Offline Safe RL solves this by teaching agents to maximize rewards while obeying strict safety constraints (zero cost/violations), purely from pre-recorded datasets.
Recently, top-performing methods for strict "hard-constraint" safety have combined Implicit Q-Learning (a way to estimate action values without querying unseen, out-of-distribution actions) with Hamilton–Jacobi (HJ) reachability analysis—a mathematical tool from control theory that maps out whether a state can ever lead to an unavoidable crash.
The catch? These methods tangle reward maximization and safety satisfaction together during offline training using a single, fixed hyperparameter. Because different tasks have wildly different risk profiles, a one-size-fits-all conservatism setting fails: the agent ends up too reckless on tricky tasks, or so overly cautious on others that it fails to do its job entirely. Once trained, you can't adjust its caution without retraining from scratch.
Methods
To make caution adjustable on the fly, the authors propose Co3G (Conservatism Controllable Compositional Guidance). Instead of learning one monolithic policy, Co3G borrows compositional generation from multi-condition image generators (which let you blend prompts like "a cat" + "oil painting" at test time).
Here is what is standard versus what is new:
- Standard: Co3G estimates value functions from offline data using expectile regression and HJ reachability, just like prior state-of-the-art methods (specifically FISOR).
- New (Decoupled Flow Matching): Instead of coupling those values into one policy, Co3G separates them via compositional score matching. Practically, it replaces standard diffusion with flow matching—a simpler, more stable generative approach—training two distinct velocity fields: one pointing toward high-reward actions, and another pointing toward safe actions.
- New (Test-Time Dials): At deployment, Co3G blends these two velocity fields using two scalar knobs: a reward guidance scale ($w_r$) and a cost/safety guidance scale ($w_c$). To set these knobs, the authors introduce three strategies:
- Manual: Start conservatively and tweak the two numbers based on test performance.
- Rejection Sampling (RS): Sample a grid of knob settings and random noise to generate candidate actions, filter for safe ones using the learned safety value function, and pick the highest-reward option.
- Latent RL: Train a lightweight meta-policy that looks at the current state and dynamically outputs the optimal guidance knobs and starting generation noise on the fly, evaluated by newly distilled, policy-aware value networks.
Datasets
The authors evaluate Co3G on the established OSRL (Offline Safe Reinforcement Learning) benchmark, introducing no new datasets:
- Safety-Gymnasium (21 tasks): 16 navigation tasks (Point and Car robots navigating Buttons, Circles, Goals, and Pushes) and 5 velocity control tasks (Ant, HalfCheetah, Hopper, Swimmer, Walker2d).
- Bullet Safety Gym (1 task): The
AntCircletask, used specifically for trajectory and distribution visualizations.
Key Insights and Ideas
- Safety and reward don't always have to fight: Intuitively, cranking up safety should tank your reward. Surprisingly, both the authors' theoretical proofs and empirical heatmaps show that within a reasonable range, increasing $w_r$ and $w_c$ together improves both reward and safety simultaneously compared to the unguided base policy.
- Flow matching stabilizes latent RL: In ablation studies, swapping flow matching back to a standard diffusion model worked fine for Manual and Rejection Sampling, but caused safety to degrade under the RL variant. Flow matching's smoother, more stable training dynamics make it a much better foundation when another RL agent is steering its inputs.
- Offline safety values aren't enough for active steering: When selecting actions automatically, relying solely on the policy-independent HJ safety values learned offline leads to blind spots. Distilling policy-aware value functions (tracking actual costs incurred by the policy) was crucial for the Latent RL variant's massive jump in safety.
Key Results
On the 21 Safety-Gymnasium tasks, an agent is deemed "safe" if its normalized cost is $\le 1.0$. Co3G dominates both soft- and hard-constraint baselines:
- Doubling the safety rate: The strongest baselines (CAPS and BC-Safe) satisfied safety constraints in 9/21 tasks, while FISOR—which uses the exact same underlying value functions as Co3G—succeeded in only 7/21 tasks (average cost 3.67).
- Strong performance across all three variants:
- Co3G RL achieved safety in 19/21 tasks—more than double the best baseline—slashing average cost to 0.46 (with a 0.22 normalized reward).
- Co3G Manual hit 16/21 safe tasks while maintaining a high average reward of 0.34 (matching FISOR's 0.35 reward, but dropping average cost from 3.67 down to 0.97).
- Co3G RS achieved 14/21 safe tasks using identical hyperparameters across every single environment.
Limitations and Future Work
- Limitations: Each tuning mechanism carries a trade-off. Manual tuning requires human-in-the-loop deployment trials; Rejection Sampling offers more limited conservatism control when locked to uniform hyperparameters; and in Co3G RL, pushing the search bounds for guidance scales and noise too high eventually triggers out-of-distribution actions and overly conservative behavior that chips away at total reward.
- Future Work: Because Co3G cleanly separates "how to do the task" from "how to stay safe," the authors highlight a fascinating modular future: pairing one shared, pre-trained reward velocity model with swap-in safety velocity models for multi-task transfer, as well as scaling the framework up to Vision-Language-Action (VLA) models in embodied robotics.
Summary updated