BiShield-TEE: On the (In-)Security of Unilateral Weight Obfuscation in On-Device TEE-Shielded LLM Partition

Zhiyuan Wang, Yuezhi Zhou, Ziqi Zhang, Zhu Zhang, Zhixing Tan, Yongheng Deng

TL;DR

BiShield-TEE exposes a critical security flaw in current methods for protecting Large Language Models (LLMs) on edge devices: "unilateral" weight obfuscation is surprisingly easy to reverse-engineer. By introducing a "bilateral" framework that obfuscates both input and output dimensions, the authors achieve near-perfect protection while actually improving inference speed on real-world hardware.

What Problem Does This Paper Address?

Deploying proprietary LLMs directly on user devices (like smartphones) is great for latency and privacy, but it’s a nightmare for intellectual property. If an attacker has "white-box" access to the model weights, they can easily steal or reverse-engineer the model.

To solve this, researchers use Trusted Execution Environments (TEEs)—secure enclaves in a processor (like Intel SGX) that are isolated from the rest of the system. However, TEEs have very limited memory and compute power, making it impossible to run a full LLM inside them. The standard workaround is partitioned execution: offload the heavy matrix multiplications to the GPU while keeping a "secret key" (an obfuscation matrix) inside the TEE to scramble and unscramble the data.

The authors identify a fundamental vulnerability they call the Solution Determinacy Property (SDP). Most current defenses only scramble the output side of weight matrices (unilateral obfuscation). The authors prove that if an attacker knows the model was fine-tuned from a public checkpoint (a very common practice), they can use simple math to uniquely determine the secret key and recover the original model.

Methods

The paper contributes both a new attack and a new defense:

  1. The Attacks: The authors developed two specialized attacks to break state-of-the-art unilateral defenses:
  2. For GROUPCOVER: They use a clustering procedure to recover the block-diagonal structure of the secret key.
  3. For ARROWCLOAK: They use Principal Component Analysis (PCA) to extract a "shared mask" that the defense mistakenly leaves as a dominant spectral signal.
  4. The Defense (BiShield-TEE): To fix the SDP vulnerability, they propose bilateral obfuscation. Instead of scrambling just the output ($W_{obf} = WT$), they scramble both the input and output sides ($W_{obf} = T_l W T_r$).
Figure 1: Comparison of unilateral and bilateral ob- fuscation.

Technically, BiShield-TEE uses Householder matrices (which are their own inverse, making them very efficient for TEEs) combined with diagonal scaling. This creates an "ill-posed" problem for the attacker: there are infinitely many valid-looking keys, and the attacker has no way to tell which one is the real one.

Datasets

The authors evaluated their work across a wide range of models and tasks:

  • Vision: ViT-Base and ViT-Large on CIFAR-10, CIFAR-100, and Food-101.
  • Language Understanding: GPT2-Base on four GLUE tasks (SST2, QQP, QNLI, MNLI).
  • Reasoning & Instructions: Llama3.2-1B and 3B on GSM8K (math) and IFEval (instruction following).

Key Insights and Ideas

  • The "Aha" Moment on Security: Unilateral obfuscation is like a puzzle with only one possible solution. Bilateral obfuscation turns it into a puzzle where thousands of different arrangements look perfectly correct, hiding the true model among "Ambiguous Solutions."
  • Structural Leakage: Even if you make your secret key sparse or low-rank to save memory, that very structure becomes a "fingerprint" that attackers can exploit using tools like PCA or clustering.
  • Efficiency via Symmetry: By using Householder reflections, the TEE doesn't need to perform complex matrix inversions. It only needs to do simple vector-matrix products, which keeps the overhead low.
  • Implicit Cancellation: In the self-attention mechanism of Transformers, the authors cleverly design the obfuscation so that the "scrambling" factors on the Keys and Queries naturally cancel each other out during the dot-product, reducing the work the TEE has to do.
Figure 3: Overview of BISHIELD-TEE for self-attention layers.

Key Results

  • Breaking the Old Guard: The authors' attacks on existing schemes (GROUPCOVER and ARROWCLOAK) were devastatingly effective, reaching over 2.4× the accuracy of the black-box baseline, essentially recovering near-full model functionality.
  • Robust Protection: BiShield-TEE successfully confined attack accuracy to the black-box baseline (1.00×) across all tested models and datasets. Even "adaptive" attacks specifically designed to beat bilateral schemes failed.
  • Real-World Speedup: On actual hardware (Intel Xeon with SGX and an NVIDIA GPU), BiShield-TEE was significantly faster than its predecessors, achieving 1.70× speedup over GROUPCOVER and 1.46× over ARROWCLOAK. This is because its mathematical operations are simpler for the TEE to handle.

Limitations and Future Work

  • Hardware Specifics: The real-device evaluation was limited to Intel SGX. While the algorithm is general, performance on other TEEs like ARM TrustZone remains to be seen.
  • Quantization: The current design relies on floating-point algebraic relations. It doesn't yet support low-precision (INT8/INT4) quantized inference, which is common for edge deployment.
  • Side-Channels: The paper focuses on algorithmic security and does not account for hardware-level side-channel attacks (like timing or power analysis) against the TEE itself.
  • Dynamic Models: Future work could explore how to handle models that are updated on-device via federated learning or fine-tuning.

Summary updated

BibTeX
@inproceedings{wang2026bishield,
  author = {Zhiyuan Wang and Yuezhi Zhou and Ziqi Zhang and Zhu Zhang and Zhixing Tan and Yongheng Deng},
  title = {{BiShield-TEE: On the (In-)Security of Unilateral Weight Obfuscation in On-Device TEE-Shielded LLM Partition}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=PQQKAksTi4},
}
Figure