SecureInfer: Heterogeneous TEE-GPU Architecture for Privacy-Critical Tensors for Large Language Model Deployment
Tushar Nayan, Ziqi Zhang, Ruimin Sun
TL;DR
SecureInfer presents a hybrid TEE-GPU framework that protects privacy-critical components of transformer-based LLMs deployed on edge devices by partitioning the model: sensitive nonlinear parts, including Q/K/V projections, attention scores, FFN blocks, and LoRA adapters, run inside an SGX enclave, while linear matrix operations are computed on the GPU with encryption and secure restoration. The design uses information-theoretic and threat-informed partitioning, memory-aware techniques (chunked transfers, XOR encryption, one-time pad masking), and a component-placement strategy that balances security with performance. Prototype experiments with a customized LLaMA-2 model on an edge-like platform show SecureInfer achieves substantial improvements over TEE-only inference (up to several-fold speedups) and competitive latency relative to GPU-only runs, while delivering strong resistance to model-extraction attacks and preserving output fidelity. These results demonstrate a practical path toward secure on-device LLM inference under realistic resource and privacy constraints, enabling privacy-preserving edge AI applications.
Abstract
With the increasing deployment of Large Language Models (LLMs) on mobile and edge platforms, securing them against model extraction attacks has become a pressing concern. However, protecting model privacy without sacrificing the performance benefits of untrusted AI accelerators, such as GPUs, presents a challenging trade-off. In this paper, we initiate the study of high-performance execution on LLMs and present SecureInfer, a hybrid framework that leverages a heterogeneous Trusted Execution Environments (TEEs)-GPU architecture to isolate privacy-critical components while offloading compute-intensive operations to untrusted accelerators. Building upon an outsourcing scheme, SecureInfer adopts an information-theoretic and threat-informed partitioning strategy: security-sensitive components, including non-linear layers, projection of attention head, FNN transformations, and LoRA adapters, are executed inside an SGX enclave, while other linear operations (matrix multiplication) are performed on the GPU after encryption and are securely restored within the enclave. We implement a prototype of SecureInfer using the LLaMA-2 model and evaluate it across performance and security metrics. Our results show that SecureInfer offers strong security guarantees with reasonable performance, offering a practical solution for secure on-device model inference.
