RAG单选题-大模型微调实验

一、背景

  • 最近参加一个竞赛:大模型根据规则内容做单选题。
  • 比赛的时候利用纯工程方式实现(RAG单选题-技术方案),并没有考虑使用模型微调(GPU服务器资源紧张,性价比一般来说比工程方式低)。
  • 现进行复盘,基于羊毛薅不秃就往秃里薅的基本原则,赛事官方给的标注数据利用起来,进行一些实验。为后续积累经验。
  • 利用竞赛官方标注数据,进行模型微调,对比测试几种微调方式(lora sft、lora dpo、full fintune)的效果。

二、 实验结论

进行了几组模型微调之后的对比测试实验,在此类选择题推理场景下,结论如下

  1. prompt选择方面:sft类型prompt效果比较好(任务描述放system里)
  2. 模型微调方面:效果 lora sft > lora dpo(大多数情况)
  3. 训练数据量方面:本次标注数据量还是太少了(400),全参微调效果不好
  4. 对于尺寸小的模型(1.5B),baseline效果不好(0.72)的模型,通过lora微调往往能有比较大的收益(0.9)
  5. 基模选择方面:intern2.5 7b chat为同尺寸类型中指标最优
    1. 第一梯队:intern2.5 7b chat ,qwen2 7b instruct
    1. 第二梯队:Yi-1.5-6B-Chat,llama 3.1 8b instruct,chatglm3-6b

三、实验数据详情

序号模型accuracy(dev 100)备注
1Qwen/Qwen2-7B-Instruct0.92(sft prompt 0.93)baseline
2Qwen/Qwen2-7B-Instruct-lora-dpo400,单卡v100,1h50min0.92 (sft prompt 0.93)
3Qwen/Qwen2-7B-Instruct-lora-sft400,单卡v100,1h30min0.91 (sft prompt 0.9)
4Qwen/Qwen2-7B-Instruct-full-sft400,双卡H20,7min0.89 (sft prompt 0.89)
5Qwen/Qwen2-1.5B-Instruct0.72 (sft prompt 0.72)baseline
6Qwen/Qwen2-1.5B-Instruct-lora-dpo400,单卡v100,30min0.81 (sft prompt 0.85)
7Qwen/Qwen2-1.5B-Instruct-lora-sft400,单卡v100,30min0.9 (sft prompt 0.89)
8Qwen/Qwen2-1.5B-Instruct-full-sft400,双卡v100,30min0.88 (sft prompt 0.9)
9Qwen/Qwen2-1.5B-Instruct-full-dpo400,单卡H20,10min
10internlm/internlm2_5-7b-chat0.92 (sft prompt 0.94)baseline
11internlm/internlm2_5-7b-chat-lora-dpo400,单卡H20,10min0.92 (sft prompt 0.93)
12internlm/internlm2_5-7b-chat-lora-sft400,单卡H20,10min0.95 (sft prompt 0.96)
13internlm/internlm2_5-7b-chat-full-sft400,双卡H20,7min0.92 (sft prompt 0.92)
14Qwen/Qwen2.5-32B-Instruct0.93
15Qwen/Qwen2.5-72B-Instruct0.95
1601-ai/Yi-1.5-6B-Chat0.85
17meta-llama/Meta-Llama-3.1-8B-Instruct0.77
18THUDM/chatglm3-6b0.76
柚子

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

Index