Algorithm Distillation for Safe In-Context Reinforcement Learning
Abstract
Safe in-context reinforcement learning (Safe ICRL) asks a policy with fixed parameters to improve on an unseen constrained task from its interaction history while aiming to keep its cost within a budget. Prior work studied Safe ICRL on five benchmarks in three families: a grid world with a hidden goal and obstacles (DarkRoom), continuous navigation where goals and hazards stay invisible until reached (PointGoal, CarGoal), and locomotion with a hidden velocity limit (HalfCheetah, Ant). Safe Algorithm Distillation (Safe AD), trained on the learning histories of a safe RL algorithm, has shown adaptation failures in prior evaluations. For example, in the locomotion tasks its return stays below zero, and it rarely reaches the goal in CarGoal. We revisit two parts of Safe AD. First, we distill a budget-aware teacher with two phases. It searches for the hidden task, exploring more when more budget remains. After its first reward or cost, an expert policy exploits the task within the remaining budget. We collect the teacher's histories under fixed or dynamic budgets. Dynamic budgets increase the occupancy entropy of the return and budget inputs in every environment, and at test time they improve return and lower cost in DarkRoom and HalfCheetah. Second, we propose A-Lag, a test-time adjustment that reweights the distilled policy's actions by their predicted cost, with an adaptive Lagrange multiplier that is updated from the costs observed. In our experiments, A-Lag had lower mean episode cost than Safe AD in all five environments, with lower mean final return in four.
Create a lesson
Metadata
- Categories
- cs.LG, cs.AI
Related papers
Transformers with Signatures: Towards Universal In-Context Learning in Path Space
Shared title terminologycs.LGZiheng Cheng, Xin Guo, Ben Hambly
SGPC: Safety-Guiding Policy Constraint for Stable Off-Policy Safe Reinforcement Learning
Shared title terminologycs.LGYifan Liu, Nan Zhang, Yang Cong
VESPA: Verifiable Symbolic Policy Adaptation for Safe Reinforcement Learning
Shared title terminologycs.LGPaul König, Sascha Marton, Stefan Lüdtke et al.
Similar Is Not Useful: Selecting In-Context Demonstrations by Closed-Loop Utility
Shared title terminologycs.LGJiachen Li, Zhigen Zhao, Shihao Li et al.
In-Context Estimation and Prediction for Parametric ODEs
Shared title terminologycs.LGAbdullah Ahmed, Yun Yang
The Price of Choosing Examples: Context Overfitting in Adaptive In-Context Learning
Shared title terminologycs.LGXiaoyu Li, Jiangxuan Long