TL;DR
While text-to-image (T2I) models excel at creating artistic imagery, they frequently fail at tasks requiring precise numerical and relational reasoning, such as generating educational math visuals. This paper introduces E2V-Bench, a benchmark designed to evaluate the "equation-to-visual" generation task across four pedagogically grounded visual types. The authors demonstrate that current T2I models struggle significantly with this task, but can be substantially improved using benchmark-guided enhancement strategies like prompt refinement and rejection-sampling fine-tuning.
What Problem Does This Paper Address?
In early primary education (Grades 1–3), visual scaffolding is essential for helping children transform abstract mathematical symbols into intuitive concepts. For example, visualizing "6 + 7 = 13" using distinct groups of objects helps build foundational arithmetic skills. However, manually creating these tailored visuals is incredibly time-consuming for educators.
While modern generative AI models seem like the perfect tool to automate this process, they suffer from a well-known flaw: they cannot reliably count or arrange objects according to strict logical rules. If a teacher asks for "6 red balloons and 7 blue balloons," a model might generate 5 red ones or mix up the colors entirely. This paper formalizes the task of Equation-to-Visual (E2V) generation to bridge the gap between open-ended image generation and the strict structural accuracy required by educational tools.
Methods
To systematically address and evaluate the E2V task, the authors developed a multi-step framework:
- Domain-Specific Language (DSL): The authors formalized equation-visual pairs into a structured DSL that explicitly defines the visual type, object categories, counts, and grouping attributes (e.g., color, spatial position, or container membership).
- Standardized Equation-to-VD Layer: Because directly prompting T2I models with symbolic equations (like
6+7=13) results in stylized text renderings rather than conceptual visuals, the authors introduced an intermediate step. An LLM verbalizes the equation into a detailed Visual Description (VD), which then serves as the prompt for the T2I model. - Deterministic Evaluation Pipeline: Instead of relying on unreliable vision-language models (VLMs) to judge correctness, the authors built a rule-based evaluation pipeline. It uses CountGD for open-world object detection, combined with OpenCV and Scikit-Learn to programmatically verify spatial clustering, color distributions, and containment boundaries against the ground-truth DSL.
- Enhancement Strategies: The authors explored two main pathways to improve open-source models:
- For Layout-to-Image Models (LMD): They introduced prompt refinement (forcing the model to plan the scene before predicting bounding boxes) and an automated rule-based regeneration loop to catch layout errors before final image synthesis.
- For Transformer/Diffusion Models (Bagel): They utilized Supervised Fine-Tuning (SFT) on curated data, synthetic data augmentation with style conversion, and Rejection-Sampling Supervised Fine-Tuning (RSFT).
Datasets
The authors introduced and utilized several key datasets:
- E2V-Bench: The core benchmark containing 1,484 VDs derived from 371 unique arithmetic equations covering addition, subtraction, multiplication, and division with quantities up to 20. It is evenly split across four visual types: Color-based, Object-based, Spatial-based, and Container-based.
- Curated Training Dataset: A high-quality dataset of 1,055 image-VD pairs, filtered using their automatic metrics from generations produced by the best-performing closed-source model.
- Real-World Validation Dataset: A manually curated set of 182 authentic educational visuals collected from primary school textbooks and online learning platforms to validate the benchmark's real-world relevance.
Key Insights and Ideas
- The "Quantity Wall": Model performance drops precipitously as object counts increase. While models perform decently when handling 1–5 objects, accuracy plummets by more than half when moving to the 6–10 range, driven almost entirely by counting errors.
- Layout Priors Provide Stability: Layout-to-image models (like LMD) that explicitly generate bounding boxes before rendering pixels show much more stable performance across higher object counts compared to pure end-to-end diffusion models.
- The Synthetic Distribution Gap: Directly fine-tuning a model on clean, icon-based synthetic images fails because of the massive style mismatch. Introducing an intermediate style conversion step (aligning synthetic data with the model's native distribution) is crucial to making structured training data effective.
Key Results
- Baseline Deficiencies: Even the strongest closed-source model evaluated (GPT-Image-1) only achieved an overall accuracy of 21.3% on realistic visuals. Open-source baselines like Flux.1-dev and Bagel hovered under 7% accuracy.
- LMD Improvements: Applying prompt refinement and automatic layout regeneration to the LMD framework raised its overall accuracy from 12.0% to 15.3%, significantly reducing bounding box and formatting errors.
- Bagel Optimization: The full enhancement pipeline (SFT + Style-Converted Synthetic Data + RSFT) boosted the Bagel model's overall accuracy from 5.7% to 14.7%.
- Feasibility Proof: A programmatic, DSL-based reference renderer achieved 98.3% accuracy, proving that the benchmark's constraints are entirely solvable given perfect structural execution.
Limitations and Future Work
- Scope Constraints: The benchmark is strictly limited to early primary arithmetic (quantities $\le$ 20, basic operations). It does not yet cover complex concepts like fractions, negative numbers, ratios, or multi-step equations.
- Visual Diversity: The framework currently models four primary visual types, leaving out other common pedagogical tools like number lines, bar models, or pie charts.
- Downstream Impact: The evaluation focuses purely on foundational visual accuracy. Future work is required to conduct human-centered studies measuring actual student learning outcomes and classroom efficacy.
Summary updated