VerifiedarXiv:2511.0596330 min
Architecture · Representation learning

NextLat: Next-Latent Prediction Transformers Learn Compact World Models

A transformer trained to also predict its own next hidden state learns to summarize the past in a compact state.

NextLat keeps the transformer and its next-token loss and adds a small network that predicts the next hidden state from the current hidden state and the next token. The gradient of that prediction pushes each hidden state to carry everything about the past that the future depends on. The architecture and inference stay the same, and the small network can also propose draft tokens that speed up generation without changing the output.

Explaining the paperNext-Latent Prediction Transformers Learn Compact World ModelsTeoh, Tomar, Ahn, Hu, Pearce, Sharma, Krishnamurthy, Islam, Lamb, Langford · Microsoft Research · 2025 · arXiv:2511.05963 ↗

Transformers trained on Manhattan taxi rides propose a legal next turn every time and still carry a map of the city with streets at impossible angles. With one extra training loss, the paper's models keep their next-turn accuracy, hold a more consistent map, and use about a third as many effective dimensions to do it.

The paper is Next-Latent Prediction (NextLat), from Microsoft Research, released in November 2025. The page follows the order the method needs: why attention removes the pressure to compress, what a belief state is, the three loss terms and which parameters each one trains, why the states do not collapse, what the theorem does and does not prove, and then the results on world modeling, planning, state tracking and decoding speed.

A taxi model with an incoherent map

Vafa et al. (2024) built a test where the world model a sequence model should learn can be drawn: taxi rides in Manhattan written as turn-by-turn directions, whose true "world" is the street map. Their transformers generated valid routes 96 to 99% of the time, yet when they reconstructed the map implied by each model's predictions, it had streets at impossible orientations, roads passing over other roads, and connections that do not exist.

NextLat reuses their random-walk dataset (91 million rides, 4.7 billion tokens) and trains 48-layer transformers of width 384 for six epochs. A plain next-token model, which the paper calls GPT, and the NextLat model both score 100% on the next-token test, the share of predictions that are legal turns. The other metrics separate them:

Table 1 metricGPTNextLattrue map
next-token test100%100%100%
valid trajectories97.0%98.7%100%
sequence compression0.650.711.00
effective latent rank (lower = more compact)160.152.7n/a
detour robustness85.0%95.0%100%

Sequence compression asks a question a correct map answers trivially. Take two different routes that arrive at the same intersection and share a destination. The remaining trip is the same problem in both cases, so a model with a coherent map should continue them identically; the metric is the fraction of such pairs where it does. GPT does so 65% of the time, NextLat 71%. Detour robustness replaces the model's top choice with a random legal turn 75% of the time and checks that the ride still reaches its destination: 85.0% for GPT, 95.0% for NextLat. Effective latent rank measures how many directions the hidden states actually spread over, and has its own figure below. All of these differences appear between models whose next-token scores are identical, and the paper concludes that next-token accuracy "cannot meaningfully assess the quality of a model's learned world model."

Why attention removes the pressure to compress

A recurrent network reads a sequence one token at a time and carries a single fixed-size vector forward. To predict token 500 it can consult only that vector, so whatever about tokens 1 to 499 matters for the future has to be packed into it. A transformer removed that constraint: self-attention lets the position at token 500 read any earlier position directly, which is what makes training parallel across positions and long-range dependencies easy to learn. It also means the hidden state at step tt never has to be a self-contained summary, because the raw past stays available for lookup. The paper's introduction describes the transformer's memory as growing with sequence length, with no pressure to compress history into a compact state with a consistent update rule.

Drag the query position in Figure 1. In attention mode the number of positions ht\mathbf{h}_t reads grows with tt; in belief-state mode each state is built from the previous state and the newest token only, and stays one box wide at any length.

Figure 1 · random access vs. a carried state
t = 6
Two ways to use the past. In attention mode, the hidden state ht\mathbf{h}_t reaches back to every past token, so the number of lookups grows with the sequence. In belief-state mode, the past is folded into one fixed-size state, built only from the previous state and the newest token. Drag the query position and switch modes.

Trained next-token transformers do encode belief-state structure in their activations; Shai et al. (2024) found it with linear probes. What standard training lacks is a guarantee or a pressure that every position holds a compact, updatable summary, so on structured tasks the model can fit the data with shortcuts that read the history instead. NextLat asks whether that pressure can be added back while training stays parallel.

What a belief state is

The term comes from control and reinforcement learning, where an agent receives a stream of observations and never sees the true state of the world. A belief state is a summary of the observation history that is sufficient for prediction: once you hold it, the rest of the history adds nothing. The paper's Definition 3.1 states it for token sequences. Write X1:tX_{1:t} for the tokens so far and bt=g(X1:t)\mathbf{b}_t = g(X_{1:t}) for some function of them. Then bt\mathbf{b}_t is a belief state if, for every bounded measurable function ff of the future tokens,

E[f(Xt+1:T)∣bt]=E[f(Xt+1:T)∣X1:t]a.s.\mathbb{E}\big[f(X_{t+1:T}) \mid \mathbf{b}_t\big] = \mathbb{E}\big[f(X_{t+1:T}) \mid X_{1:t}\big] \quad \text{a.s.}

Choosing ff as the indicator of any particular future makes this say that the summary predicts every future event with the same probability the full history does. Equivalently, bt\mathbf{b}_t is a sufficient statistic of the history for the future, the term the paper takes from Striebel (1965).

In the taxi task, the history is the list of turns so far. To predict the rest of the ride you need the current intersection and the destination; the turns that led there add nothing once you know those two. The pair (current intersection, destination) is a belief state, and it is far smaller than a 50-turn history. Two rides that reach the same corner bound for the same place have the same belief state, which is why a model whose hidden state is a belief state scores well on sequence compression.

Definition 3.1 defines a sufficient statistic, not the smallest one: the raw history X1:tX_{1:t} satisfies the equation trivially. So being a belief state and being compact are separate properties, and the theorem below guarantees only the first. And it is the predictive form of the idea, a summary that reproduces the distribution of future tokens, not necessarily a probability distribution over hidden world states.

How NextLat works: predicting the next hidden state

The hidden state ht\mathbf{h}_t is the transformer's final-layer output at position tt, the vector the output head turns into next-token logits. The output head pθp_\theta and the transformer are trained with the usual cross-entropy:

Lnext-token(θ)=Et<T[−log⁡pθ(Xt+1∣ht)]\mathcal{L}_{\text{next-token}}(\theta) = \mathbb{E}_{t<T}\big[-\log p_\theta(X_{t+1}\mid \mathbf{h}_t)\big]

NextLat adds a latent dynamics model pψp_\psi, a separate network with its own parameters ψ\psi. It takes the current hidden state and the next token and predicts the next hidden state, the way a world model in reinforcement learning (as in World Models or MuZero) takes a latent state and an action and predicts the next latent state; here the next token plays the role of the action. In the paper it is a three-layer MLP with GELU activations, applied to the layer-normalized concatenation of ht\mathbf{h}_t and the next token's embedding, and it outputs a change added to the current state:

h^t+1=pψ(ht,Xt+1)=fψ(ht,Xt+1)+ht\hat{\mathbf{h}}_{t+1} = p_\psi(\mathbf{h}_t, X_{t+1}) = f_\psi(\mathbf{h}_t, X_{t+1}) + \mathbf{h}_t

The paper keeps pψp_\psi a simple MLP so that any gain can be attributed to the objective rather than to a specialized transition architecture, and lists a richer design as future work. The residual form makes the default prediction "the state does not change", so the MLP only has to learn the update. Applied to its own output, pψp_\psi is a recurrent cell: a state and a token in, a new state out.

For a deterministic transformer, the true next state ht+1\mathbf{h}_{t+1} is a fixed vector given the tokens, so learning pψp_\psi is regression. The paper uses a Smooth-L1 (Huber) loss, which per coordinate is squared error for gaps under 1 and absolute error beyond (PyTorch's default threshold of 1, which the code uses):

SmoothL1(a,b)=1D∑j=1Dℓ(aj−bj),ℓ(x)={12x2∣x∣<1∣x∣−12otherwise\mathrm{SmoothL1}(\mathbf{a},\mathbf{b}) = \tfrac{1}{D}\textstyle\sum_{j=1}^{D}\ell(a_j-b_j), \qquad \ell(x)=\begin{cases}\tfrac12 x^2 & |x|<1\\ |x|-\tfrac12 & \text{otherwise}\end{cases}SmoothL1(a,b)=1D∑j=1Dℓ(aj−bj),ℓ(x)={12x2∣x∣<1∣x∣−12otherwise\begin{gathered}\mathrm{SmoothL1}(\mathbf{a},\mathbf{b}) = \tfrac{1}{D}\textstyle\sum_{j=1}^{D}\ell(a_j-b_j), \\ \ell(x)=\begin{cases}\tfrac12 x^2 & |x|<1\\ |x|-\tfrac12 & \text{otherwise}\end{cases}\end{gathered}

Early in training, when predictions are far off, a coordinate with a gap of 5 contributes a gradient of 1 instead of 5, so a few large gaps cannot dominate the update. The latent loss averages it over a horizon of dd steps:

Lnext-h(θ,ψ;d)=Et[1d∑i=1dSmoothL1(sg[ht+i], h^t+i)]\mathcal{L}_{\text{next-h}}(\theta,\psi;d) = \mathbb{E}_t\Big[\tfrac{1}{d}\textstyle\sum_{i=1}^{d}\mathrm{SmoothL1}\big(\mathbf{sg}[\mathbf{h}_{t+i}],\ \hat{\mathbf{h}}_{t+i}\big)\Big]Lnext-h(θ,ψ;d)=Et[1d∑i=1dSmoothL1(sg[ht+i], h^t+i)]\begin{aligned}&\mathcal{L}_{\text{next-h}}(\theta,\psi;d) \\ &= \mathbb{E}_t\Big[\tfrac{1}{d}\textstyle\sum_{i=1}^{d}\mathrm{SmoothL1}\big(\mathbf{sg}[\mathbf{h}_{t+i}],\ \hat{\mathbf{h}}_{t+i}\big)\Big]\end{aligned}
(3)

sg[⋅]\mathbf{sg}[\cdot] is the stop-gradient operator: in the backward pass the target ht+i\mathbf{h}_{t+i} is treated as a constant. For d>1d>1, h^t+i\hat{\mathbf{h}}_{t+i} is a recursive rollout: pψp_\psi is applied to its own previous prediction with the true tokens Xt+1,…,Xt+iX_{t+1}, \dots, X_{t+i} fed in, so the transition rule has to stay accurate over several steps. The theorem below needs only d=1d=1; the paper uses larger dd as a richer training signal.

A second term checks the prediction in token space. Pass the true next state and the predicted next state through the output head, with the head's weights frozen, and require the two next-token distributions to match:

LKL(θ,ψ;d)=Et[1d∑i=1dDKL(pθsg(⋅∣sg[ht+i]) ∥ pθsg(⋅∣h^t+i))]\mathcal{L}_{\mathrm{KL}}(\theta,\psi;d) = \mathbb{E}_t\Big[\tfrac{1}{d}\textstyle\sum_{i=1}^{d} D_{\mathrm{KL}}\big(p_\theta^{\mathbf{sg}}(\cdot\mid \mathbf{sg}[\mathbf{h}_{t+i}])\ \big\|\ p_\theta^{\mathbf{sg}}(\cdot\mid \hat{\mathbf{h}}_{t+i})\big)\Big]LKL(θ,ψ;d)=Et[1d∑i=1dDKL(pθsg(⋅∣sg[ht+i]) ∥ pθsg(⋅∣h^t+i))]\begin{aligned}&\mathcal{L}_{\mathrm{KL}}(\theta,\psi;d) = \mathbb{E}_t\Big[\tfrac{1}{d}\textstyle\sum_{i=1}^{d} \\ &\quad D_{\mathrm{KL}}\big(p_\theta^{\mathbf{sg}}(\cdot\mid \mathbf{sg}[\mathbf{h}_{t+i}])\ \big\|\ p_\theta^{\mathbf{sg}}(\cdot\mid \hat{\mathbf{h}}_{t+i})\big)\Big]\end{aligned}
(4)

The first argument of the KL is the distribution from the true state, so the true state is the teacher and the prediction the student, as in knowledge distillation with one model playing both roles. The superscript sg\mathbf{sg} on pθp_\theta marks the frozen head. Where Eq. (3) asks whether h^\hat{\mathbf{h}} lands on the right vector, Eq. (4) asks whether it predicts the same next token, which weights errors by how much they change the model's output. The full objective is

LNextLat=Lnext-token+λnext-h Lnext-h+λKL LKL\mathcal{L}_{\text{NextLat}} = \mathcal{L}_{\text{next-token}} + \lambda_{\text{next-h}}\,\mathcal{L}_{\text{next-h}} + \lambda_{\mathrm{KL}}\,\mathcal{L}_{\mathrm{KL}}LNextLat=Lnext-token+λnext-h Lnext-h+λKL LKL\begin{aligned}\mathcal{L}_{\text{NextLat}} &= \mathcal{L}_{\text{next-token}} \\ &\quad + \lambda_{\text{next-h}}\,\mathcal{L}_{\text{next-h}} + \lambda_{\mathrm{KL}}\,\mathcal{L}_{\mathrm{KL}}\end{aligned}
(5)

with λnext-h,λKL>0\lambda_{\text{next-h}}, \lambda_{\mathrm{KL}} > 0. The code defaults are λnext-h=λKL=1\lambda_{\text{next-h}} = \lambda_{\mathrm{KL}} = 1 and d=1d = 1; the experiments tune them per task, as the table further down shows. Figure 2 shows Eq. (3) at work on a path of hidden states. Each teal dot is a true ht\mathbf{h}_t, each amber ring is the prediction pψp_\psi makes for the next state, and the dashed line is the error. Drag training forward and the rings move onto the dots.

Figure 2 · learning a consistent transition
0%
The transformer's hidden states ht\mathbf{h}_t trace a path through latent space. The dynamics model pψp_\psi predicts each next state from the current one and the next token; the dashed line is the Smooth-L1 error. Press Train or drag the slider. This is a schematic; the gradient also moves the teal dots, as Figure 3 shows.

Concretely, take the paper's largest model: 22 layers, 16 heads, width D=2048D = 2048, a GPT-2 vocabulary of 50,257 tokens and sequences of 1,024 tokens. One forward pass gives hidden states of shape (batch, 1024, 2048). At position 500, pψp_\psi reads h500\mathbf{h}_{500} and the embedding of token 501, a concatenated vector of 4,096 numbers, and passes it through layers of width 4096→6528→6528→20484096 \to 6528 \to 6528 \to 2048. That is about 82.7 million parameters, which is why the paper's Table 4 lists 1.40B training parameters for NextLat against 1.32B for GPT. The 2048-vector output is added to h500\mathbf{h}_{500} to give h^501\hat{\mathbf{h}}_{501}, compared coordinate by coordinate with the detached h501\mathbf{h}_{501} for Eq. (3), and both vectors go through the frozen head to give two distributions over 50,257 tokens for Eq. (4). The same happens at every position in parallel, since all the ht\mathbf{h}_t come from the one forward pass. After training pψp_\psi is dropped and the model serves 1.32B parameters. One step in PyTorch-style pseudocode:

# one NextLat training step, horizon d = 1 (Algorithm 1 of the paper)
h      = transformer(x)              # hidden states, [B, T, D], one parallel pass
logits = head(h)                     # [B, T, V]
loss_tok = cross_entropy(logits[:, :-1], x[:, 1:])     # ordinary next-token loss

# predict h_{t+1} from (h_t, x_{t+1}); h_t is NOT detached
h_hat  = p_psi(h[:, :-1], embed(x[:, 1:]))    # residual MLP, [B, T-1, D]
loss_h = smooth_l1(h_hat, h[:, 1:].detach())  # Eq. (3): the target is a constant

# Eq. (4): same next-token distribution from h_hat as from the true h_{t+1}
teacher = logits[:, 1:].detach()              # head applied to the true state
student = frozen_head(h_hat)                  # head weights get no gradient here
loss_kl = kl(teacher, student)

loss = loss_tok + lam_h * loss_h + lam_kl * loss_kl   # Eq. (5)
loss.backward()   # reaches p_psi, the head (via loss_tok), and the transformer

The settings vary by task (paper Table 5 and the experiment sections). pψp_\psi is always three layers; only its hidden width changes.

Taskmodel widthhorizon dλ next-hλ KLp_ψ width
Manhattan38481.00.11536
Countdown7681, 4, 82.01.0768
Path-Star384ℓ − 21.01.0384
TinyStories7681, 81.01.02048
A₅51211.00.01024
FineWeb-Edu 1.3B20481, 21.01.06528

Where each gradient goes

The stop-gradient in Eq. (3) applies to the target ht+1\mathbf{h}_{t+1} only. The input ht\mathbf{h}_t that pψp_\psi reads is not detached (in the code, line 303 of model_nextlat.py detaches h_t_next and nothing else), so the gradient of the latent loss flows through pψp_\psi into ht\mathbf{h}_t and from there into every transformer layer. The transformer is pushed to produce states from which one fixed rule can compute the next state, and pψp_\psi itself is discarded after training.

Every position plays both roles. h501\mathbf{h}_{501} is a constant target for the prediction made from h500\mathbf{h}_{500}, and a trainable input for the prediction of h502\mathbf{h}_{502}. In the KL term the head is frozen, so its gradient passes through the head's weights to h^\hat{\mathbf{h}} without changing them, and the head is trained only by the ordinary next-token loss. Pick a loss in Figure 3 to see its backward path.

Figure 3 · which parameters each loss trains
One training step as a graph. Grey arrows are the forward pass; the teal dashed path is the gradient of the selected loss flowing back toward the parameters. Red bars mark stop-gradients and dashed blue boxes the frozen head. The readout lists which parameter groups the loss updates.

The frozen head also saves compute. A backward pass through a 2048 × 50,257 output layer is expensive, and the paper's ablation (Appendix D) found that stopping gradients on both the Smooth-L1 target and the KL head gave the best probe accuracy on TinyStories while removing that extra backward pass.

Why the states do not collapse

A model rewarded for predicting its own future states has a trivial way to score perfectly: make every hidden state the same vector. Then pψp_\psi only has to output that vector, the latent loss is zero, and the states carry no information. This failure, representational collapse, is the standard risk of self-predictive learning, the family of methods (common in reinforcement learning) that learn representations by predicting their own future latents.

The stop-gradient blocks the main path to collapse. Without it, the gradient of the error between the prediction pψ(ht)p_\psi(\mathbf{h}_t) and the target ht+1\mathbf{h}_{t+1} moves both ends of every pair toward each other, and shrinking the whole cloud to one point lowers every error at once. With the target held constant, only the input side moves. Tang et al. (2023) proved what that buys in a linear setting: if the predictor is fit faster than the representation (a small MLP next to a large transformer approximates this), the semi-gradient update keeps Φ⊤Φ\Phi^\top\Phi constant, where Φ\Phi is the matrix whose rows are the states, so Φ⊤Φ\Phi^\top\Phi holds their second moments. The states can rotate but cannot shrink or merge.

Figure 4 runs that setting. Twelve 2-D states each have a fixed successor, forming three loops of four. Every step, the linear predictor is refit exactly by least squares, then the states take one gradient step on the squared prediction error. Press Play with the stop-gradient on: the loss falls to zero and the spread stays near its starting value instead of shrinking (0.76 at step 0, 0.86 at step 300; in continuous time the second moments would be exactly constant). The states settle into three four-cornered loops, and a single linear map carries each corner to the next one around its loop. Switch the stop-gradient off and replay: the loss also reaches zero, but the spread falls toward zero as all twelve states slide to one point.

Figure 4 · stop-gradient on vs. off, simulated
step 0
Twelve states (dots, colored by loop), each predicted successor (ring), and the error to the true successor (dashed). Toggle the stop-gradient, then press Play or drag the step slider. This toy has no next-token loss, which is the second guard in the real method.

NextLat has a second guard the toy leaves out. It is still training with next-token cross-entropy, and a constant hidden state cannot produce different next-token distributions in different contexts, so collapse would cost cross-entropy. The paper's footnote 4 makes the same point: the next-token objective already grounds against collapse, and the stop-gradient is kept because it performs better. In the ablation, removing the stop-gradient on the Smooth-L1 term slightly lowered the validation losses (by about 0.02) but gave hidden states that linear probes read the future from less well, and on Countdown and Path-Star the stop-gradient was needed for high accuracy. Other self-predictive methods use the same asymmetry in other forms: SimSiam, like NextLat, puts a hard stop-gradient on targets from the same network, while I-JEPA computes its targets with a slowly updated (moving-average) copy of the encoder.

What Theorem 3.2 proves

Theorem 3.2 says that if training reaches its ideal, the hidden states are belief states. Suppose two conditions hold exactly at every position. The output head is a perfect next-token predictor,

pθ(Xt+1∣ht)=P(Xt+1∣X1:t),p_\theta(X_{t+1}\mid \mathbf{h}_t) = \mathbb{P}(X_{t+1}\mid X_{1:t}),
(1)

and the dynamics model is a perfect transition predictor,

pψ(ht+1∣ht,Xt+1)=P(ht+1∣X1:t+1).p_\psi(\mathbf{h}_{t+1}\mid \mathbf{h}_t, X_{t+1}) = \mathbb{P}(\mathbf{h}_{t+1}\mid X_{1:t+1}).
(2)

Then each ht\mathbf{h}_t is a belief state for X1:tX_{1:t}. (The right side of (2) is the transition the transformer's weights induce; the probabilistic notation covers stochastic transformers, and for the deterministic ones used in practice it is a point mass.) The proof is a backward induction. Split the future distribution into its first token and the rest:

P(Xt+1:T∣X1:t)=P(Xt+1∣X1:t)  P(Xt+2:T∣X1:t+1)\mathbb{P}(X_{t+1:T}\mid X_{1:t}) = \mathbb{P}(X_{t+1}\mid X_{1:t})\;\mathbb{P}(X_{t+2:T}\mid X_{1:t+1})P(Xt+1:T∣X1:t)=P(Xt+1∣X1:t)  P(Xt+2:T∣X1:t+1)\begin{aligned}&\mathbb{P}(X_{t+1:T}\mid X_{1:t}) \\ &= \mathbb{P}(X_{t+1}\mid X_{1:t})\;\mathbb{P}(X_{t+2:T}\mid X_{1:t+1})\end{aligned}

By (1), the first factor equals pθ(Xt+1∣ht)p_\theta(X_{t+1}\mid\mathbf{h}_t), a function of ht\mathbf{h}_t. By the induction hypothesis, the second factor depends on the history only through ht+1\mathbf{h}_{t+1}, and by (2), ht+1\mathbf{h}_{t+1} is determined by ht\mathbf{h}_t and Xt+1X_{t+1} through pψp_\psi. So the whole future distribution is a function of ht\mathbf{h}_t. Read as a procedure, the two maps let you generate the future from ht\mathbf{h}_t alone, without the history:

ht→ pθ Xt+1→ pψ ht+1→ pθ Xt+2→ pψ ⋯→ pθ XT\mathbf{h}_t \xrightarrow{\ p_\theta\ } X_{t+1} \xrightarrow{\ p_\psi\ } \mathbf{h}_{t+1} \xrightarrow{\ p_\theta\ } X_{t+2} \xrightarrow{\ p_\psi\ } \cdots \xrightarrow{\ p_\theta\ } X_Tht→ pθ Xt+1→ pψ ht+1→ pθ Xt+2→ pψ ⋯→ pθ XT\begin{aligned}&\mathbf{h}_t \xrightarrow{\ p_\theta\ } X_{t+1} \xrightarrow{\ p_\psi\ } \mathbf{h}_{t+1} \\ &\xrightarrow{\ p_\theta\ } X_{t+2} \xrightarrow{\ p_\psi\ } \cdots \xrightarrow{\ p_\theta\ } X_T\end{aligned}

In condition (2) the next state must be computable from the current state and the next token, with no access to the earlier tokens, so anything the future needs has to be in the current state already. The argument uses one-step transitions only, so it holds at d=1d=1.

Next-token consistency alone is not enough. The Belief State Transformer paper (Hu et al., 2025, Theorem 3) constructs a distribution and a perfect next-token predictor whose head input is not a belief state. That is an existence result: next-token training does not guarantee a belief state, which is different from saying transformers cannot form one. Among the paper's baselines, GPT and multi-token prediction (MTP, extra heads predicting the next dd tokens) have no such guarantee. Joint-token prediction (JTP, Ahn et al., 2025) predicts each of the next dd tokens from the hidden state plus the true tokens before it, passed through a small attention bottleneck, so the hidden state has to carry the joint distribution of those tokens rather than each one's marginal. It has a guarantee only when dd is at least the observability horizon kk of the data-generating process: the number of future tokens whose distribution, once two histories agree on it, fixes the whole future (Definition A.1). In long text kk can be very large.

The theorem describes the ideal fixed point. It does not show that gradient training reaches it, and it does not say the belief state is small, since the raw history qualifies too. The abstract's phrase "provably converge towards belief states" reads stronger than this; the Provenance panel below has the details. That the learned states are compact is an experimental result, measured next.

The paper also argues that the latent target is a richer training signal than a token. A one-hot next token says which token came; ht+1\mathbf{h}_{t+1} parameterizes the whole distribution over Xt+2X_{t+2}, and because each state is trained to predict the next, it also carries information about later states. The paper links this to NextLat's results in the low-data Path-Star setting.

Manhattan: a more compact world model

In Figure 5, two routes arrive at the same intersection bound for the same destination. Toggle between the models. A model that kept the two histories apart can give them different next moves, one of them off the map; a model whose state is the belief state gives both the same move, which is what the sequence-compression metric counts (0.65 for GPT, 0.71 for NextLat).

Figure 5 · two histories, one belief state
pair 1/3
Two routes reach the same intersection, both bound for the same destination. Toggle GPT and NextLat and step through the route pairs. The illustrated moves are schematic; the readout carries the paper's Table 1 numbers for each model.

The second compactness number describes the hidden states directly. Stack the final-layer states for a batch of 256 sequences of 256 tokens into a matrix with 65,536 rows and 384 columns (the model width). Its singular values σ1≥⋯≥σ384\sigma_1 \ge \dots \ge \sigma_{384} say how much the states spread along each direction. Normalize them to sum to one and exponentiate their Shannon entropy (natural log, after Roy and Vetterli, 2007):

erank=exp⁡ ⁣(−∑kpkln⁡pk),pk=σk/∑iσi\mathrm{erank} = \exp\!\Big(-\textstyle\sum_k p_k \ln p_k\Big), \qquad p_k = \sigma_k \big/ \textstyle\sum_i \sigma_ierank=exp⁡ ⁣(−∑kpkln⁡pk),pk=σk/∑iσi\begin{gathered}\mathrm{erank} = \exp\!\Big(-\textstyle\sum_k p_k \ln p_k\Big), \\ p_k = \sigma_k \big/ \textstyle\sum_i \sigma_i\end{gathered}

If the states spread equally over kk directions and not at all over the rest, the entropy is ln⁡k\ln k and the effective rank is exactly kk. A spectrum that decays smoothly gets a value between 1 and 384 even though every singular value is positive, so the ordinary matrix rank stays 384. In Figure 6, switch to "k equal directions" to check the first case, then use the power-law shape and the match buttons to see how concentrated a spectrum has to be to give NextLat's 52.7 or GPT's 160.1.

Figure 6 · effective rank of a 384-wide hidden state
α = 0.84
The normalized singular-value spectrum (one bar per direction, the first erank bars bright) and the resulting effective rank, against the paper's Table 1 values. Drag the exponent or the number of equal directions; the matrix rank readout stays 384 for every power law.

The true Manhattan graph has 4,580 intersections and 9,846 edges, a small state space, so a faithful state should need only a modest number of directions. NextLat's states have an effective rank of 52.7 against GPT's 160.1, a ratio of 3.04: NextLat uses about a third as many effective directions while scoring higher on every other metric. The paper's appendix notes both values are far below the width of 384, and that a wider model did not help on this task while a deeper one did.

Planning and reasoning tasks

Path-Star. A Path-Star graph Ga,ℓG_{a,\ell} (the paper writes Gd,ℓG_{d,\ell}, reusing the letter dd) has a center node and aa disjoint arms of ℓ−1\ell-1 nodes each. A training example lists the edges, names a start (the center) and a goal (the tip of one arm), and gives the path. The paper follows the original setup of Bachmann and Nagarajan (2024): 200,000 fixed training graphs with node labels drawn from 1 to 100, evaluated on 20,000 held-out graphs.

Next-token training fails here because of teacher forcing, the standard practice of feeding the true path so far as the prefix during training. Once the prefix contains a node on the correct arm, the next node is the only neighbor not yet visited, which a model can copy from the edge list without knowing where the goal is. Every hop after the first is learnable this way. The first hop, choosing which arm to enter, needs the model to trace back from the goal, and a model that has learned the copy rule gets little gradient signal for it. Bachmann and Nagarajan call the shortcut the Clever Hans cheat, after the horse that answered arithmetic questions by reading its trainer's posture. The failure arises during training, when the copy rule absorbs the gradient; errors compounding at generation time play no part.

Figure 7 · the only hard step is the first
goal arm 2
A Path-Star graph with five arms and a goal at one tip. Every hop after the first copies the only unvisited neighbor; the first hop picks the arm and needs lookahead. Toggle the model and move the goal arm.

The paper tests G2,10G_{2,10}, G5,5G_{5,5} and G7,7G_{7,7} with five seeds each, and sets the NextLat horizon to ℓ−2\ell-2 so the goal lies inside the prediction horizon from the center. NextLat solves all three at close to 100%. The Belief State Transformer solves G2,10G_{2,10} and G5,5G_{5,5} and starts failing at G7,7G_{7,7}, and GPT fails throughout. The paper notes that its BST and JTP numbers are lower than the original BST and JTP papers report, because the NextLat authors used a smaller, freshly sampled setup.

Countdown. Given four numbers and a target, write three equations that combine them into the target using +, −, × and ÷. It is a generalized Game of 24, which GPT-4 solved 4% of the time with default prompting. A training example from the paper, with inputs 14, 83, 88, 91 and target 23, reads:

14,83,88,91,23 | 83-14=69, 91-88=3, 69/3=23

The setup has 500,000 training problems with targets from 10 to 100, 10% of targets held out, eight pause tokens before the answer, and 10,000 test problems, averaged over three seeds:

Countdown accuracy (%)d = 1d = 4d = 8
GPT (next-token)33.1
Belief State Transformer42.3
MTP39.249.757.3
JTP39.049.455.0
NextLat54.857.658.7

The gap is largest at d=1d=1, where NextLat's 54.8% compares with 39.2% and 39.0% for the two multi-token methods. At d=8d=8 MTP reaches 57.3%, 1.4 points behind. When the paper checks each generated equation, most errors are in the third and last one: a model that did not plan discovers at the end that its numbers cannot reach the target and writes an invalid equation that does, a behavior Ye et al. (2025) named the regretful compromise.

TinyStories. On short synthetic stories the paper freezes each trained model and fits linear probes that predict the token 1 to 20 positions ahead from a single hidden state. The extra token-level objectives of BST, MTP and JTP lower next-token probe accuracy, and MTP and JTP probes degrade quickly with distance. NextLat matches GPT one token ahead and has the most accurate probes at long range, up to 20 tokens, at both d=1d=1 and d=8d=8.

A₅: training a recurrent network in parallel

A5A_5 is the group of the 60 even permutations of five objects. In its word problem, each token is one such permutation, and after every token the model must output the arrangement produced by applying all the tokens so far. The task is pure state tracking: a solver that keeps the current arrangement and updates it per token handles any length, as Figure 8 shows with five lettered balls.

Transformers have trouble with it for a structural reason. The A5A_5 word problem is complete for the circuit class NC1\mathsf{NC}^1 (Barrington, 1989), and constant-depth transformers with fixed-precision arithmetic can be simulated by circuits in the smaller class TC0\mathsf{TC}^0 (Merrill and Sabharwal, 2023). If, as is widely conjectured but unproven, TC0≠NC1\mathsf{TC}^0 \ne \mathsf{NC}^1, no constant-depth transformer solves it at all lengths; a transformer needs depth growing like log⁡T\log T in the sequence length.

The paper trains 2-layer transformers of width 512 on one million distinct 12-token sequences, with plain next-token prediction (GPT) and with NextLat at d=1d=1 using only the latent loss (λKL=0\lambda_{\mathrm{KL}} = 0, so nothing but transition prediction shapes pψp_\psi). It tests on about 100,000 sequences of 36 tokens. For the recurrent test, the transformer only produces the first hidden state; after that pψp_\psi steps the state forward token by token and the head reads each answer off it. That network has 2.62M parameters, against 6.43M for the transformer.

Figure 8 · state tracking on A₅, and who generalizes
n = 0
Top: a random sequence of even permutations (cycle notation on the five slots) and the arrangement after nn tokens. Bottom: accuracy against sequence length, traced from the paper's Figure 10 (approximate); the shaded band is the 12-token training length. Press Play or drag nn to move the cursor.

Within the 12-token training length the NextLat transformer stays near 98% (GPT slips to about 84% at length 12). Past it, both transformers drop to about 0%, as the depth bound predicts, and a GPT trained directly on 36-token sequences falls apart between lengths 10 and 13. The co-trained pψp_\psi, run as a recurrent network, stays above 95% out to length 36, with only one-step supervision and no backpropagation through time.

No complexity bound is broken. A recurrent network that updates one state per token is outside TC0\mathsf{TC}^0 and can express A5A_5 tracking at any length; the open question was whether one could be learned without sequential training. Here a transformer limited to 12 steps supplied per-step targets, and a recurrent rule fit to those targets extrapolated three times further. The trained transformer itself is no more capable than before. The paper also notes that the hidden states include rotary position information (RoPE), and the transition rule generalized anyway.

Speculative decoding past the training horizon

Speculative decoding (Leviathan et al., 2022) speeds up generation with a cheap drafter. The drafter proposes several tokens, the full model scores all of them in one parallel pass, and an accept-or-resample rule keeps a prefix. The rule is built so the emitted tokens have exactly the distribution the full model's own sampling would give; only the number of full-model passes changes.

A model that can predict its own next hidden state can draft without running the transformer: decode a token from the current state with the head, step the state with pψp_\psi, decode the next token, and repeat. This is the decoding chain from the theorem, run as a loop:

# drafting with p_psi: no transformer calls inside the loop
h = last_hidden_state            # from one real transformer pass
draft = []
for _ in range(gamma):           # gamma can exceed the training horizon d
    x = sample(head(h))          # decode a token from the current latent
    draft.append(x)
    h = p_psi(h, embed(x))       # step the latent with the MLP
# then score the whole draft with ONE parallel transformer pass and keep
# the accepted prefix (Leviathan et al. 2022 accept/resample rule)

Multi-token prediction methods draft with their extra heads, one per future position, so a model trained with horizon dd drafts at most dd tokens per cycle. pψp_\psi is one rule applied repeatedly, so the draft can run past dd. The paper pretrains 1.3B models on 100 billion FineWeb-Edu tokens, then samples 1,024 prompts of 512 tokens per domain and generates 512-token continuations on 8 B200 GPUs, trying fixed NextLat draft lengths from 2 to 10 and reporting the fastest. At d=2d=2 on Books, NextLat averages 4.86 accepted tokens per drafting step and a 3.32× speedup; MTP and JTP accept 1.83 and 1.89 tokens, for 1.72× and 1.90×. Switch the domain and the horizon in Figure 9.

Figure 9 · drafting past the trained horizon
3.32×
Accepted tokens per drafting step and speedup over ordinary sampling, from the paper's Table 3. MTP and JTP stay at or under the dashed horizon line; NextLat goes past it. Toggle the domain and the training horizon dd.

At d=1d=1 the multi-token methods accept under one token per step (0.91 to 0.98) for 1.38× to 1.47×, while NextLat accepts 2.66 to 3.64 for 2.29× to 2.72×. Code is the hardest domain for NextLat (2.38× at d=2d=2) and Books the easiest. The 3.3× headline is NextLat's best configuration on one domain, and every emitted token is still distributed as the base model's.

Costs, scale and limits

Training cost depends on the horizon. On the 1.3B model (paper Table 4) GPT trains at 3.09 steps per second, NextLat at 3.09 for d=1d=1, 2.79 for d=2d=2 and 1.73 for d=8d=8, because pψp_\psi is unrolled sequentially over the horizon. The Belief State Transformer trains a second, backward transformer and accumulates gradients over all O(T2)O(T^2) prefix-suffix pairs; even subsampling 10% of the pairs it runs at 0.89 steps per second, over 3× slower than NextLat. NextLat's gradient terms grow as O(Td)O(Td).

At 1.3B parameters the language-modeling gains are small. Zero-shot accuracy averaged over eight benchmarks is 59.21 for NextLat at d=2d=2 against 58.82 for GPT, 58.69 for MTP and 58.63 for JTP, and the paper says the gains are not consistent across tasks. FineWeb-Edu perplexity is 10.52 for GPT, 10.88 for NextLat, 11.00 for MTP and 11.18 for JTP: NextLat costs less next-token quality than the multi-token methods but still some. The clear wins are on the structured tasks above. The paper does not test frontier scale.

The paper lists its own open questions. pψp_\psi was only ever an MLP, and its hidden width, which acts as a bottleneck on how much the belief state can hold, was not studied (smaller widths helped on Path-Star and Countdown). The loss design comes from small ablations, and it is unclear whether d>1d>1 or the KL term matter at larger scale. The speculative decoder used a fixed draft length per run, not an adaptive one.

NextLat changes the representations, not the computational class. A fixed-depth transformer trained with NextLat is still a fixed-depth transformer, bounded by TC0\mathsf{TC}^0; the extra capability in the A5A_5 experiment belongs to pψp_\psi, a recurrent network the training produced on the side. The method differs from hybrid transformer and state-space architectures (such as Mamba layers mixed with attention): it adds no layers and works as a training loss on an unmodified transformer.

Provenance Verified against primary literatureHow we verify
Teoh et al. (2025), Sec. 3Definition 3.1, Theorem 3.2 and Eqs. (1)-(5) as printed; this page uses the same equation numbers. The proof is in Appendix B.
Official code, github.com/JaydenTeoh/NextLat (commit 3770be6)models/model_nextlat.py:47-92: p_psi is LayerNorm on concat(h_t, next-token embedding), Linear-GELU-Linear-GELU-Linear, plus h_t. Line 303: Smooth-L1 against h_t_next.detach(), the only detach on that term. Line 316: lm_head weight detached inside the KL. Defaults lambda_kl = lambda_mse = 1, lambda_ce = 0, horizon 1.
Teoh et al. (2025), Tables 4 and 5The 1.3B model trains 1.40B parameters and serves 1.32B; its p_psi hidden width is 6528 (4096 -> 6528 -> 6528 -> 2048, about 82.7M parameters, roughly 6%). The code default proj_factor = 1 would give about 42M; the released 1.3B configs use 1.6.
Vafa et al. (2024)Manhattan taxi benchmark and the finding that next-token success can coexist with an incoherent reconstructed map. Metrics reused in Table 1.
Hu et al. (2025), Belief State Transformer, Theorem 3An existence result: some distribution and some perfect next-token predictor whose head input is not a belief state. Next-token training gives no guarantee; it does not show transformers cannot form belief states.
Tang et al. (2023), Theorem 1With a semi-gradient (stop-gradient) update and a predictor optimized faster than the representation, Phi^T Phi stays constant, so the representation cannot collapse. Basis of the Figure 4 simulation.
Bachmann & Nagarajan (2024)Path-Star task and the Clever Hans cheat of teacher-forced training: later hops are copies, only the first hop needs lookahead.
Merrill & Sabharwal (2023); Barrington (1989)Constant-depth, fixed-precision transformers lie in TC0; the A5 word problem is NC1-complete. Inexpressibility holds only under the unproven conjecture TC0 != NC1.
Leviathan et al. (2022)Speculative sampling leaves the output distribution identical to the base model. The NextLat paper uses the algorithm but does not restate the guarantee.
correctionThe abstract says NextLat latents "provably converge towards belief states." Theorem 3.2 is a statement about an idealized optimum: if next-token consistency (1) and transition consistency (2) both hold exactly, then each h_t is a belief state. It does not prove that gradient training reaches that optimum, and it does not say the belief state is minimal: the raw history is also a sufficient statistic. The compactness in the title is an empirical finding (effective latent rank 52.7 against 160.1 on Manhattan), not a consequence of the theorem. Separately, the code calls the weight on the Smooth-L1 term lambda_mse, but the loss is Smooth-L1, not mean squared error.

Questions you might still have

?

Does NextLat change how the model runs at inference?
For ordinary decoding, no. p_psi is a training-time auxiliary and the transformer decodes token by token as before; the 1.3B model serves 1.32B parameters, the same as the GPT baseline. You keep p_psi only if you want it as a speculative-decoding drafter, and then the output distribution is still the base model's.

?

Why does predicting your own hidden state not collapse to a constant?
Two separate guards. The stop-gradient makes the target a constant, so only the input side moves, and with a predictor that keeps up, that update can rotate the states but not shrink them (Tang et al. 2023, Theorem 1). Independently, the next-token cross-entropy needs different states to produce different next-token distributions. The paper's footnote 4 says the cross-entropy alone already grounds against collapse; its ablation found the stop-gradient still gives better representations.

?

Does Theorem 3.2 prove the states become compact?
No. At the idealized optimum each hidden state is a sufficient statistic of the past for the future. The raw history is one too, so sufficiency says nothing about size. Compactness is measured: effective latent rank 52.7 for NextLat against 160.1 for GPT on Manhattan.

?

Is NextLat a recurrent network in disguise?
At horizon d = 1 it trains a transformer and a small recurrent transition network together, fully in parallel. The transformer's own forward pass stays non-recurrent and keeps its circuit-complexity limits; the recurrent piece is p_psi, which the A5 experiment uses on its own.

?

How is this different from multi-token prediction or the Belief State Transformer?
MTP adds heads that predict the next d tokens and has no belief-state guarantee. JTP has one only when d is at least the observability horizon k of the data. The Belief State Transformer reaches belief states by training a second, backward transformer over all prefix-suffix pairs, O(T^2) gradient terms and over 3 times slower in training. NextLat supervises in latent space with one MLP, its guarantee holds at d = 1, and it drafts past its training horizon.

?

Why Smooth-L1 for the latent loss and not mean squared error?
Smooth-L1 is squared error for coordinate gaps under 1 and absolute error beyond, so early in training, when the predictions are far off, large gaps contribute a bounded gradient instead of one that grows with the gap. The paper lists the Smooth-L1 choice, with the stop-gradients and the KL term, among the design decisions guided by small-scale ablations rather than systematic study.

?

How expensive is it to add?
At d = 1 the 1.3B model trains at 3.09 steps per second, the same as GPT; at d = 2 it is 2.79 and at d = 8 1.73, because p_psi is unrolled sequentially over the horizon. The MLP adds about 82.7M parameters at training time and none at inference.

Footnotes & further reading

  1. The paper: Teoh, Tomar, Ahn, Hu, Pearce, Sharma, Krishnamurthy, Islam, Lamb, Langford, Next-Latent Prediction Transformers Learn Compact World Models (Microsoft Research, 2025). Code. The default coefficients (λnext-h=λKL=1\lambda_{\text{next-h}}=\lambda_{\mathrm{KL}}=1, horizon d=1d=1), the three-layer residual MLP for pψp_\psi and the placement of the stop-gradients are read from that repository.
  2. The Manhattan taxi world-model probe, and the finding that near-perfect next-token accuracy can coexist with an incoherent internal map: Vafa et al., Evaluating the World Model Implicit in a Generative Model (2024).
  3. Next-token optimality does not guarantee a belief state (Theorem 3): Hu et al., The Belief State Transformer (2025). NextLat compares directly against it and the joint-token-prediction method of Ahn et al., Efficient Joint Prediction of Multiple Future Tokens (2025).
  4. Stop-gradients against collapse in self-predictive learning: Tang et al., Understanding Self-Predictive Learning for Reinforcement Learning (2023), whose Theorem 1 is the invariant simulated in Figure 4; Ni et al., Bridging State and History Representations (2024), which the NextLat paper cites for the stop-gradient; and SimSiam (Chen & He, 2021). The paper's own footnote 4 observes that next-token cross-entropy already grounds against collapse and that the stop-gradient still helps empirically.
  5. The Path-Star task and the Clever Hans cheat of teacher-forced next-token training: Bachmann & Nagarajan, The Pitfalls of Next-Token Prediction (2024).
  6. Speculative decoding and its exactness: Leviathan et al., Fast Inference from Transformers via Speculative Decoding (2022). The TC0\mathsf{TC}^0 bound for fixed-depth, fixed-precision transformers is from Merrill & Sabharwal, The Parallelism Tradeoff: Limitations of Log-Precision Transformers (2023); the A5A_5 word problem is NC1\mathsf{NC}^1-complete by Barrington (1989).
  7. The KL self-distillation term echoes soft-target distillation: Hinton et al., Distilling the Knowledge in a Neural Network (2015). Latent dynamics models over a state and an action are the core of Ha & Schmidhuber's World Models (2018), MuZero and DreamerV3, and predicting in representation space with an asymmetric target is the idea behind I-JEPA and V-JEPA. The paper calls its plain next-token baseline GPT after models like GPT-3.