Skip to main content
QUICK REVIEW

[论文解读] A Comparative Study between Full-Parameter and LoRA-based Fine-Tuning on Chinese Instruction Data for Instruction Following Large Language Model

Xianghui Sun, Yunjie Ji|arXiv (Cornell University)|Apr 17, 2023
Topic ModelingComputer Science被引用 3
一句话总结

本研究在中文指令数据上对比了全参数微调与基于LoRA的微调方法,使用LLaMA模型,结果表明LoRA在显著降低训练成本的同时实现了具有竞争力的性能。关键发现显示,模型规模、数据规模和基础模型选择对LoRA的有效性具有决定性影响,更大的模型和更多数据能带来更好的结果;当应用于经过指令微调的基础模型时,LoRA的性能与全参数微调相当。

ABSTRACT

Recently, the instruction-tuning of large language models is a crucial area of research in the field of natural language processing. Due to resource and cost limitations, several researchers have employed parameter-efficient tuning techniques, such as LoRA, for instruction tuning, and have obtained encouraging results In comparison to full-parameter fine-tuning, LoRA-based tuning demonstrates salient benefits in terms of training costs. In this study, we undertook experimental comparisons between full-parameter fine-tuning and LoRA-based tuning methods, utilizing LLaMA as the base model. The experimental results show that the selection of the foundational model, training dataset scale, learnable parameter quantity, and model training cost are all important factors. We hope that the experimental conclusions of this paper can provide inspiration for training large language models, especially in the field of Chinese, and help researchers find a better trade-off strategy between training cost and model performance. To facilitate the reproduction of the paper's results, the dataset, model and code will be released.

研究动机与目标

  • 评估中文大语言模型指令跟随任务中,全参数微调与基于LoRA的微调之间的权衡。
  • 研究基础模型选择、训练数据规模和模型参数对LoRA性能的影响。
  • 为寻求在中文自然语言处理领域中成本效益高、性能优异的指令微调大语言模型的研究人员提供实证指导。
  • 发布代码、数据和模型,以支持可复现性并推动进一步研究。

提出的方法

  • 在中文指令数据集上,对LLaMA-7B和LLaMA-13B模型分别采用全参数微调和基于LoRA的方法进行微调。
  • 在不同数据规模下进行训练:0.6M、2M和4M个样本,以评估数据规模的影响。
  • 应用LoRA,使用低秩适配矩阵,仅微调一小部分参数,同时保持主模型参数冻结。
  • 在1,000个样本的基准测试集上,针对9个真实应用场景评估模型的指令遵循准确率。
  • 针对数学数据进行任务特定微调,同时对比LoRA与增量式全参数微调方法。
  • 采用标准化评估协议,使用人工标注的提示,以确保性能测量的一致性。

实验结果

研究问题

  • RQ1在中文数据上,基于LoRA的微调与全参数微调在指令遵循性能方面有何差异?
  • RQ2模型规模和训练数据规模如何影响基于LoRA的微调效果?
  • RQ3基础模型的选择(指令微调过的 vs. 非指令微调过的)是否显著影响LoRA性能?
  • RQ4当应用于指令微调过的基础模型时,LoRA能否实现与全参数微调相当的性能?
  • RQ5LoRA与全参数微调在训练成本与推理效率之间存在怎样的权衡?

主要发现

  • 在非指令微调的基础模型(LLaMA-7B)上应用LoRA微调,平均性能比全参数微调低约10分,表明在缺乏前期指令微调的情况下,LoRA效果有限。
  • 当应用于指令微调过的基础模型时,LoRA实现了与全参数微调相当的性能,尤其在数学任务中,其得分提升至0.586。
  • 将训练数据量翻倍(从0.6M增至2M)使平均性能提升约2分,表明更多数据能持续带来性能增益。
  • LLaMA-13B + LoRA(2M)的性能优于LLaMA-7B + LoRA(4M),表明模型规模对LoRA性能的影响大于数据规模。
  • 全参数微调所需的训练时间是LoRA的3至5倍,凸显了LoRA在效率上的优势,尽管在非指令微调基础模型上的性能略低。
  • 在微调过的基础模型上应用LoRA微调,数学性能提升至0.586,而全参数微调为0.559,表明当应用于强基础模型时,LoRA可极为高效。

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。