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

DevFeed: [Generalization properties of the token perceptron: the role of embedding and vocabulary](<https://devfeed.tech/articles/generalization-properties-of-the-token-perceptron-the-role-of-embedding-and-vocabulary-99658.md>)

Original publisher: [Read original article](<https://arxiv.org/abs/2610.32788>)

Author: Dario Bocchi, Matteo Negri, Flavio Nicoletti, Francesco D'Amico

Published: 2026-10-26T04:00:00Z

Content type: article

Language: en

Sources: [arXiv: Machine Learning](<https://devfeed.tech/sources/arxiv-machine-learning.md>)

Topics: [Language models](<https://devfeed.tech/topics/language-models.md>), [Embeddings](<https://devfeed.tech/topics/embeddings.md>), [Large Language Model](<https://devfeed.tech/topics/llm.md>), [mlp](<https://devfeed.tech/topics/mlp.md>)

Tags: [2](<https://devfeed.tech/tags/2.md>), [abstract](<https://devfeed.tech/tags/abstract.md>), [alpha](<https://devfeed.tech/tags/alpha.md>), [arxiv](<https://devfeed.tech/tags/arxiv.md>), [call](<https://devfeed.tech/tags/call.md>), [capacity](<https://devfeed.tech/tags/capacity.md>), [classes](<https://devfeed.tech/tags/classes.md>), [classification](<https://devfeed.tech/tags/classification.md>), [closure](<https://devfeed.tech/tags/closure.md>), [compute](<https://devfeed.tech/tags/compute.md>), [cond-mat-dis-nn](<https://devfeed.tech/tags/cond-mat-dis-nn.md>), [cond-mat-stat-mech](<https://devfeed.tech/tags/cond-mat-stat-mech.md>), [consider](<https://devfeed.tech/tags/consider.md>), [continuous](<https://devfeed.tech/tags/continuous.md>), [cross](<https://devfeed.tech/tags/cross.md>), [cs-lg](<https://devfeed.tech/tags/cs-lg.md>), [d](<https://devfeed.tech/tags/d.md>), [dimension](<https://devfeed.tech/tags/dimension.md>), [embedded](<https://devfeed.tech/tags/embedded.md>), [embedding](<https://devfeed.tech/tags/embedding.md>), [perceptron](<https://devfeed.tech/tags/perceptron.md>), [properties](<https://devfeed.tech/tags/properties.md>), [stat-ml](<https://devfeed.tech/tags/stat-ml.md>), [token](<https://devfeed.tech/tags/token.md>)

## AI overview

The token perceptron model shows that embedding geometry changes token prediction from regression to inequality-constrained classification. With continuous spherical embeddings, normalized labels fix the teacher output direction; for dimension d>1, the teacher is recovered exactly above α_rec = d²/(d−1), and spherical cross-entropy reaches that threshold at large inverse temperature. Random-association storage capacity scales as d² for margins of order 1/√d. With finite-vocabulary embeddings, each label identifies a Voronoi cell and imposes inequalities. An approximate spectral closure for Bayes-optimal error indicates that learning first resolves directions with the vocabulary's largest variance, even for an isotropic teacher.

## Source excerpt

arXiv:2610.32788v1 Announce Type: cross 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 $\alpha=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 $\alpha/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 $\alpha_{\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.