Introduction
Agentic models are moving language models from reasoning and responding to acting: interacting with applications on behalf of users. Bringing this to devices means building reliable agentic skills within tight memory and compute budgets, yet the end-to-end training of small agentic models is poorly understood. Existing work either keeps large-model recipes proprietary or optimizes post-training in isolation.
Our central finding is that agentic performance after post-training depends strongly on what pre-training establishes. Post-training sharpens what the base model can already express, but does not reliably recover what it cannot. So we design pre-training and post-training as one end-to-end recipe.
Data mixtures are optimized recursively by measured performance, with synthetic bridge data to ease competition between capabilities. Sampling lift is an early indicator of post-training potential, and a readiness predictor anticipates diminishing returns from pre-training. In post-training, a joint SFT stage learns long-horizon reasoning and multi-turn agentic trajectories together, and aligning the SFT data with the teacher, in chat format and in trajectories, is critical for on-policy distillation.
Pre-training
1) Mixtures chosen by measured performance, not hand-set ratios
We build the pre-training mixture from a pool of over 15T raw tokens from 194 sources. Each round trains candidate mixtures at small scale and uses their scores to refine the next, until scores plateau; the final run is then monitored for diminishing returns.
- Top row: data for each domain is split into fitting, validation and audit sets. The fitting set defines target clusters, and the diagnostics show which clusters the training data underserves.
- Middle row: each source is read once into a shared store. The data then passes through a fixed sequence of steps (dedup, gradient alignment, generation, regrouping), guided by those diagnostics, and is grouped and weighted for training.
- Bottom row: the existing trainer trains on this data, and each checkpoint is scored on the validation set to give results for every cluster. The audit set stays locked until the end, when it gives the final check before the data recipe is exported.
2) Bridge data eases competition between domains
Adding data for one capability can affect performance on others, and the trade-offs are sharpest in small models. Synthetic bridge documents combine competing domains in a natural intermediate form, such as natural-language explanations of code. They make up 15.8% of the pre-training mixture and, in our ablation, improve all 19 evaluated benchmarks, with an average gain of 1.27 percentage points (3.48% relative).
3) Sampling lift signals post-training potential
Sampling lift, Δ16 = pass@16 − pass@1, measures solvable capability that sits outside the model's most likely output, which is what post-training can draw on. Later in pre-training, pass@1 keeps improving while pass@16 saturates, and post-training gains diminish as the lift shrinks.
4) Zero-shot scores predict performance after post-training
A ridge-regression readiness predictor maps a checkpoint's 20 zero-shot scores and its sampling lift to its BFCL score after a fixed post-training recipe. Fit on checkpoints before 500k steps, it tracks the later held-out checkpoints without post-training them.
Code provides the strongest signal (37.7%), and sampling lift carries information that zero-shot accuracy does not. Mid-training follows: two 50,000-step phases distill from Muse-Glimmer-30B on 105B tokens each, and Phase 2 raises the share of mathematics and code from 15.1% and 27.6% to 49.0% and 39.2%.
Post-training
Post-training has three stages: general SFT, agentic reasoning SFT, and on-policy knowledge distillation (OPD), in which the student trains on its own rollouts with the teacher's next-token distribution as the target.
1) One model learns long reasoning and agentic tool use together
Single-turn reasoning and multi-turn tool use demand different reasoning patterns. Median outputs run from 1,724 to 16,718 tokens on math and coding problems but 210 tokens per turn on SWE-Bench, where reasoning interleaves with tool calls. Trained on both, one model keeps MATH500, AIME'25 and LiveCodeBench close to reasoning-only training and reaches 27.0% on SWE-Bench, against 25.4% for agentic-only training.
| Training data | MATH500 | AIME'25 | LCB | SWE-Bench |
|---|---|---|---|---|
| Long-horizon reasoning data only | 90.8% | 38.3% | 31.4% | 0.0% |
| Agentic multi-turn data only | 30.0% | 2.6% | 12.0% | 25.4% |
| Joint reasoning + agentic training | 91.2% | 37.1% | 29.3% | 27.0% |
SFT data mixtures: reasoning data, agentic data, or both.
2) Distillation needs the teacher's chat template
Because OPD supervises the student's own trajectories, it depends on how compatible they are with the teacher, starting with the chat protocol. Tool-use formats differ across model families, and small mismatches can degrade tool use or invalidate whole episodes, so we convert source trajectories into the native Muse-Glimmer protocol.
LLaMA 3.1
<|start_header_id|>assistant<|end_header_id|>
<|python_tag|>{
"type": "function",
"name": "get_weather",
"parameters": {"city": "Tokyo"}
}<|eom_id|>
<|start_header_id|>ipython<|end_header_id|>
...<|eot_id|>
<|start_header_id|>assistant<|end_header_id|>
...<|eot_id|>
Qwen3.5
<|im_start|>assistant <tool_call> <function=get_weather> <parameter=city> Tokyo </parameter> </function> </tool_call><|im_end|> <|im_start|>user <tool_response> ... </tool_response><|im_end|> <|im_start|>assistant ...<|im_end|>
Muse-Glimmer
<|start|>assistant to=self<|message|> ...<|eom|> <|start|>assistant to=get_weather<|message|> <atem:function_calls> <atem:invoke name="get_weather"> <atem:parameter name="city">Tokyo</atem:parameter> </atem:invoke> </atem:function_calls><|eot|> <|start|>tool<|message|> <tool_output>...</tool_output><|eot|> <|start|>assistant to=user<|message|> ...<|eot|>
3) Teacher-written solutions make one distillation round enough
SFT data can also teach behaviors unlike the teacher's. Mismatches with limited impact on SFT accuracy matter far more after OPD: the template switch lifts mean AIME'24/'25 accuracy after OPD from 17.1 to 36.8, and adding 25% teacher-written solutions lifts it to 54.9. With them, one OPD round is enough; without them, OPD first lowers accuracy and needs several rounds to recover.
| SFT Stage 2 data format | After SFT | After OPD |
|---|---|---|
| Original chat template | 43.4 | 17.1 |
| Muse-Glimmer template | 49.0 | 36.8 |
| + 25% teacher-written solutions | 43.9 | 54.9 |
Mean AIME'24/'25 accuracy after SFT and after OPD, for three SFT data formats.
Results
We compare MobileLLM-R2 with six open models from 0.95B to 7.3B parameters on 14 benchmarks, all reproduced from publicly released checkpoints under one evaluation framework and protocol. Among models with fewer than 3.5B total parameters, it is best or within 1.0 point of the best on 12 of 14, and it beats OLMo-3-7B-Instruct on AIME'24, AIME'25, HumanEval, LiveCodeBench and SWE-Bench Verified with a third of the parameters.
Results tables
| Category | Benchmark | MobileLLM- R1.5-950M0.95B |
Qwen3.5- 2B2.27B |
SmolLM3- 3B3.08B |
Nemotron-3- Nano-4B3.97B |
Gemma-4- E2B2.00B / 5.12B |
Olmo-3- 7B7.30B |
MobileLLM- R2-2.5B2.50B |
|---|---|---|---|---|---|---|---|---|
| Math | AIME24 (avg@16) | 39.8 | 13.3 | 46.7 | 58.5 | 48.1 | 54.8 | 59.4 |
| AIME25 (avg@16) | 31.0 | 16.5 | 37.7 | 56.5 | 36.0 | 42.3 | 49.0 | |
| MATH500 | 86.6 | 67.8 | 91.8 | 91.4 | 77.4 | 92.0 | 91.0 | |
| GSM8K | 83.7 | 76.2 | 88.0 | 87.2 | 90.1 | 93.3 | 91.9 | |
| Knowledge | MMLU | 37.4 | 65.9 | 63.2 | 65.8 | 58.1 | 63.4 | 56.5 |
| GPQA | 29.3 | 51.5 | 41.4 | 61.1 | 44.4 | 41.9 | 45.2 | |
| Coding | HumanEval | 11.6 | 36.0 | 54.3 | 72.0 | 67.1 | 47.6 | 69.5 |
| MBPP | 5.6 | 23.2 | 50.0 | 45.8 | 47.4 | 39.2 | 49.6 | |
| LiveCodeBench | 29.1 | 12.6 | 28.8 | 45.3 | 44.8 | 21.8 | 47.3 | |
| Agentic | BFCL V4 | 10.2 | 48.9 | 25.7 | 53.8 | 41.9 | 31.8 | 50.6 |
| SWE-Bench Verified | 0.0 | 15.6 | 0.0 | 7.3 | 1.1 | 0.6 | 30.9 | |
| OOD | Terminal-Bench | 0.0 | 4.1 | 0.4 | 2.6 | 1.9 | 1.1 | 5.2 |
| Aider Polyglot | 2.7 | 3.7 | 2.5 | 5.0 | 3.7 | 2.1 | 6.5 | |
| BFCL-Parity | 0.0 | 30.1 | 70.2 | 68.0 | 84.0 | 69.4 | 77.5 |
Accuracy (%), parameter counts under the names. Bold: within 1.0 point of the best model under 3.5B total parameters; underline: best overall. Per-benchmark protocols are in the paper.
Model Details
MobileLLM-R2-2.5B builds on the architectural designs of MobileLLM and Muse-Glimmer-30B. It has 32 layers, 32 attention heads with 8 key-value heads, a model dimension of 2048, a hidden dimension of 8192, and 2.49B parameters in total. It uses the 202,048-token Muse-Glimmer tokenizer, SwiGLU, RoPE (θ = 10⁷), and shared input and output embeddings. Training hyperparameters and detailed data compositions for all stages are provided in the paper.
Released models: MobileLLM-R2-2.5B-base, the base model after mid-training (16k context); MobileLLM-R2-2.5B, the final model (32k context); and MobileLLM-R2-2.5B-GGUF for llama.cpp.
Quantized Models (GGUF)
MobileLLM-R2-2.5B-GGUF provides BF16 and five quantizations from 1.5 to 5.0 GB. These files, in dense/, run on llama.cpp built with the small patch in that folder; on an Apple M4 Max laptop, Q4_K_M with an 8-bit KV cache decodes 137 tokens/s at a 4K context.
| Quantization | Size (GB) | Perplexity | vs BF16 |
|---|---|---|---|
| BF16 | 5.00 | 15.61 | reference |
| Q8_0 | 2.67 | 15.64 | +0.2% |
| Q6_K | 2.09 | 15.64 | +0.2% |
| Q5_K_M | 1.87 | 15.76 | +1.0% |
| Q4_K_M | 1.67 | 16.17 | +3.6% |
| IQ4_XS | 1.54 | 16.37 | +4.9% |
Size and WikiText-2 perplexity of each GGUF quantization. Perplexity is measured with llama-perplexity on the full WikiText-2 test set at a 512-token context.
Demo: a local coding agent
MobileLLM-R2 runs as a coding agent on a laptop with llama.cpp. We ran two agent harnesses, Terminus-2 and Claude Code, on tasks from a 100-task sample of SWE-bench Verified, with the Q8_0 GGUF file and each task in a container without network access. These replays show runs whose fix passed the task's SWE-bench tests.
The GGUF repository has the full replay page for eight solved runs and the setup for both harnesses.
Quick Start
The model code ships with the checkpoint, so pass trust_remote_code=True to both the tokenizer and the model (transformers 4.57 or 5.x). Reasoning strength defaults to high; agentic and tool-calling use matches the agentic training data with low reasoning strength.
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "facebook/MobileLLM-R2-2.5B"
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
model_id, dtype=torch.bfloat16, trust_remote_code=True
).to("cuda")
# Math problem / default scenario (reasoning strength "high" by default)
messages = [{"role": "user", "content": "Compute: $1-2+3-4+5- \\dots +99-100$."}]
inputs = tokenizer.apply_chat_template(
messages, add_generation_prompt=True, return_tensors="pt", return_dict=True
).to("cuda")
# Tool calling / agentic scenario: low reasoning strength, as in the agentic training data
tools = [{"type": "function", "function": {"name": "get_weather",
"description": "Get the current weather for a city.",
"parameters": {"type": "object", "properties": {"city": {"type": "string"}}, "required": ["city"]}}}]
messages = [{"role": "user", "content": "What is the weather like in Paris right now?"}]
inputs = tokenizer.apply_chat_template(
messages, tools=tools, reasoning_strength="low",
add_generation_prompt=True, return_tensors="pt", return_dict=True
).to("cuda")
out = model.generate(**inputs, max_new_tokens=30000) # sampling defaults: temperature 0.6, top-p 0.95, top-k 20
print(tokenizer.decode(out[0, inputs["input_ids"].shape[1]:], skip_special_tokens=False))
Serve it with stock vLLM 0.28 or newer, which loads the model code shipped in the repository; the built-in muse_glimmer parsers return OpenAI-style tool_calls and reasoning. For llama.cpp, use the GGUF files.
vllm serve facebook/MobileLLM-R2-2.5B --trust-remote-code \
--enable-auto-tool-choice --tool-call-parser muse_glimmer --reasoning-parser muse_glimmer
llama-server -m MobileLLM-R2-Q4_K_M.gguf --jinja --swa-full -c 32768
BibTeX
@article{zhao2026mobilellmr2,
title = {MobileLLM-R2: Advancing On-Device Language Models from Reasoning to Agents},
author = {Zhao, Changsheng and Chang, Ernie and Liu, Zechun and Ashley, Dylan R. and
Paltenghi, Matteo and Chandra, Vikas and Shi, Yangyang and Krishnamoorthi, Raghuraman},
journal = {arXiv preprint},
year = {2026}
}