The Geometry of Tokens in Internal Representations of Large Language
  Models
We investigate the relationship between the geometry of token embeddings and
their role in the next token prediction within transformer models. An important
aspect of this connection uses the notion of empirical measure, which encodes
the distribution of token point clouds across transformer layers and drives the
evolution of token representations in the mean-field interacting picture. We
use metrics such as intrinsic dimension, neighborhood overlap, and cosine
similarity to observationally probe these empirical measures across layers. To
validate our approach, we compare these metrics to a dataset where the tokens
are shuffled, which disrupts the syntactic and semantic structure. Our findings
reveal a correlation between the geometric properties of token embeddings and
the cross-entropy loss of next token predictions, implying that prompts with
higher loss values have tokens represented in higher-dimensional spaces.
6790ffb0561e5b824100c29a
Karthik Viswanathan
extracted_pending
2025-01-22T14:24:50.240Z
6632140cf69134729c68e65f
/avatars/f68426b505752606223bb78fd82a1af9.svg
Karthik Viswanathan
user
vkarthik095
6790ffb0561e5b824100c29b
Yuri Gardinazzi
claimed_verified
2025-01-22T15:35:14.198Z
6618fbba78bd2f4adc475834
https://cdn-avatars.huggingface.co/v1/production/uploads/6618fbba78bd2f4adc475834/dJBRN4jucKOnMHtq2aq42.jpeg
YuriGardinazzi
user
YuriGardinazzi
6790ffb0561e5b824100c29c
Giada Panerai
6790ffb0561e5b824100c29d
Alberto Cazzaniga
6790ffb0561e5b824100c29e
Matteo Biagetti
The Geometry of Tokens in Internal Representations of Large Language
  Models
We investigate the relationship between the geometry of token embeddings and
their role in the next token prediction within transformer models. An important
aspect of this connection uses the notion of empirical measure, which encodes
the distribution of token point clouds across transformer layers and drives the
evolution of token representations in the mean-field interacting picture. We
use metrics such as intrinsic dimension, neighborhood overlap, and cosine
similarity to observationally probe these empirical measures across layers. To
validate our approach, we compare these metrics to a dataset where the tokens
are shuffled, which disrupts the syntactic and semantic structure. Our findings
reveal a correlation between the geometric properties of token embeddings and
the cross-entropy loss of next token predictions, implying that prompts with
higher loss values have tokens represented in higher-dimensional spaces.
The research explores the relationship between token embedding geometry and next token prediction in transformers, finding correlations between geometric properties and prediction loss.
transformer models token embeddings empirical measure intrinsic dimension neighborhood overlap cosine similarity cross-entropy loss