Millie 2 runs giant language model with million-token memory on phones
Millie 2: Streaming a 177-Billion-Parameter Language Model on Phones at Million-Token Context
Computation and LanguageMachine Learning
Summary
Running very large language models on phones is hard because their data and memory needs are huge. The authors present Millie 2, which streams parts of a 177-billion-parameter model and its long context across limited phone memory. It predicts which parts of the model and past text will be needed soon to keep things in fast memory, allowing it to generate responses based on a million words of context. They also retrain some model settings to keep performance high despite these memory tricks. This shows it is possible to run advanced language models with huge memory requirements on everyday phones.
What this means in practice
- •For mobile app developers: Integrate large language models that access million-token contexts directly on phones with limited memory, enabling advanced AI features offline.$Commercial implications: Enables selling AI applications with sophisticated long-context language understanding running efficiently on consumer smartphones.
- •For android developers: Run stateful agent or assistant applications that handle extremely long documents by streaming model and attention data within mobile RAM constraints.
Authors
Ben Krause
Abstract
Millie 2 runs a 177-billion-parameter language model with a million-token context on a phone with 12 GB of RAM. At that length, its compressed weights and attention data occupy 69.5 GB. On an iPhone 18 Pro, it generates 14.1 tokens/s at short context and 9.9 tokens/s when answering a question about a million-token document. Millie 2 streams model weights by predicting which experts a layer will use and favoring experts whose weights are already in RAM. We propose Residency-Biased Attention (RBA) for streaming attention data. Millie 2 uses an earlier layer's state to score a compact index of the full history, giving a bonus to blocks whose keys and values are already in RAM. The model fetches missing blocks while earlier layers compute. The destination layer then computes attention with the per-token keys and values of its selected blocks. To recover model quality, we keep the compressed weights fixed and train their shared scales under the same expert-selection constraints used on the phone. The resulting model scores close to its parent across reasoning, coding, instruction-following, and agentic benchmarks. We also evaluate browser and Android agents with model inference on the phones. These methods make it practical to run a large language model at long context on a phone even when its compressed weights and attention history together far exceed the phone's RAM.