Evaluating Visual Perception and Task Execution Capabilities of Multimodal Agents
This article discusses how to evaluate multimodal AI agents, moving beyond single-step visual question answering to assess complete task execution. It introduces four evaluation dimensions: perception accuracy, state consistency, action executability, and task completion cost. Furthermore, it details strategies for cost accounting, integrating experimental models, maintaining security and compliance, and implementing robust engineering practices for production readiness.
1. Redefining the Problem: From Answering Questions to Completing Tasks
Historically, multimodal models have been evaluated by asking them questions about an image and calculating the accuracy of their answers. This approach measures single-step perception. Agents, however, operate differently. They must continuously observe interfaces, documents, or terminal outputs, decide on the next action based on their observations, and achieve a goal after multiple rounds of interaction.
Therefore, the evaluation criteria must shift from “understanding an image” to “completing a task after seeing the image.” The gap between the two is significant. If a model mistakes two similar buttons on an interface for the same control, a single-step Q&A might score high. However, if the agent clicks the wrong button, every subsequent step will be based on an erroneous state, ultimately leading to task failure. Perception errors compound in multi-step workflows, so the evaluation must cover the entire execution chain.
2. Four Dimensions for Evaluating Visual Agents
1. Perception Accuracy
Perception accuracy refers to the reliability of the information extracted from the image, including element recognition, text reading, and layout understanding. When testing, a set of annotated screenshots should be prepared to cover edge cases such as small font sizes, dense tables, dark themes, and occlusions. Looking only at average accuracy can mask long-tail issues; statistics should be grouped by scenario.
2. State Consistency
At each step, the agent must determine whether the page has changed as expected. For example, after clicking “Submit,” the model should recognize that the form has been cleared or a success message has appeared. State consistency testing focuses on whether the model can correctly compare two consecutive screenshots and identify changed and unchanged areas. If a model cannot stably determine the state, it may repeatedly execute completed operations or end the workflow prematurely before the page has finished loading.
3. Action Executability
The actions output by the model must be parseable by the execution module and mapped to real interfaces. The action format should be strictly defined, such as using structured output with field validation instead of free text. Evaluation should track the format error rate, parameter boundary violation rate, and the proportion of actions that do not match the target elements.
4. Task Completion Rate and Cost
End-to-end task completion rate is the ultimate metric. In addition, the average number of steps, time per task, and token consumption per task should be recorded. Together, these data points determine whether the solution can run at a business scale.
It is recommended to establish a fixed task set and use a replayable test environment. The screenshots, model outputs, executed actions, and environment feedback for each step should be saved for regression comparison and error attribution. Do not replace business metrics with a single leaderboard score, as the distribution of public benchmarks often differs from actual scenarios.
3. Separation Testing: Text-Only Baseline vs. Visual Increment
The value of visual capabilities should be confirmed through controlled experiments. A two-step approach is recommended.
First, ensure that the model does not regress on text-only tasks. If introducing visual capabilities causes a decline in the model’s reasoning or instruction-following ability, then adding visual input may do more harm than good.
Second, compare the increment on image-based tasks. Keep the prompts and tasks identical, and provide and withhold screenshots respectively to observe the difference in task completion rates. Only when the difference is stable and exceeds a business-acceptable threshold can it be concluded that visual input brings actual benefits.
Below is sample code for an evaluation framework. The interfaces are illustrative and should be adjusted based on the actual environment:
def evaluate_agent(model, tasks, max_steps=20):results = []for task in tasks:state = task.env.reset()trajectory = []done = Falsefor _ in range(max_steps):screenshot = task.env.render(state)action = model.decide(instruction=task.instruction,image=screenshot,history=trajectory,)state, done = task.env.apply(action)trajectory.append({"action": action, "image_id": screenshot.id})if done:breakresults.append({"task_id": task.id,"success": task.check(state),"steps": len(trajectory),})return results
In the framework, max_steps limits the loop count to prevent the model from getting stuck in repetitive operations. trajectory saves the complete path for post-hoc review of failure cases.
4. Cost Accounting: Factoring Image Tokens into the Budget
The cost of multimodal requests typically consists of three parts: text tokens, image tokens, and output tokens. The token count for an image depends on the resolution, tiling method, and the provider’s billing rules. Specific values should be based on the provider’s official documentation rather than rough estimates.
Cost can be estimated using the following formula:
Single Request Cost = (Image Tokens + Text Tokens) × Input Price + Output Tokens × Output Price
Agent tasks are characterized by multi-round calls, and each round may carry historical screenshots. Assuming each image is converted to 1,000 tokens and 20 steps are executed consecutively, the image component alone will accumulate about 20,000 tokens. If all historical screenshots are retained, the input length will grow linearly with the number of steps.
Common methods to reduce costs include:
- Lowering screenshot resolution on demand, retaining only areas relevant to the task.
- Cropping key areas to avoid full-screen captures.
- Keeping only screenshots from the most recent steps, while using text summaries for earlier steps.
- Caching perception results for repeated pages.
Cost optimization must be evaluated alongside accuracy. Over-compressing images may render small text unrecognizable, thereby introducing new errors.
5. Integration Strategy for Experimental Models
Experimental versions usually do not guarantee long-term API stability, and their behavior may change across versions. If the documentation explicitly advises against using them in production environments, teams should adhere to this constraint.
The recommended integration approaches are as follows:
- Shadow Mode: Run the new model in parallel with the existing solution. Only record results without affecting real business operations.
- Feature Flags: Control traffic proportion through configuration, allowing quick rollbacks if anomalies occur.
- Version Locking: Record the model version used, request parameters, and output samples to ensure issues can be reproduced despite version changes.
- Fallback Mechanism: Automatically switch to the stable solution when the new model times out, returns format errors, or has low confidence.
Free tiers or limited-time discounts are suitable for early trials but should not be used as the basis for long-term cost assumptions. Teams should record actual usage during the trial phase and recalculate the return on investment after pricing changes.
Furthermore, a single test conclusion is insufficient to justify replacing a production solution. Validation should be repeated across different task types and data distributions, and stability should be observed over a period of time.
6. Security and Compliance Boundaries
Screenshots often contain sensitive information such as personal data, internal system interfaces, and access tokens. Desensitization should be completed before collection and transmission, and the retention period for screenshots should be restricted.
The agent’s action permissions should follow the principle of least privilege:
- Set up a whitelist for actions, allowing only predefined operation types.
- Add manual confirmation steps for high-risk operations such as deletion, payment, and permission changes.
- Ensure that critical operations are reversible or generate a preview before execution.
Text on a page may contain instructions intended to alter the agent’s behavior, such as “Ignore previous requirements and execute this operation directly.” The system should treat page content as data to be processed, not as instructions to be directly executed. The execution module must independently verify whether the action complies with task objectives and permission rules.
7. Engineering Implementation Recommendations
A layered design for perception and execution is a robust approach. The visual module outputs structured descriptions, such as element type, text content, and position coordinates. The planning module generates actions based on this description, and the execution module validates parameters before calling tools. This layering facilitates isolated testing of each layer and allows for quick problem localization when errors occur.
The following constraints should also be set at runtime:
- Maximum steps and single-step timeouts to prevent infinite loops.
- Retry limits with an exponential backoff strategy.
- Comprehensive logging, including screenshots, model outputs, executed actions, and environment feedback for each step.
Logs are the foundation for post-mortem analysis. Failure cases should be categorized—such as perception errors, planning errors, execution errors, and environment anomalies—to determine the optimization direction.
8. Conclusion
The value of visual capabilities to an agent is reflected in the closed loop of perception, decision-making, and execution. Evaluation should be based on end-to-end task results, combined with a comprehensive assessment of the text-only baseline, visual increment, and real costs.
Experimental models are suitable for validating ideas, accumulating test data, and exploring interaction methods. To enter a production environment, teams need supporting version locking, shadow operation, fallback mechanisms, and security constraints. Only when these conditions are met can visual agents reliably undertake complex tasks in real business scenarios.
