This paper introduces a new algorithm called POCC (Primal-Dual algorithm for Offline Convex CMDP) that makes offline safe reinforcement learning both more practical and theoretically efficient. By moving away from the restrictive "full data coverage" assumption and handling general convex objectives, the authors provide a framework that can learn optimal, safe policies even from messy, incomplete datasets.
TL;DR
The authors propose a primal-dual method for offline safe RL that works with convex utility functions and requires only partial data coverage—meaning the dataset only needs to cover the optimal policy, not every possible dangerous action. Their approach improves the state-of-the-art sample complexity by a factor of $1/(1-\gamma)$, making it significantly more data-efficient for long-horizon tasks.
What Problem Does This Paper Address?
Reinforcement Learning (RL) in the real world often faces two massive hurdles: Safety and Data Availability.
- Offline RL: We cannot always let an agent explore freely (e.g., driving a car into a ditch to learn it is bad). We must learn from pre-collected, "offline" datasets.
- Safe RL (CMDPs): We need to maximize rewards while strictly staying under a "cost" threshold to satisfy safety constraints.
- Convex Objectives: Most RL assumes rewards are linear. However, many modern tasks—like imitation learning or maximum entropy exploration—use convex utility functions where the standard Bellman equation (the backbone of most RL) fails to hold.
The biggest gap the authors identify is the Coverage Assumption. Previous works often assumed the offline dataset covered all possible policies. In a safety context, this is a paradox: it implies the dataset must contain examples of every possible way to be dangerous. This paper relaxes that, assuming we only need data covering the optimal safe policy.
Methods
The authors develop POCC, a primal-dual optimization framework. Here are the technical highlights:
- Marginalized Importance Weights (MIW): Since Bellman equations break down in convex MDPs, the authors avoid using standard value functions (Q-values). Instead, they optimize over occupancy measures—essentially asking "how often does the optimal policy visit this state-action pair?"—using importance weights ($w$) relative to the offline data distribution.
- Relaxed Constraints: They formulate an empirical version of the problem that incorporates "uncertainty" parameters ($\zeta$ and $\kappa$). These parameters act as a buffer, accounting for the fact that the offline dataset is a finite sample and might suffer from distribution shifts.
- Primal-Dual Iteration: The algorithm performs gradient descent on the importance weights (Primal) and gradient ascent on the Lagrange multipliers for the safety and validity constraints (Dual).
- General Function Approximation: Unlike tabular methods that only work for small grids, POCC is designed to work with neural networks to represent the importance weights, making it applicable to high-dimensional problems.
Datasets and Key Results
The researchers evaluated POCC across three distinct types of environments:
- FrozenLake (Grid World): An 8x8 grid used to test the algorithm's robustness against completely random and safety-violated offline data.
- Maze Environment: Used for Safe Imitation Learning, where the goal is to mimic an expert's path while avoiding specific high-cost zones.
- SafetyGym: A suite of continuous control tasks (AntRun, CarRun, BallRun, BallCircle, CarPush1) to test how well safe RL scales to complex, physics-based robotics simulations.
Key Results: * Superior Safety: In SafetyGym benchmarks, POCC consistently achieved near-zero cost violations, whereas baselines like PDCA and BEAR-Lagrangian often exceeded the safety budget. * Robustness to Bad Data: On FrozenLake, POCC found the optimal safe path even when the training data was 100% random and full of safety violations. A leading baseline, COptiDICE, failed to learn a logical policy under the same conditions. * Sample Efficiency: The theoretical $1/\sqrt{n}$ convergence was backed up by experiments showing that as the dataset size ($n$) increased, the reward improved and the cost variance dropped much faster than competing methods.
Key Insights
- The $1/(1-\gamma)$ Win: In RL, $\gamma$ is the discount factor. As $\gamma$ approaches 1 (long-term planning), the problem gets much harder. POCC improves sample complexity from $\mathcal{O}(1/(1-\gamma)^2\sqrt{n})$ to $\mathcal{O}(1/(1-\gamma)\sqrt{n})$. This is a major theoretical leap for long-horizon tasks.
- Pessimism is Key: By using the relaxed parameters $\zeta$ and $\kappa$, the algorithm implicitly adopts a "pessimistic" view of the data it hasn't seen. This prevents the agent from over-estimating the safety of regions where data is sparse.
- Convexity as a Generalizer: By solving for Convex CMDPs, the authors effectively created a highly versatile algorithm. Standard linear RL is just a special case of their framework, but it also handles imitation learning and exploration out-of-the-box.
Limitations and Future Work
- Slater’s Condition: The proof relies on "Slater’s condition," which assumes there exists at least one strictly safe policy in the dataset. If the dataset is entirely composed of catastrophic failures, the algorithm cannot recover.
- Behavior Policy Knowledge: The current theory assumes we know the behavior policy ($\pi_\mu$) that collected the data. While they use behavior cloning to estimate it in practice, a version that is completely agnostic to the behavior policy would be a strong next step.
- Iteration Complexity: While the sample complexity is optimized, the iteration complexity (how many steps the solver takes) is $\mathcal{O}(1/\sqrt{K})$. The authors suggest that more advanced primal-dual techniques could potentially push this to $\mathcal{O}(1/K)$.
Summary updated