mlsanityData to 14 Oct 2026

Safe In-Context Reinforcement Learning

arXiv 2509.25582 ↗First posted 29 Sep 2025cs.LGcited by 3

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

Abstract (arXiv)

In-context reinforcement learning (ICRL) is an emerging RL paradigm where an agent, after pretraining, can adapt to out-of-distribution test tasks without any parameter updates, instead relying on an expanding context of interaction history. While ICRL has shown impressive generalization, safety during this adaptation process remains unexplored, limiting its applicability in real-world deployments where test-time behavior is expected to be safe. In this work, we propose SCARED: Safe Contextual Adaptive Reinforcement via Exact-penalty Dual, the first method that promotes safe adaptation of ICRL under the constrained Markov decision process framework. During the parameter-update-free adaptation process, our agent not only maximizes the reward but also keeps the accumulated cost within a user-specified safety budget. We also demonstrate that the agent actively reacts to the safety budget; with a higher safety budget, the agent behaves more aggressively, and with a lower safety budget the agent behaves more conservatively. Across challenging benchmarks, SCARED consistently enables safe and robust in-context adaptation, outperforming existing ICRL and safe meta-RL baselines.

Key facts. Cited by 3 papers in the map (data through 14 Oct 2026). Placed in Safe and constrained RL, one of 15 directions in Deep reinforcement learning methods. Builds on 47 of its 73 references that are in the map. First posted on arXiv 29 Sep 2025.

Builds on

47 of 73 references.

Closest ancestors · 1

Same direction, newest first

  1. 2024A Survey of Constraint Formulations in Safe Reinforcement Learning3 Feb

Other references · 46

  1. 2017Attention Is All You Needcited by 60,361
  2. 2017Proximal Policy Optimization Algorithmscited by 15,215
  3. 2017Model-Agnostic Meta-Learning for Fast Adaptation of Deep Networkscited by 4,897
  4. 2016Overcoming catastrophic forgetting in neural networkscited by 4,787
  5. 2023Mamba: Linear-Time Sequence Modeling with Selective State Spacescited by 4,718
  6. 2015Continuous control with deep reinforcement learningcited by 3,407
  7. 2020D4RL: Datasets for Deep Data-Driven Reinforcement Learningcited by 1,427
  8. 2017Constrained Policy Optimizationcited by 983
  9. 2015End-to-End Training of Deep Visuomotor Policiescited by 875
  10. 2016RL2: Fast Reinforcement Learning via Slow Reinforcement Learningcited by 503
  11. 2018Reward Constrained Policy Optimizationcited by 417
  12. 2016Learning to reinforcement learncited by 377
34 more
  1. 2022ScienceWorld: Is your Agent Smarter than a 5th Grader?cited by 327
  2. 2022In-context Reinforcement Learning with Algorithm Distillationcited by 190
  3. 2022A Review of Safe Reinforcement Learning: Methods, Theory and Applicationscited by 181
  4. 2021A Survey of Zero-shot Generalisation in Deep Reinforcement Learningcited by 170
  5. 2022Prompting Decision Transformer for Few-Shot Policy Generalizationcited by 146
  6. 2023Safety-Gymnasium: A Unified Safe Reinforcement Learning Benchmarkcited by 143
  7. 2023Supervised Pretraining Can Learn In-Context Reinforcement Learningcited by 139
  8. 2020CRPO: A New Approach for Safe Reinforcement Learning with Convergence Guaranteecited by 134
  9. 2020Safe Reinforcement Learning in Constrained Markov Decision Processescited by 115
  10. 2023Structured State Space Models for In-Context Reinforcement Learningcited by 111
  11. 2023A Tutorial on Meta-Reinforcement Learningcited by 108
  12. 2023Transformers as Decision Makers: Provable In-Context Reinforcement Learning via Supervised Pretrainingcited by 83
  13. 2024Can large language models explore in-context?cited by 76
  14. 2023Constrained Decision Transformer for Offline Safe Reinforcement Learningcited by 69
  15. 2018Accelerated Primal-Dual Policy Optimization for Safe Reinforcement Learningcited by 62
  16. 2022Constrained Update Projection Approach to Safe Policy Optimizationcited by 58
  17. 2021Muesli: Combining Improvements in Policy Optimizationcited by 53
  18. 2023Generalization to New Sequential Decision Making Tasks with In-Context Learningcited by 39
  19. 2025A Survey of In-Context Reinforcement Learningcited by 39
  20. 2025Reward Is Enough: LLMs Are In-Context Reinforcement Learnerscited by 31
  21. 2023Emergence of In-Context Reinforcement Learning from Noise Distillationcited by 27
  22. 2024In-Context Decision Transformer: Reinforcement Learning via Hierarchical Chain-of-Thoughtcited by 26
  23. 2023In-Context Reinforcement Learning for Variable Action Spacescited by 24
  24. 2024Transformers Can Learn Temporal Difference Methods for In-Context Reinforcement Learningcited by 23
  25. 2024In-context Exploration-Exploitation for Reinforcement Learningcited by 16
  26. 2024AMAGO-2: Breaking the Multi-Task Barrier in Meta-Reinforcement Learning with Transformerscited by 15
  27. 2025Distilling Reinforcement Learning Algorithms for In-Context Model-Based Planningcited by 13
  28. 2025Robust Gymnasium: A Unified Modular Benchmark for Robust Reinforcement Learningcited by 13
  29. 2024A CMDP-within-online framework for Meta-Safe Reinforcement Learningcited by 12
  30. 2023Cross-Episodic Curriculum for Transformer Agentscited by 10
  31. 2021MESA: Offline Meta-RL for Safe Adaptation and Fault Tolerancecited by 8
  32. 2024Artificial Generational Intelligence: Cultural Accumulation in Reinforcement Learningcited by 8
  33. 2024N-Gram Induction Heads for In-Context RL: Improving Stability and Reducing Data Needscited by 7
  34. 2025Towards Provable Emergence of In-Context Reinforcement Learningcited by 3

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2026: 3.

3 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2026Safe Continual Reinforcement Learning under Nonstationarity via Adaptive Safety Constraints
  2. 2024Safe and Robust Reinforcement Learning: Principles and Practice
  3. 2025Provably Optimal Reinforcement Learning under Safety Filtering
  4. 2024Safe Reinforcement Learning in Black-Box Environments via Adaptive Shielding
  5. 2025Safe But Not Sorry: Reducing Over-Conservatism in Safety Critics via Uncertainty-Aware Modulation
  6. 2025Adaptive Shielding for Safe Reinforcement Learning under Hidden-Parameter Dynamics Shifts
  7. 2025Safety Modulation: Enhancing Safety in Reinforcement Learning through Cost-Modulated Rewards
  8. 2024Safe Reinforcement Learning with Learned Non-Markovian Safety Constraints