让手机上的大模型轻松改知识,不耗电不卡顿
MobiEdit: Resource-efficient Knowledge Editing for Personalized On-device LLMs
- 用前向梯度估算替代耗能的反向传播,适配手机芯片
- 在普通手机上实现30亿参数模型实时编辑,提速3.6倍
- 适合想在手机上个性化大模型的开发者和用户
大语言模型部署在手机上可驱动智能助手等应用,但通用预训练模型在处理个性化或新问题时易产生幻觉。知识编辑通过调整少量关键权重修复此问题,而无需影响通用能力。然而,现有方法依赖资源密集型反向传播,难以在本地设备运行。本文提出MobiEdit,首个可在商用手机上实现高效知识编辑的框架。它将全精度反向传播替换为量化前向梯度估计,兼容手机神经网络处理器(NPUs)。为进一步提升效率,引入早停机制与前缀缓存,复用计算步骤。该方法使30亿参数模型(Qwen2.5-3B-Instruct)在普通手机上实现实时编辑,内存减少7.6倍,能耗降低14.7倍,延迟下降3.6倍。
原文摘要 · Abstract (English)
Large language models (LLMs) are deployed on mobile devices to power killer applications such as intelligent assistants. LLMs pre-trained on general corpora often hallucinate when handling personalized or unseen queries, leading to incorrect or outdated responses. Knowledge editing addresses this by identifying and adjusting a small crucial portion of model weights, without compromising the general knowledge. However, prior knowledge editing methods are impractical to run on local devices due to the resource-heavy backpropagation (BP) needed for updates. We present MobiEdit, the first mobile knowledge editing framework that enables efficient LLM personalization on commercial off-the-shelf (COTS) mobile devices. MobiEdit replaces full-precision BP with quantized forward-only gradient estimation, thus compatible with the energy-efficient mobile neural processing units (NPUs). MobiEdit replaces full-precision backpropagation with quantized forward-only gradient estimation, making it compatible with energy-efficient mobile NPUs. To further improve gradient estimation efficiency, we introduce two optimizations: an early stoping mechanism that adaptively terminates editing upon success and a prefix cache that reuses computation across steps. Our approach enables real-time editing of a 3B-parameter model (Qwen2.5-3B-Instruct) on COTS mobile devices with 7.6$\times$ less memory, 14.7 $\times$ less energy and 3.6$\times$ less latency compared to previous knowledge editing methods.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。