Repository navigation
feat(data): mask Muse Spark assistant spans - #1000
Conversation
The qwen3.5 parser looks for ChatML markers that Muse's Harmony template never emits, so every loss mask is empty. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
jiapingW
left a comment
There was a problem hiding this comment.
The overall design looks reasonable.
One correctness issue should be fixed before merging: train_only_last_turn=True currently keeps only the last regex match. Since Muse renders reasoning and the final answer as separate spans, this excludes the last turn’s reasoning from supervision. It should select all assistant spans belonging to the last turn, while keeping earlier turns as context only.
Please add a multi-turn regression test covering this behavior, and a test against a pinned Muse template to verify the assumptions currently encoded in the mock tokenizer.
train_only_last_turn kept only the final regex match, so the last turn's reasoning was left unsupervised. Co-authored-by: Cursor <cursoragent@cursor.com>
|
The multi-turn regression covers that case. A pinned Muse Spark chat template checks the mock tokenizer's span layout, including tool-argument bodies and the unsupervised tool schema in the system prompt. |
|
@jiapingW could you take another look? |
|
@jiapingW could you merge it pls? I don't have the permission |
Motivation
Muse Spark renders ShareGPT rows through its own tokenizer as Harmony messages (
<|start|>assistant to=self<|message|>...<|eom|>andto=userclosed by<|eot|>).data.chat_template: qwen3.5only selects a loss-mask parser, and that parser searches for<|im_start|>assistantmarkers this template never emits. Every mask is empty and the rows are dropped.This adds a
museprofile that keeps rendering ontokenizer.apply_chat_templateand masks the assistant spans that template actually produces.Modifications
museinspecforge/data/template.py.MuseParserand dispatchparser_type="muse". One assistant header and one end token cannot describe bothto=selfandto=user.to=self,to=user,to=commentary, andto=<tool name>messages. Leave the<|start|>assistant to=…<|message|>prefix, and system, user, and tool-result turns, unsupervised.enable_thinking. Do not reuse the qwen3.5 or gpt-oss Harmony parsers.Related Issues
Independent of the Muse capture patch in #999.
Accuracy Test
tests.test_data.test_muse_parserandtests.test_data.test_template_registrypass. The reasoning-plus-answer example hasloss_mask.sum() >= 2and covers both bodies. No GPU training run was performed.Benchmark & Profiling
Not run.
Checklist