Fix MLM seq2seq suffix window train/inference mismatch#48
Merged
Conversation
Cap MLM-eligible and attended suffix positions to block_size after the prompt, hiding the tail from attention and loss. TinyGSM uses variable- length prefixes with truncate: null and a larger model.max_length. Fixes #47 Co-authored-by: Cursor <cursoragent@cursor.com>
input_ids reflect random MLM masking; suffix slot layout belongs in target_ids. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #48 +/- ##
==========================================
+ Coverage 36.04% 36.25% +0.21%
==========================================
Files 128 128
Lines 11442 11470 +28
Branches 1555 1560 +5
==========================================
+ Hits 4124 4159 +35
+ Misses 7109 7097 -12
- Partials 209 214 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Fixes #47
Summary
suffix_block_sizetoprepare_prefix_suffix_ids: fixed suffix slot after the prompt, with tail positions attention-hidden and excluded from MLM masking/lossMLMSeq2SeqTrainCollator; auto-detectinput_block_size == 0for TinyGSM (batch-max padding, no shared 512-block packing)truncate: nullon train/val lm collators;model.max_length: 2048in experiment YAMLinput_block_size) and TinyGSM (variable prefix) layoutsTest plan
pytest tests/models/mlm/test_collator_mlm.py -k PreparePrefixSuffixblock_sizelen(prompt) + block_sizeMade with Cursor