ChartBench-E (Rebuilt, Insight-Oriented)
This implementation rebuilds ChartBench-E and extends it into a more diagnostic benchmark for VLM chart reading.
What it provides
- 20 data patterns grouped into 6 behavior families.
- Multiple chart morphologies:
line,bar_v,bar_h,stacked. - Annotation modes:
labeled,partial,unlabeled. - Multi-factor difficulty beyond point count:
- visual perturbations (noise, blur, JPEG artifacts, partial occlusion)
- semantic traps (truncated axis, log-scale reading, legend confusion)
- event-level stressors (outlier spikes, near-tie values, regime shifts)
- Diagnostic metadata tags for capability slicing:
event_tagsperceptual_tagssemantic_risk_tags
- Reproducible generation with random seed.
- Evaluation metrics:
- SPR (Success Parsing Rate)
- OA (Overall Accuracy)
- NRA (Numerical Reading Accuracy)
- ARE (Average Relative Error)
Install
cd chartbench_e
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
Build benchmark-focused dataset
PYTHONPATH=. python scripts/build_chartbench_e.py \
--out output/chartbench_e_benchmark_plus \
--total-samples 20000 \
--seed 42 \
--task-mode benchmark \
--challenge-level standard
Challenge levels:
standard: light perturbation, mostly clean charts.advanced: balanced stress setting.extreme: heavy perturbation and denser hard cases.
Make fixed evaluation subset
PYTHONPATH=. python scripts/make_eval_subset.py \
--index output/chartbench_e_benchmark_plus/metadata/index.jsonl \
--out output/chartbench_e_benchmark_plus/metadata/eval_subset.jsonl \
--per-task 400
Risk-focused subset example:
PYTHONPATH=. python scripts/make_eval_subset.py \
--index output/chartbench_e_benchmark_plus/metadata/index.jsonl \
--out output/chartbench_e_benchmark_plus/metadata/eval_compositional.jsonl \
--per-task 200 \
--require-risk-tag compositional_reasoning
Evaluate predictions
Prediction format (jsonl):
{"sample_id": "cb_0000001", "values": [[...], [...]]}
Run:
PYTHONPATH=. python scripts/evaluate_predictions.py \
--truth output/chartbench_e_benchmark_plus/metadata/eval_subset.jsonl \
--pred your_predictions.jsonl \
--out output/report.json \
--tolerance 0.05
Multi-model benchmark (new)
Supported model registry
See scripts/model_registry.json.
Default enabled models:
gpt-5.2gpt-5.2-highgpt-5gpt-5-mini-highqwen3-vl-30b-a3b-thinkingqwen2.5-vl-72bglm-4.6v
Explicitly excluded in this round:
deepseek-vl2paddleocr-vl-1.5
Required env vars
OpenAI provider:
OPENAI_API_KEYOPENAI_BASE_URL(optional)
SiliconFlow provider:
SILICONFLOW_API_KEYSILICONFLOW_BASE_URL(optional, defaulthttps://api.siliconflow.cn/v1)
Fallback rule for SiliconFlow models:
- if
SILICONFLOW_*is missing, script falls back toOPENAI_*
Prompt behavior
- The benchmark runner defaults to
--prompt-mode type_specific. - In
type_specificmode, prompts are loaded fromprompts/chart_types/<chart_type>.txt. - Each prompt instantiation now includes a shape-aware JSON example through
{json_example}, in addition to the strict JSON output contract. prompts/chart_reading_prompt.txtremains available for--prompt-mode unified.
Run benchmark
Single model + 3 repeats + evaluation:
PYTHONPATH=. python scripts/run_vlm_benchmark.py \
--truth-index output/chartbench_e_benchmark_plus/metadata/eval_subset.jsonl \
--dataset-root output/chartbench_e_benchmark_plus \
--models gpt-5.2 \
--repeats 3 \
--max-workers 2 \
--max-retries 2 \
--timeout-seconds 120 \
--run-eval \
--tolerance 0.05
All enabled models:
PYTHONPATH=. python scripts/run_vlm_benchmark.py \
--truth-index output/chartbench_e_benchmark_plus/metadata/eval_subset.jsonl \
--dataset-root output/chartbench_e_benchmark_plus \
--models all \
--repeats 3 \
--max-workers 4 \
--max-retries 2 \
--timeout-seconds 120 \
--run-eval
Offline smoke test (no API call, sanity-only):
PYTHONPATH=. python scripts/run_vlm_benchmark.py \
--truth-index output/chartbench_e_benchmark_plus/metadata/eval_subset.jsonl \
--dataset-root output/chartbench_e_benchmark_plus \
--models gpt-5.2 \
--repeats 3 \
--max-samples 20 \
--run-eval \
--mock-from-truth
Prompt A/B pilot
This pilot samples a 54-chart subset (18 chart types x 3 difficulty tiers x 1 sample), runs baseline vs. updated chart-type prompts, and writes a comparison report:
PYTHONPATH=. python scripts/run_prompt_ab_pilot.py \
--mock-from-truth
For real model runs, set provider credentials first and rerun without --mock-from-truth.
Output structure
output/bench_runs/{run_id}/
run_config.jsontruth_subset.jsonlrun_summary.jsonleaderboard.csvmodels/{model_key}/repeat_0x/pred.jsonlmodels/{model_key}/repeat_0x/report.jsonmodels/{model_key}/repeat_0x/failures.jsonlmodels/{model_key}/repeat_0x/raw_responses.jsonlmodels/{model_key}/repeat_0x/slice_report.jsonmodels/{model_key}/model_stability.jsonmodels/{model_key}/sample_stability.jsonlmodels/{model_key}/slice_summary.json
Slicing coverage:
difficulty_tier(L1-L4)theme_domainaxis_scaley_axis_truncated
Output structure (dataset)
images/*.png: generated chart images.metadata/index.jsonl: full metadata with ground truth and challenge tags.metadata/summary.json: split and distribution summary.metadata/eval_subset.jsonl: fixed benchmark subset.