Summary
AttestLLM is a novel framework designed to protect the intellectual property of hardware vendors by ensuring only authorized, billion-parameter LLMs can run on edge devices. By co-designing the watermarking algorithm with Trusted Execution Environment (TEE) system optimizations, it overcomes the severe memory limits of mobile processors, providing robust, on-the-fly model verification with minimal impact on inference speed or text generation quality.
Problem Statement
Running Large Language Models (LLMs) directly on edge devices (like smartphones or laptops) is great for user privacy and reducing latency. To make this work, hardware vendors invest heavily in co-designing model compression (like 4-bit quantization) with their specific silicon architectures. This optimized model setup is highly valuable Intellectual Property (IP).
However, untrusted third parties in the supply chain (e.g., resellers) can easily swap out these vendor-optimized models for unauthorized, unsafe, or poorly performing ones. While we can traditionally use a Trusted Execution Environment (TEE)—like ARM TrustZone—to verify software legitimacy (a process called attestation), TEEs on edge devices typically only have 10 to 32 MB of secure memory. You simply cannot fit a billion-parameter LLM into 32 MB to verify it. Existing solutions either only work for tiny neural networks or require painfully slow, segment-by-segment execution inside the TEE, ruining the user experience.
Methodology
AttestLLM solves this scalability bottleneck through an algorithm/software/hardware co-design split into two phases: offline watermarking and online attestation.
1. Offline Watermarking (Algorithm)
Instead of watermarking the weights directly, AttestLLM embeds device-specific signatures into the activations of specific LLM layers using a secret trigger dataset.
- Sensitivity Analysis: It profiles the LLM to see which layers are most sensitive. Highly active, salient layers get fewer watermark bits, while less critical layers absorb more, preserving the model's reasoning capabilities.
- Two-Stage Optimization: Because quantization destroys standard watermarks, the authors use a pre-quantization (gradient-based) and post-quantization (zeroth-order) optimization process to ensure the watermark survives the transition to 8-bit or 4-bit integers.
2. Online Attestation (System/Hardware)
The LLM runs normally in the untrusted Rich Execution Environment (REE). Periodically, the system pauses to verify the model.
- Virtualization-based Enclave: AttestLLM uses a hypervisor to expand the TEE's memory capacity beyond the standard 32 MB limit.
- Dynamic Sampling & Pipelining: Instead of checking the whole model, it randomly samples a few layers. To hide the latency, it dedicates one TEE thread to securely copying the next layer into memory while other threads cryptographically verify the previous layer's watermark.
Key Results and Evaluation
The framework was evaluated using several datasets, including C4 for profiling, SimCSE for triggers, and WikiText, LAMBADA, HellaSwag, PIQA, and WinoGrande for quality. Malicious attacks were simulated using ToxicChat.
- Perfect Reliability: AttestLLM achieved a 100% Watermark Extraction Rate (WER) and 100% Attest Pass Rate across Llama 3 (1B, 3B, 8B), Qwen 3 (4B, 8B), and Phi-4 (15B) models.
- Preserved Model Quality: The watermarking process barely touches model fidelity. For INT4 models, perplexity degraded by an average of only 0.62%, and zero-shot accuracy dropped by a negligible 0.09%.
- Massive Efficiency Gains: Compared to "TEE-shield" methods (which run the model entirely inside the TEE), AttestLLM is incredibly fast. It reduces latency overhead by 62x (imposing only a 9.3% overhead vs. 472.8% for INT4) and reduces energy overhead by 30x (7.3% vs. 87.8%).
- Robustness: The system successfully detected and blocked partial model replacement attacks (e.g., an attacker fine-tuning just 4 out of 32 layers on a toxic dataset) and proved resilient against watermark forgery.
Key Insights
- Activation-based watermarking enables modular checking: By anchoring the watermark to a layer's output activations rather than its static weights, AttestLLM can verify the model layer-by-layer. You don't need the whole model in memory at once.
- Probabilistic security beats exhaustive checks: You don't need to verify all 32+ layers of an LLM to know it's safe. By randomly sampling just 4 layers every 100 tokens, the probability of an attacker successfully evading detection over a standard 1,000-token conversation drops to near zero ($7.1 \times 10^{-3}$).
- Quantization-aware watermarking is mandatory for the edge: Standard watermarks get destroyed when a model is compressed to 4-bit (INT4). By applying a secondary, zeroth-order optimization after quantization, the watermark remains robust without destroying the discrete weight distributions.
Limitations and Future Work
- Side-Channel Vulnerabilities: The authors acknowledge that sophisticated side-channel attacks (e.g., timing or power analysis) are out of scope for this paper. Existing orthogonal defenses against side-channels would need to be integrated to fully harden the system.
- Hyperparameter Trade-offs: The system requires manual tuning of the attestation interval ($f$) and the number of layers sampled ($k$). Future work could explore dynamically adjusting these parameters based on real-time threat heuristics.
Summary updated