sanchit97/chartrl

ChartRL - Improving Chart understanding through GRPO and RLVR

7

stars

53

commits

Python

primary language

Aug 25, 2025

updated

sanchitsinha.com

README

ChartRL: Improving Chart understanding in VLMs

Repo for RL post-training on Chart data. We present a small 3 billion chart understanding model which outputs answers AND rationales. Currently the model is based on Qwen2.5VL (3 billion).

The design hinges on training VLMs using GRPO with verifiable rewards. The training data is sampled from train sets of - ChartQA, PlotQA, and ChartFC (in-domain).

Huge thanks to the team at Morgan Stanley for their support!

Find our Chart-RVR-3B models and associated datasets on Huggingface.

Main Benchmark Results

ApproachExp?ChartQAPlotQAChartFCEvoChartChartQAPro
Direct Prompting
Q2.5VL-Ins82.080.574.448.7225.7
Explainable Models - with Rationales
Q2.5VL-Ins (CoT)73.1252.7269.2029.615.80
ChartGemma76.4433.2870.3336.9610.93
Fine-tuned Models - with Rationales
Q2.5VL-SFT83.0874.1877.3046.0823.56
Q2.5VL-DPO75.4253.8670.134.815.95
Q2.5VL-Ins (F+L+Tasks)81.876.2463.8551.6827.66
Chart-RVR-3B (Ours)84.5678.6877.6253.3628.38
Data Curated Fine-tuned Models - with Rationales
Q2.5VL-SFT-Hard84.2875.5477.9049.3623.20
Chart-RVR-3B-Hard (Ours)85.7677.980.0754.2428.64

Running Evals

Run inference on ChartQA with Chain-of-Thought: python main.py --mode eval --vlm-name qwen2-5-3b --dataset-name chartqa-src --cot True

Run inference on ChartQA with GRPO trained models: python main.py --mode eval --vlm-name qwen2-5-3b --dataset-name chartqa-src --cot True --grpo-lora True

Run inference on ChartQA with SFT trained models: python main.py --mode eval --vlm-name qwen2-5-3b --dataset-name chartqa-src --cot True --sft-lora True

Ensure path to models correspond to checkpoints from Chart-RVR or Chart-RVR-Hard

To ease computation, we have provided scripts which can directly be executed on SLURM in ./eval-scripts For instance to run GRPO on all datasets, use: sbatch ./eval-scripts/grpo_all_eval.sh. This runs evaluation on all datasets and stores it in ./logs.

Training Models

SFT

We utilize the great work here to fine-tune models.

Chart-RVR (GRPO-based)

To directly run training, we recommend first double checking TRL version. Next double check the num_processes in ./deepspeed_zero3.yaml is set to 4 (recommended). For any other combination, there might be OOM errors with default completions, prompt size, etc.

Then, simply run on the SLURM cluster sbatch grpo.sh. For running directly on local GPUs, run: accelerate launch --config_file=deepspeed_zero3.yaml main.py --mode grpo --vlm-name qwen2-5-3b --dataset-name chartqa-src

Note: The datset name is only placeholder for the eval-script. It is mandatory to run the dataset generation script first.

Contributors

sanchit97

53 commits

sanchit97/chartrl

ChartRL - Improving Chart understanding through GRPO and RLVR

7

stars

53

commits

Python

primary language

Aug 25, 2025

updated

sanchitsinha.com

README

ChartRL: Improving Chart understanding in VLMs

Repo for RL post-training on Chart data. We present a small 3 billion chart understanding model which outputs answers AND rationales. Currently the model is based on Qwen2.5VL (3 billion).

The design hinges on training VLMs using GRPO with verifiable rewards. The training data is sampled from train sets of - ChartQA, PlotQA, and ChartFC (in-domain).

Huge thanks to the team at Morgan Stanley for their support!

Find our Chart-RVR-3B models and associated datasets on Huggingface.

Main Benchmark Results

ApproachExp?ChartQAPlotQAChartFCEvoChartChartQAPro
Direct Prompting
Q2.5VL-Ins82.080.574.448.7225.7
Explainable Models - with Rationales
Q2.5VL-Ins (CoT)73.1252.7269.2029.615.80
ChartGemma76.4433.2870.3336.9610.93
Fine-tuned Models - with Rationales
Q2.5VL-SFT83.0874.1877.3046.0823.56
Q2.5VL-DPO75.4253.8670.134.815.95
Q2.5VL-Ins (F+L+Tasks)81.876.2463.8551.6827.66
Chart-RVR-3B (Ours)84.5678.6877.6253.3628.38
Data Curated Fine-tuned Models - with Rationales
Q2.5VL-SFT-Hard84.2875.5477.9049.3623.20
Chart-RVR-3B-Hard (Ours)85.7677.980.0754.2428.64

Running Evals

Run inference on ChartQA with Chain-of-Thought: python main.py --mode eval --vlm-name qwen2-5-3b --dataset-name chartqa-src --cot True

Run inference on ChartQA with GRPO trained models: python main.py --mode eval --vlm-name qwen2-5-3b --dataset-name chartqa-src --cot True --grpo-lora True

Run inference on ChartQA with SFT trained models: python main.py --mode eval --vlm-name qwen2-5-3b --dataset-name chartqa-src --cot True --sft-lora True

Ensure path to models correspond to checkpoints from Chart-RVR or Chart-RVR-Hard

To ease computation, we have provided scripts which can directly be executed on SLURM in ./eval-scripts For instance to run GRPO on all datasets, use: sbatch ./eval-scripts/grpo_all_eval.sh. This runs evaluation on all datasets and stores it in ./logs.

Training Models

SFT

We utilize the great work here to fine-tune models.

Chart-RVR (GRPO-based)

To directly run training, we recommend first double checking TRL version. Next double check the num_processes in ./deepspeed_zero3.yaml is set to 4 (recommended). For any other combination, there might be OOM errors with default completions, prompt size, etc.

Then, simply run on the SLURM cluster sbatch grpo.sh. For running directly on local GPUs, run: accelerate launch --config_file=deepspeed_zero3.yaml main.py --mode grpo --vlm-name qwen2-5-3b --dataset-name chartqa-src

Note: The datset name is only placeholder for the eval-script. It is mandatory to run the dataset generation script first.

Contributors

sanchit97

53 commits

Languages

Python

97.9%

Shell

2.1%