(Meta research) MobileLLM: Optimizing Sub-billion Parameter Language Models for On-Device Use Cases

Paper: https://arxiv.org/abs/2402.14905

Abstract:

This paper addresses the growing need for efficient large language models (LLMs) on mobile devices, driven by increasing cloud costs and latency concerns. We focus on designing top-quality LLMs with fewer than a billion parameters, a practical choice for mobile deployment. Contrary to prevailing belief emphasizing the pivotal role of data and parameter quantity in determining model quality, our investigation underscores the significance of model architecture for sub-billion scale LLMs. Leveraging deep and thin architectures, coupled with embedding sharing and grouped-query attention mechanisms, we establish a strong baseline network denoted as MobileLLM, which attains a remarkable 2.7%/4.3% accuracy boost over preceding 125M/350M state-of-the-art models. Additionally, we propose an immediate block-wise weight sharing approach with no increase in model size and only marginal latency overhead. The resultant models, denoted as MobileLLM-LS, demonstrate a further accuracy enhancement of 0.7%/0.8% than MobileLLM 125M/350M. Moreover, MobileLLM model family shows significant improvements compared to previous sub-billion models on chat benchmarks, and demonstrates close correctness to LLaMA-v2 7B in API calling tasks, highlighting the capability of small models for common on-device use cases.

Zero-shot performance of pre-trained models on Common Sense Reasoning tasks:

Model BoolQ PIQA SIQA HellaSwag WinoGrande ARC-e ARC-c OBQA Average
MobileLLM-350M 62.4 68.6 44.7 49.6 57.6 53.8 33.5 40.0 51.3
MobileLLM-LS-350M 62.8 69.8 44.1 50.6 57.2 54.4 32.5 45.8 52.1
Llama 2 7B 77.4 78.8 48.3 77.2 69.2 75.2 45.9 58.6 66.3

Example output of a finetuned MobileLLM-350M for chat compared to Llama-2-7b-Chat:

https://preview.redd.it/r6doht8631lc1.png?width=2251&format=png&auto=webp&s=a74a1d6e79f3d4fb9a0f434ffd4620a6587a7dbe