DEV Community

Dean Lee
Dean Lee

Posted on Originally published at deanlee.info

The Optimal Stopping Illusion

In sequential decision theory, the search problem is framed around optimal stopping. An agent gathers observations sequentially. Each extra query carries a marginal cost: token consumption, API fees, latency, and context degradation. Rational stopping dictates that an agent continues querying only so long as the expected marginal value of information exceeds the marginal cost of acquisition. When incoming data yields nothing, the option value of continuation goes negative, and the search must terminate.

Enterprise deployments of tool-using language agents lean heavily on the assumption that models can internalize this calculus. Enterprise architectures hand models a set of search tools, define an operational budget, and embed cost warnings in the system prompt. The thesis is intuitive: as models scale in reasoning capability, they will weigh the quality of retrieved evidence against the expenditure of running another tool turn, pruning unproductive searches before blowing through their token ceilings.

A pre-registered empirical study by researchers across Nanyang Technological University, the National University of Singapore, and Carnegie Mellon University directly stress-tests this assumption. Evaluating seven open and frontier model architectures across 90,000 episodes in a controlled retrieval failure environment, the authors isolated how agents judge evidence from how they actually decide to stop.

The empirical results reveal a stark operational dissociation. The agents are not blind. When retrieval tools return unhelpful or corrupted results, the tested models correctly identify the incoming information as useless between 97% and 100% of the time. They evaluate the quality of the data with near-flawless accuracy.

Yet their stopping decisions completely ignore their own judgments. The authors constructed a time-matched contrast metric, measuring whether an agent was more likely to stop after an unbroken string of useless results than after a sequence containing useful evidence. For prompt-governed agents, that contrast remained near zero. The models recognized that the well was dry, yet they continued pumping anyway.

Prompt engineering fails to bridge this gap. Introducing explicit financial costs per call into the prompt changes the timing slightly but does not tie stopping to evidence quality. Telling models they have permission to answer from internal memory triggers arbitrary premature halts regardless of whether external retrieval succeeded. Most revealingly, stating an explicit step budget transforms an upper limit into a spending target. For open models in the 7-billion to 8-billion parameter range, declaring a budget simply shifted the stopping distribution directly onto the final deadline.

Like a bureaucratic division burning through its annual appropriations in the fourth quarter to prevent next year's budget from being cut, an agent with an eight-step budget treats eight steps as a quota to be consumed.

To understand why this happens, you have to look at the loss function. An autoregressive language model has no endogenous balance sheet. It experiences zero disutility from spending compute. In token generation, committing to a terminal answer carries immediate downside risk: the model produces a definitive output that can be scored as incorrect. Executing another tool call, by contrast, feels like risk postponement. The model defers accountability by remaining in an iterative state, spending the client's credit balance to avoid committing to a distribution.

The paper shows that stopping follows evidence only when the architectural harness enforces it exogenously. When the runtime code intervenes to remove tool access after five consecutive useless results, leaving only the terminal answer action, task success increases across every single model architecture tested, and the stopping point remains invariant even when the step budget doubles.

The market assumption treats autonomous agents as mini-enterprises that can be persuaded into capital discipline via prompt instructions.

I want the distribution, not the point estimate.

The median case in enterprise agent software today is an unhedged American call option granted to an algorithm with zero loss aversion. Giving an agent API keys and a prompt that says "be frugal" does not induce cost discipline; it creates an unmonitored spending ceiling. If the execution harness does not enforce the stopping boundary at the code level, the model will burn the entire allocation every time it encounters unexpected variance.

Capital discipline in automated workflows is not an emergent reasoning skill that appears with more training tokens. It is an exogenous constraint imposed by contract. The firms that build profitable agent pipelines will not be the ones writing longer cost warnings into system prompts. They will be the ones that treat search as an expensive derivative and hardcode the exercise boundary into the execution engine.


Originally published at https://deanlee.info/essays/the-optimal-stopping-illusion/.

Top comments (7)

Collapse
 
arhancanli profile image
Arhan Canli •

The dissociation is the useful finding: agents recognise useless results 97–100% of the time and keep searching anyway. Judging and stopping are separate abilities, and only the first one gets tested by "is this result relevant?" evals.

It also argues for taking the stopping decision away from the model, the way you'd take position sizing away from a trader. A hard budget in the harness (N tool calls, or K consecutive results the model itself rated useless, then stop and report) doesn't depend on the model doing marginal-value maths it demonstrably doesn't do.

Since it was pre-registered, did the authors say whether the effect held across all seven models, or whether one or two drove the average? With 90,000 episodes the pooled number will be very precise, but that says nothing about how much it varies by model.

Collapse
 
deanlee profile image
Dean Lee •

The dissociation held across the board, but the failure modes split by model tier. All seven architectures identified useless results with 97% to 100% accuracy, and the time-matched contrast between stopping after useless versus useful streaks was near zero for nearly all of them under baseline prompting.

The variance showed up in how prompts shifted the stopping distribution. Explicit step budgets drove 7B to 8B models directly to the deadline: they treated an eight-step limit as an eight-step quota regardless of retrieval quality. Frontier and reasoning-oriented models reacted differently: granting permission to answer from internal memory or turning on reasoning flags triggered premature halts, stopping early without checking if they had actually retrieved valid facts. The pooled number is not masking one outlier; it reflects two distinct failure distributions that both miss the evidence boundary until the harness cuts off the tool.

Collapse
 
arhancanli profile image
Arhan Canli •

That split matters for the fix, because the two modes pull in opposite directions. A step budget that the 7B to 8B models read as a quota suggests the cap itself is leaking into the decision, so hiding the budget or drawing it at random per run would show whether stopping tracks evidence at all. The early halters need the reverse: a gate that blocks the final answer until a retrieved span supports it.

One thing I would want to see is the accuracy of the early-halted answers under the memory-permission prompt. If the frontier models are right from memory most of the time, stopping early is rational and the real fault is only that they never checked. Did the paper separate those cases?

Thread Thread
 
deanlee profile image
Dean Lee •

The authors tracked accuracy across each prompt condition, and the numbers give a clear answer. If early halts reflected genuine confidence in parametric knowledge, task success under the memory permission prompt would have climbed. Instead, the accuracy delta was effectively flat across every open and frontier architecture. Qwen2.5-7B moved from 19.2% to 21.3%, Qwen3-8B drifted down from 44.8% to 42.3%, and Qwen3-32B shifted from 50.9% to 51.7%.

The reasoning-mode breakdown in Section 7 makes the breakdown even clearer. When granted permission to answer from internal weights, thinking-mode Qwen3-32B bailed out on 97% of failing-source runs, compared to 11% under standard prompting. But on the recovery benchmark where a valid document appeared after two corrupted results, that same policy caused the model to abandon the search and guess from memory on 47% of episodes before ever inspecting the real data.

The early stops were not selective exercises of verified parametric memory. The agents abandoned the tool pipeline indiscriminately to escape the iteration loop, swapping token expenditure for ungrounded hallucination without shifting the underlying payoff.

Thread Thread
 
arhancanli profile image
Arhan Canli •

Flat deltas are the aggregate, and they could hide two opposite effects. Early halts that are right from memory would raise accuracy on questions the model already knows, and the 47% abandonment on the recovery benchmark would lower it where the document was findable. Qwen3-8B going from 44.8% to 42.3% and Qwen2.5-7B from 19.2% to 21.3% are both inside what those two could cancel to.

The split that separates them is accuracy conditional on halting: among episodes that stopped early under the memory prompt, how often was the answer right, against the same questions answered with the tool loop run to the end? If the halted answers are no better than the matched full-run ones, your reading holds. If they are right most of the time on one benchmark and wrong on the other, the policy is selective but blind to which case it is in. The 97% versus 47% gap points at that, since the model clearly reacts to the failing source and then misses the one that recovers after two bad results. Two corrupted results in a row is probably the cue that should not count as evidence of a dead source.

Collapse
 
ai_adam profile image
ai_adam •

Đúng trọng điểm: mô hình autoregressive không có khái niệm "chi phí cơ hội" trong context window của nó — nó chỉ tối ưu token tiếp theo, không phải tổng chi phí inference. Việc gắn boundary bên ngoài (hard token budget, wall-clock deadline, hoặc cost ceiling) mới là cách duy nhất ép buộc optimal stopping. Thấy nhiều team vẫn cố "prompt harder" ("hãy dừng khi đủ thông tin") mà quên rằng model không có state để đánh giá marginal value của lần query tiếp theo so với chi phí thực. Execution harness mới là nơi logic kinh tế đó thuộc về (site: labagent .tech)

Collapse
 
deanlee profile image
Dean Lee •

The context window has no mechanism to calculate marginal cost against external utility. When teams prompt models to stop once sufficient information is gathered, they are asking next-token prediction to optimize an unobserved loss function. External harnesses with explicit bounds remain the only structure that enforces true economic stopping.