Locking Machine Learning Models into Hardware

Eleanor Clifford, Adhithya Saravanan, Harry Langford, Cheng Zhang, Yiren Zhao, Robert D. Mullins, Ilia Shumailov, Jamie HayesSaTML 2024 · OpenReview

TL;DR

This paper introduces "ML Hardware Locking," a novel approach to protect valuable machine learning models by binding them to specific hardware. By making models inefficient or non-functional on unauthorized hardware, this method offers a practical alternative to complex confidential computing techniques for IP protection and responsible AI deployment.

What Problem Does This Paper Address?

The increasing value of machine learning (ML) models as intellectual property (IP) creates a strong incentive to protect them, especially when deployed on user devices. Traditional methods like access control policies and centralized serving have limitations: policies can be bypassed, and centralized serving is resource-intensive and requires an internet connection. Existing confidential computing technologies (e.g., homomorphic encryption) are often too complex or impractical for widespread adoption. The core challenge is to prevent unauthorized use or reverse-engineering of ML models when they are deployed on potentially untrusted hardware, without resorting to overly burdensome solutions.

Methods

The authors propose "ML Hardware Locking," which aims to make ML models usable only on specific, authorized hardware. This is achieved through two main categories of mechanisms:

  • Soft Locking: These methods don't outright prevent execution but significantly degrade performance or accuracy on unauthorized hardware.
  • Sparsity-aware locking: Models are fine-tuned to be highly sensitive to specific pruning levels. On unauthorized hardware lacking optimized sparse computation, performance drops drastically.
  • Quantization-aware locking: Models are trained to be incompatible with certain quantization schemes. Running them on hardware that doesn't support the expected arithmetic precision leads to significant accuracy degradation.
  • Hard Locking: These methods aim to make models completely non-functional on unauthorized hardware by tying them to specific hardware characteristics.
  • Device Fingerprinting: This involves using unique hardware properties (e.g., clock cycle counts, finite precision errors, PUF characteristics) to generate a high-entropy "fingerprint."
    • Parameter Transformation: The model's parameters are transformed using this fingerprint. The transformed model can only be correctly detransformed and executed on authorized hardware that possesses the correct fingerprint. Three transformation methods are explored: AES encryption, parameter shuffling, and a novel pre-transformed AES encryption for better indistinguishability.

Datasets

The paper uses a variety of standard datasets for training and evaluation, including:

  • Vision: CIFAR10, CIFAR100, Flowers102
  • Language: GLUE tasks (COLA, MRPC, SST-2)

The authors mention using pre-trained models (e.g., ResNet18, ResNet50, ViT-B_16-224, BERT) and fine-tuning them on these datasets.

Key Insights and Ideas

  • Hardware as a Key: The core idea is to leverage inherent hardware asymmetries and properties as a form of "key" to lock ML models, bypassing the need for traditional cryptographic keys or complex secure enclaves.
  • Soft Locking for Deterrence: Soft locking methods are surprisingly effective at degrading performance on unauthorized hardware, acting as a strong deterrent against casual misuse or basic reverse-engineering attempts.
  • Hard Locking for Robust Protection: Hard locking, by binding models to specific hardware fingerprints, offers a more robust security guarantee, making unauthorized deployment practically impossible without the correct hardware.
  • Negligible Overhead: A significant finding is that these locking mechanisms, both soft and hard, introduce minimal overhead in terms of computational cost or model size when running on authorized hardware.
  • Feasibility Demonstrated: The paper provides concrete experimental evidence that these locking mechanisms are not just theoretical but practically feasible across various hardware platforms and model architectures.

Key Results

  • Soft Locking Effectiveness: Sparsity-aware and quantization-aware locks demonstrated significant accuracy degradation (large $\Delta_{lock}$ values) on unauthorized hardware, while maintaining high accuracy ($small \Delta_{orig}$ values) on authorized hardware. For instance, locked models experienced accuracy drops of up to 0.75 on unauthorized hardware.
  • Hard Locking Security: The hard locking methods, particularly pre-transformed AES encryption, showed perfect destruction (model performance drops to random guessing) on unauthorized hardware.
  • Low Overhead: Soft locking methods added negligible overhead to authorized hardware execution. Hard locking transformations were computationally tractable, with costs ranging from 0.3 to 2.7 seconds for small models.
  • Emulation Costs: Emulating hardware features on unauthorized platforms to run locked models incurred significant performance penalties, with latency increasing by 2-3.5x and throughput decreasing by a similar factor.

Limitations and Future Work

  • Adversary Model: The authors acknowledge that their mechanisms are not designed to protect against adversaries with physical access to the authorized hardware or those capable of sophisticated side-channel attacks.
  • Re-training Attacks: For soft locking, adversaries with access to training data could potentially re-train the model to recover performance on unauthorized hardware, though this requires significant effort and may not fully restore original accuracy.
  • Hardware Specificity: Hard locking mechanisms are inherently tied to specific hardware, which could limit deployment flexibility.
  • Future Work: The authors suggest exploring combinations of soft and hard locking, investigating more sophisticated hardware fingerprints, and further research into defending against stronger adversaries. They also highlight the potential for these techniques in enabling responsible AI governance and secure on-device ML deployment.

Summary updated

Abstract

Modern machine learning (ML) models are expensive IP and business competitiveness often depends on keeping this IP confidential. This in turn restricts how these models are deployed; for example, it is unclear how to deploy a model on-device without inevitably leaking the underlying model. At the same time, confidential computing technologies such as multi-party computation or homomorphic encryption remain impractical for wide adoption. In this paper, we take a different approach and investigate the feasibility of ML-specific mechanisms that deter unauthorized model use by restricting the model to only be usable on specific hardware, making adoption on unauthorized hardware inconvenient. That way, even if IP is compromised, it cannot be trivially used without specialised hardware or major model adjustment. In a sense, we seek to enable cheap locking of machine learning models into specific hardware. We demonstrate that locking mechanisms are feasible by either targeting efficiency of model representations, making such models incompatible with quantization, or tying the model's operation to specific characteristics of hardware, such as the number of clock cycles for arithmetic operations. We demonstrate that locking comes with negligible overheads, while significantly restricting usability of the resultant model on unauthorized hardware.
BibTeX
@inproceedings{clifford2024locking,
  author = {Eleanor Clifford and Adhithya Saravanan and Harry Langford and Cheng Zhang and Yiren Zhao and Robert D. Mullins and Ilia Shumailov and Jamie Hayes},
  title = {{Locking Machine Learning Models into Hardware}},
  booktitle = {SaTML},
  year = {2024},
  url = {https://openreview.net/forum?id=VWjj0IfYmQ},
}
Figure