Skip to content

ServiceNow/SynthDocBench

Repository files navigation

SynthDocBench logo SynthDocBench: Controlled Benchmark for Long-Context Visual Document Understanding

πŸ“ Paper Β |Β  πŸ€— Dataset Β |Β  πŸ’» Code Β |Β  πŸ“„ MIT License

SynthDocBench is a fully synthetic, controlled benchmark for long-context visual document understanding that varies document length, layout structure, modality composition, and question type as independent axes, enabling systematic diagnosis of VLM failure modes.

Authors

Abhigya Verma*,1Β Β Khyati Mahajan*,1Β Β Amit Kumar Saha*,1Β Β Shruthan Radhakrishna1Β Β Sagar Davasam1Β Β Vikas Yadav1Β Β Sai Rajeswar1,2,3

*Equal contribution Β |Β  1ServiceNow AI Β |Β  2Mila – Quebec AI Institute Β |Β  3UniversitΓ© de MontrΓ©al


πŸ“– Introduction

SynthDocBench evaluates vision-language models on 1,788 questions over 200 documents containing 3,340 charts, averaging 51.1 pages per document β€” a fully synthetic, controlled benchmark for long-context visual document understanding.

Unlike prior benchmarks that draw on real documents and confound length, layout, and modality, SynthDocBench generates documents end-to-end with an LLM pipeline across 6 layout archetypes, varying document length, layout structure, modality composition, and question type as independent axes β€” enabling controlled attribution of why a model fails, not just that it does.

Key Features:

  • 🧩 3 task-specific subsets β€” chart (24 D3.js chart types), cross_modal (evidence split across non-adjacent sections), and complex (multi-hop, difficulty L1 β†’ L5)
  • πŸ“„ 51.1 avg. pages per document, far beyond single-page chart/doc-VQA benchmarks
  • πŸ§ͺ Dual-layer generation β€” every chart is rendered as D3.js and backed by hidden structured metadata, making ground-truth answers deterministic
  • πŸ€– 7 frontier VLMs evaluated, cross-judge validated (GPT-5 vs. Gemini-as-judge agree within 3.5 accuracy points, r β‰₯ 0.94)
  • πŸ“‰ Surfaces 3 failure modes invisible to existing benchmarks β€” length degradation, positional sensitivity (middle third hardest for 5/6 models), and chart-reading collapse in long-document settings

Benchmark

Subset Description
chart Chart-reading questions answerable only from a chart β€” probes 24 D3.js chart types (incl. dumbbell, lollipop, slope, sparkline grids) requiring exact numerical reads.
cross_modal Questions requiring text + chart evidence from separate, non-adjacent sections (long-range cross-modal grounding).
complex Multi-hop questions combining 2–4 evidence units across text and charts, difficulty L1 (direct lookup) β†’ L5 (cross-section synthesis).

Source PDFs are hosted alongside the QA subsets at huggingface.co/datasets/ServiceNow-AI/SynthDocBench.

Reproduce the evaluation

See Evaluation below for the harness that scores candidate VLMs against these questions and reproduces the paper's numbers.


Report generation pipeline

A LangGraph-based pipeline that generates rich, themed reports (HTML + PDF, with an optional "scanned document" effect) and embedded D3.js visualizations. It supports two input paths:

  • Topic-in: give it a topic and it researches (Wikipedia/Wikidata) and authors the report itself.
  • Data-in: give it pre-built source text β€” Wikipedia groupings or arXiv papers β€” and it themes and visualizes them.

Pipeline overview

select_layout_archetype
  β†’ generate_reports_from_topics   (topic-in; bypassed when reports are supplied)
  β†’ generate_topic_summary
  β†’ enrich_reports
  β†’ generate_design_tokens
  β†’ assign_blueprints_and_budget   (style DNA, chart budget, report identity)
  β†’ generate_visualization_ideas
  β†’ insert_placeholders
  β†’ select_visualization_types
  β†’ search_wikipedia_wikidata
  β†’ structure_diagram_data
  β†’ generate_diagram_code_with_metadata
  β†’ validate_vizzes
  β†’ assign_figure_numbers β†’ insert_figure_references
  β†’ generate_content_components
  β†’ extract_table_metadata β†’ validate_metadata
  β†’ generate_qa_manifest
Post-graph: generate_html_report()
         β†’  convert_to_scanned_pdf()   (HTML β†’ PDF β†’ scanned PDF)
         β†’  complex question generation (β†’ <report>_questions.json)

After each report is built, complex/chart-reading/cross-modal QA pairs are generated from it (reusing the report's embedded JSON-LD chart metadata) and written alongside it. Opt out with --no-questions. It can also be run standalone via pipelines/complex_question_generation.py.

Features

  • Style DNA & visual diversity β€” 7 randomized style axes plus per-component renderers so reports don't all look identical (utils/style_dna.py, utils/visual_diversity.py).
  • Layout archetypes β€” magazine / dashboard / academic / editorial / infographic / brutalist.
  • Real-world data β€” Wikipedia prose + Wikidata structured facts (tools/wiki_search.py).
  • D3.js visualizations with figure numbering, in-text references, and a QA/metadata manifest.
  • Parallelism β€” per-section and per-viz LLM calls run concurrently (utils/parallel.py).
  • PDF export β€” clean PDF and a realistic scanned-document effect.
  • Multi-model β€” GPT (Azure), Gemini (OpenAI-compatible endpoint or native Vertex AI), and Claude (Foundry / Bedrock / proxy).
  • arXiv-to-report β€” fetch papers, extract text/figures/tables, and generate reports.
  • Complex question generation β€” multi-hop, chart-reading, and cross-modal QA pairs generated from each finished report (pipelines/complex_question_generation.py); auto-chained into report generation (opt out with --no-questions).

Installation

uv sync          # or: pip install -e .   (dependencies are in pyproject.toml)
uv run playwright install chromium   # needed for HTML→PDF

pdf2image needs poppler on your system (brew install poppler / apt-get install poppler-utils).

Configuration β€” model credentials

Model configs live in utils/model_constant.py, which is git-ignored. Copy the template and fill it in (or set the referenced environment variables, e.g. in .env):

cp utils/model_constant.example.py utils/model_constant.py

The template documents which fields each provider needs (SUPPORTED_MODELS per model key; ALL_GENERATIONS is an unused stub for this pipeline).

Usage

Topic-in

# Single topic β€” pipeline researches and authors the report
python -m pipelines.report_generation --topic "Renewable Energy" --model gpt-4o --output output/demo

# Many topics from a JSON list, run concurrently
python -m pipelines.report_generation --topics-file topics.json --batch-size 4 --model gemini-2.5-flash

Data-in β€” Wikipedia groupings

python -m pipelines.report_generation \
    --input data/filtered_groupings.json \
    --sample_start_index 0 --sample_end_index 3 \
    --per_topic_limit 3 \
    --model gemini-3-pro-preview \
    --output output/trial
# or: bash run_report_generation.sh

arXiv-to-report

# End-to-end (fetch β†’ extract β†’ report). See the header of the script for all options.
bash run_arxiv_to_report.sh

# Autonomous mode: LLM discovers topics, fetches papers per topic, generates reports
RESEARCH_AREA="Large Language Model Evaluation" bash run_arxiv_to_report.sh

# Use a pre-fetched metadata file directly
python -m pipelines.report_generation --arxiv-metadata arxiv_dataset/metadata/papers_metadata.json

Other modes

# Regenerate from a cached state
python -m pipelines.report_generation --from-cache cache/state_file.pkl

# Convert existing HTML(s) to PDF (no LLM)
python -m pipelines.report_generation --html-to-pdf output/demo

# HTML only (skip PDF)
python -m pipelines.report_generation --topic "…" --no-scanned

Evaluation

Score candidate VLMs on the generated reports. The harness rasterizes each report PDF to page-image strips (vision-only β€” no HTML/metadata), asks each candidate model the report's questions, and scores answers with a judge model.

python eval/evaluate_models.py \
    --input-dir data/reports_v4 \
    --candidates gpt-4o \
    --judge gpt-5 \
    --output results/all_results.json \
    --workers 4
# --concat-num N groups N pages per strip; see the script header for all options.

Key CLI options

Option Default Description
--topic / --topics-file β€” Topic-in input
--input β€” Data-in: Wikipedia groupings .json/.pkl
--arxiv-metadata β€” Data-in: arXiv papers_metadata.json
--from-cache β€” Regenerate from a saved state
--html-to-pdf β€” Convert existing HTML file/dir to PDF
--model gpt-4o LLM model key (see model_constant.py)
--output output Output directory
--viz-cache β€” Directory for viz code/images
--per_topic_limit 3 Data-in: samples/papers per group
--sample_start_index / --sample_end_index 0 / 3 Data-in: slice of topic groups
--batch-size 1 Topic-in: max concurrent topics
--noise-min / --noise-max 5.0 / 15.0 Scanned-PDF noise range
--no-scanned false Skip PDF generation

Project structure

  • pipelines/report_generation.py β€” the report pipeline (topic-in + data-in).
  • pipelines/arxiv_pipeline.py β€” arXiv search / citation-reference expansion / PDF download.
  • pipelines/autonomous_pipeline.py β€” autonomous arXiv mode (topic discovery β†’ fetch β†’ report).
  • pipelines/complex_question_generation.py β€” multi-hop / chart-reading / cross-modal QA generation.
  • eval/evaluate_models.py β€” vision-only evaluation of candidate VLMs with a judge model.
  • utils/ β€” api_call (LLM client), html_generator, state_loader, extract_content, parallel, style_dna, visual_diversity, model_constant (git-ignored config).
  • tools/wiki_search.py β€” Wikipedia/Wikidata API integration.
  • data/filtered_groupings.json β€” sample Wikipedia groupings for data-in mode.

Output

  1. HTML report β€” themed, with embedded D3.js visualizations.
  2. PDF β€” clean print version.
  3. Scanned PDF β€” realistic scanned-document effect (unless --no-scanned).
  4. Metadata sidecar β€” *_report_metadata.json (style DNA, blueprints, QA global stats).
  5. State cache β€” pickle for regeneration (with --save-cache).

Dependencies

Key deps (full list in pyproject.toml): langgraph, openai, anthropic, langchain-google-vertexai, boto3 (LLM/orchestration); beautifulsoup4, pymupdf, feedparser (data); playwright, pdf2image, pillow (PDF export).

πŸ“š Citation

@misc{verma2026synthdocbenchcontrolledbenchmarklongcontext,
      title={SynthDocBench: Controlled Benchmark for Long-Context Visual Document Understanding},
      author={Abhigya Verma and Khyati Mahajan and Amit Kumar Saha and Shruthan Radhakrishna and Sagar Davasam and Vikas Yadav and Sai Rajeswar},
      year={2026},
      eprint={2607.10400},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2607.10400},
}

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors