Lune

ICML2024Top-tier venue

Generalization to New Sequential Decision Making Tasks with In-Context Learning

Sharath Chandra Raparthy, Eric Hambro, Robert Kirk, Mikael Henaff, Roberta Raileanu

Abstract

Training autonomous agents that can learn new tasks from only a handful of demonstrations is a long-standing problem in machine learning. Recently, transformers have been shown to learn new language or vision tasks without any weight updates from only a few examples, also referred to as in-context learning. However, the sequential decision making setting poses additional challenges having a lower tolerance for errors since the environment's stochasticity or the agent's actions can lead to unseen, and sometimes unrecoverable, states. In this paper, we use an illustrative example to show that naively applying transformers to sequential decision making problems does not enable in-context learning of new tasks. We then demonstrate how training on sequences of trajectories with certain distributional properties leads to in-context learning of new sequential decision making tasks. We investigate different design choices and find that larger model and dataset sizes, as well as more task diversity, environment stochasticity, and trajectory burstiness, all result in better in-context learning of new out-of-distribution tasks. By training on large diverse offline datasets, our model is able to learn new MiniHack and Procgen tasks without any weight updates from just a handful of demonstrations.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

23 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Reward Is Enough: LLMs Are In-Context Reinforcement Learners cites Can large language models explore in-context?
  • Reward Is Enough: LLMs Are In-Context Reinforcement Learners cites Language Models are Few-Shot Learners
  • What needs to go right for an induction head? A mechanistic study of in-context learning circuits and their formation cites An Explanation of In-context Learning as Implicit Bayesian Inference
  • What needs to go right for an induction head? A mechanistic study of in-context learning circuits and their formation cites Language Models are Few-Shot Learners
  • Offline Reinforcement Learning as One Big Sequence Modeling Problem cites Decision Transformer: Reinforcement Learning via Sequence Modeling
  • Offline Reinforcement Learning as One Big Sequence Modeling Problem cites Language Models are Few-Shot Learners
  • Offline Reinforcement Learning as One Big Sequence Modeling Problem cites Conservative Q-Learning for Offline Reinforcement Learning
  • In-Context Reinforcement Learning for Variable Action Spaces cites Decision Transformer: Reinforcement Learning via Sequence Modeling
  • In-Context Reinforcement Learning for Variable Action Spaces cites Language Models are Few-Shot Learners
  • An Explanation of In-context Learning as Implicit Bayesian Inference cites Language Models are Few-Shot Learners
  • Can large language models explore in-context? cites An Explanation of In-context Learning as Implicit Bayesian Inference
  • Can large language models explore in-context? cites Language Models are Few-Shot Learners
  • LLMs are Greedy Agents: Effects of RL Fine-tuning on Decision-Making Abilities cites Language Models are Few-Shot Learners
  • Decision Transformer: Reinforcement Learning via Sequence Modeling cites Language Models are Few-Shot Learners
  • Decision Transformer: Reinforcement Learning via Sequence Modeling cites Conservative Q-Learning for Offline Reinforcement Learning
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers23

  1. Can large language models explore in-context?Akshay Krishnamurthy, Keegan Harris, Dylan J. Foster, Cyril Zhang et al.NeurIPS 2024 · 95 citations
  2. What needs to go right for an induction head? A mechanistic study of in-context learning circuits and their formationAaditya K. Singh, Ted Moskovitz, Felix Hill, Stephanie C. Y. Chan et al.ICML 2024 · 77 citations
  3. Reward Is Enough: LLMs Are In-Context Reinforcement LearnersKefan Song, Amir Moeini, Peng Wang, Lei Gong et al.ICLR 2026 · 42 citations
  4. LLMs are Greedy Agents: Effects of RL Fine-tuning on Decision-Making AbilitiesThomas Schmied, Jörg Bornschein, Jordi Grau-Moya, Markus Wulfmeier et al.ICLR 2026 · 41 citations
  5. In-Context Reinforcement Learning for Variable Action SpacesViacheslav Sinii, Alexander Nikulin, Vladislav Kurenkov, Ilya Zisman et al.ICML 2024 · 26 citations

Builds on29

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
  2. Conservative Q-Learning for Offline Reinforcement LearningAviral Kumar, Aurick Zhou, George Tucker, Sergey LevineNeurIPS 2020 · 2,881 citations
  3. Decision Transformer: Reinforcement Learning via Sequence ModelingLili Chen, Kevin Lu, Aravind Rajeswaran, Kimin Lee et al.NeurIPS 2021 · 2,557 citations
  4. An Explanation of In-context Learning as Implicit Bayesian InferenceSang Michael Xie, Aditi Raghunathan, Percy Liang, Tengyu MaICLR 2022 · 1,030 citations
  5. Offline Reinforcement Learning as One Big Sequence Modeling ProblemMichael Janner, Qiyang Li, Sergey LevineNeurIPS 2021 · 950 citations

Related papers

  1. Meta-DT: Offline Meta-RL as Conditional Sequence Modeling with World Model DisentanglementZhi Wang, Li Zhang, Wenhao Wu, Yuanheng Zhu et al.NeurIPS 2024 · 31 citations
  2. Prompting Decision Transformer for Few-Shot Policy GeneralizationMengdi Xu, Yikang Shen, Shun Zhang, Yuchen Lu et al.ICML 2022 · 194 citations
  3. When can in-context learning generalize out of task distribution?Page C. Goddard, Lindsay M. Smith, Vudtiwat Ngampruetikorn, David J. SchwabICML 2025
  4. In-Context Decision Transformer: Reinforcement Learning via Hierarchical Chain-of-ThoughtSili Huang, Jifeng Hu, Hechang Chen, Lichao Sun et al.ICML 2024 · 25 citations
  5. Towards Provable Emergence of In-Context Reinforcement LearningJiuqi Wang, Rohan Chandra, Shangtong ZhangNeurIPS 2025 · 5 citations
Dusk over the sea between two cliffs drawn in fine vertical lines