Millie 2 demonstrates inference of a 177-billion-parameter language model with a one-million-token context window on a mobile device equipped with only 12 GB of RAM, where the combined compressed weights and attention data footprint reaches 69.5 GB. On an iPhone 18 Pro, the system achieves 14.1 tokens/s at short context and 9.9 tokens/s when processing a million-token document. The architecture employs a mixture-of-experts approach with predictive expert loading: an earlier layer anticipates which experts a subsequent layer requires, prioritizing those already resident in RAM to minimize flash storage reads. For attention streaming, the paper introduces Residency-Biased Attention (RBA), which uses a prior layer's state to score a compact index of the full key-value history, applying a residency bonus to blocks cached in RAM. Missing blocks are fetched asynchronously while earlier layers compute, allowing the destination layer to attend only to selected per-token keys and values. To preserve model quality under these streaming constraints, compressed weights remain fixed while shared scales are retrained under the same expert-selection logic deployed on-device. The resulting model maintains performance comparable to its parent across reasoning, coding, instruction-following, and agentic benchmarks. The authors additionally validate the approach on browser and Android agents running inference locally, releasing both model weights and inference code.

Read original