将大型语言模型移植到移动设备以用于问答
Porting Large Language Models to Mobile Devices for Question Answering
AI总结:
本文使用llama.cpp框架将30亿参数的Orca-Mini-3B模型6-bit量化版移植到移动设备,实现Galaxy S21上的交互式问答推理并保持高质量回答。
摘要:
在移动设备上部署大型语言模型(LLMs)使得自然语言处理的所有能力都能在设备上使用。LLMs的一个重要应用场景是问答,它可以为各种用户查询提供准确且与上下文相关的答案。我们描述了如何将最先进的LLMs移植到移动设备上,使其能够在设备上原生运行。我们采用llama.cpp框架,这是一个用于LLM推理的灵活且自包含的C++框架。我们选择了具有30亿参数的Orca-Mini-3B模型的6-bit量化版本,并展示了该模型的正确提示格式。实验结果表明,LLM推理在Galaxy S21智能手机上以交互速度运行,并且该模型针对政治、地理或历史等不同学科的问题,向用户查询提供了高质量的答案。
英文摘要:
Deploying Large Language Models (LLMs) on mobile devices makes all the capabilities of natural language processing available on the device. An important use case of LLMs is question answering, which can provide accurate and contextually relevant answers to a wide array of user queries. We describe how we managed to port state of the art LLMs to mobile devices, enabling them to operate natively on the device. We employ the llama.cpp framework, a flexible and self-contained C++ framework for LLM inference. We selected a 6-bit quantized version of the Orca-Mini-3B model with 3 billion parameters and present the correct prompt format for this model. Experimental results show that LLM inference runs in interactive speed on a Galaxy S21 smartphone and that the model delivers high-quality answers to user queries related to questions from different subjects like politics, geography or history.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。