Repository navigation
Stage 1: format pointing prompts with the stage-1 family, not stage 2's - #836
Merged
Merged
Conversation
`SftFormatter` is a port of mm_olmo's `DataFormatter` for the *stage-2* prompt family, as its
docstring said: `uber_model_v2` templates plus `demo_or_style_v2`. Stage 1 was using it anyway, so
its pointing data was trained on
Point to leather earmuff
Please say 'There are none.' if it is not in the image.
where the released `Molmo2-4B-Pretrain` config (`prompt_templates: none`,
`system_prompt: style_and_length_v2`) trains on
pointing: leather earmuff
The evals send the released form, so our checkpoint was answering a prompt shape it had never
seen. On `pixmo_point_eval_v3_mp:test`, 1215 instances, both correctly prompted for their
respective families:
ours released 4B-Pretrain delta
f1 0.7062 0.8152 -0.109
precision 0.7231 0.8342 -0.111
recall 0.7232 0.8232 -0.100
zero (absent) 0.7181 0.9128 -0.195 <- worst
single 0.7647 0.8570 -0.092
low_freq 0.7233 0.8387 -0.116
med_freq 0.5795 0.6895 -0.110
high_freq 0.6739 0.7624 -0.089
The abstention slice is worst because the instruction to abstain -- "Please say 'There are
none.'" -- exists only inside the stage-2 template. Given the terse eval prompt our model has no
cue to abstain and says "There are none" 115 times where the released one says it 153. The same
mismatch also made our model echo the unfamiliar prefix back into its answer:
`<points coords="...">pointing: needle-nose tong</points>`.
Two other explanations were tested and eliminated first. Negative examples are not scarce in our
data: zero-count labels are 13.6% of pointing and 27.1% of counting label-instances under our
`max_points=60` filter, versus 13.6% and 25.0% under mm_olmo's unfiltered defaults -- we have
slightly more. And the coordinates are fine: differencing 1925 paired points against the released
model's shows dx/dy medians of 0.0/-2.0 on a 0-1000 scale with 65% of points within 2.0 units, so
there is no convention or scaling bug.
`SftFormatter` now takes `prompt_templates` and `system_prompt`, defaulting to the stage-2 family
so `image_only_v9` is untouched. Under `style_and_length*` the pointing/counting styles get their
`"<style>:"` prefix (they are in `DEMO_STYLES`, which is what suppressed it), and under
`prompt_templates="none"` the question is the bare lowercased label, matching
`data_formatter.py:1770-1779`. The three pointing dataset configs plumb both settings through, and
`Molmo2-Stage1.py` sets them via `POINTING_PROMPT_FAMILY`.
Verified: 6 new tests pin both families, that the target label never carries the prefix, and that
absent labels still abstain in both; the stage-1 assertions fail without the fix. 151 tests pass
across `src/test/data/multimodal/`. Stage-1 `dry_run` builds. isort/black/ruff clean; mypy
unchanged at its 3 pre-existing errors in this file.
This changes what stage 1 trains on, so it wants a fresh run to land -- the 08/14 checkpoint and
both runs cancelled today all carry the stage-2 pointing form.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
jason718
added a commit
that referenced
this pull request
Aug 31, 2026
The pointing/counting dataset classes default `loss_token_weighting` to `root_subsegments`, which scales an example's loss by `1/√(n_labels)`. The caption dataset is explicitly set to `"none"`, with a 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 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`, `cosyn_point`. Measured over 15k source rows under our `max_points=60` filter: | dataset | labels/example | our per-token weight | released | |---|---|---|---| | points-pointing | 12.5 | **0.28** | 1.00 | | points-counting | 2.8 | **0.60** | 1.00 | 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 in these 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 zero scoring failures. | checkpoint | contents | |---|---| | `molmo2-stage1-4b-full-20260814` | baseline: neither fix | | `molmo2-stage1-4b-ptfix-unalloc-20260819` | #836 only (stage-1 pointing prompt family) | | `molmo2-stage1-4b-lossw-20260828` | #836 + this PR | All 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) | metric | baseline | #836 only | **+#842** | Δ vs #836 | Δ vs baseline | released | gap left | |---|---|---|---|---|---|---|---| | **f1** | 0.7062 | 0.7053 | **0.7977** | **+0.0924** | +0.0915 | 0.8152 | 0.0175 | | precision | 0.7231 | 0.7226 | 0.8164 | +0.0938 | +0.0933 | 0.8342 | 0.0178 | | recall | 0.7232 | 0.7209 | 0.8037 | +0.0828 | +0.0805 | 0.8232 | 0.0195 | | **single** | 0.7647 | 0.7338 | **0.8465** | **+0.1127** | +0.0818 | 0.8570 | 0.0105 | | zero (absent) | 0.7181 | 0.8389 | 0.8658 | +0.0269 | +0.1477 | 0.9128 | 0.0470 | | low_freq | 0.7233 | 0.7240 | 0.8205 | +0.0965 | +0.0972 | 0.8387 | 0.0182 | | med_freq | 0.5795 | 0.5889 | 0.6774 | +0.0885 | +0.0979 | 0.6895 | 0.0121 | | high_freq | 0.6739 | 0.6640 | 0.7366 | +0.0726 | +0.0627 | 0.7624 | 0.0258 | ### sa_co_gold_point_4k_mp:test (28,672 instances, unweighted primaries) | metric | baseline | #836 only | **+#842** | Δ vs #836 | Δ vs baseline | |---|---|---|---|---|---| | **f1** | 0.3314 | 0.5502 | **0.5593** | +0.0091 | **+0.2279** | | precision | 0.3463 | 0.5639 | 0.5741 | +0.0102 | +0.2278 | | recall | 0.3394 | 0.5571 | 0.5640 | +0.0069 | +0.2246 | | single | 0.8363 | 0.8541 | **0.8842** | +0.0301 | +0.0479 | | low_freq | 0.3135 | 0.5476 | 0.5527 | +0.0051 | +0.2392 | | med_freq | 0.6343 | 0.6417 | **0.7011** | +0.0594 | +0.0668 | | high_freq | 0.5352 | 0.5423 | **0.6039** | +0.0616 | +0.0687 | | is_absent_acc | 0.2053 | 0.4871 | 0.4859 | −0.0012 | +0.2806 | | is_present_acc | 0.9969 | 0.9925 | 0.9912 | −0.0013 | −0.0057 | ### Counting and captions | benchmark / metric | baseline | #836 only | **+#842** | Δ vs #836 | Δ vs baseline | |---|---|---|---|---|---| | `pixmo_count` correct | 0.8815 | 0.8685 | **0.8963** | **+0.0278** | +0.0148 | | `countbench_qa` correct | 0.9612 | 0.9510 | 0.9388 | −0.0122 | **−0.0224** | | `dense_caption` avg | 57.983 | 57.721 | 57.314 | −0.407 | **−0.669** | | ↳ recall | 45.275 | 44.879 | 44.666 | −0.213 | −0.609 | | ↳ consistency | 70.691 | 70.564 | 69.961 | −0.603 | −0.730 | | ↳ recall_at_10 | 86.727 | 86.231 | 85.861 | −0.370 | −0.866 | | ↳ num_statements | 21.655 | 21.763 | 21.739 | −0.024 | +0.084 | ## Reading it The two fixes are cleanly separable, which is what makes the attribution credible: * **#836 fixed abstention.** It moved `is_absent_acc` 0.205 → 0.487 and SA-Co f1 0.331 → 0.550, while leaving 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. * **This PR fixed localisation.** On top of that it moved pixmo_points `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_acc` held flat (−0.001) — i.e. the reweighting did not spend #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_qa` declines 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. * every `dense_caption` sub-metric except `num_statements` declines monotonically (avg −0.67 from baseline). 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/√n` mechanism (1 label → 1.000, 4 → 0.500, 12 → 0.289); the stage-1 assertion fails when the value is restored to `root_subsegments`. 8 tests pass in the file. isort/black/ruff clean. Co-authored-by: Jason Ren <[email protected]>
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.
SftFormatteris a port of mm_olmo'sDataFormatterfor the stage-2 prompt family — itsdocstring said so:
uber_model_v2templates plusdemo_or_style_v2. Stage 1 used it anyway, so itspointing data trained on
where the released
Molmo2-4B-Pretrainconfig (prompt_templates: none,system_prompt: style_and_length_v2) trains onThe evals send the released form, so our checkpoint was answering a prompt shape it had never seen.
Measured
pixmo_point_eval_v3_mp:test, 1215 instances, each checkpoint prompted for its own family:Abstention is worst because the instruction to abstain — "Please say 'There are none.'" — exists
only inside the stage-2 template. Given the terse eval prompt our model has no cue to abstain,
and says "There are none" 115× where the released one says it 153×. The same mismatch made our model
echo the unfamiliar prefix into its answer:
<points coords="...">pointing: needle-nose tong</points>.Two other explanations tested and eliminated first
counting label-instances under our
max_points=60filter, versus 13.6% / 25.0% under mm_olmo'sunfiltered defaults — we have slightly more.
medians 0.0 / −2.0 on a 0–1000 scale, 65% of points within 2.0 units. No convention or scaling bug.
The change
SftFormattertakesprompt_templatesandsystem_prompt, defaulting to the stage-2 family soimage_only_v9is untouched. Understyle_and_length*the pointing/counting styles get their"<style>:"prefix (they live inDEMO_STYLES, which is what suppressed it), and underprompt_templates="none"the question is the bare lowercased label, matchingdata_formatter.py:1770-1779. The three pointing dataset configs plumb both settings, andMolmo2-Stage1.pysets them viaPOINTING_PROMPT_FAMILY.Verification
6 new tests pin both families, that the target label never carries the prefix, and that absent
labels still abstain in both — the stage-1 assertions fail without the fix. 151 tests pass across
src/test/data/multimodal/. Stage-1dry_runbuilds and the family reaches all three configs(defaults confirmed unchanged). isort/black/ruff clean; mypy unchanged at its 3 pre-existing errors
in this file.
This changes what stage 1 trains on, so it needs a fresh run to land — the 08/14 checkpoint and
the two runs cancelled today all carry the stage-2 pointing form.