Saved in:
Bibliographic Details
Main Authors: Moeini, Amir, Kwon, Minjae, Bozkurt, Alper Kamil, Motai, Yuichi, Chandra, Rohan, Feng, Lu, Zhang, Shangtong
Format: Preprint
Published: 2025
Subjects:
Online Access:https://arxiv.org/abs/2509.25582
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866914607853993984
author Moeini, Amir
Kwon, Minjae
Bozkurt, Alper Kamil
Motai, Yuichi
Chandra, Rohan
Feng, Lu
Zhang, Shangtong
author_facet Moeini, Amir
Kwon, Minjae
Bozkurt, Alper Kamil
Motai, Yuichi
Chandra, Rohan
Feng, Lu
Zhang, Shangtong
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2509_25582
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Safe In-Context Reinforcement Learning
Moeini, Amir
Kwon, Minjae
Bozkurt, Alper Kamil
Motai, Yuichi
Chandra, Rohan
Feng, Lu
Zhang, Shangtong
Machine Learning
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.
title Safe In-Context Reinforcement Learning
topic Machine Learning
url https://arxiv.org/abs/2509.25582