FudanDISC / DISC-LawLLM

[中文法律大模型] DISC-LawLLM: an intelligent legal system powered by large language models (LLMs) to provide a wide range of legal services.
Apache License 2.0
563 stars 66 forks source link

Finetuning self-cognition not working #24

Closed lichenyigit closed 11 months ago

lichenyigit commented 1 year ago

你好我要微调数据。现在用【我是谁】来做测试数据。 微调之后,感觉没有一点效果。 还请看一下什么问题?

数据集如下: 0.json

微调脚本如下: torchrun --nproc_per_node 1 src/train_bash.py \ --stage sft \ --model_name_or_path ShengbinYue/DISC-LawLLM \ --do_train \ --dataset yiqi \ --template baichuan2 \ --finetuning_type lora \ --lora_rank 8 \ --lora_target W_pack \ --output_dir output_checkpoint\ --overwrite_cache \ --per_device_train_batch_size 4 \ --per_device_eval_batch_size 4 \ --gradient_accumulation_steps 8 \ --preprocessing_num_workers 16 \ --lr_scheduler_type cosine \ --logging_steps 10 \ --save_steps 100 \ --eval_steps 100 \ --learning_rate 1e-4 \ --max_grad_norm 0.5 \ --num_train_epochs 3000.0 \ --evaluation_strategy steps \ --load_best_model_at_end \ --plot_loss \ --fp16 \ --val_size 0.01

导出脚本如下: python src/export_model.py \ --model_name_or_path ShengbinYue/DISC-LawLLM \ --template baichuan2 \ --finetuning_type lora \ --checkpoint_dir output_checkpoint \ --export_dir export_model

Charlie-XIAO commented 1 year ago

DISC-LawLLM has been training on self-cognition. This behavior may be very hard to override, at least not possible with only ~10 data.

lichenyigit commented 1 year ago

需要多少个数据才会有效果呢?

lichenyigit commented 1 year ago

@Charlie-XIAO 可以抽空回答一下问题吗?

Charlie-XIAO commented 1 year ago

@lichenyigit I have no exact answer for this, but there may need to be at least hundreds.

lichenyigit commented 1 year ago

后来,又进行了10000次训练力度,还是没有效果。请问是哪个步骤出了问题? 数据集: 新闻Q&A.json 训练脚本:

torchrun --nproc_per_node 1 src/train_bash.py \
    --stage sft \
    --model_name_or_path ShengbinYue/DISC-LawLLM \
    --do_train \
    --dataset yiqi5-fun \
    --template baichuan2 \
    --finetuning_type lora \
    --lora_rank 8 \
    --lora_target W_pack \
    --output_dir /home/DISC-output-checkpoint \
    --overwrite_output_dir \
    --overwrite_cache \
    --per_device_train_batch_size 4 \
    --per_device_eval_batch_size 4 \
    --gradient_accumulation_steps 8 \
    --preprocessing_num_workers 16 \
    --lr_scheduler_type cosine \
    --logging_steps 10 \
    --save_steps 100 \
    --eval_steps 100 \
    --learning_rate 1e-5 \
    --max_grad_norm 0.5 \
    --num_train_epochs 10000.0 \
    --evaluation_strategy steps \
    --load_best_model_at_end \
    --plot_loss \
    --fp16 \
    --val_size 0.01

@Charlie-XIAO

Charlie-XIAO commented 11 months ago

Moving to #29, closing this one as completed.