Skip to main content
QUICK REVIEW

[论文解读] SWIFT:A Scalable lightWeight Infrastructure for Fine-Tuning

Yuze Zhao, Jintao Huang|arXiv (Cornell University)|Aug 10, 2024
Semiconductor Lasers and Optical DevicesEngineering被引用 5
一句话总结

SWIFT 是一个开源框架,统一训练、微调、后训练流程与部署,支持 300+ LLMs 和 50+ MLLMs,实现轻量级、多模态模型调优,集成评估与量化。

ABSTRACT

Recent development in Large Language Models (LLMs) and Multi-modal Large Language Models (MLLMs) have leverage Attention-based Transformer architectures and achieved superior performance and generalization capabilities. They have since covered extensive areas of traditional learning tasks. For instance, text-based tasks such as text-classification and sequence-labeling, as well as multi-modal tasks like Visual Question Answering (VQA) and Optical Character Recognition (OCR), which were previously addressed using different models, can now be tackled based on one foundation model. Consequently, the training and lightweight fine-tuning of LLMs and MLLMs, especially those based on Transformer architecture, has become particularly important. In recognition of these overwhelming needs, we develop SWIFT, a customizable one-stop infrastructure for large models. With support of over $300+$ LLMs and $50+$ MLLMs, SWIFT stands as the open-source framework that provide the most comprehensive support for fine-tuning large models. In particular, it is the first training framework that provides systematic support for MLLMs. In addition to the core functionalities of fine-tuning, SWIFT also integrates post-training processes such as inference, evaluation, and model quantization, to facilitate fast adoptions of large models in various application scenarios. With a systematic integration of various training techniques, SWIFT offers helpful utilities such as benchmark comparisons among different training techniques for large models. For fine-tuning models specialized in agent framework, we show that notable improvements on the ToolBench leader-board can be achieved by training with customized dataset on SWIFT, with an increase of 5.2%-21.8% in the Act.EM metric over various baseline models, a reduction in hallucination by 1.6%-14.1%, and an average performance improvement of 8%-17%.

研究动机与目标

  • 解决对统一、轻量级的大语言模型和多模态模型训练与微调流水线的需求。
  • 在基于 Transformer 的框架内,为文本 LLMs 与 MLLMs 提供系统性支持。
  • 整合后训练流程(推理、评估、量化),以促进在应用中的快速落地。
  • 提供一套调优技术及部署/评估工具,用于比较不同训练方法与结果。

提出的方法

  • 将 SWIFT 引入为一个与 Transformer 兼容的训练框架,集成 PEFT 和 Optimum,用于预训练、微调和人类对齐。
  • 支持六种量化类型(BNB、HQQ、EETQ、AWQ、GPTQ、AQLM)和 QLoRA 风格的训练。
  • 纳入 PEFT 之外的调优器(如 LLaMA-Pro、LongLoRA、LISA、DoRA、rsLoRA),并通过 prepare_model 与 from_pretrained 实现界面的混用/统一。
  • 提供训练、推理、评估与部署路径,包括基于 Megatron 的预训练支持以及长序列的序列并行。
  • 提供一个可扩展的数据集和模板系统来处理文本和多模态数据,针对 Agent 相关微调提供 ToolBench 和 AgentFlan 风格数据集的专门支持。
  • 暴露一个 Web UI(Gradio)和命令行界面,实现端到端工作流(pt、sft、rlhf)以及与 OpenAI 兼容的推理 API。
Figure 1 . The framework of SWIFT
Figure 1 . The framework of SWIFT

实验结果

研究问题

  • RQ1如何让一个开源框架在训练和微调中高效地同时支持文本 LLMs 与多模态 LLMs?
  • RQ2哪些轻量级调优技术在不同模型之间能实现内存、速度与准确率的最佳权衡?
  • RQ3如何整合后训练过程(推理、评估、量化)以简化大模型的部署?
  • RQ4通过专用数据集和损失缩放策略,在代理相关的微调方面可以实现哪些改进?

主要发现

  • SWIFT 支持超过 300 个 NLP 模型和超过 50 个多模态模型,以及 150+ 数据集。
  • 在轻量级调优基准中,LISA 在调优器中实现了最低内存占用和最快速度。
  • LoRA+、GaLore 和 Q-GaLore 在 qwen-7b-chat 和 LLaMA3-8b-instruct 等模型上展现出较强的性能提升和内存/速度特征。
  • Agent 训练实验表明 loss-scale 在 in-domain 和 out-of-domain 设置下显著改善 Plan.EM、Act.EM、Hallucination rate 及其他指标。
  • 在领域内 Qwen2-7b-instruct ToolBench 的 LoRA/Ours 与 Full(Ours) 结果在若干指标上超越基线 GPT-4;平均提升约 8-17%。
  • 该框架实现多 LoRA 推理与部署,灵活的后端(vLLM、PT),以及用于多模态任务的无缝基于模板的数据处理。

阅读本论文

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

在 Nubint 中阅读本论文

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