大規模言語モデルの内部表現におけるトークンの幾何学
The Geometry of Tokens in Internal Representations of Large Language Models
January 17, 2025
著者: Karthik Viswanathan, Yuri Gardinazzi, Giada Panerai, Alberto Cazzaniga, Matteo Biagetti
cs.AI
要旨
トークン埋め込みの幾何学とトランスフォーマーモデル内での次のトークン予測における役割との関係を調査します。この接続の重要な側面は、トークンの点群の分布を符号化し、平均場相互作用の視点でトークン表現の進化を促す経験的測定の概念を使用します。我々は、固有次元、近傍重複、コサイン類似度などのメトリクスを使用して、これらの経験的測定を層を横断して観察的に探索します。我々のアプローチを検証するために、トークンがシャッフルされたデータセットとこれらのメトリクスを比較します。これにより、構文および意味構造が崩れるデータセットが得られます。我々の調査結果は、トークン埋め込みの幾何学的特性と次のトークン予測の交差エントロピー損失との相関を明らかにしました。これは、損失値が高いプロンプトは、高次元空間で表現されるトークンを持っていることを意味しています。
English
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.Summary
AI-Generated Summary