Millie 2: Streaming a 177B-Parameter LLM on Phones at 1M Context

Millie 2 (arXiv:2611.41874) streams a 177-billion-parameter MoE language model derived from Qwen3.8-Flash-Next at 1M-token context on a smartphone with 12 GB of RAM—even though compressed weights and KV attention history occupy 69.5 GB. Using lookahead expert streaming and Residency-Biased Attention (RBA), it generates 14.1 tokens/s on short prompts and 9.9 tokens/s on 990K-token documents on an iPhone 18 Pro.
Millie 2: Streaming a 177B-Parameter LLM on Phones at 1M Context: Millie 2 (arXiv:2611.41874) streams a 177-billion-parameter MoE language model derived from Qwen3.8-Flash-Next at 1M-token context on a smartphone with 12 GB of RAM—even though compressed weights and KV attention history occupy 69.5 GB. Using lookahead expert streaming and Residency-Biased Attention (RBA), it generates 14.1 tokens/s on short prompts and 9.9 tokens/s on 990K-token documents on an iPhone 18 Pro. 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.
- 69.5 GB Footprint in 12 GB RAM: Q3 checkpoint packs 177B weights at 2.54 bits/weight (56.3 GB), while Ternary compresses to 1.66 bits/weight (36.9 GB).
- 9.9 tok/s at ~1M Context on iPhone 18 Pro: Hits 14.1 tok/s on short context (+1.5 expert bias) and 9.9 tok/s on 990K-token BABILong queries.
- Residency-Biased Attention (RBA): Uses an earlier layer to score KV block indices and adds a residency bonus to blocks already in RAM, fetching misses asynchronously.
- Near-Parent Quality & Mobile Agents: Q3 RBA hits 91.9% on GPQA Diamond and 90.5% on LiveCodeBench v6; scores 64.3% on WebArena Lite (iPhone 18 Pro) and 69.0% on AndroidWorld (Galaxy S26 Ultra).
import { createAgent } from '@smoke-monkey/harness';// Mobile/Edge agent targeting a local Millie 2 streaming server (12 GB RAM cap)const agent = createAgent({agentId: 'millie2-mobile-1m-agent',provider: 'openai-compatible',baseUrl: 'http://127.0.0.1:8090/v1',model: 'millie-2-177b-q3-rba',workspacePath: process.cwd(),permissions: {read_file: 'allow',write_file: 'ask',run_command: 'ask',},});async function main() {const result = await agent.run('Analyze the 900K-token offline codebase dump and extract all authentication state transitions.');console.log('Millie 2 Edge Analysis:', result.summary);}main().catch(console.error);
Watch: Related Video Guides
How Do We Get MASSIVE Model To Run On Device? Quantization Explained.
On-Device LLM Explained: A 3B Phone Assistant in 2 GB (4-bit Weights, GQA, Distillation)
What Is Millie 2 and How Does It Fit 177B Parameters on a Phone?
Millie 2 (Ben Krause, arXiv:2611.41874) is a mobile-streaming adaptation of Qwen/Qwen3.8-Flash-Next that runs a 177B-parameter Mixture-of-Experts (MoE) model with a 1M-token context window on a 12 GB smartphone. At full 1M length, its compressed weights plus attention KV history total 69.5 GB, far exceeding device memory; Millie 2 solves this by overlapping flash storage reads with computation via lookahead expert admission and Residency-Biased Attention (RBA).
To recover accuracy lost from hardware-constrained routing, Millie 2 freezes the compressed Q3 (2.54 bpw, 56.3 GB) or Ternary (1.66 bpw, 36.9 GB) weights and fine-tunes only their shared scales under the exact on-device selection policy.
| Benchmark | Tasks | Parent (Qwen3.8-Flash-Next) | Millie 2 Q3 (RBA) | Millie 2 Ternary (Streamed Q8 KV) |
|---|---|---|---|---|
| GPQA Diamond | 198 | 90.4% | 91.9% | 84.3% |
| HumanEval+ | 164 | 95.7% | 92.1% | 90.2% |
| LiveCodeBench v6 | 1,055 | 91.2% | 90.5% | 83.3% |
| IFBench strict | 300 | 82.0% | 81.0% | 73.0% |
| SWE-bench Verified (server) | 500 | 80.6% | 78.4% (native attn) | 75.2% |
| WebArena Lite (iPhone 18 Pro) | 70 | 61.4% (server) | 64.3% (on phone) | — |
| AndroidWorld (Galaxy S26 Ultra) | 116 | 75.9% (server) | — | 69.0% (on phone) |
Lookahead Expert Streaming and Residency-Biased Attention (RBA)
Flash I/O stalls would normally crush token generation if the runtime waited until layer l computed its router logits before loading missing experts or KV blocks. Millie 2 eliminates this stall through two co-designed mechanisms:
- Lookahead Expert Admission: A lightweight low-rank predictor
a_l = W_l x_early + B_l(A_l x_early)forecasts expert probabilities several layers ahead and boosts experts already cached in RAM (R_l) or prefetched (P_l) by a tunable biasb. Raising expert bias on an iPhone 18 Pro from+1.5to+3boosts short-context speed from 14.1 tok/s to 15.5 tok/s by increasing RAM cache hits. - Residency-Biased Attention (RBA): For long contexts, an earlier layer scores a compact index of historical KV blocks and adds
+0.5 sigma_s(64K resident budget) or+1.0 sigma_s(16K resident budget) to blocks already in RAM. On 64 matched ~990K-token BABILong questions, Q3 with RBA (64K resident,+0.5 sigma) scored 54/64, outperforming even native decode attention (51/64) while cutting flash transfers. - Numerical Parity Across Devices: Despite streaming and quantization, mean KL divergence between the GPU distribution and iPhone execution stays at just 0.00581 nats/token for Q3 and 0.00405 nats/token for Ternary.
Tune the Expert Bias Knob for Latency vs Quality
On 12 GB phones, use +1.5 expert bias and 64K RBA residency (+0.5 sigma) for reasoning/coding tasks, and bump bias to +3 for interactive 15.5 tok/s chat where slightly higher expert reuse is acceptable.
Reproducible Millie 2 Inspection and On-Device Streaming Setup
Inspect the parent Qwen3.8-Flash-Next base architecture and run the Millie 2 streaming and WebArena/AndroidWorld evaluation harness:
# 1. Inspect the parent model config and sparse attention layout
hf download Qwen/Qwen3.8-Flash-Next config.json --local-dir ./qwen38-meta
# 2. Clone the official Millie 2 / llmsforall mobile streaming runtime
git clone https://github.com/llmsforall/millie-2.git && cd millie-2
# 3. Verify Q3 (2.54 bpw, 56.3 GB) or Ternary (1.66 bpw, 36.9 GB) streaming throughput
python3 scripts/bench_streaming.py \
--checkpoint q3 \
--context-length 990000 \
--rba-resident-tokens 65536 \
--rba-bonus-sigma 0.5 \
--expert-bias 1.5Frequently Asked Questions
Q:How can a 69.5 GB model + 1M context KV cache run on a 12 GB phone?
Millie 2 keeps only active/hot expert weights and a compact KV index + resident KV subset inside the phone’s 12 GB RAM, streaming missing sparse experts and selected KV blocks asynchronously from flash storage while earlier layers compute.
Q:What decode speeds does Millie 2 achieve on an iPhone 18 Pro?
Millie 2 Q3 reaches 14.1 tokens/s on short contexts (15.5 tokens/s with +3 expert bias) and 9.9 tokens/s when answering questions over a ~990K-token document.
Q:Does Residency-Biased Attention hurt accuracy at 1M tokens?
No. On ~990K-token BABILong QA, Q3 with RBA (64K resident, +0.5 sigma) scored 54/64 correct compared to 51/64 for native attention, with only +0.00906 nats/token KL divergence.
Q:What is the file size difference between Millie 2 Q3 and Ternary?
Millie 2 Q3 averages 2.54 bits/weight (56.3 GB model file), while Millie 2 Ternary averages 1.66 bits/weight (36.9 GB model file) and hits 69.0% on AndroidWorld on a Galaxy S26 Ultra.
Related Alternatives & Comparisons
Related Architecture Guides
View all guidesBest Open Source Coding Agents in 2026: Free, Local & Fully Hackable Harnesses
MCP Server Security Best Practices: Hardening Model Context Protocol Agents in 2026
Open Source Coding Agent Harness: Build a Forkable, Local AI Engineering Runtime
Build with Smoke Monkey Harness
Zero dependencies. 24 built-in tools. Human-in-the-loop safety. 100% open source under the MIT License.