Robust in practice: Adversarial attacks on quantum machine learning

Haoran Liao, Ian Convy, William J. Huggins, K. Birgitta Whaley · DOI

Abstract

State-of-the-art classical neural networks are observed to be vulnerable to small crafted adversarial perturbations. A more severe vulnerability has been noted for quantum machine learning (QML) models classifying Haar-random pure states. This stems from the concentration of measure phenomenon, a property of the metric space when sampled probabilistically, and is independent of the classification protocol. To provide insights into the adversarial robustness of a quantum classifier on real-world classification tasks, we focus on the adversarial robustness in classifying a subset of encoded states that are smoothly generated from a Gaussian latent space. We show that the vulnerability of this task is considerably weaker than that of classifying Haar-random pure states. In particular, we find only mildly polynomially decreasing robustness in the number of qubits, in contrast to the exponentially decreasing robustness when classifying Haar-random pure states and suggesting that QML models can be useful for real-world classification tasks.

Introduction

In the realm of classical machine learning, adversarial examples—inputs specifically designed to deceive a model—pose a significant security risk. As researchers began exploring Quantum Machine Learning (QML), early theoretical results suggested an even more dire situation. For quantum classifiers, the robustness against such attacks appeared to vanish exponentially as the number of qubits increased. This phenomenon, rooted in the "concentration of measure," implied that almost any quantum state would sit precariously close to a decision boundary, making QML models inherently fragile.

However, these pessimistic predictions were largely based on the study of Haar-random states. While mathematically convenient, Haar-random states represent a "worst-case" scenario of unstructured, totally random data. This paper investigates whether this fragility persists when QML models are applied to structured, "meaningful" data typical of real-world applications.

The Geometry of Robustness

The core of the adversarial problem in QML is geometric. In the high-dimensional Hilbert space where quantum states reside, the distance between a data point and the decision boundary determines its robustness. Previous work showed that for Haar-random states, this distance $D$ shrinks as $O(d^{-n})$, where $n$ is the number of qubits.

To bridge the gap between theory and practice, the authors model data as being generated from a low-dimensional latent space via a "smooth generator," such as a Generative Adversarial Network (GAN). This approach mirrors how "natural" data like images are handled in classical ML.

Geometric representation of a quantum classifier's decision boundary and the distance $D$ required for an adversarial perturbation to change a prediction.

By focusing on these structured manifolds, the researchers utilized Levy’s Lemma and Gaussian isoperimetric inequalities to derive new bounds. They shifted the focus from "error-region" risk to "prediction-change" risk, which measures how likely any perturbation is to flip the model's output, regardless of the initial correctness.

Key Findings: Polynomial vs. Exponential Scaling

The most significant contribution of this work is the discovery of a scaling disparity. While Haar-random states suffer from exponentially decreasing robustness, states generated from a Gaussian latent space exhibit a much more resilient profile.

  • Haar-Random Baseline: Robustness scales as $O(d^{-n})$.
  • Smoothly Generated Data: Robustness scales as $O(1/\sqrt{n})$.

This polynomial decay means that as quantum systems grow in size (more qubits), the security of the model does not instantly collapse. This suggests that QML is "robust in practice" for tasks like image classification (e.g., MNIST), where data is not random but follows specific underlying structures.

Defenses and Future Directions

Beyond theoretical bounds, the paper proposes a "tomographic preprocessing" defense. By performing single-qubit tomography and fitting the results back to the known data manifold, the model can maintain robustness even against "unconstrained" attacks that attempt to move states into "illegal" regions of the Hilbert space.

While these results are promising, the authors note that the $O(1/\sqrt{n})$ bound is an upper limit; specific QML architectures might still be more fragile. Future work is needed to experimentally validate these bounds on hardware and to consider the impact of physical noise in the NISQ era.

Conclusion

By moving away from the abstraction of Haar-randomness and toward a manifold-based understanding of data, this research provides a much-needed optimistic outlook for the field of QML. The transition from exponential to polynomial vulnerability indicates that quantum models can indeed be secured for practical, real-world applications.

Summary updated

BibTeX
@inproceedings{liao2021robust,
  author = {Haoran Liao and Ian Convy and William J. Huggins and K. Birgitta Whaley},
  title = {{Robust in practice: Adversarial attacks on quantum machine learning}},
  booktitle = {Physical},
  year = {2021},
  doi = {10.1103/physreva.103.042427},
}
Figure