Manuscript Offprint

arXiv:2608.26651

Beyond Vector Hiding: Breaking and Mitigating Shared-Direction Weight Obfuscation in TEE-Offloaded Large Language Models

Menghui Zhang, Aoying Zheng, Guoxiao Liu, Zizhuang Deng, Jiejing Wen, Jincheng Zhuang, Ran Tao

Abstract

Trusted Execution Environment (TEE)-shielded partitioning of Large Language Models (LLMs) accelerates on-device inference by offloading obfuscated linear layers to an untrusted accelerator while retaining only a small correction inside the TEE. However, earlier lightweight obfuscation schemes preserved weight-vector directions and were broken by ArrowMatch. To defend against this attack, ArrowCloak injects scalar multiples of the same hidden direction into all weight vectors, enabling lightweight trusted correction.

We show that this reuse leaves a rank-one relation across the complete accelerator-visible matrix. For the released real-valued scheme, we propose SPECTRALLEAK, which estimates and removes the shared component. Across 12 task settings, its surrogates achieve 87.98% mean accuracy versus 89.85% for the victims. In our defense-favorable mod-Q realization of ArrowCloak's published modular security formulation, mod-Q arithmetic suppresses this spectral signal but retains the algebraic rank-one relation modulo Q. We therefore propose LATTICELEAK, which exploits the resulting hidden lattice. In our BERT-Base and GPT2-Base experiments, it reconstructs every protected fixed-point parameter exactly; across all evaluated architectures, the reconstructed models retain victim-level task accuracy without victim queries, labels, or fine-tuning.

These findings identify shared rank-one reuse as the root cause of the leakage exploited by our attacks. Guided by this insight, we design BUTTERFLYCLOAK, a keyed maximal-rank butterfly mask that replaces the reused direction with distinct mask rows while retaining fast trusted correction. In our full-BERT evaluation, protection leaves task accuracy unchanged (91.6284% before and after), reduces ArrowMatch recovery to near-random levels, and prevents LATTICELEAK. For a square n×nn \times n layer with ℓ\ell input activations, its trusted correction costs O(nℓlog⁡n)O(n\ell \log n), only a logarithmic factor above ArrowCloak's O(nℓ)O(n\ell) correction and asymptotically below dense masking's O(n2ℓ)O(n^2\ell) cost.

1 Introduction

As Large Language Models (LLMs) are increasingly deployed on smartphones, personal computers, and other edge devices, protecting proprietary model weights has become an important security problem. Model weights embody substantial investments in data collection, training, and task-specific adaptation, and therefore constitute valuable intellectual property. In cloud deployment, users typically have only black-box access through an input–output interface. In on-device deployment, however, the model runs on a user-controlled device, potentially exposing its files, memory, and execution process. Prior studies have shown that model weights can be extracted from on-device applications, device memory, or data transfers [19, 23, 30, 41, 46]. Related attacks recover model architectures or protected inputs through shared resources and ciphertext side channels [39, 42], while black-box and transfer-learning attacks demonstrate that public interfaces can also enable functional or parameter recovery [2, 10, 21, 32, 35]. On-device model protection therefore aims to prevent restricted black-box access from becoming direct white-box access to proprietary weights. Trusted Execution Environments (TEEs) can isolate model weights and sensitive computation from the rest of the device. However, their limited memory and computation make full-model execution expensive. TEE-shielded model partitioning addresses this limitation by offloading computation-intensive linear layers to an untrusted accelerator while retaining only lightweight correction inside the TEE [15, 18, 31, 44]. Research on GPU and accelerator TEEs seeks to enlarge the trusted computing base [27, 33, 36]; nevertheless, partitioned execution remains attractive when the accelerator is outside the trusted boundary or when trusting the complete accelerator is too costly. Because the accelerator must receive the weights required for computation, these systems obfuscate the weights before offloading them and recover the correct outputs inside the TEE. The central challenge is to hide the original weights while keeping the in-TEE output correction lightweight, thereby preserving the efficiency benefits of computation offloading.

∗^{*}Equal contribution. †^{\dagger}Corresponding authors.

Figure

Figure 1: The security–efficiency evolution studied in this paper. Earlier lightweight transformations preserve vector directions; ARROWCLOAK blocks that leakage by reusing one hidden direction, but the reuse creates a global rank-one invariant. Our two attacks expose its real and finite-field views, and BUTTERFLYCLOAK explores a maximal-rank repair. Cost labels use the square-layer shorthand m=d=nm = d = n.

Existing schemes face a clear tension between security and efficiency. Lightweight permutation, scaling, and channel-wise transformations require only O(nℓ)O(n\ell) trusted correction, but preserve weight-vector directions [16,25,28,29,38]. Active weight-obfuscation defenses can also perturb selected parameters, but must preserve model utility and efficient inference [45]. More expressive schemes such as GroupCover [43] can change vector directions, but incur substantially higher trusted computation. ArrowMatch [37] showed that the former lightweight schemes can be broken by matching the directions of exposed private-model vectors to those of a public pre-trained model. Because private models are commonly fine-tuned from public checkpoints, corresponding weights often retain exploitable structure [2, 10, 35]; the recovered correspondences can therefore be used to construct functional surrogate models. To defend against ArrowMatch, ArrowCloak [37] injects the same hidden direction into every private weight vector using different coefficients, followed by scaling and permutation, and establishes a reduction to Learning With Errors (LWE) problem [24]. This shared component disrupts per-vector direction matching while retaining O(nℓ)O(n\ell) trusted correction. When vectors are considered independently, ArrowCloak therefore appears to provide both direction protection and lightweight overhead. However, we find that hiding individual weight vector directions does not protect the complete weight matrix. Because ArrowCloak injects the same hidden direction into all vectors, this reuse leaves a shared rank-one relation in the complete matrix. In row notation, the transformation is Y=P(D+rk⊤)WY = P(D + rk^\top)W, where WW is the private weight matrix, DD is diagonal, PP is a permutation, and rk⊤rk^\top captures the shared rank-one reuse. This relation remains in both the real-valued implementation of ArrowCloak and its modular variant.

For the original ArrowCloak over the reals, we propose SPECTRALLEAK, which removes the shared component and recovers surrogate models that nearly match victim-model utility. Across 12 task settings covering 4 models and 7 datasets, the recovered models achieve 87.98% mean accuracy, compared with 89.85% for the victims. A separate scale extension to Qwen3-8B, Llama-3.1-8B, and Gemma-4-E2B obtains 96.22–96.56% without public-data refinement, at most 0.34 percentage points from the corresponding victims. Although field-wide mod-Q arithmetic defeats SPECTRALLEAK, the underlying rank-one relation remains. We therefore propose LATTICELEAK for the modular variant. In our BERT-Base and GPT2-Base experiments, LATTICELEAK reconstructs every protected fixed-point parameter exactly. It also restores victim-level accuracy in the evaluated ViT and GPT2-XL settings. The algebraic attack requires no victim queries, labels, or fine-tuning. These findings identify shared rank-one reuse as the root cause of the leakage. Guided by this insight, we further design BUTTERFLYCLOAK, a keyed maximal-rank butterfly mask that removes rank-one reuse without dense TEE computation. It leaves full-BERT accuracy unchanged. Across the three larger models, it suppresses the tested spectral and correspondence attacks and keeps simulated protected accuracy within 0.23 percentage points of the victim. For an m×dm \times d layer, its trusted correction costs O(ℓmax⁡{m,d}log⁡d)O(\ell \max\{m, d\} \log d), compared with ArrowCloak's O(ℓ(m+d))O(\ell(m+d)) and dense masking's O(ℓmd)O(\ell md).

Figure 1 summarizes this evolution: earlier lightweight schemes preserve weight-vector directions; ArrowCloak blocks this directional leakage but introduces shared rank-one reuse; SPECTRALLEAK and LATTICELEAK expose this structure over the reals and finite fields, respectively; and BUTTERFLYCLOAK eliminates the root cause of the leakage.

Two recent concurrent preprints also analyze ArrowCloak. MOSAIC [3] questions ArrowCloak’s claimed security reduction to LWE. After we registered our USENIX Security submission on August 18, 2026, another concurrent preprint was submitted to arXiv on August 21, 2026, introducing ArrowRevelio, an SVD-based attack against ArrowCloak’s released real-valued implementation [17]. Compared with these concurrent works, we study ArrowCloak in both settings: we propose a PCA attack against its original implementation over the reals and use lattice reduction to attack its modular formulation. In addition, we design a mitigation against these attacks.

Our contributions are summarized as follows:

• Matrix-level leakage. We identify shared rank-one reuse as the root cause of information leakage in both Arrow-Cloak and its modular variant, showing that security must be analyzed over the complete accelerator-visible matrix rather than individual vectors.

• Attacks across arithmetic settings. We propose SPEC-TRALLEAK for the real-valued scheme, recovering surrogates with 87.98% mean accuracy versus 89.85% for the victims across 12 task settings and extending to three 5.1–8.2B-parameter models without refinement. We further propose LATTICELEAK for the modular variant; it exactly reconstructs all protected fixed-point parameters for BERT-Base and GPT2-Base and restores victim-level utility across the evaluated BERT, ViT, GPT2-Base, and GPT2-XL settings without victim queries, labels, or fine-tuning.

• Mitigation of rank-one reuse. We design BUTTERFLYCLOAK, a keyed maximal-rank butterfly mask that eliminates shared rank-one reuse. On full BERT it suppresses all evaluated attacks, including LATTICELEAK. On three larger language models it preserves utility and suppresses the tested spectral and correspondence attacks, with O(ℓmax⁡{m,d}log⁡d)O(\ell \max\{m, d\} \log d) trusted correction.

References (42)

  • Food-101—mining discriminative components with random forests
  • Teacher model fingerprinting attacks against transfer learning
  • Mosaic: Masked outsourcing of secure ai computations (opens arXiv in a new tab)
  • Sphere Packings, Lattices and Groups
  • Learning fast algorithms for linear transforms using butterfly factorizations
  • BERT: Pre-training of deep bidirectional transformers for language understanding
  • An image is worth $16 \times 16$ words: Transformers for image recognition at scale
  • Gemma 4 Technical Report
  • The Llama 3 Herd of Models
  • Recovering the pre-fine-tuning weights of generative models
  • Principal component analysis: A review and recent developments
  • Factoring polynomials with rational coefficients
  • TEESlice: Protecting sensitive neural network models in trusted execution environments when attackers have pre-trained models
  • TransLinkGuard: Safeguarding transformer models against model stealing in edge deployment
  • Hiding directions, leaking structure: Breaking ArrowCloak through Low-Rank structure (opens arXiv in a new tab)
  • DarkneTZ: Towards model privacy at the edge using trusted execution environments
  • SoK: All you need to know about on-device ML model extraction—the gap between research and practice
  • The two faces of lattices in cryptology
  • Knockoff nets: Stealing functionality of black-box models
  • Language models are unsupervised multitask learners
  • DeepSteal: Advanced model extractions leveraging efficient weight stealing in memories
  • SOTER: Guarding black-box inference for general neural networks at the edge
  • Adjustment of an inverse matrix corresponding to a change in one element of a given matrix
  • ACAI: Protecting accelerator execution with Arm confidential computing architecture
  • TSQP: Safeguarding real-time inference for quantization neural networks on edge devices
  • ShadowNet: A secure and efficient on-device model inference system for convolutional neural networks
  • Mind your weight(s): A large-scale study on insufficient machine learning model protection in mobile apps
  • Slalom: Fast, verifiable and private execution of neural networks in trusted hardware
  • Stealing machine learning models via prediction APIs
  • Graviton: Trusted execution environments on GPUs
  • GLUE: A multi-task benchmark and analysis platform for natural language understanding
  • With great training comes great vulnerability: Practical attacks against transfer learning
  • CAGE: Complementing Arm CCA with GPU extensions
  • Game of Arrows: On the (In-)security of weight obfuscation for On-Device TEE-Shielded LLM partition algorithms
  • Tempo: Confidentiality preservation in cloud-based neural network training
  • Cache telepathy: Leveraging shared resource attacks to learn DNN architectures
  • Qwen3 Technical Report
  • Hyper-Theft: Thieving model weights from TEE-shielded neural networks via ciphertext side channels
  • CipherSteal: Stealing input data from TEE-shielded neural networks with ciphertext side channels
  • GroupCover: A secure, efficient and scalable inference framework for on-device model protection based on TEEs
  • No privacy left outside: On the (In-)security of TEE-Shielded DNN partition for On-Device ML. In 45th IEEE Symposium on Security and Privacy (SP), pages 3327–3345, 2024
  • NNSplitter: An active defense solution for DNN model via automated weight obfuscation