Repository navigation
Stage 1: stop down-weighting the pointing and counting loss - #842
Merged
Merged
Conversation
The pointing/counting dataset classes default `loss_token_weighting` to `root_subsegments`, which
scales an example's loss by 1/sqrt(n_labels). The caption dataset is explicitly set to `"none"`
with a comment explaining why the factor is wrong here -- it does not cancel out of the global
`sum(CE*w)/sum(w)` divisor when branch counts differ across examples -- but the four pointing
entries were left on the default.
The released `Molmo2-4B-Pretrain` weights every response token equally:
`mm_preprocessor.loss_token_weighting: None` and `message_weight: None` on all of
pixmo_points_train, pixmo_count_train, pixmo_points_high_freq_train and cosyn_point. Measured over
15k source rows under our `max_points=60` filter, our examples average 12.5 labels for pointing and
2.8 for counting, so the default gave that data roughly 3.5x and 1.7x less gradient weight per
token than captions, for a whole 32k-step run:
labels/example our per-token weight released
12.5 (pointing) 0.28 1.00
2.8 (counting) 0.60 1.00
This is the best remaining explanation for the pointing gap against the released Pretrain
checkpoint. #836 fixed the prompt family and moved abstention a long way -- SA-Co `is_absent_acc`
0.205 -> 0.487, its f1 0.331 -> 0.550, and pixmo_point_eval_v3_mp's zero slice 0.718 -> 0.839 --
but overall pointing f1 stayed flat at 0.705 against the released 0.815, because the non-absent
slices did not improve (single 0.765 -> 0.734). Abstention was a formatting problem; localisation
quality looks like a training-weight problem, and this is the weight that was wrong. The 1-2%
counting shortfall (pixmo_count 0.869, countbench_qa 0.951) has the same cause.
Verified: 2 new tests pin the stage-1 setting and the 1/sqrt(n) mechanism (1 label -> 1.000,
4 -> 0.500, 12 -> 0.289); the stage-1 assertion fails when the value is put back to
`root_subsegments`. 8 tests pass in the file. isort/black/ruff clean.
Needs a fresh run to land: every existing stage-1 checkpoint trained with the pointing loss
down-weighted.
jason718
added a commit
that referenced
this pull request
Sep 7, 2026
#842 matched the released weighting exactly — no weighting on any source — which puts captions at ~77.5% of the `sum(CE*w)/sum(w)` loss mass. That's the right default for *reproducing* the released recipe, but it left `dense_caption` ~0.9 below the released checkpoint while pointing and counting were at or above it. Weighting captions 1.25× lifts their share to ~81% and recovers most of that gap for a pointing cost at the noise floor. ## The change - `PixMoCapDatasetConfig` gains a `message_weight` field (the pointing configs already had one), applied through the same path — branch scaling is already folded into `loss_masks` by `build_branched_sequence`, so only the example-wide multiplier is applied. **Library default stays `None`** (released behaviour), so `image_only_v9`, stage 2 and every other consumer are unaffected. - Stage 1 sets it from `CAPTION_MESSAGE_WEIGHT = 1.25`, **overridable per run**: ```bash python src/scripts/train/Molmo2-Stage1.py launch <name> # 1.25 (default) python src/scripts/train/Molmo2-Stage1.py launch <name> --caption_message_weight=1.0 # released weighting ``` The flag needs both an override reader (the caption config is built inside `build_config`, before `Config.merge` runs — same reason `model_size` and `train_vit` use readers) and a declaration on `ExperimentConfig`, or `merge` rejects it as an unknown attribute. ## Measured, two seeds per baseline arm Every delta is quoted against its seed spread, measured from two runs of the identical +842 config: | metric | +842 (n=2) | **1.25×** | delta | seed spread | |---|---|---|---|---| | **dense_caption avg** | 57.271 | **57.808** | **+0.537** | 0.085 | | ↳ recall | 44.570 | 44.915 | +0.345 | 0.193 | | ↳ consistency | 69.973 | **70.701** | +0.728 | 0.024 | | ↳ recall_at_10 | 85.761 | 86.243 | +0.482 | 0.200 | | pixmo_points f1 | 0.7938 | 0.7847 | −0.009 | 0.008 | | sa_co_gold f1 | 0.5537 | 0.5408 | −0.013 | 0.011 | | pixmo_count | 0.8991 | 0.8815 | −0.018 | 0.006 | | countbench_qa | 0.9378 | 0.9388 | +0.001 | 0.002 | The caption gain is **~6× its noise floor**; the pointing losses are **~1× theirs**. Caption consistency reaches 70.701 against the released 70.745 — essentially parity — and sa_co `single` rises to 0.8919, best of any run (released: 0.8832). `pixmo_count` is the one real cost at ~3× noise, though it lands exactly at the released 0.8685 rather than below it. ## Standing vs `Molmo2-4B-Pretrain` after this - **ahead**: both counting benchmarks - **parity**: sa_co f1 and `is_absent_acc` (two-seed means 0.5537 / 0.4786 vs 0.5559 / 0.4797) - **behind**: pixmo_points f1 by 0.018, dense_caption avg by 0.354 ## Caveats - **The treatment arm is n=1.** Baselines have two seeds each; the 1.25 config has one run. The caption gain is ~6× the caption noise floor so it is very likely real, but the pointing costs sit at ~1× theirs and a second seed would be needed to call them genuine rather than artifact. - **1.25 is a deliberate deviation from the released recipe**, which is why it is a documented flag rather than a hardcoded constant. - Run 1 alone appeared to beat released on sa_co (0.5593 vs 0.5559); that is a quarter of the 0.011 seed spread. With two seeds it is parity, not a win — which is why every delta above carries its noise floor. ## Verification `--caption_message_weight` exercised through real `dry_run`s: default → 1.25, `=1.0` → 1.0, `=2.0` → 2.0. 3 tests pin the default, the override path, and that the multiplier scales loss mass exactly 1.25× with `None` unchanged. 155 tests pass across `src/test/data/multimodal/`. isort/black/ruff clean. Checkpoint: `/weka/oe-training-default/ai2-llm/checkpoints/jasonr/molmo2-stage1-4b-capmw125u-20260904/step32000`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The pointing/counting dataset classes default
loss_token_weightingtoroot_subsegments, whichscales an example's loss by
1/√(n_labels). The caption dataset is explicitly set to"none", witha comment explaining exactly why that factor is wrong here — it "does not cancel out of the global
sum(CE*w)/sum(w)divisor when branch counts differ across examples" — but the four pointingentries were left on the default.
The released
Molmo2-4B-Pretrainweights every response token equally:mm_preprocessor.loss_token_weighting: None, andmessage_weight: Noneon all ofpixmo_points_train,pixmo_count_train,pixmo_points_high_freq_train,cosyn_point.Measured over 15k source rows under our
max_points=60filter:So pointing data got ~3.5× and counting ~1.7× less gradient weight per token than captions, for a
full 32k-step run.
Verified by a full run
Three 4B stage-1 checkpoints, 32k steps each, same recipe and
data.seed=95818, differing only inthese fixes. Every eval below was run with the checkpoint's own prompt family
(
-o prompt_templates=none -o system_prompt_style=style_and_length_v2) and completed with zeroscoring failures.
molmo2-stage1-4b-full-20260814molmo2-stage1-4b-ptfix-unalloc-20260819molmo2-stage1-4b-lossw-20260828All at
/weka/oe-training-default/ai2-llm/checkpoints/jasonr/<name>/step32000; released reference at/weka/oe-training-default/mm-olmo/released-models-molmo2-1225/Molmo2-4B-Pretrain/step32000.pixmo_point_eval_v3_mp:test (1215 instances)
sa_co_gold_point_4k_mp:test (28,672 instances, unweighted primaries)
Counting and captions
pixmo_countcorrectcountbench_qacorrectdense_captionavgReading it
The two fixes are cleanly separable, which is what makes the attribution credible:
is_absent_acc0.205 → 0.487 and SA-Co f1 0.331 → 0.550, whileleaving pixmo_points f1 flat (0.7062 → 0.7053) — the terse eval prompt lacks the "Please say
'There are none.'" instruction that only existed in the stage-2 template.
single+0.113 and overall f1+0.092, and SA-Co's non-absent buckets (
med_freq+0.059,high_freq+0.062,single+0.030),while
is_absent_accheld flat (−0.001) — i.e. the reweighting did not spend Stage 1: format pointing prompts with the stage-1 family, not stage 2's #836's gain.Net: the pointing gap against the released Pretrain checkpoint went from 11.0 points to 1.8.
Costs, stated plainly
Two benchmarks moved the wrong way and are not explained by the mechanism:
countbench_qadeclines monotonically across all three checkpoints (0.9612 → 0.9510 → 0.9388).It is the only benchmark that benefited from neither fix, and it is out-of-domain academic data,
unlike in-distribution
pixmo_count, which gained +0.028.dense_captionsub-metric exceptnum_statementsdeclines monotonically (avg −0.67 frombaseline). A plausible mechanism exists — raising the pointing/counting weight reduces captions'
relative share of the normalised
sum(CE*w)/sum(w)objective — but it is unconfirmed.Both are small per step, and the trade (+9.2 f1 pointing, +2.8 counting, for ~0.7 caption avg) is
strongly favourable, but a second seed would be needed to separate the ~0.7 from run-to-run
variance. Filed as a follow-up rather than a blocker.
Tests
2 new tests pin the stage-1 setting and the
1/√nmechanism (1 label → 1.000, 4 → 0.500,12 → 0.289); the stage-1 assertion fails when the value is restored to
root_subsegments. 8 testspass in the file. isort/black/ruff clean.