Introduction
Multimodal Large Language Models (MLLMs), such as LLaVA and InternVL, have demonstrated impressive capabilities in general visual recognition. However, they frequently encounter a "reasoning bottleneck" when processing complex visual data like charts. Even when these models correctly identify individual data points, they often fail to execute the multi-step logical operations required to answer sophisticated questions. This paper identifies two primary failure modes in chart understanding: Recognition Errors (misidentifying labels or values) and Reasoning Errors (failing to synthesize correctly identified data).
To address this, the authors propose a novel approach that leverages the structured logic of programming code to bridge the gap between visual perception and cognitive reasoning.
Methodology: Code-as-Intermediary Translation (CIT)
The core innovation of this work is Code-as-Intermediary Translation (CIT). Rather than relying on raw data tables—which strip away visual-semantic features like color, layout, and style—the authors use Python (Matplotlib) code as the primary representation for chart generation and reasoning distillation.
The CIT pipeline consists of three stages:
- Intermediary Code Synthesis: Starting with a small set of "seed" scripts, the system uses Self-Instruct to diversify chart types and Evol-Instruct to increase complexity, creating charts with overlays, subplots, and dense data.
- Bi-directional Translation: The code is executed to produce an image while an LLM (GPT-4o) analyzes the same code to generate complex Q&A pairs. This ensures that questions can reference specific visual elements (e.g., "the red bar") with perfect ground-truth accuracy.
- Quality Assurance: A multi-model ensemble filters the synthetic data to ensure the generated charts are readable and the answers are consistent, resulting in the REACHQA dataset.
The REACHQA Dataset
REACHQA contains 3,249 reasoning-intensive charts and nearly 20,000 Q&A pairs. Unlike previous datasets, REACHQA is balanced between recognition-oriented tasks (identifying values) and reasoning-oriented tasks (comparing trends or calculating proportions). This balance is crucial; the authors found that a model's reasoning ability eventually plateaus if it lacks a strong "visual foundation" in recognition.
Experimental Results
Fine-tuning MLLMs on REACHQA led to substantial performance gains across both specialized chart benchmarks (ChartQA, ChartBench) and general mathematical reasoning benchmarks (MathVista).
As shown in the error analysis, the integration of REACHQA significantly reduces the total number of errors. For instance, LLaVA-Next-Llama3-8B saw its total error count drop from over 1,300 to under 900, with the most dramatic reductions occurring in reasoning-related failures. This suggests that the logical patterns distilled from the LLM via code are effectively transferred to the MLLM.
Key Insights and Conclusion
- Code as a Superior Proxy: Programming code is a more effective intermediary than raw tables because it preserves the "visual intent" of a chart, allowing the model to learn the relationship between visual style and data logic.
- Cross-Domain Generalization: Training on REACHQA improved performance on general math tasks, indicating that the distilled reasoning patterns are transferable beyond just chart reading.
- Scalability: The entire dataset was produced for approximately $300 in API costs, providing a highly scalable and cost-effective alternative to manual human annotation.
While the CIT method is currently optimized for code-generated visuals like charts and diagrams, it represents a significant step toward more logical and reliable multimodal AI systems.
Summary updated