NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Solve Vision with Code: Coding Agents Are Stronger Visual Reasoners Than Video Models

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 DengarXiv 2026

TL;DR

Can AI solve visual puzzles better by dreaming up pixels or by writing Python scripts? While video generation models are increasingly hyped as "native visual reasoners," this paper pits them head-to-head against off-the-shelf coding agents on a 500-task visual reasoning benchmark. The coding agents don't just win—they blow the best video models out of the water, revealing fascinating echoes of long-standing debates in human cognitive science along the way.

What Problem Does This Paper Address?

Modern video generation models can render stunningly realistic footage, prompting researchers to ask whether they can also act as visual reasoners. If you hand a video model the starting image of a maze and prompt it to "draw the path from start to goal," can it reason through the puzzle purely in pixel space—denoising frame by frame until the solution appears?

Proponents argue this "native" visual route is superior because reasoning unfolds directly in the visual medium rather than being awkwardly translated into text. However, nobody had actually tested this assumption against a symbolic alternative under identical conditions. If the solution to a visual puzzle is a deterministic function of its starting image and prompt, is it more reliable to implicitly hallucinate the pixels, or to explicitly write a program that computes and renders the video?

Methods

The authors set up a strict, controlled change of medium: everything about the input, output format, and evaluation stays identical, changing only how the video gets made.

Overview of the evaluation setup comparing video generation models and coding agents

Instead of feeding the 1024×1024 first frame and prompt into a diffusion model, the authors hand them to off-the-shelf command-line coding agents—specifically three frontier closed-model CLIs (Codex with gpt-6-astra, Claude Code with Fable 5.1, and Gemini CLI with Gemini 3.1 Pro) and 23 open-weight models driven via the OpenCode harness.

Each agent operates inside an isolated CPU-only sandbox preloaded with standard Python imaging and scientific libraries. Under a 30-minute wall-clock limit and with just one attempt per task, the agent writes and executes code to render an .mp4 answer video. Generative image/video APIs are strictly forbidden, and failure to produce a file scores a zero. Both agent-rendered videos and published video-model outputs are graded by the exact same unmodified, rule-based computer vision evaluator.

Finally, to understand how the agents solve problems, the authors run a clever behavioral test: they take every successful program and re-execute it on a different puzzle instance from the same task family to see if the code generalizes.

Datasets

No new datasets were trained on or introduced; evaluation relies entirely on VBVR-Pro-Bench, an existing verifiable benchmark built specifically to test visual reasoning in video models. It contains 500 instances across 100 procedurally generated task families (5 instances each), spanning five cognitive categories: Perception, Abstraction, Knowledge, Transformation, and Spatiality.

Key Insights and Ideas

  • Two distinct modes of code-driven thought: Borrowing from a classic cognitive science debate on human mental imagery, the authors discover agents write two types of code. Depictive programs treat the image like a spatial canvas—filtering colors, measuring widths, and navigating pixel arrays at runtime—meaning the exact same script solves any instance of that puzzle family. Propositional programs happen when the agent figures out the answer during its interactive chat session and simply hard-codes the final coordinates into a rendering script, which fails if run on a new instance.
  • Task nature dictates the reasoning strategy: Agents naturally lean on depictive code for Perception (67%) and Transformation (45%) tasks where spatial measurement is king, but shift toward propositional hard-coding for Abstraction and Knowledge tasks where inferring an abstract rule is easier done "in the agent's head" before rendering.
Breakdown of depictive vs. propositional programs across the five cognitive categories
  • More tool calls ≠ better reasoning: Among top agents, burning more tokens and tool calls doesn't buy higher accuracy—within a single agent's runs, high tool-call counts actually correlate with lower scores, serving as a symptom of the agent struggling on a tough problem rather than thinking more thoroughly.
  • Open-weight models fail on plumbing, not just brains: The weakest open-weight models tank their scores primarily due to delivery failure—responding in plain prose without ever calling a tool, or writing a code skeleton and exiting before running it.

Key Results

Coding agents dominate the leaderboard across every single cognitive category:

  • Closed-model sweep: Codex (0.923), Claude Code (0.894), and Gemini CLI (0.893) claim the top three spots, delivering valid videos on all 500 instances. They beat the strongest video model (VBVR-Pro-Wan2.2-I2V-A14B, scoring 0.670) by more than 0.22 points—even though that video model was explicitly reinforcement-learning trained on the benchmark's own task families!
  • Open-weight surprise: The top open-weight coding agent, GLM-5 (0.572), beats every native video model on the leaderboard except the RL-trained specialist.
  • Massive efficiency gaps: While the top three closed agents score within 0.030 of each other, Codex achieves first place using roughly 3× fewer tool calls and 4× fewer input tokens than Claude Code, and ~8× fewer calls and ~12× fewer tokens than Gemini CLI.
Score vs. mean tool calls per instance across closed and open-weight coding agents

Limitations and Future Work

The authors are upfront about why coding agents enjoy home-field advantage here: VBVR-Pro-Bench puzzles are procedurally generated with flat colors and clean geometry. Writing Python masks to parse clean shapes is vastly easier than manipulating messy, real-world footage with complex lighting, textures, and occlusions where editing pixels without a generative model falls apart. Furthermore, the comparison is computationally asymmetric—agents get 30 minutes of iterative sandbox execution, whereas video models take a single generative pass.

Looking ahead, because the benchmark's evaluator is deterministic, researchers could use it as a verifiable reward to train code-writing policies via reinforcement learning (like GRPO). Other exciting frontiers include testing 3D video-to-video continuation tasks (inferring physics from a clip rather than a single frame) and building hybrid systems that pair a symbolic coding agent's reasoning brain with a generative video renderer's paintbrush.

Summary updated

Abstract

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.
BibTeX
@misc{luo2026solve,
  author = {Dezhi Luo and Fengyuan Yu and Haotian Zhang and Zehong Zhao and Ran Ji and Siyuan An and Huayi Qin and Qingying Gao and Zhongang Cai and Lei Yang and Ziqi Huang and Ruisi Wang and Maijunxian Wang and Hokin Deng},
  title = {{Solve Vision with Code: Coding Agents Are Stronger Visual Reasoners Than Video Models}},
  year = {2026},
  eprint = {2611.34813},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.34813},
}
Figure