Research map / Architectures and efficiency / RNNs and normalization
Layer by Layer: Uncovering Hidden Representations in Language Models
Read the paperCheck your idea against 108,967 papers
AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.
Analyzes layer-wise representations of LLMs and vision transformers with a unified matrix-based-entropy framework of compression, geometry, and invariance metrics, showing intermediate layers often beat final layers on 32 MTEB tasks.
Problem
Final-layer representations of LLMs are assumed to be the best for downstream embedding tasks, but it is unclear whether earlier or intermediate layers may be better and why.
Approach
Unifies information-theoretic (prompt/dataset matrix-based entropy), geometric (curvature, effective rank), and augmentation-invariance (InfoNCE, LiDAR, DiME) metrics under matrix-based entropy, and uses them to probe every layer of several models, showing mid-depth layers often provide the best embeddings and that autoregressive objectives produce a mid-layer compression valley.
Key results
- Intermediate layers outperform the final layer on nearly every MTEB task, with absolute improvements of about 2% to 16% on average.
- Unsupervised DiME-based layer selection improves Pythia-410M average MTEB score from 45.5 (last layer) to 48.5.
- Autoregressive models (Pythia, AIM) show a mid-depth entropy valley, whereas BERT and most non-autoregressive vision models do not.
Measured effects reported in the paper
| What was changed | Where | Measured | Effect |
|---|---|---|---|
| select the layer with minimum DiME instead of using the last layer | Pythia-410M · MTEB (32 tasks) | average MTEB performance (%): 45.5 -> 48.5 | Helped |
| select the layer with minimum dataset entropy instead of using the last layer | Pythia-410M · MTEB (32 tasks) | average MTEB performance (%): 45.5 -> 48.1 | Helped |
| select the layer with minimum InfoNCE instead of using the last layer | Pythia-410M · MTEB (32 tasks) | average MTEB performance (%): 45.5 -> 46.2 | Helped |
| select the layer with minimum InfoNCE instead of using the last layer | LLM2Vec-8B · MTEB (32 tasks) | average MTEB performance (%): 63.9 -> 64.3 | Helped |
| select the layer with minimum DiME instead of using the last layer | LLM2Vec-8B · MTEB (32 tasks) | average MTEB performance (%): 63.9 -> 60.0 | Hurt |
| select the layer with minimum dataset entropy instead of using the last layer | LLM2Vec-8B · MTEB (32 tasks) | average MTEB performance (%): 63.9 -> 50.4 | Hurt |
| use an intermediate layer instead of the final layer | language models evaluated on MTEB tasks · MTEB (32 tasks) | downstream task performance | Helped |
| use DiME-based unsupervised layer selection instead of using the last layer | Pythia-410M · MTEB (32 tasks) | average MTEB score: 3% | Helped |
| fine-tune with LLM2Vec-mntp-unsup-simcse | Llama3 · input augmentations | augmentation invariance | Helped |
| fine-tune with LLM2Vec-mntp-supervised | Llama3 · input augmentations | augmentation invariance | Helped |
| add math pretraining and CoT finetuning | Qwen 2.5 · token sequences | prompt entropy | Helped |
| increase token repetition | Pythia-410M · extreme prompts | prompt entropy | Hurt |
Surprising findings
- The final layer can be overly specialized to the pretraining objective, underperforming mid-depth layers on downstream embedding tasks.
- AIMv2 does not show improved intermediate accuracy despite still producing an entropy valley.
Limitations
- Metrics are correlated with downstream performance but not a formal integration; anisotropy and intrinsic dimensionality are left for future work.
- Evaluation restricted to 32 English MTEB tasks and WikiText-103 for analysis.
- Theoretical results rely on strong assumptions such as orthogonal equivariance and isotropic Gaussian data.
Experimental setup
Datasets: WikiText-103 MTEB (32 tasks) ImageNet-1k ImageNet-100
Benchmarks: MTEB (32 tasks) ImageNet-1k WikiText-103
Metrics: average MTEB score distance correlation Spearman Kendall prompt entropy dataset entropy curvature InfoNCE LiDAR DiME
Baselines: final-layer embeddings LLM2Vec-8B Pythia-410M last layer
Builds on: LiDAR DiME InfoNCE RankMe LLM2Vec
Closest papers by meaning
- LLM Layers Immediately Correct Each Other (NeurIPS 2025 · similarity 0.89)
- Scaling Embedding Layers in Language Models (NeurIPS 2025 · similarity 0.89)
- The Curse of Depth in Large Language Models (NeurIPS 2025 · similarity 0.89)
- LayerIF: Estimating Layer Quality for Large Language Models using Influence Functions (NeurIPS 2025 · similarity 0.89)
- Leviathan: Decoupling Input and Output Representations in Language Models (NeurIPS 2026 · similarity 0.88)
- Layer as Puzzle Pieces: Compressing Large Language Models through Layer Concatenation (NeurIPS 2025 · similarity 0.88)
Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.
