在大型语言模型(LLM)领域,arXiv:2305.16938 表明,少样本全模型微调——即香草微调(FT)和基于模式的微调(PBFT)——以及上下文学习(ICL)在域外(OOD)数据集上具有相似的泛化能力,但在任务适应性方面有所不同。然而,这两种方法都带来了挑战,尤其是在内存需求方面。在本文中,我们进一步尝试加深对 LLM 不同微调策略的理解,并旨在将多种策略置于同一平台上,与全模型微调在两个不同数据集上进行详细比较。为此,我们进行了一系列实验,首先在预训练模型上使用最先进的方法,如香草微调和基于模式的微调(PBFT),应用于 COLA 和 MNLI 两个数据集。然后,我们研究了自适应微调和 LoRA 适配器在少样本设置下的效率。最后,我们还比较了一种最近流行的替代方法——上下文蒸馏——与香草 FT 和 PBFT 在有无少样本设置下的表现。我们的研究结果表明,我们探索的这些替代策略可以展现出与香草 FT 和 PBFT 相当的域外泛化能力。PBFT 在域外(OOD)数据上的表现不如香草 FT,这强调了有效提示的必要性。此外,我们的自适应微调和 LoRA 实验表现与标准微调相当或略差,这符合预期,因为标准微调涉及对整个模型的调整。最后,我们的上下文蒸馏实验优于标准微调方法。这些发现强调,最终选择合适的微调方法取决于可用资源(内存、计算、数据)和任务适应性。
英文摘要:
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.
The Ultimate Guide to Fine-Tuning LLMs from Basics to Breakthroughs: An Exhaustive Review of Technologies, Research, Best Practices, Applied Research Challenges and Opportunities
University College Dublin(都柏林大学学院);CeADAR(CeADAR(爱尔兰人工智能中心))
Comparative Analysis of Listwise Reranking with Large Language Models in Limited-Resource Language Contexts
Simon Fraser University(西蒙菲莎大学);Duke University(杜克大学);University of California San Diego(加利福尼亚大学圣迭戈分校);University of Amsterdam(阿姆斯特丹大学);Johns Hopkins University(约翰斯·霍普金斯大学)
A Comparative Study of Specialized LLMs as Dense Retrievers
Key Laboratory of Network Data Science and Technology(网络数据科学与技术重点实验室);Institute of Computing Technology(计算技术研究所);Chinese Academy of Sciences(中国科学院);State Key Laboratory of AI Safety(人工智能安全国家重点实验室);University of Chinese Academy of Science(中国科学院大学)
L-TUNING: Synchronized Label Tuning for Prompt and Prefix in LLMs
Stevens Institute of Technology(史蒂文斯理工学院);Hajee Mohammad Danesh Science & Technology University(哈吉·穆罕默德·达内什科学技术大学);Noakhali Science & Technology University(诺阿卡利科学技术大学);Amazon(亚马逊)
Parameter-Efficient Fine-Tuning for Low-Resource Languages: A Comparative Study of LLMs for Bengali Hate Speech Detection
Department of Computer Science and Engineering(计算机科学与工程系);University of Rajshahi(拉贾沙希大学);College of Engineering and Computer Sciences(工程与计算机科学学院);Marshall University(马歇尔大学)
Fine-Tuning Large Language Models for Scientific Text Classification: A Comparative Study
Doctoral School of Applied Informatics(应用信息学博士学院);Applied Mathematics Óbuda University Budapest, Hungary(应用数学 奥布达大学 布达佩斯 匈牙利);John von Neumann Faculty of Informatics(约翰·冯·诺依曼信息学学院)