开发者社区 > ModelScope模型即服务 > 自然语言处理 > 正文

我用开源数据集lora微调后,发现很多回答都不太准确,跟指令一模一样的问题都答错了

我用开源数据集lora微调后,发现很多回答都不太准确,跟指令一模一样的问题都答错了,这种问题怎么解决呀?

微调配置如下:

training_args.yaml

cutoff_len: 1024
dataset: alpaca_gpt4_data_en.json,alpaca_gpt4_data_zh.json,code_alpaca_20k.json
dataset_dir: /xxx
ddp_timeout: 180000000
deepspeed: cache/ds_z2_config.json
do_train: true
eval_steps: 100
eval_strategy: steps
finetuning_type: lora
flash_attn: auto
fp16: true
gradient_accumulation_steps: 8
include_num_input_tokens_seen: true
learning_rate: 5.0e-05
logging_steps: 10
lora_alpha: 16
lora_dropout: 0
lora_rank: 16
lora_target: all
lr_scheduler_type: cosine
max_grad_norm: 0.5
max_samples: 100000
model_name_or_path: /xxx/Baichuan-7B-Base
num_train_epochs: 2.0
optim: adamw_torch
output_dir: saves/Baichuan-7B-Base/lora/hiyouga_Baichuan-7B-sft
packing: false
per_device_eval_batch_size: 8
per_device_train_batch_size: 8
plot_loss: true
preprocessing_num_workers: 16
quantization_method: bitsandbytes
report_to: none
save_steps: 100
stage: sft
template: default
val_size: 0.01
warmup_steps: 0

all_results.json

{
    "epoch": 1.9989299090422685,
    "eval_accuracy": 0.7150343523585071,
    "eval_loss": 1.099609375,
    "eval_runtime": 31.0477,
    "eval_samples_per_second": 38.94,
    "eval_steps_per_second": 2.448,
    "num_input_tokens_seen": 91293504,
    "total_flos": 3.710641784267735e+18,
    "train_loss": 1.1082913645840304,
    "train_runtime": 19932.6598,
    "train_samples_per_second": 12.002,
    "train_steps_per_second": 0.094
}

环境

A100 * 2
cuda_11.7.r11.7
LLaMA-Factory:最新版本

training_loss.png

training_loss.png

training_eval_loss.png

training_eval_loss.png

测试结果 - 1

image-3.png

4.png

原始数据(alpaca_gpt4_data_zh):

  {
    "instruction": "朱利叶斯·凯撒是如何死亡的?",
    "input": "",
    "output": "朱利叶斯·凯撒,又称尤利乌斯·恺撒(Julius Caesar)是古罗马的政治家、军事家和作家。他于公元前44年3月15日被刺杀。 \n\n根据历史记载,当时罗马元老院里一些参议员联合起来策划了对恺撒的刺杀行动,因为他们担心恺撒的统治将给罗马共和制带来威胁。在公元前44年3月15日(又称“3月的艾达之日”),恺撒去参加元老院会议时,被一群参议员包围并被攻击致死。据记载,他身中23刀,其中一刀最终致命。"
  },

测试结果 - 2

5.png

原始数据(alpaca_gpt4_data_zh):

  {
    "instruction": "快速棕色的狐狸跳了。",
    "input": "",
    "output": "This sentence in Chinese roughly translates to \"The quick brown fox jumps.\" in English. Is there something specific you would like me to do with this information?"
  },

展开
收起
游客gnswtecn3bvmu 2024-07-12 11:21:30 56 0
0 条回答
写回答
取消 提交回答

包含命名实体识别、文本分类、分词、关系抽取、问答、推理、文本摘要、情感分析、机器翻译等多个领域

热门讨论

热门文章

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载