mlsanityData to 14 Oct 2026

Latent Q-Barrier Shielding for Safe In-Context Reinforcement Learning

arXiv 2605.25267 ↗First posted 24 May 2026cs.LG cs.AIcited by 1

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

Abstract (arXiv)

Safe in-context reinforcement learning (ICRL) adapts online from interaction history without test-time parameter updates while controlling episode cost under a safety budget. Under out-of-distribution (OOD) deployment shifts, pretraining-only safe ICRL can give poor reward-safety tradeoffs because the remaining budget affects behavior only through frozen policy conditioning, not an explicit action-level check against predicted future cost. We propose a latent Q-Barrier shield that learns a context representation, latent dynamics, and an ensemble cost critic before deployment. Without parameter updates, the shield infers context from history and filters or softly reweights candidate actions using the remaining budget and predicted future cost. We prove a conditional, error-decomposed barrier-margin result: a Q-Barrier-satisfying action leaves the next latent-budget state with an approximately budget-safe continuation under the learned critic, up to Bellman and latent-prediction errors. Across five safe ICRL benchmarks, the shield improves deployment-time reward-safety tradeoffs over a strong safe-ICRL baseline: after a short context window, it achieves higher return in four of five benchmarks while matching or lowering average episode cost in all five.

Key facts. Cited by 1 paper 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 55 of its 70 references that are in the map. First posted on arXiv 24 May 2026.

Builds on

55 of 70 references.

Closest ancestors · 3

Same direction, newest first

  1. 2025Safe In-Context Reinforcement Learning29 Sep
  2. 2024ActSafe: Active Exploration with Safety Constraints for Reinforcement Learning12 Oct
  3. 2024Enhancing Efficiency of Safe Reinforcement Learning via Sample Manipulation31 May

Other references · 52

  1. 2017Proximal Policy Optimization Algorithmscited by 15,215
  2. 2017Model-Agnostic Meta-Learning for Fast Adaptation of Deep Networkscited by 4,897
  3. 2020Bootstrap your own latent: A new approach to self-supervised Learningcited by 4,750
  4. 2017Constrained Policy Optimizationcited by 983
  5. 2020CURL: Contrastive Unsupervised Representations for Reinforcement Learningcited by 760
  6. 2016RL2: Fast Reinforcement Learning via Slow Reinforcement Learningcited by 503
  7. 2017Safe Reinforcement Learning via Shieldingcited by 449
  8. 2016Reinforcement Learning with Unsupervised Auxiliary Taskscited by 404
  9. 2016Learning to reinforcement learncited by 377
  10. 2020Projection-Based Constrained Policy Optimizationcited by 203
  11. 2022In-context Reinforcement Learning with Algorithm Distillationcited by 190
  12. 2021A Survey of Zero-shot Generalisation in Deep Reinforcement Learningcited by 170
38 more
  1. 2022Prompting Decision Transformer for Few-Shot Policy Generalizationcited by 146
  2. 2023Safety-Gymnasium: A Unified Safe Reinforcement Learning Benchmarkcited by 143
  3. 2023Supervised Pretraining Can Learn In-Context Reinforcement Learningcited by 139
  4. 2022Safe Planning in Dynamic Environments using Conformal Predictioncited by 119
  5. 2020Safe Reinforcement Learning in Constrained Markov Decision Processescited by 115
  6. 2021Pretraining Representations for Data-Efficient Reinforcement Learningcited by 105
  7. 2024Can large language models explore in-context?cited by 76
  8. 2020Reinforcement Learning for Safety-Critical Control under Model Uncertainty, using Control Lyapunov Functions and Control Barrier Functionscited by 68
  9. 2022Enforcing Hard Constraints with Soft Barriers: Safe Reinforcement Learning in Unknown Stochastic Environmentscited by 60
  10. 2022Constrained Update Projection Approach to Safe Policy Optimizationcited by 58
  11. 2022Safe Reinforcement Learning via Shielding under Partial Observabilitycited by 56
  12. 2022Contextualize Me -- The Case for Context in Reinforcement Learningcited by 46
  13. 2025Generalizing Safety Beyond Collision-Avoidance via Latent-Space Reachability Analysiscited by 45
  14. 2023Safe Reinforcement Learning via Probabilistic Logic Shieldscited by 42
  15. 2023Generalization to New Sequential Decision Making Tasks with In-Context Learningcited by 39
  16. 2025A Survey of In-Context Reinforcement Learningcited by 39
  17. 2023Iterative Reachability Estimation for Safe Reinforcement Learningcited by 37
  18. 2021Context-Aware Safe Reinforcement Learning for Non-Stationary Environmentscited by 33
  19. 2025Uncertainty-aware Latent Safety Filters for Avoiding Out-of-Distribution Failurescited by 33
  20. 2023In-Context Reinforcement Learning for Variable Action Spacescited by 24
  21. 2024Transformers Can Learn Temporal Difference Methods for In-Context Reinforcement Learningcited by 23
  22. 2019Single Episode Policy Transfer in Reinforcement Learningcited by 18
  23. 2024Zero-Shot Reinforcement Learning via Function Encoderscited by 18
  24. 2023Simplified Temporal Consistency Reinforcement Learningcited by 17
  25. 2024In-context Exploration-Exploitation for Reinforcement Learningcited by 16
  26. 2024Dreaming of Many Worlds: Learning Contextual World Models Aids Zero-Shot Generalizationcited by 16
  27. 2022An Adaptive Deep RL Method for Non-Stationary Environments with Piecewise Stable Contextcited by 15
  28. 2024AMAGO-2: Breaking the Multi-Task Barrier in Meta-Reinforcement Learning with Transformerscited by 15
  29. 2025Distilling Reinforcement Learning Algorithms for In-Context Model-Based Planningcited by 13
  30. 2024A CMDP-within-online framework for Meta-Safe Reinforcement Learningcited by 12
  31. 2022Safe and Efficient Reinforcement Learning Using Disturbance-Observer-Based Control Barrier Functionscited by 11
  32. 2024Zero-Shot Transfer of Neural ODEscited by 10
  33. 2025Vintix: Action Model via In-Context Reinforcement Learningcited by 10
  34. 2021MESA: Offline Meta-RL for Safe Adaptation and Fault Tolerancecited by 8
  35. 2023Safe POMDP Online Planning via Shieldingcited by 8
  36. 2024Safe POMDP Online Planning among Dynamic Agents via Adaptive Conformal Predictioncited by 8
  37. 2025AnySafe: Adapting Latent Safety Filters at Runtime via Safety Constraint Parameterization in the Latent Spacecited by 7
  38. 2025Scalable In-Context Q-Learningcited by 5

50 most cited of 52 All 52 (JSON)

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2026: 1.

1 paper.

Similar, not cited

Close in wording, no citation either way

  1. 2025Adaptive Shielding for Safe Reinforcement Learning under Hidden-Parameter Dynamics Shifts
  2. 2026Safe-Support Q-Learning: Learning without Unsafe Exploration
  3. 2024Safe Reinforcement Learning in Black-Box Environments via Adaptive Shielding
  4. 2026From Weak Data to Strong Policy: Q-Targets Enable Provable In-Context Reinforcement Learning
  5. 2025Safe But Not Sorry: Reducing Over-Conservatism in Safety Critics via Uncertainty-Aware Modulation
  6. 2024Leveraging Approximate Model-based Shielding for Probabilistic Safety Guarantees in Continuous Environments
  7. 2025Predictive Safety Shield for Dyna-Q Reinforcement Learning
  8. 2026From Cumulative Constraints to Adaptive Runtime Safety Control for Nonstationary Reinforcement Learning