mlsanityData to 24 Nov 2026

Algorithm Distillation for Safe In-Context Reinforcement Learning

arXiv 2611.21524 ↗Submitted 16 Nov 2026cs.LG cs.AIcited by 0

On the map: Deep reinforcement learning methods → Safe and constrained RL

Abstract (arXiv)

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.

Key facts. No citing papers in the map yet (data through 24 Nov 2026). Placed in Safe and constrained RL, one of 15 directions in Deep reinforcement learning methods. Builds on 42 of its 51 references that are in the map. Submitted 16 Nov 2026.

Builds on

42 of 51 references.

Closest ancestors · 5

Same direction, newest first

  1. 2026Latent Q-Barrier Shielding for Safe In-Context Reinforcement Learning24 May
  2. 2026Safety Generalization Under Distribution Shift in Safe Reinforcement Learning: A Diabetes Testbed28 Jan
  3. 2025Adaptive Shielding for Safe Reinforcement Learning under Hidden-Parameter Dynamics Shifts20 May
  4. 2024ActSafe: Active Exploration with Safety Constraints for Reinforcement Learning12 Oct
  5. 2024A Survey of Constraint Formulations in Safe Reinforcement Learning3 Feb

Other references · 37

  1. 2017Model-Agnostic Meta-Learning for Fast Adaptation of Deep Networkscited by 4,967
  2. 2021Decision Transformer: Reinforcement Learning via Sequence Modelingcited by 1,582
  3. 2017Constrained Policy Optimizationcited by 1,029
  4. 2016RL2: Fast Reinforcement Learning via Slow Reinforcement Learningcited by 528
  5. 2016Learning to reinforcement learncited by 396
  6. 2020Projection-Based Constrained Policy Optimizationcited by 210
  7. 2022In-context Reinforcement Learning with Algorithm Distillationcited by 205
  8. 2021A Survey of Zero-shot Generalisation in Deep Reinforcement Learningcited by 180
  9. 2023Safety-Gymnasium: A Unified Safe Reinforcement Learning Benchmarkcited by 155
  10. 2022Prompting Decision Transformer for Few-Shot Policy Generalizationcited by 152
  11. 2023Supervised Pretraining Can Learn In-Context Reinforcement Learningcited by 149
  12. 2020CRPO: A New Approach for Safe Reinforcement Learning with Convergence Guaranteecited by 144
25 more
  1. 2020Safe Reinforcement Learning in Constrained Markov Decision Processescited by 117
  2. 2023A Tutorial on Meta-Reinforcement Learningcited by 115
  3. 2023Transformers as Decision Makers: Provable In-Context Reinforcement Learning via Supervised Pretrainingcited by 92
  4. 2023Constrained Decision Transformer for Offline Safe Reinforcement Learningcited by 74
  5. 2022Constrained Update Projection Approach to Safe Policy Optimizationcited by 61
  6. 2022Contextualize Me -- The Case for Context in Reinforcement Learningcited by 50
  7. 2025A Survey of In-Context Reinforcement Learningcited by 44
  8. 2023Generalization to New Sequential Decision Making Tasks with In-Context Learningcited by 42
  9. 2025Reward Is Enough: LLMs Are In-Context Reinforcement Learnerscited by 35
  10. 2023Safe Offline Reinforcement Learning with Real-Time Budget Constraintscited by 29
  11. 2023Emergence of In-Context Reinforcement Learning from Noise Distillationcited by 28
  12. 2023In-Context Reinforcement Learning for Variable Action Spacescited by 27
  13. 2024Transformers Can Learn Temporal Difference Methods for In-Context Reinforcement Learningcited by 27
  14. 2024In-Context Decision Transformer: Reinforcement Learning via Hierarchical Chain-of-Thoughtcited by 27
  15. 2022Achieving Zero Constraint Violation for Constrained Reinforcement Learning via Conservative Natural Policy Gradient Primal-Dual Algorithmcited by 22
  16. 2023Constraint-Conditioned Policy Optimization for Versatile Safe Reinforcement Learningcited by 21
  17. 2024AMAGO-2: Breaking the Multi-Task Barrier in Meta-Reinforcement Learning with Transformerscited by 17
  18. 2024A CMDP-within-online framework for Meta-Safe Reinforcement Learningcited by 15
  19. 2024Temporal Logic Specification-Conditioned Decision Transformer for Offline Safe Reinforcement Learningcited by 11
  20. 2025Vintix: Action Model via In-Context Reinforcement Learningcited by 11
  21. 2021MESA: Offline Meta-RL for Safe Adaptation and Fault Tolerancecited by 9
  22. 2026Beyond Linear Attention: Softmax Transformers Implement In-Context Reinforcement Learningcited by 7
  23. 2025Scalable In-Context Q-Learningcited by 6
  24. 2025Towards Provable Emergence of In-Context Reinforcement Learningcited by 4
  25. 2026Convergence and Emergence of In-Context Reinforcement Learning with Chain of Thoughtcited by 4

Built on by

Not cited yet.

Similar, not cited

Close in wording, no citation either way

  1. 2025Safe In-Context Reinforcement Learning
  2. 2024Revisiting Safe Exploration in Safe Reinforcement learning
  3. 2026Imagine to Ensure Safety in Hierarchical Reinforcement Learning
  4. 2026Evaluation Metrics for Safe Reinforcement Learning
  5. 2025Constraint-Aware Reinforcement Learning via Adaptive Action Scaling
  6. 2024Safe Reinforcement Learning with Learned Non-Markovian Safety Constraints
  7. 2025Safety Representations for Safer Policy Learning
  8. 2026Safe Continual Reinforcement Learning under Nonstationarity via Adaptive Safety Constraints