Foundation models have demonstrated a great ability to achieve general human-level intelligence far beyond traditional approaches. As the technique keeps attracting attention from the AI community, an increasing number of foundation models are becoming publicly accessible. However, a significant shortcoming of most of these models lies in their performance in specialized-domain and task-specific applications, necessitating domain- and task-aware fine-tuning to develop effective scientific language models. As the number of available foundation models and specialized tasks keeps growing, the job of training scientific language models becomes highly nontrivial. In this paper, we initiate steps to tackle this issue. We introduce an extensible and lightweight toolkit, LMFlow, which aims to simplify the domain- and task-aware finetuning of general foundation models. LMFlow offers a complete finetuning workflow for a foundation model to support specialized training with limited computing resources. Furthermore, it supports continuous pretraining, instruction tuning, parameter-efficient finetuning, alignment tuning, inference acceleration, long context generalization, model customization, and even multimodal finetuning, along with carefully designed and extensible APIs. This toolkit has been thoroughly tested and is available at https://github.com/OptimalScale/LMFlow.
翻译:基础模型已展现出远超传统方法、实现通用人类智能的强大能力。随着该技术持续受到人工智能领域关注,越来越多的基础模型变得可公开获取。然而,这些模型在特定领域和任务特定应用上的性能存在显著不足,需要结合领域和任务感知的微调来开发有效的科学语言模型。随着可用基础模型和专门任务数量的持续增长,训练科学语言模型的工作变得极具挑战性。本文着手解决这一问题,介绍了一个可扩展的轻量级工具包——LMFlow,旨在简化通用基础模型的领域和任务感知微调。LMFlow为基础模型提供了完整的微调工作流,支持在有限计算资源下进行专业化训练。此外,该工具包还支持持续预训练、指令微调、参数高效微调、对齐微调、推理加速、长上下文泛化、模型定制,甚至多模态微调,并配备了精心设计且可扩展的API。该工具包已全面测试,可通过https://github.com/OptimalScale/LMFlow获取。