Context Structure Reshapes the Representational Geometry of Language Models
Not on the map. Why?
Abstract (arXiv)
Large Language Models (LLMs) have been shown to organize the representations of input sequences into straighter neural trajectories in their deep layers, which has been hypothesized to facilitate next-token prediction via linear extrapolation. Language models can also adapt to diverse tasks and learn new structure in context, and recent work has shown that this in-context learning (ICL) can be reflected in representational changes. Here we bring these two lines of research together to explore whether representation straightening occurs within a context during ICL. We measure representational straightening in Gemma 2 models across a diverse set of in-context tasks, and uncover a dichotomy in how LLMs' representations change in context. In continual prediction settings (e.g., natural language, grid world traversal tasks) we observe that increasing context increases the straightness of neural sequence trajectories, which is correlated with improvement in model prediction. Conversely, in structured prediction settings (e.g., few-shot tasks), straightening is inconsistent -- it is only present in phases of the task with explicit structure (e.g., repeating a template), but vanishes elsewhere. These results suggest that ICL is not a monolithic process. Instead, we propose that LLMs function like a Swiss Army knife: depending on task structure, the LLM dynamically selects between strategies, only some of which yield representational straightening.
Key facts. Cited by 6 papers in the map (data through 7 Oct 2026). Builds on 33 of its 40 references that are in the map. First posted on arXiv 29 Jan 2026.
Builds on
33 of 40 references.
References · 33
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2018Representation Learning with Contrastive Predictive Codingcited by 7,662
- 2016The LAMBADA dataset: Word prediction requiring a broad discourse contextcited by 960
- 2022In-context Learning and Induction Headscited by 930
- 2022Transformers learn in-context by gradient descentcited by 714
- 2023The Linear Representation Hypothesis and the Geometry of Large Language Modelscited by 679
- 2019Data-Efficient Image Recognition with Contrastive Predictive Codingcited by 672
- 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 671
- 2021Prompt Programming for Large Language Models: Beyond the Few-Shot Paradigmcited by 599
- 2022Data Distributional Properties Drive Emergent In-Context Learning in Transformerscited by 303
- 2023In-Context Learning Creates Task Vectorscited by 302
- 2025Layer by Layer: Uncovering Hidden Representations in Language Modelscited by 293
21 more
- 2023Function Vectors in Large Language Modelscited by 292
- 2023Role-Play with Large Language Modelscited by 290
- 2022Can language models learn from explanations in context?cited by 248
- 2023Does Localization Inform Editing? Surprising Differences in Causality-Based Localization vs. Knowledge Editing in Language Modelscited by 237
- 2023Label Words are Anchors: An Information Flow Perspective for Understanding In-Context Learningcited by 235
- 2024Many-Shot In-Context Learningcited by 203
- 2023The Hydra Effect: Emergent Self-repair in Language Model Computationscited by 145
- 2023Pretraining task diversity and the emergence of non-Bayesian in-context learning for regressioncited by 138
- 2024What needs to go right for an induction head? A mechanistic study of in-context learning circuits and their formationcited by 86
- 2024Competition Dynamics Shape Algorithmic Phases of In-Context Learningcited by 52
- 2024ICLR: In-Context Learning of Representationscited by 49
- 2025Tracing the Representation Geometry of Language Models from Pretraining to Post-trainingcited by 33
- 2023Large language models implicitly learn to straighten neural sentence trajectories to construct a predictive representation of natural languagecited by 32
- 2024Parallel Structures in Pre-training Data Yield In-Context Learningcited by 26
- 2013Predictive information in a sensory populationcited by 22
- 2023Passive learning of active causal strategies in agents and language modelscited by 21
- 2025Priors in Time: Missing Inductive Biases for Language Model Interpretabilitycited by 18
- 2024Inference via Interpolation: Contrastive Representations Provably Enable Planning and Inferencecited by 15
- 2025Just-in-time and distributed task representations in language modelscited by 7
- 2025Distinct Computations Emerge From Compositional Curricula in In-Context Learningcited by 5
- 2025Contrastive Representations for Temporal Reasoningcited by 5
Built on by
Citing papers per year: 2026: 6.
6 papers.
- 2026Temporal Straightening for Latent Planningcited by 32
- 2026Do Sparse Autoencoders Capture Concept Manifolds?cited by 25
- 2026Shifting the Gradient: Understanding How Defensive Training Methods Protect Language Model Integritycited by 1
- 2026An Analysis of Residual-Stream Geometry Across Transformer Depthcited by 1
- 2026Context Is King: How In-Context Specification Shapes the Geometry of Conceptscited by 0
- 2026What Makes a Good Layer? Assessing the Layer-Wise Intrinsic Properties of Music Foundation Modelscited by 0
- 2026What Makes a Good Layer? Assessing the Layer-Wise Intrinsic Properties of Music Foundation Models14 Aug 2026
- 2026Context Is King: How In-Context Specification Shapes the Geometry of Concepts27 Jul 2026
- 2026An Analysis of Residual-Stream Geometry Across Transformer Depth20 Jul 2026
- 2026Do Sparse Autoencoders Capture Concept Manifolds?30 Apr 2026
- 2026Shifting the Gradient: Understanding How Defensive Training Methods Protect Language Model Integrity3 Apr 2026
- 2026Temporal Straightening for Latent Planning12 Mar 2026