Local & Offline
~9 min readUpdated: December 2026

Meta MobileLLM-R2: 2.5B On-Device Reasoning & Tool-Use Agents

Meta MobileLLM-R2 2.5B On-Device Reasoning and Tool-Use Agent Architecture

Meta AI MobileLLM-R2 (arXiv:2611.39870) is a 2.49B-parameter on-device model that unifies long-horizon reasoning and multi-turn tool calling on just 1.2T pre-training tokens (<2T total). Driven by Muon optimization, Muse-Glimmer-30B distillation, and On-Policy Distillation, it hits 30.9% on SWE-Bench Verified and 59.4% on AIME24—beating 7B baselines.

Technical Review: Smoke Monkey Core Architecture Team
Tested on Node.js 18+ & BunTypeScript 5.x
Quick Answer & Executive Definition

Meta MobileLLM-R2: 2.5B On-Device Reasoning & Tool-Use Agents: Meta AI MobileLLM-R2 (arXiv:2611.39870) is a 2.49B-parameter on-device model that unifies long-horizon reasoning and multi-turn tool calling on just 1.2T pre-training tokens (<2T total). Driven by Muon optimization, Muse-Glimmer-30B distillation, and On-Policy Distillation, it hits 30.9% on SWE-Bench Verified and 59.4% on AIME24—beating 7B baselines. Designed as a zero-dependency, open-source TypeScript architecture under the MIT License with native Model Context Protocol (MCP) support and deterministic phase state machines.

Key Architectural Takeaways
Quick Implementation Examplemobilellm-r2-edge-agent.ts
mobilellm-r2-edge-agent.tstypescript
import { createAgent } from '@smoke-monkey/harness';
// Run compact 2.49B on-device agentic coding via local llama.cpp or MLX OpenAI server
const edgeAgent = createAgent({
agentId: 'mobilellm-r2-edge-coder',
provider: 'openai-compatible',
model: 'facebook/MobileLLM-R2-2.5B',
baseUrl: 'http://127.0.0.1:8080/v1',
workspacePath: process.cwd(),
permissions: {
read_file: 'allow',
write_file: 'allow',
run_command: 'ask',
},
});
async function executeOfflineToolLoop() {
const result = await edgeAgent.run(
'Inspect package.json scripts, fix the failing parser test in src/parser.ts, and verify with minimal token overhead.'
);
console.log('MobileLLM-R2 edge execution:', result.summary);
}
executeOfflineToolLoop().catch(console.error);
Video Guides

Watch: Related Video Guides

MobileLLM-R1 First Look & Testing – Sub-1B Reasoning Models From Meta!

LLM vs. SLM vs. FM: Choosing the Right AI Model

What Is MobileLLM-R2? Architecture & Token-Efficient Training

MobileLLM-R2 (arXiv:2611.39870) is Meta AI's 2.49B-parameter open-architecture edge model engineered for both mathematical reasoning and multi-turn software tool use. Trained from scratch on only 1.2T pre-training tokens using Muon, forward-KL distillation from Muse-Glimmer-30B, and On-Policy Distillation (OPD), it outperforms 2B–7B competitors on SWE-Bench Verified and AIME24.

Structurally, MobileLLM-R2 uses 32 transformer layers (dim=2048, hidden_dim=8192 SwiGLU), 32 query heads with 8 KV heads (4:1 GQA for compact KV cache), tied input/output embeddings over a 202,048-token Muse-Glimmer vocabulary, and RoPE theta=10^7 supporting 32,768-token sequences.

BenchmarkQwen3.5-2B (2.27B)SmolLM3-3B (3.08B)Nemotron-3-Nano-4B (3.97B)OLMo-3-7B (7.30B)`MobileLLM-R2` (`2.49B`)
SWE-Bench Verified15.6%0.0%7.3%0.6%`30.9%`
BFCL V4 / BFCL-Parity48.9% / 30.1%25.7% / 70.2%53.8% / 68.0%31.8% / 69.4%50.6% / `77.5%`
Terminal-Bench / Aider Polyglot4.1% / 3.7%0.4% / 2.5%2.6% / 5.0%1.1% / 2.1%`5.2%` / `6.5%`
AIME24 / AIME25 (`avg@16`)13.3% / 16.5%46.7% / 37.7%58.5% / 56.5%54.8% / 42.3%`59.4%` / 49.0%
LiveCodeBench / HumanEval12.6% / 36.0%28.8% / 54.3%45.3% / 72.0%21.8% / 47.6%`47.3%` / 69.5%

Joint Reasoning + Agentic Supervision & On-Policy Distillation

Meta's ablation studies prove that training a 2.5B model exclusively on reasoning traces yields 0.0% on SWE-Bench Verified, while training exclusively on agentic trajectories collapses math and coding performance. Joint Stage-2 SFT (mixing 16.0% agentic examples from OpenThoughts-Agent-SFT-100K with OpenMathReasoning, OpenCodeReasoning-2, and OpenScienceReasoning-2) recovers both: 91.2% MATH500 alongside 27.0% SWE-Bench before On-Policy Distillation boosts SWE-Bench to 30.9%.

Even better for edge battery and latency budgets, the jointly trained model self-regulates verbosity—emitting 13,157 median tokens on AIME25 and 16,718 on LiveCodeBench, yet only 210 tokens per turn on SWE-Bench Verified.

Align Chat Templates Between SFT and On-Policy Distillation

If fine-tuning compact 2B–3B agent models with OPD, ensure identical tool-call delimiters and assistant loss masks across SFT and rollout generation, and seed teacher rewrites from student-induced intermediate states.

Reproducible Local Edge Serving & KV Memory Sizing

With 2.49B parameters and 8 GQA KV heads (head_dim = 64), MobileLLM-R2 occupies ~5.0 GB in BF16 or ~1.6 GB in 4-bit Q4_K_M, leaving plenty of unified memory on phones, laptops, and Jetson kits for a 32K context window.

bash
# 1. Estimate 4-bit weight + 32K FP16 KV-cache footprint (32 layers x 8 KV heads x 64 dim)
python - <<'PY'
weights_q4_gb = 2.49 * 0.55
kv_bytes_per_tok = 32 * 2 * 8 * 64 * 2  # K+V in FP16 = 65,536 bytes/tok
kv_32k_gb = (32768 * kv_bytes_per_tok) / (1024**3)
print(f"Q4 weights: {weights_q4_gb:.2f} GB, 32K KV cache: {kv_32k_gb:.2f} GB, Total: {weights_q4_gb + kv_32k_gb:.2f} GB")
PY

# 2. Launch an OpenAI-compatible local tool-calling server (llama.cpp)
llama-server -m ./MobileLLM-R2-2.5B-Q4_K_M.gguf \
  --host 127.0.0.1 --port 8080 \
  -c 32768 --jinja -ngl 99

Running Offline Repository Agents in Smoke Monkey Harness

Inside Smoke Monkey Harness, a 2.49B model scoring 30.9% on SWE-Bench Verified and 77.5% on BFCL-Parity crosses the reliability threshold needed for local offline coding loops. Developers on flights, air-gapped networks, or mobile edge hosts can bind MobileLLM-R2 to local file, AST, and test tools without sending proprietary code to external APIs.

Google Search Questions & Answers

Frequently Asked Questions

Q:How many parameters and KV heads does Meta MobileLLM-R2 have?

MobileLLM-R2-2.5B has 2.49B total parameters across 32 transformer layers, 32 query heads, 8 KV heads (4:1 GQA), embedding dimension 2,048, FFN dimension 8,192, and a 202,048-token vocabulary.

Q:How does MobileLLM-R2 compare to Qwen3.5-2B and OLMo-3-7B on coding agents?

MobileLLM-R2 reaches 30.9% on SWE-Bench Verified, more than doubling Qwen3.5-2B (15.6%) and outperforming OLMo-3-7B-Instruct (0.6%) despite having roughly one-third the parameters.

Q:Why did Meta train MobileLLM-R2 with only 1.2T pre-training tokens?

By combining Muon optimization, recursive data-mixture refinement, synthetic cross-domain bridge data, and forward-KL distillation from Muse-Glimmer-30B, MobileLLM-R2 matched or beat models trained on 11.2T to 36T tokens.

Q:Does MobileLLM-R2 waste tokens overthinking simple tool calls?

No. Joint reasoning and agentic supervision teaches task-adaptive length control—averaging 13K–16K tokens on competition math/code while emitting a median of just 210 tokens per turn on SWE-Bench Verified.

Related Alternatives & Comparisons

Related Architecture Guides

View all guides

Build with Smoke Monkey Harness

Zero dependencies. 24 built-in tools. Human-in-the-loop safety. 100% open source under the MIT License.

npm install smoke-monkey-harness