Explaining Quantum Circuits with Shapley Values: Towards Explainable Quantum Machine Learning
Raoul Heese, Thore Gerlach, Sascha Mücke, Sabine Müller, Matthias Jakobs, Nico Piatkowski
TL;DR
The paper addresses the need for explainability in quantum machine learning by adapting Shapley values to gate-level attributions in parameterized quantum circuits, forming the QSV framework. It introduces SVQXs, where gates (or groups) act as players and the value function is derived from circuit measurements, enabling attribution of each gate's contribution to selected objectives. The authors propose multiple value-function options (including expressibility, entangling capability, hardware fidelity, and transpilation efficiency) and handle uncertainty due to quantum hardware by using uncertain Shapley values with sampling-based estimators. Through experiments on simulators and two IBM QPUs, the work demonstrates gate-level insights across QSVM, QNN, QGAN, transpilation tasks, and QAOA/VQE, and provides a toolbox for public use. Overall, QSV offers a flexible, architecture-aware approach to XQML, with potential to inform circuit design and broader QML development, while acknowledging computational cost as a key challenge and suggesting future directions such as alternative attribution schemes and extensions to XQML.
Abstract
Methods of artificial intelligence (AI) and especially machine learning (ML) have been growing ever more complex, and at the same time have more and more impact on people's lives. This leads to explainable AI (XAI) manifesting itself as an important research field that helps humans to better comprehend ML systems. In parallel, quantum machine learning (QML) is emerging with the ongoing improvement of quantum computing hardware combined with its increasing availability via cloud services. QML enables quantum-enhanced ML in which quantum mechanics is exploited to facilitate ML tasks, typically in the form of quantum-classical hybrid algorithms that combine quantum and classical resources. Quantum gates constitute the building blocks of gate-based quantum hardware and form circuits that can be used for quantum computations. For QML applications, quantum circuits are typically parameterized and their parameters are optimized classically such that a suitably defined objective function is minimized. Inspired by XAI, we raise the question of the explainability of such circuits by quantifying the importance of (groups of) gates for specific goals. To this end, we apply the well-established concept of Shapley values. The resulting attributions can be interpreted as explanations for why a specific circuit works well for a given task, improving the understanding of how to construct parameterized (or variational) quantum circuits, and fostering their human interpretability in general. An experimental evaluation on simulators and two superconducting quantum hardware devices demonstrates the benefits of the proposed framework for classification, generative modeling, transpilation, and optimization. Furthermore, our results shed some light on the role of specific gates in popular QML approaches.
