ms-swift icon indicating copy to clipboard operation
ms-swift copied to clipboard

怎么提高GRPO的训练效果

Open dong-168 opened this issue 1 year ago • 1 comments

GRPO的训练效果不如SFT

同数据集和同模型(qwen2.5vl-3b)前提下,

  • grpo表现稍逊色sft方法。

  • grpo参数:

  • 我该如何调参或改进它呢?

      args = RLHFArguments(
          rlhf_type="grpo",
          model=MODEL_PATH,
          external_plugins=EXTERNAL_PLUGINS,
          reward_funcs=[funcs["cot"][-1], "format"],  
          train_type=TRAIN_TYPE,
          torch_dtype="float32",  
          dataset=DATASET_PATH,
          max_length=2048,        
          max_completion_length=2048,     
          num_train_epochs=5,  
          per_device_train_batch_size=2,
          per_device_eval_batch_size=2,
          learning_rate=1e-5,
          gradient_accumulation_steps=4,
          save_strategy="steps",
          eval_strategy="steps",
          eval_steps=1000,
          save_steps=50,
          save_total_limit=10,
          logging_steps=1,
          output_dir=OUTPUT_DIR,
          dataloader_num_workers=4,
          temperature=1.0,
          system=SYSTEM_PROMPT,
          log_completions=True, 
          num_iterations=1,
          num_infer_workers=2,
          async_generate=False,  
          num_generations=2,
          split_dataset_ratio=0,
          lora_rank=8,
          lora_alpha=32,
          target_modules="all-linear",
          beta=0.001,  # KL系数
          warmup_ratio=0.03,
          max_grad_norm=1.0,
          lr_scheduler_type="cosine",
    
          is_device_map=True,
          device_num=GPU_NUM,
          is_filter_trainData=True,
      )
    

dong-168 avatar Sep 08 '25 03:09 dong-168

This issue has been inactive for over 3 months and will be automatically closed in 7 days. If this issue is still relevant, please reply to this message.

github-actions[bot] avatar Dec 08 '25 00:12 github-actions[bot]