TL;DR
Redistribution-based Cost Inference (RCI) solves a major bottleneck in safe offline reinforcement learning by eliminating the need for expensive, per-step safety annotations. By leveraging return decomposition, RCI transforms simple trajectory-level "stop-feedback" (like an emergency stop trigger) into dense, per-step cost estimates. This approach is theoretically guaranteed to preserve the optimal policy while practically reducing safety violations by up to fivefold without sacrificing task performance.
What Problem Does This Paper Address?
To safely deploy reinforcement learning (RL) agents in real-world scenarios like autonomous driving or robotics, algorithms typically use Constrained Markov Decision Processes (CMDPs). These models maximize a reward function while ensuring that the expected cumulative cost of safety violations stays below a strict budget.
In the offline safe RL setting, agents learn entirely from pre-collected historical datasets. Standard CMDP methods assume these datasets are meticulously annotated with dense, per-step costs (e.g., a penalty value for every single millisecond the agent gets too close to an obstacle). In reality, human supervisors or automated safety monitors only provide trajectory-level stop-feedback—a binary signal indicating that an episode was halted because a violation occurred.
This leaves us with a severe temporal credit assignment problem: if a vehicle crashes at step 100, which of its earlier actions (at step 20, 50, or 80) actually caused the failure? Without knowing per-step costs, standard safe RL algorithms struggle to train effectively.
Methods
The authors introduce Redistribution-based Cost Inference (RCI), a modular three-stage framework that bridges the gap between sparse feedback and dense safe RL algorithms:
- Expert Feedback Collection: Trajectories are evaluated based on simple binary stop-feedback (1 if a violation occurred, 0 otherwise) and are truncated at the first point of failure.
-
Return Decomposition: RCI trains a sequence model (instantiated as an LSTM in this paper) to predict the total episodic cost based on trajectory prefixes. It then extracts dense, per-step costs ($\tilde{c}_t$) by calculating the difference between successive predictions: $$\tilde{c}_t = \hat{C}(s_{0:t}, a_{0:t}) - \hat{C}(s_{0:t-1}, a_{0:t-1}) + \delta_t$$ Crucially, a terminal correction term ($\delta_T$) is introduced to guarantee return equivalence, ensuring that the sum of the redistributed step costs exactly matches the true trajectory outcome.
-
Constrained Offline Policy Learning: Because the framework is completely decoupled, any standard constrained offline RL algorithm can be deployed on this newly augmented dataset. The authors use BCQ-Lagrangian, which uses a Variational Autoencoder (VAE) to keep the learned policy close to the data distribution while adaptively tuning a Lagrange multiplier to enforce safety.
Datasets
The framework was evaluated on 5,000 offline episodes across two continuous control benchmark environments:
- HighwayEnv: An autonomous driving task where an ego vehicle must navigate highway traffic. A transition is labeled unsafe if the vehicle comes within 0.2 units of another vehicle.
- Safe-FetchReach: A 7-DOF robotic arm manipulation task where the end-effector must reach a target position while avoiding a spherical hazard zone.
To test robustness, datasets were generated using three distinct behavioral configurations: goal-directed but aggressive policies (trained via PPO), uniform random action sampling, and a mixed composition of both.
Key Insights and Ideas
- Decoupling Credit Assignment from Policy Learning: By treating cost redistribution and policy optimization as separate problems, RCI remains highly flexible. You can swap out the sequence model (e.g., replacing the LSTM with a Transformer) or change the underlying safe RL algorithm without modifying the rest of the pipeline.
- Theoretical Losslessness (Policy Invariance): The authors mathematically prove that return-equivalent cost redistribution preserves the exact same feasible policy set and optimal Lagrangian saddle point as the original sparse CMDP. Remarkably, this guarantee holds true regardless of the sequence model's prediction accuracy, thanks to the telescoping nature of the redistribution formula.
- Better-Conditioned Critic Learning: While sparse and dense formulations share the same theoretical optimal policy, sparse signals provide a brutal landscape for neural network critics to learn from. RCI smooths out this landscape, allowing the cost critic to learn meaningful, globally coherent spatial risk structures (like identifying dangerous approach corridors long before a crash happens).
Key Results
RCI demonstrated a powerful ability to minimize safety violations while preserving high task rewards across both domains:
- Fivefold Violation Reduction: In
Safe-FetchReach, RCI achieved a roughly fivefold reduction in constraint violation rates compared to baseline models using raw sparse labels. - Maintained Performance: In
HighwayEnv, RCI significantly outperformed sparse and classifier-based baselines in safety, while its task return remained statistically indistinguishable from an unconstrained agent. - Robustness to Noise: RCI proved highly resilient to label corruptions, maintaining stable performance even when the recorded time of failure was artificially shifted (noisy labels) or when 20% of the trajectory safety labels were completely flipped (adversarial labels).
Limitations and Future Work
Despite its strong performance, the authors highlight a few key limitations:
- Offline Data Coverage: RCI is still bound by standard offline RL limitations. If the dataset is heavily skewed toward unsafe trajectories or lacks sufficient safe exploration data, the policy can become overly conservative.
- Statistical vs. Causal Correlation: The return decomposition mechanism captures statistical associations between trajectory prefixes and failures rather than pure causal relationships. It identifies risky situations rather than pinpointing the exact causal action.
- Single Constraint Restriction: The current framework handles only a single binary constraint.
For future work, the authors suggest extending RCI to multi-constraint scenarios via per-channel decomposition, incorporating uncertainty-aware redistribution to handle distributional shift, and experimenting with more expressive sequence architectures like Transformers.
Summary updated