Reading Between the Layers: Where Representation Quality Lives, and What Geometry Reveals
Organizations: Indraprastha Institute of Information Technology, Delhi · Manipal University Jaipur
Abstract
Representation quality in pretrained text foundation models is not concentrated at the final layer, yet practitioners routinely probe it there because layer selection without labels has remained an open problem. We present a large-scale empirical study of where layer quality lives across 25 models spanning four architectural families and four pretraining strategies, evaluated on 13 datasets across classification, pair classification, semantic textual similarity, and multiple-choice question answering. Peak probing layers depend systematically on pretraining strategy and architecture: masked encoders peak in late-middle layers, sequence-to-sequence models shift their peak with task type, contrastive sentence encoders concentrate signal at the final layer under CLS and last-token readouts but peak early under mean pooling, and decoder-only models exhibit distinct phase structure tied to depth. We distill these findings into the Stable Geometry Index (SGI), a closed-form, fully label-free selector with no fitted coefficients combining power-law fit quality, effective-rank capacity, spectral stability, and a weak depth prior. Across 383 evaluation groups SGI improves over the last-layer baseline and lifts Hit@3 from 0.39 to 0.52, recovering 40% of the gap to the oracle without using any labels, and exceeds a supervised ELMo-style layer mix on the matched subset despite using strictly less information. Our ablations also reverse a common assumption in the spectral-decay literature: power-law fit quality is a stronger predictor of layer quality than the exponent's proximity to one.
Figures & tables
| Method | Gain-L (%) | Gap-O (%) | H@1 | H@3 |
|---|---|---|---|---|
| SGI (Our Method) | 1.20 | 1.80 | 0.285 | 0.517 |
| Eff. rank | 0.45 | 2.55 | 0.238 | 0.428 |
| RankMe | 0.45 | 2.55 | 0.238 | 0.428 |
| Last | 0.00 | 3.00 | 0.235 | 0.389 |
| Entropy | -0.29 | 3.28 | 0.198 | 0.397 |
| Part. ratio | -0.71 | 3.71 | 0.222 | 0.407 |
| Metric | 95% CI | Test | |
|---|---|---|---|
| Primary metric | +1.20 pp | [0.85, 1.54] | |
| Hit@3 | +12.79 pp | [6.79, 18.80] |
| Pooling | Gain-L (pp) | Gap-O (pp) | H@3 | |
|---|---|---|---|---|
| CLS | 191 | 0.58 | 1.80 | 0.613 |
| Last token | 24 | 1.30 | 5.71 | 0.500 |
| Mean | 96 | 2.48 | 1.13 | 0.427 |
| SBERT pair | 72 | 1.09 | 1.40 | 0.389 |
| Task | Gain-L (%) | Gap-O (%) | H@3 | |
|---|---|---|---|---|
| Classification | 287 | 3.18 | 1.97 | 0.585 |
| Multiple-choice QA | 90 | 0.06 | 1.10 | 0.378 |
| Pair classification | 158 | 0.76 | 1.39 | 0.399 |
| STS | 82 | 1.69 | 9.41 | 0.476 |
| Method | Metric | Gain-L (%) |
|---|---|---|
| Oracle best layer | 0.715 | 2.38 |
| SGI | 0.697 | 0.58 |
| Last layer | 0.692 | 0.00 |
| Learned all-layer mix | 0.683 | -0.83 |
| Model family | Gain-L (%) | Gap-O (%) | H@3 | |
|---|---|---|---|---|
| Encoder | 383 | 1.20 | 1.80 | 0.517 |
| Decoder | 48 | 0.11 | 1.49 | 0.354 |
| Encoder–decoder | 80 | 6.51 | 5.91 | 0.600 |
| Sentence transformer | 82 | 2.33 | 2.19 | 0.598 |
| State-space | 8 | 4.57 | 1.50 | 0.125 |
| Model | Datasets | Gain-L (pp) |
|---|---|---|
| DeBERTa-v3-large | SST-2, MRPC, STS-B | |
| Mamba-2.8B | ARC, PIQA, STS-B | |
| XLM-RoBERTa-large | SST-2, MRPC, STS-B | |
| Qwen3.5-4B | ARC, PIQA |
| Task | SGI | Learned | |
|---|---|---|---|
| Classification | 95 | 0.740 | 0.720 |
| Pair classification | 72 | 0.655 | 0.656 |
| STS | 24 | 0.657 | 0.620 |
| Variant | Score | Gain-L (%) | H@3 |
|---|---|---|---|
| SGI (full) | 1.20 | 0.517 | |
| No residual | 0.72 | 0.473 | |
| No capacity | 0.00 | 0.454 | |
| No spread | 0.94 | 0.478 | |
| No depth prior | 0.73 | 0.449 | |
| Linear capacity | 0.96 | 0.491 |
Appendix figures & tables27 assets
Supplementary material from the paper’s appendix.
Appendix
| Task family | Datasets | Primary metric |
|---|---|---|
| Classification | SST-2; AG News; Emotion; Banking77 | Accuracy |
| Pair classification | SNLI; MultiNLI; MRPC; QQP | Accuracy |
| STS | STS-B; BIOSSES | Spearman correlation |
| Multiple-choice QA | ARC; HellaSwag; PIQA | Accuracy |
| Dataset | Task | Domain |
| SST-2 | classification | Sentiment |
| AG News | classification | News |
| Emotion | classification | Social |
| Banking77 | classification | Finance |
| SNLI | pair classification | NLI |
| MultiNLI | pair classification | Multi-genre |
| Artifact | Rows | Models | Datasets |
|---|---|---|---|
| Peak-layer instances | 617 | 25 | 13 |
| Layerwise score rows | 8,544 | 25 | 13 |
| Final SGI selector groups | 383 | 12 | 8 |
| Analysis scope | Models | Datasets | Tasks | Readouts | Probes | Seeds | Evaluation unit |
|---|---|---|---|---|---|---|---|
| Layerwise peak analysis | 25 | 13 | 4 | 4 | 2 | 3 | 617 peak-layer instances |
| Layerwise scores | 25 | 13 | 4 | 4 | 2 | 3 | 8,544 layerwise score rows |
| Final SGI selector evaluation | 12 | 8 | 3 | 4 | 2 | 3 | 383 encoder selector groups |
| Selector comparison | 12 | 8 | 3 | 4 | 2 | 3 | 21 methods on the same 383 groups |
| Task | Readout | Linear probe | Nonlinear probe | Total |
|---|---|---|---|---|
| Classification | CLS token | 54 | 53 | 107 |
| Classification | Last token | 18 | 18 | 36 |
| Classification | Mean pooled tokens | 72 | 72 | 144 |
| Multiple-choice QA | CLS token | 12 | 12 | 24 |
| Multiple-choice QA | Last token | 33 | 33 | 66 |
| Pair classification | CLS token | 40 | 39 | 79 |
| Dimension | Value | Groups |
|---|---|---|
| Task | Classification | 191 |
| Task | Pair classification | 144 |
| Task | STS | 48 |
| Readout | CLS token | 191 |
| Readout | Mean pooled tokens | 96 |
| Readout | Sentence-pair readout | 72 |
| Task | Early | Middle | Late | Total |
|---|---|---|---|---|
| Classification | 121 (42.2%) | 28 (9.8%) | 138 (48.1%) | 287 |
| Multiple-choice QA | 30 (33.3%) | 31 (34.4%) | 29 (32.2%) | 90 |
| Pair classification | 21 (13.3%) | 48 (30.4%) | 89 (56.3%) | 158 |
| STS | 11 (13.4%) | 33 (40.2%) | 38 (46.3%) | 82 |
| Readout | Early | Middle | Late | Total |
|---|---|---|---|---|
| CLS token | 27 (11.1%) | 54 (22.1%) | 163 (66.8%) | 244 |
| Last token | 50 (33.3%) | 42 (28.0%) | 58 (38.7%) | 150 |
| Mean pooled tokens | 88 (61.1%) | 14 (9.7%) | 42 (29.2%) | 144 |
| Sentence-pair readout | 18 (22.8%) | 30 (38.0%) | 31 (39.2%) | 79 |
| Family | N | Q1 | Median | Q3 | IQR | Outliers |
|---|---|---|---|---|---|---|
| Encoder-decoder | 120 | 0.083 | 0.167 | 0.833 | 0.750 | 0 |
| Decoder | 48 | 0.333 | 0.542 | 0.688 | 0.354 | 0 |
| SSM | 8 | 0.615 | 0.667 | 0.708 | 0.094 | 1 |
| Encoder | 399 | 0.479 | 0.727 | 0.917 | 0.438 | 0 |
| Sentence transformer | 42 | 0.667 | 0.917 | 1.000 | 0.333 | 3 |
| Family | Training label | Task | Readout | N | Median peak | Early peak | Early 1pp |
|---|---|---|---|---|---|---|---|
| Encoder-decoder | Span Corruption | Classification | last token | 18 | 0.08 | 100.0 | 100.0 |
| Encoder-decoder | Span Corruption | Classification | mean pooled tokens | 18 | 0.08 | 100.0 | 100.0 |
| Encoder-decoder | Span Corruption | STS | last token | 6 | 0.08 | 100.0 | 100.0 |
| Encoder-decoder | Contrastive Sentence Embedding Finetuning | Classification | mean pooled tokens | 12 | 0.08 | 91.7 | 100.0 |
| Decoder | Causal Language Modeling | Multiple-choice QA | CLS token | 24 | 0.42 | 45.8 | 100.0 |
| Encoder-decoder | Contrastive Sentence Embedding Finetuning | Multiple-choice QA | last token | 12 | 0.79 | 33.3 | 100.0 |
| Family | Training label | Task | Readout | N | Early 1pp | Gap |
|---|---|---|---|---|---|---|
| Encoder-decoder | Span Corruption | Classification | last token | 18 | 100.0 | 0.185 |
| Encoder-decoder | Span Corruption | Classification | mean pooled tokens | 18 | 100.0 | 0.295 |
| Encoder-decoder | Span Corruption | STS | last token | 6 | 100.0 | 0.191 |
| Encoder-decoder | Contrastive Sentence Embedding Finetuning | Classification | mean pooled tokens | 12 | 100.0 | 0.093 |
| Decoder | Causal Language Modeling | Multiple-choice QA | CLS token | 24 | 100.0 | 0.005 |
| Encoder-decoder | Contrastive Sentence Embedding Finetuning | Multiple-choice QA | last token | 12 | 100.0 | 0.003 |
| Task | Training label | N | Early near-best (%) |
|---|---|---|---|
| Classification | Span Corruption | 36 | 100.0 |
| Classification | Masked Language Modeling (MLM) | 111 | 60.4 |
| Classification | Contrastive Sentence Embedding Finetuning | 48 | 56.2 |
| Classification | Continual Multi-Task Pretraining | 16 | 56.2 |
| Classification | Knowledge Distillation + MLM | 16 | 43.8 |
| Classification | Replaced Token Detection (RTD) | 16 | 43.8 |
| Pruning rule | Count |
|---|---|
| All observed quadruplets | 58 |
| Quadruplets with at least 6 instances | 43 |
| Quadruplets with at least 8 instances | 28 |
| Quadruplets with at least 10 instances | 16 |
| Task | Readout | N | Win (%) | Mean gap | Early 1pp (%) |
|---|---|---|---|---|---|
| Classification | Mean pooled tokens | 143 | 97.2 | 0.000 | 83.2 |
| Classification | CLS token | 107 | 3.7 | -0.083 | 20.6 |
| Classification | Last token | 36 | 0.0 | -0.294 | 72.2 |
| Multiple-choice QA | Last token | 24 | 95.8 | 0.000 | 54.2 |
| Multiple-choice QA | CLS token | 24 | 4.2 | -0.031 | 100.0 |
| Pair classification | Sentence-pair readout | 79 | 86.1 | -0.002 | 51.9 |
| Task | Higher-performing readout vs alternative | N | Win (%) | Mean delta | Median delta |
|---|---|---|---|---|---|
| Classification | Mean pooled tokens vs CLS token | 107 | 96.3 | 0.083 | 0.060 |
| Classification | Mean pooled tokens vs Last token | 36 | 100.0 | 0.294 | 0.194 |
| Multiple-choice QA | Last token vs CLS token | 24 | 95.8 | 0.031 | 0.013 |
| Pair classification | Sentence-pair readout vs CLS token | 79 | 86.1 | 0.049 | 0.042 |
| STS | CLS token vs Last token | 34 | 76.5 | 0.053 | 0.014 |
| Coordinate | Formula | Source | Interpretation |
|---|---|---|---|
| Residual | Low residual power-law error | ||
| Capacity | effective rank | High spectral capacity | |
| Stability | condition number, 2NN dimension | Stable spread | |
| Depth | layer depth | Late-middle phase prior |
| Coordinate | Task | N | Mean delta | Median delta | Std. |
|---|---|---|---|---|---|
| Capacity | Classification | 191 | 0.152 | 0.000 | 0.831 |
| Capacity | Pair classification | 144 | -0.220 | -0.187 | 0.757 |
| Capacity | STS | 48 | -0.717 | -0.497 | 0.769 |
| Depth | Classification | 191 | 0.255 | 0.003 | 0.369 |
| Depth | Pair classification | 144 | 0.540 | 0.606 | 0.412 |
| Depth | STS | 48 | 0.709 | 0.819 | 0.309 |
| Model | Task | Readout | Datasets | Best | Selected | Spearman | Verdict |
|---|---|---|---|---|---|---|---|
| deberta-v3-base | Classification | Mean pooled tokens | 4 | 7 | 1 | 0.315 | appendix candidate |
| distilbert-base-uncased | Pair classification | Sentence-pair readout | 3 | 5 | 1 | -0.886 | caution only |
| ernie-2.0-base-en | Pair classification | CLS token | 3 | 9 | 10 | 0.972 | main candidate |
| distilbert-base-uncased | Classification | CLS token | 4 | 5 | 5 | 0.943 | main candidate |
| Artifact class | License or access condition observed | Artifacts |
|---|---|---|
| Models | Apache-2.0 | BERT variants, DistilBERT, ModernBERT, MPNet sentence encoder, Pythia-70M, Qwen2.5-0.5B, T5, BART, Flan-T5, ByT5, Instructor, Sentence-T5 |
| Models | MIT | RoBERTa, DeBERTa-v3, XLM-RoBERTa, BGE, GPT-2, GPT-Neo |
| Models | CC-BY-NC-4.0 | XLM-MLM-100-1280 |
| Models | Not specified in queried metadata | SpanBERT, ERNIE-2.0-base-en, Mamba-130M |
| Datasets | MIT | Banking77 |
| Datasets | CC-BY-SA-4.0 | SNLI, ARC-Challenge |
| Family | Examples | Count | Min params | Max params | Layer range |
|---|---|---|---|---|---|
| Encoder | BERT, RoBERTa, DeBERTa, XLM-R | 12 | 66.4M | 571.5M | 6–24 |
| Sentence transformer | MPNet, BGE | 2 | 109.5M | 109.5M | 12 |
| Decoder | GPT-2, GPT-Neo, Pythia, Qwen2.5 | 4 | 70.4M | 494.0M | 6–24 |
| Encoder–decoder | T5, BART, Flan-T5, ByT5, Instructor, Sentence-T5 | 6 | 139.4M | 581.1M | 6–18 |
| State-space | Mamba-130M | 1 | 129.1M | 129.1M | 24 |
| Dataset | Task | Train | Dev | Test | Groups |
|---|---|---|---|---|---|
| AG News | Classification | 120000 | – | 7600 | 80 |
| Emotion | Classification | 16000 | 2000 | 2000 | 79 |
| Banking77 | Classification | 9993 | – | 3076 | 80 |
| SST-2 | Classification | 67349 | 872 | 1821 | 48 |
| MRPC | Pair classification | 3668 | 408 | 1725 | 52 |
| QQP | Pair classification | 363846 | 40430 | 390965 | 10 |
Language Model Probing
Language model probing measures what information and capabilities models encode and how those signals relate to their behavior.
See all 306 papers