AAMAS Conference 2026 Conference Paper
OSIL: Learning Offline Safe Imitation Policies with Safety Inferred from Non-preferred Trajectories
- Returaj Burnwal
- Nirav Pravinbhai Bhatt
- Balaraman Ravindran
This work addresses the problem of offline safe imitation learning (IL), where the goal is to learn safe and reward-maximizing policies from demonstrations that do not have per-timestep safety cost or rewardinformation. Inmanyreal-worlddomains, onlinelearningin the environment can be risky, and specifying accurate safety costs can be difficult. However, it is often feasible to collect trajectories that reflect undesirable or unsafe behavior, implicitly conveying what the agent should avoid. We refer to these as non-preferred trajectories. We propose a novel offline safe IL algorithm, OSIL, that inferssafetyfromnon-preferreddemonstrations. Weformulatesafe policy learning as a Constrained Markov Decision Process (CMDP). Instead of relying on explicit safety cost and reward annotations, OSIL reformulates the CMDP problem by deriving a lower bound on reward maximizing objective and learning a cost model that estimates the likelihood of non-preferred behavior. Our approach allows agents to learn safe and reward-maximizing behavior entirelyfromofflinedemonstrations. Weempiricallydemonstratethat our approach can learn safer policies that satisfy cost constraints without degrading the reward performance, thus outperforming several baselines.