Next-token prediction relies on learned token embeddings whose dimension $d$ is much smaller than the vocabulary size $V$. Existing analyses of training dynamics either fix the embeddings with $d\ge V$ or train them only in restricted settings. It remains unclear whether jointly training the embeddings by gradient-based methods from random initialization leads to accurate prediction when $d<V$. In this paper, we study this question in the simplest setting where it is already nontrivial, namely next-token prediction with a one-token context, which we refer to as a state-transition model. The model consists of an input embedding and an output embedding, either untied or tied, and is trained from Gaussian initialization by perturbed gradient descent with weight decay on the population cross-entropy loss. We consider ground-truth transition laws whose centered log-probability table has low rank and bounded entries, and measure the prediction quality by the relative prediction gain (RPG). It is zero for the uniform predictor and one for the optimal predictor. For the untied model, we show that when $d=Ω(\sqrt V)$, with probability at least $1-e^{-cd}$ for some constant $c$, the RPG is above $7/8$ at every iterate in the final $1-1/d$ fraction of training iterations. For the tied model trained on a subset of states, we prove that the RPG on the observed states is $1-O(V/d^2)$, and under a coverage condition on the ground truth and a bound on the learned embeddings, we further prove a prediction guarantee on the unseen states. Our analysis is based on the bounded trace of the Hessian of the softmax cross-entropy loss, which implies that the approximate second-order stationary points reached by training have high prediction gain. Numerical experiments with practical parameter choices illustrate the persistent training gain and the transfer of the tied model.
翻译:暂无翻译