TL;DR
In-context learning (ICL) isn't just a simple retrieval of pre-trained knowledge; it involves a dynamic "geometric reorganization" of an LLM's internal representations to untangle task-relevant information. However, this flexibility is not infinite—a model's ability to learn a task in-context is strictly constrained by its pre-existing representational geometry, favoring tasks aligned with high-variance "principal" directions over those hidden in the noise.
What Problem Does This Paper Address?
While Large Language Models (LLMs) are famous for their ability to learn new tasks from just a few examples (ICL), we still don't fully understand why some tasks are easy for them to pick up while others are nearly impossible. A major challenge in studying this is "semantic contamination": it's hard to tell if a model is truly learning a new task or just recognizing a pattern it already saw during pre-training.
The authors of this paper set out to determine if LLMs can learn arbitrary linear classification tasks in-context. By defining tasks based on the model's own internal hidden states rather than external labels, they created a "clean room" environment to test the limits of ICL and observe how internal representations shift as the model "learns."
Methods
The researchers introduced a representation-defined task framework. For a given set of sentences, they extracted the model's internal activations (hidden states). They then defined binary labels by projecting these activations onto specific axes:
- Logistic Regression (LR) Axis: A direction already aligned with the dataset's ground-truth semantic labels (e.g., "moral" vs. "immoral").
- Principal Component (PC) Axes: Directions ranked by how much variance they explain in the model's representation space (PC1 has the most variance, PC512 very little).
Crucially, all these tasks are linearly separable by construction. The model was then given sequences of these sentence-label pairs and asked to predict the label for a new sentence.
To look "under the hood," the authors used manifold capacity theory to measure how the geometry of these representation "clouds" changed. They also performed causal interventions, where they manually amplified the signal along a specific axis to see if it improved learning. Finally, they compared LLM behavior against classic online learning algorithms like Prototype learning and Gradient Descent.
Datasets
The study evaluated eight instruction-tuned models (from the Llama 3, Gemma 3, and Qwen 3 families) across several classification datasets:
- ETHICS (Commonsense and Justice)
- SST-2 (Sentiment analysis)
- CoLA (Linguistic acceptability)
- LIAR (Fake news detection)
Key Insights and Ideas
- The "Spectral Bias" of ICL: Even though all tasks were mathematically "solvable" (linearly separable), the models struggled immensely with tasks defined along low-variance axes (trailing PCs). ICL is heavily biased toward the "loudest" directions in the model's head.
- Learning as "Untangling": Successful ICL is characterized by a physical reorganization of representations. As more examples are provided, the manifolds for different classes become more compact (lower radius/dimension) and move further apart (higher capacity and SNR).
- Amplification is Not Enough: Simply "turning up the volume" on a specific axis (causal intervention) did not improve performance. This suggests that ICL isn't just about detecting a signal; it requires the model to actively reorganize its internal space, a process that is constrained by its pre-trained architecture.
- LLMs as Prototype Learners: The way LLMs integrate context is best described by a prototype-like algorithm. The model appears to calculate a "mean representation" (a centroid) for each class and classifies new inputs based on their proximity to these evolving centroids.
Key Results
The researchers found a systematic performance gap based on the labeling axis. As shown in Figure 2, tasks defined by the LR axis and leading PCs (PC1-PC8) reached high accuracy quickly, while trailing PCs (PC32-PC512) barely improved above chance, even with hundreds of examples.
Quantitatively, the internal geometric metrics were incredibly strong predictors of behavioral success. Manifold capacity (a measure of separability) correlated with accuracy at r = 0.83, while the effective dimensionality of the representations correlated negatively at r = -0.87.
Limitations and Future Work
- Linearity: The study focused on linear partitions. It remains to be seen if these geometric principles hold for more complex, non-linear, or hierarchical tasks.
- Sample Size: While trailing PCs showed an "empirical ceiling," it's possible that with thousands of examples (beyond current context windows), the model might eventually learn them.
- Pre-training Origins: The paper shows that these constraints exist but doesn't explain how they emerge during the initial pre-training process.
- Reasoning Tasks: Future work could explore if "Chain-of-Thought" prompting allows the model to perform more sophisticated representational reorganization before committing to an answer.
Summary updated