# OmniDiagram: Advancing Unified Diagram Code Generation via Visual Interrogation Reward

Source: [OmniDiagram: Advancing Unified Diagram Code Generation via Visual Interrogation Reward](<https://www.sota2.com/research/paper/69d5e0f77d0172140ec75985>)

Collection index: [llms.txt](<https://www.sota2.com/research/llms.txt>)

Data updated: 2026-04-09T05:00:04.534Z

Authors: Haoyue Yang, Xuanle Zhao, Xuexin Liu, Feibang Jiang, Yao Zhu

Published: 2026-04-07T07:10:24.000Z

## Abstract

The paradigm of programmable diagram generation is evolving rapidly, playing a crucial role in structured visualization. However, most existing studies are confined to a narrow range of task formulations and language support, constraining their applicability to diverse diagram types. In this work, we propose OmniDiagram, a unified framework that incorporates diverse diagram code languages and task definitions. To address the challenge of aligning code logic with visual fidelity in Reinforcement Learning (RL), we introduce a novel visual feedback strategy named Visual Interrogation Verifies All (\\textsc{Viva}). Unlike brittle syntax-based rules or pixel-level matching, \\textsc{Viva} rewards the visual structure of rendered diagrams through a generative approach. Specifically, \\textsc{Viva} actively generates targeted visual inquiries to scrutinize diagram visual fidelity and provides fine-grained feedback for optimization. This mechanism facilitates a self-evolving training process, effectively obviating the need for manually annotated ground truth code. Furthermore, we construct M3$^2$Diagram, the first large-scale diagram code generation dataset, containing over 196k high-quality instances. Experimental results confirm that the combination of SFT and our \\textsc{Viva}-based RL allows OmniDiagram to establish a new state-of-the-art (SOTA) across diagram code generation benchmarks.

## Recorded benchmark results

A research result applies to its stated dataset, split, metric and evaluation configuration. Compare like-for-like settings, preserve the metric's unit and direction, and distinguish paper-reported results from independent reproduction. The best result recorded here is not a claim of exhaustive, current global coverage.

- [Diagram-to-Code on M3²Bench](<https://www.sota2.com/research/sota/diagram-to-code-on-m3-bench.md>): Diagram-to-Code; M3²Bench; Execution Rate: 94.3.

- [Diagram-to-Code on CoSynDiagram](<https://www.sota2.com/research/sota/diagram-to-code-on-cosyndiagram.md>): Diagram-to-Code; CoSynDiagram; Exec (%): 96.

- [Diagram Editing on M3²Bench](<https://www.sota2.com/research/sota/diagram-editing-on-m3-bench.md>): Diagram Editing; M3²Bench; Execution Rate: 75.5.

- [Text-to-Code on M3²Bench](<https://www.sota2.com/research/sota/text-to-code-on-m3-bench.md>): Text-to-Code; M3²Bench; Execution Rate (%): 90.3.

- [Text-to-Code on VisPlotMermaid](<https://www.sota2.com/research/sota/text-to-code-on-visplotmermaid.md>): Text-to-Code; VisPlotMermaid; Execution Success Rate: 88.6.

## Original sources and implementation

[Original paper](<https://arxiv.org/abs/2604.05514>)

[PDF](<https://arxiv.org/pdf/2604.05514.pdf>)
