# 端侧LLM推理

端侧LLM推理，是指直接在智能手机、笔记本电脑等消费级硬件上运行基于Transformer的语言模型，从而省去云端AI服务所必需的、与集中式GPU集群之间的往返通信。<sup>[1](https://zenodo.org/records/20370985)</sup> 其驱动力有三：隐私（推理在本地处理输入，这有助于保护隐私，但并不保证应用永远不会将数据传出设备）、延迟（无需网络往返）和成本（供应商无需按token支付服务账单）。<sup>[2](https://link.springer.com/article/10.1007/s10462-026-11538-1)</sup><sup> • </sup><sup>[9](https://support.apple.com/en-euro/guide/iphone/iphe3f499e0e/ios)</sup> 该领域依托两项使能技术——激进的量化与小模型家族——以及以配备多GB内存的移动级片上系统为基础的硬件底座。<sup>[2](https://link.springer.com/article/10.1007/s10462-026-11538-1)</sup>

| 关键事实 | 数值 | 来源 |
|---|---|---|
| 全精度下的存储占用 | 7B模型以32位存储约28 GB；175B模型则达数百GB | <sup>[2](https://link.springer.com/article/10.1007/s10462-026-11538-1)</sup> |
| 标准量化方案 | 以16位训练，量化为4位；内存缩减至原来的四分之一 | <sup>[3](https://v-chandra.github.io/on-device-llms/)</sup> |
| 量化模型体积 | 经4位训练后量化后为0.26–3.7 GB | <sup>[1](https://zenodo.org/records/20370985)</sup> |
| 延迟目标 | 单向≤150毫秒（ITU-T G.114），以达到可接受的实时质量 | <sup>[2](https://link.springer.com/article/10.1007/s10462-026-11538-1)</sup> |
| TTFT阈值 | 4秒仍可接受，10秒则不可；约2,000个预填充token是实际的最佳平衡点 | <sup>[4](https://aclanthology.org/2026.acl-industry.51.pdf)</sup> |
| 最小实用速度 | 1.25亿参数模型在iPhone上达到50 token/秒 | <sup>[3](https://v-chandra.github.io/on-device-llms/)</sup> |
| 延迟基准测试硬件 | 三星Galaxy S25（骁龙8 Elite，12 GB内存） | <sup>[4](https://aclanthology.org/2026.acl-industry.51.pdf)</sup> |

## 端侧推理意味着什么

综述文献在端侧部署与边缘部署之间划了一条界线：“端侧”面向移动级片上系统，例如配备多GB内存的智能手机；而“边缘”则面向Jetson级加速器或网关。<sup>[2](https://link.springer.com/article/10.1007/s10462-026-11538-1)</sup> 两种情况下，其定义性特征相同：模型权重与解码循环都运行在本地芯片上，而非数据中心内。<sup>[1](https://zenodo.org/records/20370985)</sup>

延迟方面的动机有标准可量化。ITU-T建议书G.114提出，单向延迟在150毫秒或以下，方可达到可接受的语音与实时应用质量——仅云端往返本身就可能耗尽这一延迟预算，而本地推理从结构上就避免了云端往返。<sup>[2](https://link.springer.com/article/10.1007/s10462-026-11538-1)</sup> 隐私动机则对应监管要求：本地推理有助于实现数据最小化、目的限制和受控保留，从而便于遵守GDPR与HIPAA。<sup>[2](https://link.springer.com/article/10.1007/s10462-026-11538-1)</sup> 这些优势在实际出货产品中是否成立，见下文“争议与局限”一节。

## 工作原理：量化、小模型与内存

**量化是核心技巧。** 在标准32位浮点精度下，一个70亿参数的模型约占28 GB，远超典型设备的容量。<sup>[2](https://link.springer.com/article/10.1007/s10462-026-11538-1)</sup> 部署方案已趋同于以16位训练、量化为4位：GPTQ（2022）与AWQ（2023）表明，4位训练后量化能在将内存缩减至原来的四分之一的同时保留大部分模型质量，仅AWQ在[Hugging Face](https://www.edgepedia.org/zh/hugging-face)上就有超过1900万次下载。<sup>[3](https://v-chandra.github.io/on-device-llms/)</sup> 借助激活感知校准，可实现0.26至3.7 GB的4位体积；已发表的量化研究报告称，对于7B级模型，生成质量与全精度基线的[困惑度](https://www.edgepedia.org/zh/perplexity)差距在0.1–0.2点以内。<sup>[1](https://zenodo.org/records/20370985)</sup>

权重并非内存账单的全部。推理过程中，激活张量和自回归解码所需的KV缓存会消耗大量额外内存与I/O带宽，增加延迟和能耗；2026年的综述建议在评估中将KV缓存视为一等子系统。<sup>[2](https://link.springer.com/article/10.1007/s10462-026-11538-1)</sup>

**架构与规模同样重要。** Meta的MobileLLM工作发现，在10亿参数以下，深而窄的架构（层数更多、隐藏维度更小）始终优于宽而浅的架构。<sup>[3](https://v-chandra.github.io/on-device-llms/)</sup> [蒸馏](https://www.edgepedia.org/zh/distillation)进一步放大了这一点：[DeepSeek-R1](https://www.edgepedia.org/zh/deepseek-r1)蒸馏产出了从1.5B到70B参数的模型，其中蒸馏后的8B模型在数学基准上超越了大得多的基础模型；据报道，Qwen3-4B在推理任务上可与Qwen2.5-72B-Instruct匹敌。<sup>[3](https://v-chandra.github.io/on-device-llms/)</sup>

**运行时。** llama.cpp仍是CPU推理的首选运行时，其GGUF格式已成为分发量化模型的事实标准。<sup>[3](https://v-chandra.github.io/on-device-llms/)</sup> Meta的MobileLLM-Flash模型采用4位权重量化（组大小32）、8位动态激活和量化KV缓存，通过[ExecuTorch](https://www.edgepedia.org/zh/executorch) v1.1.0导出，并借助XNNPACK针对移动CPU优化。<sup>[4](https://aclanthology.org/2026.acl-industry.51.pdf)</sup> 在系统层面，LeanStream（2026年9月）将GPU执行与存储I/O重叠，将内存占用降至此前端侧推理系统的1/4.8。<sup>[5](https://arxiv.org/abs/2609.03079)</sup>

## 具名系统与出货方

多家平台厂商如今将端侧LLM作为产品基础设施出货：

- **Apple Intelligence**运行一个端侧模型，Foundation Models框架让第三方开发者可以访问同一模型。苹果的公告称，开发者可以“使用免费的AI推理”进行构建。<sup>[6](https://absolutedigitalpublishers.com/articles/the-real-economics-of-shipping-a-model-to-a-device)</sup> 苹果的Private Cloud Compute文档称，端侧数据避免了“任何集中式攻击点”，而服务器处理“需要对用户请求及随附个人数据进行未加密访问”。<sup>[7](https://absolutedigitalpublishers.com/articles/the-deployment-envelope-small-models-on-device)</sup>
- **Gemini Nano**随谷歌的AICore在Android上出货。Android文档称，它“在处理后不存储任何输入数据或结果输出的记录”，且AICore“没有直接互联网访问权限”。<sup>[7](https://absolutedigitalpublishers.com/articles/the-deployment-envelope-small-models-on-device)</sup> 两家厂商的隐私声明均为厂商主张，未经独立验证。<sup>[7](https://absolutedigitalpublishers.com/articles/the-deployment-envelope-small-models-on-device)</sup>
- **MobileLLM-Flash**（Meta，2026）与Llama4-Scout共享32k词表，以降低推理成本，并支持蒸馏到浅层与深层骨干网络中。<sup>[4](https://aclanthology.org/2026.acl-industry.51.pdf)</sup>
- 面向本地使用的**小模型家族**包括Llama 3.2（1B/3B，128K上下文，2024）、[Gemma 3](https://www.edgepedia.org/zh/gemma-3)（270M–27B，2025）、[Phi-4](https://www.edgepedia.org/zh/phi-4)（3.8B mini与14B，2025）、SmolLM2（135M–1.7B，2025）和Qwen2.5（0.5B/1.5B，2024）。<sup>[3](https://v-chandra.github.io/on-device-llms/)</sup>

## 数据一览

**延迟。** 端侧助手必须优先考虑首token时间（TTFT），即从接收请求到生成第一个token的时间，因为解码速率可以通过向用户流式输出而加以掩盖。Meta的工程分析发现，4秒的TTFT仍能带来合理的用户体验，而10秒则不行；约2,000个预填充token是端侧模型能够执行有用工作的实际最佳平衡点。<sup>[4](https://aclanthology.org/2026.acl-industry.51.pdf)</sup>

**吞吐量。** 一个架构合适的1.25亿参数模型在iPhone上以50 token/秒运行，可处理基础任务。<sup>[3](https://v-chandra.github.io/on-device-llms/)</sup> Meta针对Galaxy S25的厂商报告表格显示，MobileLLM-Flash 350M在1k上下文下解码速度为95.55 token/秒，而Gemma3 270M为52.40；Llama3.2 1B解码速度为39.01 token/秒，而在测试硬件上Gemma3 1B为58.58。<sup>[4](https://aclanthology.org/2026.acl-industry.51.pdf)</sup> 这些均为厂商报告数据；对此类主张的独立评估才刚刚开始。<sup>[8](https://arxiv.org/abs/2609.13159)</sup>

**体积。** 4位精度下的量化端侧模型体积在0.26–3.7 GB之间。<sup>[1](https://zenodo.org/records/20370985)</sup> 每token能耗是一项公认指标，在[MLPerf Mobile](https://www.edgepedia.org/zh/mlperf-mobile)等协议下以焦耳/token计量，但本文所审查的来源未提供实际能耗测量值。<sup>[2](https://link.springer.com/article/10.1007/s10462-026-11538-1)</sup>

## 端侧与云端及混合设计

能力上的权衡是明确的：端侧将推理成本转移至用户已拥有的硬件，这对高用量应用而言经济性极具吸引力，但云端在前沿推理、广泛世界知识或长多轮对话方面仍更胜一筹。<sup>[3](https://v-chandra.github.io/on-device-llms/)</sup>

**谁付费。** 苹果对Foundation Models框架“免费”的表述，按一种分析的解读，并非主张推理没有成本，而是关于谁付费的主张：是用户的硬件和电池，而非供应商的服务账单。<sup>[6](https://absolutedigitalpublishers.com/articles/the-real-economics-of-shipping-a-model-to-a-device)</sup> 用户还需在硬件要求上付费，因为多GB内存和现代SoC是前提条件。<sup>[2](https://link.springer.com/article/10.1007/s10462-026-11538-1)</sup>

**混合设计**正不断涌现，以管理准确性—延迟—能耗—内存之间的权衡：边缘优先执行、云端回退，以及在紧凑设备模型与更大服务器模型之间共享的投机解码。<sup>[2](https://link.springer.com/article/10.1007/s10462-026-11538-1)</sup> 当任务需要前沿推理或长上下文时，端侧是错误选择；当需要低延迟、离线功能或数据最小化时，它则是正确选择。<sup>[3](https://v-chandra.github.io/on-device-llms/)</sup>

## 近期进展

2022年，传统观点认为至少需要7B参数才能生成连贯文本；到2026年，不足十亿参数的模型已能处理许多实际任务。<sup>[3](https://v-chandra.github.io/on-device-llms/)</sup> 2024–2025年的小模型浪潮（Llama 3.2、Gemma 3、Phi-4、SmolLM2、Qwen2.5）使本地使用在各厂商间成为主流。<sup>[3](https://v-chandra.github.io/on-device-llms/)</sup> 推理蒸馏进一步压缩：DeepSeek-R1蒸馏模型覆盖1.5B至70B参数，而Qwen3-30B-A3B混合专家模型仅激活3B参数，据报道其活跃参数仅为QwQ-32B的十分之一，却能超越后者。<sup>[3](https://v-chandra.github.io/on-device-llms/)</sup> 苹果通过[Apple Intelligence](https://www.edgepedia.org/zh/apple-intelligence)出货端侧模型，并通过Foundation Models框架向第三方开发者开放。<sup>[6](https://absolutedigitalpublishers.com/articles/the-real-economics-of-shipping-a-model-to-a-device)</sup> 在研究方面，2026年带来了独立基准测试（MobiBench）<sup>[8](https://arxiv.org/abs/2609.13159)</sup>以及LeanStream将内存缩减至原来的1/4.8等系统工作。<sup>[5](https://arxiv.org/abs/2609.03079)</sup>

## 争议与局限

**4位质量的分歧尚未解决。** 量化文献报告四位下精度退化可忽略不计，就其测量内容而言是正确的；分布文献报告同一比特宽度下出现有意义的行为变化，就其测量内容而言也是正确的。分歧在于应以哪项指标主导出货决策。<sup>[7](https://absolutedigitalpublishers.com/articles/the-deployment-envelope-small-models-on-device)</sup> 困惑度与基线差距在0.1–0.2点以内<sup>[1](https://zenodo.org/records/20370985)</sup>与行为变化，在四位下都是彼此一致的观察结果。

**厂商基准缺乏独立确认。** Meta针对MobileLLM-Flash及其Gemma、Llama竞品的对比表为厂商报告；MobiBench（2026年9月）的存在正是为了在不同硬件设置下，以任务特定准确性、预填充速度、解码速度和TTFT等面向用户的指标评估边缘优化LLM，填补厂商报告数据留下的空白，而记录中尚无对具体厂商数据的独立确认。<sup>[4](https://aclanthology.org/2026.acl-industry.51.pdf)</sup><sup> • </sup><sup>[8](https://arxiv.org/abs/2609.13159)</sup>

**隐私主张未经审计。** 苹果和谷歌关于端侧数据处理的声明是厂商对其自身系统的主张，未经独立验证。<sup>[7](https://absolutedigitalpublishers.com/articles/the-deployment-envelope-small-models-on-device)</sup> 一种分析认为，关于服务器端数据处理的政策承诺与服务器不存在，并非同一种保证，只有后者是“因其不存在”而可审计的。<sup>[7](https://absolutedigitalpublishers.com/articles/the-deployment-envelope-small-models-on-device)</sup>

**能力差距依然存在。** 不足十亿参数及1–4B模型在前沿推理、广泛世界知识和长多轮对话上表现不佳，这些仍需要云端模型。<sup>[3](https://v-chandra.github.io/on-device-llms/)</sup>

## References

1. On-Device Large Language Model Inference at the Network Edge, Zenodo (2026). https://zenodo.org/records/20370985
2. On-device large language models: a survey of model compression and system optimization, Artificial Intelligence Review (Springer, 2026). https://link.springer.com/article/10.1007/s10462-026-11538-1
3. On-Device LLMs: State of the Union, 2026, Vikas Chandra (Meta AI researcher). https://v-chandra.github.io/on-device-llms/
4. MobileLLM-Flash: Latency-Guided On-Device LLM Design for Industry Scale Deployment, ACL 2026 Industry Track (Meta). https://aclanthology.org/2026.acl-industry.51.pdf
5. LeanStream: A Speculate-and-Refine Streaming Framework for Efficient on-Device LLM Inference, arXiv (September 2026). https://arxiv.org/abs/2609.03079
6. The Real Economics of Shipping a Model to a Device, Absolute Digital Publishers (2026). https://absolutedigitalpublishers.com/articles/the-real-economics-of-shipping-a-model-to-a-device
7. The Deployment Envelope: Small Models Where the Power Is Not, Absolute Digital Publishers (2026). https://absolutedigitalpublishers.com/articles/the-deployment-envelope-small-models-on-device
8. MobiBench: Benchmarking LLMs for On-Device Performance, arXiv (September 2026). https://arxiv.org/abs/2609.13159
9. Apple Intelligence and privacy on iPhone, https://support.apple.com/en-euro/guide/iphone/iphe3f499e0e/ios

---
*Initially written Sep 17, 2026 · Edited: Oct 11, 2026; Oct 15, 2026*

Topic: 技术与人造世界 › 计算技术与数字系统 › 现代人工智能：基础模型、生成式人工智能与人工智能产业 › Foundation-model methods and training › Inference, serving, and efficiency of foundation models

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/on-device-llm-inference

English original: https://www.edgepedia.org/on-device-llm-inference
