Speculative Perception and Unified Policy Optimization for Visual Agents
This article examines how to accelerate visual agents through speculative perception—pre-executing high-probability perceptual operations before they are formally requested—while preserving verification and fallback guarantees. It covers the efficiency bottlenecks of multi-turn visual workflows (repeated perception, serial waiting, context bloat, and unclear stopping conditions), a layered architecture separating planning, execution, and evidence management, reasoning-driven visual generation with constraint checking, unified policy optimization across text and visual actions, structured multimodal intermediate representations, and a phased evaluation and deployment strategy built on two principles: acceleration must be switchable off, and evidence chains must remain traceable.
1. From Single-Pass Image Understanding to Closed-Loop Visual Workflows
Traditional visual question answering follows a relatively fixed pipeline: receive an image, extract visual features, and generate an answer conditioned on the user’s question. This works well for tasks like object recognition or scene description, but a single observation is often insufficient for reliable conclusions when dealing with dense tables, complex drawings, small text, or cross-region relationship judgments.
A visual agent instead decomposes image understanding into a sequential decision process. The system first observes the whole image, then selects local regions as the task requires, invokes zooming, cropping, OCR, or other visual processing capabilities, and adjusts its next action based on new evidence. The key shift is not simply adding tools—it is making “how to observe” a decidable and verifiable workflow.
A typical closed loop can be expressed as:
Task parsing → initial observation → action selection → evidence acquisition → state update → conclusion verification → continue observing or stop.
This architecture lets the system actively fill in missing information, but it also introduces new costs. Multi-turn processing may repeatedly encode the same image, tool execution adds waiting time, and new evidence expands the context. The optimization goal for a visual agent therefore cannot be reducing the latency of a single inference—it must be shortening the entire task completion path under quality constraints.
2. Efficiency Bottlenecks: Costs from Repeated Computation and Decision Dependencies
2.1 Repeated Perception
Two consecutive crops may overlap substantially; OCR may be run repeatedly on the same content. If the system does not record existing evidence and its scope of applicability, every tool call is treated as a brand-new task.
The fix is a reusable perception state. Beyond processing results, the state should store the image version, region coordinates, processing method, and task association. Cached results should be reused directly only when the source, region, and processing conditions are all consistent.
2.2 Serial Waiting
Many systems execute strictly serially: the model proposes an action, the tool runs, and only after the tool returns does the model continue deciding. This design is simple but adds every step’s waiting time to the critical path.
Note that not all tool calls are suitable for parallelization. If the next crop position must be determined by the previous OCR result, there is a genuine data dependency. Only independent candidate operations whose inputs can be determined in advance are worth concurrent or pre-execution.
2.3 Context Bloat
Appending every round of images, recognized text, and tool logs to the context creates redundancy. The model must search for genuinely relevant evidence while processing stale or conflicting records.
A better approach separates information into three categories: raw evidence stays in external storage; structured facts enter the working state; only necessary evidence references enter the model context. This reduces input overhead while preserving traceability.
2.4 Missing Stopping Conditions
Without a defined standard for “sufficient evidence,” a system may keep zooming, re-recognizing, and re-checking. Stopping conditions should be task-bound—for example, all key fields have traceable sources, no unresolved conflicts remain in relationship judgments, or additional observations no longer meaningfully reduce uncertainty.
3. Speculative Perception: Preparing Likely-Needed Evidence in Advance
Speculative perception is a workflow acceleration design: while the current decision is still in progress, the system pre-executes a small number of perceptual operations that have a high probability of being needed next, based on the task type and current state.
For example, when processing a document with multiple information blocks, the system already knows the user needs to verify dates, amounts, and payee information. While the model analyzes the overall layout, the backend can pre-compute crops and OCR results for those candidate regions. When the formal decision calls for one of them, the system can use the candidate result directly after confirming it applies—reducing waiting time.
The “speculation” here is predicting future needs, not guessing at image facts. Pre-executed results must still be verified; running early does not make a result trustworthy by default.
3.1 Selecting Candidate Actions
Candidate actions should come from a constrained action space—for example, viewing a specified region, reading a detected text block, or inspecting chart axes. Task templates, lightweight predictors, or historical workflow statistics can generate candidates, but branches should not expand without limit.
The value of a candidate action can be judged with a conceptual relationship:
Expected benefit = hit probability × waiting time saved − extra compute cost − verification and state management cost.
This is not a universal performance formula but an engineering decision framework. When tools are cheap, hit rates are high, and waiting is significant, speculation tends to pay off; when candidate inputs are large or task branches are hard to predict, pre-execution may only waste resources.
3.2 A Hit Must Satisfy Verifiable Conditions
Before reusing a candidate result, the system must check at minimum:
- Whether the input image is the same version;
- Whether the region coordinates match the formal request;
- Whether the tool type and processing configuration are compatible;
- Whether the result is complete and free of obvious quality issues;
- Whether the current task state still needs this evidence.
Similar but non-identical regions must not be assumed equivalent. Small crop offsets can change results, especially around table column boundaries, drawing annotations, and small-font text. If a reliable coverage relationship cannot be established, the formal operation should be re-executed.
3.3 Fallback Must Not Change Task Semantics
When a speculative result misses, the system should return to the normal execution path rather than force-adjusting the observation plan to exploit already-computed results.
The speculative module is therefore best positioned as a bypassable acceleration layer. Even with it disabled, the main workflow should still complete tasks. It changes evidence preparation time, not formal decision rules.
Below is illustrative pseudocode; the functions express design logic only and do not represent actual product interfaces:
state = initialize_task(image, request)while not task_finished(state):candidates = predict_candidate_actions(state)pending = preexecute(candidates, resource_budget)action = select_verified_next_action(state)result = find_exact_match(pending, action)if result is absent or not validate_result(result, action, state):result = execute(action)state = update_with_evidence(state, action, result)
Implementation must also handle timeouts, cancellation, concurrency contention, and resource quotas. Completed-but-unused results can go into a cache; tasks not yet started or that have lost their value should be cancelled early to avoid crowding out formal requests.
4. Workflow Architecture: Separating Decision, Execution, and Evidence
4.1 Planning Layer: Goals and Actions
The planning layer converts user requirements into checkable task conditions. For example, “verify the total in this table” requires locating the table, recognizing the relevant cells, determining the calculation rule, and comparing the computed result against the displayed value.
The planning layer should not generate a fixed, unadjustable full path in one shot. A more robust approach keeps the overall goal while selecting the next action incrementally based on new evidence.
4.2 Execution Layer: Tools and Resources
The execution layer handles image processing, OCR, region extraction, and other operations, while centrally managing queues, caching, timeouts, and concurrency budgets. Speculative and formal tasks should have different priorities so background pre-execution does not slow down tool calls that are genuinely needed.
4.3 Evidence Layer: Provenance and Consistency
Every fact should be linked to its source region, acquisition method, and verification status. Coordinate transformation is especially important: zoomed images, local crops, and the original image need explicit mappings, or the system may mistake a local position for a global one.
When two rounds of recognition conflict, the system should not simply keep the latest text—it should record the conflict and trigger a recheck. The evidence layer’s goal is not accumulating results but maintaining a reliable state that can support conclusions.
4.4 Output Layer: Presentation and Acceptance
The final answer should distinguish verified facts, inferences, and unresolved issues. For high-risk tasks, the output should include the necessary evidence locations or recheck prompts rather than a single seemingly definitive conclusion.
5. Reasoning-Driven Visual Generation: Making Outputs Accept Inspection
Visual agents can participate in producing images, charts, and layout content, not just reading them. Unlike one-shot generation, reasoning-driven visual generation emphasizes defining constraints first, then generating candidates, and using checks to drive revisions.
For example, when creating an infographic, the task may require several data items, a specified layout, readable text, and consistency between the legend and the graphics. The system should convert these requirements into acceptance items rather than concatenating everything into a single generation prompt.
The process can be:
Requirement structuring → layout and content planning → candidate generation → constraint checking → local revision → re-acceptance.
Checks cover text content, element counts, spatial relationships, readability, and data consistency. Scenarios that require precise values and text are usually better served by deterministic layout or drawing processes than by free-form image generation alone.
Visual understanding and visual generation can share some checking capabilities, but their goals differ: understanding tasks need evidence sufficient to support an answer; generation tasks need outputs that satisfy constraints. “The image looks plausible” is not a substitute for task acceptance.
6. Unified Text-Image Policy Optimization: One Objective, Not One Representation
Text actions and visual actions can live in the same decision framework. For example, an agent may choose to ask a clarifying question, inspect a local image region, read text, or generate a candidate layout.
The core of unified policy optimization is weighing these actions against the same task objective—not forcing text and images into an identical internal representation.
6.1 Reward Design Must Cover Quality and Cost
If only the final answer’s correctness is rewarded, the system may brute-force its way through repeated observations; if only tool calls are penalized, it may stop too early. A sound objective should consider task success, critical errors, execution latency, resource cost, and output constraints together.
Different tasks need different weights. High-risk document verification should prioritize factual accuracy of key fields; low-risk interactive tasks can weigh response speed more heavily.
6.2 Training and Validation Must Cover Full Trajectories
A correct final answer does not mean the intermediate actions were effective. The system may rely on coincidental cues or invoke many irrelevant tools. Action sequences, evidence sources, and failure reasons should therefore be retained for analysis of which operations actually improve success rates.
The speculative module also deserves separate evaluation, so the policy does not choose unnecessary actions just to raise cache hit rates. What needs optimizing is end-to-end task benefit, not any single local metric.
7. Multimodal Intermediate Representations: Structured Evidence Linking Observation and Reasoning
So-called “multimodal chain-of-thought tokens” are better understood from an engineering perspective as intermediate representations linking visual regions, textual facts, and action decisions—rather than assuming the model has a directly readable internal thought process.
A practical representation might include:
- Region identifiers and original-image coordinates;
- Observed text, objects, or relationships;
- Evidence sources and verification status;
- Currently unresolved questions;
- Allowed next actions.
For example, “the value in region A is inconsistent with the total in region B” is easier to check than a long unsourced description. The system can locate the relevant regions, recheck recognition results, and then determine whether the discrepancy comes from a recognition error or actual content.
Intermediate representations need controlled granularity: too coarse and key relationships are lost; too fine and context bloat returns. In practice, hierarchical summaries work well—task-level conclusions, key region facts, and raw evidence fetched on demand.
8. Deployment Evaluation: Prove It’s Faster, and Prove It Hasn’t Gotten Worse
When evaluating visual agents, observe task quality, latency, resources, and stability together.
Quality metrics include task success rate, key-field accuracy, relationship judgment correctness, and output constraint satisfaction. Latency should be decomposed into model decision time, tool waiting, queuing, and verification, with attention to tail latency rather than just averages.
For the speculative module, also track candidate hit rate, wasted computation, fallback ratio, and resource impact on formal tasks. A high hit rate does not guarantee value: if pre-execution itself is expensive, overall cost may still rise.
Experiments should compare at least these configurations: a no-speculation baseline workflow, a workflow with caching only, and a workflow with caching plus speculative perception. This separates gains from eliminating repeated computation versus genuinely shortening the critical path.
Test sets should cover low-resolution images, dense text, cross-region reasoning, input updates, tool failures, and evidence conflicts. For irreversible operations or high-risk conclusions, speculative execution should be limited to safely preprocessable perception steps and must not bypass confirmation and authorization.
9. Implementation Advice: Build a Reliable Closed Loop First, Then Add Prediction
Roll out in phases. First, build an observable baseline that records the inputs, results, latency, and evidence usage of every tool call. Next, improve caching and region-coordinate management to eliminate clear repeated computation. Then pilot speculative perception in scenarios with stable task patterns and controllable tool costs. Finally, introduce more sophisticated candidate prediction and unified policy optimization.
Throughout, keep two principles: acceleration mechanisms must be switchable off, and evidence chains must remain traceable.
The long-term value of a visual agent lies not in executing more tools, but in obtaining sufficiently reliable evidence with fewer wasted observations. Only when speculative perception, structured intermediate representations, and unified policy optimization all serve this goal can multi-turn visual capability become a stable, controllable technical system with real efficiency gains.
