arXiv Science⌕ Search

arXiv · 2610.32788

Generalization properties of the token perceptron: the role of embedding and vocabulary

Abstract

Large language models are trained to predict tokens from a finite vocabulary, each represented by a vector in a $d$-dimensional embedding space. Therefore, token prediction is a classification problem whose classes have a geometry determined by the embedding. We study how this geometry affects learning in a minimal solvable model: a linear predictor that maps a sequence of $N$ embedded tokens to a $d$-dimensional output through one $d\times d$ matrix per position, trained in the teacher--student setting. We call this the \textit{token perceptron}. We compute its generalization error with the replica method, taking $N\to\infty$ at fixed number of examples per position $α=P/N$ and keeping $d$ and the vocabulary size $D$ finite. As a first reference case, we consider continuous embeddings on the sphere, which isolate the role of the embedding dimension. The natural load is then $α/d$, and for $d>1$ a normalized label fixes the direction of the teacher output, so the problem becomes a noiseless regression: the teacher is recovered exactly above $α_{\rm rec}=d^2/(d-1)$, and spherical cross-entropy reaches this threshold at large inverse temperature. In the same setting the storage capacity of random associations scales as $d^2$ for margins $O(1/\sqrt{d})$. We then turn to vocabulary embeddings, where a label only identifies the Voronoi cell of the teacher output, so that each example imposes inequalities rather than equations, as in the classical perceptron. We compute the Bayes-optimal error for a given embedding matrix through an approximate spectral closure and show that the optimal learner first resolves the directions in which the vocabulary has the largest variance, even when the teacher is isotropic.

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Dario Bocchi, Matteo Negri, Flavio Nicoletti, Francesco D'Amico. 2026-10-23. Generalization properties of the token perceptron: the role of embedding and vocabulary. https://arxiv.org/abs/2610.32788

Cite the original work for its findings. Save a collection to share your selection of sources.

KEEP EXPLORING

Related papers

Approximating velocity fields with planted point attractors via Neural-ODE for classification purposes

In this work, Neural ODEs equipped with a curated collection of equilibrium points have been successfully employed for classification tasks. The planted fixed points serve as indicators for the target classes, while the velocity field, leveraging the universal approximation capabilities of the architecture, shapes the dynamical landscape. This process defines the basins of attraction of the trained model, effectively directing each input (provided as an initial condition) toward its corresponding destination target.

cond-mat.dis-nn↗

Boundary shape controls the stress distribution in two-component elastic materials

We investigate how the shape and arrangement of high-stiffness regions govern stress redistribution in two-component triangular elastic spring networks subjected to spatially correlated and uncorrelated random prestress. We compare boundary roughness, partitioning into disconnected regions, and graded transitions between regions of different stiffness. Our simulations identify interface bonds as channels for energy transfer: increasing their number provides additional transfer paths and reduces stress concentration in mechanically rigid regimes, while offering little benefit in compliant subnetworks. This is analogous to defects in naturally occurring crystal structures, where the defects themselves isolate stress. At a fixed fraction of high-stiffness material, partitioning reduces stress concentration for both correlated and uncorrelated prestress. The benefit diminishes with further subdivision as the number of interface bonds becomes comparable to the number of interior nodes. Stress reduction, however, depends on the spatial correlations of the imposed prestress: random prestress generally yields a stronger effect, though the difference diminishes in some regimes. Graded interfaces further reduce peak stress by distributing the stiffness transition over a broader region. Together, these results suggest design strategies based on increasing interface area, matching subdivision scale to prestress correlations, and grading stiffness transitions. This minimal framework identifies how internal structure controls energy transfer and stress redistribution, suggesting design principles for mechanical robustness under both internal and external loading.

cond-mat.dis-nn↗

Existence and Absence of Spin-Glass Phases on Migdal--Kadanoff Hierarchical Lattices: A Complete Classification

We consider the Ising spin-glass model on Migdal--Kadanoff (MK) hierarchical lattices, characterized by the fractal dimension $d=1+\log s/\log b$, where $s$ and $b$ denote the number of parallel branches and the number of bonds in series within each branch, respectively. For independent Gaussian couplings, we rigorously establish a necessary and sufficient condition for the existence of finite-temperature spin-glass order for arbitrary integers $b,s\ge2$. We prove that a finite-temperature spin-glass phase exists whenever \[ \frac{b}{\sqrt{s}} \left( \frac{b\sqrt{s(s-1)}}{bs-1} \right)^{s-1}<1. \] In particular, this condition holds for all three-dimensional MK hierarchical lattices ($d=3$, or equivalently $s=b^2$), regardless of the choice of $b$. Conversely, we prove the absence of finite-temperature spin-glass order for fractal dimensions $d<1+\log17/\log6\approx2.58$, as well as in the large-$b$ limit for any fixed $d<3$. In the intermediate regime $1+\log17/\log6\le d<3$, we provide a finite-step procedure to determine the presence or absence of spin-glass order, which depends on $b$ and $s$. Our results provide a complete characterization of finite-temperature spin-glass order on MK hierarchical lattices.

cond-mat.dis-nn↗