Large Language Models (LLMs) are increasingly served on shared accelerators where an adversary with read access to device memory can observe KV caches and hidden states, threatening prompt privacy for open-source models. Cryptographic protections such as MPC and FHE offer strong guarantees but remain one to two orders of magnitude too slow for interactive inference, while static obfuscation schemes break under multi-run statistical attacks once the model is known. We present GELO (Good-Enough LLM Obfuscation), a lightweight protocol for privacy-preserving inference that limits information leakage from untrusted accelerator observations by hiding hidden states with fresh, per-batch invertible mixing. For each offloaded projection, the TEE samples a random matrix A, forms U=AH, offloads U and weights W to the accelerator, and then applies A−1 on return, so that A−1((AH)W)=HW and outputs are unchanged. Because mixing is never reused across batches, the attacker faces only a single-batch blind source separation problem. We analyse information leakage and introduce two practical defences: (i) non-orthogonal mixing to mask Gram matrices, and (ii) orthogonal mixing augmented with a small fraction of high-energy "shield" vectors that pollute higher-order statistics. On Llama-2 7B, GELO preserves float32 outputs exactly, closely matches low-precision baselines, and shows about 20--30% compute-side overhead in a controlled offload microbenchmark; an unoptimized remote prototype is dominated by transport overhead, motivating deeper serving-engine integration. GELO resists ICA/BSS and anchor-assisted attacks; a 60M-parameter transformer-based unmixing attack also fails under strong mixing and shielding.
Figures & tables
Figure 1: GELO protocol overview. The diagram illustrates the Q/K/V projections; the same procedure is also applied to the output projection ( O ).
Precision
Top-1 Equality
Logit MSE
Mean per-token L2
float32
1.000000
9.320817×10−11
0.000902
bfloat16
0.988045
1.813321×10−3
6.179683
float16
0.998450
4.312208×10−5
0.793820
Table 1: Functional equality between baseline and GELO-obfuscated inference across precisions.
Batch size n
Overhead (%)
GELO total (ms)
Baseline (ms)
64
28.9
4.49
3.48
128
29.2
5.79
4.48
256
19.9
8.93
7.44
512
20.1
16.11
13.41
1024
26.2
30.36
24.06
2048
32.8
60.31
45.41
Table 2: Latency and overhead versus batch size.
Step
GELO (ms)
% of total
Baseline (ms)
A-gen (QR)
2.322
13.3%
–
Mix ( A⋅H )
0.199
1.1%
0.000
GEMM ( U⋅W )
0.441
2.5%
0.443
Un-mix ( A−1⋅Y )
0.272
1.6%
0.000
Copy (socket+I/O)
14.186
81.4%
14.123
Total
17.420
100.0%
14.566
Table 3: Latency breakdown at n=512 .
Metric
Value
Percentage
Total Embeddings
10,000,165
100%
Unique Embeddings
8,359,390
83.6%
Duplicate Embeddings
1,640,775
16.4%
Table 4: Duplicate analysis over 10,000,165 embeddings.
#
Hash
Count
Token IDs
Tokens
1
cd167d7d34197d98
427
29871
SPIECE_UNDERLINE
2
bec72f2782bf3be5
353
450
_The
3
1dfdd463904c2fcf
218
13
newline
4
c057b29aa81c90fb
218
13
newline
5
41cbbddc2cb91529
124
319
_A
Table 5: Top 5 most frequent embedding hashes.
Known anchors ( k )
Projection
Subtraction
Constrained ICA
0
0.341
0.341
0.341
2
0.323
0.323
0.328
5
0.317
0.315
0.316
10
0.301
0.310
0.258
20
0.283
0.288
0.237
40
0.245
0.256
0.207
Table 6: Non-anchor recovery quality ( 95th-percentile of cosine similarity) versus number of known anchors k .
Figure 2: 95th percentile cosine similarity of recovered tokens versus padding scale. Each batch is augmented with 5% random Gaussian shield rows at varying scales; no exact token repeats are allowed.
Figure 3: Median cosine similarity of recovered tokens versus padding scale. Each batch is augmented with 5% random Gaussian shield rows at varying scales; no exact token repeats are allowed. Marker shapes denote attack method (ICA, JADE, JD).
Figure 4: Median Gram error of recovered tokens versus padding scale. Each batch is augmented with 5% random Gaussian shield rows at varying scales; no exact token repeats are allowed. Marker shapes denote attack method (ICA, JADE, JD).
Kind
Fraction range
Scale range
Randomization
llama2 train/val
Qwen train/val
Manifold
0.05
1
none
0.8318 / 0.8212
0.8333 / 0.7561
Manifold
0.01–0.14
5–30
log-uniform
0.0704 / 0.0723
0.5370 / 0.5401
Manifold
0.05
5
none
0.5330 / 0.4990
0.5845 / 0.5214
Gaussian
0.05
2.5–20
log-uniform
0.4584 / 0.3700
0.4890 / 0.4094
Gaussian
0.05
10
none
0.4749 / 0.5010
0.4554 / 0.3907
Student- t
0.05
10
none
0.3115 / 0.3042
0.3659 / 0.3828
Table 9: Transformer-based learned retrieval attack results across shield-vector distributions, shield-fractions, and scales. Each result reports final retrieval mass as train / val , where train is measured on the training candidate pool and val is measured on the held-out validation split. Chance positive mass = 0.0625
Shield
Positives/text
Tokens/text
Obs rows
Sinkhorn ( ϵ , iters)
OT weight
train/val
manifold, frac 0.01–0.10, scale 1–20
2–8
8–96
0.96
(5.0, 50)
0.1
0.0788 / 0.0678
manifold, frac 0.01–0.10, scale 1–20
2–8
8–96
0.80
(5.0, 50)
1
0.0750 / 0.0691
gaussian, frac 0.05, scale 5
2–8
8–96
0.96
(5.0, 50)
0.1
0.0703 / 0.0625
gaussian, frac 0.05, scale 5
4
64
0.96
(5.0, 50)
0.1
0.2800 / 0.2712
gaussian, frac 0.05, scale 5
4
64
0.96
(0.1, 30)
1
0.4181 / 0.4144
gaussian, frac 0.00, scale 5
4
64
1
(5.0, 50)
0.1
0.4431 / 0.4375
Table 10: Token-level unmixing attack results. The final column reports global-assignment same-embedding probability mass as train / val , where train is measured against the training candidate pool and val on held-out validation set. Higher is better for the attacker; chance mass is approximately 0.065.
The rapid development of large language models (LLMs) has driven the widespread adoption of cloud-based LLM inference services, while also bringing prominent privacy risks associated with the transmission and processing of private data in remote inference. For privacy-preserving LLM inference technologies to be practically applied in industrial scenarios, three core requirements must be satisfied simultaneously: (1) Accuracy and efficiency losses should be minimized to mitigate degradation in service experience. (2) The inference process can be run on large-scale clusters consist of heterogeneous legacy xPUs. (3) Compatibility with existing LLM infrastructures should be ensured to reuse their engineering optimizations. To the best of our knowledge, none of the existing privacy-preserving LLM inference methods satisfy all the above constraints while delivering meaningful privacy guarantees. In this paper, we propose AloePri, the first privacy-preserving LLM inference method for industrial applications. AloePri protects both the input and output data by covariant obfuscation, which jointly transforms data and model parameters to achieve better accuracy and privacy. We carefully design the transformation for each model component to ensure inference accuracy and data privacy while keeping full compatibility with existing infrastructures of Language Model as a Service. AloePri has been integrated into an industrial system for the evaluation of mainstream LLMs. The evaluation on Deepseek-V3.1-Terminus model (671B parameters) demonstrates that AloePri causes accuracy loss of 0.0%~3.5% and exhibits efficiency equivalent to that of plaintext inference. Meanwhile, AloePri successfully resists state-of-the-art attacks, with less than 5% of tokens recovered. To the best of our knowledge, AloePri is the first method to exhibit practical applicability to large-scale models in real-world systems.
User prompts provided to large language models (LLMs) may contain private information. One way to protect them is to execute the LLM inside a trusted execution environment (TEE). However, this results in slow inference times as current TEEs are significantly slower than GPUs for LLM inference. To circumvent this, Tramèr and Boneh (2019) proposed Slalom which splits neural network inference between a TEE and an untrusted GPU. They encrypt inputs to computations outsourced to the GPU. In this paper, we extend this split-inference architecture to LLM inference and instead protect intermediate inputs using differential privacy (DP). We first demonstrate that masking intermediate representations is necessary by showing an 80% accuracy on a prompt-reconstruction attack from these representations. Our main contribution is a global sensitivity analysis of key functions in LLM inference, which bounds the required scale of DP noise. Unlike encryption, DP avoids quantization, allowing the LLM to remain in the floating-point domain. We also derive an upper bound on the floating-point error from masking and subsequent noise cancellation as a function of the privacy parameter epsilon, keeping the same quality of the LLM response. We implement our architecture using the Intel TDX TEE and two LLMs: Llama-3.2-3B and Qwen3-4B. Our split execution is nearly twice as fast as fully TDX-based inference. Moreover, it is at most 43% faster than Slalom while achieving higher accuracy. Finally, we demonstrate that prompt reconstruction, even with knowledge of the DP mechanism, cannot recover more information than is contained in an unrelated prompt.
Shashie Dilhara Batan Arachchige, Robin Carpentier, Hassan Jameel Asghar +1
Running large language models locally is often impractical, pushing inference on sensitive text to third-party providers. Split inference partially mitigates this by keeping tokens on the client and sending only hidden representations, but these representations can still be recovered via nearest-neighbor search against the public embedding table. We propose an orthogonal obfuscation procedure in which the client multiplies embeddings by a secret orthogonal matrix before transmission. To enable correct inference under arbitrary rotations, we introduce ConjFormer, a transformer variant that is exactly O(d)-equivariant via a lightweight normalization change (scalar RMSNorm) together with blockwise orthogonal conjugation of all linear weights. As a result, the server performs the full forward pass entirely in the rotated basis and never observes unrotated hidden states. Experiments on GPT-2 and Llama 3.2 1B models fine-tuned on PubMed show that orthogonal obfuscation eliminates direct cosine nearest-neighbor inversion and reduces token recovery from over 35% top-10 to at most 1.3%, while increasing perplexity by only 0.4% after fine-tuning. These results indicate that enforcing symmetry at the architectural level can provide a practical defense for privacy-preserving LLM inference without noise injection or heavy cryptographic machinery.
Alexander Yukhimchuk, Andrey Shulga, Mladen Kolar +1