TL;DR
This paper introduces MobiZO, a novel framework for efficiently fine-tuning large language models (LLMs) directly on edge devices like smartphones. By cleverly combining parallel processing techniques with a specialized LoRA adaptation, MobiZO significantly speeds up training and reduces memory usage, making on-device LLM personalization a practical reality.
What Problem Does This Paper Address?
Large Language Models (LLMs) are incredibly powerful, but fine-tuning them for specific tasks or user data is computationally intensive. Traditionally, this requires powerful cloud servers, which poses privacy concerns when dealing with sensitive personal data. While edge devices (like smartphones) are ideal for privacy-preserving, on-device fine-tuning, their limited memory and computational resources make it infeasible with current methods. Existing inference engines, designed for efficiency, don't support the complex gradient calculations needed for fine-tuning. This paper tackles the challenge of enabling efficient LLM fine-tuning on these resource-constrained edge devices.
Methods
MobiZO's core innovation lies in its efficient approach to Zeroth-Order (ZO) optimization, a gradient-free method that avoids the need to store intermediate activations during backpropagation, thus saving memory. The key techniques are:
- Multi-Perturbed LoRA (MP-LoRA): This is a specialized adaptation of the Low-Rank Adaptation (LoRA) technique. Instead of just adapting a few parameters, MP-LoRA allows for multiple perturbed versions of these parameters to be processed concurrently. This is crucial for parallelizing the multiple forward passes required by ZO optimization.
- Outer-Loop Parallelization: MobiZO executes multiple ZO queries (forward passes with different perturbations) in parallel. This significantly reduces the overall training time by amortizing the cost of loading model parameters.
- Inner-Loop Parallelization: Further accelerating the process, MobiZO can perform the two forward passes required for a single gradient estimation (one with a positive perturbation, one with a negative) in parallel. This is achieved by cleverly using the MP-LoRA module.
- Inference Engine Integration: MobiZO is designed to seamlessly integrate with inference engines like ExecuTorch, a framework for deploying PyTorch models on edge devices. This is achieved by encapsulating the MobiZO logic within the forward function of MP-LoRA modules, requiring no modifications to the inference engine's runtime.
Datasets
The paper evaluates MobiZO on several standard datasets for fine-tuning and evaluating LLMs:
- TinyLlama-1.1B: Evaluated on the GLUE dataset (sentiment analysis, paraphrase, natural language inference).
- Llama2-7B: Evaluated on GLUE, SuperGLUE (text classification, multiple-choice), WinoGrande, ARC-Easy, and ARC-Challenge datasets.
- OPT-1.3B: Used for additional experiments to demonstrate MobiZO's applicability beyond LLaMA models.
- Llama3.2-1B, Qwen3-0.6B, SmolLM-340M: Used to evaluate MobiZO on newer, smaller edge-specific models.
Key Insights and Ideas
- ZO Optimization is Key for Edge: The paper strongly advocates for Zeroth-Order optimization as a viable path for on-device LLM fine-tuning due to its inherent memory savings by avoiding backpropagation.
- Parallelism is Not Just for Speed, but for Efficiency: MobiZO's dual outer-loop and inner-loop parallelization isn't just about making things faster; it's about making the ZO process efficient enough to be practical on limited hardware by amortizing computational costs.
- LoRA is a Versatile Foundation: The MP-LoRA design shows that parameter-efficient fine-tuning (PEFT) methods like LoRA can be effectively adapted to support advanced optimization techniques like ZO, opening new avenues for on-device training.
- Inference Engines are Ready for Training: By designing MobiZO to work within existing inference engine frameworks like ExecuTorch, the paper demonstrates that on-device fine-tuning can be achieved without deep modifications to the underlying deployment infrastructure.
Key Results
- Significant Speedups: MobiZO achieves up to 4.3x end-to-end training speedup compared to the MeZO baseline (full parameter space) and up to 1.9x speedup over MeZO with LoRA-FA.
- Memory Savings: MobiZO uses significantly less memory than traditional first-order methods. For Llama2-7B, it uses around 14.53 GB compared to over 40 GB for first-order methods.
- Accuracy Improvements: MobiZO consistently outperforms baselines like MeZO, achieving up to 8.1% improvement in accuracy on tasks like WiC.
- Quantization Compatibility: MobiZO works well with weight-only quantization (8-bit and 4-bit), showing comparable accuracy to full FP16 training.
- On-Device Performance: Experiments on Jetson GPUs and Android NPUs demonstrate practical runtime improvements and feasibility for on-device fine-tuning.
Limitations and Future Work
- ZO Method Extension: MobiZO is currently tailored for randomized gradient estimators. Extending it to other ZO methods (e.g., variance-reduced or adaptive query selection) could further enhance convergence.
- Thermal Constraints: Edge devices have thermal limitations that can lead to throttling during prolonged fine-tuning. Future work could explore thermal-aware scheduling.
- Dynamic Resource Adaptation: Edge environments often have dynamic resource constraints. Adapting query count, batch size, or precision in response to runtime conditions is a promising direction.
- Broader PEFT Support: While MP-LoRA is based on LoRA-FA, its core principles could be adapted to other PEFT techniques.
Summary updated