FlexServe: A Fast and Secure LLM Serving System for Mobile Devices with Flexible Resource Isolation
作者: Yinpeng Wu, Yitong Chen, Lixiang Wang, Jinyu Gu, Zhichao Hua, Yubin Xia
分类: cs.CR, cs.LG, cs.OS
发布日期: 2026-07-05
💡 一句话要点
提出FlexServe以解决移动设备LLM推理的安全与效率问题
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 大型语言模型 移动设备 安全推理 资源隔离 ARM TrustZone 内存管理 多模型调度 推理加速
📋 核心要点
- 现有的LLM推理方法在安全性和效率上存在显著不足,尤其是在移动设备上,攻击者可能通过操作系统内核的漏洞窃取敏感数据。
- 本文提出FlexServe,通过灵活资源隔离机制实现内存和NPU的高效切换,从而在TrustZone的安全环境中加速LLM推理。
- 实验结果表明,FlexServe在Time to First Token(TTFT)上相比于基线设计平均提升了10.05倍,且在多模型工作流中实现了最高24.30倍的加速。
📝 摘要(中文)
随着设备端大型语言模型(LLMs)的快速发展,相较于云端LLMs,设备端提供了更高的隐私性和可用性。然而,在LLM推理过程中,模型权重和用户数据的安全性面临威胁,攻击者可能通过破坏操作系统内核来窃取这些信息。ARM TrustZone作为移动设备的硬件隔离技术,虽然可以保护敏感应用,但在LLM推理中由于内存和NPU的隔离不灵活,导致显著的性能开销。为了解决这些挑战,本文提出了FlexServe,一个快速且安全的LLM服务系统,采用灵活资源隔离机制构建灵活安全内存(Flex-Mem)和灵活安全NPU(Flex-NPU),实现了内存页和NPU在保护模式与非保护模式之间的高效切换。通过设计LLM感知内存管理和安全推理管道,FlexServe显著加速了推理过程。
🔬 方法详解
问题定义:本文旨在解决移动设备上LLM推理过程中的安全性和效率问题,现有方法在使用ARM TrustZone时存在显著的性能开销,且隔离机制不够灵活。
核心思路:FlexServe通过引入灵活资源隔离机制,构建灵活安全内存(Flex-Mem)和灵活安全NPU(Flex-NPU),使得内存和NPU能够在保护模式与非保护模式之间高效切换,从而提升推理效率和安全性。
技术框架:FlexServe的整体架构包括灵活资源隔离机制、LLM感知内存管理和安全推理管道。该框架在TrustZone的安全世界中运行,确保了数据的安全性和推理的高效性。
关键创新:FlexServe的主要创新在于灵活资源隔离机制的设计,使得内存和NPU的保护模式切换更加灵活高效,显著降低了推理过程中的性能开销。
关键设计:在设计中,FlexServe采用了多模型调度器来优化多模型工作流,并通过安全推理管道加速推理过程,确保在不同模型间的高效切换。
🖼️ 关键图片
📊 实验亮点
实验结果显示,FlexServe在Time to First Token(TTFT)上相比于传统TrustZone设计平均提升了10.05倍,且在优化设计下的TTFT提升达2.44倍。在多模型工作流中,FlexServe的端到端速度提升最高可达24.30倍,显示出其在实际应用中的显著优势。
🎯 应用场景
FlexServe的研究成果在移动设备上具有广泛的应用潜力,尤其是在需要高隐私保护和实时响应的场景,如智能手机助手、移动医疗和个性化推荐系统等。其高效的推理能力和安全性将推动更多智能应用的落地,提升用户体验。
📄 摘要(原文)
Device-side Large Language Models (LLMs) have witnessed explosive growth, offering higher privacy and availability compared to cloud-side LLMs. During LLM inference, both model weights and user data are valuable, and attackers may even compromise the OS kernel to steal them. ARM TrustZone is the de facto hardware-based isolation technology on mobile devices, used to protect sensitive applications from a compromised OS. However, protecting LLM inference with TrustZone incurs significant overhead due to its inflexible isolation of memory and the NPU. To address these challenges, this paper introduces FlexServe, a fast and secure LLM serving system for mobile devices. It first introduces a Flexible Resource Isolation mechanism to construct Flexible Secure Memory (Flex-Mem) and Flexible Secure NPU (Flex-NPU). Both memory pages and the NPU can be efficiently switched between unprotected and protected modes. Based on these mechanisms, FlexServe designs a fast and secure LLM inference framework within TrustZone's secure world. The LLM-Aware Memory Management and Secure Inference Pipeline are introduced to accelerate inference. A Multi-Model Scheduler is proposed to optimize multi-model workflows. We implement a prototype of FlexServe and compare it with two TrustZone-based strawman designs. The results show that FlexServe achieves an average $10.05\times$ speedup in Time to First Token (TTFT) compared to the strawman, and an average $2.44\times$ TTFT speedup compared to an optimized strawman with pipeline and secure NPU enabled. For multi-model agent workflows, the end-to-end speedup is up to $24.30\times$ and $4.05\times$ compared to the strawman and optimized strawman, respectively.