OpenMOSS / OpenMOSS/MOSS-Audio

sft lora finetune的loss和gradient norm的数值过于大,sft训练后性能反而显著下降

Open
#26 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
665
Forks
45
PR merge metrics
No merged PRs in 30d

Description

我用finetune的代码在我的数据集上进行lora微调,finetune.py没有任何修改,但是训练过程中的loss和gradient norm的数值都是好几十,感觉不正常啊,训练完后性能也下降了,请问这是正常的吗?
我的训练Log数值:
{'loss': 17.0996, 'grad_norm': 14.1919527053833, 'learning_rate': 4.9146347821251266e-05, 'epoch': 0.55}
我的微调脚本:
accelerate launch --num_processes 4 finetune/finetune.py
--model_dir openmoss/MOSS-Audio-8B-Thinking
--data_path path/to/data
--eval_data_path path/to/data
--eval_strategy steps
--save_strategy steps
--output_dir path/to/output
--attn_implementation sdpa
--max_len 2048
--use_lora
--lora_rank 8
--lora_alpha 32
--lora_on_audio_encoder true
--bf16
--per_device_train_batch_size 1
--per_device_eval_batch_size 1
--gradient_accumulation_steps 8
--num_train_epochs 1
--learning_rate 1e-4
--logging_steps 1
--save_steps 10
--eval_steps 10
--lr_scheduler_type cosine
--warmup_steps 50
--save_total_limit 5
--max_grad_norm 1.0 \

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting finetune/finetune.py and reproducing the reported run with the supplied accelerate command and training arguments. Compare the logged loss and grad_norm with the configured max_grad_norm, LoRA settings, and evaluation results; done means determining whether the behavior is expected or identifying a reproducible training or evaluation defect.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.