ChartEditor: A Reinforcement Learning Framework for Robust Chart Editing

Liangyu Chen, Yichen Xu, Jianzhe Ma, Yuqi Liu, Donglu Yang, Liang Zhang, Zihao Yue, Wenxuan Wang, Qin Jin

Introduction

While Multi-modal Large Language Models (MLLMs) have demonstrated remarkable capabilities in image description and reasoning, they frequently stumble when tasked with precise visual modifications. Chart editing—the process of altering specific elements of a chart based on natural language instructions—remains a significant challenge. Existing models often struggle to bridge the gap between generating executable code and ensuring that the resulting visual output accurately reflects the user's intent.

ChartEditor addresses these limitations through a novel reinforcement learning (RL) framework. By utilizing a 3B-parameter architecture and a specialized rendering reward system, ChartEditor achieves state-of-the-art performance, outperforming models with over twenty times its parameter count and even proprietary systems like GPT-4o.

The Challenge of Image-to-Code Chart Editing

Most current chart editing benchmarks operate under the unrealistic assumption that the model has access to the original source code (e.g., Python/Matplotlib). In real-world scenarios, users typically only possess the chart image. This creates three primary hurdles:

  1. Source Code Absence: Models must infer the underlying data and structure solely from pixels.
  2. Fine-Grained Control: Standard text-based metrics fail to capture subtle errors in layout, label placement, or color hex codes.
  3. The Code-to-Visual Gap: Code that is syntactically correct may still fail to produce the requested visual change.

Methodology: Reinforcement Learning with Rendering Rewards

ChartEditor is built upon the Qwen2.5-VL-3B architecture and trained through a sophisticated multi-stage pipeline designed to align code generation with visual outcomes.

The ChartEditor data generation and training pipeline.

Two-Stage Supervised Fine-Tuning (SFT)

Before entering the RL phase, the model undergoes two stages of SFT. The first stage focuses on "Chart-to-Code" tasks to establish a foundational understanding of how visual elements map to programmatic structures. The second stage introduces "Chart Editing" tasks, teaching the model to follow specific natural language instructions.

Group Relative Policy Optimization (GRPO)

The core of ChartEditor's success lies in its use of GRPO, an RL algorithm that allows the model to explore diverse code-generation strategies. Unlike traditional RL, GRPO identifies optimal paths without requiring a separate, complex critic model. The training is guided by a multi-dimensional reward system:

  • Format and Execution Rewards: Ensure the model produces structured, runnable code.
  • Rendering Reward: This novel metric compares the rendered output of the generated code against a ground-truth image, specifically evaluating layout, text accuracy, and color fidelity.

Curriculum Learning

To mitigate the "sparse reward" problem—where a model fails too frequently in early training to learn effectively—the authors employed curriculum learning. The model begins with simple, single-instruction edits on basic charts before progressing to complex, multi-step modifications on multi-plot visualizations.

Results: Scaling Efficiency and Robustness

The researchers introduced ChartEditVista, a comprehensive benchmark comprising 7,964 samples across 31 chart categories. Unlike previous datasets, ChartEditVista provides only the original image and a natural language instruction as input, mirroring real-world constraints.

Performance comparison of ChartEditor against larger models across three benchmarks.

ChartEditor (3B) achieved an average score of 58.1 on ChartEditVista, significantly outperforming specialized models like TinyChart (12.2) and general-purpose giants like GPT-4o (43.5). Furthermore, the model demonstrated high reliability with a 76.8% code execution rate.

A key insight from this research is that domain-specific RL and high-quality synthetic data allow smaller models to "punch up." As shown in the performance benchmarks, the 3B ChartEditor consistently outperforms 72B models across multiple datasets, including ChartEdit and ChartMimic. This suggests that for specialized tasks like data visualization, targeted training objectives are more critical than raw model scale.

Conclusion

ChartEditor demonstrates that a rendering-centric reinforcement learning approach can bridge the gap between code generation and visual intent. By prioritizing the visual consequences of code through a Rendering Reward, the framework enables robust, high-fidelity chart editing from images alone. Future work will look toward expanding this framework to handle "in-the-wild" charts from noisy sources and developing interactive, multi-turn editing capabilities.

Summary updated

BibTeX
@inproceedings{chen2026charteditor,
  author = {Liangyu Chen and Yichen Xu and Jianzhe Ma and Yuqi Liu and Donglu Yang and Liang Zhang and Zihao Yue and Wenxuan Wang and Qin Jin},
  title = {{ChartEditor: A Reinforcement Learning Framework for Robust Chart Editing}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2026},
  doi = {10.1609/aaai.v40i24.39107},
}
Figure