TwinShield让大模型在不信任云端安全运行,兼顾数据与模型双重防护。
Securing Transformer-based AI Execution via Unified TEEs and Crypto-protected Accelerators
- 将注意力和SoftMax等关键操作安全外包给显卡,减少可信环境负担
- 计算量87%可外接加速,速度比旧方法快4.0至6.1倍
- 适合部署于云服务中的大模型推理场景,保障隐私与性能
Transformer模型(如大语言模型)在诸多人工智能任务中取得突破,被广泛应用于安全敏感领域。由于其规模庞大且研发成本高昂,这些模型已成为重要的知识产权,并越来越多通过机器学习即服务(MLaaS)方式部署。然而,MLaaS通常运行在不可信的云基础设施上,导致数据与模型面临泄露风险。主流保护机制依赖可信执行环境(TEEs),利用硬件加密和完整性验证保障数据机密性与完整性。但将推理完全置于TEEs内会导致显著性能下降,尤其在大语言模型中更为严重。近期研究提出将部分推理操作卸载至不可信加速器(如GPU)的混合方案,具有潜力。然而,现有方案无法安全地卸载关键操作——注意力机制与SoftMax层,迫使这些计算仍留在TEEs内。为此,我们提出TwinShield框架,实现异构TEEs与加速器系统下的安全Transformer推理,同时保护数据与模型。TwinShield可将约87%的计算卸载至GPU,在多种Transformer模型上相较此前方法获得4.0x–6.1x的加速效果。
原文摘要 · Abstract (English)
Recent advances in Transformer models, e.g., large language models (LLMs), have brought tremendous breakthroughs in various artificial intelligence (AI) tasks, leading to their wide applications in many security-critical domains. Due to their unprecedented scale and prohibitively high development cost, these models have become highly valuable intellectual property for AI stakeholders and are increasingly deployed via machine learning as a service (MLaaS). However, MLaaS often runs on untrusted cloud infrastructure, exposing data and models to potential breaches. Mainstream protection mechanisms leverage trusted execution environments (TEEs) where confidentiality and integrity for secretive data are shielded using hardware-based encryption and integrity checking. Unfortunately, running model inference entirely within TEEs is subject to non-trivial slowdown, which is further exacerbated in LLMs due to the substantial computation and memory footprint involved. Recent studies reveal that the hybrid TEE-based scheme offloading partial model inference operations to the untrusted accelerators (e.g., GPU) is a promising solution. However, prior offloading schemes fail to ensure dual protection of data and model in Transformer inference, as they cannot securely offload critical operations, i.e., Attention and SoftMax, forcing these computations to remain confined within TEEs. To address these challenges, we propose TwinShield, a framework enabling secure Transformer inference in heterogeneous TEE and accelerator systems with dual protection for both model and data. TwinShield offloads ~87% of computation to GPUs and delivers 4.0x - 6.1x speedups over previous approaches across various Transformer models.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。