QDoor: Exploiting Approximate Synthesis for Backdoor Attacks in Quantum Neural Networks

Cheng Chu, Fan Chen, Philip Richerme, Lei Jiang · DOI

Abstract

As Quantum Neural Networks (QNNs) emerge as a viable paradigm for machine learning on Noisy Intermediate-Scale Quantum (NISQ) hardware, their security vulnerabilities remain largely unexplored. This paper introduces QDoor, a stealthy backdoor attack that weaponizes the standard quantum compilation step known as approximate synthesis. By training a QNN to remain benign in its uncompiled state while exhibiting malicious behavior only after hardware-specific optimization, QDoor achieves a 13× higher attack success rate and 65% better clean data accuracy compared to state-of-the-art quantum backdoor methods. Our findings suggest that the very tools used to mitigate quantum noise can be subverted to hide adversarial logic.

1. Introduction

Quantum Neural Networks (QNNs) are increasingly proposed for complex tasks such as image recognition and chemical modeling. However, the limitations of current NISQ devices—specifically high gate error rates and limited connectivity—require circuits to undergo rigorous optimization before execution. A critical component of this pipeline is approximate synthesis, which replaces complex, high-level quantum gates with a streamlined sequence of hardware-native gates. While this process reduces the depth and error rate of the circuit, it introduces subtle mathematical deviations (unitary differences) between the original design and the executed version.

QDoor identifies these deviations as a novel attack vector. Traditional backdoor attacks, which trigger misclassification via specific input patterns, are often detectable in the uncompiled circuit or fail to survive the noise of real quantum hardware. QDoor addresses these shortcomings by hiding the backdoor within the "gap" created by approximate synthesis.

2. Methodology

2.1 The Approximate Synthesis Vulnerability

Approximate synthesis compilers (e.g., BQSKit) aim to find a circuit $C'$ that is mathematically close to the original circuit $C$ within a defined error budget $\epsilon$. QDoor exploits the fact that QNNs are inherently error-tolerant. An attacker can find a specific parameter space where the uncompiled circuit behaves normally, but the slight shifts introduced by the compiler "activate" a malicious logic branch.

2.2 Multi-Task Learning for Poisoning

QDoor utilizes a multi-task learning objective during the training phase to create a "Jekyll and Hyde" circuit. The attacker optimizes the QNN parameters to satisfy three simultaneous goals:

  1. Inference Task (The Jekyll): The uncompiled circuit must maintain high accuracy on clean, legitimate data to avoid suspicion.
  2. Stealthiness: The uncompiled circuit must ignore the presence of a trigger, ensuring that standard security scanners (which typically analyze the raw circuit) do not detect the backdoor.
  3. Malicious Behavior (The Hyde): The synthesized (compiled) version of the circuit must react to the trigger, either by misclassifying the input to a target label or by inducing indiscriminate failure.

This is achieved through a composite loss function: $$L = \alpha L_{inference} + \beta L_{stealth} + \gamma L_{malicious}$$

3. Experimental Setup

3.1 Datasets and Encoding

The researchers evaluated QDoor using standard benchmarks adapted for quantum constraints:

  • IRIS: A 2-class flower classification task.
  • MNIST & FashionMNIST: Handwritten digits and clothing items, tested in 2-class and 4-class configurations.

To accommodate 2-qubit and 8-qubit QNN architectures, high-dimensional images were pre-processed using Principal Component Analysis (PCA) and average pooling. Notably, QDoor proved to be encoding-agnostic, functioning effectively across amplitude, angle, and QuAM encoding methods.

3.2 Hardware and Simulation

Tests were conducted using quantum simulators and real-world IBM quantum backends, specifically the Melbourne and Cambridge systems, to verify the attack's resilience against physical hardware noise.

4. Key Results

4.1 Effectiveness and Accuracy

QDoor significantly outperforms previous quantum backdoor methods like qtrojan. On real hardware, QDoor achieved an Attack Success Rate (ASR) 13× higher than naive transplantation methods. Furthermore, it maintained a Clean Data Accuracy (CDA) that was 65% higher on average, ensuring the victim remains unaware of the compromise during routine operations.

4.2 Stealth and Detection

In evaluations against standard backdoor detection tools, classical-style attacks were identified within 5 minutes of scanning the uncompiled circuit. In contrast, QDoor remained undetected because the malicious logic is mathematically "latent" until the circuit is re-synthesized for the target hardware.

5. Discussion and Limitations

While potent, QDoor currently operates under a white-box threat model. The attacker must possess knowledge of the target's training data, circuit architecture, and the specific compiler settings (such as the error budget $\epsilon$) used by the victim. Additionally, the success of the attack is sensitive to the specific noise profile of the quantum backend, which can vary over time.

Potential countermeasures include performing security audits after the synthesis step or employing "model washing" techniques where the user retrains the model on a small, trusted local dataset to disrupt poisoned parameters. However, these defenses require significant quantum expertise from the end-user.

6. Conclusion

QDoor demonstrates that the quantum software stack's optimization layers introduce unique security risks. By weaponizing approximate synthesis, attackers can deploy backdoors that are both highly effective on noisy hardware and invisible to pre-compilation analysis. As quantum computing moves toward practical deployment, securing the compilation pipeline against such "optimization-aware" threats will be paramount.

Summary updated

BibTeX
@inproceedings{chu2023qdoor,
  author = {Cheng Chu and Fan Chen and Philip Richerme and Lei Jiang},
  title = {{QDoor: Exploiting Approximate Synthesis for Backdoor Attacks in Quantum Neural Networks}},
  booktitle = {QCE},
  year = {2023},
  url = {https://openreview.net/forum?id=VOfeLntyLf},
}
Figure