Introduction
As Quantum Neural Networks (QNNs) transition from theoretical constructs to practical tools, they are increasingly deployed via "Quantum-Neural-Network-as-a-Service" (QNNaaS) platforms. In this model, providers like IBM or Google host proprietary models, allowing users to submit data and receive predictions for a fee. However, this accessibility introduces a significant security vulnerability: model extraction attacks. In these attacks, an adversary queries the service to build a local "substitute" model that mimics the victim's performance, effectively stealing intellectual property and bypassing future service fees.
Traditional extraction attacks struggle in the quantum domain due to two primary factors: the high cost of quantum queries and the volatile nature of Noisy Intermediate-Scale Quantum (NISQ) hardware. CopyQNN is a novel framework designed to overcome these hurdles, enabling high-fidelity model extraction with significantly higher efficiency and resilience to hardware noise.
The Challenges of Quantum Model Extraction
Existing model extraction techniques often assume a stable environment, but real-world quantum hardware is characterized by varying quantum noise. Noise levels on NISQ devices fluctuate throughout the day, meaning the same input can yield different results depending on when it is processed. This temporal drift leads to "unreliable labels" that degrade the quality of a stolen model.
Furthermore, prohibitive costs act as a barrier to entry. With quantum computing time costing upwards of $90 per minute, previous attack methods requiring thousands of queries are financially impractical and easily detected by service providers monitoring for anomalous traffic.
The CopyQNN Framework
CopyQNN addresses these challenges through a three-stage pipeline that prioritizes data quality and training efficiency.
1. Multi-Round Querying and Noise Characterization
Instead of a single bulk query, CopyQNN distributes queries over a 24-hour period. By querying the victim model in multiple rounds, the attacker can measure the variance of the probability outputs for each data point. This allows the framework to characterize how specific inputs react to the hardware's shifting noise profile.
2. Data Cleaning via the "Remember Ratio"
Counter-intuitively, the researchers found that samples with the lowest variance across different time intervals were not necessarily the most accurate; often, they were "consistently wrong" due to inherent hardware bias. CopyQNN utilizes a metric called the Remember Ratio (RR) to filter the query results. By identifying and keeping only the samples that provide a reliable signal amidst the noise, the attacker ensures the substitute model is trained on high-quality data.
3. Quantum Contrastive Knowledge Transfer
To minimize expensive cloud queries, CopyQNN shifts the majority of the computational burden to local resources using a hybrid training strategy:
- Quantum Encoder (QEnc): The attacker pre-trains a local encoder on an unlabeled dataset using Contrastive Learning (specifically the Barlow Twins objective). This allows the model to learn general feature representations without needing any labels from the victim service.
- Quantum Classifier (QClassifier): A small, task-specific head is then attached to the encoder. This is the only component trained using the "cleaned" labels obtained from the QNNaaS provider. This Transfer Learning approach allows the substitute model to achieve high fidelity with a fraction of the labeled data.
Experimental Results
The framework was evaluated on the 127-qubit IBM_Brisbane quantum computer using the MNIST and Fashion-MNIST datasets. The results demonstrate a significant leap in both performance and stealth:
- Accuracy Gains: CopyQNN outperformed the previous state-of-the-art (QuantumLeak) by an average of 8.73%. In certain tasks, such as distinguishing between MNIST digits 6 and 7, the accuracy improvement reached 29%.
- Query Efficiency: CopyQNN achieved these results using only 40 to 200 queries, representing a 90x reduction compared to the 6,000 queries required by previous methods. This reduction makes the attack both more affordable and harder for providers to detect.
- Hardware Practicality: The substitute models remained efficient, requiring only a 20% increase in quantum gate parameters, ensuring they can run effectively on current NISQ devices.
Conclusion
CopyQNN demonstrates that the fluctuating noise of quantum hardware, once thought to be a defense against extraction, can be characterized and bypassed. By combining temporal noise analysis with contrastive transfer learning, CopyQNN proves that proprietary QNNs can be stolen with high precision and minimal cost. As QNNaaS continues to grow, these findings highlight an urgent need for more robust defensive measures and noise-aware security protocols in the quantum cloud.
Summary updated