In-Context Reinforcement Learning through Bayesian Fusion of Context and Value Prior
Ana\"is Berkes, Vincent Taboga, Donna Vakalis, David Rolnick, Yoshua Bengio

TL;DR
SPICE is a Bayesian in-context reinforcement learning method that learns a prior over Q-values, updates it with in-context data, and achieves near-optimal adaptation and regret minimization in unseen environments.
Contribution
We introduce SPICE, a Bayesian ICRL approach that learns and updates Q-value priors at test time, enabling rapid adaptation and regret optimality even with suboptimal training data.
Findings
SPICE achieves near-optimal decisions on unseen tasks.
It substantially reduces regret compared to prior methods.
It adapts rapidly and remains robust under distribution shifts.
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…
Peer Reviews
Decision·Submitted to ICLR 2026
The paper provides both theoretical and justification for the algorithm proposed.
I think the writing quality of this paper does not meet the standard of ICLR. I feel lost while reading the paper. First, the paper should start with the formulation of the ICRL problem rather than the architecture design. Second, the architecture part contains too many details without explanation, and I do not know what I am supposed to pay attention to to understand the idea. Third, though I am relatively familiar with bandit algorithms, I do not understand where formulas 14 and 15 come from.
- By using value-based learning instead of imitation, SPICE can train on mixed-quality historical data, making it far more practical than methods that require optimal demonstrations. - The algorithm is backed by an optimal O(log K) regret bound for bandits. The theory confirms that any prior miscalibration only adds a constant cost, providing a strong justification for its test-time efficiency. - It uses a novel combination of advantage and uncertainty weighting to guide the transformer in learn
- The paper does not analyze the algorithm's breaking point with poor data. If training data is too heterogeneous (e.g., mixed with random policies), the Q-ensemble may fail to learn a useful prior. An analysis of performance degradation versus data quality is needed to define the method's practical limits. - Performance critically depends on the state-similarity kernel, but little guidance is offered on its selection. A mismatch between the kernel's similarity metric and the true Q-function's s
1. Learning an explicit, calibrated value prior for ICRL is a clear and novel idea. 2. Theoretical contribution: proves regret-optimality (O(log K)) in stochastic bandits without requiring optimal pretraining. 3. Empirical validation aligns with theory: SPICE tracks UCB’s logarithmic regret and adapts quickly from suboptimal logs, whereas sequence-only ICRL baselines remain tied to behavior policy
1. The assumption of SPICE is too strong to limit its application. The Bayesian fusion uses kernel-weighted evidence, implicitly assuming a form of local smoothness in the action-value landscape—i.e., that states close under the chosen kernel share similar action values, and consequently that evidence from nearby states is informative for the query. However, this can break in domains with discontinuous or highly multimodal action-value structure where small perturbations in state can correspon
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsAdvanced Bandit Algorithms Research · Reinforcement Learning in Robotics · Gaussian Processes and Bayesian Inference
