mlsanityData to 14 Oct 2026

Few-Shot Demonstrations Elicit the Use of In-Context World Representations in LLMs

arXiv 2609.24352 ↗First posted 21 Sep 2026cs.AIcited by 0

Not on the map. Why?

Abstract (arXiv)

Large language models (LLMs), when acting as agents, are expected to take observed data in context, infer the latent state space underlying the world, and leverage it for downstream prediction. However, prior work demonstrated that LLMs struggle to use representations learned in context on a graph tracking task, where the model needs to construct a representation of the graph governing data generation process and use it for subsequent predictions. In this paper, we show that extending this to few-shot settings, where each demonstration is generated from a different world with either the same or different graph topologies, enhances its prediction on 6 models from 4 model families. To understand this improvement, we linearly probe a low-dimensional world representation that encodes graph information in the hidden states. Notably, we find that few-shot demonstrations relocate the world representation and increase its predictive use. Specifically, for each model, these world representations shift in directions nearly orthogonal to their original subspace, and interventions on these representations selectively impair performance more than interventions on other subspaces. Consistent with this insight, we show that few-shot demonstrations with observations from different worlds improve performance on ARC-AGI-1&2, web agent tasks, and Othello. Our findings elucidate the role and internal mechanisms of few-shot demonstrations in in-context world modeling. More broadly, our work advances our understanding of how LLM agents learn from in-context observations and provides implications for their further improvement.

Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 82 of its 92 references that are in the map. First posted on arXiv 21 Sep 2026.

Builds on

82 of 92 references.

References · 82

  1. 2020Language Models are Few-Shot Learnerscited by 32,419
  2. 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,459
  3. 2025Qwen3 Technical Reportcited by 8,820
  4. 2022Large Language Models are Zero-Shot Reasonerscited by 4,374
  5. 2023SWE-bench: Can Language Models Resolve Real-World GitHub Issues?cited by 3,373
  6. 2022Language Models (Mostly) Know What They Knowcited by 1,856
  7. 2024SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineeringcited by 1,737
  8. 2018World Modelscited by 1,513
  9. 2022Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?cited by 1,434
  10. 2016Understanding intermediate layers using linear classifier probescited by 1,353
  11. 2023Inference-Time Intervention: Eliciting Truthful Answers from a Language Modelcited by 1,302
  12. 2023Mind2Web: Towards a Generalist Agent for the Webcited by 1,242
38 more
  1. 2022In-context Learning and Induction Headscited by 964
  2. 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 938
  3. 2021Probing Classifiers: Promises, Shortcomings, and Advancescited by 876
  4. 2023A Comprehensive Survey of Continual Learning: Theory, Method and Applicationcited by 872
  5. 2022Discovering Latent Knowledge in Language Models Without Supervisioncited by 767
  6. 2024Genie: Generative Interactive Environmentscited by 747
  7. 2022Transformers learn in-context by gradient descentcited by 732
  8. 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 715
  9. 2025SFT Memorizes, RL Generalizes: A Comparative Study of Foundation Model Post-trainingcited by 672
  10. 2023The Internal State of an LLM Knows When It's Lyingcited by 659
  11. 2020Null It Out: Guarding Protected Attributes by Iterative Nullspace Projectioncited by 455
  12. 2026Self-Distilled Reasoner: On-Policy Self-Distillation for Large Language Modelscited by 455
  13. 2021MetaICL: Learning to Learn In Contextcited by 454
  14. 2022Emergent World Representations: Exploring a Sequence Model Trained on a Synthetic Taskcited by 431
  15. 2025Scaling up Test-Time Compute with Latent Reasoning: A Recurrent Depth Approachcited by 415
  16. 2026Reinforcement Learning via Self-Distillationcited by 332
  17. 2023Emergent Linear Representations in World Models of Self-Supervised Sequence Modelscited by 319
  18. 2023Language Models Represent Space and Timecited by 316
  19. 2023In-Context Learning Creates Task Vectorscited by 312
  20. 2022Data Distributional Properties Drive Emergent In-Context Learning in Transformerscited by 309
  21. 2023Function Vectors in Large Language Modelscited by 308
  22. 2026Self-Distillation Enables Continual Learningcited by 247
  23. 2024Not All Language Model Features Are One-Dimensionally Linearcited by 212
  24. 2022In-context Reinforcement Learning with Algorithm Distillationcited by 190
  25. 2025ARC-AGI-2: A New Challenge for Frontier AI Reasoning Systemscited by 190
  26. 2026On-Policy Context Distillation for Language Modelscited by 186
  27. 2021Meta-learning via Language Model In-context Tuningcited by 164
  28. 2023The Hydra Effect: Emergent Self-repair in Language Model Computationscited by 156
  29. 2017Learning to Generate Reviews and Discovering Sentimentcited by 148
  30. 2023Mechanistically analyzing the effects of fine-tuning on procedurally defined taskscited by 115
  31. 2024Evaluating the World Model Implicit in a Generative Modelcited by 113
  32. 2024The Surprising Effectiveness of Test-Time Training for Few-Shot Learningcited by 96
  33. 2024Transformers represent belief state geometry in their residual streamcited by 77
  34. 2024LLM Circuit Analyses Are Consistent Across Training and Scalecited by 63
  35. 2024Emergent World Models and Latent Variable Estimation in Chess-Playing Language Modelscited by 62
  36. 2023Meta-in-context learning in large language modelscited by 59
  37. 2026Expanding the Capabilities of Reinforcement Learning via Text Feedbackcited by 53
  38. 2024ICLR: In-Context Learning of Representationscited by 50

50 most cited of 82 All 82 (JSON)

Built on by

Not cited yet.

Similar, not cited

Close in wording, no citation either way

  1. 2025Exploring Graph Learning Tasks with Pure LLMs: A Comprehensive Benchmark and Investigation
  2. 2025Graph World Model
  3. 2025Linear Spatial World Models Emerge in Large Language Models
  4. 2022Can In-context Learners Learn a Reasoning Concept from Demonstrations?
  5. 2024Instruction Tuning Vs. In-Context Learning: Revisiting Large Language Models in Few-Shot Computational Social Science
  6. 2025Better World Models Can Lead to Better Post-Training Performance
  7. 2026Do World Models Learn Global Understanding?
  8. 2026How do World Models and Policies Compose in LLM Agents? A Joint Spectral and Behavioral Account