New Research Gives AI Agents a Principled Formula for Deciding When to Seek Context
OQA Benchmark Reveals How Far Seven Frontier Models Lag an Oracle When Clarification Costs Tokens
Every time an AI agent encounters an underspecified task — a user who forgot a constraint, a document missing a crucial variable — it faces a decision no widely deployed system currently solves well: proceed on a best-guess assumption, or spend tokens on a clarifying question, retrieval call, or tool invocation? A paper appearing in the arXiv cs.AI daily new-submissions listing from researchers at the University of California, Davis, and the Technical University of Munich provides the first rigorous mathematical answer: acquire more context only when the expected reduction in task-relevant uncertainty exceeds the token cost of doing so.
The framework, called Optimal Question Asking (OQA), formalizes this tradeoff using active inference — a probabilistic framework rooted in computational neuroscience — and applies it uniformly to clarifying questions, RAG retrieval calls, tool invocations, and prompt optimization trials. To test how well current systems approximate the ideal, the researchers constructed a controlled benchmark grounded in the Twenty Questions game and ran seven frontier models — GPT-5, GPT-4.1, Gemini 2.5 Pro, Gemini 2.0 Flash, Claude Sonnet 4.5, Claude Haiku 4.5, and Grok 4 — against an exact oracle computed via dynamic programming. All seven showed measurable planning gaps.
The Agent Context Bottleneck Is a Token-Cost Crisis
The timing of the paper is not incidental. Agentic AI token costs have become one of the most pressing operational problems in enterprise deployment. An agent running a multi-step task re-sends the accumulated context — system prompt, history, retrieved documents, tool outputs — to the model at every step. By step 20 of a loop, the agent is paying for the same system prompt roughly 20 times. Among businesses with the highest AI adoption, Ramp's enterprise spending data shows that token consumption grew 1,001 percent from January 2025 to April 2026.
Within that cost explosion, the context-acquisition decision is among the most consequential and least principled. A passive agent that proceeds without asking risks wrong outputs and expensive retry loops. An over-eager agent that asks unnecessary questions burns tokens on queries whose answers would not have changed the outcome. Between those failure modes is a quantifiable sweet spot that no existing framework had previously defined with mathematical precision. That gap is what the OQA paper addresses.
The Active Inference Formulation: A Bilevel Decision Rule
The paper formalizes context acquisition using active inference — a probabilistic theory in which agents act to minimize expected free energy rather than maximize reward. In the LLM setting, the agent maintains a belief distribution over a latent task state: the user's true intent, a missing specification constraint, the identity of a best-performing prompt, or the target entity in a retrieval task.
The formalism is bilevel. An inner step simulates what the agent's posterior would become after each candidate action: if it asks question A and the user answers yes, how much does that narrow the belief over the hidden state? The outer step scores each candidate action by expected free energy — the combined reduction in task risk and increase in belief precision. Under deterministic observations and a uniform preference prior, the outer objective simplifies cleanly: maximize the mutual information between the latent task state and the observable answer, minus a token-cost penalty.
This decomposition has a natural interpretation. Expected information gain is the expected KL divergence between the posterior after observing the action's output and the current prior — the average amount by which one context-acquisition action would sharpen the agent's beliefs. Multiplying by the inverse of the action's token cost gives information per unit cost, and the stopping rule collapses to: rank actions by bits-per-token, and act only on those that exceed the threshold λ.
The resulting stopping rule, Proposition 3.3 in the paper, is precise: a context-acquisition action is worthwhile if and only if I(x; o | a) > λ · c(a), where I is mutual information, c(a) is the token cost of action a, and λ is a cost-sensitivity parameter. Among all worthwhile actions, the optimal one maximizes information per unit cost. If no action clears the threshold, the agent executes the task without further context-seeking.
This is structurally distinct from approaches that ask questions when the model "feels uncertain." The framework specifies exactly when uncertainty is worth resolving at the price of additional tokens, and makes that criterion auditable.
The OQA Benchmark and the Planning Gap Against an Oracle
To ground the framework empirically, the researchers instantiate it as the OQA benchmark: a deterministic Twenty Questions game over structured attribute tables. A hidden target is drawn uniformly from a finite candidate set. The agent asks about one attribute per turn; answers come from table lookup with no noise, so posteriors are exact and computable. Uncertainty at each turn equals log₂ of the remaining consistent set's size.
Binary tasks use candidate sets of 25 and 100 items across three domains — places, cars, and animals. Multiway categorical tasks use 100, 200, and 300 candidates. For each configuration, the authors compute an exact dynamic programming oracle — the globally optimal questioning strategy that minimizes expected questions to identification — and measure each model's "planning gap": the average number of extra questions used compared to optimal.
All seven frontier models show positive planning gaps in the author-run experiments, meaning no tested system natively implements information-efficient context acquisition at oracle quality. The benchmark's value is not that the oracle is practically deployable — full dynamic programming over large candidate sets requires exponential precomputation — but that it provides a precise, model-independent measurement of the gap between current LLM questioning behavior and optimal information-seeking. That measurement did not previously exist in the literature.
Two Deployment Case Studies: Clarification Before Writing, and Prompt Selection
The paper extends the active inference accounting to two settings that resemble real production workflows.
The first is prompt autocompletion: before generating a long-form output, the model may spend clarification turns asking about style, audience, or constraints. Each exchange consumes tokens. The information-per-cost criterion applies directly: ask a clarification turn only if the expected improvement in the final output exceeds the token cost. The second is automated prompt optimization: given a fixed evaluation budget, the model must allocate test runs across prompt variants to identify the best one. Here the active inference criterion governs experiment selection — each evaluation should maximize information about which prompt works best per token spent.
Both case studies share the same underlying structure as OQA: a finite latent state, a measurement model, and a cost. The active inference formulation unifies them with the Twenty Questions setting while extending the framework's reach to tasks directly relevant to deployed agentic systems.
What Separates OQA From Prior Clarification Research
The LLM clarification literature has grown quickly since 2024. Hu et al.'s Uncertainty of Thoughts framework selected follow-up questions using information-gain-motivated rewards, but without a free-energy decomposition or oracle baseline. BED-LLM (2025) applied Bayesian experimental design to LLM information gathering; Active Task Disambiguation (2025) framed task clarification similarly. CaRT (2025) studied when an agent should stop gathering context and act — the complementary problem.
OQA's three additions that prior work does not combine: first, it unifies all context-acquisition types — questions, retrievals, tool calls, prompt trials — under a single expected free energy criterion, making them directly comparable on a cost-adjusted information basis. Second, it provides an exact oracle via dynamic programming, enabling a direct measurement of the planning gap rather than only comparing models against each other. Third, it tests seven current frontier models, giving the framework immediate relevance to practitioners making model choices for agentic deployment.
The paper also formally connects the formulation to the active inference and expected free energy literature and, importantly, to bilevel reinforcement learning — with an appendix establishing the structural parallels and differences. The authors are careful to note that active inference is not categorically superior to RL; the information-theoretic decomposition is a design vocabulary advantage in settings where the agent must explicitly choose what evidence to buy before acting, not a claim that minimizing free energy outperforms reward maximization in all environments.
Where the Framework Does Not Yet Reach
Several important constraints bound the current work. OQA uses noiseless, fully observed attribute tables with exact posteriors — conditions far cleaner than the partial-information environments of real agentic tasks. Greedy expected information gain, which frontier models might reasonably approximate, is not globally optimal; the dynamic programming oracle reveals exactly how large that gap is, but it does not supply a practically deployable approximation for open-domain settings where candidate sets are open-ended and attribute tables do not pre-exist. Scaling the active inference formulation to that regime remains an open research problem the paper does not claim to solve.
All benchmark results were run by the paper authors and have not been independently reproduced; the paper is a preprint and has not yet undergone peer review. The planning gaps reported for specific models should be treated as author-reported results pending external replication.
The Oracle Gap Points to a Practical Architecture Change
The most consequential result is not which frontier model performs best — it is that all seven show a positive planning gap. No tested system natively implements information-efficient context acquisition as a first-class decision policy. Models make clarification and retrieval decisions implicitly, through mechanisms trained on human text, rather than through an explicit information-gain-versus-cost calculation at each turn.
This suggests a concrete architecture direction: rather than relying on a frontier model to self-regulate its information-seeking, an agentic orchestrator could implement the OQA stopping rule as a separate control policy. Before each potential context-acquisition action fires, the orchestrator evaluates whether the expected information gain clears the token-cost threshold. If it does not, the action is skipped and the agent executes. This layer is model-agnostic — whether the underlying model is GPT-5, Gemini 2.5 Pro, or a smaller inference-optimized system, the same expected free energy criterion applies to the orchestration layer.
For enterprises running agentic workloads at scale, the difference between a heuristic clarification policy and a principled information-per-cost policy could represent meaningful efficiency gains at the volumes now being reported. The benchmarks establish that the planning gap is real and measurable. The framework exists to close it. What follows is implementation at the engineering layer and validation in open-domain deployments — work that OQA's formalism now makes precisely scoped enough to begin.