Reproduce “Layer by Layer: Uncovering Hidden Representations in Language Models” on OpenResearch

Turn your favorite coding agents into research agents that review literature, develop hypotheses, and run experiments.

Universal app for Apple silicon and Intel. Requires macOS 11 or later.

About this paper

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

The authors evaluate whether intermediate language-model layers provide better features than the conventional final layer for embedding tasks. They compare representations across layers on 32 English MTEB tasks and relate performance to measures of information, compression, and stability. Some intermediate layer outperforms the last in nearly every task, with average improvements of 2% to 16% across tested models, not universally.

Key insights

  • Intermediate layers in autoregressive models consistently yield superior representations for downstream tasks, challenging the reliance on final layers.
  • The proposed matrix-based entropy metrics effectively correlate with downstream performance, enabling unsupervised selection of optimal layers.
  • The training objective, particularly autoregression, significantly influences the layer-wise information compression and representation dynamics, observed across both language and vision models.

Summary by alphaXiv.

Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.