The structure of the token space for large language models
Michael Robinson, Sourya Dey, Shauna Sweet
TL;DR
The paper addresses how tokens occupy a high-dimensional embedding space and argues that the token subspace is not a manifold but a stratified manifold with locally varying dimension and strongly negative curvature. It introduces a Monte-Carlo, regression-based method to estimate local dimension $n$ and Ricci curvature $Ric$ from volume-radius curves via the asymptotic relation $v(r) = K r^n igl(1 - rac{Ric}{6(n+2)} r^2 + O(r^4)igr)$, and applies it to GPT2, LLEMMA7B, and MISTRAL7B. The key findings are that the token subspaces are stratified, exhibit negative curvature across strata, and show clear differences between numeric and non-numeric tokens, with local dimension far smaller than the ambient latent space and strong correlations between geometry and generative fluency. These results have practical implications for understanding model behavior, stability under retraining, and the limits of global guarantees in inference, guiding future analysis of embedding geometry in large language models.
Abstract
Large language models encode the correlational structure present in natural language by fitting segments of utterances (tokens) into a high dimensional ambient latent space upon which the models then operate. We assert that in order to develop a foundational, first-principles understanding of the behavior and limitations of large language models, it is crucial to understand the topological and geometric structure of this token subspace. In this article, we present estimators for the dimension and Ricci scalar curvature of the token subspace, and apply it to three open source large language models of moderate size: GPT2, LLEMMA7B, and MISTRAL7B. In all three models, using these measurements, we find that the token subspace is not a manifold, but is instead a stratified manifold, where on each of the individual strata, the Ricci curvature is significantly negative. We additionally find that the dimension and curvature correlate with generative fluency of the models, which suggest that these findings have implications for model behavior.
