English

Do language models plan ahead for future tokens?

Machine Learning 2024-08-05 v2 Computation and Language

Abstract

Do transformers "think ahead" during inference at a given position? It is known transformers prepare information in the hidden states of the forward pass at time step tt that is then used in future forward passes t+τt+\tau. We posit two explanations for this phenomenon: pre-caching, in which off-diagonal gradient terms present during training result in the model computing features at tt irrelevant to the present inference task but useful for the future, and breadcrumbs, in which features most relevant to time step tt are already the same as those that would most benefit inference at time t+τt+\tau. We test these hypotheses by training language models without propagating gradients to past timesteps, a scheme we formalize as myopic training. In a constructed synthetic data setting, we find clear evidence for pre-caching. In the autoregressive language modeling setting, our experiments are more suggestive of the breadcrumbs hypothesis, though pre-caching increases with model scale.

Keywords

Cite

@article{arxiv.2404.00859,
  title  = {Do language models plan ahead for future tokens?},
  author = {Wilson Wu and John X. Morris and Lionel Levine},
  journal= {arXiv preprint arXiv:2404.00859},
  year   = {2024}
}

Comments

24 pages, 11 figures. Camera-ready for COLM 2024

R2 v1 2026-06-28T15:39:51.564Z