MobileLLM: Benchmark & Architecture Teardown
MobileLLM is a family of compact LLMs built to run on phones. This teardown covers architecture, benchmark plan, runnable code, and practical trade-offs.

Short answer: What is MobileLLM and why it matters
MobileLLM is a family of compact language models designed to run well on phones and other small devices. It uses a "deep-and-thin" design plus smart weight-sharing to give strong reasoning and coding ability while using far less memory than big models. For the research paper and code, see the authors' ICML/arXiv paper and the official GitHub repo. You can also preview model releases on Hugging Face.
Quick wins: When to pick MobileLLM
- You need an efficient LLM for mobile or want to run LLM on device with low latency.
- You want strong math, coding, or reasoning in an offline assistant.
- You must reduce cloud cost, improve privacy, or support poor networks.
If that sounds like your project, MobileLLM is worth testing.
High-level architecture: the simple parts that do the heavy lifting
Deep-and-thin
MobileLLM favors more layers with narrower layer width. Think of it as adding floors to a building rather than making each floor huge. This helps small models learn better hierarchical features.
SwiGLU activation
The models use SwiGLU, which is a modern activation that often improves small-model learning compared with older activations.
Embedding sharing
MobileLLM shares token embeddings between input and output. That cuts parameter count and helps smaller models use parameters more efficiently. The idea is documented in the paper and visible in the training code on GitHub.
Grouped-Query Attention (GQA)
GQA reduces memory and compute by grouping attention heads for key/value storage. It keeps most of the attention power while lowering resource use. The paper explains how this helps on-device tasks like API calling and chat.
Block-wise weight sharing (immediate repeat)
Instead of unique weights for every transformer block, MobileLLM repeats blocks in small groups. The best-performing method in experiments was the "immediate block-wise repeat" strategy. That gives a good trade-off: less storage but fast cache reuse on real hardware.
What the research shows (benchmarks & claims)
Key findings from the paper and follow-ups:
- MobileLLM-125M and -350M beat prior sub-billion models on zero-shot reasoning and chat benchmarks.
- Weight-sharing and architectural choices matter more at sub-billion scale than simply adding tokens or parameters.
- A MobileLLM variant (R1 950M) trained on ~2T high-quality tokens matched or beat a Qwen3 0.6B model on tasks like MATH, GSM8K, MMLU, and LiveCodeBench (see the Hugging Face release notes).
Those are documented in the paper and model release. For an accessible write-up, see UnfoldAI and a community summary at WandB article.
Benchmark plan: how I recommend you test MobileLLM
Here’s a reproducible, developer-friendly test plan. Run each step on the device or environment you care about.
- Prepare hardware notes: device model, CPU, RAM, OS, and whether you use GPU or NPU.
- Models to compare: MobileLLM-125M, MobileLLM-350M, MobileLLM-R1-950M, plus your target competitors (Phi-3, Qwen3 0.6B). Note: MobileLLM authors compared to Qwen3 in their release notes.
- Tests to run:
- Latency: time per token and end-to-end answer time for 50–200 token prompts.
- Memory: peak RAM and disk for model weights.
- Accuracy: run standard benchmarks like GSM8K and MMLU or a small held-out test you care about.
- API calling exact match: measure JSON output correctness for structured responses.
- Power: battery draw for a 10-minute inference loop (optional but useful for mobile).
Simple results table (qualitative)
Metric | MobileLLM (sub‑1B) | Phi‑3 / Qwen3 (examples) |
---|---|---|
Latency on CPU | Low to medium | Medium to high |
Memory footprint | Small (good for edge) | Larger |
Reasoning & code | Strong for size | Depends on model size |
Note: the paper reports MobileLLM surpasses previous sub‑billion SOTA and that MobileLLM-R1 950M compares favorably to Qwen3 0.6B on several benchmarks. For precise numbers, use the test plan above on your target device and dataset.
How to run MobileLLM quickly (example with Hugging Face Transformers)
Install the usual packages and load a model. This snippet shows a basic test. It uses a transformers
-style load. For on-device production you'll usually quantize the model or use a runtime like Ollama or ggml-based tools.
pip install transformers accelerate
python - <<'PY'
from transformers import AutoTokenizer, AutoModelForCausalLM, pipeline
model_name = "facebook/MobileLLM-R1-950M"
# load tokenizer
tok = AutoTokenizer.from_pretrained(model_name, use_fast=True)
# load model (CPU or set device_map for GPU)
model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype="auto")
pipe = pipeline("text-generation", model=model, tokenizer=tok)
print(pipe("2+2=", max_new_tokens=8)[0]["generated_text"])
PY
In practice, for mobile you’ll:
- Quantize weights (int8 / int4) to cut memory.
- Use block-wise sharing-friendly runtimes or export to a compact format.
- Test on the actual phone CPU or NPU and measure latency and battery.
See the MobileLLM repo for training recipes and more advanced loaders.
Practical trade-offs and caveats
- Not a general chat model: MobileLLM versions in the release are SFT models focused on math, programming, and science. They may not behave like a chat-first assistant.
- Training data and licenses: Some MobileLLM model releases have license and access controls. Check the Hugging Face page and repository license before using in products.
- Quantization matters: You’ll usually need to quantize for phones. That can change accuracy—test on your tasks.
- Benchmarks vary by task: MobileLLM shines on reasoning for its size, but larger models still win for broad conversational quality.
Decision checklist: Is MobileLLM right for your project?
- Do you need on-device inference with low memory? — Yes = test MobileLLM.
- Is high-quality coding or math important? — Yes = MobileLLM is a good fit for sub‑1B budgets.
- Do you need general chat style across many domains? — Consider larger models or SFT on top of MobileLLM.
Resources and further reading
- MobileLLM paper (arXiv) — research details and design choices.
- GitHub repo — training code and recipes.
- Hugging Face model card — model artifacts and notes.
- UnfoldAI explainer — friendly summary.
- ICML/MLR proceedings entry — official publication record.
Final take (practical)
What changed: MobileLLM shows that careful architecture and weight sharing can close much of the gap between tiny models and much larger ones for on-device tasks. If you need a small LLM for edge devices that does math and code well, try MobileLLM with quantization and measure latency, memory, and accuracy on your task. Ship a short pilot: test one model, one prompt set, and one device. You’ll learn fast and keep scope small.