MathGen: Revealing the Illusion of Mathematical Competence through Text-to-Image Generation

Ruiyao Liu, Hui Shen, Ping Zhang, Yunta Hsieh, Yifan Zhang, Jing Xu, Qi Han, Junchen Li, Jiawei Lu, Jianing Ma, Jiaqi Mo, Sicheng Chen, Zhen Zhang, Zhongwei Wan, Jing Xiong, Xin Wang, Ziyuan Liu, Hangrui Cao, Ngai WongarXiv 2026

TL;DR

While modern generative models excel at textual mathematical reasoning, a new benchmark called MathGen reveals they suffer from a severe "illusion of competence" when required to render math visually. By introducing a deterministic, script-based evaluation protocol across 420 problems, the authors show that even the best proprietary text-to-image (T2I) models top out at 53.7% accuracy, while open-source alternatives frequently drop to near 0% on precise geometric and functional tasks.

What Problem Does This Paper Address?

Large Language Models (LLMs) can routinely solve competition-level math problems in text, and text-to-image (T2I) diffusion models can generate breathtakingly realistic artwork. However, this paper investigates a critical blind spot at the intersection of these capabilities: Can generative models accurately render mathematical concepts visually?

In textbooks, research papers, and engineering designs, math isn't just text—it relies on precise visual structures like Venn diagrams, geometric proofs, and function plots. Standard T2I evaluation metrics (like CLIP-score or FID) only measure semantic similarity or visual realism, completely missing whether a geometric angle is exactly 45 degrees or if a plot contains the correct number of tick marks. Furthermore, using Vision-Language Models (VLMs) as judges introduces hallucination and unreliability. MathGen addresses this by establishing a rigorous, automated framework to evaluate exact structural and numerical validity.

Table 1: Comparison with existing benchmarks. Prior datasets mainly evaluate visual mathematical under- standing, while MathGen focuses on mathematical image generation with script-based verification.

Methods

To eliminate the subjectivity of human or VLM evaluation, the authors developed a Script-as-a-Judge framework.

Figure 3: Overview of the MathGen benchmark and evaluation pipeline. MathGen evaluates text-to-image models on seven mathematical domains using structured prompts and automatic verification. Generated images are validated against domain-specific structural, geometric, and logical constraints. Each criterion Ci is checked independently, and the final correctness is determined through logical aggregation.

Instead of guessing if an image is correct, the evaluation pipeline uses classical computer vision tools and libraries (such as OpenCV, Pillow, EasyOCR, and NumPy) to programmatically verify pixel-level constraints:

  • Contour analysis for shape extraction and set topology checks.
  • Hough transforms for detecting line intersections in geometry.
  • Optical Character Recognition (OCR) to verify axis labels and text placement.
  • Object detection (RT-DETR) to ensure exact counts for discrete items.

An image is only marked as correct if it simultaneously satisfies every single deterministic constraint defined for that problem.

Datasets

The authors introduced the MathGen benchmark, which consists of 420 curated problems split into two main settings:

  1. Clean-Scene Set (350 problems): 50 problems per domain across seven core mathematical dimensions: Counting, Angles, Fractions, Plane Geometry, Functions, Sets, and Solid Geometry. These focus on pure, textbook-style diagrammatic reasoning.
  2. Open-Scene Set (70 problems): 10 problems per domain, paired directly with Clean-Scene counterparts. These embed the exact same mathematical constraints into complex, real-world contexts (e.g., counting apples on a tree instead of dots on a page) to test how background noise affects performance.
Figure 1: Task taxonomy of MathGen. MathGen covers seven fundamental mathematical domains. Example prompts and reference illustrations are shown to provide an overview of the mathematical concepts evaluated in each domain. They highlight the diverse forms of numerical, geometric, and structural constraints that generative models are required to express, and illustrate the types of visual outcomes expected under correct mathematical interpretation.

Key Insights and Ideas

  • Visual Plausibility $\neq$ Mathematical Fidelity: Models are highly adept at creating images that look like math diagrams at a glance, but completely fail under strict logical scrutiny. They generate the "vibe" of a function plot without drawing the actual mathematical truth.
  • The Quantitative Bottleneck: Error analysis shows that models generally understand qualitative concepts (e.g., they know to draw a pie chart or a group of oranges), but they fail catastrophically at quantitative precision (e.g., drawing exactly 18 oranges or making a slice exactly $1/7$th of a circle).
  • Asymmetric Domain Mastery: Plane geometry is relatively tractable for modern models, likely due to an abundance of simple shapes in training data. Conversely, rendering exact angles and continuous function plots remains incredibly difficult because they require precise coordinate mapping.

Key Results

The benchmark revealed a massive performance gap between proprietary and open-source models, though none achieved reliable competence:

Figure 2: Performance comparison. The chart shows the accuracy of representative open-source and closed- source text-to-image models on each MathGen domain.
  • Closed-Source Performance: Nano Banana Pro led the field with a modest 53.7% overall accuracy, followed by GPT-Image-1.5 at 39.1%.
  • Open-Source Performance: Most open-source models failed entirely, staying below 10% overall accuracy. FLUX-2 was the strongest open-source contender at 11.1%.
  • Domain Breakdowns: On highly structured tasks like Functions and Angles, open-source models frequently scored 0%. Even the advanced GPT-Image-1.5 dropped from 70% on Plane Geometry down to just 20% on Sets and 24% on Angles.
  • Scene Complexity Penalty: Moving from Clean-Scene to Open-Scene caused a sharp drop in accuracy for the best models (e.g., GPT-Image-1.5 plummeted from 38.6% to 18.6%), proving that realistic backgrounds severely interfere with a model's ability to maintain mathematical constraints.

Limitations and Future Work

The authors note that current T2I architectures are fundamentally limited by their continuous diffusion or autoregressive pixel-generation paradigms, which lack explicit mechanisms to handle discrete numerical and geometric constraints.

To bridge this gap, they suggest that future text-to-image systems should integrate autoregressive layout planning or test-time verification loops—essentially giving the model a way to plan the mathematical structure of an image before rendering the pixels.

Summary updated

BibTeX
@misc{liu2026mathgen,
  author = {Ruiyao Liu and Hui Shen and Ping Zhang and Yunta Hsieh and Yifan Zhang and Jing Xu and Qi Han and Junchen Li and Jiawei Lu and Jianing Ma and Jiaqi Mo and Sicheng Chen and Zhen Zhang and Zhongwei Wan and Jing Xiong and Xin Wang and Ziyuan Liu and Hangrui Cao and Ngai Wong},
  title = {{MathGen: Revealing the Illusion of Mathematical Competence through Text-to-Image Generation}},
  year = {2026},
  eprint = {2603.27959},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2603.27959},
}
Figure