cs.AIApr 7, 2026

OmniDiagram: Advancing Unified Diagram Code Generation via Visual Interrogation Reward

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

Organizations: Institute of Automation, Chinese Academy of Sciences · University of Chinese Academy of Sciences · Zhejiang University

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 (Viva). Unlike brittle syntax-based rules or pixel-level matching, Viva rewards the visual structure of rendered diagrams through a generative approach. Specifically, 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 M32^2Diagram, the first large-scale diagram code generation dataset, containing over 196k high-quality instances. Experimental results confirm that the combination of SFT and our Viva-based RL allows OmniDiagram to establish a new state-of-the-art (SOTA) across diagram code generation benchmarks.

Figures & tables

Appendix figures & tables15 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. Visual-ERM: Reward Modeling for Visual Equivalence

    Mar 13, 2026Ziyu Liu, Shengyuan Ding, Xinyu Fang +7Reward ModelingRL for VLMs

  2. Feynman: Knowledge-Infused Diagramming Agent for Scalable Visual Designs

    Mar 13, 2026Zixin Wen, Yifu Cai, Kyle Lee +5Synthetic Data GenerationTool-Using Vision-Language Agents

  3. UniCoder: Unified Visual-to-Code Generation via Symbolic Rewards and Reference-Guided Code Optimization

    Jun 30, 2026Yaozhi Zheng, Yilei Jiang, Manyuan Zhang +5RL for Code GenerationReinforcement Learning