[Paper Review] Chart Specification: Structural Representations for Incentivizing VLM Reasoning in Chart-to-Code Generation
The paper introduces Chart Specification, a structure-focused intermediate representation that improves chart-to-code generation by aligning visual structure with code, enabling data-efficient training and reinforcement learning with fine-grained structural rewards.
Vision-Language Models (VLMs) have shown promise in generating plotting code from chart images, yet achieving structural fidelity remains challenging. Existing approaches largely rely on supervised fine-tuning, encouraging surface-level token imitation rather than faithful modeling of underlying chart structure, which often leads to hallucinated or semantically inconsistent outputs. We propose Chart Specification, a structured intermediate representation that shifts training from text imitation to semantically grounded supervision. Chart Specification filters syntactic noise to construct a structurally balanced training set and supports a Spec-Align Reward that provides fine-grained, verifiable feedback on structural correctness, enabling reinforcement learning to enforce consistent plotting logic. Experiments on three public benchmarks show that our method consistently outperforms prior approaches. With only 3K training samples, we achieve strong data efficiency, surpassing leading baselines by up to 61.7% on complex benchmarks, and scaling to 4K samples establishes new state-of-the-art results across all evaluated metrics. Overall, our results demonstrate that precise structural supervision offers an efficient pathway to high-fidelity chart-to-code generation. Code and dataset are available at: https://github.com/Mighten/chart-specification-paper
Motivation & Objective
- Identify limitations of surface-level token imitation in chart-to-code synthesis.
- Propose Chart Specification as a minimal sufficient structural representation that bridges visual intent and code execution.
- Construct a structurally balanced ChartStruct dataset to cover diverse chart topologies.
- Develop Spec-Align Reward to provide fine-grained, verifiable feedback for reinforcement learning.
- Demonstrate data-efficient, state-of-the-art performance on three public benchmarks.
Proposed method
- Define Chart Specification as a two-part schema: S = <S_sem, S_code>, where S_sem encodes global topology, coordinate systems, data domains, and analytic representations, and S_code grounds numerical facts via runtime interception.
- Construct ChartStruct, a structurally balanced training corpus organized into 55 structural categories (S_struct) across 20 chart families, using difficulty-aware sampling (ρ tiers 90/72/54).
- Introduce Spec-Align Reward within a Group Relative Policy Optimization (GRPO) framework, using a hierarchical reward tree with phases: Integrity (Format, Execution) and Semantic/Code fidelity (R_sem, R_code).
- R_sem combines Topology Gate, Coord, Domain, Series, and Data/Func components; R_code adds chart-family–specific metrics (Statistical, Relational, Vector, Auxiliary) grounded in runtime code comparisons.
- Train using a 4K ChartStruct instantiation with Qwen2.5-VL-7B backbone, fine-tuned under GRPO for 3 epochs with a 32-batch size, and evaluate on ChartMimic, Plot2Code, and ChartX benchmarks.

Experimental results
Research questions
- RQ1How does a structure-focused intermediate representation affect structural fidelity in chart-to-code generation?
- RQ2Can a structurally balanced dataset improve data efficiency and generalization for chart reasoning tasks?
- RQ3Does Spec-Align provide meaningful, verifiable rewards that enhance reinforcement learning for chart code generation?
- RQ4How does Chart Specification perform relative to state-of-the-art baselines on benchmark datasets?
- RQ5What are the limits and benefits of structure-aware supervision in reducing hallucinations and improving code execution?
Key findings
- ChartSpec achieves leading performance among open-source MLLMs on ChartMimic with 3k data (Overall Score 79.9) and 4k data (82.4).
- With 4k data, ChartSpec surpasses some commercial models (e.g., GPT-4o at 81.2) on ChartMimic and closes the gap to top systems.
- The approach delivers the highest Execution Rate (93.5%) on the leaderboard, indicating strong code validity and fewer runtime failures.
- ChartStruct enables strong data efficiency by prioritizing structurally complex charts, achieving state-of-the-art results at 4K while using far fewer samples than large-scale baselines.
- Spec-Align Reward provides dense, verifiable feedback via a multi-stage reward tree, improving structural fidelity and logical coherence over purely supervised baselines.
- Experiments across three benchmarks (ChartMimic, Plot2Code, ChartX) demonstrate robust gains and data-efficient chart-to-code generation.

Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.