대규모 언어 모델의 내부 표현에서 토큰의 기하학
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