In-Context Reinforcement Learning through Bayesian Fusion of Context and Value Prior

Anaïs Berkes, Vincent Taboga, Donna Vakalis, David Rolnick, Yoshua Bengio
1/6/2026
cs.LGcs.AI

No confident code implementation found for this paper.

Abstract

In-context reinforcement learning (ICRL) promises fast adaptation to unseen environments without parameter updates, but current methods either cannot improve beyond the training distribution or require near-optimal data, limiting practical adoption. We introduce SPICE, a Bayesian ICRL method that learns a prior over Q-values via deep ensemble and updates this prior at test-time using in-context information through Bayesian updates. To recover from poor priors resulting from training on sub-optimal data, our online inference follows an Upper-Confidence Bound rule that favours exploration and adaptation. We prove that SPICE achieves regret-optimal behaviour in both stochastic bandits and finite-horizon MDPs, even when pretrained only on suboptimal trajectories. We validate these findings empirically across bandit and control benchmarks. SPICE achieves near-optimal decisions on unseen tasks, substantially reduces regret compared to prior ICRL and meta-RL approaches while rapidly adapting to unseen tasks and remaining robust under distribution shift.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{berkes2026incontext,
  title  = {In-Context Reinforcement Learning through Bayesian Fusion of Context and Value Prior},
  author = {Anaïs Berkes and Vincent Taboga and Donna Vakalis and David Rolnick and Yoshua Bengio},
  year   = {2026},
  eprint = {2601.03015},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2601.03015v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2601.03015.svg)](https://codeofpaper.com/paper/2601.03015)

Discussion