Skip to main content
QUICK REVIEW

[论文解读] LoRA Land: 310 Fine-tuned LLMs that Rival GPT-4, A Technical Report

Justin Zhao, Timothy C. Wang|arXiv (Cornell University)|Apr 29, 2024
Particle accelerators and beam dynamicsEngineering被引用 8
一句话总结

本文在10个基模型和31个任务上评估了310个 LoRA 微调的 LLM,结果显示4-bit LoRA 微调在平均水平上常常超过基模型和GPT-4,并展示了在 LoRAX 与 LoRA Land 平台将25个微调的 Mistral-7B 模型部署在单个 A100 GPU 的实际应用。

ABSTRACT

Low Rank Adaptation (LoRA) has emerged as one of the most widely adopted methods for Parameter Efficient Fine-Tuning (PEFT) of Large Language Models (LLMs). LoRA reduces the number of trainable parameters and memory usage while achieving comparable performance to full fine-tuning. We aim to assess the viability of training and serving LLMs fine-tuned with LoRA in real-world applications. First, we measure the quality of LLMs fine-tuned with quantized low rank adapters across 10 base models and 31 tasks for a total of 310 models. We find that 4-bit LoRA fine-tuned models outperform base models by 34 points and GPT-4 by 10 points on average. Second, we investigate the most effective base models for fine-tuning and assess the correlative and predictive capacities of task complexity heuristics in forecasting the outcomes of fine-tuning. Finally, we evaluate the latency and concurrency capabilities of LoRAX, an open-source Multi-LoRA inference server that facilitates the deployment of multiple LoRA fine-tuned models on a single GPU using shared base model weights and dynamic adapter loading. LoRAX powers LoRA Land, a web application that hosts 25 LoRA fine-tuned Mistral-7B LLMs on a single NVIDIA A100 GPU with 80GB memory. LoRA Land highlights the quality and cost-effectiveness of employing multiple specialized LLMs over a single, general-purpose LLM.

研究动机与目标

  • 评估在实际应用中训练和服务 LoRA 微调 LLM 的可行性。
  • 在标准化提示下,量化 LoRA 微调在多样化基模型和任务上的性能提升。
  • 研究哪些基模型和任务特征最能预测微调收益。
  • 评估使用 LoRAX 在生产环境中同时服务多个 LoRA 适配器的延迟、并发性和实用性。

提出的方法

  • 使用 4-bit 量化、秩为 8 对 10 个基模型进行 LoRA 的标准化微调,共 310 个 LLM。
  • 统一训练设置:40000 步、批量大小 1、Paged Adam、学习率 0.002、余弦学习率调度、3% 预热、16 次累积步长。
  • 使用零-shot 或单次完成提示进行评估,并用正则表达式提取将输出映射到地面真实词汇表。
  • 生成任务使用 ROUGE-L,分类任务使用准确率,回归任务使用 MAE,具任务特定的适应(WikiSQL ROUGE 作为代理)。
  • 使用 LoRAX 启用动态适配器加载和在单个 GPU 上的多模型服务,并在 LoRA Land 部署 25 个 LoRA 微调的 Mistral-7B 模型。
Figure 1 : Average model performance for GPT-3.5, GPT-4, and 310 LLMs, before and after fine-tuning with LoRA, across 31 different tasks and 10 different base models. Zephyr-7b and Mistral-7b models exhibit the best performance after LoRA-based fine-tuning.
Figure 1 : Average model performance for GPT-3.5, GPT-4, and 310 LLMs, before and after fine-tuning with LoRA, across 31 different tasks and 10 different base models. Zephyr-7b and Mistral-7b models exhibit the best performance after LoRA-based fine-tuning.

实验结果

研究问题

  • RQ1在统一提示下,LoRA 微调在广泛的基模型和任务上有多大效果?
  • RQ2哪些基模型从 LoRA 微调中获益最多,模型大小如何影响收益?
  • RQ3任务复杂度启发式能否预测微调收益的幅度及对基线的提升?
  • RQ4在生产中使用 LoRAX 高效地部署和服务多个 LoRA 适配器是否可行?

主要发现

  • 4-bit LoRA 微调模型在平均上比基模型高出 34 点,平均也超过 GPT-4 10 点,在31个任务和10个基模型上。
  • 最优秀的微调 LLM 在 310 项任务中有 301 项胜过其基模型对应项,在 310 项中有 224 项胜过 GPT-4。
  • Phi-2 (2B) 在微调后与 GPT-4 竞争;7B 模型普遍在微调后优于其 2B 对应模型。
  • Mistral-7B 和 Zephyr-7b-beta 成为 LoRA 微调的顶尖基模型,Mistral-7B 在各任务中最常位居第一,Zephyr-7b-beta 取得总体最高平均值。
  • LoRAX 使在单个 A100 上服务 25 个 LoRA 微调的 Mistral-7B 模型成为可能,展示了实际、成本效益高的多模型部署。
Figure 2 : Examples of different styles of prompting. To maintain using the same prompts when comparing models and to ensure the highest likelihood of success amongst all types of models (fine-tuned, auto-complete, or instruction-tuned), all of our prompts adhere to completion style.
Figure 2 : Examples of different styles of prompting. To maintain using the same prompts when comparing models and to ensure the highest likelihood of success amongst all types of models (fine-tuned, auto-complete, or instruction-tuned), all of our prompts adhere to completion style.

阅读本论文

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

在 Nubint 中阅读本论文

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