Lune

ICLR2024Top-tier venue

Context is Environment

Sharut Gupta, Stefanie Jegelka, David Lopez-Paz, Kartik Ahuja

Abstract

Two lines of work are taking the central stage in AI research. On the one hand, the community is making increasing efforts to build models that discard spurious correlations and generalize better in novel test environments. Unfortunately, the bitter lesson so far is that no proposal convincingly outperforms a simple empirical risk minimization baseline. On the other hand, large language models (LLMs) have erupted as algorithms able to learn in-context, generalizing on-the-fly to eclectic contextual circumstances that users enforce by means of prompting. In this paper, we argue that context is environment, and posit that in-context learning holds the key to better domain generalization. Via extensive theory and experiments, we show that paying attention to context\unicodex2013\unicodex2013\unicode{x2013}\unicode{x2013}unlabeled examples as they arrive\unicodex2013\unicodex2013\unicode{x2013}\unicode{x2013}allows our proposed In-Context Risk Minimization (ICRM) algorithm to zoom-in on the test environment risk minimizer, leading to significant out-of-distribution performance improvements. From all of this, two messages are worth taking home. Researchers in domain generalization should consider environment as context, and harness the adaptive power of in-context learning. Researchers in LLMs should consider context as environment, to better structure data towards generalization.

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.

4 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

  • Unlabeled Data Can Provably Enhance In-Context Learning of Transformers cites Language Models are Few-Shot Learners
  • Toward Understanding In-context vs. In-weight Learning cites Language Models are Few-Shot Learners
  • Invariance Principle Meets Information Bottleneck for Out-of-Distribution Generalization cites Domain Generalization using Causal Matching
  • CCL: Causal-aware In-context Learning for Out-of-Distribution Generalization cites Language Models are Few-Shot Learners
  • In-Context Symmetries: Self-Supervised Learning through Contextual World Models cites Language Models are Few-Shot Learners
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers4

  1. In-Context Symmetries: Self-Supervised Learning through Contextual World ModelsSharut Gupta, Chenyu Wang, Yifei Wang, Tommi S. Jaakkola et al.NeurIPS 2024 · 8 citations
  2. Unlabeled Data Can Provably Enhance In-Context Learning of TransformersRenpu Liu, Jing YangNeurIPS 2025 · 3 citations
  3. CCL: Causal-aware In-context Learning for Out-of-Distribution GeneralizationHoyoon Byun, Gyeongdeok Seo, Joonseong Kang, Taero Kim et al.NeurIPS 2025 · 1 citation
  4. Toward Understanding In-context vs. In-weight LearningBryan Chan, Xinyi Chen, András György, Dale SchuurmansICLR 2025

Builds on18

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
  2. WILDS: A Benchmark of in-the-Wild Distribution ShiftsPang Wei Koh, Shiori Sagawa, Henrik Marklund, Sang Michael Xie et al.ICML 2021 · 1,773 citations
  3. Tent: Fully Test-Time Adaptation by Entropy MinimizationDequan Wang, Evan Shelhamer, Shaoteng Liu, Bruno A. Olshausen et al.ICLR 2021 · 1,731 citations
  4. Domain Generalization using Causal MatchingDivyat Mahajan, Shruti Tople, Amit SharmaICML 2021 · 399 citations
  5. Invariance Principle Meets Information Bottleneck for Out-of-Distribution GeneralizationKartik Ahuja, Ethan Caballero, Dinghuai Zhang, Jean-Christophe Gagnon-Audet et al.NeurIPS 2021 · 372 citations

Related papers

  1. Task Descriptors Help Transformers Learn Linear Models In-ContextRuomin Huang, Rong GeICLR 2025
  2. What Do Language Models Learn in Context? The Structured Task HypothesisJiaoda Li, Yifan Hou, Mrinmaya Sachan, Ryan CotterellACL 2024 · 5 citations
  3. Probing the Decision Boundaries of In-context Learning in Large Language ModelsSiyan Zhao, Tung Nguyen, Aditya GroverNeurIPS 2024 · 26 citations
  4. Invariant Language ModelingMaxime Peyrard, Sarvjeet Singh Ghotra, Martin Josifoski, Vidhan Agarwal et al.EMNLP 2022 · 8 citations
  5. Large Language Models Can be Lazy Learners: Analyze Shortcuts in In-Context LearningRuixiang Tang, Dehan Kong, Longtao Huang, Hui XueACL Findings 2023 · 31 citations
Dusk over the sea between two cliffs drawn in fine vertical lines