Layer by Layer: Uncovering Hidden Representations in Language Models

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

arXiv:2502.02013 · 2026-07-27 공개 · arXiv · PDF

language-models state-space-models information-theory transformers hidden-representations text-embedding embedding-features mid-layer

Abstract

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.

한국어 요약

한 줄 요약

중간층은 최종층보다 더 뛰어난 표현력을 가지며, 이를 정보 이론, 기하학, 불변성 기반의 통합 평가 프레임워크로 분석한다.

핵심 기여도

핵심 아이디어

기존에는 최종층이 가장 유용한 표현을 제공한다고 가정했으나, 본 연구는 중간층이 더 풍부한 표현을 담고 있음을 밝혔다. 이는 정보 이론적 압축과 신호 보존의 균형, 고차원 공간에서의 기하학적 분포, 입력 변형에 대한 불변성이라는 세 가지 관점을 통합한 프레임워크를 통해 설명된다. 특히, MTEB 데이터셋을 기반으로 32개의 텍스트 임베딩 태스크에서 중간층이 일관된 우수성을 보인다는 점에서, 기존의 최종층 중심 접근이 한계가 있음을 드러낸다.

기술적 접근법

주요 결과

의의 및 한계

본 연구는 LLM 내부 표현의 역할을 재조명하며, 중간층의 잠재력을 실질적으로 활용할 수 있는 이론적 근거를 제공한다. 특히, DiME, Curvature, InfoNCE와 같은 지표가 표현 품질과 일반화 능력 간의 강한 상관관계를 보임으로써, 모델 최적화와 평가 전략에 실질적 기여를 한다. 그러나 본 연구는 특정 아키텍처와 데이터셋에만 국한된 실험 결과를 기반으로 하며, 다양한 도메인과 스케일에서의 일반화 가능성은 추가 연구가 필요하다.

실용적 활용

본 연구는 NLP, 이미지 분석 등 다양한 도메인에서 중간층 표현을 활용한 모델 설계와 학습 전략 개선에 기여할 수 있다. 특히, 다단계 추론이 필요한 CoT 기반 시스템에서 중간층의 잠재 맥락 활용이 유리하며, 모델의 표현 품질을 정량적으로 평가할 수 있는 DiME, InfoNCE 등의 지표는 모델 최적화에 활용될 수 있다.