Manuscript Offprint
arXiv:2609.10117Understanding the Security Boundary of Obfuscation-based On-Device LLM Protection
Hanyi Zhou
Tsinghua University
Beijing, China
hy-zhou24@mails.tsinghua.edu.cn
Chenyang Li
Tsinghua University
Beijing, China
Ke Xu
Tsinghua University
Beijing, China
Yuanzhe Pang
Tsinghua University
Beijing, China
pangyz24@mails.tsinghua.edu.cn
Mingwei Xu
Tsinghua University
Beijing, China
Zhuotao Liu
Tsinghua University
Beijing, China
Abstract
Trusted Execution Environments (TEEs) offer a promising mechanism for safeguarding the intellectual property of on-device Large Language Models (LLMs). To overcome the inherent computational bottlenecks of TEEs, existing TEE-Shielded LLM Partition (TSLP) methods apply efficient obfuscation schemes to computationally intensive layers, offloading them to external GPUs while retaining only lightweight operations within the TEE. Although a growing body of TSLP-based approaches has emerged, these defense mechanisms remain largely heuristic. Consequently, some methods are proven vulnerable to certain specialized adversarial attacks designed to exploit their specific architectural implementations.
To overcome the limitations of these heuristic designs, this paper addresses a fundamental research question: can we establish common primitives to unify representative prior methodologies, characterize the security boundary of their compositions, and systematically extend them? To this end, we formalize a set of obfuscation primitives, defined as dual-tuples of linear computations satisfying specific algebraic properties. We demonstrate that the matrix-level weight transformations of the representative efficient TSLP frameworks studied in this paper can be expressed as compositions of these primitives; consequently, the canonical form of these primitive compositions, denoted as , characterizes the structural boundary of this primitive family. We then expose the vulnerabilities of through a novel primitive-guided attack methodology, COLLAPSE, demonstrating a shared vulnerability in several prominent TSLP methods published in top-tier venues, such as ArrowCloak (Security'25), TSQP (S&P'25), and LoRO (NeurIPS'25). Finally, we introduce two novel obfuscation primitives and integrate them with existing constructs to formulate , extending this security boundary.
Keywords
On-Device LLM Protection, Trusted Execution Environment, Weight Obfuscation, Model Stealing
Compared to cloud-based LLM serving, a local adversary could obtain white-box visibility into code, parameters, memory, and intermediate activations of the on-device LLMs that the cloud-based APIs would never expose, resulting in model-extraction [3, 12, 13, 19, 20, 34] and privacy attacks [7, 27, 38].
Trusted Execution Environments (TEEs) such as Intel SGX [4] and Arm TrustZone [22] provide hardware-isolated execution even when the operating system is untrusted, making them suitable for securing the on-device models. However, commodity TEEs are not scalable to host full LLM inference on their own: secure memory is limited, and their compute throughput falls far short of what modern LLM serving requires.
Recent works therefore adopt a TEE-Shielded LLM Partition (TSLP) methods [15, 16, 18, 26, 33, 39, 43, 49], in which the TEE computes the lightweight non-linear computations,
(e.g., LayerNorm, Softmax), while the compute-intensive linear operators (i.e., matrix multiplications) are offloaded to the surrounding Rich Execution Environments (REEs), such as the commodity GPU/NPU runtime. As these REEs are not trusted to be secure, the TEEs are required to obfuscate the model weights (for instance via various matrix manipulation tricks) before offloading them to REEs.
The REEs then compute on the obfuscated inputs, and the TEE subsequently recovers the correct results by “subtracting” the obfuscation factors from the results.
Existing research on TSLP has developed along two parallel lines: developing new obfuscation schemes and exploiting the vulnerabilities of these schemes. However, existing obfuscation methodologies are largely ad-hoc.
Each obfuscation scheme invents tricks based on
certain efficiently-computable algebraic operations, such as column-wise permutation [16], column-wise scaling [26, 30], additive masking [31, 33, 49], or low-rank masking [43], and applies them to masking the offloaded linear layers. For instance, one recent design ArrowCloak [39] hand-stack several operations. In each case, the authors show that a handful of obvious inversions fail against the chosen tricks and declare the scheme secure. Meanwhile, attacks against these mechanisms are likewise ad-hoc, where each targets a specific class of obfuscation methods. Zhang et al. [47] target schemes built on additive masking [33, 49], and ArrowMatch [39] targets schemes built on column-wise permutation and scaling [16, 26].
To overcome the limitations of these heuristic designs, this paper addresses a fundamental research question: can we establish common primitives to unify representative prior methodologies, characterize the security boundary of their compositions, and systematically extend them? To this end, we formalize a set of
obfuscation primitives, defined as dual-tuples of linear computations satisfying specific algebraic properties. We demonstrate that the matrix-level weight transformations studied in several prominent TSLP methods published in top-tier venues [16, 26, 30, 31, 39, 43, 48, 49] can be expressed as compositions of these primitives. Concretely, we identify two categories of primitives, multiplicative primitives (permutation and scaling ) and additive primitives (sparse mask and low-rank mask ).
Each primitive is invertible and efficiently-computable, so any combination of them is also efficiently-computable within TEE's secure enclave.
Given these unified primitives, we identify as a canonical structural form for the family generated by these primitives, which represents the security boundary of these methods.
Yet, we demonstrate that is vulnerable, revealing a shared vulnerability in these approaches.
Specifically, we develop a novel attack methodology COLLAPSE against . Our key insight is that the column directions of the protected model weight cannot be effectively masked by arbitrary composition of these primitives. Specifically, column-wise permutation and column-wise scaling only permute and rescale columns, so the column directions of are preserved and remain correlated with the public . Second, sparse mask only masks a tiny fraction of elements in , so the column direction of are largely intact. Third, low-rank mask hides inside one low-dimensional subspace , so the column directions of are intact in the subspace orthogonal to . As a result, we can apply a systematic methodology to leverage such leaked information to obtain a surrogate model with the same architecture and comparable performance with . At a high level, our attack methodology has three steps: aligning the permutations of multiple observations of ; combining the aligned observations to recover the low-rank mask and locating the positions that has been masked by the sparse mask to obtain an intermediate model ; fine-tuning on a small labeled dataset (collected by querying ) to remove the remaining sparse mask and scaling , resulting in .
To further extend this security boundary, we propose two novel obfuscation primitives: the sparse multiplicative primitive mixes the columns of and double-sided multiplicative primitive disturbs both column and row of . Combining these two primitives with existing primitives yields , which disrupts the row- and column-wise invariants on which COLLAPSE relies. Extensive experiments across four representative models (e.g., BERT-Base, ViT-Base, Qwen2.5-0.5B, and Qwen2.5-1.5B) demonstrate that while COLLAPSE can extract high-fidelity surrogate models from prior defenses, reduces the resulting surrogate accuracy to the empirical black-box reference on average.
We clarify that we do not claim the universal security of . Instead, we only evaluate against the existing COLLAPSE pipeline. Since we only evaluate against existing pipeline without a
defense-specific adaptation, we do not claim the universal security of . Yet, our main contribution is to demonstrate a unified methodology to understand the security of obfuscation-based on-device LLM protection. Concretely, the contributions of our work are as follows.
-
Unified Obfuscation Primitives in TSLP Approaches. We formalize a set of obfuscation primitives that underpin the matrix-level weight transformations of several representative TSLP methods published in top-tier venues, providing a common algebraic abstraction for understanding and analyzing these approaches within a single framework.
-
Identify the Security Boundary. Building on the unified analysis abstraction, we define as a canonical structural form for the family generated by the existing primitives, which represents the security boundary of these methods.
-
Breaking the Security Boundary. We develop COLLAPSE, a systematic, primitive-guided attack against and its instantiations, demonstrating a common vulnerability shared by those TSLP approaches.
-
Extending the Boundary. Guided by COLLAPSE, we propose to further extend this security boundary beyond by introducing novel obfuscation primitives. We evaluate both COLLAPSE and across representative models, datasets, and obfuscation schemes.
2 Background and Threat Model
2.1 Transformer Inference and TEE-REE Collaborative Inference
2.1.1 Operator Classes in Transformer Inference. As illustrated in Fig. 1, a transformer block contains three operator classes that differ on what matters for protection—whether they carry proprietary weights and whether they dominate arithmetic cost. comprises the weight-bearing linear transforms (QKV, output projection, feed-forward-network (FFN) up/down), which carry the proprietary parameters. comprises the token-to-token products inside self-attention, whose cost grows quadratically with sequence length. collects the remaining lightweight non-linear operators (normalization, activation, residual).
2.1.2 TEE-REE Collaborative Inference. Trusted Execution Environments such as Intel SGX [4] and Arm TrustZone [22] enforce code and data isolation even when the OS is untrusted, but have limited secure memory and weaker throughput than the accelerators used for modern inference. Recent systems therefore retain the lightweight stages inside the TEE and offload and to the untrusted Rich Execution Environment (REE) [15, 16, 18, 26, 33, 39, 47]. A weight-bearing linear layer would expose its parameters in clear, so every scheme we study interposes an obfuscation step. For input X and protected weight W, the TEE releases , the REE returns , and the TEE applies a recovery map satisfying .
2.2 Threat Model
Figure 2 summarizes the threat model. We adopt an honest-but-curious adversary model: the device owner follows the TEE-REE

Figure 1: Operator classes in a transformer block (left) and the obfuscate-compute-recover TSLP pipeline on (right).
protocol correctly (so that the recovered output equals ), but records every distinct exposed view across key refreshes and attempts to reconstruct from them together with public prior knowledge.

Figure 2: Threat model. The model owner fine-tunes into a victim and deploys it as ; the device-owner attacker combines , distinct exposed views, and task data into a surrogate .
System model. The model owner starts from a public pretrained model and fine-tunes it on private data to obtain the proprietary victim model . is deployed on the user's device under the TEE-REE pipeline of § 2.1, producing the obfuscated runtime view to the REE.
Defender goal and mechanism. The defender keeps usable while preventing recovery of . Following standard practice [16, 26, 30, 39, 43, 49], the TEE primarily adopts a dynamic-key strategy, refreshing obfuscation keys every few rounds to prevent attacks that accumulate observations under a static key.
TEE-REE trust model. Following prior TSLP defenses [10, 16, 39, 43, 49], the GPU is an untrusted REE accelerator and the TEE (SGX, TrustZone, or equivalent) is the trust anchor. Each round, the REE sees the released input, the obfuscated weight , and the product it computes; and the post-recovery XW remain inside. Confidential-compute GPUs (H100 CC, TDX-IO) would only make REE-side information harder to access through side-channels, and are complementary to our work.
Attack goal. The attacker does not need exact white-box recovery of every parameter. Instead, the attacker aims to construct a high-utility surrogate model whose downstream behavior approximates .
Attacker capabilities. The attacker is the device owner, who fully controls the REE host and the GPU but cannot compromise the TEE.
-
Boundary visibility. The attacker records every tensor that crosses the TEE-REE boundary and every REE-side tensor derived from it. Across key refreshes, the attacker obtains distinct exposed views , where .
-
Limited task data. The attacker queries the deployed model to collect a small amount of labeled task data—typically less than 1% of the original training set—for fine-tuning the surrogate [39].
-
Public pretrained prior. The attacker uses standard model-fingerprinting techniques [21, 46] to identify the public backbone and treats it as prior knowledge about .
Out-of-scope assumptions. Hardware side-channel and transient-execution attacks against the TEE are outside the scope of this work.
3 Systematizing Linear Obfuscation
3.1 Obfuscation Primitives
The fundamental building blocks of this pipeline are what we term Obfuscation Primitives, which abstract the pair of operations used to mask a weight matrix in the REE and to recover the correct result inside the TEE. A trivial instantiation is an i.i.d. Gaussian mask , with and . Although this construction offers both exact correctness and strong security, it is self-defeating in our setting: since is dense, computing inside the TEE incurs a cost equivalent to the original operation , rendering the offloading to the REE fundamentally redundant. A viable primitive must therefore jointly satisfy correctness, efficiency, and a meaningful bound on leakage, as formalized below.
Definition 1 (Obfuscation Primitive). An obfuscation primitive is a pair of (possibly randomized) operators , where maps a weight matrix to an obfuscated matrix , and reconstructs the intended product from . The pair is called a valid obfuscation primitive if it satisfies the following three properties:
(1) Correctness. For every input matrix and weight matrix ,
i.e., the recovery operator restores exact functional equivalence with the original linear computation.
(2) Efficiency. Let denote the computational cost of an operation. The TEE-side cost of obfuscation and recovery is negligible relative to the original matrix multiplication:
(3) Model-Extraction Resistance. We characterize the security property of an obfuscation primitive as its resistance to model extraction, using a security game based on the threat model in § 2.2. Game overview. With an observation budget T and a labeled task-data budget B, the adversary attempts to extract the victim model. Winning condition. The adversary uses any polynomial-time attack strategy to maximize the task accuracy of an output surrogate , and wins if
Here, denotes the classification accuracy of on the evaluation set , and is the tolerated accuracy deficiency of the surrogate model relative to the victim model. The formal game and its success criterion are given in Appendix E.
3.2 From Primitives to Schemes
A central property of obfuscation primitives is that primitives compose without degrading any of the three properties: correctness remains exact, TEE-side computation cost grows only additively, and under the conditions stated below, the composition is no easier to extract than individual components.
Theorem 1 (Primitives are closed under composition). Let and be compatible obfuscation primitives. Their composition is the pair , where obfuscations are applied in order and recoveries in reverse so that each undoes its corresponding . Under the conditions below, this composed pair is itself a valid obfuscation primitive, with:
(i) Exact correctness, by chaining the correctness of and ;
(ii) Additive TEE-side cost, , still negligible relative to ;
(iii) No weaker model-extraction resistance. Intuitively, an attack that extracts the composition would also induce an attack on each component. Under the formal full-transcript simulation conditions in Appendix F, the composition is therefore no easier to extract than either or .
We provide a detailed proof in Appendix F.
Given this theorem, we define
the efficiency-preserving family generated by a base set of obfuscation primitives as
Here denotes the accumulated TEE-side obfuscation and recovery cost of the composition. Accordingly, longer compositions that exceed the efficiency budget in Definition 1 are excluded from . In the next subsection, we decompose existing efficient TSLP schemes into their constituent primitives.
3.3 Prior Schemes as Compositions of Primitives
We now apply the framework of § 3.2 to the existing literature. Although prior TSLP schemes [10, 16, 26, 30, 39, 43, 49] have been introduced as standalone designs, each with its own obfuscation scheme and security argument, we find that their matrix-level weight transformations are built from a small set of primitives. This subsection introduces a base set of four such primitives, and shows that the matrix-level transformations summarized in Table 2 belong to the family .
Taxonomy of Primitives. The primitives fall into two paradigms based on their algebraic nature: additive primitives, which mask W by adding a structured noise term, and multiplicative primitives, which transform W by an invertible linear map. Their obfuscation and recovery operators are summarized in Table 1.
Additive Primitives. Both additive primitives share the form and , differing only in the structure of the additive term . Their efficiency comes from the structure of , which makes XR cheaper to compute than XW itself.
A sparse mask sets , where is a sparse matrix with non-zero entries sampled by the TEE. Recovery amounts to subtracting from , where is a sparse-dense multiplication of cost , far below the cost of .
For a low-rank mask, with sampled by the TEE at small rank . The TEE recovers by subtracting from , two thin matrix multiplications of total cost , again far below .
Multiplicative Primitives. We use one-sided permutation and scaling to refer to transformations acting on either rows or columns. Since the two orientations are equivalent up to transposition, e.g., , we use the column-wise convention below for simplicity. Both multiplicative primitives share the form and , where is an invertible matrix sampled by the TEE. Their efficiency comes from the structure of , which reduces TEE-side recovery to operations far cheaper than a dense matrix multiplication.
A column-wise permutation sets , an permutation matrix sampled by the TEE. The recovery reduces to permuting the columns of back to their original order, which the TEE performs as a memory copy with no arithmetic.
A column-wise scaling sets , a nonsingular diagonal matrix sampled by the TEE. The recovery reduces to dividing the -th column of by , which the TEE performs as scalar divisions, at total cost .
Existing Schemes as Compositions. Table 2 maps the matrix-level weight transformations of prior schemes onto these four primitives. Defining
we observe that every weight transformation listed in Table 2 is an element of — whether built on a single primitive or, as in the case of ArrowCloak [39], composed of several.
Table 2 gives a scheme-by-scheme correspondence between each published weight transform and its representation using our primitives. The last two columns show the equivalent obfuscation and
For the classification tasks evaluated in this paper, we adopt . Thus, an attack is considered successful if the surrogate model's accuracy is no more than five percentage points below that of the victim model.
Table 1: The four obfuscation primitives identified in the literature. , , and denote a sparse, low-rank, permutation, and non-singular diagonal matrix, respectively. TEE cost is given for , . Security analysis is deferred to § 4.
| Paradigm | Primitive | TEE cost | Notes | ||
|---|---|---|---|---|---|
| Additive | sparse mask | ||||
| low-rank mask | |||||
| Multiplicative | col-wise perm. | memcpy | |||
| col-wise scale | WD |
Table 2: Representative TSLP schemes mapped onto the four primitives of . Six of the seven schemes use a single primitive; only ArrowCloak composes multiple primitives in one scheme. The Mode column indicates whether the same weight matrix is obfuscated by a single fixed mask (static) or by multiple masks across inferences (dynamic).
| Scheme | Venue | Mode | Original transformation | ||||||
|---|---|---|---|---|---|---|---|---|---|
| NNSplitter [49] | ICML'23 | ✓ | static | ||||||
| Magnitude [10] | TDSC'21 | ✓ | static | ||||||
| LoRO [43] | NeurIPS'25 | ✓ | dynamic | ||||||
| TransLinkGuard [16] | MM'24 | ✓ | static | ||||||
| Soter [26] | ATC'22 | ✓ | dynamic | WD | |||||
| TSQP [30] | S&P'25 | ✓ | static | WD | |||||
| ArrowCloak [39] | Security'25 | ✓ | ✓ | ✓ | dynamic |
TEE-side recovery. For TransLinkGuard [16], adjacent layers use different permutations, so the TEE rearranges the output of one layer into the order expected by the next. For ArrowCloak [39], setting and gives . Our abstraction captures the core weight-obfuscation and recovery algorithms at the TEE–REE boundary, which are central to protecting offloaded weights.
3.4 Security Boundary of
§ 3.3 established that the matrix-level transformations listed in Table 2 lie in . This motivates the following question: does this family admit a “most secure” composition?
Definition 2 (Security Boundary). Let be a base set of obfuscation primitives. A scheme is the security boundary of if it satisfies the efficiency requirement in Definition 1 and every efficiency-preserving can be realized by under some choice of parameters. Therefore, can be viewed as the “most secure” scheme attainable from .
Theorem 2 (Security boundary of ). The security boundary of is
where , and range over sparse, low-rank, non-singular diagonal, and permutation matrices, respectively. That is, every efficiency-preserving composition is an instance of for some , and .
Proof. We show that any efficiency-preserving composition of primitives in can be rewritten into the form of Eq. (1) via a sequence of algebraic identities. Write as a word in the alphabet representing the sequence of primitives applied to .
The following rewriting rules reduce any such word to canonical form:
diagonal closed under product
(2)
perm. closed under product
(3)
We apply these rules in three phases. First, repeated application of Rules (5) and (6) distributes every multiplicative primitive through the enclosing additive structure, yielding
where each . Second, Rules (2), (3), and (4) reduce the multiplicative chain to (Rule (4) pushes permutations rightward; Rules (2) and (3) fuse adjacent diagonals and adjacent permutations). Finally, Rules (7) and (8) fuse the additive masks of the same type, giving
Setting and , both still low-rank and sparse respectively, we obtain
which is the canonical form of Eq. (1).
Every efficiency-preserving composition built from is an instance of . Whether the protection offers is adequate is the question we take up in § 5.
4 Attack Intuition
Before presenting COLLAPSE in detail (§5), we first explain why is vulnerable. The high-level message is simple: no matter how the four primitives are composed, the column directions of the victim weight remain largely exposed. We articulate this as three insights, each pointing to a structural limitation of one or more primitives.
Insight 1 (Column atomicity).
Each victim column survives in as a transformed copy of a single original column. and relabel and rescale columns but never mix them.
permutes columns and scales them entry-wise per column; neither operation forms linear combinations across columns. Hence the set of column directions of passes through and unchanged, up to reordering and positive rescaling.
Insight 2 (Sparse coverage gap).
A vanishing fraction of entries are perturbed; the rest leak in cleartext. Sparse mask has nonzeros.
Practical deployments keep extremely sparse for efficiency, so nearly every entry of each column of is released verbatim. A column direction is a global property of all entries, and corrupting only a small fraction of them barely tilts it.
Insight 3 (Low-rank coverage gap).
Each column's -dim orthogonal component leaks in cleartext. Low-rank mask confines noise to an -dim subspace.
Because has rank at most , every column of lives in a single -dimensional subspace. Projecting away from this subspace removes entirely and exposes the remaining dimensions of each victim column without any noise at all.
Why direction leakage suffices. fails to hide the column directions of . Since the backbone architecture is public, building reduces to recovering the weight matrices. Once the column directions are obtained, the attacker only needs to fix them and fine-tune the column magnitudes to build . §5 develops the attack.
5 The COLLAPSE Pipeline
§ 4 has shown that leaks along three structural channels: column directions pass through and , most entries pass through , and most directions pass through . This section turns those leaks into an executable model-extraction attack, which we call Collapse.
The attacker observes obfuscated views of a single weight matrix,
with a static and dynamically-refreshed , and . The attacker additionally has access to a public pretrained weight identified by model fingerprinting, and to a labeled task-data budget of size at most 1% of the original training set. The output is a surrogate model whose downstream accuracy approximates the victim .
Figure 3 summarizes the pipeline. Stage 1 (§5.1) consumes view-to-view consistency to discharge , returning views in a common column ordering. Stage 1 treats as a whole and uses cross-view consistency to align the relative permutations . Stage 2 (§5.2) uses mask-subspace intersections from four aligned views to discharge , producing an anchor-ordered estimate . Stage 3 (§5.3) consumes the prior and the task-data budget to discharge the column scaling , the unknown column ordering, and any residual error, returning . Stages 1 and 2 run independently per weight matrix; Stage 3 runs once on the assembled model.
5.1 Stage 1: Cross-View Column Alignment
Goal. From the raw views, extract that share a common column ordering. The recovered ordering is relative: for every accepted pair we obtain exactly, while the absolute remain unknown.
Stage 1 treats as a whole and rests on the linear dependency detection (LDD) oracle of §5.1.1, an algebraic test that decides whether two column subsets of and correspond to the same victim columns. We then call this oracle repeatedly into an explicit recovery of .
5.1.1 The LDD Oracle. For column subsets with , stack the corresponding columns into
and let , be the corresponding indices in the shared matrix . The dimension of 's column space is determined by how much and overlap. Two cases:
- Full overlap (). Both blocks span the same victim directions, and each contribute a rank- subspace generic with respect to . The columns of admit
linearly independent vectors among them.
- Partial overlap (). The victim-direction count rises to , and contribute a further , so the columns admit
linearly independent vectors.
Choice of . We use the rank of as our estimate of the number of linearly independent columns it contains. The parameter then controls how large an overlap deficit we can detect: because has only columns, its rank is bounded by , so the identity holds only while , i.e. . Beyond that threshold pegs at and different values of become indistinguishable. For instance, taking when yields a detection range of , so every overlap situation

Figure 3: COLLAPSE against : align columns (Stage 1), separate the low-rank mask (Stage 2), fine-tuning the length of columns and recover sparse mask (Stage 3).
Algorithm 1: LDD Oracle
Input: , rank threshold
Output: Numerical rank
1 ;
2 ;
3 return ;
with is resolved exactly from . Thus even a small overlap is immediately visible in .
5.1.2 Recovering Relative Permutations. The LDD oracle returns only the size of the overlap between two index sets and , without establishing a one-to-one correspondence between them. In this subsection we build an alignment algorithm on top of the oracle that recovers the full relative permutation between two views. The algorithm proceeds in three phases. We first seed the alignment by locating a pair of size- column subsets that the oracle certifies as fully overlapping. We then disambiguate the bijection inside this seed by removing one column from each side at a time and querying the oracle. Finally we propagate the bijection to all remaining columns one at a time.
Phase 1: seed. A seed is a pair of size- column subsets that fully overlap, i.e., . Our strategy is to first find and that partially overlap, then grow this overlap until it is complete. The first step is essentially free: even when and are drawn uniformly at random, the LDD oracle reports the overlap with high probability, giving us a partial overlap to start from. Next, we grow the overlap by replacing one column of at a time with a
new column from , keeping only those replacements that increase . We continue this process until full overlap, and then we obtain a seed. We continue this process until , at which point is a seed.
Phase 2: disambiguate. A seed gives us two fully overlapping sets, but we still need the element-level mapping between them. To recover it, we remove one column from each of and and ask the LDD oracle whether the remaining columns on each side still fully overlap. If they do, the two removed columns must correspond to the same underlying column. Repeating this test over all candidate pairs gradually determines the full correspondence between and .
Phase 3: propagate. Following Phases 1 and 2, a one-to-one correspondence has been established between the columns of a seed pair , and it remains to extend this correspondence to all columns. A natural starting point is to match the columns one at a time. We append an unmatched column to each side and query the LDD oracle. If the two sides remain fully overlapping, the appended columns are matched. By repeating this procedure until no unmatched columns remain, the full correspondence is recovered. Algorithm. Algorithm 2 assembles the three phases into a single procedure that recovers from two raw views. The cost is dominated by Phase 3, which makes LDD calls; Phase 1 and Phase 2 together contribute only calls.
5.2 Stage 2: Mask Recovery
Goal. We select four aligned views from Stage 1. Working in their common column order and suppressing the shared permutation ,
Algorithm 2: Permutation Alignment via the LDD Oracle
Input: Views ; subset size
Output: Bijection matching columns of to those of
// Ovl(A,B): = number of shared victim columns between A and B, read off the rank returned by the LDD oracle.
/* Phase 1 (seed): grow a random pair until it fully overlaps. */
1 draw uniformly at random with ;
// When comfortably exceeds 2r, random blocks likely satisfy Ovl > 2r; otherwise resample.
2 while do
3
// now index the same victim columns, in unknown order.
/* Phase 2 (disambiguate): match the seed columns one-to-one. */
4 ;
5 for do
6
// now bijects to on the seed; the remaining columns are still unmatched.
/* Phase 3 (propagate): extend to the remaining columns. */
9 ;
10 while do
11
15 return ;
we write
Let and . Our goal is : Stage 2 removes the low-rank masks while leaving the shared sparse mask and anchor-view scaling to Stage 3.
Step 1: Identify mask subspaces. Choose disjoint column blocks , each of size . For each view pair , concatenate the selected columns from both views within each block, then take the intersection of the resulting column spaces:
Here selects the columns indexed by , denotes horizontal concatenation, and is the space spanned by the columns of . The column spaces and share exactly the independent mask directions spanned by and . Their intersection therefore extracts . Having identified and , we use SVD to obtain their orthonormal bases .
Step 2: Recover the shared columns. Define , the orthogonal projector onto . The key observation is that the low-rank masks in each view pair affect only components within , leaving its orthogonal complement unaffected:
We have , so the two mask-free projections jointly provide information spanning the entire space. However, these projections retain different unknown column scales, requiring joint recovery of the relative scales and mask components. Specifically, for each column , let and solve
where are mask coordinates and is the relative scale. Solving the system recovers the mask component .^5 Subtracting the mask then yields
The recovered is passed to Stage 3.
5.3 Fine-tuning on Length and Sparse Mask
Goal. Stage 3 takes the anchor-ordered estimate and the public prior and turns it into a surrogate model . To do so, we first align the recovered columns with , then estimate a candidate sparse support, and finally calibrate the column lengths and fine-tune the resulting initialization.
Step 1: direction recovery. This step recovers the column permutation by exploiting direction similarity between and [39]. We find an index mapping , the inverse of , that maps each column of back to its position in the column order of . We use cosine similarity to quantify directional similarity: at each step,
We assume that the 2r basis directions of and the 4r selected columns of are jointly linearly independent, and that each difference block spans all 2r mask directions for . In BERT-Base (m = n = 768, r = 2), these conditions require only 6r = 12 independent directions in .
In the BERT-Base setting [5] (n = m = 768 and r = 2), choosing k = 80 gives for one random block pair.
For independent mask directions drawn from full-dimensional continuous distributions in , almost surely when .
When , the coefficient matrix has full column rank with overwhelming probability.
the attacker fixes a column in and, within , selects the vector with the largest cosine similarity to it, that is,
Since each column of has only a small fraction of entries perturbed by S, the directional similarity between and is preserved.
Step 2: sparse-support estimation. After aligning the recovered columns with , we first estimate the remaining scale of each column by least-squares projection:
Using the fitted scale, we measure the normalized residual of each entry as
where and are the typical residual magnitudes of row i and column j. We then select the candidate sparse support by
Here, returns the locations of the largest q fraction of entries within each layer.
Step 3: fine-tuning. This step undoes the effect of the per-column scaling in by estimating its diagonal entries . We compare the length between column vector and to recover an approximation of . Let be a length function of vector. The approximation of is computed as . The attacker then initializes the approximate vector as , and constructs the initialization weight matrix . We then construct for each layer to get the initialized model . The entries in the candidate support are initialized from , after which we fine-tune on to obtain .
6 Extending the Security Boundary
The leakage exposed by Collapse traces to a single invariant of : the column directions of W survive the obfuscation. None of the primitives in removes this invariant; to push the boundary forward, the base set itself must be enlarged with primitives that obfuscate column (and, symmetrically, row) directions directly. § 6.1 introduces the sparse multiplicative primitive that mixes columns of W, and § 6.2 introduces the double-sided multiplicative primitive that simultaneously mixes rows. § 6.3 writes down the canonical form of the extended family, and proves it is the new security boundary.
6.1 Sparse Multiplicative Primitive
Motivation. We break column atomicity by making each exposed column a sparse combination of several victim columns, instead of a transformed copy of one.
Construction. We seek a sparse, invertible multiplicative matrix whose inverse is also sparse. A natural family is the sum of a constant number k of permutation-diagonal terms,
where each is a permutation and each a non-singular diagonal. Sampled appropriately, both and admit the same form, so each has nonzero entries. The case is sufficient to break column atomicity, and we use it in our experiments. A concrete instantiation is given in § D. We refer to any matrix of this form as a generalized mixing matrix.
The primitive is
Recovery applies as two paired permute-and-scale passes over the columns of followed by a sum, at total cost —the same as .
Remark. The prior multiplicative primitives are degenerate cases of this construction: setting gives (with ) and (with ). So strictly subsumes .
6.2 Double-Sided Multiplicative Primitive
Motivation. mixes columns but leaves the row basis of identical to that of ; we close this channel by mixing rows as well.
Construction. Let be two independently sampled generalized mixing matrices. The primitive is
Correctness follows from , which recovers by stripping the trailing ; each of the four sparse multiplications costs .
Extending Definition 1. The primitives in and all act on alone, fitting the pair of Definition 1. To accommodate a primitive that also transforms , we widen the definition to a triple with the correctness requirement . Every primitive in is the special case , so the extension is strictly backwards-compatible, and the closure-undercomposition property of Theorem 1 carries over by stacking maps on the input side and maps on the weight side.
Remark. composes with any right-acting multiplicative primitive: stacking around an existing , or yields a double-sided variant of that primitive without any further modification. In other words, every column-wise multiplicative primitive admits a two-sided lift through .
6.3 The Extended Boundary
Let and let be the family it generates through (extended) composition. We claim the boundary of this family is
(18) where ranges over sparse matrices, over rank- matrices, and over generalized mixing matrices. Setting and recovers , so strictly subsumes .
Theorem 3 (Security boundary of ). Every scheme can be realized as for some choice of parameters. Here the additive masks satisfy and .
PROOF. We extend the rewriting system of Theorem 2 to the enlarged alphabet . Each DS symbol expands into a matched pair: an acting on the right of , and an acting on the left of . Two new rewriting rules suffice:
Rule (19) reflects that any product of generalized mixing matrices remains a mixing matrix: two -term mixing matrices multiply to a -term one, but since has bounded length, the accumulated term count stays in , so the result is still -sparse. Rule (20) is the left-side analogue of Rules (5)–(6): has rank at most , and has nonzeros. Note also that and are degenerate mixing matrices ( 6.1), so the old Rules (2)–(4) are absorbed by Rule (19).
The remaining three phases mirror Theorem 2: distribute multiplicative factors through additive structure on both sides, fuse the right-side chain into one via Rule (19) and the left-side factors into one analogously, then fuse same-type additive masks via Rules (7) and (8). Absorbing the resulting into the parenthesized block by the substitutions and (both still rank- and sparse) yields the canonical form of Eq. (18). Thus, every efficiency-preserving scheme admitted to satisfies these sparsity and rank thresholds.
Cost. The per-query overhead of stays within the envelope: applying and are sparse-dense products, identical to . The per-refresh cost of materializing inside the TEE is , on par with .
7 Evaluation
In this section we evaluate the performance of COLLAPSE and . We first describe the evaluation setup ( 7.1) and then answer the following research questions.
-
RQ1: How effective is COLLAPSE against existing defenses?
-
RQ2: How accurately does COLLAPSE recover the target obfuscation components at each stage?
-
RQ3: How effective is as a defense against COLLAPSE?
-
RQ4: What cost does impose relative to prior defenses?
7.1 Experimental Setup
Models. As summarized in Table 3, we evaluate COLLAPSE and across four representative models to ensure broad applicability. We select BERT-Base [5] and the Qwen2.5 series [23] to cover both auto-encoding and state-of-the-art auto-regressive (decoder-only)
architectures. ViT-Base [6] is further included to verify generalizability on vision-related transformer tasks. To assess scalability, our selection spans from 86M parameters up to 1.54B (Qwen2.5-1.5B), the latter mirroring the complexity of modern high-performance edge LLMs such as Microsoft's Phi [1]. All model checkpoints are loaded via the HuggingFace Transformers library [42].
Table 3: Summary of model architectures and configurations used in our evaluation.
| Model | Architecture | Params | Hidden (n) | Layers (L) |
|---|---|---|---|---|
| BERT-Base | Auto-encoding | 110M | 768 | 12 |
| ViT-Base | Vision Transformer | 86M | 768 | 12 |
| Qwen2.5-0.5B | Auto-regressive | 490M | 896 | 24 |
| Qwen2.5-1.5B | Auto-regressive | 1.54B | 1536 | 28 |
Datasets. We evaluate four representative datasets that cover multiple modalities and task complexities, summarized in Table 4. For natural language understanding, we select MNLI [41], SST-2 [28], and QNLI [24] from the General Language Understanding Evaluation (GLUE) benchmark [37]. MNLI is a large-scale resource for multi-genre natural-language inference, SST-2 is the industry standard for sentiment analysis, and QNLI converts question answering into a sentence-pair classification task. To demonstrate generalizability in computer vision, we evaluate ViT-Base on CIFAR-100 [14]. This selection ensures that our evaluation reflects realistic deployment scenarios for models shielded by trusted execution environments.
Table 4: Representative datasets used in our evaluation.
| Dataset | Modality | Task Type | # Samples | Evaluation Metric |
|---|---|---|---|---|
| MNLI | Text | NLI | 393K | Accuracy |
| SST-2 | Text | Sentiment | 67K | Accuracy |
| QNLI | Text | QA/NLI | 105K | Accuracy |
| CIFAR-100 | Image | Classification | 60K | Top-1 Accuracy |
Selective Defenses. To evaluate the robustness of COLLAPSE across various protection paradigms, we select five representative prior lightweight obfuscation algorithms summarized in Table 2. For each prior defense, we evaluate the matrix-level weight transformation summarized in Table 2. We include NNSplitter and LoRO to represent the additive category, which use sparse masks and low-rank masks respectively. TSQP and TransLinkGuard cover multiplicative primitives via column-wise scaling and permutation. To assess composite defenses, we incorporate ArrowCloak [39], the state-of-the-art fusion method combining both multiplicative and additive transformations. We additionally evaluate COLLAPSE against , the canonical form of compositions over the prior primitives defined in 3.4.
Key-refresh configuration. Following the refresh settings of the prior schemes summarized in Table 2, we keep the sparse mask static and refresh , and at each key epoch.
Baselines. We compare COLLAPSE against three baselines to provide a clear performance reference. The White-box setting assumes the defender deploys the model directly to an untrusted REE. The adversary possesses complete access to the model parameters and architecture, and obtains directly without any recovery effort. We fine-tune with the same 1%-task-data budget that COLLAPSE uses. This establishes the upper bound of attack performance. The Black-box setting represents the scenario where model execution is fully protected within the TEE. The adversary only has access to the public pre-trained model and a limited training set (1%-task-data, the same budget as COLLAPSE). We fine-tune all parameters of to produce a surrogate . This baseline demonstrates that generic fine-tuning alone fails to reconstruct to White-box level, underscoring the necessity of the recovery steps in our attack pipeline. ArrowMatch [39] serves as the state-of-the-art prior attack against multiplicative obfuscation primitives (). Compared to ArrowMatch, COLLAPSE exhibits a significant advantage in handling additive primitives (). This performance gap validates the advanced capabilities of our attack pipeline in recovering parameters from highly secured models. For we additionally compare against the strongest prior defense, ArrowCloak, to isolate the empirical reduction in COLLAPSE surrogate accuracy from the new primitives.
Metric. We evaluate attack effectiveness using two metrics. First, we measure the classification accuracy of the surrogate model . A higher accuracy indicates that has captured a greater portion of the functional logic from , which signifies a more potent attack. Second, we calculate , the relative performance compared to the Black-box baseline. This comparison highlights how effectively our attack pipeline accelerates the model fine-tuning phase. We report both metrics across all model-task-defense combinations.
7.2 RQ1: Attack Performance Across Defenses
We display the attack performance of COLLAPSE in Table 5. The last row reports the average performance across all settings. We can observe that COLLAPSE effectively recovers the obfuscated weights and achieves a high attack performance. Relative to the black-box baseline, the attack reaches on average , essentially matching the white-box upper bound. On , the full-stack target, the surrogate is also close to white-box. This shows that COLLAPSE successfully recovers the knowledge encoded in the obfuscated weights, lifting the attack performance from the black-box floor to near-white-box.
On the contrary, the -based baseline has a much lower attack performance. We can also observe that performs even worse than a black box fine-tuning model. It is because the obfuscated weights give a destructive initialization for , this initialization is even worse than fine-tuning from alone. Thus cannot be used to train a surrogate model. It means that the evaluated weight-obfuscation configurations are effective in front of the naive -based attack. But COLLAPSE can utilize the leaked column information to recover weights from these configurations and achieve near-white-box performance.
Answer to RQ1. COLLAPSE effectively recovers weights from the evaluated configurations and achieves a high attack performance. The attack performance is on average the black-box baseline (white-box upper bound is ).
7.3 RQ2: Stage-wise Attack Success
We validate the complete recovery pipeline by comparing the output of each stage with the corresponding generator ground truth. The results show that COLLAPSE succeeds at every stage rather than relying solely on downstream fine-tuning. We conduct three independent attack runs using BERT-Base on MNLI and report the mean of each metric in Table 6.
Table 6 reports the recovery metrics for each stage. In Stage 1, we report the percentage of columns correctly aligned across views. In Stage 2, we report -Sim (), which measures the similarity between the recovered and ground-truth . In Stage 3, we report absolute-permutation accuracy and the precision, recall, and F1 score for sparse-support estimation.
Answer to RQ2. COLLAPSE achieves approximately 100% recovery performance at every stage.
7.4 RQ3: Defense Effectiveness
In this RQ, we compare 's defense effectiveness with prior obfuscation methods. We evaluate using the existing COLLAPSE pipeline and the same hyperparameters as in § 7.2, without a defense-specific adaptation to . Tab. 7 shows the attack performance against and the best performance of the existing lightweight obfuscation algorithms (denoted as "Prior Best"). We report 's accuracy and the relative accuracy compared to the black-box baseline (denoted as "Rel.Black"). The black-box baseline is an empirical reference point obtained without using the obfuscated weights, not a formal security lower bound or ideal-protection guarantee.
Under the evaluated COLLAPSE configuration, yields lower surrogate accuracy than the best prior defense. On average, the Rel.Black of is , but Prior Best is . The surrogate reaches the empirical black-box reference point on average, indicating that this evaluated pipeline obtains no measured benefit in average accuracy from the obfuscated weights. Notably, performs even better on smaller models such as ViT-Base, where Rel.Black drops to . These results establish empirical resistance only under the evaluated COLLAPSE configuration.
Answer to RQ3. Under the evaluated COLLAPSE configuration, reduces Rel.Black from under the strongest prior defense (ArrowCloak) to , matching the empirical black-box reference on average. This result is empirical and attack-specific.
7.5 RQ4: Cost of
We implement a TEE-GPU prototype to measure the obfuscation and recovery cost on the TEE side. The TEE runs Python inside Oclum, the GPU runs a long-lived worker process, and the two sides communicate via sockets. We run two microbenchmarks on a BERT-Base linear layer at and sequence length 768 (10-sample mean), and break each measurement into four phases: obfuscation, GPU compute, TEEGPU transfer, and TEE-side recovery. Tab. 9 reports the cost of each primitive in isolation; the Double-Sided primitive is omitted because its cost is by construction twice that of its column-wise multiplicative counterpart. Tab. 8 aggregates the four phases over one self-attention block and one feed-forward block for , ArrowCloak [39] (the strongest prior
Table 5: Attack accuracy (%) across four models, four tasks, and six evaluated weight-obfuscation configurations ; single-seed. : exposed obfuscated model; COLLAPSE: recovered surrogate. White-box / Black-box are upper/lower bounds.
| NNSplitter | LoRO | TSQP | TransLinkGuard | ArrowCloak | White-box | Black-box | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| COLLAPSE | COLLAPSE | COLLAPSE | COLLAPSE | COLLAPSE | COLLAPSE | ||||||||||
| ViT-Base | CIFAR-100 | 1.94 | 90.28 | 1.14 | 90.36 | 0.88 | 89.44 | 0.98 | 90.26 | 0.88 | 89.82 | 0.86 | 90.62 | 90.44 | 68.44 |
| BERT-Base | MNLI | 33.01 | 84.67 | 32.13 | 84.86 | 34.77 | 84.47 | 32.03 | 84.57 | 32.03 | 83.59 | 32.03 | 83.69 | 84.67 | 45.80 |
| QNLI | 49.80 | 90.43 | 50.20 | 90.62 | 48.83 | 90.62 | 53.91 | 91.02 | 53.91 | 90.62 | 49.31 | 89.97 | 90.43 | 63.48 | |
| SST-2 | 49.02 | 93.16 | 53.52 | 93.16 | 51.56 | 92.77 | 53.52 | 93.16 | 53.52 | 92.58 | 53.52 | 93.36 | 93.16 | 58.20 | |
| Qwen2.5-0.5B | MNLI | 34.77 | 83.79 | 33.98 | 84.77 | 33.59 | 84.96 | 32.42 | 84.18 | 32.03 | 83.40 | 31.84 | 83.40 | 84.38 | 66.41 |
| QNLI | 50.00 | 89.84 | 52.15 | 89.26 | 46.29 | 91.41 | 51.37 | 89.65 | 47.46 | 91.60 | 49.22 | 89.84 | 91.99 | 62.11 | |
| SST-2 | 49.02 | 94.34 | 48.24 | 93.75 | 49.61 | 91.60 | 48.24 | 94.14 | 50.39 | 94.14 | 47.07 | 92.38 | 94.14 | 51.17 | |
| Qwen2.5-1.5B | MNLI | 34.18 | 89.26 | 33.79 | 89.26 | 32.42 | 90.23 | 31.05 | 89.65 | 32.03 | 88.48 | 33.25 | 89.28 | 91.41 | 72.36 |
| QNLI | 47.07 | 93.16 | 53.32 | 93.36 | 54.10 | 94.14 | 53.52 | 92.97 | 52.93 | 92.97 | 48.37 | 92.26 | 93.75 | 67.58 | |
| SST-2 | 47.27 | 96.48 | 52.15 | 96.88 | 52.54 | 95.70 | 53.32 | 96.29 | 54.49 | 96.09 | 51.43 | 94.86 | 96.68 | 69.53 | |
| Average | 39.61 | 90.54 | 41.07 | 90.63 | 40.46 | 90.53 | 41.04 | 90.59 | 40.97 | 90.33 | 39.69 | 89.97 | 91.11 | 62.51 | |
| Ratio | 0.63× | 1.45× | 0.66× | 1.45× | 0.65× | 1.45× | 0.66× | 1.45× | 0.66× | 1.45× | 0.63× | 1.44× | 1.46× | 1.00× | |
Table 6: Stage-wise recovery performance of COLLAPSE against . Results are the mean of three independent attack runs.
| Setting | Stage 1 | Stage 2 | Stage 3 | Stage 3 |
|---|---|---|---|---|
| Rel. II Acc. | L-Sim. | Abs. II Acc. | Support P/R/F1 | |
| BERT-Base/MNLI | 100.00% | 99.97% | 100.00% | 99.36%/99.22%/99.29% |
Table 7: Surrogate accuracy under vs. the strongest prior defense, both evaluated against COLLAPSE. Rel.Black is Acc()/Acc(Black-box).
| Model | Dataset | Prior Best | |||
|---|---|---|---|---|---|
| Rel.Black | Rel.Black | ||||
| ViT-Base | CIFAR-100 | 53.40% | 0.78× | 89.44% | 1.31× |
| BERT-Base | MNLI | 35.86% | 0.78× | 83.59% | 1.83× |
| SST-2 | 59.97% | 1.03× | 92.58% | 1.59× | |
| Qwen2.5-0.5B | MNLI | 66.99% | 1.01× | 83.40% | 1.26× |
| QNLI | 70.75% | 1.14× | 89.26% | 1.44× | |
| SST-2 | 66.94% | 1.31× | 91.60% | 1.79× | |
| Qwen2.5-1.5B | MNLI | 74.74% | 1.03× | 88.48% | 1.22× |
| QNLI | 67.48% | 1.00× | 92.97% | 1.38× | |
| SST-2 | 63.96% | 0.92× | 95.70% | 1.38× | |
| Average | 62.23% | 1.00× | 89.67% | 1.46× | |
Table 8: Phase-level latency (ms) for a protected BERT-Base block with .
| Defense | Self-Attention (ms) | Feed-Forward (ms) | Tot. (ms) | ||||||
|---|---|---|---|---|---|---|---|---|---|
| Obf. (ms) | GPU (ms) | Trans. (ms) | Rec. (ms) | Obf. (ms) | GPU (ms) | Trans. (ms) | Rec. (ms) | ||
| ArrowCloak | 24.15 | 5.54 | 250.99 | 313.92 | 42.36 | 0.60 | 138.63 | 146.63 | 922.81 |
| 22.12 | 4.66 | 202.99 | 318.46 | 40.33 | 0.49 | 118.09 | 148.70 | 855.82 | |
| 80.28 | 4.38 | 195.94 | 303.80 | 59.16 | 0.48 | 116.08 | 143.21 | 903.33 | |
hybrid scheme), and (the canonical representative of the prior family).
Table 9: Per-primitive latency on a BERT-Base linear layer at , seq. length 768.
| Primitive | Obfuscation (ms) | GPU Compute (ms) | Recovery (ms) |
|---|---|---|---|
| Sparse Mask | 1.010 | 0.242 | 7.428 |
| Low-rank Mask () | 1.04/1.04/1.00 | 0.25/0.26/0.24 | 3.05/5.93/9.51 |
| Col. Scaling / Permutation | 0.82 / 3.96 | 0.23 / 0.23 | 0.87 / 4.12 |
| Sparse Mixing | 10.97 | 0.23 | 11.61 |
New primitives are on par with prior ones. Tab. 9 shows that the sparse multiplicative primitive stays within the same order of magnitude as the prior primitives. This is because it can be decomposed into a permutation followed by a diagonal scaling , so its cost is essentially that of plus .
's end-to-end cost matches prior schemes. Tab. 8 shows that 's end-to-end cost is on par with both and ArrowCloak. This is because the new primitives only add cost in the obfuscation phase for X, while recovery and transfer are essentially unaffected. Answer to RQ4. 's end-to-end cost is on par with ArrowCloak () while reducing Collapse surrogate accuracy by 27.4 percentage points ( 7.4).
8 Discussion
GPU TEEs. GPU-based confidential computing is a promising direction for protecting accelerator-side execution, with proposals such as Graviton [36] and ACAI [29] extending hardware-isolated execution to the accelerator (see [40] for a survey of the CPU–GPU confidential-computing landscape). However, it depends on specific hardware, firmware, and deployment support, and is not yet available on many commodity devices. Our work studies the current TEE–REE setting where the CPU-side TEE is trusted while the GPU/NPU remains untrusted. Thus, our primitive-based analysis is complementary to GPU TEEs: confidential GPUs can reduce the exposed boundary when available, while our results characterize the security of algorithmic obfuscation when accelerators are not trusted.
Side-channel attacks. We assume the TEE correctly protects enclave-resident code and data, and do not consider hardware side channels or transient-execution attacks against the TEE. A separate body of work recovers model weights through fault injection or memory/PCIe side channels—e.g., RowHammer-based weight extraction in DeepSteal [25], GPU memory-bus snooping in HyperTheft [44] and CipherSteal [45], PCIe-traffic analysis in the Hermes attack [50], and the side-channel reverse-engineering of CNNs by Hua et al. [11]. This line is orthogonal to our focus: our attacks do not rely on compromising the TEE or any hardware channel; they exploit algebraic structure in the obfuscated tensors already exposed to the REE. Existing TEE and bus-side side-channel mitigations can therefore be combined with our framework.
Key rotation and boundary-visible leakage. Our analysis reveals a counterintuitive consequence of lightweight obfuscation. Because these primitives conceal only selected algebraic aspects of the weight matrix, a single obfuscated view can still reveal exploitable structure. Refreshing the keys produces multiple differently obfuscated views; comparing them may reveal complementary clues and make weight recovery easier. Thus, under our threat model, more frequent key rotation can weaken resistance to model extraction. Appendix G analyzes the fully refreshed setting.
Defense scope and adaptive attacks. Our evidence for is empirical and limited to the existing COLLAPSE pipeline without a defense-specific adaptation. Developing defense-aware attacks targeting and is left for future work; we claim no formal model-extraction security guarantee.
Other TSLP Schemes. GroupCover [48] represents a different security–efficiency trade-off. By mixing groups of weight vectors through matrix multiplication, it can hide stronger column-level invariants than efficient TSLP schemes. However, it splits into mixing groups based on distances between weight vectors, rather than randomly choosing groups. Since fine-tuned weights are often close to the public pretrained weights, may help the attacker guess which vectors are mixed together. ShadowNet [31] uses a dense additive mask, but the mask is not fully confined within the TEE: part of the mask-related information is exposed to the GPU to enable efficient outsourced computation. This exposure gives the attacker extra information to steal the protected model.
9 Related Work
TEE-shielded model partition. TEE-shielded partition schemes split a model between TEE and REE; early designs such as DarkneTZ [18] and Occlumency [15] simply partition without obfuscating offloaded weights. To better protect the offloaded weights, subsequent schemes combine algebraic tricks heuristically: ShadowNet [31] composes permutation with random per-channel scaling on convolution filters; Magnitude [10] partitions selected high-magnitude weights into the TEE; NNSplitter [49] perturbs a small fraction () of weight entries and stores their original values in the TEE; TransLinkGuard [16] couples layer-specific row/column permutations with TEE authorization that carries permuted activations across adjacent transformer layers; Soter [26] morphs operators with scalar blinding coins and restores accumulated coins at enclave boundaries; TSQP [30] combines a learned dissimilar
model with quantization scaling; LoRO [43] obfuscates weights with a dense mask generated from low-rank factors; ArrowCloak [39] composes permutation, scaling, and a low-rank mask. A common primitive-level structural characterization of these schemes is lacking.
Attacks on obfuscation-based TSLP. Existing attacks rely heavily on expert intuition and lack a unified methodology. Zhang et al. [47] taxonomize TSDP schemes by which layers are shielded, without analyzing the algebraic structure of the obfuscation applied to offloaded layers. ArrowMatch [39] attacks schemes built on permutation and scaling by matching obfuscated columns against a public prior, with an attack design specific to these two primitives. LoRO [43] similarly attacks permutation-, scaling-, and sparse-mask-based schemes by exploiting their statistical proximity to a public prior, but its attack design relies heavily on hand-crafted heuristics.
Our work. We move the design of TSLP attacks and defenses beyond expert intuition. To this end, we introduce a unified algebraic abstraction over the representative obfuscation primitives studied in this paper. From this abstraction we derive a canonical structural form for the family generated by these primitives and a systematic attack against it, and extend the primitive set with two new constructs that close the structural channels exploited by the attack.
10 Conclusion
The rapid evolution of heuristic attacks and defenses for TEE-shielded LLM partitioning (TSLP) has substantially advanced this area, but it has also led to a fragmented design space dominated by point solutions. As a result, existing schemes are difficult to compare, evaluate, and extend in a principled manner. In this paper, we take a step toward systematizing this design space by introducing Unified Obfuscation Primitives, a primitive-level abstraction that captures representative defense mechanisms for TSLP. This abstraction enables us to identify a canonical structural boundary for the declared primitive family. Building on this foundation, we systematically attack this canonical form and extend the declared primitive family. Our evaluation demonstrates that the proposed attack can effectively recover the hidden obfuscation structure and build high-fidelity surrogate models across diverse obfuscation families, revealing fundamental limitations of lightweight obfuscation in TSLP systems.
References
[1] Marah Abdin, Jyoti Aneja, Hany Awadalla, Ahmed Awadallah, Ammar Ahmad Awan, Nguyen Bach, Amit Bahree, Arash Bakhtiari, Harkirat Behl, et al. 2024. Phi-3 Technical Report: A Highly Capable Language Model Locally on Your Phone. arXiv preprint arXiv:2404.14219 (2024). [2] Tom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel M. Ziegler, Jeffrey Wu, Clemens Winter, Christopher Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. 2020. Language Models are Few-Shot Learners. In Advances in Neural Information Processing Systems (NeurIPS), Vol. 33. 1877–1901. https://papers.nips.cc/paper/2020/hash/1457c0d6bfcb4967418bfb8ac142f64a-Abstract.html [3] Nicholas Carlini, Daniel Paleka, Krishnamurthy Dvijotham, Thomas Steinke, Jonathan Hayase, A. Feder Cooper, Katherine Lee, Matthew Jagielski, Milad Nasr,
Arthur Conmy, Eric Wallace, David Rolnick, and Florian Tramèr. 2024. Stealing Part of a Production Language Model. In Proceedings of the 41st International Conference on Machine Learning (ICML). PMLR. https://proceedings.mlr.press/v235/carlini24a.html
[4] Victor Costan and Srinivas Devadas. 2016. Intel SGX Explained. Cryptology ePrint Archive, Paper 2016/086. https://eprint.iacr.org/2016/086
[5] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. 2019. BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL-HLT). 4171–4186. doi:10.18653/v1/N19-1423
[6] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, and Neil Houlsby. 2021. An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale. In International Conference on Learning Representations (ICLR). https://openreview.net/forum?id=YicbFdNTTy
[7] Matt Fredrikson, Somesh Jha, and Thomas Ristenpart. 2015. Model Inversion Attacks that Exploit Confidence Information and Basic Countermeasures. In Proceedings of the 22nd ACM SIGSAC Conference on Computer and Communications Security (CCS). ACM, 1322–1333. doi:10.1145/2810103.2813677
[8] Gemini Team. 2023. Gemini: A Family of Highly Capable Multimodal Models. arXiv preprint arXiv:2312.11805 (2023).
[9] Tom Gunter, Zirui Wang, Chong Wang, et al. 2024. Apple Intelligence Foundation Language Models. arXiv preprint arXiv:2407.21075 (2024).
[10] Jiahui Hou, Huiqi Liu, Yunxin Liu, Yu Wang, Peng-Jun Wan, and Xiang-Yang Li. 2022. Model Protection: Real-Time Privacy-Preserving Inference Service for Model Privacy at the Edge. IEEE Transactions on Dependable and Secure Computing 19, 6 (2022), 4270–4284. doi:10.1109/TDSC.2021.3126315
[11] Weizhe Hua, Zhiru Zhang, and G. Edward Suh. 2018. Reverse Engineering Convolutional Neural Networks through Side-Channel Information Leaks. In Proceedings of the 55th Annual Design Automation Conference (DAC). ACM, 4:1–4:6. doi:10.1145/3195970.3196105
[12] Matthew Jagielski, Nicholas Carlini, David Berthelot, Alex Kurakin, and Nicolas Papernot. 2020. High Accuracy and High Fidelity Extraction of Neural Networks. In 29th USENIX Security Symposium (USENIX Security 20). USENIX Association, 1345–1362. https://www.usenix.org/conference/usenixsecurity20/presentation/jagielski
[13] Kalpesh Krishna, Gaurav Singh Tomar, Ankur P. Parikh, Nicolas Papernot, and Mohit Iyyer. 2020. Thieves on Sesame Street! Model Extraction of BERT-Based APIs. In International Conference on Learning Representations (ICLR). https://openreview.net/forum?id=Byl5NRFDR
[14] Alex Krizhevsky. 2009. Learning Multiple Layers of Features from Tiny Images. Technical Report. University of Toronto. https://www.cs.toronto.edu/~kriz/learning-features-2009-TR.pdf
[15] Taegyeong Lee, Zhiqi Lin, Saumay Pushp, Caihua Li, Yunxin Liu, Youngki Lee, Fengyuan Xu, Chenren Xu, Lintao Zhang, and Junehwa Song. 2019. Occlumency: Privacy-Preserving Remote Deep-Learning Inference Using SGX. In Proceedings of the 25th Annual International Conference on Mobile Computing and Networking (MobiCom). ACM, 46:1–46:17. doi:10.1145/3300061.3345447
[16] Qinfeng Li, Zhiqiang Shen, Zhenghan Qin, Yangfan Xie, Xuhong Zhang, Tianyu Du, Sheng Cheng, Xun Wang, and Jianwei Yin. 2024. TransLinkGuard: Safeguarding Transformer Models Against Model Stealing in Edge Deployment. In Proceedings of the 32nd ACM International Conference on Multimedia (MM). ACM, 3479–3488. doi:10.1145/3664467.3680786
[17] Zechun Liu, Changsheng Zhao, Forrest Landola, Chen Lai, Yuandong Tian, Igor Fedorov, Yunyang Xiong, Ernie Chang, Yangyang Shi, Raghuraman Krishnamoorthi, and Vikas Chandra. 2024. MobileLLM: Optimizing Sub-billion Parameter Language Models for On-Device Use Cases. In International Conference on Machine Learning (ICML).
[18] Fan Mo, Ali Shahin Shamsabadi, Kloelemis Katevas, Soteris Demetriou, Ilias Leontiadis, Andrea Cavallaro, and Hamed Haddadi. 2020. DarkneTZ: Towards Model Privacy at the Edge using Trusted Execution Environments. In Proceedings of the 18th International Conference on Mobile Systems, Applications, and Services (MobiSys). ACM, 161–174. doi:10.1145/3386901.3388946
[19] Tushar Nayan, Qiming Guo, Mohammed Aldunwari, Marcus Botacin, A. Selcuk Uluagac, and Ruimin Sun. 2024. So: All You Need to Know About On-Device ML Model Extraction – The Gap between Research and Practice. In 33rd USENIX Security Symposium (USENIX Security 24). USENIX Association, 5233–5250.
[20] Tribhuvanesh Orekondy, Bernt Schiele, and Mario Fritz. 2019. Knockoff Nets: Stealing Functionality of Black-Box Models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR). 4954–4963. doi:10.1109/CVPR.2019.00509
[21] Dario Pasquini, Evgenios M. Kornaropoulos, and Giuseppe Ateniese. 2025. LLMmap: Fingerprinting for Large Language Models. In 34th USENIX Security Symposium (USENIX Security 25). USENIX Association.
[22] Sandro Pinto and Nuno Santos. 2019. Demystifying Arm TrustZone: A Comprehensive Survey. Comput. Surveys 51, 6 (2019), 130:1–130:36. doi:10.1145/3291047
[23] Qwen Team. 2024. Qwen2.5 Technical Report. arXiv preprint arXiv:2412.15115. https://arxiv.org/abs/2412.15115
[24] Pranav Rajpurkar, Jian Zhang, Konstantin Lopyrev, and Percy Liang. 2016. SQuAD: 100,000+ Questions for Machine Comprehension of Text. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing (EMNLP). 2383–2392. doi:10.18653/v1/D16-1264
[25] Adnan Siraj Rakin, Md Hafizul Islam Chowdhury, Fan Yao, and Deliang Fan. 2022. DeepSteal: Advanced Model Extractions Leveraging Efficient Weight Stealing in Memories. In 2022 IEEE Symposium on Security and Privacy (SP). IEEE, 1157–1174. doi:10.1109/SP46214.2022.9833743
[26] Tianxiang Shen, Ji Qi, Jianyu Jiang, Xian Wang, Siyuan Wen, Xusheng Chen, Shixiong Zhao, Sen Wang, Li Chen, Xiaipu Luo, Fengwei Zhang, and Heming Cui. 2022. SOTER: Guarding Black-box Inference for General Neural Networks at the Edge. In 2022 USENIX Annual Technical Conference (USENIX ATC 22). USENIX Association, 723–738. https://www.usenix.org/conference/atc22/presentation/shen
[27] Reza Shokri, Marco Stronati, Congzheng Song, and Vitaly Shmatikov. 2017. Membership Inference Attacks Against Machine Learning Models. In 2017 IEEE Symposium on Security and Privacy (SP). IEEE, 3–18. doi:10.1109/SP.2017.41
[28] Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D. Manning, Andrew Y. Ng, and Christopher Potts. 2013. Recursive Deep Models for Semantic Compositionality Over a Sentiment Treebank. In Proceedings of the 2013 Conference on Empirical Methods in Natural Language Processing (EMNLP). 1631–1642. https://aclanthology.org/D13-1170
[29] Suprajna Sridhara, Antonby Bertschi, Benedict Schlüter, Mark Kuhne, Fabio Aliberti, and Shweta Shinde. 2024. ACAI: Protecting Accelerator Execution with ARM Confidential Computing Architecture. In 33rd USENIX Security Symposium (USENIX Security 24). USENIX Association.
[30] Yu Sun, Gaojian Xiong, Jianhua Liu, Zheng Liu, and Jian Cui. 2025. TSPQ: Safeguarding Real-Time Inference for Quantization Neural Networks on Edge Devices. In 2025 IEEE Symposium on Security and Privacy (SP). IEEE, 2114–2132. doi:10.1109/SP61157.2025.00001
[31] Zhichuang Sun, Ruimin Sun, Changming Liu, Amrita Roy Chowdhury, Long Lu, and Somesh Jha. 2023. ShadowNet: A Secure and Efficient On-Device Model Inference System for Convolutional Neural Networks. In 2023 IEEE Symposium on Security and Privacy (SP). IEEE, 1596–1612. doi:10.1109/SP46215.2023.00052
[32] Hugo Tourron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timothée Lacroix, Baptiste Rozière, Naman Goyal, Eric Hambro, Faisal Azhar, Aurélien Rodriguez, Armand Joulin, Edouard Grave, and Guillaume Lample. 2023. LLaMA: Open and Efficient Foundation Language Models. arXiv preprint arXiv:2302.13971. https://arxiv.org/abs/2302.13971
[33] Florian Tramér and Dan Boneh. 2019. Slalom: Fast, Verifiable and Private Execution of Neural Networks in Trusted Hardware. In International Conference on Learning Representations (ICLR). https://openreview.net/forum?id=jVorJcKQ
[34] Florian Tramér, Fan Zhang, Ari Juels, Michael K. Reiter, and Thomas Ristenpart. 2016. Stealing Machine Learning Models via Prediction APIs. In 25th USENIX Security Symposium (USENIX Security 16). USENIX Association, 601–618. https://www.usenix.org/conference/usenixsecurity16/technical-sessions/presentation/tramer
[35] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. 2017. Attention Is All You Need. In Advances in Neural Information Processing Systems (NeurIPS). 5998–6008. https://papers.nips.cc/paper/7181-attention-is-all-you-need
[36] Stavros Volos, Kapil Vaswani, and Rodrigo Bruno. 2018. Graviton: Trusted Execution Environments on GPUs. In 13th USENIX Symposium on Operating Systems Design and Implementation (OSDI 18). USENIX Association, 681–696.
[37] Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R. Bowman. 2018. GLUE: A Multi-Task Benchmark and Analysis Platform for Natural Language Understanding. In Proceedings of the 2018 EMNLP Workshop BlackboxNLP: Analyzing and Interpreting Neural Networks for NLP. 353–355. doi:10.18653/v1/W18-5446
[38] Binghui Wang and Neil Zhenqiang Gong. 2018. Stealing Hyperparameters in Machine Learning. In 2018 IEEE Symposium on Security and Privacy (SP). IEEE, 36–52. doi:10.1109/SP.2018.00038
[39] Pengli Wang, Bingyou Dong, Yifeng Cai, Zheng Zhang, Junlin Liu, Huanan Xue, Ye Wu, Yao Zhang, and Ziqi Zhang. 2025. Game of Arrows: On the (In)-Security of Weight Obfuscation for On-Device TEE-Shielded LLM Partition Algorithms. In 34th USENIX Security Symposium (USENIX Security 25). USENIX Association, 279–298. https://www.usenix.org/conference/usenixsecurity25/presentation/wang-pengli
[40] Qifan Wang and David Oswald. 2024. Confidential Computing on Heterogeneous CPU-GPU Systems: Survey and Future Directions. arXiv preprint arXiv:2408.11601. https://arxiv.org/abs/2408.11601
[41] Adina Williams, Nikita Nangia, and Samuel R. Bowman. 2018. A Broad-Coverage Challenge Corpus for Sentence Understanding through Inference. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL-HLT). 1112–1122. doi:10.18653/v1/N18-1101
[42] Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumond, Clement De-langue, Anthony Moi, Pierric Cistac, Tim Rault, Rémi Loeff, Morgan Funtowicz, Joe Davison, Sam Shleifer, Patrick von Platen, Clara Ma, Yacine Jernite, Julien Plu, Canwen Xu, Teven Le Scao, Sylvain Gugger, Mariama Drame, Quentin Lhoest, and Alexander M. Rush. 2020. Transformers: State-of-the-Art Natural Language Processing. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations (EMNLP). 38–45. doi:10.18653/v1/2020.emnlp-demos.6
[43] Gaojian Xiong, Yu Sun, Jianhua Liu, Jian Cui, and Jianwei Liu. 2025. LoRO: Real-Time On-Device Secure Inference for LLMs via TEE-Based Low Rank Obfuscation. In Advances in Neural Information Processing Systems (NeurIPS).
[44] Yuanyuan Yuan, Zhibo Liu, Sen Deng, Yanzuo Chen, Shuai Wang, Yingqian Zhang, and Zhendong Su. 2024. HyperTheft: Thieving Model Weights from TEE-Shielded Neural Networks via Ciphertext Side Channels. In Proceedings of the 2024 ACM SIGSAC Conference on Computer and Communications Security (CCS). ACM, 4346–4360.
[45] Yuanyuan Yuan, Zhibo Liu, Sen Deng, Yanzuo Chen, Shuai Wang, Yingqian Zhang, and Zhendong Su. 2025. CipherSteal: Stealing Input Data from TEE-Shielded Neural Networks with Ciphertext Side Channels. In 2025 IEEE Symposium on Security and Privacy (SP). IEEE, 4136–4154.
[46] Boyi Zeng, Lizheng Wang, Yuncong Hu, Yi Xu, Chenghu Zhou, Xinbing Wang, Yu Yu, and Zhouhan Lin. 2024. HuRef: HUMAN-Readable Fingerprint for Large Language Models. In Advances in Neural Information Processing Systems (NeurIPS).
[47] Ziqi Zhang, Chen Gong, Yifeng Cai, Yuanyuan Yuan, Bingyan Liu, Ding Li, Yao Guo, and Xiangun Chen. 2024. No Privacy Left Outside: On the (In-)Security of TEE-Shielded DNN Partition for On-Device ML. In 2024 IEEE Symposium on Security and Privacy (SP). IEEE, 3327–3345. doi:10.1109/SP54263.2024.00052
[48] Zheng Zhang, Na Wang, Ziqi Zhang, Yao Zhang, Tianyi Zhang, Jianwei Liu, and Ye Wu. 2024. GroupCover: A Secure, Efficient and Scalable Inference Framework for On-Device Model Protection Based on TEEs. In Forty-first International Conference on Machine Learning (ICML). OpenReview.net.
[49] Tong Zhou, Yukui Luo, Shaolei Ren, and Xiaolin Xu. 2023. NNSplitter: An Active Defense Solution for DNN Model via Automated Weight Obfuscation. In Proceedings of the 40th International Conference on Machine Learning (ICML) (Proceedings of Machine Learning Research, Vol. 202). PMLR, 42614–42624. https://proceedings.mlr.press/v202/zhou23h.html
[50] Yuankun Zhu, Yueqiang Cheng, Husheng Zhou, and Yantao Lu. 2021. Hermes Attack: Steal DNN Models with Lossless Inference Accuracy. In 30th USENIX Security Symposium (USENIX Security 21). USENIX Association, 1973–1988.
A Open Science
Our artifacts are publicly available at
https://github.com/gabber-gabber/Collapse.
B Ethical Considerations
This paper develops a model-extraction attack against a family of deployed defenses for on-device LLM inference. Publishing such work carries dual-use risk: the same pipeline that demonstrates the insecurity of could help a malicious device owner steal proprietary weights in practice.
We conclude that disclosure is justified and that the risks are outweighed by the benefits, for four reasons. (i) The defenses we break maybe already deployed; Table 2 lists peer-reviewed schemes from 2022–2025 at top-tier venues. Systematically characterizing their insecurity across the six canonicalized schemes is more actionable than yet another scheme-specific attack. (ii) Our threat model assumes a physically present, trusted-hardware-excluded adversary; the attack does not extend to cloud-only or API-only deployments. (iii) We provide a concrete defense ( , § 6) that, in our experiments, reduces the attacker's advantage over ordinary fine-tuning by an order of magnitude. (iv) We do not publish pre-extracted weights of any proprietary model; the evaluation uses publicly available pretrained checkpoints throughout, and our artifacts contain only the defense and attack implementations, not extracted victim parameters.
No live production system was targeted, and no personally identifiable or sensitive data was used in any experiment.
C Generative AI Usage
Per the CCS submission policy, we disclose that a large-language-model assistant (Claude Opus) was used during manuscript preparation in the following capacities:
-
Prose editing and tightening across all sections, including copy-editing, paragraph restructuring, and removal of redundancy. Every edit was reviewed by the authors.
-
Literature-review support for identifying canonical citations in the related-work space; each suggested reference was individually verified by the authors for venue, authors, and relevance.
D Sparse Mixing Matrix Construction
The sparse mixing operator in § 6 requires an invertible matrix P such that both P and remain sparse. A simple way to satisfy both requirements is to use constant-size block mixing.
Partition the column indices into groups with , where is a small constant ( in our setting). For each group, choose an invertible matrix . After applying an input permutation to gather the columns of the same group together, we construct
with permutation matrices. Then
Because each block has size at most , both and contain only nonzero entries. Obfuscation and recovery therefore require only linear-time sparse post-processing. One concrete instantiation uses blocks with , making every exposed column a linear combination of two original columns.
E Model Extraction Game
This appendix makes precise the model-extraction game summarized in Definition 1. We use the system and threat model of § 2.2 throughout.
Participants and deployment. The model owner fine-tunes the public pretrained model into the proprietary victim model and deploys it through the TEE-REE pipeline using an obfuscation scheme S. The scheme samples and refreshes its keys according to its declared schedule. The device-owner adversary is honest-but-curious: it follows the prescribed inference protocol and cannot compromise the TEE, but it controls the REE and records all information exposed there.
Available and hidden information. The adversary knows the model architecture, , and the public description and parameters of S. It may use labeled task data up to the declared budget B. Across key refreshes, it records at most T distinct exposed views. For every offloaded layer in view t, this includes the released input, the obfuscated weight, and the REE-computed product. We write this layer-level observation as
Let denote the labeled task data available to the adversary, where , and let denote outputs available through the normal inference interface. The adversary's complete view is
where contains the public description and parameters of the deployed scheme. The victim weights, private fine-tuning data, obfuscation keys, recovery state, and post-recovery values inside the TEE remain hidden.
Attack and output. Let be any polynomial-time attack algorithm. Within the budgets and , may jointly process all public information and recorded views and may choose later protocol-valid queries based on earlier observations. It outputs a surrogate model (the of § 2.2) intended to reproduce the task behavior of :
The compact view notation includes the entire protocol-valid interaction; it does not restrict the attack to a particular extraction method. The adversary's goal is to maximize the surrogate's task accuracy.
Winning condition. After the attack terminates, the surrogate and victim models are evaluated on the same evaluation set . The attack succeeds if
Here, denotes the task accuracy of on , and is the allowed accuracy gap from the victim model. This criterion defines attack success; it does not by itself assert that a particular obfuscation scheme prevents every such attack.
F Proof of the Composition Theorem
PROOF OF THEOREM 1. Let . For an admissible input and weight , let and . Correctness of the two primitives gives
Applying the recoveries in reverse proves (i). Since the composition executes each primitive once, the additive cost model gives
which proves (ii).
For (iii), let and assume a polynomial-time full-transcript simulator under the same budgets such that
For any polynomial-time attack on , is an attack on with the same surrogate-output distribution and hence the same winning condition. Thus, every successful attack on induces one on . Applying this argument to both and proves (iii).
G Attack Strategy under Fully Refreshed Components
This appendix discusses an attack strategy for the alternative schedule in which all four obfuscation components are refreshed across views:
The attack retains the same three-stage structure as COLLAPSE in the main text: Stage 1 aligns the relative permutations, Stage 2 removes the low-rank terms, and Stage 3 recovers the absolute column order and scales before fine-tuning. The difference is that is no longer shared across views and therefore also appears in cross-view differences. To handle this, the attacker repeats each LDD query on different row subsets. Clean subsets provide the normal rank used for permutation alignment, whereas subsets that contain a nonzero entry of produce an additional rank increase. By recording which sampled positions cause these increases, the attacker estimates the support of each and excludes those entries when recovering the low-rank terms.
Stage 1: permutation alignment and support localization. The original LDD test computes the rank of two column blocks using all rows. Here, the attacker instead repeats each test on small random subsets of rows. If a sampled block contains no nonzero entry from either or , the sample is clean and obeys the same rank-overlap relation used in Stage 1: the rank reveals how many victim columns the two blocks share. If the sample intersects a sparse entry, the additional perturbation generally increases the rank. Repeating the test and taking the smallest stable rank therefore recovers the clean LDD result. The seed, disambiguation, and propagation procedures from the main attack can then be applied without change to recover the relative permutation between the two views.
The same tests also reveal the sparse support. Whenever the observed rank is larger than the clean rank, the sampled row-column positions receive an anomaly vote. The attacker repeats this test with different row subsets and different column blocks. Positions containing a sparse perturbation receive such votes consistently, whereas clean positions do not. Aggregating the votes across view pairs yields an estimated support for each . Stage 1 thus outputs the relative permutations together with a support estimate for every view.
Stage 2: masked removal of the low-rank terms. After aligning the permutations, the attacker estimates the relative column scales using only entries outside the estimated sparse supports. Let denote the resulting view in the anchor's column order and scale. For two views a and b, their difference is
Let . Outside this set, the sparse difference disappears, leaving
After excluding , the difference contains only the low-rank terms and reduces to the setting of the original Stage 2. The original Stage 2 procedure then produces an estimate of outside the sparse support; the excluded entries are passed to Stage 3 for fine-tuning.
Stage 3: absolute alignment and fine-tuning. Stage 3 receives the Stage 2 estimate of outside the sparse support and directly reuses the original Stage 3 procedure for absolute alignment, scale recovery, and fine-tuning. The attack therefore succeeds under the fully refreshed schedule.