Mobile Foundation Model as Firmware

Jinliang Yuan, Chen Yang, Dongqi Cai, Shihe Wang, Xin Yuan, Zeling Zhang, Xiang Li, Dingge Zhang, Hanzi Mei, Xianqing Jia, Shangguang Wang, Mengwei Xu

TL;DR

This paper proposes M4, a novel paradigm that treats a multimodal foundation model as "firmware" integrated into a mobile device's hardware and OS. Instead of every app shipping its own fragmented, task-specific model, they all share a single, unified backbone managed by the system, using lightweight "adapters" to handle everything from image classification to voice assistants.

What Problem Does This Paper Address?

Mobile AI is currently a "fragmented ecosystem." Every app brings its own Deep Neural Network (DNN) with unique architectures and operators. This creates three major headaches:

  1. Hardware Inefficiency: Mobile NPUs (Neural Processing Units) struggle to support the thousands of different operators used in the wild. The authors found that only 8% of popular models can run entirely on a modern NPU; the rest fall back to the slower CPU/GPU.
  2. System Bloat: If you have 50 apps each using a 500MB model, you've wasted 25GB of storage and massive amounts of RAM.
  3. Optimization Nightmare: It is nearly impossible for OS developers to co-optimize hardware and software when the "workload" is a moving target of thousands of different model types.

Methods

The authors introduce M4 (Mobile Multimodal Model), which follows an "N-1-M" architecture:

  • N Encoders: Specialized modules to process different inputs (Vision, Text, Audio, IMU/Sensing).
  • 1 LLM Backbone: A "narrow waist" (specifically LLaMA-7B) that performs the heavy lifting of reasoning and understanding.
  • M Decoders: Task-specific generators (Text-to-Speech, Image Generation, or simple Classification layers).

Key Innovations: * Foundation Model as Firmware: The core model is unmodifiable and exposed as a system service (like a unified ML API). * Lightweight Adapters: Apps only provide small "adapters" (using Parameter-Efficient Fine-Tuning like LoRA). These are tiny (1MB–10MB) compared to full models. * Multi-path Task Execution: To save energy, M4 doesn't always run the full pipeline. Simple tasks (like image classification) might skip the LLM backbone entirely, while complex tasks (like visual QA) use the whole stack.

Datasets

To prove this works, the authors built eAIBench, the first comprehensive edge-oriented AI benchmark:

  • Scope: 38 mobile AI tasks across 50 classic datasets.
  • Modalities: Covers Vision (OCR, object detection), NLP (translation, sentiment), Audio (ASR, keyword spotting), Sensing (human activity recognition), and Multimodal (Visual QA, image captioning).
  • Baselines: They compared M4 against "TS-models" (Task-Specific models) like ResNet-152, RoBERTa, and MobileNet.

Key Insights and Ideas

  • The Operator Simplicity Win: While task-specific models collectively required 156 different mathematical operators, M4 only requires 39. This significantly simplifies NPU design, allowing hardware to be "lean and mean" rather than a jack-of-all-trades.
  • Scalability Flip-Point: M4 has a higher "entry cost" (it's a large model), but as the number of tasks on a device grows, it becomes much more efficient. At 15+ tasks, M4 (quantized to INT4) uses less total storage than a collection of individual small models.
  • Quantization Resilience: Large foundation models are surprisingly robust. Moving from 16-bit to 4-bit quantization resulted in less than a 2% accuracy drop for most tasks, making them viable for mobile memory constraints.
  • Zero-Shot Potential: Unlike traditional models that need training for every new task, M4 can perform many tasks (like image classification) with zero or very few examples just by changing the text prompt.

Key Results

  • Accuracy: M4 achieved comparable or superior accuracy in 85% of the 50 tested datasets. In some tasks, like image captioning, it outperformed specialized models by 19%.
  • Memory Efficiency: For a device running 50 tasks, M4 reduced peak memory consumption by 5.1x compared to hosting 50 individual models.
  • The NPU "What-If": On current mobile CPUs, M4 is slow (e.g., 2.1s for image classification). However, the authors' "what-if" analysis shows that if NPUs were optimized for M4's 39 operators, it would achieve 0.48s latency, making it competitive with current on-device AI.

Limitations and Future Work

  • Current Hardware Gap: Most current mobile NPUs don't yet support the specific operators needed for LLMs (like LLaMA), meaning M4 currently runs mostly on the CPU/GPU in real-world tests.
  • The "Heavy" Backbone: Even with quantization, a 7B-parameter model is a "heavy" resident for mid-range phones. The authors suggest future work should focus on even more compact "mobile-first" foundation models.
  • Low-Resource Tasks: M4 still struggles with specific low-resource translation tasks where the pre-training data was insufficient.
  • Adapter Compatibility: If the "firmware" model is updated by the OS, old app adapters might break, requiring a unified interface to ensure long-term compatibility.

Summary updated

BibTeX
@inproceedings{yuan2024mobile,
  author = {Jinliang Yuan and Chen Yang and Dongqi Cai and Shihe Wang and Xin Yuan and Zeling Zhang and Xiang Li and Dingge Zhang and Hanzi Mei and Xianqing Jia and Shangguang Wang and Mengwei Xu},
  title = {{Mobile Foundation Model as Firmware}},
  booktitle = {MobiCom},
  year = {2024},
  doi = {10.1145/3636534.3649361},
}
Figure