Skip to content

Molmo2 stage 1: academic QA group, PixMo-Clocks group, v3 recipe (50k steps); drop TallyQA's COCO val2017 images - #887

Merged
jason718 merged 10 commits into
visionfrom
jasonr/stage1-academic-qa
Oct 2, 2026
Merged

jason718 merged 10 commits into
visionfrom
jasonr/stage1-academic-qa

Conversation

@jason718

@jason718 jason718 commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Based on vision at 05885ef (after #875, #893, #894 and the v3.0.0 main sync).

Stage 1 is going to be mixed into text midtraining, which has about 100B text tokens, so it needs more distinct multimodal data than PixMo-Cap's ~717k images, which a stage-1 run already sees about 4 times. This PR adds:

  1. An academic QA group (--academic_rate): stage 2's large synthetic QA sets, copied into stage 1 (stage 2 keeps them). The training set of a benchmark stage 2 is evaluated on is never a source.
  2. A PixMo-Clocks group (--clock_rate), so clock reading can be learned without stage 2.
  3. A v3 recipe for 50,000 steps: caption 0.33, pointing and counting 0.16, OCR 0.34, academic QA 0.14, clocks 0.03. The default recipe stays v1 at 32,000 steps.
  4. TallyQA without COCO val2017 images. This changes stage 2 too, which reads TallyQA's train split.

It also makes the stage-1 prompt family tag every style, which the new sources depend on (Prompt).

Results

The v3 run molmo2-stage1-4b-v3-50k-20260930 (beaker, 4×8 B300 on holmes, 50k steps, finished 2026-10-01) trained this PR's code at 163d1c1f9 (this PR plus #893). Every file this PR touches is identical to the launch commit, except the removal of the unused share caps, which leaves the mixture weights unchanged (max difference 6e-17).

All rows are from olmo-eval #412 with the stage-1 prompts (-o prompt_templates=none -o system_prompt_style=style_and_length_v2). v3 and the released checkpoint were scored at #412's 5fc8fa21. v1 and v2 were scored on 2026-09-27 at f1f3b2b3; the caption, pointing and counting task code is the same at both commits.

Metric Released Molmo2-4B-Pretrain v1 32k v2 32k v3 50k
Caption avg 57.7 57.1 56.9 56.8
Caption recall 44.3 43.1 43.1 43.6
Caption consistency 71.1 71.0 70.8 69.9
PixMo-Points F1 81.5 78.4 79.4 78.2
SA-Co Gold subset F1 66.3 62.0 68.1 67.2
SA-Co Gold 4k F1 55.7 54.0 83.7 83.7
SA-Co Gold 4k absent-object accuracy 48.0 46.1 84.3 84.7
PixMo-Count val 88.5 89.6 90.4 91.3
PixMo-Count test 88.0 87.8 87.6 85.2
olmOCR-Bench 26.5 26.5 51.1 54.0
CC-OCR multi-scene, English (macro F1) 19.6 6.1 78.4 79.2
OmniDocBench v1.6 English, text edit (lower is better) 0.971 0.980 0.247 0.211
OmniDocBench v1.5 English, text edit (lower is better) 0.970 0.979 0.236 0.212
  • OCR improves. Against v2: olmOCR-Bench +2.9, CC-OCR +0.8, and OmniDocBench text edit 0.036 lower on v1.6 and 0.024 lower on v1.5. With formula grading (CDM), v3's OmniDocBench overall is 66.7 on v1.6 and 70.3 on v1.5. The v1/v2 eval skipped CDM, so OmniDocBench is compared on text edit only. 9 of the 755 v1.6 pages failed to score for v3.
  • Caption and pointing are flat to about 1 point lower. Caption avg is 56.8 against v2's 56.9 (recall +0.5, consistency −0.9). PixMo-Points F1 is −1.2 and the SA-Co subset −0.9; SA-Co 4k is unchanged. v3 sees caption and pointing data about as often as v2 does (4.2 and 4.4 passes), at lower rates over more steps.
  • Counting is mixed. Val is +0.9 and test −2.4. All answers parse.
  • Longer training would not help. v3 at step 40,000 is within about 1 point of step 50,000 on every caption, pointing, olmOCR-Bench and CC-OCR metric (OmniDocBench was not run at 40k). v2's 24k, 28k and 32k checkpoints were also within about 1 point of each other.
  • The released checkpoint was trained on 0.6 caption and 0.3 pointing. It still leads on caption (+0.9 avg over v3) and PixMo-Points (+3.3), but its SA-Co 4k score is 28 points lower: it handles only 48% of absent-object queries correctly, against v3's 85%. It has no OCR training. Its scores reproduce mm_olmo's own eval of it: PixMo-Points 81.5 vs 81.6, SA-Co 4k 55.7 vs 55.5. Its caption prompt here is long_caption: rather than the long_caption 65: it was trained on; mm_olmo with that prompt gets avg 58.1 and recall 45.6.
  • What these evals do not measure is the academic QA group (9.1% of v3's loss). Its effect, if any, shows after stage 2 or midtraining.

Which stage-2 sets go into stage 1

Rule: the training set of a benchmark the stage-2 checkpoints are evaluated on stays stage-2 data. The stage-2 image evals (mm_olmo eval_molmo2.py IMAGE_TASKS / TEST_IMAGE_TASKS) are VQAv2, TextVQA, ChartQA, DocVQA, InfographicVQA, AI2D, A-OKVQA, MMMU, RealWorldQA, MathVista, Point-Bench, CountBenchQA and PixMo-Count. STAGE2_EVAL_TRAIN_SETS lists the sets this rule keeps out, and both the dataset class and the training script refuse them:

Stays in stage 2 Train images Benchmark
coco_2014_vqa_multi 82,783 VQAv2
doc_qa 39,463 DocVQA
text_vqa 34,602 TextVQA
chart_qa_weighted 28,299 ChartQA
info_qa 23,946 InfographicVQA
a_okvqa_mc / a_okvqa_da 17,056 A-OKVQA
ai2_diagram_v2_mix_transparent 15,042 AI2D
tally_qa 127,867 (after the filter below) VQAv2, through shared val2014 images

The rest of stage 2's single-image academic data becomes the stage-1 group. The group's rate is split by sqrt(size), with stage 2's row caps (image_only_v9 root_size_factor) on the three templated chart sets. Without the caps, those sets would take 44.0% of the group instead of 18.8%:

Source Train images Weighted as Share of group Share of v3 mixture
cosyn_chart_exp 116,814 116,814 18.83% 2.64%
cosyn_document 71,282 71,282 14.71% 2.06%
cosyn_math_exp 66,714 66,714 14.23% 1.99%
cosyn_table_exp 46,518 46,518 11.88% 1.66%
cosyn_diagram_exp 34,963 34,963 10.30% 1.44%
cosyn_music_exp 11,969 11,969 6.03% 0.84%
cosyn_chemical_exp 8,942 8,942 5.21% 0.73%
plot_qa 157,070 20,000 7.79% 1.09%
dv_qa 200,000 10,000 5.51% 0.77%
figure_qa 100,000 10,000 5.51% 0.77%
  • PlotQA trains 20 of its questions per image per epoch, drawn afresh each epoch (STAGE1_DEFAULT_MAX_QUESTIONS; an explicit max_questions still wins). Its images carry 131 questions on average, and most full examples exceed the 2,560-token stage-1 sequence. With 20 questions, none of 300 sampled images overflowed (max 2,437 tokens).
  • Left out: OKVQA, ST-VQA, ScienceQA and TabMWP (6k–25k images each, too small to matter), and every multi-image source.
  • CoSyn is closest to the line. Its chart, document and table categories were built to improve ChartQA, DocVQA and InfographicVQA. It is not their training split, so the rule allows it. It is the set to drop first if the rule should be read more strictly.
  • Overlap with the OCR group: 267,359 of CoSyn's 357,202 images are also in the OCR group's figure-caption sources, so for those the group adds QA on images v3 already describes. The images a v3 run sees only through this PR: 546,913 (CoSyn's other 89,843, DVQA, FigureQA, PlotQA), plus PixMo-Clocks.

PixMo-Clocks: a group of its own

800,269 synthetic clock faces, all asking the same question. They teach one narrow skill, so the group gets its own rate (--clock_rate; 0.03 in v3) instead of a share of the QA group. Clocks may later leave stage 2, which would leave stage 1 as the only place the model learns to read them. v3 trains about 271k clock examples (0.34 passes). That is roughly 40–70% of what the released Molmo2-4B stage 2 trained, at 2.0% of v3's tokens and 0.08% of its loss.

The user turn is clocks: What time is being shown? and the answer is the time (The time shown is 3:02 PM). The question stays in because, without stage 2, it would be the only clock question the model ever sees. Naming pixmo_clocks in --academic_sources is refused with a pointer to --clock_rate.

The v3 recipe

--recipe=v3 adds the academic and clock groups to v2 and raises OCR. It runs 50,000 steps (RECIPE_MAX_STEPS; an explicit --trainer.max_duration.value still wins). The rates were chosen against the sources themselves: 80 sampled examples per source (all 27, built as the script builds them), packed by the script's 2D-knapsack packer (2,560 tokens, 27 crops). That gives 1.41 examples per sequence, so 50k steps are 9.0M examples.

v2 (32k steps) v3 (50k steps)
Rate: caption / pointing / OCR / academic / clocks 0.50 / 0.25 / 0.25 / 0 / 0 0.33 / 0.16 / 0.34 / 0.14 / 0.03
Loss share: caption 55.1% 39.2%
Loss share: pointing and counting 18.5% 12.8%
Loss share: OCR 26.5% 38.9%
Loss share: academic QA 9.1%
Passes over PixMo-Cap (715k) 4.0 4.2
Passes over the pointing sources (325k) 4.4 4.4
Passes over the OCR sources (3.09M) 0.46 0.99
Passes over the academic group (814k) 1.55
Synthetic share of examples / loss 22.6% / 20.7% 44.0% / 38.5%
  • OCR 0.34 gives one pass over the OCR group: 3.07M OCR examples for its 3.09M rows. The pass is uneven within the group, which is still split by task and then sqrt(size). The figure captions get about 1 pass, olmOCR documents 2.1, the small olmOCR subsets, TextOCR and the receipts 7–10, and NVIDIA's 1.46M synthetic images 0.32.
  • Most of the synthetic rise is OCR (figure captions, NVIDIA, receipts). CoSyn is 95% of the academic group's loss because its answers carry explanations. DVQA, FigureQA, PlotQA and the clocks together are about 0.5% of the loss.
  • For midtraining these are shares of the multimodal part. If that part grows, every pass count grows with it.

Prompt

Stage-1 sources send a "<style>:" tag and no template. An academic source sends the tag followed by the bare question:

Source User turn Answer
plot_qa plot_qa: Is the sum of the use of imf credit in dod in 2003 and 2007 greater than ...? Yes
dv_qa dv_qa: What percentage of people like the least preferred object in the whole chart? 10
cosyn_chart_exp cosyn_chart_exp: What's the average investment in Transportation between 2003 and 2022? <explanation> Answer: <answer>
pixmo_clocks clocks: What time is being shown? The time shown is 3:02 PM

Two SftFormatter fixes for the stage-1 family (prompt_templates="none", system_prompt="style_and_length_v2"), which had only been used with pointing data:

  • Every style is tagged. Before, only the pointing styles got "<style>:". mm_olmo tags every style under this family; the length number it adds to non-pointing styles is dropped here, as Molmo2 stage 1: tag-only caption prompt, mm_olmo v2 pointing data, and a general OCR group #875 dropped it from the caption tag. That matches mm_olmo's molmo3 stage-1 family (style_and_length_v3). The pointing sources are unaffected.
  • No chain-of-thought instruction under "none", as in mm_olmo (data_formatter.py:1933-1934); the *_exp tag is what asks for the explanation. The stage-2 family keeps the instruction.

Multiple choice under "none" raises NotImplementedError (mm_olmo's format_options layout is not ported); no stage-1 source is multiple choice.

TallyQA: drop its COCO val2017 images

TallyQA's train split holds the 5,000-image COCO val2017 set, both under 2014 file names and through Visual Genome (image_data.json coco_id). Those images are dropped; the rest of val2014 is kept.

TallyQA train Images Questions
Total 132,981 249,318
COCO val2017 images under val2014 names 4,052
Visual Genome images that are COCO val2017 images 1,062
Dropped 5,114 9,578
Kept 127,867 239,740

The ids come from COCO's annotations/captions_val2017.json. The filter is in the registry's TallyQA loader (train split only), so image_only_v9 gets it too: TallyQA's sqrt(size) weight in stage 2 falls by 1.9% relative to the other academic sources. A missing held-out file fails the build rather than skipping the check.

Launch note: torchvision

pixmo_clocks imports torchvision only when it formats a clock image, so v1/v2 runs don't need it. A run that trains clocks does. In the akshitab/olmo-core-tch2100cu130-2026-07-03 image, the package install upgrades torch to 2.13.0 and leaves torchvision at 0.25.0, which fails to import ("operator torchvision::nms does not exist"). The v3 run added torchvision==0.28.0 to post_setup. Stage 2 trains clocks too, so it needs the same pin on that image.

Verification

  • src/test/data/multimodal/: 324 passed, 7 skipped on CPU (torch 2.10, rebased branch). The skips are h5py / pypdfium2, not installed here. stage1_academic_test.py (38 tests) covers:
    • the v3 recipe and its 50k steps, and PlotQA's default cap;
    • the clock group: prompt, refusal as an academic source, rate validation;
    • the prompt family and per-epoch question sampling;
    • the TallyQA filter, on synthetic files and against weka (pins 127,867 kept images and 5,000 val2017 ids);
    • refusal of every stage-2 eval training set;
    • the group weights (CoSyn 81.2%, templated charts 18.8%).
  • Real data: every v3 source built with the Qwen3 tokenizer as the script builds it, and 80 examples encoded from each of the 27 for the recipe numbers.
  • black 23.12 and isort 5.13 pass. ruff 0.15.9 (the pinned version) passes. mypy adds no errors: the changed files have 5 errors, against 7 on vision.

Usage

python src/scripts/train/Molmo2-Stage1.py launch RUN --recipe=v3                 # 50k steps
python src/scripts/train/Molmo2-Stage1.py launch RUN --recipe=v3 --clock_rate=0.02
python src/scripts/train/Molmo2-Stage1.py launch RUN --recipe=v3 \
    --academic_sources=[cosyn_chart_exp,cosyn_document,cosyn_table_exp]

🤖 Generated with Claude Code

@jason718 jason718 self-assigned this Sep 28, 2026
@jason718 jason718 changed the title Molmo2 stage 1: opt-in academic QA group; drop TallyQA images the VQAv2 eval uses Molmo2 stage 1: opt-in academic QA group; drop TallyQA's COCO val2017 images Sep 29, 2026
@jason718
jason718 marked this pull request as ready for review September 29, 2026 04:37

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7842175642

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

if _TARBALL_SEP not in pdf_relpath:
raise ValueError(f"pdf_relpath {pdf_relpath!r} has no '{_TARBALL_SEP}' separator")
tar_part, arcname = pdf_relpath.split(_TARBALL_SEP, 1)
return os.path.join(root, "pdfs", os.path.basename(tar_part), arcname)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Strip the tarball suffix before locating extracted PDFs

When an olmOCR source is enabled (including the advertised --recipe=v2), pdf_relpath values such as .../00_documents_train_00000.tar.gz:0000/page.pdf must resolve under the expanded pdfs/00_documents_train_00000/ directory. This joins the basename while retaining .tar.gz, so every render looks in a nonexistent pdfs/...tar.gz/... path; all pages are skipped and the source eventually aborts after the bad-row retry limit.

Useful? React with 👍 / 👎.

@jason718 jason718 changed the title Molmo2 stage 1: opt-in academic QA group; drop TallyQA's COCO val2017 images Molmo2 stage 1: academic QA group and v3 recipe; drop TallyQA's COCO val2017 images Sep 29, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 029dd50cd5

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

clip_points=True,
)
)
weights.append(1.0 if label in easy else cfg.negative_weight)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve negative provenance when assigning loss weights

When negative_weight is configured and an easy-negative label is also present in an annotated-absence or paired-negative list, this value-based membership check assigns that non-easy branch weight 1.0 instead of negative_weight. For example, an annotated empty "fork" plus easy_negatives=["fork"] produces two indistinguishable labels, both treated as easy. Keep the negative source/weight alongside each entry rather than inferring it from the label text.

Useful? React with 👍 / 👎.

@jason718
jason718 force-pushed the jasonr/stage1-academic-qa branch from 5d71779 to 27d82af Compare September 29, 2026 14:30
@jason718 jason718 changed the title Molmo2 stage 1: academic QA group and v3 recipe; drop TallyQA's COCO val2017 images Molmo2 stage 1: academic QA group, PixMo-Clocks group, v3 recipe; drop TallyQA's COCO val2017 images Sep 29, 2026
jason718 added a commit that referenced this pull request Sep 30, 2026
#887 put the academic registry, and so pixmo_clocks, on every stage-1 run's
import path. Its module-level `import torchvision` then failed the first v3
launch on all 32 ranks: the image's torchvision 0.25.0+cu130 was built for
torch 2.10, but the package install leaves torch at 2.13.0, so importing
torchvision raises "operator torchvision::nms does not exist". Importing it
inside format_pixmo_clocks_row means only a run that trains on clocks needs a
matching torchvision; v1 / v2 stage-1 runs no longer import it at all.
jason718 added a commit that referenced this pull request Sep 30, 2026
#887 put the academic registry, and so pixmo_clocks, on every stage-1 run's
import path. Its module-level `import torchvision` then failed the first v3
launch on all 32 ranks: the image's torchvision 0.25.0+cu130 was built for
torch 2.10, but the package install leaves torch at 2.13.0, so importing
torchvision raises "operator torchvision::nms does not exist". Importing it
inside format_pixmo_clocks_row means only a run that trains on clocks needs a
matching torchvision; v1 / v2 stage-1 runs no longer import it at all.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6760960af7

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +99 to +102
max_questions: Optional[int] = None
"""Most questions trained per image per epoch; ``None`` trains all of them. Which ones are
drawn moves with the epoch, so over several epochs the rest are reached too. PlotQA needs it:
its images carry 131 questions on average, which do not fit in a stage-1 sequence."""

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Bound the public PlotQA configuration to the sequence length

When callers use the exported Stage1AcademicDatasetConfig(name="plot_qa") without overrides, its default keeps all roughly 131 question branches per image. Those examples exceed the stage-1 2,560-token batch length, and MultimodalCollator silently tail-truncates them, dropping later answers and their supervision. The recipe helper supplies a cap of 20, but that does not protect this public default path; provide the PlotQA cap by default or enforce a sequence-length-safe limit before collation.

Useful? React with 👍 / 👎.

jason718 added a commit that referenced this pull request Sep 30, 2026
The cap lived only in the recipe helper, so Stage1AcademicDatasetConfig(name=
"plot_qa") built directly kept all ~131 questions per image; those examples
overflow the 2,560-token sequence and the collator silently tail-truncates
them (Codex review on #887). The default now lives with the dataset
(STAGE1_DEFAULT_MAX_QUESTIONS = {"plot_qa": 20}), applied whenever
max_questions is left unset; an explicit value still wins.
jason718 added a commit that referenced this pull request Sep 30, 2026
The cap lived only in the recipe helper, so Stage1AcademicDatasetConfig(name=
"plot_qa") built directly kept all ~131 questions per image; those examples
overflow the 2,560-token sequence and the collator silently tail-truncates
them (Codex review on #887). The default now lives with the dataset
(STAGE1_DEFAULT_MAX_QUESTIONS = {"plot_qa": 20}), applied whenever
max_questions is left unset; an explicit value still wins.
@jason718 jason718 changed the title Molmo2 stage 1: academic QA group, PixMo-Clocks group, v3 recipe; drop TallyQA's COCO val2017 images Molmo2 stage 1: academic QA group, PixMo-Clocks group, v3 recipe (50k steps); drop TallyQA's COCO val2017 images Sep 30, 2026
… uses

Adds `--academic_rate` / `--academic_sources` to Molmo2-Stage1.py: stage 2's
large synthetic QA sets (CoSyn's seven single-image categories, DVQA,
FigureQA, PlotQA; PixMo-Clocks registered but not default), trained in stage 1
as the bare question behind the source's style tag. Off by default.

The training set of a benchmark the stage-2 checkpoints are evaluated on
(VQAv2, TextVQA, ChartQA, DocVQA, InfographicVQA, AI2D, A-OKVQA) is never a
stage-1 source; neither is TallyQA. Both the dataset and the script refuse
them.

TallyQA train held 41,441 images (77,663 questions) that the VQAv2 eval samples
from: 32,633 COCO val2014 files and 8,808 Visual Genome images that are COCO
val2014 images. They are dropped from its train split, which stage 2 reads.

The stage-1 prompt family now tags every style with "<style>:" (non-pointing
styles got no tag before) and sends a *_exp question bare, as mm_olmo does
under prompt_templates="none"; multiple choice under that family is refused.
The train-split filter now drops the 5,000 COCO val2017 images (read from
coco/annotations/captions_val2017.json) instead of the VQAv2 eval's 40,504
val2014 images. TallyQA train loses 5,114 images (9,578 questions): 4,052
filed under val2014 names and 1,062 Visual Genome images that are val2017
images. 127,867 of its 132,981 images remain, including 28,581 other val2014
files.
v3 = caption 0.475, pointing and counting 0.225 (v2 sources), OCR 0.15,
academic QA 0.15, no text-only data. v1 and v2 now list academic_rate (0.0)
explicitly.

The rates keep v2's balance of what is trained on. Simulated with 80 sampled
examples per source through the stage-1 2D-knapsack packer at 2,560 tokens,
the weighted loss splits caption / pointing / text-rich (OCR + academic) as
55.9% / 18.0% / 26.2%, against v2's 55.2% / 18.4% / 26.3%. The academic share
comes out of OCR, the one group a run never repeats (v2 sees 0.46 of its
3.09M rows, v3 0.28). Over 32k steps (1.39 examples per sequence, 5.7M
examples): PixMo-Cap ~3.8 passes (v2 4.0), pointing ~3.9 (v2 4.4), academic
~1.05 of its 814k images.
Adds Stage1AcademicSource.max_share: a source takes at most that fraction of
the group's rate, and the rest is re-divided among the other sources in
proportion to their sqrt(capped size) weights (academic_group_fractions).
A selection of only capped sources whose caps sum below 1 is refused.

PixMo-Clocks joins the default sources, held to 5% of the group (21.6% by its
row-capped size alone), no more than DVQA or FigureQA get. With the real
sizes the group splits CoSyn 77.1%, PlotQA 7.4%, DVQA 5.2%, FigureQA 5.2%,
Clocks 5.0%. In v3 that is ~43k clock examples per 32k-step run (0.05 of its
800k images). Re-simulated v3 loss shares, caption / pointing / text-rich:
56.1% / 18.1% / 25.8% (v2: 55.2% / 18.4% / 26.3%).
PixMo-Clocks leaves the academic QA group and becomes a group of its own,
set with --clock_rate (default 0). It is one narrow skill from 800k
synthetic clock faces with one fixed question, so its own rate sets how much
of it a run sees, and its user turn is the bare tag "clocks:" (new
Stage1AcademicDatasetConfig.tag_only); the answer is unchanged ("The time
shown is 3:02 PM"). Naming it in --academic_sources is refused with a pointer
to --clock_rate. The share-cap mechanism stays; no default source uses it.

v3 = caption 0.475 / pointing 0.225 / OCR 0.15 / academic 0.14 / clocks 0.01.
From 80 sampled examples per source (all 27), expected loss shares caption /
pointing / text-rich are 56.1% / 17.8% / 26.0% (v2: 55.0% / 18.5% / 26.5%);
academic QA 9.0%, clocks under 0.1% (~57k examples per 32k-step run).
The PixMo-Clocks user turn is "clocks: What time is being shown?" again,
the same tag-plus-question form as the academic sources: clocks may later
leave stage 2, making stage 1 the only place the model learns to read them,
so the question text has to be trained too. The tag_only option this drops
had no other user and is removed.

v3 clock_rate 0.01 -> 0.03, paid for by captions (0.475 -> 0.455). From 80
sampled examples per source (all 27), expected loss shares caption /
pointing / text-rich stay at v2's: 55.0% / 18.3% / 26.7% (v2: 55.1% /
18.5% / 26.5%). A 32k-step run (1.43 examples per packed sequence, 5.8M
examples) gets ~175k clock examples: 0.22 passes, 2.0% of the tokens,
0.08% of the loss.
#887 put the academic registry, and so pixmo_clocks, on every stage-1 run's
import path. Its module-level `import torchvision` then failed the first v3
launch on all 32 ranks: the image's torchvision 0.25.0+cu130 was built for
torch 2.10, but the package install leaves torch at 2.13.0, so importing
torchvision raises "operator torchvision::nms does not exist". Importing it
inside format_pixmo_clocks_row means only a run that trains on clocks needs a
matching torchvision; v1 / v2 stage-1 runs no longer import it at all.
The cap lived only in the recipe helper, so Stage1AcademicDatasetConfig(name=
"plot_qa") built directly kept all ~131 questions per image; those examples
overflow the 2,560-token sequence and the collator silently tail-truncates
them (Codex review on #887). The default now lives with the dataset
(STAGE1_DEFAULT_MAX_QUESTIONS = {"plot_qa": 20}), applied whenever
max_questions is left unset; an explicit value still wins.
v3 = caption 0.33 / pointing 0.16 / OCR 0.34 / academic 0.14 / clocks 0.03,
and v3 now runs 50,000 steps by default (RECIPE_MAX_STEPS; an explicit
--trainer.max_duration.value still wins); v1 and v2 keep 32,000.

From 80 sampled examples per source (all 27), packed at 2,560 tokens: 1.41
examples per sequence, 9.0M examples in 50k steps, 3.07M of them OCR for its
3.09M rows. The within-OCR split is unchanged (task, then sqrt(size), synthetic
capped), so the pass is uneven: figure captions ~1, olmOCR documents 2.1, the
small olmOCR subsets / TextOCR / receipts 7-10, NVIDIA synthetic 0.32. Caption
and pointing keep about v2's passes (4.2 and 4.4). Expected loss shares
caption / pointing / OCR / academic: 39.2% / 12.8% / 38.9% / 9.1%.
No source has a max_share since PixMo-Clocks became its own group, so the
water-filling split (academic_group_fractions, check_share_caps) is removed and
the group's rate is split by sqrt of the row-capped sizes alone. The default
fractions are unchanged (max difference 6e-17 on the real sizes).
@jason718
jason718 force-pushed the jasonr/stage1-academic-qa branch from 1f7b254 to 2fc26e8 Compare October 2, 2026 18:11

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2fc26e899b

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +115 to +116
def build(self, tokenizer) -> "Stage1AcademicDataset":
return Stage1AcademicDataset(self, tokenizer)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Add a docstring to the exported config builder

Stage1AcademicDatasetConfig is exported as a public configuration type, but its public build() method has no docstring, so the generated Sphinx API documentation omits the construction path for this dataset. Add a concise docstring describing what the method builds and its tokenizer parameter.

AGENTS.md reference: AGENTS.md:L43-L44

Useful? React with 👍 / 👎.

Comment on lines +147 to +149
return Stage1AcademicDatasetConfig(name=CLOCKS_SOURCE, max_crops=max_crops, seed=seed).build(
tokenizer
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Mark noon clock targets as PM

When v3 enables this source through its nonzero clock_rate, 12:xx rows are passed to format_pixmo_clocks_row, whose hour == 12 branch assigns AM and only switches to PM for hours greater than 12. Thus noon clock images using the AM/PM formats are supervised with 12:xx AM targets; handle hour 12 as PM before training this source.

Useful? React with 👍 / 👎.

@jason718
jason718 merged commit b8e7392 into vision Oct 2, 2026
1 check passed
@jason718
jason718 deleted the jasonr/stage1-academic-qa branch October 2, 2026 18:15
jason718 added a commit that referenced this pull request Oct 3, 2026
GUISyn sits inside the unchanged pointing rate, so the v2 and v3 pointing sources
are seen about 4.0 times per run (4.4 with --gui_pointing=false); #887's loss
split was measured without it.
jason718 added a commit that referenced this pull request Oct 3, 2026
…s) (#898)

Adds
[allenai/MolmoPoint-GUISyn](https://huggingface.co/datasets/allenai/MolmoPoint-GUISyn)
(synthetic GUI screenshots with dense pointing annotations, Apache-2.0)
to the stage-1 pointing group used by the v2 and v3 recipes
(`pointing_data="v2"`). Based on `vision` after #887 (v3 recipe). It
ports mm_olmo's `molmo2_syn_point` (`Molmo2SyntheticPointConfig`,
`olmo/data/academic_datasets_manual.py`), which mm_olmo trains only in
its GUI-only mixtures.

## The data

Train split at revision `24bb3e99`, read from mm_olmo's copy on weka,
`/weka/oe-training-default/mm-olmo/hf_datasets/allenai___molmo_point-gui_syn`
(`GUI_SYN_ROOT`, under `$MOLMO_DATA_DIR` like the other dataset roots;
`--gui_syn.dataset_path` overrides it). The loader reads the Arrow
shards directly, with no network access; the 256-image validation split
of each part stays held out.

| Part | Images | Elements per image | Typical size |
|---|---|---|---|
| desktop | 16,232 | ~89 | 1920x1080 |
| mobile | 10,130 | ~22 | 393x844 |
| web | 9,830 | ~40 | 1440x900 |

All 36,192 images have at least one usable element.

## How it is formatted (`GuiSynDataset`, `data/multimodal/gui_syn.py`)

- **One example per image.** Each sampled element is one branch,
answered with a single point at its box center and labelled with the
element's lowercased name: `<points coords="1 1 090 012">file
menu</points>`.
- **Question:** with probability 0.8 (mm_olmo's `p_intent`), one of the
element's five intents under a new **`gui_point:`** tag, e.g.
`gui_point: Open the File menu to save the current spreadsheet`.
Otherwise the lowercased name under `pointing:`, e.g. `pointing: share
document button`. An element with no name is always asked by an intent.
The intents are English requests, so they get their own tag, for the
same reason CoSyn's questions get `cosyn_point:`: `pointing:` keeps
meaning "an object name follows". `gui_point` is registered like
`cosyn_point` in `SftFormatter`'s pointing and demo styles, so it is
prefixed under the stage-1 family and unprefixed under the stage-2
family.
- **At most 16 elements per image and epoch** (`max_elements`), redrawn
each epoch, unlike mm_olmo, which trains every element. Measured on 150
real images per part with the stage-1 tokenizer
(`Qwen3-4B-Instruct-2507`) and 8 crops:

| `max_elements` | desktop p50 / max tokens | mobile | web | Over 2,560
tokens |
|---|---|---|---|---|
| 8 | 1,522 / 1,627 | 1,316 / 1,578 | 1,503 / 1,655 | 0% |
| **16** | **1,854 / 1,991** | **1,620 / 1,941** | **1,811 / 2,074** |
**0%** |
| all (mm_olmo) | 4,696 / 9,669 | 1,752 / 4,085 | 2,570 / 7,836 | 93% /
17% / 51% of examples; 62% / 10% / 25% of loss tokens |

- **Stage-1 resolution (`max_crops=8`).** A 1920x1080 desktop shot with
~12-pixel buttons is downscaled, so the smallest targets lose detail;
mm_olmo's GUI-only runs force high-resolution crops.

## Mixture (`Molmo2-Stage1.py`)

GUISyn is a fourth source of the v2 pointing group, which both
`--recipe=v2` and `--recipe=v3` use. It sits **inside the pointing
group**: the pointing rate is unchanged (0.16 in v3, 0.25 in v2), and
the group is split linearly by image count as before, so GUISyn takes
10% of the group from the other three sources. `--gui_pointing=false`
leaves it out and restores the previous shares exactly;
`--gui_syn.<field>` configures it.

| Source | Images | v3 before | v3 after | v2 before | v2 after |
|---|---|---|---|---|---|
| `pixmo_points_v2` | 220,290 | 10.84% | 9.75% | 16.93% | 15.24% |
| `pixmo_count_v2` | 36,901 | 1.82% | 1.63% | 2.84% | 2.55% |
| `cosyn_point_v2` | 68,051 | 3.35% | 3.01% | 5.23% | 4.71% |
| `gui_syn` | 36,192 | - | 1.60% | - | 2.50% |

Over a 50k-step v3 run (about 9.0M examples, 1.44M of them pointing)
each pointing image is seen about 4.0 times instead of 4.4, and GUISyn
gets about 145k examples of up to 16 elements each. A 16-element GUISyn
example is about 1,850 tokens at 8 crops, close to the v3 average of
about 1,800 tokens per example, so its share by tokens is about its
share by examples.

The v2 group's sources now come from `_v2_pointing_sources(config)`, so
the wiring is testable without the data.

## Verification

- **New tests,** `src/test/data/multimodal/gui_syn_test.py` (16):
reading only the train split from shards laid out like the weka copy,
the `gui_point:` / `pointing:` forms and answer labels, nameless
elements, the box-center point, skipping unusable elements and images,
the 16-element cap, per-epoch rotation and determinism, the end-to-end
example, a clear error when the data is missing, config validation, and
the v2 group wiring.
- **Updated test:** the existing CoSyn wiring test now checks
`_v2_pointing_sources` instead of the script's source text.
- **Results:** `src/test/data/multimodal` 340 passed, 7 skipped (rebased
on #887). Pinned black / isort pass on the whole repo, and ruff on the
changed files. `Molmo2-Stage1.py` builds its full config for the v1, v2
and v3 recipes. Real data was loaded and formatted from the weka copy
(all 36,192 images).
- **Not done:** no training run with GUISyn yet. GUI grounding evals
(ScreenSpot-v2, ScreenSpot-Pro, OSWorld-G, plus Point-Bench) are in
allenai/olmo-eval#431 (`gui_pointing` / `pointing_mp` suites), whose
stage-1 prompts are the `gui_point: <instruction>` and `pointing:
<label>` turns trained here. The current v2 checkpoint, trained without
GUISyn, already scores ScreenSpot-v2 87.8, ScreenSpot-Pro 10.4,
OSWorld-G 35.3 at 8 crops (Molmo2-4B-Pretrain: 88.3 / 10.9 / 33.9).
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.

1 participant