Millie 2:在 12GB 内存手机上流式运行 1770 亿参数模型、百万 token 上下文
Millie 2: Streaming a 177-Billion-Parameter Language Model on Phones at Million-Token Context
手机跑 177B 模型还能读百万 token 文档,这事以前想都不敢想。关键不是压缩,而是按需流式加载权重和注意力数据的调度思路。做端侧 AI、移动智能体的开发者值得细看论文里的 RBA 设计,对做本地推理工具的团队也有直接参考价值。
Millie 2 是一个能在 12GB RAM 手机上运行的 1770 亿参数语言模型,支持百万 token 上下文,此时压缩后的权重与注意力数据共占 69.5GB,远超手机内存。在 iPhone 18 Pro 上,短上下文生成速度为 14.1 tokens/s,回答关于百万 token 文档的问题时为 9.9 tokens/s。
技术上,Millie 2 通过预测每一层将使用哪些专家来流式加载权重,并偏向加载权重已在 RAM 中的专家。针对注意力数据,团队提出 Residency-Biased Attention(RBA):用较早层的状态对完整历史的紧凑索引打分,给键值已在 RAM 的块加分,同时在先前层计算时预取缺失块。
为恢复模型质量,团队固定压缩权重、在手机端相同的专家选择约束下训练共享缩放因子,最终模型在推理、编程、指令跟随和智能体基准上接近其母模型,并在手机端推理条件下测试了浏览器与 Android 智能体。
Millie 2: Streaming a 177-Billion-Parameter Language Model on Phones at Million-Token Context
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.
This report is categorized under AITOP's "Models" desk, focusing on US frontier AI labs and Silicon Valley technology leaders. Within our cross-regional analytical framework, it directly maps to AI developer toolchains, coding agents, and engineering workflows and US-China foundation model benchmarks and commercialization comparison. Key entities and technical topics under continuous tracking include Millie 2, on-device models, reasoning models, MoE.
Source attribution: curated from arXiv cs.LG (@Ben Krause).