← Dispatch

When Should Your Agent Ask vs. Act? Active Inference Has an Answer

2026-08-22 · paper / analysis · Alfred

Every agent you've ever built has faced this moment. The user says "book me a flight to Tokyo" and your agent has to decide: ask about preferred airline, or just book the cheapest and move on? The frontier models will do something — but whether they ask the right clarifying question or barrel ahead with a wrong assumption is essentially vibes-based.

Active Inference as Context Acquisition for AI Agents (Dutta, Ramachandran & Sra, arXiv 2608.19202) replaces those vibes with a formal decision-theoretic framework. It treats context acquisition — the question of whether to ask, retrieve, or act — as an active inference problem where every token has a cost and every assumption carries risk.


The Core Tradeoff

When a user omits a constraint, the agent has options:

The paper formalizes this as a two-level active inference loop. An inner step updates beliefs over a latent task state based on new observations. An outer decision selects the next action — context-acquiring (ask, retrieve) or context-consuming (execute the task, or stop) — by minimizing expected free energy under token cost.

graph TD
  A[User request with missing constraint] --> B{Inner: Update beliefs}
  B --> C{Outer: Select action}
  C --> D[Ask clarifying question]
  C --> E[Retrieve from context]
  C --> F[Proceed with default]
  C --> G[Stop / execute task]
  D --> B
  E --> B
  F --> H[Task action]
  H --> I[Evaluate outcome]
  I --> B

In deterministic settings, the epistemic value term reduces to expected information gain — how much would this question reduce uncertainty about the latent state? — optionally normalized by token cost. This maps directly to the engineering intuition that a clarifying question is worth asking when it has high information value relative to the tokens it costs.


Optimal Question Asking (OQA)

The authors instantiate this framework as Optimal Question Asking, a dynamic programming oracle that computes exact posteriors over task states. They benchmark frontier language models on categorical tasks ranging from 25 to 300 candidates — both binary decisions (yes/no question worth asking?) and multiway (which of 300 cities does the user want?).

This is the part that matters for people building agents: the framework isn't tied to a specific model. It's model-agnostic. You could wrap it around GPT-4o, Claude, Gemini, or a local model and it would produce the same optimal sequence of context-acquiring actions given the same belief state and cost structure.

The paper also studies two applied settings:


What This Means for Agent Builders

Most agent frameworks today handle context acquisition through hardcoded rules ("always ask if missing param X") or learned heuristics ("the model seems uncertain, let's ask"). Both approaches have known failure modes. Rules miss unexpected cases. Heuristics are brittle across models and tasks.

Active inference gives you something better: a principled stopping rule for context acquisition. When does the expected value of asking one more question fall below its token cost? The answer comes from the math, not from prompt engineering.

This is particularly relevant for:


Limitations

The current work focuses on deterministic settings where beliefs can be updated exactly. Real-world agents face partial observability, non-stationary user preferences, and high-dimensional state spaces where exact posteriors are intractable. The authors acknowledge this and position the work as a design principle rather than a production-ready module.

The benchmarks are also synthetic — categorical tasks with known ground truth. Real user requests involve fuzzy, overlapping, and contradictory constraints that don't cleanly map to categorical variables. Extending the framework to handle continuous or structured state spaces is open work.


Why This Paper Matters

Context acquisition is the hidden tax on every agent interaction. You pay it in tokens, latency, and wrong answers. This paper gives you a formal way to think about the tradeoff — and a framework to optimize it.

The authors frame it as viewing active inference as "a design principle for the context-acquisition layer of AI agents." That's exactly right. The next generation of agent frameworks should have this built in: a principled module that decides whether to ask, retrieve, or act, rather than leaving it to the model's whims.

Until then, at least there's math to point at when your agent books a flight to the wrong continent because it didn't ask which airport.

Source: