ChartM3: Benchmarking Chart Editing with Multimodal Instructions

Donglu Yang, Liang Zhang, Zihao Yue, Liangyu Chen, Yichen Xu, Wenxuan Wang, Qin Jin

Introduction

Editing charts programmatically is a critical task for data scientists and researchers, yet it remains a significant challenge for Artificial Intelligence. While Multimodal Large Language Models (MLLMs) have become adept at describing visual data, they often stumble when required to perform precise, fine-grained modifications to the underlying code. The primary hurdle is ambiguity: a simple instruction like "change the color of the third bar" can be interpreted in multiple ways depending on the chart's orientation or sorting logic.

To address this, ChartM3 introduces a new paradigm for chart editing that moves beyond textual instructions by incorporating visual indicators—such as bounding boxes or point-clicks—to specify targets. This research provides a comprehensive benchmark and a massive training dataset to bridge the gap between visual perception and code execution.

The Problem: The "Last Mile" of Chart Editing

Existing MLLMs struggle with mapping a user's intent to specific lines of code (typically Matplotlib). In complex visualizations like stacked bar charts or heatmaps, natural language is often insufficient for pinpointing a specific element. Current models may understand the visual scene but fail to translate that understanding into the precise logic required to modify a script without breaking the rest of the visualization. ChartM3 addresses the lack of standardized benchmarks for this multimodal task and investigates why current models fail to interpret visual cues for code modification.

The ChartM3 Framework

The researchers propose a dual-paradigm approach to evaluate and improve chart editing:

  1. Textual Description-Guided Editing: The traditional method where users provide natural language instructions (e.g., "the third bar from the left").
  2. Visual Indicator-Guided Editing: A more precise method where the user provides a visual hint, such as a bounding box, to highlight the target element directly on the image.

Datasets

The study introduces two major resources:

  • ChartM3 (Benchmark): A curated set of 1,000 human-verified triplets consisting of an original chart, its source code, and multimodal instructions. It spans 10 chart types (including box plots, heatmaps, and bar charts) and four levels of complexity.
  • ChartM3-Train: A large-scale dataset of 24,000 samples designed for Supervised Fine-Tuning (SFT), teaching models to associate visual indicators and text with specific code structures.

Evaluation Metrics

To accurately measure progress, the authors developed two novel metrics:

  • $Δ$SSIM (Delta Structural Similarity): This metric quantifies the relative improvement a model makes starting from the original image. It rewards progress toward the target state while penalizing unintended changes that deviate from the goal.
  • GPT Score: Utilizing GPT-4 as an evaluator, the framework measures Directive Compliance Ratio (accuracy of the specific edit) and Non-intervened Robustness (the ability to leave unrelated parts of the chart untouched).

Key Insights and Results

The Ambiguity Gap

Interestingly, visual cues act as a double-edged sword. While they reduce ambiguity for humans, they actually make the task harder for zero-shot models. Even top-tier models like GPT-4o perform better with text descriptions than with visual boxes in a zero-shot setting, suggesting that current MLLMs are "text-first" thinkers that struggle to connect pixel-level coordinates to code logic.

Asymmetric Knowledge Transfer

A pivotal finding of the study is that training a model on visual-guided tasks improves its performance on text-guided tasks, but the reverse is not true. Learning to map pixels to code appears to provide a more fundamental understanding of chart structure than learning from text alone.

The Power of Fine-Tuning

Supervised Fine-Tuning (SFT) proved transformative for open-source models. For instance, Qwen2-vl initially struggled with visual tasks, but after training on ChartM3-Train, its $Δ$SSIM score skyrocketed from 6.5 to 57.88, nearly matching the performance of GPT-4o. This demonstrates that specialized data can bridge the performance gap between open-source models and proprietary giants.

Limitations and Future Work

While ChartM3 sets a new standard, several avenues for future research remain:

  • Library Expansion: The current benchmark is focused on Matplotlib; future iterations could include Seaborn, Plotly, or Highcharts.
  • Intent-Level Instructions: The dataset currently uses "parameter-level" instructions (e.g., "change transparency to 0.15"). Moving toward "intent-level" instructions (e.g., "make this look more professional") would require models to exercise design agency.
  • Direct Image Editing: A more ambitious goal is "code-free" editing, where models modify the chart pixels directly without requiring access to the underlying source code.

Conclusion

ChartM3 highlights that the future of AI-driven data visualization lies in multimodal interaction. By providing a robust framework for visual-guided editing, this research paves the way for more intuitive and precise tools for data communication.

Summary updated

BibTeX
@inproceedings{yang2025chartm,
  author = {Donglu Yang and Liang Zhang and Zihao Yue and Liangyu Chen and Yichen Xu and Wenxuan Wang and Qin Jin},
  title = {{ChartM3: Benchmarking Chart Editing with Multimodal Instructions}},
  booktitle = {ACM Multimedia},
  year = {2025},
  doi = {10.1145/3746027.3755714},
}
Figure