Context Structure Reshapes the Representational Geometry of Language Models
Eghbal A. Hosseini, Yuxuan Li, Yasaman Bahri, Declan Campbell, Andrew Kyle Lampinen

TL;DR
This paper investigates how large language models' internal representations change during in-context learning, revealing a task-dependent dichotomy in representational straightening linked to prediction improvement.
Contribution
It demonstrates that representational straightening occurs variably within tasks, depending on their structure, and introduces a dynamic view of how LLMs adapt their internal strategies.
Findings
In continual prediction tasks, increasing context leads to more straightened neural trajectories.
In structured prediction tasks, straightening occurs only during explicit structural phases.
Representational straightening correlates with prediction performance in some contexts.
Abstract
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 \emph{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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsNeurobiology of Language and Bilingualism · Language and cultural evolution · Topic Modeling
