[论文解读] Comparative Analysis of Different Efficient Fine Tuning Methods of Large Language Models (LLMs) in Low-Resource Setting
本文在低资源设置下对比了大型语言模型(LLMs)的高效微调方法,评估了标准微调、基于模式的微调(PBFT)、LoRA、自适应微调以及上下文蒸馏在OPT-125M和OPT-350M模型上的表现,数据集为MNLI和COLA。上下文蒸馏在分布外泛化方面优于标准微调,而PBFT由于提示设计不佳导致性能低于标准微调,凸显了效率、性能与资源约束之间的权衡。
In the domain of large language models (LLMs), arXiv:2305.16938 showed that few-shot full-model fine-tuning -- namely Vanilla Fine Tuning (FT) and Pattern-Based Fine Tuning (PBFT) --, and In-Context Learning (ICL) generalize similarly on Out-Of-Domain (OOD) datasets, but vary in terms of task adaptation. However, they both pose challenges, especially in term of memory requirements. In this paper, we further try to push the understanding of different fine-tuning strategies for LLM and aim to bring a myriad of these on the same pedestal for an elaborate comparison with full-model fine-tuning on two diverse datasets. To that end, we conducted a series of experiments, beginning with state-of-the-art methods like vanilla fine-tuning and Pattern-Based Fine-Tuning (PBFT) on pre-trained models across two datasets, COLA and MNLI. We then investigate adaptive fine-tuning and the efficiency of LoRA adapters in a few-shot setting. Finally, we also compare an alternative approach that has gained recent popularity -- context distillation -- with the vanilla FT and PBFT with and without few-shot setup. Our findings suggest that these alternative strategies that we explored can exhibit out-of-domain generalization comparable to that of vanilla FT and PBFT. PBFT under-performs Vanilla FT on out-of-domain (OOD) data, emphasizing the need for effective prompts. Further, our adaptive-fine tuning and LoRA experiments perform comparable or slightly worse than the standard fine-tunings as anticipated, since standard fine-tunings involve tuning the entire model. Finally, our context distillation experiments out-perform the standard fine-tuning methods. These findings underscore that eventually the choice of an appropriate fine-tuning method depends on the available resources (memory, compute, data) and task adaptability.
研究动机与目标
- 评估并比较在低资源、少样本设置下各种高效微调方法在LLM上的性能。
- 评估替代性微调策略(如LoRA、自适应微调和上下文蒸馏)相对于标准微调(vanilla FT)和基于模式的微调(PBFT)的泛化能力。
- 理解在序列分类任务中,模型性能、计算效率与资源约束之间的权衡,使用两个差异较大的数据集:MNLI和COLA。
- 研究少样本学习与提示工程对分布外(OOD)泛化的影响,特别是在低数据场景下。
提出的方法
- 在OPT-125M和OPT-350M模型上开展对比实验,使用两个数据集:MNLI(用于自然语言蕴含)和COLA(用于语法可接受性)。
- 将标准微调(vanilla FT)和基于模式的微调(PBFT)作为基线,采用一致的超参数和训练流程以确保公平比较。
- 应用低秩适应(LoRA),秩值范围为1至64,缩放因子α=8,与原始作者的α=32不同,以评估对超参数的敏感性。
- 探索自适应微调以优化学习动态,提升泛化能力,同时避免全模型更新。
- 实现上下文蒸馏,包括有少样本提示和无少样本提示两种方式,利用上下文示例将知识蒸馏到蒸馏模型中。
- 使用HANS数据集作为分布外基准,评估对句法和词汇启发式攻击的鲁棒性,确保泛化能力超越分布偏移。

实验结果
研究问题
- RQ1在低资源设置下,上下文蒸馏是否在分布外泛化方面优于标准微调和PBFT?
- RQ2LoRA和自适应微调在序列分类任务中,与全模型微调相比,性能与效率如何?
- RQ3为何PBFT在COLA数据集上表现劣于标准微调?这对少样本学习中的提示设计有何启示?
- RQ4少样本上下文蒸馏能否实现与全数据集微调相当的性能,同时减少训练时间和资源消耗?
- RQ5LoRA缩放因子α对性能有何影响,特别是在偏离原始超参数选择时?
主要发现
- 上下文蒸馏在OPT-125M模型上于MNLI数据集上实现了0.7209的域内准确率,显著优于标准微调和PBFT。
- 少样本上下文蒸馏在N=128个样本时达到0.6708的域内准确率,接近全数据集蒸馏性能,同时将训练时间从1小时51分钟缩短至5分19秒。
- 标准微调在COLA数据集上(N=16)的分布外准确率为0.5310,优于PBFT的0.5058,表明提示设计对泛化能力有显著影响。
- 自适应微调在COLA上的分布外性能相比标准微调提升了0.0290,表明动态优化在泛化方面具有优势。
- LoRA在α=8时性能提升微弱,各秩下的分布外准确率差异为-0.0697至-0.0445,表明与全微调相比改进有限。
- 在HANS数据集上,大多数方法的分布外准确率保持在约0.5,少样本蒸馏略有下降,表明在对抗性样本上泛化增益有限。

阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。