Skip to content

Stage-1 v7: Nemotron-Image-Training caption and reasoning sources - #935

Merged
jason718 merged 12 commits into
jasonr/olmo35-mixed-midtrainingfrom
jasonr/stage1-nemotron-image
Oct 26, 2026
Merged

jason718 merged 12 commits into
jasonr/olmo35-mixed-midtrainingfrom
jasonr/stage1-nemotron-image

Conversation

@jason718

@jason718 jason718 commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #916. Adds ten subsets of nvidia/Nemotron-Image-Training-v3/v3.5 to the stage-1 vision mixture as --recipe.visual_data=stage1_v7. The write-up (subset choice, stage 1/2 split, token accounting) is shared separately.

Sources

Source Rows Task tag Images from
nemotron_openimages_1 1,236,601 detailed_caption Open Images, CVDF S3 mirror
nemotron_openimages_2 504,262 detailed_caption Open Images, CVDF S3 mirror
nemotron_cc3m 867,064 detailed_caption our cc3m tars (oe-encoder)
nemotron_textcaps 106,447 text_caption our TextCaps (oe-encoder)
nemotron_ecd 55,341 chart_reasoning ChartFoundation/ECD-10k-Images
nemotron_deepvision 9,818 visual_logic_reasoning skylenage-ai/DeepVision-103K
nemotron_babyvision 125,875 visual_perception_reasoning bundled synthetic images + web URLs (7% gone)
nemotron_fintabnet 56,479 table_multihop_reasoning FinTabNet page PDFs (HF mirror), rendered
nemotron_hopchain 7,328 doc_multihop_reasoning CC-MAIN-2021-31 PDF pages (Digital Corpora S3), rendered
nemotron_raven 41,995 matrix_puzzle_reasoning HuggingFaceM4/RAVEN panels, composed
  • Captions: filler openings ("Of course.", "This is a detailed description of …") are dropped.
  • Reasoning: the <think> trace is trained, as the text mid-training mix trains its traces. Rows whose trace never closes or whose answer is empty are dropped.
  • Left out on purpose: visualpuzzles and vision_language_reasoning (benchmark images), slake_med (more rows than Slake's English train split), sa_finance (the JSONL has file names only, no URLs), turing (no image source), pmc_vqa (2K rows).

Data prep

python -m olmo_core.data.multimodal.nemotron_image <subset>... --dataset-path /weka/oe-training-default/jasonr/dataset/nemotron-image

This writes one save_to_disk directory per subset, plus a prepare_stats.json. Images are capped at 1,536 px on the long side.

Mixture

Built in two steps (STAGE1_V7_LOSS_TARGETS):

  1. Nemotron funded from OCR. The Nemotron sources take fixed passes over a 20,000-step run (v6's reference length), all of it from the OCR group. v6 moved the loss of the capped PixMo-Cap and PixMo-Count to OCR (39% to 61%) because we had no fresh caption data; the Nemotron captions are that data.
  2. CoSyn and olmOCR capped at 5 passes (STAGE1_V7_PASS_CAP). v6 drew the CoSyn sets 8.7–30 times and olmOCR books, LoC and national archives 21–30 times; now every one is at 5 (olmOCR documents is already at 4.5). The 5.5% of the visual loss the CoSyn cap frees goes to the Nemotron detailed captions, and the five text-rich OCR sources top them up to exactly 2 passes (STAGE1_V7_NEMOTRON_CAPTION_PASSES) with another 1.9%, in their ratio (each about 5% lower, e.g. text_rich_doc 5.7 → 5.4 passes). The 1.6% the olmOCR cap frees goes to the Nemotron reasoning sets (2 → 2.5 passes). Synthetic receipts are capped at 5 (from 28.5) and TextOCR at 10 (from 19.6); the 0.5% they free goes to olmOCR documents, the one olmOCR source under its cap (4.5 → 4.96 passes).

Result: Nemotron captions 14.9% and reasoning 7.8% of the visual loss, close to the ~7.5% share reasoning traces have in the OLMo 3 text mix. OCR is at 43.9% and academic QA at 4.2%. PixMo-Cap, PixMo-Count, PixMo-Points, NVIDIA synthetic OCR, DVQA, FigureQA, PlotQA and clocks keep their step-1 shares; pointing is deliberately untouched.

Positions per step stay v6's. The Nemotron sources are text-dense (1.4–3.7 positions per response token) and the capped CoSyn sets were position-heavy (25–186), so v7 uses 9.6 positions per visual response token against v6's 11.5. recipe.text_loss_share now defaults per visual data: 0.9 as before, or STAGE1_V7_TEXT_LOSS_SHARE = 0.882 for stage1_v7. That share splits positions per step between text and vision exactly as v6 at 0.9 does, so the text per step and the step time are unchanged, and the vision share trains about 20% more response tokens in the same positions. An explicit --recipe.text_loss_share still wins. Measured positions per response token for every source are in STAGE1_POSITIONS_PER_LOSS_TOKEN.

Full stage1_v7 mix

Share of the visual loss next to v6 and the Molmo2-Stage1 v3 recipe. The visual share is 11.8% of all loss under v7 (text 88.2%) and 10% under v6. The tag is the prefix of every user turn. Passes are over a 20,000-step run (v6's reference length).

Source Task tag Molmo2 v3 v6 v7 v7 passes
Caption 39.2% 19.1% 19.1%
pixmo_caption long_caption 19.17% 9.17% 9.17% 10.0
pixmo_transcript transcript 20.04% 9.93% 9.93% 10.0
Pointing 12.6% 10.7% 10.0%
pixmo_points_v2 pointing, point_count 11.52% 9.71% 9.71% 19.1
pixmo_count_v2 pointing, point_count 0.18% 0.08% 0.08% 10.0
cosyn_point_v2 cosyn_point 0.90% 0.91% 0.21% 5.0
OCR 39.3% 61.2% 43.9%
text_rich_doc fig_caption_high/_mid/_low 8.26% 16.85% 12.38% 5.4
text_rich_table fig_caption_high/_mid/_low 6.68% 13.62% 10.01% 6.5
text_rich_chart fig_caption_high/_mid/_low 5.63% 11.49% 8.44% 6.1
text_rich_diagram fig_caption_high/_mid/_low 3.74% 3.80% 2.79% 4.6
text_rich_graphic fig_caption_high/_mid/_low 2.24% 2.28% 1.67% 5.9
olmocr_documents olmocr 7.56% 5.97% 5.11% 5.0
olmocr_books olmocr 1.25% 1.28% 0.24% 5.0
olmocr_national_archives olmocr 0.67% 0.68% 0.09% 5.0
olmocr_loc_transcripts olmocr 0.59% 0.60% 0.10% 5.0
nvidia_synth_en synth_ocr 1.84% 3.76% 2.92% 1.8
synth_receipts_en receipt_ocr 0.63% 0.64% 0.09% 5.0
textocr textocr 0.19% 0.19% 0.07% 10.0
Academic QA 8.8% 9.0% 4.2%
cosyn_chart_exp cosyn_chart_exp 2.69% 2.74% 1.58% 5.0
cosyn_table_exp cosyn_table_exp 1.76% 1.79% 0.63% 5.0
cosyn_math_exp cosyn_math_exp 1.73% 1.76% 0.83% 5.0
cosyn_diagram_exp cosyn_diagram_exp 1.04% 1.06% 0.37% 5.0
cosyn_music_exp cosyn_music_exp 0.46% 0.47% 0.09% 5.0
cosyn_chemical_exp cosyn_chemical_exp 0.44% 0.45% 0.08% 5.0
plot_qa plot_qa 0.39% 0.39% 0.39% 3.3
cosyn_document cosyn_document 0.23% 0.23% 0.11% 5.0
dv_qa dv_qa 0.04% 0.04% 0.04% 1.3
figure_qa figure_qa 0.04% 0.04% 0.04% 1.8
Clocks 0.1% 0.1% 0.1%
pixmo_clocks clocks 0.08% 0.08% 0.08% 1.6
Nemotron captions (new) – – 14.9%
nemotron_openimages_1 detailed_caption – – 8.21% 2.0
nemotron_cc3m detailed_caption – – 3.35% 2.0
nemotron_openimages_2 detailed_caption – – 3.33% 2.0
nemotron_textcaps text_caption – – 0.04% 2.0
Nemotron reasoning (new) – – 7.8%
nemotron_babyvision visual_perception_reasoning – – 2.30% 2.5
nemotron_fintabnet table_multihop_reasoning – – 2.20% 2.5
nemotron_ecd chart_reasoning – – 1.79% 2.5
nemotron_raven matrix_puzzle_reasoning – – 0.70% 2.5
nemotron_deepvision visual_logic_reasoning – – 0.45% 2.5
nemotron_hopchain doc_multihop_reasoning – – 0.37% 2.5

Capped at 5 passes: every CoSyn and olmOCR set and the synthetic receipts; TextOCR at 10. Still above 10: PixMo-Points (19.1), deliberately unchanged.

Status

  • Unit tests: nemotron_image_test.py and the v7 recipe test.
  • Full prep of all ten subsets: 3,011,210 rows under /weka/oe-training-default/jasonr/dataset/nemotron-image.
  • Measured STAGE1_V7_NEMOTRON_SOURCE_SIZES / ..._MEAN_LOSS_WEIGHTS (128 samples, seed 0). Nemotron is 22.8% of the visual loss (captions 14.9% at 2 passes, reasoning 7.8%); CoSyn and olmOCR capped at 5 passes; text share 0.882 keeps v6's positions per step.
  • Batch-offset index (batch_index.json) so subsets open without scanning: the first smoke spent 42 min opening the 650 GB of Nemotron data on Weka; now 0.01 s per subset. Backfilled for all ten subsets.
  • Smoke run (1 node, 256K, 40 steps, ai2/oe-olmo3p5-mt, scaling-ladders jasonr/mixed-stage1-v7): https://beaker.org/ex/01M5TG7305A773CFCJ14JE1BN5, exit 0, all 38 sources load, CE 0.85 at step 40, no skipped steps, 52.7K tokens/s/GPU, 188 GiB active memory (v6 256K run: 175 GiB).
  • Full launch.

…ources

New `nemotron_image` module: prepares subsets of nvidia/Nemotron-Image-Training-v3/v3.5
(pinned revisions) by fetching each row's image from its upstream copy (Open Images from the
CVDF mirror, our cc3m tars and TextCaps on Weka, ECD-10k-Images, DeepVision-103K, the bundled
BabyVision synthetic images), and serves them as `"<task tag>: <question>"` examples.

- captions: openimages_1/2 and cc3m (`detailed_caption`, filler openings dropped),
  textcaps_commercial (`text_caption`)
- reasoning, `<think>` trace kept: ecd (`chart_reasoning`), deepvision
  (`visual_logic_reasoning`), babyvision (`visual_perception_reasoning`); rows with an unclosed
  trace or empty answer are dropped

`--recipe.visual_data=stage1_v7`: v6's sources in v6's ratio plus the Nemotron sources at fixed
passes over a 20,000-step run (1 over the detailed captions, 2 over the rest), with the vision
share's loss per step kept at v6's. Source sizes and means are estimates from the NVIDIA text
until the prepared subsets are calibrated.
…image more than once

DeepVision-103K's parquet repeats some images byte for byte, so its rows were written once per copy
(14,030 rows from 9,818). Shards now skip an image they already emitted, the stats count distinct
images, and rows repeated across shards are dropped after sorting by id.
…the referenced images

An empty shard fails the final from_parquet (ArrowInvalid: BatchSize must be greater than 0); cc3m
has tars with none of NVIDIA's images.
Sorting left an index mapping that save_to_disk resolved by random reads over every image (cc3m:
over 30 minutes on Weka without finishing). Shards are named by index and each emits rows in a fixed
order, so reading them by name is already deterministic; repeated ids are found from the id column
alone.
Rows from the prepared subsets and means from estimate_mean_loss_weights (128 samples, seed 0,
dolma2, 65,536 tokens, documents mode). The Nemotron sources take 9.4% of the visual loss (detailed
captions 7.45%), the v6 sources keep the rest at 0.906 of their v6 shares.
…d BabyVision's web images

- nemotron_fintabnet (table_multihop_reasoning): FinTabNet page PDFs range-read from an HF mirror
  of the release and rendered
- nemotron_hopchain (doc_multihop_reasoning): the CC-MAIN-2021-31 PDF pages each row's
  image_sources names, range-read from Digital Corpora's zips and rendered
- nemotron_raven (matrix_puzzle_reasoning): HuggingFaceM4/RAVEN panels composed into the matrix
  and A-H options NVIDIA's prompt describes (its RAVEN_<id> is the row id and its answer the row's
  target on all 12,000 rows checked)
- nemotron_babyvision now also fetches the web images its JSONL names by URL

sa_finance stays out: its JSONL names images by file name only.
…ion's web images

Measured rows and means (128 samples, seed 0). BabyVision grows to 125,875 rows (7% of its web
images are gone) with 1,189 loss tokens per draw. The Nemotron sources now take 13.75% of the visual
loss (captions 7.5%, reasoning 6.3%); the v6 sources keep 0.8625 of their v6 shares.
…s positions per step

v6 moved the loss of the capped PixMo-Cap and PixMo-Count to OCR (39% to 61% of the visual loss)
for want of fresh caption data; the Nemotron captions are that data, so v7 now takes the Nemotron
share from the OCR group alone (OCR lands at 47%) and leaves caption, pointing, academic and clock
sources at their v6 shares. Taking it from every v6 source also cut the position-heavy pointing and
academic sets, so the vision share filled 11% fewer positions per step than v6.

The Nemotron sources are text-dense (1.4-3.7 positions per response token against 2.5-7 for OCR),
so even OCR-funded v7 fills 3% fewer positions per visual loss token. recipe.text_loss_share now
defaults per visual data: 0.9, or STAGE1_V7_TEXT_LOSS_SHARE (0.897) for stage1_v7, the share that
splits positions per step between text and vision exactly as v6 at 0.9 does, so the text per step
and the step time stay v6's. STAGE1_POSITIONS_PER_LOSS_TOKEN records the measured positions.
…ir loss to Nemotron

v6 drew the CoSyn sets 8.7-30 times and olmOCR books, LoC and national archives 21-30 times over a
20,000-step run. v7 caps both families at 5 passes (olmOCR documents, at 4.5, is under it), so each
comes out even. The 5.5% of the visual loss the CoSyn cap frees goes to the Nemotron detailed
captions (1 to 1.74 passes), the 1.6% the olmOCR cap frees to the Nemotron reasoning sets (2 to 2.5
passes; 7.8% of the visual loss, near the 7.5% reasoning traces have in the OLMo 3 text mix).

The capped sets were position-heavy, so the solved text loss share falls to 0.883: positions per
step between text and vision stay exactly v6's, and the vision share trains about 19% more response
tokens in them.
…ir loss to olmOCR documents

v6 drew the receipts 28.5 times and TextOCR 19.6 times over a 20,000-step run. The 0.49% of the
visual loss the caps free goes to olmOCR documents, the one olmOCR source under its 5-pass cap
(4.5 to 4.96 passes). Caps are now per source (STAGE1_V7_PASS_CAPS).
…e text-rich sources

The CoSyn cap freed enough for 1.74 passes; the remaining 1.9% of the visual loss comes from the
five text-rich OCR sources in their ratio (each about 5% lower, e.g. text_rich_doc 5.7 to 5.4
passes). Pointing is unchanged. Text loss share 0.8824.
…instead of scanning

save_to_disk writes Arrow stream files, which have no footer: opening one walks every message, and on
Weka that pages in the whole file. The v7 smoke run spent 42 minutes opening the 650 GB of Nemotron
data (Open Images alone 21). Prepare now writes batch_index.json (each record batch's byte offset and
row count), and the dataset memory-maps the files lazily and decodes only a row's own batch: opening
Open Images takes 0.01 s. Subsets without the index fall back to the HF loader;
--index-only adds it to subsets already prepared.
@jason718
jason718 marked this pull request as ready for review October 26, 2026 03:04
@jason718
jason718 merged commit 36a1745 into jasonr/olmo35-mixed-midtraining Oct 26, 2026
1 check passed
@jason718
jason718 deleted the jasonr/stage1-nemotron-image branch October 26, 2026 03:04
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-26T03:08:00.957981Z d55dcbc Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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: d55dcbc404

ℹ️ 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".

seq = encode_sft_example(
self.tokenizer,
image,
list(zip(prompts, row["responses"])),

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 multi-turn conversations as one branch

For any row containing multiple user/assistant pairs, this flat list is interpreted by encode_sft_example as multiple independent branches rather than one sequential conversation. Consequently the branches may be shuffled, later questions such as “Why?” lose the preceding turns they depend on, and only the first branch receives the task-style prefix. Pass the zipped turns inside an outer list so each parsed conversation remains a single sequential branch.

Useful? React with 👍 / 👎.

Comment on lines +141 to +142
r"^\s*(of course[.,!]?|based on the image provided,|this is a detailed description of)"
r"[^\n]*(\n+|$)",

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 same-line caption text after filler

When a response starts with a filler phrase but continues with its real caption on the same line, such as Of course! A dog is running on a beach., [^^\n]* consumes the entire line; clean_caption then returns None, and preparation silently drops the row. The cleaner should remove only the recognized lead-in (or otherwise retain text following it) instead of requiring the useful caption to begin after a newline.

Useful? React with 👍 / 👎.

jason718 added a commit that referenced this pull request Oct 26, 2026
…d, PixMo-Count kept

v7 has not had a full run, so the revised mix keeps the name. The #935 split stays as v7's base
split (STAGE1_V7_BASE_LOSS_TARGETS / STAGE1_V7_BASE_TEXT_LOSS_SHARE). On top of it, in passes over
the 22,240-step hero:
- PixMo-Points halved (25.4 -> 12.7); PixMo-Count unchanged (13.4).
- GUISyn at 12 passes: each element about 3.4 times, as mm_olmo main's Molmo3 stage 1 trains it
  (split_annotations, 4 epochs of a 424,423-example group before GUISyn joined).
- PixMo-Cap, transcripts and TextOCR 13.3 -> 15; the base split's caps of 5 restated over the hero
  (6.7 -> 5); NVIDIA synthetic OCR and the Nemotron sources to 5.
- Text share 0.879: v6's positions per step, the text taking what vision leaves (1.12x v6's text).
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