arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2404.10779cs.SEcs.LG
收藏

面向企业的大语言模型微调:实用指南与建议

Fine Tuning LLM for Enterprise: Practical Guidelines and Recommendations

HCLTech

Mathav Raj J, Kushala VM, Harikrishna Warrier, Yogesh Gupta

AI总结:

针对企业用专有领域知识微调LLM的需求,本研究以开源LLaMA为对象,提出文档和代码数据集的预处理方案,给出GPU选型等入门指导,经定性验证后输出LLM微调的实用指南。

摘要:

企业迫切需要对LLM(大语言模型)进行微调,使其基于专有领域知识完成训练。当前的挑战在于,以最优化的资源、成本和尽可能短的时间,让大语言模型吸收领域特定知识。许多企业依赖RAG(检索增强生成),该技术无需对大语言模型进行微调,但其效果受限于向量数据库的质量及其检索能力,而非大语言模型本身的内在能力。在本研究中,我们聚焦于使用企业仓库中的专有文档和代码,对开源大语言模型LLaMA进行微调,并利用微调后的模型评估响应质量。作为研究工作的一部分,我们旨在通过合理预估所需GPU规模以及可用的数据格式化选项,指导初学者如何开展面向文档和代码场景的大语言模型微调工作。我们还提出了面向文档和代码的预处理方案,用于制备不同格式的数据集。针对文档数据集,我们提出的数据制备方法包括形成段落块、形成问答对以及形成关键词-段落块对;针对代码数据集,我们提出形成摘要-函数对的方法。此外,我们针对领域特定查询对模型结果进行了定性评估。最后,我们还提出了大语言模型微调的实用指南与建议。

英文摘要:

There is a compelling necessity from enterprises for fine tuning LLMs (Large Language Models) o get them trained on proprietary domain knowledge. The challenge is to imbibe the LLMs with domain specific knowledge using the most optimial resource and cost and in the best possible time. Many enterprises rely on RAG (Retrieval Augmented Generation) which does not need LLMs to be ine-tuned but they are limited by the quality of vector databases and their retrieval capabilities rather than the intrinsic capabilities of the LLMs themselves. In our current work we focus on fine tuning LLaMA, an open source LLM using proprietary documents and code from an enterprise repository and use the fine tuned models to evaluate the quality of responses. As part of this work, we aim to guide beginners on how to start with fine tuning an LLM for documentation and code by making educated guesses on size of GPU required and options that are available for formatting the data. We also propose pre processing recipes for both documentation and code to prepare dataset in different formats. The proposed methods of data preparation for document datasets are forming paragraph chunks, forming question and answer pairs and forming keyword and paragraph chunk pairs. For code dataset we propose forming summary and function pairs. Further, we qualitatively evaluate the results of the models for domain specific queries. Finally, we also propose practical guidelines and recommendations for fine tuning LLMs.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑