Solve Vision with Code: Coding Agents Are Stronger Visual Reasoners Than Video Models
Authors: Dezhi Luo, Fengyuan Yu, Haotian Zhang, Zehong Zhao, Ran Ji, Siyuan An, Huayi Qin, Qingying Gao, Zhongang Cai, Lei Yang, Ziqi Huang, Ruisi Wang, Maijunxian Wang, Hokin Deng
Organizations: University College London · Nanyang Technological University · University of Southern California · University of California, San Diego · Carnegie Mellon University · Johns Hopkins University · Chinese University of Hong Kong · University of California, Berkeley
Video generation models are increasingly evaluated as visual reasoners: given a first frame and a natural-language prompt, can the model produce the video in which the specified task is carried out? The paradigm is considered advantageous because the reasoning is native to the visual medium, unfolding directly in the frames rather than through language or code. Whether this native route is in fact the more reliable path to visual reasoning has not been tested against a symbolic alternative under the same conditions. We therefore pose the same tasks, with identical inputs, output specification and evaluator, to both media: rather than denoising pixels, a coding agent writes a program that renders the answer video, which an unmodified rule-based evaluator scores. On VBVR-Pro-Bench (Xu et al., 2026), a 500-instance suite spanning five cognitive categories with symbolic ground truth, the agent receives the same first frame and prompt as the video model, with no access to ground truth, metadata or generation models, and one attempt per instance. Three closed-model agents (Codex with gpt-6-astra, Claude Code with Fable 5.1 and Gemini CLI with Gemini 3.1 Pro) score 0.923, 0.894 and 0.893, each more than 0.22 above the strongest video model. Among 23 runnable open-weight models, the best, GLM-5, reaches 0.572, above all video models except the RL-trained one. Together, we show that for tasks whose solutions can be computed from a first frame and a prompt, program synthesis is currently a substantially more reliable route to visual reasoning than video generation. We further distinguish depictive programs, which navigate the image to recover a transferable scheme, from propositional programs, which operate on hard-coded values, revealing how visual reasoning unfolds in agent-written programs and what it implies for its nature of reasoning in general.
Figures & tables
Figure 1: Coding agents as visual reasoners. Given the same first frame and prompt, a video generation model denoises the answer video directly, whereas a coding agent writes and executes a program that renders it. Both outputs share one video format and are scored by the same unmodified official evaluator, which compares them against symbolic ground truth using classical computer vision. The coding agent outperforms the best video model overall. The two solutions to one sequence task illustrate how the agents differ: Claude Code navigates the image to recover a transferable scheme (depictive), whereas Codex resolves the specific visual problem by hard-coding the answer it identified for that instance (propositional).
Agent (CLI)
Version
Model
Codex CLI ( OpenAI, 2026 )
0.154.0
gpt-6-astra
Claude Code ( Anthropic, 2026 )
2.1.268
Claude Fable 5.1 (Amazon Bedrock)
Gemini CLI ( Google, 2026 )
0.59.0
gemini-3.1-pro-preview
Table 1: The three closed-model coding agents, each the vendor’s own CLI run in non-interactive mode with approvals bypassed.
Rank
System
Score
Videos
Rank
System
Score
Videos
Coding agents, closed models
Coding agents, open-weight models (cont.)
1
Codex (gpt-6-astra)
0.923
500
30
Nemotron Nano 3 30B
0.028
91
2
Claude Code (Fable 5.1)
0.894
500
31
Qwen3-VL-235B-A22B
0.025
70
3
Gemini CLI (Gemini 3.1 Pro)
0.893
500
32
Qwen3-32B
0.004
25
Coding agents, open-weight models (OpenCode)
33
Llama 4 Maverick
0.001
7
5
GLM-5
0.572
495
34
Gemma 3 27B
0.000
0 †
Table 2: VBVR-Pro-Bench leaderboard, 100 task families × 5 instances, for coding agents and video models. All videos are scored by the unmodified official evaluator; the score is the mean over all 500 instances, and an instance without a video scores 0. Coding-agent rows are our runs (one attempt per instance, sandboxed, no image or video generation model); video-model rows are the published VBVR-Pro leaderboard numbers ( Xu et al., 2026 ) , not rerun. Rank is the position among all 37 systems. Videos is the number of instances, out of 500, for which the agent wrote a video (— for video models, which we did not run). The best coding agent and the best video model are shaded. † No video in any attempt (the model never calls a tool).
System
Abstraction
Perception
Spatiality
Transformation
Knowledge
Overall
Families per label
(25)
(39)
(17)
(19)
(20)
(100)
Coding agents, closed models
Codex (gpt-6-astra)
0.964
0.942
0.903
0.908
0.872
0.923
Claude Code (Fable 5.1)
0.828
0.934
0.901
0.933
0.851
0.894
Gemini CLI (Gemini 3.1 Pro)
0.887
0.960
0.816
0.884
0.850
0.893
Coding agents, open-weight models (OpenCode)
Table 3: Score by task category for the three closed-model agents and the eight best open-weight models over all 500 instances, with the kit’s label weighting (a family with k labels counts 1/k toward each; number of families carrying each label in the second header row; best per column among the agents in bold, second underlined). The last row is the best video model: its category scores are VBVR-Pro’s published per-split category scores ( Xu et al., 2026 , Table 4) combined with the same weights (inputs rounded to three decimals), and its Overall is the published leaderboard score.
Figure 2: Score against tool calls per instance.
Figure 3: Share of programs classified as depictive (blue) and propositional (red) by task category, for the closed-agent programs that solve their own instance. Classification is behavioural: each program is re-executed on a different instance of the same task family. A program is depictive if its answer follows the new input (it scores as well as before, or fails while measuring the new frame), and propositional if it runs but draws the same, now-incorrect answer, judged by the overlap of the region it changes in the final frame on the two instances. The grey band marks programs that fall between the two: they transfer only part of their answer, or draw a different but incorrect one. A task family that carries two category labels is split equally between them, and one with three labels is split three ways, as in Table 3 .
Figure 4: Depictive and propositional programs on the same instance of G-131. (a) The input frame shared by both agents. (b) Claude Code (depictive): the program measures the circle widths, computes the constant difference and evaluates the candidates at run time. (c) Codex (propositional): the correct candidate is identified in the session, and the program only renders and highlights it. Both agents select the same candidate and obtain the same score.
Appendix figures & tables5 assets
Supplementary material from the paper’s appendix.
Appendix
Agent
Score
Videos
Tool use
Calls
Median s
In (k)
Out (k)
Timeouts
Codex (gpt-6-astra)
0.923
500
1.00
3.2
22
57
1.2
0
Claude Code (Fable 5.1)
0.894
500
1.00
9.2
105
233
7.3
0
Gemini CLI (Gemini 3.1 Pro)
0.893
500
1.00
25.3
218
659
7.5
0
GLM-5
0.572
495
1.00
48.0
378
1569
16.3
12
Kimi K2.5
0.557
498
0.99
41.9
336
1213
19.2
0
MiniMax M2.5
0.451
488
0.99
45.7
420
1295
19.8
0
Appendix
Table 4: Cost of solving an instance for the three closed-model agents and the six highest-scoring open-weight models. Values are means over the 500 instances computed from each agent’s own event log, except run time, which is the median in seconds. Tool use is the fraction of instances in which the agent made at least one tool call, input and output tokens are given per instance in thousands, and timeouts are instances terminated at the 1,800 s time limit; a video written before the limit is still scored. All agents that produced a video appear in Figure 2 . Claude Code’s token counts cover the main model only; the auxiliary Sonnet 5 calls add 0.6%.
Task
Generator
Split
Category
Codex
Claude Code
Gemini CLI
G-3
stable_sort
ID
Perception
1.000
1.000
1.000
G-5
multi_object_placement
ID
Transformation
1.000
1.000
1.000
G-8
track_object_movement
ID
Spatiality
1.000
1.000
1.000
G-9
identify_objects_in_region
ID
Perception
0.898
0.938
0.627
G-13
grid_number_sequence
ID
Spatiality
1.000
1.000
1.000
G-15
grid_avoid_obstacles
ID
Spatiality
0.414
0.805
0.609
Appendix
Table 5: Per-task scores of the three closed-model coding agents on VBVR-Pro-Bench. Each entry is the mean official-evaluator score over the five instances of the task, an instance without a video counts 0, and the best of the three is in bold; the overall means match Table 2 . In-Domain tasks (50) have training data in VBVR-Pro; Out-of-Domain tasks (50) are held out from all training.
Figure 5: Mean tool calls per instance, decomposed by capability, for the three closed agents across the five task categories. Each panel corresponds to one agent, with stacked bars partitioning its tool calls into pixel probing, image viewing, code authoring, output checking and all other operations. The within-agent composition of tool use changes relatively little across task categories, whereas the overall interaction profiles differ substantially between agents, forming distinct behavioural fingerprints.
Figure 6: The Codex program for G-161 (mark second largest shape, out-of-domain, instance 00000; 2 tool calls, score 1.0), trimmed to the lines discussed in the text, with the task’s first frame, the last frame it renders, and the last frame the same program renders when re-executed on instance 00001, which has four circles instead of three.
Figure 7: The Codex program for G-13 (grid number sequence task, instance 00000; 3 tool calls, 20 s, score 1.0), shown alongside the task’s first frame and the final frame it renders. The nine corner cells of the route are written into the program as literals derived from the agent’s visual reading of the image, with each leg annotated by its Manhattan length. The sprite is erased from its starting cell and re-stamped pixel-for-pixel at each interpolated position along the route, leaving the board itself unchanged throughout the video.
Code-driven video generation asks a coding agent to write and run rendering programs. This gives exact control over typography, data visualizations, synchronized audio, and multi-shot scenes, and it leaves an editable project behind. A program that exits cleanly can still render overlapping labels, a camera aimed away from its subject, broken object interactions, or narration that drifts out of sync, and none of these raise a runtime error. Feeding rendered frames and audio back into the coding session bloats its long-horizon context, while critiquing only the finished full-resolution render turns early design mistakes into costly rewrites. We introduce VibeVideoAgent, a training-free framework that lets coding agents inspect their drafts throughout production. Multimodal perception runs in short-lived contexts kept apart from the coder and returns compact, grounded Findings. Seven primitives operate on a unified multi-clock representation of assets and drafts: they explore media from coarse to fine, verify quoted requirements with evidence from every required modality, compare a draft with a reference or an earlier revision on separate clocks, and measure stream signals locally. A lightweight staged protocol has the agent test its riskiest decision on a minimal preview first. On all 239 VibeVideoBench tasks, with matched agent runtimes and a fixed perception model, VibeVideoAgent improves holistic audiovisual quality (L3) for Claude Opus 5.5 (4.03 -> 4.43, while L2 rubric compliance rises from 98.87% to 99.35%), GPT-6 Astra (4.03 -> 4.27), and Claude Sonnet 5.5 (3.97 -> 4.10), with the largest gains in audio-visual synchronization (up to +0.56). Controlled ablations show that each component contributes, and trajectory audits show that the granularity of code edits governs the trade-off between rubric adherence and perceptual quality.
Diffusion video models produce striking clips, but they cannot reliably render an exact formula, a correct chart, a rule-consistent game or narration synchronized to on-screen events. A different route is emerging: multimodal agents that write code to render every frame and synthesize every sound. We introduce VibeVideoBench, a benchmark for evaluating agents on code-driven video generation. Its 239 self-contained tasks in English and Chinese span 12 categories, from data stories and music-driven pieces to classroom lessons and paper explainers; each asks an agent, running in its native harness inside a sandbox with no image or video generation model, to deliver a finished MP4 with sound within one hour. Evaluation is hierarchical and evidence-based: program checks of the delivery spec, about 13k task-specific rubric checks traced to the requirements they enforce, and five quality dimensions anchored per task, scored by three VLM judge panels. Across nine frontier agent systems and 2,151 scored rollouts, GPT-6 Astra and Claude Opus 5.5 rank first and second with both the judges and human annotators, and the strongest system satisfies every core requirement on 76.3% of tasks. Delivery is a second axis: counting missing videos as zero changes the ranking, and three quarters of the lost videos are final renders that started too late, ran too slowly or never started, a failure of how agents plan their hour. Agents build their own rendering pipelines and inspect their own frames, yet how much they look does not predict quality. The judges' ranking of the systems closely matches blind human preferences.
Recent studies suggest that video generation models can exhibit certain forms of zero-shot visual reasoning through generated frames. Yet reliable evaluation remains challenging: benchmarks should adopt inputs aligned with the visual priors of current video models, require valid evolving processes rather than only plausible final states, and calibrate task difficulty to remain challenging yet partly feasible. To this end, we introduce VGI-bench, containing 27 tasks and 810 instances, organized by a two-level taxonomy of task domains and skill tags for fine-grained evaluation of visual reasoning capabilities of video generation models. Our evaluations show that current generative systems can solve a subset of visually grounded reasoning tasks, but remain far from reliable, with even the strongest model, Seedance 2.0, achieving only 51.0% under our evaluation criteria. Our analysis further explore the output failure modes, input condition sensitivity, performance transfer boundary from synthetic fine-tuning, and internal denoising perspective revealing limited self-correction, where later steps mainly refine early hypotheses rather than correct reasoning errors. We hope VGI-bench will help stimulate the development of next-generation video generation models. Website: https://hexuan21.github.io/VGI-Bench/
Xuan He, Cong Wei, Yuhao Cheng +20
University of Illinois Urbana Champaign · University of Waterloo · Vector Institute +6