Does Representation Matter? Exploring Intermediate Layers in Large Language Models

Oscar Skean, Md Rifat Arefin, Yann LeCun, Ravid Shwartz-Ziv
12/12/2024
cs.LGcs.CL

No confident code implementation found for this paper.

Abstract

Understanding what defines a good representation in large language models (LLMs) is fundamental to both theoretical understanding and practical applications. In this paper, we investigate the quality of intermediate representations in various LLM architectures, including Transformers and State Space Models (SSMs). We find that intermediate layers often yield more informative representations for downstream tasks than the final layers. To measure the representation quality, we adapt and apply a suite of metrics - such as prompt entropy, curvature, and augmentation-invariance - originally proposed in other contexts. Our empirical study reveals significant architectural differences, how representations evolve throughout training, and how factors like input randomness and prompt length affect each layer. Notably, we observe a bimodal pattern in the entropy of some intermediate layers and consider potential explanations tied to training data. Overall, our results illuminate the internal mechanics of LLMs and guide strategies for architectural optimization and training.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{skean2024does,
  title  = {Does Representation Matter? Exploring Intermediate Layers in Large Language Models},
  author = {Oscar Skean and Md Rifat Arefin and Yann LeCun and Ravid Shwartz-Ziv},
  year   = {2024},
  eprint = {2412.09563},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2412.09563v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2412.09563.svg)](https://codeofpaper.com/paper/2412.09563)

Discussion