Large language models reorganize representational geometry during in-context learning

Hua-Dong Xiong, Li Ji-An, Robert C. Wilson, Kwonjoon Lee, Xue-Xin Wei

TL;DR

In-context learning (ICL) isn't just about large language models (LLMs) finding a static decision boundary; it actively reorganizes the geometry of their internal representations to "untangle" task-relevant information. However, this rapid adaptation is strictly constrained by the model's pretrained representational structure, explaining why tasks aligned with low-variance dimensions remain stubbornly difficult to learn.

What Problem Does This Paper Address?

In-context learning (ICL) allows LLMs to adapt to new tasks using only a few examples in the prompt, without any parameter updates. Despite its widespread use, ICL is notoriously fickle—performance varies wildly based on prompt formatting, example ordering, and task difficulty.

Prior work has tried to explain ICL through the lens of implicit algorithms (like online gradient descent) or specific circuit motifs (like induction heads). However, a fundamental question remains: Can an LLM learn any arbitrary task in-context if given enough examples, or is it fundamentally limited by its pretraining? This paper addresses this gap by exploring how an LLM's internal representational geometry constrains or enables successful in-context learning.

Methods

To isolate the effect of internal model structure on learning, the authors designed a clever experimental paradigm: representation-defined classification tasks.

Instead of using external labels, they generated binary labels by extracting sentence representations from an LLM's internal hidden layers and projecting them onto specific geometric axes:

  1. Logistic Regression (LR) axis: Aligned with ground-truth semantic labels (a supervised reference direction).
  2. Principal Component (PC) axes: Ordered by the amount of variance they explain in the representation space (from high-variance PC1 to low-variance PC512).
Figure 1: Representation-defined in-context classification task. (a) For each sentence

Crucially, because these labels are defined by linear splits of the model's own hidden states, all these tasks are perfectly linearly separable by construction.

The authors then evaluated eight instruction-tuned LLMs (including Llama 3, Gemma 3, and Qwen 3) on these tasks. They tracked how the final-layer representations changed over successive ICL steps using manifold capacity theory, measuring:

  • Capacity: How easily the class manifolds can be linearly separated.
  • Radius and Dimension: The spread and complexity of within-class variability.
  • Signal-to-Noise Ratio (SNR): How clearly the class means separate relative to background noise.

Finally, they compared the LLMs' trial-by-trial behavior against classic online learning algorithms (e.g., Prototype learning, Online Gradient Descent, Kalman filters) to see which algorithmic description best fit the model's actual outputs.

Datasets

The sentence representations were extracted using five text classification datasets:

  • ETHICS (commonsense and justice subsets)
  • SST-2 (Sentiment Analysis from GLUE)
  • CoLA (Linguistic Acceptability from GLUE)
  • LIAR (Fake News Detection)

Key Insights and Ideas

  • Linear Separability $\neq$ Learnability: Even though every task was linearly separable by design, the LLMs failed to learn partitions defined along low-variance, trailing PC axes (like PC128 or PC512). Pretrained structure acts as a strict filter for what can be learned in-context.
  • Dynamic Untangling: Successful ICL is characterized by an active, online geometric reorganization. As more examples are provided, the model compresses the task-relevant class manifolds (reducing radius and dimensionality) and pushes them apart, increasing the SNR.
  • Structure Over Scale: The authors attempted a causal intervention: artificially amplifying the variance ($\gamma = 2$) along the difficult, low-variance axes. Surprisingly, this did not improve performance. This proves that ICL difficulty isn't just about signal magnitude; it's about the underlying structural support inherited during pretraining.
  • The LLM as a Prototype Learner: When looking at how the model processes information over time, its behavior is best described by a prototype-like algorithm that computes class centroids over these dynamically shifting representations.

Key Results

  • Performance Disparity: Tasks defined by the LR axis and leading PCs (PC1–PC8) showed rapid accuracy improvements, plateauing at high levels. Trailing PCs (PC32–PC512) showed flat or severely stunted learning curves.
Figure 2: ICL performance varies systematically across labeling axes that define the task. ICL accuracy as a function of the number of in-context examples. Tasks defined by the LR axis and leading PCs are learned more rapidly and reach higher performance, whereas tasks defined by trailing PCs exhibit slower learning and lower saturation levels. (a) Accuracy averaged over five labeling layers sampled at evenly spaced depth quantiles and across eight models of varying sizes and families on ETHICS-commonsense. Shaded regions denote ±1 standard error of the mean (SEM) across models. (b) Accuracy for Qwen3 4B averaged over the same five labeling layers and across five datasets. Shaded regions denote ±1 SEM across datasets.
  • Geometry Predicts Behavior: Final-layer geometric metrics strongly correlated with behavioral accuracy. Accuracy increased with manifold capacity ($r = 0.83$) and SNR ($r = 0.71$), and decreased as representational dimensionality grew ($r = -0.87$).
Figure 4: Geometric reorganization of neural representations during ICL. Capacity, radius, dimension, and SNR of the final-layer representations across in-context examples, averaged over five labeling layers and eight models. Each curve denotes a different labeling axis. The LR axis and leading PCs (PC1/2/4/8) exhibit strong geometric reorganization with in- context examples, with increasing capacity and SNR and decreasing radius and dimension, whereas trailing PCs (PC32/128/512) remain in low-capacity, low-SNR regimes, showing little geometric reorganization and even increased radius and dimension.
  • Algorithmic Fit: Across all tested models and datasets, the Prototype learning model consistently achieved the highest predictive accuracy for matching the LLM's actual token-generation probabilities.

Limitations and Future Work

While this paper provides an elegant geometric account of ICL, the authors note several limitations:

  1. Linear Task Constraints: The study focuses entirely on binary linear classification. How these geometric principles map to open-ended generation or complex, hierarchical tasks remains an open question.
  2. Correlational Nature: The link between geometric untangling and behavioral success is largely correlational; the causal mechanisms that drive this representational shift are still not fully understood.
  3. Static Pretraining: The work doesn't explore how these favorable geometric structures emerge during the pretraining phase or how instruction-tuning alters them.

Summary updated

BibTeX
@inproceedings{xiong2026large,
  author = {Hua-Dong Xiong and Li Ji-An and Robert C. Wilson and Kwonjoon Lee and Xue-Xin Wei},
  title = {{Large language models reorganize representational geometry during in-context learning}},
  booktitle = {COLM},
  year = {2026},
  url = {https://openreview.net/forum?id=MPsP7vOdcO},
}
Figure