The widespread adoption of cloud-based proprietary large language models (LLMs) has introduced significant challenges, including operational dependencies, privacy concerns, and the necessity of continuous internet connectivity. In this work, we introduce an LLMOps pipeline, "LlamaDuo", for the seamless migration of knowledge and abilities from service-oriented LLMs to smaller, locally manageable models. This pipeline is crucial for ensuring service continuity in the presence of operational failures, strict privacy policies, or offline requirements. Our LlamaDuo involves fine-tuning a small language model against the service LLM using a synthetic dataset generated by the latter. If the performance of the fine-tuned model falls short of expectations, it is enhanced by further fine-tuning with additional similar data created by the service LLM. This iterative process guarantees that the smaller model can eventually match or even surpass the service LLM's capabilities in specific downstream tasks, offering a practical and scalable solution for managing AI deployments in constrained environments. Extensive experiments with leading edge LLMs are conducted to demonstrate the effectiveness, adaptability, and affordability of LlamaDuo across various downstream tasks. Our pipeline implementation is available at https://github.com/deep-diver/llamaduo.
翻译:基于云的专有大语言模型的广泛采用带来了诸多严峻挑战,包括运营依赖性、隐私问题以及持续互联网连接的必要性。本文提出一种名为"LlamaDuo"的LLMOps流程,旨在实现从服务导向的大语言模型向更小、可本地管理的模型进行知识与能力的无缝迁移。该流程对于在出现运营故障、严格隐私政策或离线需求时确保服务连续性至关重要。我们的LlamaDuo流程包括:利用服务型大语言模型生成的合成数据集对一个小型语言模型进行微调。若微调后的模型性能未达预期,则通过使用服务型大语言模型创建的额外相似数据进行进一步微调来增强其能力。这一迭代过程确保小型模型最终能够在特定下游任务中匹配甚至超越服务型大语言模型的能力,为在受限环境中管理人工智能部署提供了一个实用且可扩展的解决方案。我们通过对前沿大语言模型进行大量实验,证明了LlamaDuo在各种下游任务中的有效性、适应性和经济性。我们的流程实现已发布于 https://github.com/deep-diver/llamaduo。