🤖 AI Summary
Existing models struggle to simultaneously preserve visual structure, achieve precise localization, ensure compilability, and retain irrelevant content when editing scientific diagram code, and there is a lack of systematic evaluation benchmarks. This work proposes Edit2TikZ—the first instruction-guided benchmark for TikZ diagram editing—comprising 1,548 high-quality samples with textual and visual grounding instructions, multi-step edits, and fine-grained annotations, alongside a human-aligned evaluation framework. By integrating multimodal large language model assessment, compilability verification, a reconstruction-to-editing curriculum learning strategy, and a hybrid training set named TikZEditMix, the approach significantly improves the compilation success rate of Qwen3.5-4B from 45.35% to 83.40%, achieving an average gain of 18.7 points across all metrics and substantially outperforming existing methods.
📝 Abstract
Although multimodal large language models (MLLMs) have shown substantial potential in visual understanding and graphic code generation, editing scientific figures through code presents a greater challenge: a model must jointly recover visual structure, ground the requested change, generate compilable code, and preserve all unrelated content. While existing TikZ benchmarks mainly focus on figure reconstruction and generation, few systematically evaluate instruction-guided scientific figure editing with compilable code. We introduce Edit2TikZ, a comprehensive benchmark for scientific figure editing tasks, featuring 1,548 diverse and high-quality samples. Edit2TikZ combines real-world and controlled synthetic edit cases, supports both textual and visual localization request, and contains multi-step editing, each with step-level annotations. We further construct a human-aligned evaluation framework to measure whether a requested edit is completed while irrelevant content is preserved. Utilizing Edit2TikZ, we evaluate 14 mainstream MLLMs and find that current systems remain unreliable: on average, proprietary models achieve a compilation success rate of merely 75% and remain limited in both figure restoration and edit correctness, while compact models below 9B struggle further with instruction following and complete figure generation. Therefore, we build a mixed training set TikZEditMix and adopt reconstruction-then-editing curriculum learning for compact models. On Qwen3.5-4B, this training improves the compilation success rate from 45.35% to 83.40% and yields an average improvement of 18.7 points across our proposed evaluation metrics. The code and data will be released at https://github.com/Solunny/Edit2TikZ.