Visual In-Context Reinforcement Learning with General-Purpose Pretrained Regressors
Abstract
A simple in-context reinforcement learning baseline labels completed episodes with Monte Carlo returns and conditions a pretrained regressor on them, while a prioritized context curation variant preserves diverse informative visual transitions to improve policy learning.
Interactive visual environments such as games and embodied control require decisions over high-dimensional visual observations and long decision horizons, making policies costly to train and tune for each new task. In-context reinforcement learning avoids per-task training by conditioning a pretrained model on past interactions. Several methods rely on domain-specific pretraining or label historical interactions using repeated value updates or a trained teacher. We show that neither is necessary for high-dimensional visual tasks and introduce Visual In-context Monte Carlo (VIMC) reinforcement learning, a simple baseline that utilizes Monte Carlo returns from completed episodes as labels. Starting with an empty first-in, first-out (FIFO) buffer, VIMC learns competitive visual policies by conditioning a general-purpose pretrained regressor on these examples as they accumulate. Analyzing the FIFO mechanism reveals that repetitive visual observations can fill the buffer and crowd out rare informative examples. We therefore propose VIMC-Pro, a prioritized context curation strategy which preserves diverse and informative historical transitions at negligible overhead from lengthy visual interactions, via grouping experiences by visual similarity and allocating context slots according to each group's prediction bias. Our methods outperform competitive baselines across diverse visual tasks. Further analysis shows their strong generalizability and potential for scalability. Code is available at https://github.com/Fir-lat/VIMC
Community
Hi everyone! We are excited to share our new work Visual In-Context Reinforcement Learning with General-Purpose Pretrained Regressors.
Existing In-Context RL (ICRL) methods either rely on costly domain-specific trajectory pretraining or expensive iterative bootstrapping (e.g., Fitted Q-Iteration) that compounds errors and suffers from prohibitive latency in high-dimensional visual environments.
In VIMC and VIMC-Pro, we show that a frozen, general-purpose regressor pretrained purely on synthetic tables can learn strong visual policies from scratch, without gradient updates, Bellman relabeling, or task-specific pretraining:
- VIMC: Pairs frozen visual features (e.g., DINOv3) and actions with episode-end Monte Carlo returns in a simple FIFO buffer to rank candidate actions directly in context.
- VIMC-Pro: Prevents repetitive trajectories from crowding out rare, informative states under a bounded context budget by grouping transitions via visual cosine similarity, allocating slots by rollout prediction bias, and balancing high- and low-return outcomes at negligible overhead.
- Fast & Scalable: Achieves ~164ร faster full-capacity updates than ICR-RL (9.89s vs. 1,615s) and scales directly with stronger pretrained regressors and vision encoders.
Key Results:
- MiniGrid: VIMC-Pro reaches 73.05% test success (vs. 48.44% FIFO VIMC, 62.50% PPO, 7.81% ICR-RL) and leads on harder OOD levels (42.97% vs. 35.94% PPO).
- Jumanji (5 visual games): VIMC / VIMC-Pro rank #1 across all five games (e.g., Tetris test return 29.61 โ 39.53; PacMan 1135.98 vs. 684.02 ExtraTrees).
- First-Person Driving (Donkey): VIMC reaches 87.12% progress in-distribution and achieves the highest OOD return (179.16) on unseen tracks where Rainbow/TRPO drop below 7% progress.
๐ Project Page, Interactive Method & Demos: https://fir-lat.github.io/VIMC/
๐ฌ 2:46 Project Film: https://fir-lat.github.io/VIMC/assets/vimc-project-film.mp4
๐ Paper: https://arxiv.org/abs/2612.01153
๐ป Code: https://github.com/Fir-lat/VIMC
Happy to answer any questions or discuss visual in-context RL and pretrained tabular regressors below!
Get this paper in your agent:
hf papers read 2612.01153 Don't have the latest CLI?
curl -LsSf https://hf.co/cli/install.sh | bash Models citing this paper 0
No model linking this paper
Datasets citing this paper 0
No dataset linking this paper
Spaces citing this paper 0
No Space linking this paper
Collections including this paper 0
No Collection including this paper