From Compression to Expression: A Layerwise Analysis of In-Context Learning
Jiachen Jiang, Yuxin Dong, Jinxin Zhou, Zhihui Zhu

TL;DR
This paper uncovers a layerwise dynamic in large language models during in-context learning, showing early layers compress task info and later layers express it, with implications for performance and robustness.
Contribution
It introduces a statistical geometric analysis revealing the Layerwise Compression-Expression phenomenon and provides a theoretical bias-variance analysis of attention mechanisms in ICL.
Findings
Early layers produce compact, discriminative representations.
Later layers express task information for prediction.
Model performance improves with size and number of demonstrations.
Abstract
In-context learning (ICL) enables large language models (LLMs) to adapt to new tasks without weight updates by learning from demonstration sequences. While ICL shows strong empirical performance, its internal representational mechanisms are not yet well understood. In this work, we conduct a statistical geometric analysis of ICL representations to investigate how task-specific information is captured across layers. Our analysis reveals an intriguing phenomenon, which we term *Layerwise Compression-Expression*: early layers progressively produce compact and discriminative representations that encode task information from the input demonstrations, while later layers express these representations to incorporate the query and generate the prediction. This phenomenon is observed consistently across diverse tasks and a range of contemporary LLM architectures. We demonstrate that it has…
Peer Reviews
Decision·Submitted to ICLR 2026
1. The paper proposes TDNV as a new metric for analyzing in-context learning (ICL), and presents a clear two-phase compression–expression pattern in layerwise representations. The experimental setup is thorough and supports the empirical observations across different model sizes and settings. 2. The authors provide a bias–variance decomposition of task vectors, offering a structured interpretation of how representation quality evolves with the number of demonstrations. This analysis contributes
1. The paper adopts TDNV as a central metric but provides limited theoretical support for why this specific ratio captures task compression or predicts ICL performance. The analysis is primarily empirical, and while correlations such as the alignment of minimum TDNV with peak task-vector accuracy are demonstrated, the underlying mechanisms remain unexplained. 2. The experimental evaluation primarily focuses on symbolic tasks such as letter transformations and simple list operations. While the p
- The paper is overall well-written and structurally sound. - The paper provides carefully designed metrics and experiments to analyze ICL. - The fact that decoder-only LLM also acts as encoder-decoder model is interesting.
- The ICL tasks are synthetic and simple. Also models are small even compared to sLMs. - Since this is tested on models solely trained for specific ICL tasks, LCE phenomenon might not be applicable to actual general-purpose LLM, which is of real interest. - In the same manner "explains why larger models and longer contexts yield better performance" could be an over-statement.
1. The "Layerwise Compression-Expression" phenomenon is a genuinely interesting discovery that provides new understanding of how ICL works internally. The observation that models split into distinct compression and expression phases is intuitive yet non-obvious. 2. Extensive experiments across multiple architectures (Transformers, Mamba), model scales, and task domains (symbolic, language understanding, multimodality). Shows the phenomenon emerges during training and isn't present in random mod
1. TDNV metric assumes tasks are well-separated and distinct, which may not hold for subtle task variations. The metric may not capture all aspects of task representation quality. Reliance on the last separator token as the task vector is somewhat arbitrary (though they do ablate this). 2. Experiments primarily focus on relatively simple, well-defined tasks. Limited exploration of more complex, real-world ICL scenarios where task boundaries are unclear. Most experiments use relatively small mo
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsMachine Learning and Algorithms · Machine Learning and Data Classification · Human Pose and Action Recognition
