OPD icon indicating copy to clipboard operation
OPD copied to clipboard

SFT config qwen3_base_full_sft.yaml uses thinking template (enable_thinking: True) but teacher data is generated non-thinking — train/data/eval mismatch

Open LLMforScience opened this issue 5 months ago • 1 comments

The released SFT pipeline mixes non-thinking teacher data with a thinking SFT template, and the final evaluation is run in non-thinking mode. These three stages are inconsistent, which can hurt the resulting student/OPD model and make reproduction confusing.

  1. Teacher SFT data is generated non-thinking — scripts/infer/vllm_rollout.py:

  2. But the SFT config trains with the thinking template — LlamaFactory/examples/train_full/qwen3_base_full_sft.yaml

Could you please explain this? Thanks

LLMforScience avatar Jun 16 '26 22:06 LLMforScience

Thanks for the careful read — but there's actually no mismatch here. The three stages are all non-thinking and consistent.

The key is how LlamaFactory's qwen3 template (a ReasoningTemplate) treats enable_thinking. The teacher responses in OpenThought3-Qwen3-4B contain no ... content (just the direct answer with \boxed{}). In encode_oneturn (LlamaFactory/src/llamafactory/data/template.py#L424-L431), when the response has no thought tags, the template only prepends the empty thinking block <think>\n\n</think>\n\n — which is exactly Qwen3's canonical non-thinking format. enable_thinking: True does not synthesize any chain-of-thought that isn't already in the data.

So the SFT target becomes empty-think + direct answer, i.e. non-thinking behavior, which matches both the non-thinking teacher data and the non-thinking evaluation.

The only practical difference between enable_thinking: True and False / qwen3_nothink is whether the loss is computed over the 4 constant tokens of the empty think block (True: placed in the response, loss computed; False: placed in the prompt, no loss). It does not change the resulting non-thinking behavior. Hope this clears things up!

Turingzero0 avatar Jun 17 '26 07:06 Turingzero0