DistilLock: Safeguarding LLMs from Unauthorized Knowledge Distillation on the Edge

Asmita Mohanty, Gezheng Kang, Lei Gao, Murali Annavaram

TL;DR

This paper introduces DistilLock, a novel framework that enables privacy-preserving knowledge distillation of Large Language Models (LLMs) on edge devices. By combining Trusted Execution Environments (TEEs) with model obfuscation, DistilLock safeguards both user data privacy and the intellectual property of proprietary LLM owners during on-device fine-tuning.

What Problem Does This Paper Address?

Large Language Models (LLMs) are incredibly powerful, but fine-tuning them typically requires sending sensitive user data to cloud servers. This raises significant privacy concerns. An alternative is to fine-tune LLMs directly on edge devices (like smartphones or laptops) using local data, which keeps data private. However, this creates a new problem: the LLM owner must send their valuable, proprietary LLM to the user's device, risking intellectual property (IP) theft. DistilLock aims to solve this by allowing secure, on-device fine-tuning without exposing the original LLM's weights or the user's private data.

Methods

DistilLock employs a two-pronged approach:

  1. Model Obfuscation: Before the proprietary LLM is sent to the edge device, its parameters are transformed using permutation matrices. This obfuscation ensures that the model's functionality is preserved for authorized use but makes it difficult to reverse-engineer or understand the original weights.
  2. TEE-Assisted Authorization: The obfuscated LLM is then executed within a Trusted Execution Environment (TEE) on the user's device. TEEs are hardware-protected secure enclaves that shield code and data from the rest of the system. DistilLock uses the TEE for lightweight authorization, ensuring that the model only performs its intended function (knowledge distillation) when properly invoked. Crucially, to maintain efficiency, most of the compute-heavy operations are offloaded to untrusted accelerators (like GPUs) using the obfuscated weights. The TEE's role is primarily to manage the secure execution and authorization, not to perform the entire LLM computation.

This combination allows the LLM to act as a "secure black-box teacher" for knowledge distillation on the edge, protecting both the model's IP and the user's data.

Datasets

  • Training/Fine-tuning: Alpaca dataset.
  • Evaluation: HellaSwag, CommonsenseQA, SST-2, ARC-e, ARC-c, BoolQ, RTE, QQP, QNLI.

The paper does not introduce new benchmarks but uses established NLP datasets for evaluating the performance of fine-tuned models and the effectiveness of the defense against model extraction attacks.

Key Insights and Ideas

  • Bridging the Privacy-IP Gap: DistilLock elegantly addresses the inherent tension between user data privacy and model owner IP protection in edge LLM personalization.
  • TEE as an Enabler, Not a Bottleneck: By offloading most computations to untrusted accelerators and using the TEE only for authorization and lightweight operations, DistilLock avoids the performance penalty often associated with TEEs.
  • Obfuscation for Security and Efficiency: The permutation-based obfuscation is key to both protecting the model's weights and enabling efficient offloading, a significant improvement over methods that might require full TEE execution.
  • Robustness Against Sophisticated Attacks: The framework is designed to thwart not just direct unauthorized distillation but also more advanced model-stealing attacks like surrogate training.

Key Results

  • Effective Lockdown: DistilLock successfully prevents unauthorized knowledge distillation. When unauthorized, the student model's performance collapses, indicating the obfuscated teacher provides no useful learning signal.
  • Accuracy Gains: Authorized knowledge distillation using DistilLock leads to significant accuracy improvements for the student models compared to their pre-distillation baselines.
  • Superior Security: In adversarial training scenarios, DistilLock consistently achieved the lowest attack success rates across various tasks and models, outperforming existing defense mechanisms like DarkneTZ and ShadowNet. On average, it reduced surrogate model accuracy to 0.98x relative to a black-box baseline.
  • Efficiency: DistilLock incurs minimal TEE computation overhead, requiring less than 1.2% of total FLOPs, making it significantly more efficient than other TEE-based defense schemes.

Limitations and Future Work

The authors acknowledge several limitations:

  • TEE Specificity: The current implementation is tied to Intel SGX and has not been extended to other TEEs like ARM TrustZone or emerging GPU TEEs.
  • Potential for Future Attacks: While robust against current attacks, future adaptive attacks (e.g., side-channel leakage, advanced surrogate training) might challenge its guarantees.
  • Scope of Evaluation: The evaluation was limited to standard KD settings and datasets. The effectiveness of DistilLock with advanced distillation variants or more complex scenarios remains an open question.

Future work could involve extending DistilLock to other TEE platforms, exploring its efficacy with advanced distillation techniques, and investigating its resilience against novel attack vectors.

Summary updated

BibTeX
@inproceedings{mohanty2025distillock,
  author = {Asmita Mohanty and Gezheng Kang and Lei Gao and Murali Annavaram},
  title = {{DistilLock: Safeguarding LLMs from Unauthorized Knowledge Distillation on the Edge}},
  booktitle = {Lock-LLM @ NeurIPS},
  year = {2025},
  url = {https://openreview.net/forum?id=gvO9XACLf1},
}
Figure