arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2611.41874cs.CLcs.LG
收藏

Millie 2:在手机上运行具有百万令牌上下文的1770亿参数语言模型

Millie 2: Streaming a 177-Billion-Parameter Language Model on Phones at Million-Token Context

LLMs For All

Ben Krause

AI总结:

Millie 2提出驻留偏置注意力(RBA)等方法,在12GB RAM手机上实现1770亿参数、百万令牌上下文的大语言模型运行,性能接近父模型,可用于手机端浏览器及Android智能体。

摘要:

Millie 2在12GB RAM的手机上运行具有百万令牌上下文的1770亿参数语言模型,在该上下文长度下,其压缩权重与注意力数据共占用69.5GB。在iPhone 18 Pro上,它在短上下文下生成14.1 tokens/s,在回答百万令牌文档相关问题时生成9.9 tokens/s。Millie 2通过预测某层将使用的专家并优先选择权重已在RAM中的专家来流式传输模型权重;我们提出用于注意力数据流式传输的驻留偏置注意力(RBA),该模型利用前一层的状态对完整历史的紧凑索引进行评分,对键和值已在RAM中的块给予奖励,在早期层计算时获取缺失块,目标层随后使用所选块的逐令牌键和值计算注意力。为恢复模型质量,我们保持压缩权重固定,并在手机所用的相同专家选择约束下训练其共享缩放参数。所得模型在推理、编码、指令遵循和智能体基准上的得分接近其父模型。我们还评估了在手机上进行模型推理的浏览器智能体和Android智能体。这些方法使得在手机上运行具有长上下文的大语言模型成为可能,即便其压缩权重与注意力历史总和远超手机RAM。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑