Does Representation Matter? Exploring Intermediate Layers in Large Language Models

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Skean, Oscar, Arefin, Md Rifat, LeCun, Yann, Shwartz-Ziv, Ravid
Natura: Preprint
Pubblicazione: 2024
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866915061438611456
author Skean, Oscar
Arefin, Md Rifat
LeCun, Yann
Shwartz-Ziv, Ravid
author_facet Skean, Oscar
Arefin, Md Rifat
LeCun, Yann
Shwartz-Ziv, Ravid
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2412_09563
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Does Representation Matter? Exploring Intermediate Layers in Large Language Models
Skean, Oscar
Arefin, Md Rifat
LeCun, Yann
Shwartz-Ziv, Ravid
Machine Learning
Computation and Language
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.
title Does Representation Matter? Exploring Intermediate Layers in Large Language Models
topic Machine Learning
Computation and Language
url https://arxiv.org/abs/2412.09563