让大模型在手机等设备上高效微调,保护用户隐私。
MobiZO: Enabling Efficient LLM Fine-Tuning at the Edge via Inference Engines
- 用多重前向传播近似梯度,避开传统反向传播
- 多扰动LoRA模块与并行计算结合,减少计算开销
- 可直接运行在手机推理引擎上,适合移动端部署
大型语言模型(LLMs)目前在云端完成预训练和微调。未来方向是模型个性化,即使用用户或任务特定数据对基础模型进行微调。由于此类数据敏感,将微调过程放在边缘设备上可提升用户信任。然而,资源受限的边缘设备面临内存和计算需求大、基础设施支持不足等挑战。我们发现,通过零阶优化(ZO)方法,可利用推理引擎(如ExecuTorch)实现微调。尽管前景可观,但直接在边缘设备上应用ZO方法效率低下,因需多次前向传播以获得准确梯度,且实际部署尚未被充分探索。为此,我们提出MobiZO,一种专为边缘设备设计的高效大模型微调框架。其核心创新包括:(1) 并行化的随机梯度估计器,结合外层与内层并行性,消除串行前向传播;(2) 专用的多扰动LoRA(MP-LoRA)模块,实现内外层并行性的高效执行;(3) 与ExecuTorch无缝集成,无需修改运行时。实验表明,MobiZO在显著提升运行速度和节省内存的同时,提高了微调精度,为实时、本地化大模型应用提供了可行路径。
原文摘要 · Abstract (English)
Large Language Models (LLMs) are currently pre-trained and fine-tuned on large cloud servers. The next frontier is LLM personalization, where a foundation model can be fine-tuned with user/task-specific data. Given the sensitive nature of such private data, it is desirable to fine-tune these models on edge devices to improve user trust. However, fine-tuning on resource-constrained edge devices presents significant challenges due to substantial memory and computational demands, as well as limited infrastructure support. We observe that inference engines (e.g., ExecuTorch) can be repurposed for fine-tuning by leveraging zeroth-order (ZO) optimization, which uses multiple forward passes to approximate gradients. While promising, direct application of ZO methods on edge devices is inefficient due to the high computational cost of multiple forward passes required for accurate gradient estimation, and their deployment has been largely unexplored in practice. We introduce MobiZO, a resource-efficient fine-tuning framework for LLMs specifically designed for edge devices. MobiZO combines three key innovations: (1) a parallelized randomized gradient estimator that employs both outer-loop and inner-loop parallelism to eliminate sequential forward passes, (2) a specialized Multi-Perturbed LoRA (MP-LoRA) module that enables efficient realization of both inner and outer loop parallelism, and (3) a seamless integration with ExecuTorch for on-device training, requiring no modifications to the runtime. Experiments demonstrate that MobiZO achieves substantial runtime speedups and memory savings while improving fine-tuning accuracy, paving the way for practical deployment of LLMs in real-time, on-device applications.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。