ChartInstruct: Instruction Tuning for Chart Comprehension and Reasoning

Ahmed Masry, Mehrad Shahmohammadi, Md. Rizwan Parvez, Enamul Hoque, Shafiq Joty

Abstract

ChartInstruct introduces a massive, first-of-its-kind instruction-tuning dataset specifically for charts, featuring 191,000 instructions across 71,000 diverse, real-world visualizations. By fine-tuning Vision-Language Models (VLMs) on this data using chart-specific encoders, the researchers achieved new state-of-the-art results on major benchmarks, outperforming previous open-source models and rivaling closed-source giants like GPT-4V in specific chart-reasoning tasks.

Introduction

While Large Language Models (LLMs) have mastered text-based instructions, their vision-language counterparts often struggle with the structured complexity of charts. Most existing chart-related models are task-specific—trained only for one thing, like question answering or summarization—which limits their flexibility in real-world scenarios. Furthermore, general-purpose Vision-Language Models typically use CLIP as a vision encoder. CLIP is trained on natural images and often misses fine-grained chart details like axis labels, legend colors, and precise bar heights. There is a distinct lack of high-quality, diverse instruction-following data that teaches models how to "read" and "reason" about data visualizations holistically.

The ChartInstruct Dataset

The core contribution of this work is the ChartInstruct dataset, which aggregates 191K instructions across 71K unique charts. The team used advanced LLMs (GPT-3.5, GPT-4, and Gemini) to generate a wide variety of instructions based on underlying chart data tables. These include complex reasoning, multi-step Chain-of-Thought (CoT) tasks, Python code generation for data analysis, and novel tasks like anomaly detection and future trend forecasting.

Examples of the diverse instruction-following tasks included in the ChartInstruct dataset.

The dataset draws from existing public sources (Statista, PlotQA, OECD/OWID) and a new "WebCharts" corpus of 41,000 charts crawled from 157 different web domains to ensure variety in visual styles and data presentation.

Specialized Architectures

The authors propose two primary systems to leverage this data:

  1. End-to-End System: This modifies the LLaVA framework by replacing the standard CLIP vision encoder with UniChart, an encoder specifically pre-trained on chart images. This allows the model to better capture visual chart structures before passing them to a language decoder (Llama2 or Flan-T5).
  2. Pipeline System: This uses a two-step process: first, it extracts the raw data table from the chart image, then it feeds that text-based table along with the user's instruction into an LLM.

Experimental Results

The models achieved State-of-the-Art (SOTA) performance across four established benchmarks: ChartQA (factoid QA), OpenCQA (explanatory QA), Chart2Text (summarization), and ChartFC (fact-checking).

Performance comparison of ChartInstruct models against open-source and closed-source baselines.

Key findings include:

  • ChartQA: The Pipeline Flan-T5-XL model reached a Relaxed Accuracy of 72.00, a significant jump over the previous best open-source model, UniChart (66.24).
  • ChartFC: On fact-checking tasks, ChartInstruct models reached 72.65% accuracy, outperforming the specialized ChartBERT model (63.8%).
  • Human Evaluation: In a head-to-head comparison, human judges rated ChartInstruct-Llama2 significantly higher than UniChart in Relevance (4.06 vs 2.74) and Informativeness, proving the model follows complex user intents much better.

Discussion and Conclusion

The research highlights that chart-specific encoders are a critical component for understanding data visualizations. While the pipeline model performed better on heavy numerical reasoning, the end-to-end model was superior at capturing nuanced visual trends that might be lost during table extraction.

Despite these gains, challenges remain in precise value estimation for crowded charts and preventing factual hallucinations. Future work will focus on better integrating external tools, such as calculators or code executors, directly into the chart-reasoning loop to eliminate calculation errors and improve overall reliability.

Summary updated

BibTeX
@inproceedings{masry2024chartinstruct,
  author = {Ahmed Masry and Mehrad Shahmohammadi and Md. Rizwan Parvez and Enamul Hoque and Shafiq Joty},
  title = {{ChartInstruct: Instruction Tuning for Chart Comprehension and Reasoning}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2024},
  doi = {10.18653/v1/2024.findings-acl.619},
}
Figure