Manuscript Offprint

arXiv:2610.09471

When Should an In-Context Learner Expand Its Hypothesis Space?

Weihan Li, Xinlei Chen, Junhao Wu, Tianshi Zheng

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Learning systems adapt quickly inside a familiar family of models. The harder step comes earlier: deciding, from observations that could be noise, an exception, a change within the family or structure outside it, whether opening a richer family is worth its cost. We treat this as a costly sequential decision: prediction failure must be turned into structural evidence, evidence into a value of expansion, and value into action. The Structural Revision Environment produces matched failures from each source, varies the price of expansion and the remaining horizon independently of the evidence, and admits exact Bayesian calculations and an exact normative solution of the one-shot decision. Its solution shows that revision is a value boundary and not an evidence threshold: one history has different optimal actions under different prices, horizons and announced queries, the boundary between local repair and expansion is set by the inputs a rule predicts and a repair cannot cover, and belief in the richer family crosses long before the decision does. Transformers trained in the environment reproduce this boundary from utility alone. Language models of three post-training lineages carry a failure-sensitive signal in their predictions that is not reflected in their revision decisions, and given the gain of expanding they read it without weighing it against price and horizon. Three models allowed to reason weigh the stated gain in the reference's proportions and still do not turn the history into an estimate of what expansion would buy. Controlled post-training of the meta-trained learners moves the prior and the sharpness of predictions, and neither moves the criterion.

1. Introduction

Learning systems adapt rapidly when new observations can be explained within a familiar family of models. A harder problem arises when the observations suggest that the family itself may be inadequate. Consider a learner that has seen many sequences generated by simple rules and now receives one in which a few values are off. The deviation might be noise, and the next observation of the same input will be normal. It might be a genuine quirk of one input, worth remembering and nothing more. Or it might be the first sign that this sequence follows a rule of a kind the learner is not currently considering. These possibilities call for qualitatively different responses: ignoring the deviation, recording an exception, or searching a richer family of rules. The last is by far the most expensive. It is also the only response that can exploit the missing structure. Yet the observations themselves do not immediately reveal which response is warranted.

A large theoretical literature studies in-context learning by asking how a learner infers a latent task, parameter, or algorithm from the examples available in its context. Transformers trained on mixtures of task families approximate Bayesian inference under their training distribution (Xie et al., 2022; Raventós et al., 2023; Wurgaft et al., 2025), average over or select among the families they know (Bai et al., 2023; Dudley et al., 2026), and language models have been tested on keeping enumerated hypotheses consistent with the evidence (Xu et al., 2026). These accounts characterize inference once the relevant alternatives are available to the learner's current computation. Our question begins one step earlier: when making a richer alternative available is itself costly, when is that computation worth invoking?

Prediction failure alone does not determine whether richer inference is warranted. A single extreme observation may be highly surprising while providing little evidence of missing structure, whereas small deviations that recur systematically across related inputs can accumulate strong evidence that the current family is inadequate. Even strong evidence does not determine the action. Opening a richer family incurs computation whose benefit must be recovered through future predictions (Russell & Wefald, 1991; Poh & Horvitz, 1993), so identical evidence can justify different decisions when the cost of computation or the remaining horizon changes.

1^{1}Department of Mechanical Engineering, The University of Tokyo, Tokyo, Japan 2^{2}School of Mechanical Engineering and Automation, Harbin Institute of Technology, Shenzhen, China 3^{3}Faculty of Mechanical Engineering, RWTH Aachen University, Aachen, Germany 4^{4}Department of Computer Science and Engineering, HKUST, Hong Kong SAR, China. Correspondence to: Weihan Li liweihan1107@g.ecc.u-tokyo.ac.jp.

Preprint. October 8, 2026.

Figure

Figure 1. The Structural Revision Environment and its normative solution. Left: four episodes, one per class, that share one query schedule and one set of label flips; framed squares mark the observations that the current family fails to predict. S is the exception set, b the threshold, τ\tau the change point and u the upper end of the interval. Middle: the nested hypothesis spaces, the four actions with their prices, and the optimal action for one history with two anomalous inputs at cE=4c_E = 4 and three horizons. Right: the expansion advantage ΔQ∗\Delta Q^* as a surface over the reference's belief in the richer family (its posterior log-odds) and amortized price ( H=20H = 20, cp=0.5c_p = 0.5), above the regions of the optimal action; the dark line is ΔQ∗=0\Delta Q^* = 0, and the three dots are the three horizons of the middle panel at their amortized prices.

Evidence also leaves open whether a local repair suffices. An exception list can absorb any number of deviations, but its length grows with every new anomalous input, while a rule that explains them all has constant length and predicts the anomalies still to come. The problem is therefore a sequential decision over when richer inference is worth invoking, and over which kind of revision the evidence supports.

To separate structural evidence from the value of expansion, we introduce the Structural Revision Environment (SRE), a controlled generative environment in which matched prediction failures arise from noise, local exceptions, within-family change, or structure outside the current family. The environment varies these sources of failure independently of the cost and future value of richer inference, and it admits exact Bayesian calculations and an exact normative solution of the one-shot revision decision.

Its solution is a normative phase diagram that specifies when revision is worth its cost, and the reference against which we evaluate Transformers trained from scratch and pretrained language models on three questions: whether they revise in response to evidence of structure or to surprise, whether their decisions follow the value of expansion, meaning the price of computation and the remaining horizon, and whether the alternatives that eventually dominate were already influencing predictions before revision.

The phase diagram gives a first result on its own: revision is a value boundary and not an evidence threshold. One history has different optimal actions under different prices, horizons and announced queries; belief in the richer family crosses long before the decision does; and the boundary between local repair and expansion is set by the inputs a rule would predict and a repair cannot cover, so that a wider region moves the boundary while the number of anomalies does not. Transformers trained in the environment reproduce this boundary from utility alone, without action labels and without the posterior, so the boundary is learnable without exact inference. Pretrained language models break the chain at a definite point. Their predictions carry a failure-sensitive signal, with the shape of a learner that explains the failures inside its current family, and their decisions do not reflect it: with the history alone the decision is constant, at states where the reference expands and the models' own predictions have already moved. With the gain of expanding stated, they read it as a trigger reads a statistic. In the three models tested with longer reasoning, the stated gain is weighed against the price and the horizon in the reference's proportions, and the history still does not yield an estimate of what expansion would buy. The failure thus has two parts, forming an estimate of the gain and pricing it, and what distinguishes the models is the second. Controlled post-training of the meta-trained learners separates three accounts of such entrenchment: the data move the implied prior, the objective moves the sharpness of the predictions, and neither moves the decision criterion; the lost response remains decodable and is largely recoverable.

References (89)