Abstract
Large Language Models (LLMs) exhibit remarkable flexibility through prompting, yet the internal mechanisms driving this adaptation remain poorly understood. This study investigates the "geometry" of internal representations using manifold capacity to distinguish between representational "untangling" and output "readout alignment." We find that few-shot demonstrations fundamentally reshape model processing from early layers, whereas instructions primarily influence the final output packaging. Crucially, failures in in-context learning are often due to misaligned readouts rather than a collapse of internal task understanding.
Introduction
LLMs can switch between diverse tasks based on simple prompts, but the underlying process—whether it's on-the-fly learning or steering pre-existing knowledge—is unclear. Few-shot In-Context Learning (ICL) is particularly sensitive to prompt variations, where minor changes in example selection or ordering can lead to significant performance drops. This research explores whether these sensitivities stem from internal representational failures or issues at the final generation stage.
Methodology: Manifold Capacity
The authors utilize a framework from statistical physics and computational neuroscience called manifold capacity. This metric measures the linear separability of category embeddings (e.g., "Joyful" vs. "Angry" sentences) in high-dimensional space. High capacity indicates that the representations are "untangled" and easy for a linear classifier to distinguish.
The study compares three prompting strategies:
- Instructions: Zero-shot natural language descriptions of the task.
- Demonstrations: Few-shot examples (ICL).
- Soft Prompts: Optimized continuous vectors (prompt-tuning).
Analysis is performed on both sentence-level embeddings (to observe intermediate processing) and last-token embeddings (which the model uses to generate the next word).
Key Insights
Demonstrations vs. Instructions
Providing examples (demonstrations) has a much more profound effect on internal states than instructions. Demos begin reorganizing and untangling representations in the early-to-mid layers of the model. In contrast, instructions mostly affect how features are "packaged" into the final token.
The Readout Alignment Bottleneck
A major finding is that few-shot learning often fails not because the model cannot distinguish the categories, but because it cannot "read" them. Even in "failure" runs where accuracy is near zero, the internal manifold capacity often remains high. The model successfully untangles the data internally, but its final output layer (the "unembed" layer) is not aligned with those new, task-specific directions.
Representational Synergy
Surprisingly, providing examples for any task—even one unrelated to the target—increases manifold capacity in the middle layers. This suggests that exposure to diverse input-output pairs triggers a general "feature enhancement" mode in the model, regardless of the specific task requested.
Empirical Results
The researchers validated their findings on both synthetic multi-task datasets and standard benchmarks like AG News and TREC.
As shown in the layer-wise analysis, the "untangling" of manifolds peaks around the middle layers (layers 12-16 in Llama 3.1-8b) before the model begins focusing on the specific task requested at the final token. Notably, manifold capacity remains robust even when labels are shuffled or replaced with arbitrary letter codes, despite the resulting drop in accuracy. This confirms that the sensitivity of ICL is primarily a readout alignment problem, not a representational one.
Conclusion
This geometric perspective reveals that different prompting methods trigger distinct internal mechanisms. While soft prompts and instructions operate largely at the output stage, few-shot demonstrations induce deep representational changes. The study suggests that future research should focus on optimizing readout alignment—perhaps through better calibration or final-layer tuning—to improve the reliability of LLM task adaptation.
Summary updated