Next-Token Prediction Should be Ambiguity-Sensitive: A Meta-Learning Perspective

Leo Gagnon, Eric Elmoznino, Sarthak Mittal, Tom Marty, Tejas Kasetty, Dhanya Sridhar, Guillaume Lajoie · 2025

Read Next-Token Prediction Should be Ambiguity-Sensitive: A Meta-Learning Perspective by Leo Gagnon, Eric Elmoznino, Sarthak Mittal, Tom Marty, Tejas Kasetty, Dhanya Sridhar, Guillaume Lajoie (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2506-16288.txt.

Introduction

Leo Gagnon and co-authors argue that word prediction should sense how unsure the context is, in work from 2025. Fast adaptation in large models is often credited to varied training data. In theory, the model weighs all stories that fit the text so far. When many stories fit, that weighing grows too costly to run in full.

The team built a test bed with a known ideal predictor to check this claim. Standard models did struggle most where the context stayed vague, at all sizes tried. Their fix turns a trained model into a sampling predictor that splits task guessing from word choice. Early tests showed strong gains in vague spots.

Catalog record

CREATORLeo Gagnon, Eric Elmoznino, Sarthak Mittal, Tom Marty, Tejas Kasetty, Dhanya Sridhar, Guillaume Lajoie
YEAR2025
COLLECTIONPAPERS
FORMATTXT
FILE SIZE29 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2506-16288

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

Next-Token Prediction Should be Ambiguity-Sensitive: A Meta-Learning Perspective Leo Gagnon, Eric Elmoznino, Sarthak Mittal, Tom Marty, Tejas Kasetty, Dhanya Sridhar, Guillaume Lajoie Abstract The rapid adaptation ability of auto-regressive foundation models is often attributed to the diversity of their pre-training data. This is because, from a Bayesian standpoint, minimizing prediction error in such settings requires integrating over all plausible latent hypotheses consistent with observations. While this behavior is desirable in principle, it often proves too ambitious in practice: under high ambiguity, the number of plausible latent alternatives makes Bayes-optimal prediction computationally intractable. Cognitive science has long recognized this limitation, suggesting that under such conditions, heuristics or information-seeking strategies are preferable to exhaustive inference. Translating this insight to next-token prediction, we hypothesize that low- and high-ambiguity predictions pose different computational demands, making ambiguity-agnostic next-token prediction a detrimental inductive bias. To test this, we introduce MetaHMM, a synthetic sequence meta-learning benchmark with rich compositional structure and a tractable Bayesian oracle. We show that Transformers indeed struggle with high-ambiguity predictions across model sizes. Motivated by cognitive theories, we propose a method to convert pre-trained models into Monte Carlo predictors that decouple task inference from token prediction. Preliminary results show substantial gains in ambiguous contexts through improved capacity allocation and test-time scalable inference—though challenges remain. Code is available here . Introduction A leading explanation for the surprising generalization capabilities of transformer-based ( Vaswani et al. 2017 ) foundation models ( Bommasani et al. 2021 ) is that their pretraining distribution resembles a sequence meta-learning problem ( Brown et al. 2020 ; Xie et al. 2021 ; Chan et al. 2022 ; Wang et al. 2023 ; Hahn & Goyal 2023 ) . In this view, each document in the corpus is governed by latent factors (e.g., topic, world state), and models learn to perform implicit Bayesian inference over these factors to predict tokens effectively across domains. In the idealized setting ( Ortega et al. 2019 ) , each sequence is generated by sampling a task \theta\sim p^{*}(\theta) and then drawing observations from p^{*}(x_{1:T}\mid\theta) . The next-token predictor that minimizes prediction error in that setting is called the Bayes-optimal posterior predictive : \displaystyle p^{*}(x_{t}\mid x_{<t})=\int_{\theta}\underbrace{p^{*}(x_{t}\mid x_{<t},\theta)}_{\text{Prediction}}\underbrace{p^{*}(\theta\mid x_{<t})}_{\text{Inference}} (1) Thus, training a model to minimize next-token prediction loss (LHS) is encouraged to implicitly perform task inference (RHS)—notably explaining how foundation models can adapt to new tasks at inference time purely by conditioning on a few input examples ( Brown et al. 2020 ; Panwar et al. 2024 , In-Context Learning, ICL;) . Figure 1: The MetaHMM benchmark. a) Latent structure of a MetaHMM environment. White rectangles contain mutually exclusive discrete choices \theta_{i} which together define an HMM \bm{\theta} . Yellow circles represent hidden states and blue rectangles represent observable symbols. b) Example of an HMM sampled from the given building blocks. c) \text{Div}_{x}(t) for different model sizes. This meta-learning view, however, exposes a fundamental challenge: in high-ambiguity contexts, where the posterior over tasks p^{*}(\theta\mid x_{<t}) has high entropy, prediction becomes inherently harder due to the need to consider many plausible hypotheses \theta . In fact, cognitive science has long recognized that Bayes-optimal prediction becomes intractable under resource constraints ( Lieder & Griffiths 2020 ) . Humans respond with ambiguity-aware strategies such as heuristics ( Binz et al. 2022 ) , approximate inference ( Sanborn et al. 2010 ) , or information-seeking ( Friston et al. 2017 ) . Following from this, we hypothesize that sequence models which allocate fixed computation per token suffer from poor capacity allocation : the more difficult high-ambiguity predictions receive too little while low-ambiguity ones receive too much. From a statistical learning angle, we suggest that ambiguity-sensitivity may serve as an effective inductive bias for general next-token prediction. While it is well understood that prediction under ambiguity causes issues at inference in foundation models ( Liu et al. 2023 ; Keluskar et al. 2024 ) , we are the first to ground this problem in meta-learning theory, make links to resource-rational analysis ( Lieder & Griffiths 2020 ) and make the case for poor resource allocation at training . To test this hypothesis, we introduce MetaHMM, the first synthetic benchmark for sequence meta-learning with rich compositional latent structure and an exactly computable Bayesian oracle. By evaluating learned next-token predictors against the Bayes-optimal model in Equation 1 , we show that Transformers consistently underperform in high-ambiguity settings. Importantly, this gap persists across model sizes, suggesting that scale alone does not resolve ambiguity-related failures. We release our codebase for procedural and scalable MetaHMM generation. To mitigate this issue, we propose a modular predictor that approximates Equation 1 using a Monte Carlo (MC) estimator, bootstrapped from a classical autoregressive model. Inspired by human approximate inference ( Sanborn et al. 2010 ) , our method separates task inference from token prediction, introducing useful inductive biases and allowing test-time scaling ( Snell et al. 2024 ) by increasing the number of MC samples. In doing so, we describe a principled type of test-time scaling as adaptation to posterior entropy—grounded in both Bayesian theory and resource-rational cognition. On MetaHMM, our method consistently outperforms the underlying sequence model in high-ambiguity settings, with gains increasing as more samples are drawn. However, performance gains diminish with larger models, suggesting this approach is especially useful when base models underfit. Adapting our method to naturalistic settings is an important direction for future work. More broadly, exploring additional types ambiguity-aware strategies may be essential for improving robustness and efficiency of foundation models. This work takes a first step in that direction. 1 The MetaHMM environment We choose a synthetic environment to isolate and analyze the ambiguity problem without the confounding complexity of natural language. While language corpora resemble a meta-learning distribution, they go far beyond that formalism in ways that would obscure the underlying mechanisms we aim to study. Moreover, no existing sequence meta-learning benchmark possesses the following two properties (a) a non-trivial, structured space of generators that supports meaningful latent inference, and (b) a fully tractable Bayes-optimal predictor (see Section 3 for further discussion). A MetaHMM environment consists of a family of Hidden Markov Models ( Rabiner & Juang 1986 , HMMs;) where each member is described by a latent code \bm{\theta} which specifies how to build the HMM from a pool of shared building blocks. Concretely, each coordinate \theta_{i} of \bm{\theta} corresponds to a discrete choice which defines the HMM. Further, one can control the size of a MetaHMM by adding/removing choices; explicit size computation given in Appendix B . The transition matrix of each HMM is composed of one base cycle which goes through all hidden states and multiple groups of smaller cycles from cycle families . For both the base cycle and cycle families, the direction and speed at which cycles are traversed can change (through a Direction and Step-size variable). Each outgoing edges of a node (after adding all cycles together) have equal probability. The emission matrix of each HMM is built from multiple different emission groups together partitioning the hidden states. Additionally, all groups’ emission mappings can be cyclically shifted through the Shift variable. See Figure 1 a) . Importantly, our setup enables efficient and exact computation of the posterior predictive in Equation 1 using JAX ( Bradbury

Read the complete text