SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2402.14905 · ICML · 2024

MobileLLM: Optimizing Sub-billion Parameter Language Models for On-Device Use Cases

Ernie Chang, Vikas Chandra, Zechun Liu, Yuandong Tian, Yunyang Xiong, Raghuraman Krishnamoorthi, Changsheng Zhao, Forrest Iandola, Chen Lai, Igor Fedorov, Yangyang Shi, Liangzhen Lai

arXiv · PDF · Open in the Atlas

Code that ran

11 of 28 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (6 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 9 have no contract verdict; 1 failure of our instrument; 17 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2402.14905.json · badge: /api/ran/2402.14905.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
facebookresearch/mobilellm canonical (classifier label)
classifier basis: classifier_2025
6 ran · 4 no recorded run
jingyaogong/minimind community
Papers with Code archive
3 ran · 5 no recorded run
facebookresearch/LLM-QAT community
Papers with Code archive
2 ran · 6 no recorded run
facebookresearch/MobileLLM-R1 extension (classifier label)
classifier basis: classifier_2025
0 ran · 2 no recorded run
FunctionStatusWhere it lives
LlamaConfig Ran
ran on a synthesized input · constructed an object; no result was computed
facebookresearch/LLM-QAT/models/modeling_llama_quant.py
pointer only (licence: NOASSERTION) · get_code("eae5ddb4e89f48a1")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, facebookresearch/LLM-QAT (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

LlamaDynamicNTKScalingRotaryEmbedding Ran
ran on a synthesized input
facebookresearch/mobilellm/utils/modeling_llama.py
pointer only (licence: NOASSERTION) · get_code("a70d6d3c2afe50fe")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, facebookresearch/mobilellm (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

LlamaLinearScalingRotaryEmbedding Ran
ran on a synthesized input
facebookresearch/mobilellm/utils/modeling_llama.py
pointer only (licence: NOASSERTION) · get_code("0b85db0b5fb36aa3")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, facebookresearch/mobilellm (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

LlamaMLP Ran
ran on a synthesized input · constructed an object; no result was computed
facebookresearch/mobilellm/utils/modeling_llama.py
pointer only (licence: NOASSERTION) · get_code("fd1eec3e84da40f6")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, facebookresearch/mobilellm (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

LlamaPreTrainedModel Ran
ran on a synthesized input · constructed an object; no result was computed
facebookresearch/mobilellm/utils/modeling_llama.py
pointer only (licence: NOASSERTION) · get_code("c9b44d1ee2b9d567")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, facebookresearch/mobilellm (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

LlamaRMSNorm Ran
ran on a synthesized input · constructed an object; no result was computed
facebookresearch/LLM-QAT/models/modeling_llama_quant.py
pointer only (licence: NOASSERTION) · get_code("b601acb1c084205e")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, facebookresearch/LLM-QAT (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

LlamaRotaryEmbedding Ran
ran on a synthesized input · constructed an object; no result was computed
facebookresearch/mobilellm/utils/modeling_llama.py
pointer only (licence: NOASSERTION) · get_code("29fb31107100b259")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, facebookresearch/mobilellm (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

LlamaSdpaAttention Ran
ran on a synthesized input
facebookresearch/mobilellm/utils/modeling_llama.py
pointer only (licence: NOASSERTION) · get_code("56c331e4f0ffb350")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, facebookresearch/mobilellm (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

RMSNorm Ran
ran on a synthesized input · constructed an object; no result was computed
jingyaogong/minimind/model/model_minimind.py
code served (permissive licence) · get_code("a8a84e7ddb0551b0")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, RMSNorm: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

ARGS = {
    "dim": 4,
    "eps": 1e-05,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type RMSNorm — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a RMSNorm output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
precompute_freqs_cis Ran
ran, honoured the contract we drafted
jingyaogong/minimind/model/model_minimind.py
code served (permissive licence) · get_code("9c1c3b7f0fe82a6d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 3, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import math
import torch
import torch.nn.functional as F

torch.manual_seed(0)

ARGS = {
    "dim": 128,
    "end": 2048,
    "rope_base": 10000.0,
    "rope_scaling": {
        "original_max_position_embeddings": 2048,
        "factor": 16,
        "beta_fast": 32.0,
        "beta_slow": 1.0,
        "attention_factor": 1.0
    }
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 3, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
repeat_kv Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
jingyaogong/minimind/model/model_minimind.py
code served (permissive licence) · get_code("226c2c7378c2826e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 4, dtype family float, shape (2, 3, 8, 5) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Create a tensor with shape (bs, slen, num_key_value_heads, head_dim)
# Using distinct sizes: batch_size=2, seq_len=3, num_key_value_heads=4, head_dim=5
x = torch.randn(2, 3, 4, 5)

# n_rep is the repetition factor
n_rep = 2

ARGS = {
    "x": x,
    "n_rep": n_rep,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 4, dtype family float, shape (2, 3, 8, 5) — shape (2, 3, 8, 5) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
Attention Not yet run
unverified (harvested, no recorded run)
jingyaogong/minimind/model/model_minimind.py
code served (permissive licence) · get_code("21b27f7007d54dbc")
How it ran

no invocation recorded.

LlamaAttention Not yet run
unverified (harvested, no recorded run)
facebookresearch/mobilellm/utils/modeling_llama.py
pointer only (licence: NOASSERTION) · get_code("f7eec176aae368de")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, facebookresearch/mobilellm (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

LlamaAttention Not yet run
unverified (harvested, no recorded run)
facebookresearch/LLM-QAT/models/modeling_llama_quant.py
pointer only (licence: NOASSERTION) · get_code("ae14385b5684f28e")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, facebookresearch/LLM-QAT (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

LlamaDecoderLayer Not yet run
unverified (harvested, no recorded run)
facebookresearch/mobilellm/utils/modeling_llama.py
pointer only (licence: NOASSERTION) · get_code("287760d8764c9f55")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, facebookresearch/mobilellm (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

LlamaDecoderLayer Not yet run
unverified (harvested, no recorded run)
facebookresearch/LLM-QAT/models/modeling_llama_quant.py
pointer only (licence: NOASSERTION) · get_code("4d865933cc1c7185")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, facebookresearch/LLM-QAT (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

LlamaFlashAttention2 Not yet run
unverified (harvested, no recorded run)
facebookresearch/mobilellm/utils/modeling_llama.py
pointer only (licence: NOASSERTION) · get_code("9311b50f80e60c54")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, facebookresearch/mobilellm (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

LlamaForCausalLM Not yet run
unverified (harvested, no recorded run)
facebookresearch/LLM-QAT/models/modeling_llama_quant.py
pointer only (licence: NOASSERTION) · get_code("941348872c1175c4")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, facebookresearch/LLM-QAT (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

LlamaMLP Not yet run
unverified (harvested, no recorded run)
facebookresearch/LLM-QAT/models/modeling_llama_quant.py
pointer only (licence: NOASSERTION) · get_code("96f0ec4ad32ef95e")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, facebookresearch/LLM-QAT (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

LlamaModel Not yet run
unverified (harvested, no recorded run)
facebookresearch/mobilellm/utils/modeling_llama.py
pointer only (licence: NOASSERTION) · get_code("6586f04f76b3fad7")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, facebookresearch/mobilellm (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

LlamaModel Not yet run
unverified (harvested, no recorded run)
facebookresearch/LLM-QAT/models/modeling_llama_quant.py
pointer only (licence: NOASSERTION) · get_code("c9a1b892ddcc160b")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, facebookresearch/LLM-QAT (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

MiniMindBlock Not yet run
unverified (harvested, no recorded run)
jingyaogong/minimind/model/model_minimind.py
code served (permissive licence) · get_code("a34a56cc2de22f8f")
How it ran

no invocation recorded.

MiniMindForCausalLM Not yet run
unverified (harvested, no recorded run)
jingyaogong/minimind/model/model_minimind.py
code served (permissive licence) · get_code("59ce4efe16d7b6e4")
How it ran

no invocation recorded.

MiniMindModel Not yet run
unverified (harvested, no recorded run)
jingyaogong/minimind/model/model_minimind.py
code served (permissive licence) · get_code("6c359011117cb016")
How it ran

no invocation recorded.

QuantizeLinear Not yet run
unverified (harvested, no recorded run)
facebookresearch/LLM-QAT/models/modeling_llama_quant.py
pointer only (licence: NOASSERTION) · get_code("3013c6ea70f1983f")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, facebookresearch/LLM-QAT (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

apply_rotary_pos_emb Not yet run
unverified (harvested, no recorded run)
jingyaogong/minimind/model/model_minimind.py
code served (permissive licence) · get_code("415c32c683875908")
How it ran

no invocation recorded.

get_folder_paths Not yet run
unverified (harvested, no recorded run)
facebookresearch/MobileLLM-R1/pretrain/pretrain.py
pointer only (licence: NOASSERTION) · get_code("9a433eced0086de3")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, facebookresearch/MobileLLM-R1 (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

get_logger Not yet run
unverified (harvested, no recorded run)
facebookresearch/MobileLLM-R1/pretrain/pretrain.py
pointer only (licence: NOASSERTION) · get_code("e3820b27e772b468")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, facebookresearch/MobileLLM-R1 (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

Also present in other papers' code

Of 28 samples lifted from this paper's linked repositories, 28 carry a function identity and 0 do not. Of the 28 distinct functions with an identity, 11 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 11 later) and 17 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
LlamaModel
brick of this paper's assembly: model
2 other papers
1 dated earlier, 1 later
2307.09288 (2023-07)
Llama 2: Open Foundation and Fine-Tuned Chat Models
2503.13108 (2025-03)
Lifting the Veil on Visual Information Flow in MLLMs: Unlocking Pathways to Faster Inference
LlamaPreTrainedModel
brick of this paper's assembly: helper
2 other papers
2 later
2410.03115 (2024-10)
X-ALMA: Plug & Play Modules and Adaptive Rejection for Quality Translation at Scale
2502.13533 (2025-02)
Train Small, Infer Large: Memory-Efficient LoRA Training for Large Language Models
repeat_kv
brick of this paper's assembly: helper
2 other papers
2 later · 1 only as an assembly brick
2601.18537 (2026-01)
SKETCH: Semantic Key-Point Conditioning for Long-Horizon Vessel Trajectory Prediction
2605.27980 (2026-05)
Periodic RoPE for Infinite Context LLMs
Attention
brick of this paper's assembly: model
1 other paper
1 later · 1 only as an assembly brick
2601.18537 (2026-01)
SKETCH: Semantic Key-Point Conditioning for Long-Horizon Vessel Trajectory Prediction
LlamaRMSNorm
brick of this paper's assembly: model
1 other paper
1 later
2502.12623 (2025-02)
DeepResonance: Enhancing Multimodal Music Understanding via Music-centric Multi-way Instruction Tuning
MiniMindBlock
brick of this paper's assembly: model
1 other paper
1 later · 1 only as an assembly brick
2601.18537 (2026-01)
SKETCH: Semantic Key-Point Conditioning for Long-Horizon Vessel Trajectory Prediction
MiniMindModel
brick of this paper's assembly: model
1 other paper
1 later · 1 only as an assembly brick
2601.18537 (2026-01)
SKETCH: Semantic Key-Point Conditioning for Long-Horizon Vessel Trajectory Prediction
QuantizeLinear
brick of this paper's assembly: helper
1 other paper
1 later
2502.02631 (2025-02)
ParetoQ: Improving Scaling Laws in Extremely Low-bit LLM Quantization
RMSNorm
brick of this paper's assembly: model
1 other paper
1 later · 1 only as an assembly brick
2601.18537 (2026-01)
SKETCH: Semantic Key-Point Conditioning for Long-Horizon Vessel Trajectory Prediction
apply_rotary_pos_emb
brick of this paper's assembly: helper
1 other paper
1 later · 1 only as an assembly brick
2601.18537 (2026-01)
SKETCH: Semantic Key-Point Conditioning for Long-Horizon Vessel Trajectory Prediction
precompute_freqs_cis
brick of this paper's assembly: helper
1 other paper
1 later · 1 only as an assembly brick
2601.18537 (2026-01)
SKETCH: Semantic Key-Point Conditioning for Long-Horizon Vessel Trajectory Prediction

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

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 weightsharing 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 subbillion 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.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2402.14905")
get_code_for_paper("2402.14905")
have("2402.14905")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2402.14905.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2402.14905.svg)](https://syntology.ai/paper/2402.14905)

Connect an agent — have() is free.