Docs /Model Selection & Architectures
ARCHITECTURE OVERVIEW · SLM SELECTION

On-Device Model Selection.

Compare the engineering strengths, attention mechanisms, and RAM requirements of leading Small Language Models (SLMs) on ARM64 mobile hardware: benchmark matrix, RoPE context scaling, open licenses, and device matchmaker.

Comprehensive Model Architecture & Benchmark Matrix

Standardized academic benchmark scores comparing general knowledge (MMLU), math reasoning (GSM8K, MATH), and code synthesis (HumanEval pass@1):

ModelNative ContextMMLU (General)GSM8K (Math)HumanEval (Code)MATH (Hard)Min Phone RAMLicense
SmolLM2 1.7B1.7B2,04850.8%42.5%28.0%22.4%4 GBMIT
Qwen 2.5 0.5B0.5B32,76846.9%35.8%23.8%18.2%4 GBApache 2.0
Qwen 2.5 1.5B1.5B131,07260.9%65.5%53.0%40.6%6 GBApache 2.0
Llama 3.2 1B1.2B131,07249.3%44.6%30.5%24.0%4 GB – 6 GBLlama 3.2 Community
Llama 3.2 3B3.2B131,07263.4%77.7%58.5%44.2%6 GB – 8 GBLlama 3.2 Community
Gemma 2 2B2.6B8,19256.1%56.4%36.6%31.8%6 GBGemma Terms
Qwen 2.5 3B3.1B131,07268.4%82.4%64.0%52.8%8 GBApache 2.0
DeepSeek-R1 Distill 1.5B1.8B131,07265.2%83.1%57.3%68.9%6 GB – 8 GBMIT
Qwen 2.5 7B7.6B131,07274.2%88.2%78.0%65.4%12 GB+Apache 2.0
DeepSeek-R1 Distill 7B7.6B131,07276.8%92.8%82.3%85.2%12 GB+MIT
DeepSeek-R1 Distill 8B8.0B131,07277.5%93.4%84.1%86.1%12 GB – 16 GBMIT

Interactive Model Matchmaker Matrix

Select your phone RAM capacity and primary workload to instantly reveal the optimal quantized model, safe context budget, and expected token speed:

Interactive Model Matchmaker
Optimal Match for Your Selection

Llama 3.2 3B Instruct

Q4_K_M (2.02 GB download)Llama 3.2 Community

The gold standard for mobile assistant intelligence. Grouped-Query Attention (GQA) ensures compact KV cache. Unmatched conversational tone and summarization quality.

RAM Footprint2.2 GB RAM
Safe Context2,048 – 4,096 tokens
MMLU General63.4%
HumanEval Code58.5%
Expected Token Speed on Your Chipset:
Snapdragon 8 Gen 338 – 52 tok/s
Snapdragon 8 Gen 228 – 38 tok/s
Google Tensor G3/G424 – 32 tok/s
Mid-Range / Budget12 – 18 tok/s
Hugging Face GGUF:bartowski/Llama-3.2-3B-Instruct-GGUF
One-tap download in Local AI

Context Window & RoPE Base Frequency Analysis

Why models advertise 128k context windows, how Rotary Position Embeddings (RoPE) work, how Gemma 2's 8k sliding window attention contrasts with native 128k architectures, and why mobile execution requires realistic context budgeting:

RoPE Theta Scaling (500k vs 1M)

Original Transformers used a base frequency (θ) of 10,000 for Rotary Position Embeddings, causing severe degradation past 2,048 tokens. Llama 3.2 scales θ to 500,000, while Qwen 2.5 scales θ to 1,000,000. This prevents high-frequency rotators from colliding, preserving needle-in-a-haystack retrieval over deep context.

128k Native vs Gemma 2 8k SWA

Llama 3.2 and Qwen 2.5 support 128k (131,072) native tokens via full Grouped-Query Attention (GQA). In contrast, Google DeepMind designed Gemma 2 with an 8,192-token native context using alternating 4,096-token Sliding Window Attention (SWA) and global attention. This architectural choice limits KV cache growth on mobile while excelling at short-to-medium creative generation.

The Mobile Reality: 128k vs 2k Tokens

While weights can address 128k tokens, storing 128k attention states in FP16 KV cache requires ~16 GB of physical RAM purely for cache memory. On smartphones with 6GB–12GB unified RAM, a 128k prompt triggers instant Android LMK eviction. Budgeting 2,048 – 4,096 tokens ensures sub-second prompt prefill and under 300MB cache footprint.

Open Weights Licensing Guide

Plain-English breakdown of legal rights, commercial permissions, and distribution clauses across open model weights:

Apache 2.0

(Qwen 2.5 Series (0.5B, 1.5B, 3B, 7B, 14B))
Full Commercial Freedom

One of the most permissive open-source licenses in existence. You can use Qwen models in commercial products, mobile apps, or enterprise deployments with no user caps and no revenue royalty thresholds.

Restrictions / Notes: Minimal (Standard copyright notice & disclaimer preservation)

MIT License

(SmolLM2 (Hugging Face), DeepSeek-R1 Distills (DeepSeek AI))
Unconditional Commercial Freedom

DeepSeek released their distilled R1 models under the pure MIT License. You have complete freedom to modify, fine-tune, embed, and redistribute commercially with zero proprietary strings attached.

Restrictions / Notes: Minimal (Include original MIT copyright notice in source distributions)

Meta Llama 3.2 Community License

(Llama 3.2 (1B & 3B))
Permitted (Under 700M Monthly Active Users)

Free for commercial use as long as your application has fewer than 700 million monthly active users in the preceding calendar month. Requires explicit 'Built with Llama' attribution in user documentation.

Restrictions / Notes: Attribution ('Built with Llama'); prohibited from using outputs to improve other non-Llama models

Gemma Terms of Use

(Gemma 2 (2B, 9B, 27B))
Permitted (Responsible AI Terms)

Google provides open weights for Gemma under custom terms. Commercial applications are permitted, but developers must adhere to acceptable use restrictions and cannot claim endorsement by Google.

Restrictions / Notes: Subject to Google's Responsible AI Prohibited Use Policy (no weapons, surveillance, illegal activities)

Architectural Deep Dive by Model Family

Llama 3.2 (Meta AI)

Available Sizes: 1B & 3B
1.2 GB (1B) / 2.2 GB (3B)38 – 52 tok/s

Architecture Highlights: Grouped-Query Attention (GQA), 128k native context, RoPE frequency scaling (theta = 500,000)

Core Strengths: Fast conversational turn-taking, crisp summarization, ultra-low latency prompt prefill.

Best For: Daily mobile assistant, message drafting, and quick Q&A.

Qwen 2.5 (Alibaba Cloud)

Available Sizes: 0.5B, 1.5B, 3B, 7B
0.8 GB (0.5B) / 1.5 GB (1.5B) / 4.4 GB (7B)24 – 48 tok/s

Architecture Highlights: Dense Transformer, SwiGLU activations, ChatML formatting, tie word embeddings (theta = 1,000,000)

Core Strengths: Frontier coding capabilities, precise structured JSON output, superior multilingual comprehension across 29+ languages.

Best For: Software developers, JSON parsing, and multilingual translation.

DeepSeek-R1 Distill (DeepSeek AI)

Available Sizes: 1.5B, 7B, 8B
1.4 GB (1.5B) / 4.5 GB (7B) / 5.2 GB (8B)18 – 35 tok/s

Architecture Highlights: Distilled reasoning backbone with chain-of-thought <think> tokens, high RoPE base frequency

Core Strengths: Mathematical proofs, step-by-step logic deduction, competitive programming, self-correction.

Best For: Complex analytical queries, debugging algorithms, and logic puzzles.

SmolLM2 (Hugging Face)

Available Sizes: 135M, 360M, 1.7B
0.6 GB (360M) / 1.1 GB (1.7B)48 – 65 tok/s

Architecture Highlights: Compact SLM trained on Cosmopedia v2 synthetic data with fineWeb-Edu filtering

Core Strengths: Ultra-compact memory footprint, zero thermal strain, executes reliably on 4GB budget phones.

Best For: Budget smartphones (Redmi, Poco, Moto G) and minimal battery drain.

Gemma 2 (Google DeepMind)

Available Sizes: 2B
1.8 GB (2B)28 – 38 tok/s

Architecture Highlights: Alternating Local & Global Sliding Window Attention (SWA), Logit soft-capping

Core Strengths: Rich lyrical prose, creative writing, nuanced roleplay, and conversational personality.

Best For: Creative writers, worldbuilding, and thoughtful conversational partner.

Model Selection FAQs

Why is Grouped-Query Attention (GQA) critical for mobile phone inference?+
Standard Multi-Head Attention (MHA) allocates separate Key and Value heads for every Query head, causing the KV cache to explode in size as context grows. Grouped-Query Attention (used by Llama 3.2 and Qwen 2.5) shares a single key-value head across 8 query heads. This slashes KV cache RAM usage by 87%, making multi-thousand-token context windows feasible on phones with 6GB–8GB RAM.
How does DeepSeek-R1 1.5B compare to Llama 3.2 3B in general conversation?+
Llama 3.2 3B is generally smoother and more conversational for everyday writing and chatting. DeepSeek-R1 1.5B is specifically fine-tuned for mathematical and logical reasoning: it will output an internal monologue inside <think> tags before answering, making it much stronger for logic puzzles and math, but more verbose for simple queries.
Can a 1B or 3B model write clean, bug-free Python and JavaScript code?+
Yes. Models like Qwen 2.5 Coder 1.5B and Llama 3.2 3B achieve over 55%–64% on HumanEval pass@1 benchmarks. They excel at writing isolated utility functions, debugging syntax errors, explaining algorithms, and generating regex patterns directly on your phone.
Why can't I utilize the full 128k context window on my smartphone?+
While Llama 3.2 and Qwen 2.5 support 128,000 tokens natively via high-frequency RoPE, storing 128k tokens of attention states in FP16 KV cache requires approximately 16 GB of physical RAM purely for the cache itself. On mobile devices with 6GB to 12GB of total unified system memory, capping context to 2,048 or 4,096 tokens provides instant prompt prefill without OOM risk.
Which model consumes the least battery life?+
SmolLM2 1.7B and Qwen 2.5 0.5B/1.5B consume the least battery. Because their weight sizes are under 1.2GB, memory bus transfers complete in fewer CPU cycles, drawing less than 2.5 watts during generation compared to 5–7 watts on 7B models.
TEST ALL THESE MODELS FREE

Try Local AI on Android

Browse Hugging Face, download one-tap GGUF weights, and switch models effortlessly.

Get Early Access ↗