Share your thoughts, 1 month free Claude Pro on usSee more
WorkDL logo mark

Layer by Layer: Uncovering Hidden Representations in Language Models

About

From extracting features to generating text, the outputs of large language models (LLMs) typically rely on the final layers, following the conventional wisdom that earlier layers capture only low-level cues. However, our analysis shows that intermediate layers can encode even richer representations, often improving performance on a range of downstream tasks. To explain and quantify these hidden-layer properties, we propose a unified framework of representation quality metrics based on information theory, geometry, and invariance to input perturbations. Our framework highlights how each layer balances information compression and signal preservation, revealing why mid-depth embeddings can exceed the last layer's performance. Through extensive experiments on 32 text-embedding tasks across various architectures (transformers, state-space models) and domains (language, vision), we demonstrate that intermediate layers consistently provide stronger features, challenging the standard view on final-layer embeddings and opening new directions on using mid-layer representations for more robust and accurate representations.

Oscar Skean, Md Rifat Arefin, Dan Zhao, Niket Patel, Jalal Naghiyev, Yann LeCun, Ravid Shwartz-Ziv• 2025

Related benchmarks

TaskDatasetResultRank
Intent ClassificationBanking77 (test)
Accuracy68.25
184
Semantic Textual SimilaritySTS Benchmark (test)
Pearson Correlation (r)0.4563
46
Semantic Textual SimilaritySTS13 (test)
Spearman Correlation52.66
42
Semantic Textual SimilaritySTS16 (test)
Spearman Corr54.32
42
Semantic Textual SimilaritySTS15 (test)
Spearman Correlation0.5807
42
Semantic Textual SimilaritySTS14 (test)
Spearman Correlation0.4288
42
Text ClassificationEmotion (test)
Accuracy34.23
38
ClassificationMTOPIntent (test)
Accuracy73.39
33
ClassificationMTOP Domain (test)
Accuracy84.42
33
ClassificationPoemSentiment (test)
Accuracy42.4
33
Showing 10 of 13 rows

Other info

Follow for update