# 边缘AI

边缘AI是指在资源受限的硬件上直接运行机器学习推理的实践，这类硬件包括智能手机、嵌入式神经处理单元（NPU）、[单板计算机](https://www.edgepedia.org/zh/single-board-computer)和微控制器，而非将数据发送至数据中心进行预测。在基础模型时代，该主题已从CNN时代的TinyML（[关键词识别](https://www.edgepedia.org/zh/keyword-spotting)、微控制器上的目标检测）转向在本地运行小型语言模型，如今涵盖端侧推理、本地边缘服务器以及设备—云混合模式，但不涉及数据中心服务和通用嵌入式系统开发。<sup>[1](https://link.springer.com/article/10.1007/s10462-026-11538-1)</sup><sup> • </sup><sup>[2](https://dl.acm.org/doi/pdf/10.1145/3827611)</sup> 目前公认三种部署模式：纯端侧、设备—边缘协同以及边缘—云协同。<sup>[1](https://link.springer.com/article/10.1007/s10462-026-11538-1)</sup>

| 关键事实 | 数据 |
|---|---|
| 7B模型以FP32存储 / 175B模型 | 约28 GB / 数百GB<sup>[1](https://link.springer.com/article/10.1007/s10462-026-11538-1)</sup> |
| 一个能力尚可的约4B模型，4比特量化 | 接近1 GB，可在手机或树莓派5上运行<sup>[3](https://derekmolloy.ie/from-tinyml-to-tiny-language-models-the-state-of-edge-ai-in-2026/)</sup> |
| Llama-2-7B 3比特（组大小128，约2.8 GB） | WikiText-2困惑度相对FP16基线5.47的退化小于0.15；同宽度下朴素就近取整量化则崩溃（困惑度>100）<sup>[4](https://www.scirp.org/journal/paperinformation?paperid=151062)</sup> |
| 手机级硬件 | 6–12 GB LPDDR5，4–8 W持续热设计功耗，NPU为10–45 TOPS INT8<sup>[4](https://www.scirp.org/journal/paperinformation?paperid=151062)</sup> |
| 智能眼镜上约5 W运行7B INT4 | 不到2分钟即热饱和；持续吞吐量降至突发性能的30–50%<sup>[4](https://www.scirp.org/journal/paperinformation?paperid=151062)</sup> |
| 压缩失效模式 | 一个压缩变体保持了71%的严格BoolQ准确率，却将100个预测中的97个归入单一类别（平衡准确率52.6%）<sup>[5](https://arxiv.org/html/2608.15693v1)</sup> |

## 边缘AI是什么（以及不是什么）

该主题由约束条件定义，而非由模型定义。嵌入式部署需要规定推理时间不可超过的最大延迟阈值、以瓦或毫瓦计的功耗预算，以及涵盖模型存储和运行时RAM的内存占用。<sup>[6](https://www.mdpi.com/2079-9292/14/24/4877)</sup> 硬件跨越若干层级：普通微控制器提供不足1 TOPS的算力，配有256 KB至1 MB闪存用于权重、64 KB至512 KB RAM用于激活；NVIDIA Jetson AGX Orin可达275 TOPS，功耗预算从纽扣电池传感器上的微瓦级到工业边缘服务器上的25–50 W不等。<sup>[7](https://www.wasilzafar.com/pages/series/ai-in-the-wild/ai-wild-part21-edge-ai.html)</sup> Google Coral通过USB在2 W下提供4 TOPS（仅INT8），Jetson Orin Nano在5–15 W下提供40 TOPS；<sup>[15](https://www.sparkfun.com/nvidia-jetson-orin-nano-developer-kit.html)</sup> Edge TPU适合持续工作负载，而Jetson更低的空闲功耗适合间歇性任务。<sup>[7](https://www.wasilzafar.com/pages/series/ai-in-the-wild/ai-wild-part21-edge-ai.html)</sup><sup> • </sup><sup>[6](https://www.mdpi.com/2079-9292/14/24/4877)</sup>

**2026年的边界。** 如今被视为边缘的包括三个层级。纯端侧推理完全在手机、可穿戴设备或微控制器上运行。本地边缘服务在本地服务器或网关上运行模型，以增加一些延迟为代价换取更大的容量。混合模式正在涌现，例如边缘优先执行并以云端作为后备，或在紧凑的设备模型与更大的服务器模型之间共享投机解码。<sup>[1](https://link.springer.com/article/10.1007/s10462-026-11538-1)</sup> [Apple Intelligence](https://www.edgepedia.org/zh/apple-intelligence)（2024）是一种混合设计：它在可能时于设备上执行模型，并选择性地将较重请求交由私有云计算处理。<sup>[8](https://arxiv.org/html/2604.22906)</sup> 大型模型的数据中心服务不属于该主题，尽管它提供了评判边缘部署的质量基线。

## 推理为何向边缘迁移

延迟是最容易量化的驱动因素。实时交互要求运动到光子的延迟低于20 ms，而往返网络传输往往超过这一阈值。<sup>[4](https://www.scirp.org/journal/paperinformation?paperid=151062)</sup> 实践中，端侧推理耗时数毫秒至数十毫秒，而云端API则需数百毫秒至数秒，并且端侧推理消除了对互联网的依赖。<sup>[9](https://www.youngju.dev/blog/ai/2026-03-17-edge-ai-on-device-ml-guide.en)</sup> 在系统层面，混合边缘微服务架构相比单体方案实现了低46%的P99延迟和高67%的吞吐量，在100 ms延迟约束下支持10,000并发用户，同时将带宽消耗降低99.5%。<sup>[10](https://acnsci.org/journal/index.php/jec/article/view/1000)</sup>

隐私源于将数据保留在设备上：本地推理可实现数据最小化、目的限制和受控保留，从而支持GDPR和HIPAA合规。<sup>[1](https://link.springer.com/article/10.1007/s10462-026-11538-1)</sup> 相比之下，以云为中心的推理增加了敏感用户内容的隐私暴露，在网络抖动下服务不稳定，并产生持续的带宽和云计算成本，难以扩展至数十亿用户。<sup>[1](https://link.springer.com/article/10.1007/s10462-026-11538-1)</sup> 在成本方面，云端API按调用计费，而端侧模型是一次性成本。<sup>[9](https://www.youngju.dev/blog/ai/2026-03-17-edge-ai-on-device-ml-guide.en)</sup> 能耗也可能有利于边缘：对于高度优化的模型，5G/WiFi传输的能耗成本往往超过本地计算。<sup>[4](https://www.scirp.org/journal/paperinformation?paperid=151062)</sup>

## 模型如何为边缘做好准备

**量化。** 在32位浮点精度下，一个70亿参数的模型占用约28 GB，而一个1750亿参数的模型可能需要数百GB，远超典型终端设备。<sup>[1](https://link.springer.com/article/10.1007/s10462-026-11538-1)</sup> 用INT8或INT4替代32位浮点可将内存占用降至原来的1/4–1/8，并在具有优化整数单元的硬件上加速运算。<sup>[11](https://basicsof.ai/article/edge-ai-on-device)</sup> 由于权重和激活以更少的字节存储和移动，量化同时降低了内存使用和每次操作的字节移动量，这在带宽受限的设备上至关重要。其谱系很重要：ZeroQuant（2022）开创了逐组权重量化与逐token INT8激活量化，[LLM.int8](https://www.edgepedia.org/zh/llm-int8)()（2022）通过将一小部分激活以更高精度路由来处理离群激活。<sup>[8](https://arxiv.org/html/2604.22906)</sup>

[训练后量化](https://www.edgepedia.org/zh/post-training-quantization)（PTQ）在训练后使用小型校准集校准权重和激活，不更新权重；量化感知训练则在训练期间注入量化效应，使模型适应低位算术。<sup>[1](https://link.springer.com/article/10.1007/s10462-026-11538-1)</sup><sup> • </sup><sup>[12](https://ar5iv.labs.arxiv.org/html/2204.11786)</sup> 来自证据的经验法则：当适度压缩且精度损失有限即可满足需求时使用PTQ，而当需要在保持精度的同时实现大幅更高的缩减时，则采用QAT或联合优化。<sup>[6](https://www.mdpi.com/2079-9292/14/24/4877)</sup> 良好PTQ的质量代价如今很小且可测量：[Llama](https://www.edgepedia.org/zh/llama-model-family)-2-7B在3比特精度下（组大小128，约2.8 GB）的WikiText-2困惑度退化小于0.15，而FP16基线为5.47；而同比特宽度下朴素就近取整量化则导致模型崩溃，困惑度超过100（在[NVIDIA A100](https://www.edgepedia.org/zh/nvidia-a100)上测得）。<sup>[4](https://www.scirp.org/journal/paperinformation?paperid=151062)</sup> 对于小型模型，Qwen3.5 0.8B在Q5_K_M GGUF量化下达到93.85 SQuAD F1和92精确匹配。<sup>[5](https://arxiv.org/html/2608.15693v1)</sup>

**剪枝。** 实证研究表明，剪枝可将参数数量缩减约75%而精度损失很小，剪枝与PTQ结合可在MCU级设备上实现接近90%的存储缩减。<sup>[2](https://dl.acm.org/doi/pdf/10.1145/3827611)</sup> 结构化剪枝移除整个滤波器或通道，能很好地映射到CMSIS-NN和TensorRT等工具链所支持的NPU、VPU和DSP，而非结构化剪枝最大化压缩，但需要专用稀疏内核，工具支持参差不齐。<sup>[2](https://dl.acm.org/doi/pdf/10.1145/3827611)</sup> 然而对于语言模型，剪枝是更昂贵的工具：与量化相同精度下的结构化剪枝，在Qwen3.5上仅1%的剪枝比例就损失16个SQuAD F1点，GPU SQuAD F1在7.03%剪枝时从84.08降至最低21.63，而LoRA恢复在3.01%剪枝时将最佳剪枝CPU结果从40.03提升至65.51。<sup>[5](https://arxiv.org/html/2608.15693v1)</sup> 对于分割模型，情况则相反：剪枝在mIoU几乎不变的情况下将模型大小缩减近80%，而量化则使参数和乘加计数保持不变。没有单一的压缩技术能在所有任务中胜出。<sup>[5](https://arxiv.org/html/2608.15693v1)</sup>

**作为一等子系统的KV缓存。** 在自回归解码期间，KV缓存和激活张量消耗大量额外内存和I/O带宽，直接增加延迟和能耗。<sup>[1](https://link.springer.com/article/10.1007/s10462-026-11538-1)</sup> 最近的一种评估协议A-L-E-M（准确率、延迟、能耗、内存）在1–4B参数模型上实例化，建议通过分页、压缩和逐出将KV缓存视为受管理的子系统，首先应用量化以改善内存和首token时间，并将结构化剪枝与可合并的低秩补偿配对。<sup>[1](https://link.springer.com/article/10.1007/s10462-026-11538-1)</sup> 延迟以首token时间和稳态每秒token数衡量；能耗以[MLPerf Mobile](https://www.edgepedia.org/zh/mlperf-mobile)等协议下的每token焦耳数衡量。<sup>[1](https://link.springer.com/article/10.1007/s10462-026-11538-1)</sup>

**主要指标所掩盖的失效模式。** 结构化剪枝可能因破坏k-quant超级块对齐而使部署产物膨胀21–49%；再加上更长、格式合规性更差的输出，这使[树莓派](https://www.edgepedia.org/zh/raspberry-pi)延迟增加多达3.4倍。<sup>[5](https://arxiv.org/html/2608.15693v1)</sup> 在18对匹配的基线与剪枝运行中，增加的延迟集中在解码阶段：剪枝模型生成多达2.7倍的token（Gemma），且一旦k-quant对齐被破坏，每个token的成本更高。<sup>[5](https://arxiv.org/html/2608.15693v1)</sup> 最严重的是，在BoolQ上发现了一种先验崩溃失效模式：一个经LoRA恢复的压缩变体保持完全可解析并保持71%的严格准确率，却将100个预测中的97个归入单一类别，平衡准确率为52.6%。压缩可以掩盖退化能力，使其隐藏在看似健康的主要指标得分背后。<sup>[5](https://arxiv.org/html/2608.15693v1)</sup>

## 小模型家族与2024–2026年的转变

从2024年起，参数范围在数亿至数十亿的小型语言模型在消费级硬件上变得真正有用，使边缘AI超越了CNN时代的TinyML工作负载类别。<sup>[3](https://derekmolloy.ie/from-tinyml-to-tiny-language-models-the-state-of-edge-ai-in-2026/)</sup> 具名的家族包括：

- [Gemini Nano](https://www.edgepedia.org/zh/gemini-nano)在受支持的手机（如Pixel 8 Pro）上于Android的AICore内本地运行，具有1.8B和3.25B变体，专为低延迟端侧任务设计（厂商报告）。<sup>[8](https://arxiv.org/html/2604.22906)</sup>
- Apple Intelligence（2024）随iPhone、iPad和Mac出货，在可能时于设备上执行模型，并选择性地将较重请求交由私有云计算处理（厂商报告）。<sup>[8](https://arxiv.org/html/2604.22906)</sup>
- Llama 3.2推出了面向移动优化的1B和3B变体，针对边缘和手机使用，高通和Meta宣布支持在骁龙驱动的手机和PC上运行Llama模型（厂商报告）。<sup>[8](https://arxiv.org/html/2604.22906)</sup>
- 微软的Phi系列证明了数据质量可以替代单纯的规模；Phi-4-mini级别约为3.8B参数，推理分数却异常出色。<sup>[3](https://derekmolloy.ie/from-tinyml-to-tiny-language-models-the-state-of-edge-ai-in-2026/)</sup>
- Google的Gemma边缘聚焦的“E”标识变体（约2B和4B有效参数）使用逐层嵌入将运行时内存削减至远低于参数数量所暗示的水平，是Google [LiteRT](https://www.edgepedia.org/zh/litert)-LM栈的参考目标。<sup>[3](https://derekmolloy.ie/from-tinyml-to-tiny-language-models-the-state-of-edge-ai-in-2026/)</sup>
- 阿里巴巴的Qwen小型系列提供从0.8B到9B（2026年初）的尺寸，面向从IoT设备到本地服务器的场景。<sup>[3](https://derekmolloy.ie/from-tinyml-to-tiny-language-models-the-state-of-edge-ai-in-2026/)</sup>

在运行时方面，LiteRT（原TensorFlow Lite）是Google用于跨Android、iOS、Linux和微控制器的端侧机器学习的运行时，具有CPU、GPU和NPU后端。<sup>[11](https://basicsof.ai/article/edge-ai-on-device)</sup> 对于LLM工作负载，llama.cpp及其生态（Ollama、LM Studio）是最成熟的跨平台运行时，而MLX是Apple生态的原生选择。<sup>[13](https://geniustechlab.com/posts/2026-06-23-edge-ai-inference-2026)</sup> 旗舰手机SoC如骁龙8 Gen 3和Apple A17 Pro搭载6–12 GB LPDDR5、4–8 W持续热设计功耗，NPU为10–45 TOPS INT8。<sup>[4](https://www.scirp.org/journal/paperinformation?paperid=151062)</sup> 以15 token/s运行3B模型约消耗3–5 W，30分钟对话约耗尽典型手机电池的5%。<sup>[14](https://henryndubuaku.github.io/maths-cs-ai-compendium/chapter%2017%3A%20AI%20inference/04.%20edge%20inference/)</sup>

## 边缘与云：内存墙与散热

能力上限由内存而非计算决定。端侧LLM推理的决定性挑战是内存子系统的“内存墙”，表现为两种形式：静态内存容量和动态内存带宽。<sup>[1](https://link.springer.com/article/10.1007/s10462-026-11538-1)</sup> 边缘部署面临“铁三角”：有限的内存带宽、严格的功耗预算（可穿戴设备往往低于2 W）以及热降频限制。<sup>[4](https://www.scirp.org/journal/paperinformation?paperid=151062)</sup> 一个1750亿参数的模型可能需要数百GB，因此无论怎样优化，最大的模型仍遥不可及；而一个3B Q4模型可容纳于2 GB，但KV缓存的增长通常将手机上的上下文长度限制在2–4K token。<sup>[1](https://link.springer.com/article/10.1007/s10462-026-11538-1)</sup><sup> • </sup><sup>[14](https://henryndubuaku.github.io/maths-cs-ai-compendium/chapter%2017%3A%20AI%20inference/04.%20edge%20inference/)</sup>

散热约束持续使用。连续生成30秒后，手机SoC会降低时钟频率，性能下降30–50%。<sup>[14](https://henryndubuaku.github.io/maths-cs-ai-compendium/chapter%2017%3A%20AI%20inference/04.%20edge%20inference/)</sup> 可穿戴设备上的约束更为严峻：连续运行7B模型推理（Llama-2-7B，INT4，批大小1）约消耗5 W，不到2分钟即使智能眼镜的热容量饱和，触发硬性频率调节，使持续吞吐量降至初始突发性能的30–50%；可穿戴设备还有约42°C的皮肤温度上限，且仅有2–6 GB LPDDR。<sup>[4](https://www.scirp.org/journal/paperinformation?paperid=151062)</sup> 小模型（0.8B–1.1B参数，Q4_K_M下508–769 MB）的实测延迟显示，平均推理时间从GPU上的每样本0.13 s升至CPU上的0.61 s和树莓派上的8.91 s，从GPU到CPU约慢4.8倍，从GPU到树莓派约慢70倍。<sup>[5](https://arxiv.org/html/2608.15693v1)</sup>

压缩下的质量退化并不均匀。随着压缩变得更加激进（更低的比特宽度、更高的剪枝比例或更小的蒸馏学生模型），任务性能可能退化，且影响往往在任务间不均匀，对需要强事实性的提示影响最大。<sup>[8](https://arxiv.org/html/2604.22906)</sup> 边缘所换来的是隐私（数据留在设备上）、离线运行、可预测的延迟，以及一次性成本而非按调用计费；边缘优先/云端后备的混合设计让部署将常规流量保留在本地，同时将困难请求升级处理。<sup>[1](https://link.springer.com/article/10.1007/s10462-026-11538-1)</sup><sup> • </sup><sup>[9](https://www.youngju.dev/blog/ai/2026-03-17-edge-ai-on-device-ml-guide.en)</sup>

## References

1. On-device large language models: a survey of model compression and system optimization (Artificial Intelligence Review, Springer) — https://link.springer.com/article/10.1007/s10462-026-11538-1
2. Edge AI on Constrained Devices: A Survey of Deployment, Optimization, and Lifecycle Management (ACM TECS) — https://dl.acm.org/doi/pdf/10.1145/3827611
3. From TinyML to Tiny Language Models: the State of Edge AI in 2026 (derekmolloy.ie) — https://derekmolloy.ie/from-tinyml-to-tiny-language-models-the-state-of-edge-ai-in-2026/
4. Edge-Centric Generative AI: A Survey on Efficient Inference for Large Language Models in Resource-Constrained Environments (SCIRP) — https://www.scirp.org/journal/paperinformation?paperid=151062
5. Large Models for Small Devices: Recent Advances and Empirical Analysis of Edge AI Deployment (arXiv) — https://arxiv.org/html/2608.15693v1
6. Edge AI in Practice: A Survey and Deployment Framework for Neural Networks on Embedded Systems (Electronics, MDPI) — https://www.mdpi.com/2079-9292/14/24/4877
7. Edge AI & On-Device Intelligence — AI in the Wild Series Part 21 — https://www.wasilzafar.com/pages/series/ai-in-the-wild/ai-wild-part21-edge-ai.html
8. Network Edge Inference for Large Language Models: Principles, Techniques, and Opportunities (arXiv) — https://arxiv.org/html/2604.22906
9. Edge AI and On-Device ML Complete Guide (youngju.dev) — https://www.youngju.dev/blog/ai/2026-03-17-edge-ai-on-device-ml-guide.en
10. Edge intelligence unleashed: a survey on deploying large language models in resource-constrained environments (Journal of Edge Computing) — https://acnsci.org/journal/index.php/jec/article/view/1000
11. Edge AI and On-Device Inference (basicsof.ai) — https://basicsof.ai/article/edge-ai-on-device
12. Enable Deep Learning on Mobile Devices: Methods, Systems, and Applications (arXiv) — https://ar5iv.labs.arxiv.org/html/2204.11786
13. Edge AI Inference in 2026: Running Production LLMs On-Device Without the Cloud (geniustechlab.com) — https://geniustechlab.com/posts/2026-06-23-edge-ai-inference-2026
14. Edge Inference — Maths, CS & AI Compendium — https://henryndubuaku.github.io/maths-cs-ai-compendium/chapter%2017%3A%20AI%20inference/04.%20edge%20inference/
15. Nvidia jetson orin nano developer kit (sparkfun.com). https://www.sparkfun.com/nvidia-jetson-orin-nano-developer-kit.html

---
*Initially written Sep 17, 2026 · Reviewed: Sep 30, 2026 · Edited: Sep 30, 2026; Oct 11, 2026 · Last review: Sep 30, 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/edge-ai

English original: https://www.edgepedia.org/edge-ai
