Skip to content

Add olmOCR-bench, CC-OCR multi-scene and OmniDocBench v1.5/v1.6 - #412

Merged
jason718 merged 19 commits into
mainfrom
jasonr/ocr-benchmarks
Oct 2, 2026
Merged

jason718 merged 19 commits into
mainfrom
jasonr/ocr-benchmarks

Conversation

@jason718

@jason718 jason718 commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

Adds three OCR benchmarks for vision-language models, each scored the way its leaderboard scores it. They follow the vision layout: tasks in evals/vision/benchmarks/, scoring in evals/vision/scoring/, and a shared OcrTask base in evals/vision/tasks/ocr.py.

task data scoring primary metric
olmocr_bench olmOCR-bench: 1,403 PDF pages, 7,019 unit tests official olmocr scorer, pinned to 0.4.27 (the release behind the published numbers) overall: mean of the 8 category pass rates (0-1)
cc_ocr_multi_scene CC-OCR multi-scene OCR track: all 13 sub-datasets (2,750 images); cc_ocr_multi_scene_en: the 8 English ones (2,000) official evaluator, vendored macro_f1: the official track score over the sub-datasets run (0-1)
omnidocbench / omnidocbench_v15 OmniDocBench v1.6 (1,651 pages) and v1.5 (1,355); _en variants: their English pages (755 and 628) pinned official evaluator of each version, run out of process overall: the leaderboard's 0-100 number

English by default. Each benchmark comes as its full version (the plain name, every language, as the leaderboards score it) and its English part (_en): cc_ocr_multi_scene_en runs CC-OCR's 8 English sub-datasets, and omnidocbench_en, omnidocbench_v15_en run OmniDocBench's pages annotated english (755 of v1.6's 1,651; 628 of v1.5's 1,355). Molmo2 models read English only, so the _en variants are the default setting for evaluating them; the full ones stay for multilingual models and additionally report OmniDocBench text edit by page language. Suite ocr_en runs the English defaults and ocr the full benchmarks (both display-only, since the scales differ). olmocr_bench is English throughout and has no variant.

Scoring notes

  • olmOCR-bench. Pages ship as PDFs and are rasterized at a 2048 px longest side; the prompt is the benchmark's own build_basic_prompt. Math tests render with KaTeX in headless Chromium, which is verified and installed before inference so a missing browser fails early instead of zeroing every math test.
  • CC-OCR. Only the multi-scene track is kept. Its scoring is the official per-image multiset F1 (characters for the Chinese sub-datasets, words otherwise), averaged within and then across sub-datasets. Prompts come from the dataset rows.
  • OmniDocBench. The official evaluator is not importable as a library (it installs a top-level package named src and pins old numpy/scipy/pandas), and its matching logic changes between versions. So each version's pinned evaluator runs in a virtualenv of its own, provisioned on first use, once per task after every page is generated. Each page's values are saved with the predictions, and the page averages are cross-checked against the evaluator's own summary.
    • Formula scoring (CDM) runs in the same job. At job start the CDM tasks install each version's verified runtime unless those exact versions are already on PATH, then render a test formula through that version's own CDM template before inference; a toolchain that cannot render fails the job there instead of scoring every formula zero.
      • v1.6: the runtime its README lists as verified (TeX Live 2025 from the frozen tlnet-final repository, ImageMagick 7.1.1-47, Ghostscript 9.55.0). Versions matter: Ghostscript 10.02 (Ubuntu 24.04's apt package) moved a formula score by 0.2 points.
      • v1.5: its CDM README also needs xelatex with xeCJK, the Source Han Sans SC font and Node.js 16.13.1.
      • With CDM in the job, there are no separate no-CDM variants: omnidocbench and omnidocbench_v15 (and their _en variants) report every metric in one run.
      • Usage, requirements and environment variables are in the README under "OmniDocBench formula scoring (CDM)".
    • The evaluator turns several environment problems into silent zeros. Three are handled here: a filelock pin, the headless OpenCV build (the GUI build needs libGL at import), and scikit-image for v1.5's CDM. Provisioning also imports the evaluator before inference.
    • If evaluation still fails, every output gets an infrastructure scoring error and no metrics are reported, so the task result carries an error. The predictions are still written for rescoring, so a many-hour run keeps them.
    • n_scorer_failures (pages the evaluator zeroed because its own scoring timed out or crashed) and eval_workers (its worker count) are reported with the metrics. v1.6's per-page time limits make the scores depend on both.
  • Saved results. Each scorer's per-instance result (olmOCR-bench's per-test outcomes, CC-OCR's per-image counts, OmniDocBench's per-page values) is saved with the predictions under scorer_results, a new generic key build_predictions keeps for every scorer. Every metric stores its own per-instance value (None outside its sub-dataset, category or language), and the edit-distance metrics are lower-is-better for pairwise analysis.
  • olmOCR-bench test errors. A test that raises fails, as in the official runner. It is also counted in n_test_errors, so a renderer crash can't pass for model failures.
  • Prompt family. Instruction-tuned checkpoints get each benchmark's own instruction; stage-1 checkpoints get the bare OCR style tag (next section).

Stage-1 prompts

A stage-1 checkpoint (-o prompt_templates=none -o system_prompt_style=style_and_length_v2) now sees exactly the prompt OLMo-core's stage 1 trains on (allenai/Olmo-core#875, merged into vision): the style tag alone. Defaults (instruction-tuned checkpoints) are unchanged. This PR also absorbs #401, now closed.

task stage-1 prompt before
dense_caption_captioner, and dense_caption under the stage-1 family long_caption: long_caption 65:
olmocr_bench, omnidocbench* olmocr: text_sft: <benchmark instruction>
cc_ocr_multi_scene* textocr: text_sft: <row prompt>

olmocr: is olmOCR page transcription, whose training answers write math as \( \) / \[ \] and tables as HTML (what OmniDocBench's evaluator reads). textocr: is scene text joined by spaces, which is exactly CC-OCR's order-free word-overlap scoring; the same content as an HTML table would score 0.10-0.20 there.

PixMo-Count (from #401): under prompt_templates=none the question is the bare lower-cased label, point_count: cows, as stage 1 trains on and mm_olmo sends; main already did this since #324. New here: the family defaults to uber_model_v2 when unset, like the pointing and OCR tasks, and an unknown family is refused instead of silently getting the templated question.

Scored with these prompts, OLMo-core's 32k-step --recipe=v2 stage-1 run (English defaults, olmo_core_vlm provider): olmocr_bench 51.1, cc_ocr_multi_scene_en 78.4, OmniDocBench v1.6 English text edit 0.247 (scored without CDM, before these tasks computed it in the job), pixmo_count 0.904, dense_caption_captioner avg 56.9.

New tests/evals/vision/test_ocr_prompts.py (11 tests) and test_pixmo_count_prompt.py (8, from #401); tests/evals/vision + tests/evals/suites: 312 passed, 2 skipped.

Other changes

  • OmniDocBench v1.6 runs with a deeper recursion limit. Its display-formula matcher recurses once per predicted formula, so a page where a model repeats a formula ~1,000 times crashed the whole evaluation. The candidate search is capped, so this changes no score; the numbers are identical on real pages for both versions.
  • OmniDocBench v1.6's evaluator starts its helper processes from a fork server. Its matching and TEDS threads fork a helper per LaTeX conversion and table, and a fork racing its page timeout can leave a lock held forever: Molmo2-4B's evaluation hung silently for over 16 hours, twice. Re-scoring saved Qwen3-VL-4B predictions gives identical per-page values except two pages the old path zeroed as failures, so v1.6 text edit moves from 0.0540 to 0.0527. v1.5 is unchanged.
  • An OmniDocBench evaluation that runs past 12h (OMNIDOCBENCH_EVAL_TIMEOUT_S) is stopped and reported like any other evaluator failure: a task error, no metrics, predictions kept for rescoring. Before, a hung evaluator held the job until its own limit and every generated page was lost.
  • Every CDM toolchain download (TeX Live installer, ImageMagick AppImage, Ghostscript, Node.js, font) is checked against a pinned SHA-256. A host other than Linux x86_64 gets a clear error when tools would have to be installed.
  • build_predictions keeps output.metadata["scorer_results"], keyed by scorer name, written with set_scorer_result (common/scorers/base.py). Other vision scorers that keep their own *_result key could move to it.
  • The olmo_core_vlm extra pins OLMo-core's current vision head, 42e65ea6 (was 2dad929a), which adds Molmo2 stage 1: tag-only caption prompt, mm_olmo v2 pointing data, and a general OCR group Olmo-core#875's stage-1 data and prompts. That OLMo-core's attention backends take a sinks argument (OLMo-core #872), which the provider's KV-cache backend rejected, so every olmo_core_vlm request failed. The backend now accepts it (and refuses it only together with a KV cache), and a test pins its forward to the parent's parameters. Greedy outputs are identical under both pins on all three checkpoint formats: an OLMo-core export (16/16 on pixmo_count + pixmo_points_eval_mp), a raw OLMo-core checkpoint (8/8) and the released Molmo2-4B mm_olmo checkpoint (16/16 on pixmo_count + pixmo_points_eval), so Molmo2 numbers from the old pin still hold. uv.lock changes only ai2-olmo-core; tests/providers, tests/evals/vision and tests/evals/suites: 445 passed, 5 skipped.

Results: Molmo2 checkpoints, English only

Molmo2 models support English only, so every column is restricted to English for a fair comparison. All numbers come from existing runs (one-step on Beaker B300).

model olmOCR-bench CC-OCR multi-scene, English OmniDocBench v1.5 English text edit ↓ OmniDocBench v1.6 English text edit ↓
Qwen3-VL-4B-Instruct (reference) 79.3 78.1 0.041 0.044
Molmo2-4B 35.4¹ 72.8¹ 0.444 0.442
Molmo2-8B 39.0 72.3 0.421 0.424
Molmo2-O-7B 31.5 72.0 0.461 0.464
Molmo2-4B-Pretrain 29.0¹ 63.8¹ 0.794 0.819²
Molmo2-8B-Pretrain 28.1 67.4 0.674 0.677²
Molmo2-O-7B-Pretrain 29.3 63.2 0.587 0.590
Molmo2-4B stage-1 v2 (OLMo-core --recipe=v2, step 32k)³ 51.1 78.4 0.236 0.247

Columns:

  • olmOCR-bench is all English; overall (x100).
  • CC-OCR: the official track score over the 8 English sub-datasets, i.e. cc_ocr_multi_scene_en's macro_f1 (x100). For full-benchmark runs it is the mean of their saved per-sub-dataset scores; the mean of all 13 reproduces each run's full-track score exactly.
  • OmniDocBench: normalized text edit distance on the pages annotated english (628 in v1.5, 755 in v1.6), lower is better. For full-benchmark runs this is their text_edit_english, the same page average as the _en tasks' text_edit. English-only Overall is not shown: it also needs table TEDS and formula CDM on the English pages, which the saved runs do not break out by language.

Setup:

  • Final checkpoints (step2000) run at max_crops=24 with the benchmarks' default instructions. Pretrain checkpoints (step32000) run at their trained 8 crops.
  • 4B and 8B run on olmo_core_vlm from the released mm_olmo checkpoints. Molmo2-O-7B runs on the HF provider (allenai/Molmo2-O-7B at 784410650d; O-7B-Pretrain converted to HF format by key renaming), because olmo_core_vlm cannot run it (see the heads-up below).
  • The released pretrain checkpoints never trained on the stage-1 OCR tags, so their rows keep the text_sft: <instruction> prompt they were first evaluated with. That form is no longer selectable on this branch; those runs used an eval-only branch that restores it (jasonr/ocr-eval-released-pretrain).

¹ From the earlier vision-branch runs of the same scorers.
² OmniDocBench v1.6's evaluator scores a page zero when matching it runs past its time limit, which pages that loop to the token cap often do: 549 of 1,651 pages for 4B-Pretrain and 238 for 8B-Pretrain (12-46 for the other Molmo2 checkpoints, 0 for Qwen3-VL-4B). v1.5 has no such limit.
³ A 4B stage-1 checkpoint trained with OLMo-core's --recipe=v2 data (allenai/Olmo-core#875), evaluated from its OLMo-core export on olmo_core_vlm at its trained 8 crops, with the stage-1 prompts described below (olmocr: / textocr: alone), on the _en tasks directly.

Validation against published numbers

Runs use the HF provider with greedy decoding, on the full benchmarks the published numbers use (olmocr_bench, cc_ocr_multi_scene, omnidocbench_v15).

model benchmark ours published
Qwen3-VL-4B-Instruct olmOCR-bench overall 79.3 79.2†
Qwen3-VL-4B-Instruct OmniDocBench v1.5 Overall 88.7 86.78†
Qwen3-VL-4B-Instruct OmniDocBench v1.5 text edit (lower is better) 0.054 0.055†
Qwen3-VL-4B-Instruct OmniDocBench v1.5 table TEDS 83.0 79.3†
Qwen2-VL-72B-Instruct CC-OCR multi-scene macro_f1 (x100) 78.6 77.95‡

† As reported in the Qianfan-OCR comparison tables.
‡ The CC-OCR paper, Table 2 (multi-scene OCR). Our run decodes greedily with the dataset's row prompts (8 GPUs, transformers==5.7.0, commit 5fc8fa2; this head computes CC-OCR scores the same way).

Heads-up, not changed here (#441): with transformers==5.17.0, Qwen3-VL degenerates into repetition loops on 10-37% of outputs. The same pages are clean with 5.7.0, and the image preprocessing is identical in both, so the regression is in 5.17's model or generation code. These results pin -o 'provider.dependencies=["transformers==5.7.0"]'. main now caps the hf extra at <5.13, a range not yet tested for this.

Heads-up, not changed here (#442): olmo_core_vlm cannot run Molmo2-O-7B. Its checkpoints use YaRN RoPE (factor 8), but the provider passes only rope_theta to OLMo-core's Molmo2 loader, whose olmo3_7B preset has no RoPE scaling. In practice every request hit a CUDA gather out-of-bounds assert. The HF provider runs the Hub's remote code, whose RoPE buffers match mm_olmo's exactly; the O-7B rows above use it. The 4B and 8B checkpoints (Qwen3, default RoPE) are unaffected.

Type of Change

  • Bug fix (non-breaking change that fixes an issue): the olmo_core_vlm KV-cache backend now accepts OLMo-core's sinks argument (see Other changes).
  • New feature (non-breaking change that adds functionality): the three OCR benchmarks, and scorer_results in saved predictions.
  • Breaking change (fix or feature that would cause existing functionality to not work as expected): dense_caption_captioner, and dense_caption under the stage-1 prompt family, now send long_caption: (was long_caption 65:), and pixmo_count refuses an unknown prompt family instead of templating the question. Stage-1 numbers on those tasks are not comparable with earlier runs; instruction-tuned defaults are unchanged. mm_olmo's captioner-family checkpoints, trained on long_caption 65:, are no longer evaluated, so dense_caption_captioner follows OLMo-core's stage 1 instead of keeping their prompt (stated in its docstring).
  • Documentation update: README sections on the OCR tasks and "OmniDocBench formula scoring (CDM)".
  • Refactoring (no functional changes)

Testing

  • Unit tests pass locally (pytest tests/ --ignore=tests/integration/): 2,944 passed, 18 skipped on this branch rebased onto main (ff7eb6d). One failure is environmental: tests/inference/test_tokenizer_loading.py::test_qwen2_checkpoint_with_llama_tokenizer_class_round_trips needs transformers >= 5.8, and my local environment has 5.7.0 (the version these runs pin). CI uses the lock (5.8.1).
  • Integration tests pass (if applicable): CI's storage integration job passes. The benchmarks also ran end to end on Beaker: the sweep above, plus one-step OmniDocBench runs of both versions whose 64 pages match a local run with the same pinned toolchain to every digit (v1.6 CDM 32.6425, overall 32.2861; v1.5 CDM 48.3762, overall 30.0399).
  • New tests added for new functionality: tests/evals/vision/test_ocr_prompts.py (11), test_pixmo_count_prompt.py (8) and test_ocr_scoring.py (26). The last covers the three scorers and their metrics, the scorer results and per-instance metric values saved with the predictions (in and out of each metric's scope), and an OmniDocBench evaluator failure reaching the TaskResult as an error. It stubs the olmOCR test runner and the OmniDocBench evaluator.
  • CI passes: lint, type check, tests on Python 3.12 and 3.13, storage integration, build.
  • Ported from a vision-based branch: re-scoring the same saved Qwen3-VL-4B generations through this branch reproduced that branch's numbers exactly. Every scorer was also checked on real data with a correct-answer oracle (every reference output) and with empty outputs.

Checklist

@jason718
jason718 force-pushed the jasonr/ocr-benchmarks branch from 28fcb0c to 420e8a1 Compare September 25, 2026 13:22
@jason718 jason718 changed the title Add olmOCR-bench, CC-OCR multi-scene and OmniDocBench v1.5/v1.6 Add olmOCR-bench, CC-OCR multi-scene and OmniDocBench v1.5/v1.6 (stacked on #324) Sep 25, 2026
@jason718
jason718 changed the base branch from vision to jasonr/vision-split-5-multiimage-docs September 25, 2026 13:22
@jason718
jason718 force-pushed the jasonr/vision-split-5-multiimage-docs branch from 6a5f1ce to 569bbb1 Compare September 25, 2026 23:27
@jason718 jason718 changed the title Add olmOCR-bench, CC-OCR multi-scene and OmniDocBench v1.5/v1.6 (stacked on #324) Add olmOCR-bench, CC-OCR multi-scene, OmniDocBench v1.5/v1.6 and TextOCR (stacked on #324) Sep 26, 2026
@jason718
jason718 force-pushed the jasonr/ocr-benchmarks branch from 6ba8958 to bfb9c5e Compare September 26, 2026 08:10
@jason718 jason718 changed the title Add olmOCR-bench, CC-OCR multi-scene, OmniDocBench v1.5/v1.6 and TextOCR (stacked on #324) Add olmOCR-bench, CC-OCR multi-scene and OmniDocBench v1.5/v1.6 (stacked on #324) Sep 26, 2026
@jason718 jason718 self-assigned this Sep 26, 2026
Base automatically changed from jasonr/vision-split-5-multiimage-docs to main September 28, 2026 16:59
@jason718
jason718 force-pushed the jasonr/ocr-benchmarks branch from fcc9534 to d9f6f7e Compare September 28, 2026 17:53
@jason718 jason718 changed the title Add olmOCR-bench, CC-OCR multi-scene and OmniDocBench v1.5/v1.6 (stacked on #324) Add olmOCR-bench, CC-OCR multi-scene and OmniDocBench v1.5/v1.6 Sep 28, 2026
@jason718
jason718 requested a review from a team as a code owner September 30, 2026 20:34
@jason718
jason718 force-pushed the jasonr/ocr-benchmarks branch from bb023fd to bb2505b Compare October 1, 2026 02:55

@gregorybchris gregorybchris left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This review was generated by an agent following REVIEW_GUIDE.md. It is not from a human reviewer. Reply in the PR thread and a maintainer will follow up.

Thanks for this! Running each benchmark's official scorer is the right call, and the Qwen3-VL-4B parity table plus the up-front toolchain probes are strong work. I found five things to fix before merge and a few smaller ones.

The first three affect persisted results and failure visibility. All three come from how the new metrics and the OmniDocBench failure path interact with existing framework defaults. Items 4 and 5 affect task identity and prompt parity for tasks that already exist.

I ran ruff check, ruff format --check, ty check and pytest tests/ --ignore=tests/integration on the PR head (bb2505b). All pass: 2,884 passed, 35 skipped. CI is green. I reproduced every finding below on that head with a small script using fake responses. None of them needed a GPU.

Blocking

  1. src/olmo_eval/runners/io/builders.py:96-104 (via src/olmo_eval/evals/vision/scoring/cc_ocr.py:100, src/olmo_eval/evals/vision/scoring/olmocr_bench.py:147, src/olmo_eval/evals/vision/benchmarks/omnidocbench.py:302)
    The per-benchmark results the scorers write to output.metadata never reach the saved predictions. build_predictions copies only an allowlist of output-metadata keys (execution_result, scoring_errors, judge_result, answer_format_correct). cc_ocr_result, olmocr_bench_result and omnidocbench_result are not on that list. I built predictions for scored cc_ocr_multi_scene and omnidocbench responses, and each model_output entry had only text, extracted_answer, num_chars and sample_metrics. So the per-test pass/fail and explanations for olmOCR-bench, the per-image right/gt/pred counts for CC-OCR, and the per-page text/table/formula values for OmniDocBench are lost after the run. The description says "Per-page results are stored on each response" and that predictions are kept "for rescoring". That is true only in memory. None of the category breakdowns can be recomputed from the saved files, and a failing test cannot be told apart from a genuine miss.
    The allowlist is a deficiency in the framework, not in this PR. Each new scorer has to remember to add its key there. Could we fix it once? For example, persist a namespaced output.metadata["scorer_results"] dict (keyed by scorer name) in build_predictions, and have these three scorers write there. The smaller fix is to add the three keys to the allowlist. Please add a test that builds predictions from a scored response for each benchmark and asserts the result dict is present.

  2. src/olmo_eval/evals/vision/scoring/cc_ocr.py:128,141, src/olmo_eval/evals/vision/scoring/olmocr_bench.py:171,183,195, src/olmo_eval/evals/vision/scoring/omnidocbench.py:887,923,951
    None of the new metrics override compute_instance, so each persisted per-instance value falls back to the scorer channel. This is the recurring compute_instance pitfall, and the values it stores are wrong. What I observed:

    • CC-OCR: an instance from TotalText with F1 1.0 is stored with IC15: 1.0, micro_f1: 1.0 and macro_f1: 1.0. An IC15 instance with F1 0.0 is stored with TotalText: 0.0. Each instance gets a value for every sub-dataset metric, including the 12 it does not belong to.
    • OmniDocBench: a page with text edit distance 0.2 is stored with text_edit: 0.8, overall: 0.8 (the aggregate is on a 0-100 scale), table_teds: 0.8, text_edit_chinese: 0.8 (the page is English), and n_scorer_failures: 0.8. A lower-is-better metric is persisted as its complement.
    • olmOCR-bench: every category and type_* metric stores the page's overall pass fraction, including for categories the page has no tests in.

    Pairwise analysis reads these values, so instance-level comparisons on these tasks would be wrong while the aggregates look right. Please override compute_instance on each metric so it returns the per-instance value in the metric's own units, and None when the instance is outside the metric's scope (another sub-dataset, another category, another language). Also set supports_pairwise_scorer_fallback() to False where the scorer value is not the metric's per-instance value. Separately, pairwise_higher_is_better() defaults to True, which is wrong for text_edit, formula_edit, read_order_edit and their slices. Please return False for those. Please add a regression test that builds predictions and checks the persisted instance_metrics for one in-scope and one out-of-scope instance per metric family.

  3. src/olmo_eval/evals/vision/benchmarks/omnidocbench.py:283-293
    When the evaluator fails or times out, the task returns NaN for every metric and the run is reported as a success. I stubbed run_official_evaluation to raise. compute_metrics returned overall: nan and evaluator_failed: 1.0. finalize_task (runners/asynq/preparation.py:160-190) then builds a TaskResult whose error is set only from scoring_errors marked as infrastructure. Nothing marks this failure, so error stays None. Keeping the predictions is the right goal: build_predictions runs after compute_metrics, so raising would lose them. But an infrastructure failure must not look like a finished run. There is a second problem I could not check without a database: metrics is a JSONB column, Postgres JSONB rejects NaN tokens, and I found no NaN sanitizing in storage/.
    The existing mechanism already handles the "keep predictions, mark incomplete" case. Could we record the failure on each output instead, for example output.metadata["scoring_errors"] = {"omnidocbench": {"error": "...", "infrastructure": "true"}}? Then _infrastructure_error sets TaskResult.error, the predictions are still written, and the error reaches storage. It would also be good to omit the metrics, or report them as absent rather than NaN. Please add a test for the failure path that asserts the task result carries an error.

  4. src/olmo_eval/common/types/base.py:248, src/olmo_eval/evals/tasks/common/base.py:300
    Adding presence_penalty to SamplingParams changes the task hash of every task in the registry. TaskConfig.to_dict serializes asdict(self.sampling_params), so each config gains "presence_penalty": null. I computed hashes with and without the new key: gsm8k moves from 4f68bf90a407205a to 496d06cf88d1ed62, and humaneval, pixmo_count and dense_caption_captioner move the same way. After merge, new runs of unchanged tasks no longer group with existing stored results. Earlier SamplingParams additions (truncate_prompt_tokens, truncation_side) had the same effect, so this is a gap in how the hash treats new defaulted fields.
    Also, no task in this PR sets the field. It is passed through for vLLM, vLLM server and HF, but litellm (inference/providers/litellm.py:136), olmo_core and olmo_core_vlm drop it silently, so a config could record a penalty that was never applied. Could we move presence_penalty into its own PR that lands with a task that uses it? That PR should either handle every provider or reject the field where it is unsupported, and it should say clearly that it moves every task hash. If it stays here, please make those two changes and state the hash change in the description. A longer-term framework fix would be to leave fields at their default None out of the hash input, so new optional knobs stop moving every hash.

  5. src/olmo_eval/evals/vision/benchmarks/dense_caption.py:201,286
    dense_caption_captioner, and dense_caption under style_and_length_v2, change their prompt in place from long_caption 65: to long_caption:. The prompt is not part of TaskConfig.to_dict. These tasks get new hashes only because of the unrelated change in item 4. The old prompt was verified verbatim against an mm_olmo DenseCaptionEval-test dump, and mm_olmo's captioner-family checkpoints (for example the siglip2-cap-stage1 runs) were trained with it. After this change those checkpoints can no longer be evaluated with their training prompt. Our convention is to keep a bug-compatible reference under the existing name and ship the new behavior under a new name. Could the OLMo-core stage-1 prompt be a new variant or task (for example dense_caption_captioner:stage1), with the mm_olmo form left under the current name? If mm_olmo captioner checkpoints are no longer evaluated at all, please say so in the description and docstring, and we can accept the in-place change.

Non-blocking

  1. Scorer unit tests (src/olmo_eval/evals/vision/scoring/)
    The description offers these. Please add them. New scoring logic needs direct tests, and items 1-3 would have been caught by them. Cases I'd like to see:

    • score_ocr_sample: word-level and character-level, ### and *** stripping, the empty prediction.
    • CcOcrTrackMetric and CcOcrDatasetMetric: macro and micro F1 over two sub-datasets.
    • olmOCR-bench category and overall aggregation from stubbed per-test results, including the synthesized baseline.
    • OmniDocBench: _page_means, _summary, _count_failures, and OmniDocBenchPageMetric zero-fill on and off. These can use small metric_result fixtures without the evaluator.
    • _presence_penalty_processor: prompt tokens are not penalized, and a repeated token is penalized once.
  2. CC-OCR parity (src/olmo_eval/evals/vision/benchmarks/cc_ocr.py)
    The validation table covers olmOCR-bench and OmniDocBench v1.5 but not CC-OCR. The CC-OCR evidence matches our scorer against itself (recomputed versus full run), not against a reference. Could we add one published multi-scene number next to ours, for example a Qwen2-VL or Qwen2.5-VL row from the CC-OCR paper?

  3. src/olmo_eval/evals/vision/scoring/omnidocbench.py:777
    v1.6 zeroes pages whose matching passes its per-page timeout. Footnote 2 reports 549 of 1,651 pages for 4B-Pretrain. The worker count comes from OMNIDOCBENCH_EVAL_WORKERS or os.cpu_count() // 4, so the same predictions may score differently on a host with different CPU or contention. Neither value is recorded. Could we record the worker count and the number of timed-out pages in the task result, so two runs whose scores differ can be traced to this?

  4. src/olmo_eval/evals/vision/scoring/omnidocbench.py:339,436,472
    The CDM toolchain downloads executables (the ImageMagick AppImage, Ghostscript, Node.js, the TeX Live installer and fonts) and runs them without verifying a checksum. It also calls apt-get from task code. For reproducibility and supply-chain safety, could we pin a SHA-256 for each download and check it? It would also help to fail early with a clear message on non-Linux or non-x86_64 hosts. Today a macOS user gets a failed Linux TeX Live install.

  5. src/olmo_eval/evals/vision/scoring/olmocr_bench.py:114
    A test that raises counts as a failure. That matches the official runner, but a Chromium crash in the middle of a run would then look like the model failing math tests. Once the result dict is persisted (item 1), could we also report a count of tests that raised, next to the pass rates?

  6. Follow-up issues
    The two heads-ups (Qwen3-VL degeneration with transformers==5.17.0, and olmo_core_vlm ignoring YaRN RoPE for Molmo2-O-7B) are worth tracking. The second one gives a CUDA assert instead of a clear error. Could you file an issue for each and link them here? The first issue should name the last known-good and first known-bad transformers versions. The second should say the provider should refuse checkpoints with rope_scaling until it supports them.

Nits

  • Nit: src/olmo_eval/evals/vision/benchmarks/omnidocbench.py:228 version: str could be Literal["v1.6", "v1.5"]. The same applies to kind: str at src/olmo_eval/evals/vision/scoring/cc_ocr.py:146.
  • Nit: src/olmo_eval/evals/vision/benchmarks/cc_ocr.py:83 decodes all 13 TSVs (523 MB at the pinned revision) and keeps them in an lru_cache for the life of the process, including for _en runs and limit runs.
  • Nit: n_scorer_failures is a run-level count, but it is copied onto every page's result. It could live on the task result instead.
  • Nit: _response_text is duplicated in scoring/cc_ocr.py and scoring/olmocr_bench.py.
  • Nit: Docstrings and suite descriptions use exact counts ("1,403 PDFs", "8 English sub-datasets", "755 of 1,651"). The data is pinned, so these are less likely to go stale than usual, but the guide asks us to keep docstrings general.
  • Nit: The OLMo-core pin bump, the dense-caption and PixMo-Count prompt changes, and the sinks fix are independent of the OCR benchmarks. Splitting them out would make this easier to review and to revert.

Before merge

Please fix items 1-5 and add the regression tests named in each. Then add the scorer unit tests from non-blocking item 1. After that you may merge once CI is green. Please also file the two follow-up issues from non-blocking item 6 and link them here.

Comment thread src/olmo_eval/common/types/base.py Resolved
@jason718
jason718 force-pushed the jasonr/ocr-benchmarks branch from bb2505b to 5fc8fa2 Compare October 2, 2026 04:44
Three document-OCR benchmarks that hand the model a page image and grade what
it writes back, each scored the way its leaderboard is.

olmocr_bench runs the 7,019 unit tests of olmOCR-bench through the official
`olmocr` scorer, pinned to the release behind the published numbers, and
reports the mean of the eight category pass rates. Pages ship as PDFs and are
rasterized to a 2048px longest side. Math tests render with KaTeX in headless
Chromium, which is verified, and installed if missing, before inference.

cc_ocr_multi_scene is CC-OCR's multi-scene OCR track with the official
evaluator vendored: per-image F1 of the word (Chinese: character) multiset,
averaged within and then across its 13 sub-datasets.

omnidocbench (v1.6) and omnidocbench_v15 run each version's pinned official
evaluator out of process, once per task: it is not importable as a library,
and its matching changes between versions. Per-page results are stored on
each response and the page averages are checked against the evaluator's own
summary. Provisioning imports the evaluator before inference, and pins around
dependencies it would otherwise turn into silent zeros (filelock, the GUI
OpenCV build, scikit-image). The v1.6 matcher runs with a deeper recursion
limit, and an evaluation failure reports NaN metrics instead of discarding
the run's predictions. CDM needs a LaTeX toolchain, so each version also has
a `_no_cdm` variant.

The instruction follows the checkpoint's prompt family, as for the pointing
and captioning tasks. Validated on Qwen3-VL-4B: olmOCR-bench 79.3 (published
79.2) and OmniDocBench v1.5 text edit 0.054 (published 0.055).
A stage-1 checkpoint (-o prompt_templates=none -o
system_prompt_style=style_and_length_v2) now sees exactly its OLMo-core
stage-1 training prompt, the style tag alone (OLMo-core #875):

* dense_caption_captioner, and dense_caption under the stage-1 family, send
  the bare `long_caption:` instead of `long_caption 65:` (the change in
  #401); default_inference_len is gone.
* The OCR tasks send the task's OCR tag instead of `text_sft: <instruction>`:
  olmocr_bench and OmniDocBench `olmocr:`, CC-OCR `textocr:`. Under
  prompt_templates=none the question is empty, as for a caption. The
  default (instruction-tuned) prompt is unchanged: the benchmark's
  instruction.

English-only variants, same official scoring on a subset:
cc_ocr_multi_scene_en (the 8 sub-datasets without `zh`, 2,000 images;
macro_f1 averages over them) and an `_en` variant of each OmniDocBench task
(pages annotated `english`: 755 of v1.6, 628 of v1.5). New suite `ocr_en`:
olmocr_bench, cc_ocr_multi_scene_en, omnidocbench_en.

11 new tests; tests/evals/vision and tests/evals/suites: 304 passed.
The v1.6 evaluator matches pages and scores tables in worker threads that
fork a helper process per LaTeX conversion and table, and abandons threads
that pass the page timeout. A fork from those threads can leave loguru's
at-fork lock held forever, which hung Molmo2-4B's evaluation with no output
for over 16 hours. Starting the helpers from a fork server avoids forking the
threaded process; re-scoring saved Qwen3-VL-4B predictions gives identical
per-page values except two pages the fork path had zeroed.
A hung evaluator held the run until the job's own limit and lost every
generated page with it. Past a 12h cap (OMNIDOCBENCH_EVAL_TIMEOUT_S) the
evaluation now fails like any other evaluator error: NaN metrics, with the
predictions written for rescoring.
The CDM tasks used to stop before inference when pdflatex, ImageMagick 7,
Ghostscript or Node.js was missing, which left Beaker runs on the _no_cdm
variants and formula scores to a separate local step. They now install
whatever is missing (TeX Live scheme-small with CDM's packages, the
ImageMagick 7 AppImage with a pngalpha PDF delegate, Node.js, Ghostscript
from apt) and render a test formula through the same template CDM uses, so
a broken toolchain fails the job up front instead of scoring formulas zero.
Stage-1 checkpoints (-o prompt_templates=none) get the bare lower-cased label,
point_count: <label>, which is what they train on; the default stays the
released templated question (uber_model_v2), and an unknown family is refused.
Moved here from #401, which is closed in favour of this PR.
Beaker's image lacks the system libraries the ImageMagick AppImage links
against (harfbuzz, fontconfig, freetype, fribidi, X11), so the render check
stopped the job; they are now installed from apt with Ghostscript. TeX Live
comes from a fixed mirror first, since mirror.ctan.org redirects to random
mirrors and some serve certificate chains that do not verify, and downloads
retry.
Moves the olmo_core_vlm extra from 2dad929a to the current vision head,
which adds OLMo-core#875 (Molmo2 stage-1 data and prompts). That OLMo-core's
attention backends take a sinks argument (#872), which the provider's KV-cache
backend rejected, failing every multimodal request; it now accepts it and
refuses it only together with a KV cache. A test pins the cached backend's
forward to the parent's parameters.
CDM follows the renderer: Ghostscript 10.02 (Ubuntu 24.04's apt package)
moved a v1.6 formula score by 0.2 points against Ghostscript 9.55. The job
now installs the runtime the v1.6 README lists as verified (TeX Live 2025
from the frozen tlnet-final repository, ImageMagick 7.1.1-47, Ghostscript
9.55.0) unless those exact versions are already on PATH, adds the pieces
v1.5's CDM README requires (xelatex with xeCJK, the Source Han Sans SC
font, Node.js 16.13.1), and checks each version's own formula template
renders before inference.
How the CDM tasks set up their toolchain at job start, the versions each
release pins, what the setup needs (network, apt), the environment
variables, and a Beaker launch example.
Molmo2 models read English only, so the default task names now run the
English subsets: cc_ocr_multi_scene the 8 English sub-datasets, and the
four omnidocbench tasks the pages annotated english. The whole benchmarks
move to _full variants (cc_ocr_multi_scene_full, omnidocbench_full,
omnidocbench_no_cdm_full, omnidocbench_v15_full,
omnidocbench_v15_no_cdm_full), which keep the per-language text-edit
slices; the English tasks drop them, since they would read 0.0. The ocr
suite follows the defaults, and ocr_full replaces ocr_en for every
language. The _en names are gone, and the prompt tests use the new names.
Restores the naming before b865b2c: each benchmark is either the full
benchmark (cc_ocr_multi_scene, omnidocbench, ...) or its English part
(cc_ocr_multi_scene_en, omnidocbench_en, ...), with suites ocr and ocr_en.
The _en variants are the documented default for Molmo2, which reads English
only; the full ones stay for multilingual models. The English OmniDocBench
tasks keep b865b2c's one fix: no per-language text-edit slices, which read
0.0 on English-only runs.
With the CDM toolchain installed at job start, omnidocbench and
omnidocbench_v15 (and their _en variants) run anywhere the evaluation does
and report every metric the _no_cdm variants did, plus CDM and overall.
Removes omnidocbench_no_cdm, omnidocbench_v15_no_cdm and their _en
variants, the text_score metric only they used, and the task's with_cdm
switch; the prompt tests use the CDM tasks with the toolchain stubbed.
build_predictions copied only a fixed list of output-metadata keys, so a
scorer's per-instance details (per-test outcomes, per-image counts,
per-page values) were dropped from the saved predictions. Scorers can now
record a result under output.metadata["scorer_results"][scorer_name] with
set_scorer_result / get_scorer_result, and build_predictions keeps the
whole dict, so new scorers no longer need to be added to the list.
The scorer records each image's statistics as its scorer result, so they
reach the predictions. Each metric now stores its own per-instance value:
a sub-dataset metric stores the image's F1 for images of that sub-dataset
only, and the track metrics store the image's F1, instead of every metric
reusing the scorer channel. kind is a Literal, and the scorers share
response_text from vision/scoring/common.

Only the TSVs of the sub-datasets a task runs are decoded; all of them must
still be present. Docstrings no longer give exact counts.
The scorer records each page's test outcomes as its scorer result, so the
pass/fail and explanation of every test reach the predictions. Category,
test-type and overall metrics store the page's own value, None when the
page has no tests in scope, instead of the page's overall pass fraction.

A test that raises still fails, as in the official runner, but is now
flagged, and n_test_errors counts them (lower is better), so a renderer
crash cannot pass for model failures.
When the official evaluator fails or times out, every output now carries an
infrastructure scoring error and no metrics are reported, so the task
result has an error instead of NaN metrics on a run that looks finished.
The predictions are still written for rescoring.

Each page's values are saved as the scorer result. Page metrics store the
page's own value (raw edit distance, x100 TEDS/CDM, zero-filled where the
evaluator does, None outside a slice), and the edit-distance metrics are
lower-is-better. The run-level scorer-failure count moves from every page
to the task metrics as n_scorer_failures, next to eval_workers, the
evaluator's worker count, which v1.6's time limits make scores depend on.

Every CDM toolchain download is checked against a pinned SHA-256, and a
host other than Linux x86_64 gets a clear error when tools are missing.
version is a Literal.
dense_caption_captioner follows OLMo-core's stage-1 prompt; say in its
docstring that mm_olmo's captioner checkpoints were trained on
"long_caption 65:" and are no longer evaluated. The OCR suite descriptions
drop exact counts.
Covers the CC-OCR, olmOCR-bench and OmniDocBench scorers and metrics, the
scorer results and per-instance metric values saved with the predictions,
and an OmniDocBench evaluator failure reaching the task result as an
error. The olmOCR test runner and the OmniDocBench evaluator are stubbed.
@jason718

jason718 commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the thorough review. Everything below is in 39895a0..6a12b69, on top of the latest main (ff7eb6d).

Blocking

  1. Scorer results reach the predictions. I took the framework fix. build_predictions now keeps output.metadata["scorer_results"], a dict keyed by scorer name and written with set_scorer_result / read with get_scorer_result (common/scorers/base.py). The three OCR scorers write there, so new scorers need no allowlist entry. Other vision scorers that keep their own *_result key could move to it in a follow-up. Tests: TestCcOcrMetrics::test_predictions_keep_the_scorer_result, TestOlmocrBench::test_a_raising_test_fails_and_is_flagged, TestOmniDocBenchTask::test_predictions_keep_each_page_result.

  2. Per-instance values. Every metric overrides compute_instance and returns False from supports_pairwise_scorer_fallback. Here is what each stores:

    • CC-OCR: a sub-dataset metric stores the image's F1 only for images of that sub-dataset (otherwise None), and macro_f1 / micro_f1 store the image's F1.
    • olmOCR-bench: category and type_* metrics store the page's pass rate over its tests of that category or type (None if it has none), and overall stores the mean over the page's own categories.
    • OmniDocBench: page metrics store the page's own value in the metric's units: raw edit distance, TEDS/CDM x100, zero-filled where v1.6 zero-fills, None outside a language or subset slice. overall uses the leaderboard formula over the terms the page has.

    The edit-distance metrics and their slices return False from pairwise_higher_is_better, as does the new n_test_errors. Tests check one in-scope and one out-of-scope instance per family: test_instance_metrics_are_scoped_to_the_sub_dataset, test_instance_metrics_cover_the_page_own_tests, test_instance_metrics_are_each_metric_own_value and test_instance_metrics_skip_missing_pages_on_v15. Your example page with edit distance 0.2 now stores text_edit: 0.2, and the scorer channel still holds 0.8.

  3. Evaluator failure. Done as you suggested. Each output gets scoring_errors["omnidocbench"] with infrastructure: "true" and the exception's type and message. compute_metrics returns no metrics, so no NaN is produced or stored, and the predictions are still written. test_evaluator_failure_is_an_infrastructure_error stubs run_official_evaluation to raise, runs finalize_task, and asserts that TaskResult.error is set, the metrics are empty, and every prediction carries the error. A timeout past OMNIDOCBENCH_EVAL_TIMEOUT_S takes the same path, and the README now says so.

  4. presence_penalty. Dropped from this PR. No task here depends on it: the validation runs decode greedily. gsm8k hashes to 4f68bf90a407205a again. If it comes back, it'll be its own PR with a task that uses it, provider coverage or rejection, and the hash change stated. I agree that leaving None-default fields out of the hash input is the better long-term fix.

  5. dense_caption_captioner prompt. mm_olmo's captioner-family checkpoints are no longer evaluated, so we're keeping the in-place change. The task docstring and the description's breaking-change line now say that those checkpoints were trained on long_caption 65: and are no longer evaluated.

Non-blocking

  1. Scorer unit tests are in tests/evals/vision/test_ocr_scoring.py (26 tests):

    • score_ocr_sample: word and character level, ### / ***, empty prediction;
    • CC-OCR macro and micro F1 over two sub-datasets;
    • olmOCR-bench category, type and overall aggregation with the baseline category, through a stub olmocr.bench.tests;
    • OmniDocBench _page_means, _summary, _count_failures, and zero-fill on (v1.6) and off (v1.5).

    _presence_penalty_processor left with item 4.

  2. CC-OCR parity. Qwen2-VL-72B-Instruct on the full cc_ocr_multi_scene, greedy, scores 78.6 macro_f1 vs 77.95 in the CC-OCR paper's Table 2. It's now in the description's validation table.

  3. Worker count and zeroed pages. n_scorer_failures and eval_workers are now reported with the task metrics. n_scorer_failures counts the evaluator's own timeout, error and fallback counters.

  4. Toolchain downloads. Every download is checked against a pinned SHA-256, and a mismatch deletes the file and stops the task. A host other than Linux x86_64 gets a clear error as soon as a tool would have to be installed. apt-get remains for the AppImage's system libraries, perl and fontconfig, and runs only when the toolchain has to be installed and those are missing.

  5. Tests that raise. Each such test is flagged raised in the saved per-test results and counted in a new n_test_errors metric.

  6. Follow-up issues: Qwen3-VL degenerates into repetition loops with transformers 5.17.0 (clean on 5.7.0) #441 (Qwen3-VL loops: last known good 5.7.0, first known bad 5.17.0; nothing in between tested, including main's current >=5.8.0,<5.13) and olmo_core_vlm: refuse checkpoints with RoPE scaling (Molmo2-O-7B's YaRN gives a CUDA assert) #442 (olmo_core_vlm should refuse checkpoints with RoPE scaling).

Nits

  • version and kind are Literals.

  • CC-OCR reads only the TSVs of the sub-datasets a task runs. It still checks that all 13 files are present, and every row's sub-dataset.

  • n_scorer_failures is a run-level metric now, not copied onto each page.

  • _response_text is gone; both scorers use response_text from vision/scoring/common.py.

  • Exact counts are out of the docstrings and suite descriptions.

  • Splitting. I kept these together because they're one dependency chain:

    For reverting, the pin with the sinks fix is 25ac5ed and PixMo-Count is ff248bd. The dense-caption prompt shares 4f6e09f with the OCR tasks' stage-1 prompts.

@jason718
jason718 requested a review from gregorybchris October 2, 2026 17:24

@gregorybchris gregorybchris left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This review was generated by an agent following REVIEW_GUIDE.md. It is not from a human reviewer. Reply in the PR thread and a maintainer will follow up.

Approving. All five blocking items from the earlier review are addressed on 6a12b69:

  1. Scorer results are saved with the predictions through the new scorer_results key.
  2. Every metric stores its own per-instance value, with None outside its scope. Edit distances are marked lower-is-better.
  3. An OmniDocBench evaluator failure or timeout is recorded as an infrastructure scoring_error. The task result carries the error, no NaN metrics are stored, and the predictions are kept.
  4. presence_penalty is dropped, so task hashes are unchanged.
  5. The in-place dense_caption_captioner prompt change is now documented as dropping mm_olmo captioner checkpoints.

The scorer unit tests, CC-OCR parity row, run-level failure and worker counts, pinned SHA-256 checksums, n_test_errors metric and follow-up issues #441 and #442 cover the non-blocking items. Locally, ruff passes and pytest tests/ --ignore=tests/integration gives 2,911 passed and 35 skipped. CI is green. Thanks for the thorough follow-up!

@jason718
jason718 merged commit 87f87c4 into main Oct 2, 2026
8 checks passed
@jason718
jason718 deleted the jasonr/ocr-benchmarks branch October 2, 2026 17:59
jason718 pushed a commit that referenced this pull request Oct 2, 2026
Conflicts were additions on both sides: the benchmark imports and the README
task table now carry both the OCR tasks and the MolmoPoint pointing tasks.
The MolmoPoint tasks are a Pointing row (suite molmopoint), not a separate
family.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants