Qwen3 32B 多轮对话SFT后丢失think能力
Describe the bug What the bug is, and how to reproduce, better with screenshots(描述bug以及复现过程,最好有截图) Qwen3 32B,Qwen3 8B 我需要训多轮对话,最后一轮的Cot,按照swift文档组织多轮对话训练格式,设置loss,让模型只计算最后一轮assistant的loss(最后一轮带think)
版本号符合要求,但是训练好的模型,丢失了think能力,不会出think了。请教一下怎么回事?
Your hardware and system info Write your system info like CUDA version/system/GPU/torch version here(在这里给出硬件信息和系统信息,如CUDA版本,系统,GPU型号和torch版本等) swift-ms 3.8.0
Additional context Add any other context about the problem here(在这里补充其他信息)
数据样本按照要求
训练配置:
megatron sft
--seed=42
--finetune=True
--load='Qwen3-32B-mcore'
--recompute_granularity='full'
--recompute_method='uniform'
--recompute_num_layers=1
--sequence_parallel=True
--tensor_model_parallel_size=4
--pipeline_model_parallel_size=4
--attention_backend='flash'
--optimizer_cpu_offload=False
--optimizer_offload_fraction=1.0
--dataset 'xxx.jsonl'
--max_length=32768
--dataset_num_proc=2
--num_workers=8
--packing=True
--lr=1e-05
--lr_warmup_fraction=0.05
--min_lr=1e-06
--optimizer_cpu_offload=False
--use_precision_aware_optimizer=False
--micro_batch_size=1
--global_batch_size=32
--cross_entropy_loss_fusion=True
--max_epochs=2
--save='xxx'
--no_save_optim=True
--no_save_rng=True
--eval_interval=10
--save_interval=25 2>&1 \
我也在数据中加入了“loss”字段,但是报错:TypeError: Couldn't cast array of type [rank0]: struct<role: string, content: string, loss: bool> [rank0]: to [rank0]: {'role': Value(dtype='string', id=None), 'content': Value(dtype='string', id=None)} swift 版本是 3.9.2,应该是支持的才对
会不会是因为你的训练数据里没有think的token导致模型在SFT的过程中将这个能力退化了?
你好,我也遇到了相同的问题,请问你最后解决了吗
请问这个问题怎么解决的
你好, 我在qwen-4b上用类似的训练设置也出现了这个问题,请问你们最后解决了吗
--loss_scale ignore_empty_think