Safe In-Context Reinforcement Learning
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
Other references · 46
- 2017Attention Is All You Needcited by 60,361
- 2017Proximal Policy Optimization Algorithmscited by 15,215
- 2017Model-Agnostic Meta-Learning for Fast Adaptation of Deep Networkscited by 4,897
- 2016Overcoming catastrophic forgetting in neural networkscited by 4,787
- 2023Mamba: Linear-Time Sequence Modeling with Selective State Spacescited by 4,718
- 2015Continuous control with deep reinforcement learningcited by 3,407
- 2020D4RL: Datasets for Deep Data-Driven Reinforcement Learningcited by 1,427
- 2017Constrained Policy Optimizationcited by 983
- 2015End-to-End Training of Deep Visuomotor Policiescited by 875
- 2016RL2: Fast Reinforcement Learning via Slow Reinforcement Learningcited by 503
- 2018Reward Constrained Policy Optimizationcited by 417
- 2016Learning to reinforcement learncited by 377
34 more
- 2022ScienceWorld: Is your Agent Smarter than a 5th Grader?cited by 327
- 2022In-context Reinforcement Learning with Algorithm Distillationcited by 190
- 2022A Review of Safe Reinforcement Learning: Methods, Theory and Applicationscited by 181
- 2021A Survey of Zero-shot Generalisation in Deep Reinforcement Learningcited by 170
- 2022Prompting Decision Transformer for Few-Shot Policy Generalizationcited by 146
- 2023Safety-Gymnasium: A Unified Safe Reinforcement Learning Benchmarkcited by 143
- 2023Supervised Pretraining Can Learn In-Context Reinforcement Learningcited by 139
- 2020CRPO: A New Approach for Safe Reinforcement Learning with Convergence Guaranteecited by 134
- 2020Safe Reinforcement Learning in Constrained Markov Decision Processescited by 115
- 2023Structured State Space Models for In-Context Reinforcement Learningcited by 111
- 2023A Tutorial on Meta-Reinforcement Learningcited by 108
- 2023Transformers as Decision Makers: Provable In-Context Reinforcement Learning via Supervised Pretrainingcited by 83
- 2024Can large language models explore in-context?cited by 76
- 2023Constrained Decision Transformer for Offline Safe Reinforcement Learningcited by 69
- 2018Accelerated Primal-Dual Policy Optimization for Safe Reinforcement Learningcited by 62
- 2022Constrained Update Projection Approach to Safe Policy Optimizationcited by 58
- 2021Muesli: Combining Improvements in Policy Optimizationcited by 53
- 2023Generalization to New Sequential Decision Making Tasks with In-Context Learningcited by 39
- 2025A Survey of In-Context Reinforcement Learningcited by 39
- 2025Reward Is Enough: LLMs Are In-Context Reinforcement Learnerscited by 31
- 2023Emergence of In-Context Reinforcement Learning from Noise Distillationcited by 27
- 2024In-Context Decision Transformer: Reinforcement Learning via Hierarchical Chain-of-Thoughtcited by 26
- 2023In-Context Reinforcement Learning for Variable Action Spacescited by 24
- 2024Transformers Can Learn Temporal Difference Methods for In-Context Reinforcement Learningcited by 23
- 2024In-context Exploration-Exploitation for Reinforcement Learningcited by 16
- 2024AMAGO-2: Breaking the Multi-Task Barrier in Meta-Reinforcement Learning with Transformerscited by 15
- 2025Distilling Reinforcement Learning Algorithms for In-Context Model-Based Planningcited by 13
- 2025Robust Gymnasium: A Unified Modular Benchmark for Robust Reinforcement Learningcited by 13
- 2024A CMDP-within-online framework for Meta-Safe Reinforcement Learningcited by 12
- 2023Cross-Episodic Curriculum for Transformer Agentscited by 10
- 2021MESA: Offline Meta-RL for Safe Adaptation and Fault Tolerancecited by 8
- 2024Artificial Generational Intelligence: Cultural Accumulation in Reinforcement Learningcited by 8
- 2024N-Gram Induction Heads for In-Context RL: Improving Stability and Reducing Data Needscited by 7
- 2025Towards Provable Emergence of In-Context Reinforcement Learningcited by 3
Built on by
Citing papers per year: 2026: 3.
3 papers.
Similar, not cited
Close in wording, no citation either way
- 2026Safe Continual Reinforcement Learning under Nonstationarity via Adaptive Safety Constraints
- 2024Safe and Robust Reinforcement Learning: Principles and Practice
- 2025Provably Optimal Reinforcement Learning under Safety Filtering
- 2024Safe Reinforcement Learning in Black-Box Environments via Adaptive Shielding
- 2025Safe But Not Sorry: Reducing Over-Conservatism in Safety Critics via Uncertainty-Aware Modulation
- 2025Adaptive Shielding for Safe Reinforcement Learning under Hidden-Parameter Dynamics Shifts
- 2025Safety Modulation: Enhancing Safety in Reinforcement Learning through Cost-Modulated Rewards
- 2024Safe Reinforcement Learning with Learned Non-Markovian Safety Constraints