PRISM: A Benchmark for Long-Horizon Programmatic Spatial Reasoning

Qiran Zhang, Yuheng Wang, Runde Yang, Lin Wu, Jingru Fan, Shu Yao, Jie Zhang, Tianle Zhou, Huatao Li, Ruijie Shi, Yihan Li, Chen QianNeurIPS 2026 Evaluations and Datasets Track Poster 2026

TL;DR

When AI models generate educational videos by writing animation code (like Python’s Manim), their scripts often run without a single error—yet the resulting video is a visual mess of overlapping text and off-screen diagrams. PRISM introduces a massive bilingual benchmark of 10,372 instruction-code pairs to test whether LLMs can actually plan and maintain clean 2D spatial layouts over long animations. Evaluating seven top models reveals a striking 41-percentage-point "Execution-Spatial Gap": runnable code is nowhere near enough to guarantee a coherent video.

What Problem Does This Paper Address?

If you ask a pixel-level diffusion model to generate a math tutorial video, you get photorealistic textures—and garbled equations. Programmatic video generation sidesteps this by having an LLM write code (e.g., in Manim) that explicitly defines objects, coordinates, and motion.

The catch? Existing benchmarks for visual code generation mostly test static, single-frame outputs like charts or webpages, or rely on tiny datasets. Worse, standard evaluation metrics either check if the code runs (ignoring whether the video looks broken) or use Vision-Language Models (VLMs) as coarse judges, which often miss brief layout collisions or text drifting out of frame. There has been no rigorous way to measure whether an LLM can maintain spatial sanity across a multi-step, evolving animation.

Methods

The authors build a funnel-style evaluation framework that grades generated animations in stages, moving from basic code health to fine-grained visual geometry:

Figure 4: Funnel-style evaluation framework. From Code-Level Reli- ability to Spatial Reasoning, and to PADVC/TD diagnostic dimensions.
  1. Code-Level Reliability (The Outer Gate): Checks if the script renders a complete video on the first try (pass@1), logs render time, and sorts failures into six buckets (such as API hallucination, API misuse, or LaTeX/text-rendering errors).
  2. Spatial Reasoning (The Core Metric): Instead of relying on a VLM to squint at the video, the authors instrument Manim’s rendering engine directly. They parse the scene graph at action-synchronized snapshots to deterministically catch three failure modes: Layout Overlap (unintended collisions), Out-of-Bounds (OOB) (elements clipped by the screen edge), and Layout Leakage (e.g., text escaping its bounding box).
  3. PADVC & TD (Diagnostic Dimensions): Prompt-Aware Dynamic Visual Complexity (PADVC) measures whether the animation uses meaningful geometric motion rather than acting like a static slideshow, while Temporal Density (TD) tracks the overall rate of frame-to-frame visual change.

Datasets

PRISM contains 10,372 human-calibrated instruction-code pairs—roughly 20× larger than prior programmatic video benchmarks—split evenly between English (5,199) and Chinese (5,173) across 437 subject categories.

Figure 2: Data overview of PRISM and aggregate model capability on the benchmark. Left: multi-level subject coverage and examples. Right: direction-normalized visualization scores: each axis is min–max normalized across models within each language, reversed for lower-is-better axes, mapped to [0.18,0.88], and averaged over EN/ZH.

To build it, the team started with over 30,000 raw candidates grounded in real educational outlines (averaging 93 lines of code and 62 API calls per script). They filtered this pool using deterministic geometry checks, calibrated edge cases against 3,000 expert-annotated examples, and performed human spot-checks for pedagogical alignment.

Key Insights and Ideas

  • The Execution-Spatial Gap: Across all models, the average drop from execution success rate to spatial pass rate is 41.24 percentage points. A model can be a fluent Manim coder and still fail miserably at 2D layout planning.
  • More Motion, More Problems: High dynamic complexity (PADVC) correlates with spatial failure. Models that try to be overly ambitious with animations often exhaust their spatial budget and trigger overlaps or out-of-bounds errors.
  • Extended "Thinking" Doesn't Fix Spatial Blindness: Enabling reasoning/thinking modes in models like Claude Sonnet 4.6 and GLM-5 produced inconsistent results—sometimes enlarging text or pushing elements off-screen—suggesting that spatial planning, not general reasoning, is the true bottleneck.
  • It’s Not Just a Manim Quirk: A cross-renderer check using Remotion (a React-based video framework) showed the exact same Execution-Spatial Gap (e.g., 84 percentage points for GPT-5.4), proving the problem is fundamental to how LLMs reason about space without seeing the rendered output.

Key Results

Models were evaluated on a 20% subset (1,041 English and 1,009 Chinese prompts) at temperature 0.7:

  • Best Spatial Planner: Gemini 3.1 Pro Preview led the pack on Spatial Pass Rate (0.572 EN / 0.557 ZH) and achieved the lowest overlap, leakage, and out-of-bounds rates.
  • Best Coder, Risky Layouts: GPT-5.4 topped Execution Success (0.945 EN / 0.902 ZH) and dynamic richness (PADVC), but its Spatial Pass Rate plummeted to 0.308 (EN) and 0.177 (ZH) due to frequent overlaps and out-of-bounds elements.
  • Open-Source Standout: GLM-5 was the most balanced open-source model (Spatial 0.341 EN / 0.340 ZH), outperforming Claude Sonnet 4.6 on spatial pass rate in both languages.

Limitations and Future Work

Because PRISM’s spatial auditor relies on deterministic scene-graph parsing, it is currently anchored to Manim CE v0.19.0 (though the authors show the evaluation concepts generalize to Remotion). The authors also note that simply adding stricter layout instructions to prompts does not reliably close the Execution-Spatial Gap. Future work points toward training or equipping LLMs with better internal spatial world models—or closed-loop visual feedback—so they can "see" and correct their layouts before finalizing code.

Summary updated

BibTeX
@inproceedings{zhang2026prism,
  author = {Qiran Zhang and Yuheng Wang and Runde Yang and Lin Wu and Jingru Fan and Shu Yao and Jie Zhang and Tianle Zhou and Huatao Li and Ruijie Shi and Yihan Li and Chen Qian},
  title = {{PRISM: A Benchmark for Long-Horizon Programmatic Spatial Reasoning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=XbNjlZYLho},
}
Figure