Active Inference as Context Acquisition for AI Agents
Teaching AI agents to decide when asking a question is worth the tokens it costs
When a user leaves out a detail, an AI agent must choose between guessing, asking a clarifying question, or making a retrieval or tool call, each of which costs tokens. This paper frames that choice as active inference, scoring each possible next action by how much it is expected to cut uncertainty against how much it costs. The authors tested the idea on seven frontier language models using a Twenty-Questions-style benchmark and two prompting experiments under token budgets.
METAL MEDIA explanatory visual
Teaching AI agents to decide when asking a question is worth the tokens it costs
- 01Frames clarifying questions, retrieval calls, tool calls, and prompt trials as 'context actions' that an agent picks between, alongside acting now or stopping, to reduce uncertainty about a hidden task variable
- 02Splits the decision into an inner step that updates beliefs assuming a hypothetical answer, and an outer step that picks whichever action minimizes expected free energy, a score combining risk, information value, and cost
- 03In deterministic settings this score simplifies to expected information gain, which can be normalized by token cost
- 04Built Optimal Question Asking (OQA), a Twenty-Questions-style benchmark with 25 to 300 candidates, computed an exact dynamic-programming oracle for optimal question count, and benchmarked 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 it
- 05In a product-description clarification task, the best tuned policy reached 0.375 verifier compliance at about 219 tokens per task, versus a no-question baseline at 0.0417 compliance and about 112 tokens
What they did
- Frames clarifying questions, retrieval calls, tool calls, and prompt trials as 'context actions' that an agent picks between, alongside acting now or stopping, to reduce uncertainty about a hidden task variable
- Splits the decision into an inner step that updates beliefs assuming a hypothetical answer, and an outer step that picks whichever action minimizes expected free energy, a score combining risk, information value, and cost
- In deterministic settings this score simplifies to expected information gain, which can be normalized by token cost
- Built Optimal Question Asking (OQA), a Twenty-Questions-style benchmark with 25 to 300 candidates, computed an exact dynamic-programming oracle for optimal question count, and benchmarked 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 it
- In a product-description clarification task, the best tuned policy reached 0.375 verifier compliance at about 219 tokens per task, versus a no-question baseline at 0.0417 compliance and about 112 tokens



| Aspect | Generic RL view | Active-inference view used here |
|---|---|---|
| Control | Optimize actions for return under the sampled or observed data stream. | Choose actions that also determine what evidence arrives next. |
| Exploration | Usually added through bonuses, entropy, optimism, or posterior sampling. | Appears directly as epistemic value in expected free energy. |
| Belief and queries | Beliefs may be implicit in a value function, recurrent state, or model posterior. | An explicit posterior over intent, target, or best prompt makes queries first-class actions. |
| Evaluation | Return, regret, accuracy, or reward-model score. | Entropy drop, oracle gap, bits per token, and final task success. |



Why it matters
This gives chatbots and agents a principled way to decide, rather than guess, when spending tokens on a clarifying question or tool call actually pays off in accuracy. For any product where token usage translates directly to cost, this kind of cost-aware information accounting could shape how agents are designed to balance efficiency and correctness.



Terms in this paper
- active inference · a framework that jointly scores information-seeking actions and goal-directed actions to pick the best next move
- expected free energy · a score combining risk, information value, and cost used to rank candidate actions
- expected information gain · how much an action is predicted to reduce uncertainty about the hidden variable
- Optimal Question Asking (OQA) · this paper's benchmark where a model narrows down a hidden target by asking questions, like Twenty Questions
- DP oracle · a dynamic-programming solution that computes the theoretically optimal minimum number of questions needed under the same rules
Original abstract (English)
Interactive AI agents must acquire the right context as efficiently as possible. When a user omits a constraint, preference, file, or task variable, an agent can proceed with a default assumption or spend tokens on a clarifying question, retrieval call, tool call, or prompt trial. We formulate this tradeoff as active inference for context acquisition. An inner inference step updates beliefs over a latent task state, and an outer decision selects the next context action, task action, or stop action to minimize expected free energy under cost. In deterministic settings, the epistemic term reduces to expected information gain, optionally normalized by token cost. We instantiate the framework in Optimal Question Asking (OQA), with exact posteriors and a dynamic programming oracle, and benchmark frontier language models on binary and multiway categorical tasks from 25 to 300 candidates. We also study clarification before generation and automated prompt optimization under token budgets. The formulation is model-agnostic and views active inference as a design principle for the context-acquisition layer of AI agents.
Read on arXivLatest papers
- SWE-bench Science: Can Coding Agents Resolve Engineering Tasks in Science?AI coding agents were tested on fixing real scientific software, and even the best one failed more than half the time
- FlashPrefill V2: Block-Sparse Prefill Attention for Long-Context LLM ServingMaking sparse attention fast enough and accurate enough for real LLM serving, not just papers
- PolicyGuide: From Guarding One Action to Guiding the Whole Workflow for Policy-Compliant LLM AgentsMaking customer-service AI agents follow the whole procedure, not just avoid one bad action
- EXIMO: VLM Guided Exploration of VLA PoliciesTeaching a robot new chores without human teleoperation, by letting a chatty AI supervise it
- EnvHarness: Awakening Static Worlds for Agent LearningInstead of building new training worlds from scratch, this work adds a plug-in layer that reshapes existing ones around each agent's actual weaknesses
- Bounded Sovereignty and the Control Tax: Pricing AI Oversight When the Deployer Does Not Own the ModelCompanies that rent AI instead of owning it can only do half of AI safety oversight
- Beyond Imitation: Filtering On-Policy Distillation by Reasoning ProgressA fix for AI models that get penalized by their teacher even when they're reasoning correctly
- PersonalBench: Measuring the Authorship Gap in LLM PersonalizationAI can be prompted to write 'like someone,' but its own voice never fully disappears
Latest from METAL MEDIA
Figures: Sanchayan Dutta et al., arXiv:2608.19202, arxiv-nonexclusive