LoRO: Real-Time on-Device Secure Inference for LLMs via TEE-Based Low Rank Obfuscation

Gaojian Xiong, Yu Sun, Jianhua Liu, Jian Cui, Jianwei LiuNeurIPS 2025

TL;DR

LoRO (Low-Rank Obfuscation) is a new framework for running Large Language Models (LLMs) securely on edge devices like phones or cars. By using clever low-rank matrix math and "factor multiplexing," it protects expensive model weights from being stolen while maintaining near-native inference speeds and zero accuracy loss.

What Problem Does This Paper Address?

Deploying LLMs on edge devices is a double-edged sword. It offers great privacy and low latency for the user, but it exposes the model owner’s intellectual property to "model stealing" attacks. Since LLMs cost millions to train, companies want to keep their weights a secret.

Edge deployment scenario and model stealing pipeline

The standard solution is to use a Trusted Execution Environment (TEE)—a secure "enclave" in a processor (like Intel SGX or ARM TrustZone). However, TEEs are slow and have very little memory. Existing TEE-based defenses usually take one of two paths:

  1. Full Shielding: Run everything in the TEE. This is secure but incredibly slow (often 100x slower than normal).
  2. Partial/Obfuscation Shielding: Obfuscate weights and run the heavy math on a standard GPU.

The authors discover that current obfuscation methods (like sparse masks or permutations) have a "statistical vulnerability." They introduce a new Model Stealing Attack with Prior (MSP) that uses publicly available pre-trained models to "guess" the obfuscation keys, effectively stealing the model despite the TEE protection.

Methods

LoRO introduces two primary innovations to provide "black-box" security at "white-box" speeds:

  1. Low Rank Mask: Instead of using a massive, dense $N \times N$ mask to hide weights (which would be too slow for a TEE to process), LoRO generates a dense mask $D$ using two low-rank factors ($D = BA$). Because of the properties of matrix multiplication, the TEE only needs to compute $xBA$, which reduces complexity from $O(n^3)$ to $O(n^2)$. This allows for a "dense" mask that completely hides the weight distribution without the massive latency penalty.
  2. Factors Multiplexing: LLMs have dozens of layers, and storing a unique mask for each would exceed the TEE’s tiny memory (often capped at 128MB), triggering "memory paging" which kills performance. LoRO stores a small set of "cornerstone factors" and randomly combines them to generate unique masks for every layer on the fly. This shrinks the memory footprint from gigabytes to just a few megabytes.
  3. Intermediate Protection: To prevent attackers from analyzing the data flowing between layers, LoRO uses One-Time Pads (OTP) for linear layers and permutation matrices to protect the sensitive Attention scores.

Datasets

The authors evaluated LoRO across a wide variety of tasks and architectures:

  • NLP Benchmarks: SQuAD (reading comprehension), GSM8k (math), Spider (code generation), and the GLUE suite (MNLI, SST-2, MRPC).
  • Computer Vision: CIFAR100 and Food101.
  • Models: RoBERTa, BART, ViT, Qwen2 (up to 7B), and LLaMA3 (up to 8B).

Key Insights and Ideas

  • The Distribution is the Leak: The "aha moment" regarding security is that previous methods failed because they didn't hide the statistical distribution of the weights. Even if you shuffle or slightly nudge weights, the underlying patterns remain. LoRO’s dense mask completely resets these statistics.
t-SNE visualization showing LoRO's effective obfuscation
  • Efficiency via Approximation: By treating the security mask as a low-rank approximation problem, the authors found a way to make the TEE do "heavy" security work using very "light" computation.
  • Plug-and-Play: Unlike many security frameworks, LoRO requires zero retraining and no changes to the model architecture. You can take a standard LLaMA3 model and "LoRO-fy" it for secure deployment immediately.

Key Results

  • Security: Against the new MSP attack, LoRO reduced the attacker's accuracy to 0.94x (essentially making the model a black box). In contrast, previous state-of-the-art (SOTA) methods allowed attackers to reach 3.37x higher accuracy.
  • Speed: LoRO introduces an average inference latency of only 1.49x compared to unprotected GPU inference. For context, "Full Shielding" in a TEE is 112x slower.
  • Memory Efficiency: For a 7B parameter model, LoRO reduced the secure memory requirement from 1.02 GB (which would crash most TEEs) to just 26 MB.
  • Accuracy: LoRO maintains 100% of the original model's accuracy, with only negligible (0.01%) fluctuations due to floating-point precision.

Limitations and Future Work

  • Side-Channel Attacks: The paper notes that TEEs are still potentially vulnerable to side-channel attacks (like timing or power analysis), which LoRO does not specifically address, as this is considered a separate hardware security domain.
  • Trusted GPUs: The current implementation focuses on standard TEEs (CPU-based) offloading to untrusted GPUs. The authors mention that while "Confidential Computing" GPUs exist, they are currently too expensive for widespread edge deployment.
  • Scaling: While tested up to 8B parameters, the authors note that as models grow even larger, the intermediate data sizes increase TEE computation time, which could eventually lead to higher latencies.

Summary updated

BibTeX
@inproceedings{xiong2025loro,
  author = {Gaojian Xiong and Yu Sun and Jianhua Liu and Jian Cui and Jianwei Liu},
  title = {{LoRO: Real-Time on-Device Secure Inference for LLMs via TEE-Based Low Rank Obfuscation}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=de07K7kreI},
}
Figure