Reading Before Reasoning: Render-Verified Chart Reconstruction Across Plotting Languages

Multimodal models often answer hard questions about charts correctly while failing simple ones, such as reading an axis range or finding the largest bar. The reason is that they are guessing from the text. When the answer is hinted in a chart title, accuracy reaches 79%. When the title is removed it falls to around 30% (Plot Twist). We propose to teach models to read the chart first. In an early training stage, the model must reconstruct a chart as a short plotting program. The program is executed and its rendered output is checked by a deterministic geometry verifier, not by another vision-language model. Only after the model reliably reconstructs charts with misleading or missing titles does training move on to multi-step questions, which are answered by computing over the reconstructed data.

The second ingredient is less obvious. The model writes these reconstruction programs in several plotting languages: Python/Matplotlib, R/ggplot2, JavaScript/Vega-Lite and Julia/Plots. The checker reads the rendered SVG output (a vector image format every one of these libraries can export) and never parses the code. Imports, styling calls and API names differ across languages. The plotted numbers, axes and color encodings are the only content shared by all valid answers. Our bet is that this pushes learning toward the visual content and away from memorized library boilerplate. Boilerplate is what Breaking the SFT Plateau blames for diminishing returns when supervised chart-to-code data is scaled.

Core Claim

We claim that a perception-gated curriculum reduces dependence on textual shortcuts more than difficulty-ordered reasoning curricula do, and that the gain carries over to chart reasoning benchmarks. In this curriculum, reinforcement learning is rewarded by a render-and-compare verifier that is independent of programming language, and progression is gated on reconstruction accuracy under title perturbation. A secondary, falsifiable claim is that reconstruction in several languages beats Python-only reconstruction at equal compute, and that it lets the model reconstruct charts in a held-out plotting language.

The roles of the four directions are uneven. The modality-bias literature supplies the target pathology and the measurements. The multimodal reasoning gap supplies the evaluation setting. Curriculum learning is the mechanism. Cross-language portability is both a verification design choice and a hypothesized regularizer.

Relation to Prior Work

Three lines of work motivate the proposal.

Plot Twist diagnoses the title shortcut and the fragility to small visual changes. For example, adding grid lines drops PaLI-3 from 29.5% to 21.3%. It proposes no remedy, and we take its perturbations as our main stress test.

MATH-Vision attributes 31.9% of GPT-4V's failures to visual recognition. It also reports that chain-of-thought can hurt multimodal models.

Hallucination snowballing shows that models trust their own generated text over the image as generation proceeds. Together these constrain the design: the reasoning stage should hand off to executable computation over reconstructed data rather than to long free-text chains.

The closest existing work is a set of curricula that each lack one of our two ingredients.

CURV stages chart training from grounding components to interleaved reasoning. Its grounding is bounding boxes in natural language, and coordinate errors accumulate at test time. Its stages are ordered by task complexity, not gated on shortcut resistance.

OpenVLThinker orders problems by reasoning difficulty and seeds reasoning with caption-conditioned text traces. It notes that this supervised stage can dilute grounding.

MSRL is the nearest technical neighbor. It applies a two-stage reinforcement learning curriculum to chart-to-code generation, but it is Python-only. Its visual reward is a vision-language-model judge that can itself be text-biased, and it does not test whether reconstruction skill transfers to question answering.

Our proposal differs from all three in three ways. Reconstruction is a prerequisite for reasoning rather than an end task. The reward is a deterministic check of rendered geometry. Curriculum progression is conditioned on measured shortcut resistance.

The method draws on three further sources. Agnostics supplies the verification pattern: it achieves language-independence by judging only observable behavior inside containers configured per language. We extend the observable from standard output to the rendered SVG. Language-Agnostic Representation Learning of Source Code found that multilingual training helps only when a shared structure is exposed; text-only multilingual training gave no cross-language gain. Our analogous hypothesis is that the rendered geometry is the shared structure. Synthesize Step-by-Step and Chart-based Reasoning show that routing chart reasoning through code gives exact computation. We reuse that idea for the final stage.

Research Program

Synthetic data. Charts are rendered from known data tables with a randomized renderer. The renderer varies library, marker style, grid lines, color palette and log or linear scale. The title is either correct, absent, or deliberately misleading, for example naming a different series or quoting a wrong maximum.

Verifier. The generated program runs in a per-language container and exports SVG. A single SVG parser then recovers the tick labels and their positions, fits the axis mapping, and maps mark geometry (bar extents, point centers, line vertices) and fill colors back to data coordinates. The reward combines a successful-execution indicator with the accuracy of the recovered data:

$$r = \mathbb{1}[\text{exec}] \cdot \Big(1 - \min\big(1, \tfrac{1}{N}\textstyle\sum_{i=1}^{N} |\hat v_i - v_i| / s\big)\Big) \cdot c,$$

where $v_i$ are the $N$ true data values, $\hat v_i$ the values recovered from the generated SVG, $s$ the axis span, and $c \in [0,1]$ the fraction of series whose color and chart type match. Training uses Group Relative Policy Optimization, a policy-gradient method that scores each sampled answer relative to others for the same prompt. This is the optimizer used by MSRL, OpenVLThinker and Agnostics.

Before any training we validate the verifier. It must recover ground-truth data from reference programs in every language within the 5% tolerance used by Chart101. We report its failure rate per library, because a verifier that silently disagrees across languages would contaminate the multilingual comparison.

Curriculum. Stage A asks for partial reconstructions: the axes alone, or a single highlighted series. Stage B asks for full reconstruction. Stage C poses questions from ChartQA-style templates; the model writes a program that both reconstructs the data and computes the answer, and is rewarded on exact answer match. We move from one stage to the next when a held-out split with misleading titles reaches a reconstruction threshold, rather than after a fixed step count. This replaces the hand-designed rubrics criticized in RuCL with a single measured gate. In the spirit of self-paced learning, we keep a small replay of earlier stages.

Language split. Training covers Python, R and JavaScript. Julia is held out entirely to test portability.

Base model and measurement. The base model is Qwen2.5-VL-7B, the model CURV fine-tuned, so the comparison is direct. To measure modality reliance we define the title sensitivity $\Delta_T = \text{Acc}_{\text{true title}} - \text{Acc}_{\text{misleading title}}$ on the same charts. We also track the layer-wise share of attention on visual tokens, the quantity LLaVA Steering measures. This tells us whether behavioral gains coincide with the model actually attending more to the image.

Baselines

Untrained base model. The do-nothing reference is the base model prompted to answer directly, and again prompted to write Python and execute it. This separates the effect of training from the effect of simply routing answers through code.

MSRL-style curriculum. This is the strongest code-centric competitor. It is a Python-only, two-stage reinforcement learning curriculum with execution and data-matching rewards followed by a vision-language-model judge. It reports a 96.5% execution rate and an 83.8% high-level score on ChartMimic (Breaking the SFT Plateau). We reimplement it on our base model with the same synthetic charts, the same number of policy updates and the same rollout budget, and then attach the same Stage C. Beating it means two things at matched ChartMimic reconstruction quality. First, $\Delta_T$ on Chart101-style probes must be lower. Second, accuracy on ChartQA's human-written split and on CharXiv reasoning must be higher.

CURV. This is the strongest natural-language grounding curriculum. It reports a 12.30% improvement on the CharXiv reasoning subset and a 10.20% out-of-domain gain on MathVista (CURV). We train it on the same base model and data budget, using its CCQA protocol. Beating it requires exceeding its CharXiv and MathVista gains over the shared base and showing lower title sensitivity.

OpenVLThinker-style difficulty curriculum. This baseline orders by reasoning difficulty rather than perception. It reports 72.3% on MathVista at 7B (OpenVLThinker). We run it at matched compute, and we use MathVista mainly to confirm that our curriculum does not sacrifice general visual math.

Ablations. Two ablations isolate our ingredients. The first is the identical curriculum restricted to Python, which isolates the multilingual claim. The second keeps all three languages but uses a fixed step schedule instead of the title-perturbation gate, which isolates the gate.

Why not just…?

Why not just randomize or remove titles during ordinary question-answering training? This is the cheapest debiasing and a genuine threat to the method. It may remove the specific title shortcut without any reconstruction stage. What it cannot do is reward correct intermediate reading, so the model may switch to other shortcuts, such as legend text or prior knowledge of typical values. We include this baseline at matched compute and evaluate it on perturbations it never saw, namely grid lines, marker changes and library switches from Plot Twist. If it matches our method on those perturbations and on CharXiv, the reconstruction stage is unnecessary, and we will report exactly that.

Why not just have the model extract a data table, with no code at all? Rendering a chart back to a plain table is the language-free version of our Stage A and the second serious threat. ChartQA found that table-only pipelines fail on questions about visual attributes such as color and relative height. Code-based reconstruction must commit to those encodings, and our verifier checks them. We run table extraction as a stage with the same reward on values, and we split results by questions that do and do not involve visual attributes. Our hypothesis predicts an advantage only on the attribute questions. If no such advantage appears, code is overhead.

Why not just use contrastive decoding such as RBD at inference time? Re-Balancing Contrastive Decoding compares predictions against a branch with a noised image to subtract the language-prior component. It reports 88.0% on POPE and reduces sentence-level caption hallucination from 20.8% to 17.8%. However, it doubles the cost of each forward pass and teaches no new reading skill. Its evaluations are on object existence, not quantitative chart reading. We apply it to both the base model and our trained model. If it closes most of the title-sensitivity gap by itself, the training is less justified. If it adds on top of our model, the two are complementary.

Why not just scale supervised chart-to-code data across languages? MSRL documents that supervised gains flatten after about 2M pairs and that reinforcement learning adds 6.2% on ChartMimic and 9.9% on ReachQA over the best supervised model. Agnostics shows that low-resource languages need execution feedback: OCaml rises from near zero to 7% and Fortran to 15%. We still run a supervised multilingual baseline on the same programs, because the plateau has not been shown for languages other than Python.

Decisive Checks

Shortcut resistance. The first decisive check is title sensitivity on Chart101's 218 elementary questions and on our perturbed synthetic set. We also report accuracy under grid-line, marker and library perturbations; Plot Twist reports collective elementary accuracy often below 25%. The method succeeds if $\Delta_T$ falls well below that of the MSRL, CURV and title-randomization baselines while elementary accuracy rises.

Transfer to reasoning. The second check is ChartQA (human-written split, where the original paper reports about 30%), CharXiv reasoning, CCQA and MathVista. Here the method must at least match CURV's reported gains over the shared base.

Portability. The third check is reconstruction in held-out Julia, scored by the same verifier. There is no reported result on Lacuna for chart-to-code generation in R, JavaScript or Julia, so we establish these numbers with the base model and the baselines. The multilingual claim is falsified if the Python-only ablation equals the full model on the first two checks.

Mechanism. Finally, we report the attention share on visual tokens in deep layers before and after each stage. This tests whether the behavioral improvement coincides with the model attending more to the image, or whether it reflects better guessing.