Source-linked AI summary

Opportunities and limitations of explaining quantum machine learning

Elies Gil-Fuster, Jonas R. Naujoks, Grégoire Montavon, Thomas Wiegand, Wojciech Samek, Jens Eisert

arXiv:2412.14753v1quant-phcs.LGstat.ML

TL;DR

Explainability is well established for classical ML, but little is known about what to expect from QML models, which also present black-box trust concerns. The paper reviews the field, proposes two PQC-specific explanation techniques, and compares existing and novel methods in synthetic experiments, where the two novel methods’ relative ranking reverses across tasks.

  • Problem

    QML explainability has few established methods and lacks a broad perspective, despite black-box QML sharing classical ML’s trustworthiness concerns.

    Source: §I · p. 2
  • Method

    The paper surveys QML explainability and proposes two explanation techniques designed specifically for parametrized quantum circuits.

    Source: §I · p. 2
  • Results

    For the m = 0.5 task QLRP outperforms Taylor-∞, whereas for the m = π task Taylor-∞ outperforms QLRP.

    Source: §IV · p. 11
  • Takeaways & Limitations

    QML offers an opportunity to design models that are inherently explainable from the outset.

    Source: §I · p. 2

    Gradient-based XQML methods may be inapplicable when typical gradient magnitudes are exponentially small and indistinguishable from zero.

    Source: E. Explaining PQC-based QML models · p. 7

Abstract

from arXiv · show

A common trait of many machine learning models is that it is often difficult to understand and explain what caused the model to produce the given output. While the explainability of neural networks has been an active field of research in the last years, comparably little is known for quantum machine learning models. Despite a few recent works analyzing some specific aspects of explainability, as of now there is no clear big picture perspective as to what can be expected from quantum learning models in terms of explainability. In this work, we address this issue by identifying promising research avenues in this direction and lining out the expected future results. We additionally propose two explanation methods designed specifically for quantum machine learning models, as first of their kind to the best of our knowledge. Next to our pre-view of the field, we compare both existing and novel methods to explain the predictions of quantum learning models. By studying explainability in quantum machine learning, we can contribute to the sustainable development of the field, preventing trust issues in the future.

I. INTRODUCTION

Explainability is well established for classical AI but remains limited for QML, where black-box models raise similar trust concerns. The paper begins a framework for XQML, reviews QML foundations, and proposes two explanation techniques for parametrized quantum circuits.

I. INTRODUCTION

  • QML explainability remains underdeveloped, even though black-box quantum models share classical ML’s trustworthiness concerns.The paper identifies an opportunity to design QML models that are inherently explainable from the outset.Source: §I · p. 2
  • The paper’s contributions are a broad perspective on QML explainability and two explanation techniques designed specifically for parametrized quantum circuits.The authors describe these as first steps toward an XQML framework.Source: §I · p. 2

II. PRELIMINARIES

  • The preliminaries bridge explainable AI and QML, introducing parametrized quantum circuits and focusing on post-hoc local explanations used later in the paper.The discussion emphasizes essential differences between classical and quantum ML rather than the QML practitioner’s perspective.Source: §II · p. 2

A. Quantum function families for machine learning

  • A PQC-based quantum computation prepares an initial state, applies parametrized unitary gates, and estimates an observable’s expectation value.For classical-data QML, input encoding and trainable gates define a function family; the encoding gates determine its frequency spectrum.Source: A. Quantum function families for… · p. 3
  • Quantum constraints complicate QML design: intermediate information is hard to store, readout is sample-limited, and hardware connectivity restricts implementable gates.Efficiently simulable restricted circuits may forfeit quantum advantage, so both model and explanation complexity matter.Source: A. Quantum function families for… · p. 4

B. Explainability

Explainability includes diverse approaches that vary by the level, units, timing, and form of the explanation. These distinctions clarify what a method explains and the trade-offs involved.

B. Explainability

  • Local explanations address one input’s prediction, while global explanations characterize a model’s broader reasoning across data.Spectral relevance analysis aggregates local explanations, for example into clusters of prototypical behavior.Source: B. Explainability · p. 4
  • Explanations may assign importance to input features or use higher-level concepts, which are more amenable to dataset-wide analysis.Concepts can include intermediate-layer activations or linear transformations of them.Source: B. Explainability · p. 4
  • Ante-hoc methods build interpretability into a model, whereas post-hoc methods explain an already trained model.Constraining model structure can reduce capabilities, a trade-off termed performance-explainability trade-off.Source: B. Explainability · p. 5
  • Attribution methods score features’ responsibility for an output, whereas synthesis methods generate data points such as counterfactuals or class prototypes.DeepDream is presented as a synthesis-based explanation technique adapted to quantum circuits.Source: B. Explainability · p. 5

C. Post-hoc local attribution methods

Post-hoc local attribution assigns relevance to input dimensions for a selected prediction. The section surveys occlusion-, gradient-, and propagation-based ways to produce these explanations.

C. Post-hoc local attribution methods

  • Post-hoc local attribution assigns relevance scores to input dimensions to explain a selected class score for one pattern.The interpretation assumes input features or their relevance scores are understandable to the end user.Source: C. Post-hoc local attribution methods · p. 5
  • Occlusion-based methods score features by measuring output changes when features are replaced by baseline values.Exact Shapley values require combinatorial resources and are commonly approximated by sampling.Source: C. Post-hoc local attribution methods · p. 5
  • Gradient-based methods use local feature effects; Taylor-1 requires higher-order terms to be negligible, while integrated gradients can handle strong nonlinearities at higher computational cost.Grad×input is another gradient-based method and coincides with other gradient approaches for some functions, including homogeneous linear functions.Source: C. Post-hoc local attribution methods · pp. 5–6
  • Propagation-based approaches attribute a prediction by reversing through a model’s computational graph, as in layer-wise relevance propagation.LRP uses purpose-defined rules to propagate attribution from output toward input.Source: C. Post-hoc local attribution methods · p. 6

D. Evaluating explanation techniques

Explanation correctness lacks ground-truth labels and must be assessed indirectly, while practical usefulness also depends on efficiency, interpretability, and sufficiency. For PQC-based QML, quantum constraints shape which explanation approaches transfer, and prior work has explored several XQML directions.

D. Evaluating explanation techniques

  • Because explanations lack ground truth and the model's strategy is unknown, correctness is assessed indirectly using pixel-flipping or synthetic datasets with known explanations.The paper proposes specific synthetic-data metrics in Appendix F and uses them in its numerical experiments.Source: D. Evaluating explanation techniques · p. 6
  • Formal checks include conservation, continuity, and implementation invariance, but these can miss whether attributions identify the most contributing features; efficiency, interpretability, and sufficiency also matter.The paper notes that a uniform redistribution of the output could satisfy the formal checks while failing to highlight the most-contributing features.Source: D. Evaluating explanation techniques · pp. 6–7

E. Explaining PQC-based QML models

  • No-cloning requires fresh circuit runs, exact intermediate-state storage can demand exponential memory and runtime, and finite-shot precision can undermine gradient-based methods when typical gradients are exponentially small.These constraints make both intermediate-information storage and the precision of hypotheses and gradients important considerations for QML explanations.Source: E. Explaining PQC-based QML models · p. 7
  • PQC gate diagrams show physical execution rather than a classical computational graph, so NN-specific explanations do not generally transfer; analytic QML functions also yield continuous explanations.The passage contrasts piece-wise analytic ReLU networks with QML sums of bounded-frequency trigonometric functions.Source: E. Explaining PQC-based QML models · pp. 7–8
  • Black-box explanations can be quantum-efficient when the model is efficient to evaluate, whereas model-specific methods that store intermediate information may incur exponential classical space overhead.The paper suggests that efficient model-specific methods using midcircuit measurements could display a quantum-classical separation if equivalent explanations cannot be realized without the quantum circuit.Source: E. Explaining PQC-based QML models · p. 8

F. Related work on XQML

  • Prior XQML work tested IG and SV under noise [21], extended Shapley-style explanations to expectation-valued functions and trainable gates [23], and explored circuit dreaming [22] and confidence-producing surrogates.Source: F. Related work on XQML · p. 8

III. NOVEL XQML APPROACHES

For present-day QML based on parametrized quantum circuits, the section presents Taylor-∞ and QLRP as two novel, model-specific explanation approaches.

A. Taylor-∞explanation

  • Taylor-∞ generalizes Taylor-1 by including all single-component orders, rather than only first-order terms.The approach uses the degree-1 trigonometric-polynomial structure of PQCs that encode each input component once.Source: A. Taylor-∞explanation · p. 9
  • With a root point where f(˜x) and the crossed-term residual ε are negligible, Taylor-∞ approximates f(x) by summing per-component contributions T_i(x, ˜x).The method defines each feature's explanation as E_i(x) = T_i(x, ˜x); finding suitable root points remains open.Source: A. Taylor-∞explanation · p. 9
  • Taylor-∞ strictly improves conservation over Taylor-1 for degree-1 trigonometric polynomials, but conservation is not generally expected beyond that scope.Generalizing the method to higher-degree polynomials is left for future research.Source: A. Taylor-∞explanation · p. 9

B. Quantum layerwise relevance propagation

  • QLRP follows the computational graph in reverse: it first assigns relevance to ρ(x), then uses x, ρ(x), and that relevance to produce the final explanation.Its linear rule specifies the intermediate relevance, while its encoding rule specifies the final explanation.Source: B. Quantum layerwise relevance… · p. 9
  • Assuming suitable root points, QLRP's encoding rule targets conservation, giving Σ_k E_k(x) ≈ f(x).The paper provides an algorithm for finding root points in Appendix E.Source: B. Quantum layerwise relevance… · p. 10
  • QLRP requires exponential classical storage and full circuit simulation, limiting scalability; applicability to classically simulable circuits remains open.The authors propose hardware adaptation as a possible way to reduce classical storage, potentially at the cost of approximately accurate explanations.Source: B. Quantum layerwise relevance… · p. 10

IV. NUMERICAL RESULTS

The authors use synthetic classification tasks to compare established and proposed explanation methods for quantum models. Explanation quality varies by method, metric, and task, with no clear across-the-board advantage for model-specific methods.

IV. NUMERICAL RESULTS

  • The model appears to use only two of the three manually designated relevant components, while Taylor-1 and Taylor-∞ highlight relevant components more sharply at m = π.The synthetic data specify which components should receive relevance, providing a reference for interpreting the explanations.Source: §IV · p. 10
  • Explanation quality is evaluated by alignment with a known feature mask using QA, Pearson correlation QP, and ROC-based QROC.The metrics compare explanations with the mask of relevant input features.Source: §IV · pp. 10–11
  • The experiments show no obvious benefit of model-specific explanations over model-agnostic ones, and the authors caution that this may reflect the task’s simplicity.The experiments are presented as a proof of concept, not as evidence that the proposed techniques are superior.Source: §IV · pp. 10–11
  • The authors say dataset-specific explainability requires validating each method for that dataset, and the toy results do not establish trends for larger, more realistic settings.They also state that quantifying a QML model’s explainability in general requires further research.Source: §IV · pp. 11–12
  • For m = π, most explanations score higher on QA and QROC, while the QLRP-versus-Taylor-∞ ranking reverses between m = 0.5 and m = π.The authors suggest the reversal may arise from artifacts of the toy problem and offer model linearity only as a hypothesis.Source: §IV · p. 11
  • Taylor-∞ does not consistently improve conservation over Taylor-1 in these experiments, and Taylor-1 is more conservative for m = π.The authors conjecture that extra Taylor terms may be harmful when the underlying function is close to linear, but do not characterize this behavior further.Source: §IV · p. 12

V. SUMMARY AND OUTLOOK

The paper previews explainable quantum machine learning (XQML), introduces two post-hoc attribution methods for parametrized quantum circuits, and compares them in synthetic experiments. It identifies scalability and encoding complexity as challenges while highlighting the opportunity to design QML models with explainability in mind.

V. SUMMARY AND OUTLOOK

  • Quantum-mechanical constraints can block direct use of some classical XAI ideas, motivating quantum versions of established techniques.The paper points to difficult classical state representation, no-cloning, and coherence loss from intermediate measurement as design constraints.Source: §V · p. 12
  • Taylor-∞ uses the trigonometric structure of QML labeling functions for higher-degree Taylor information, while QLRP adapts layerwise relevance propagation to PQC structure.QLRP treats a PQC as a linear model on a high-dimensional Hilbert space and accounts for its intermediate quantum feature map.Source: §V · p. 12
  • The experiments illustrate how to implement and evaluate XQML techniques rather than present state-of-the-art classical simulations.The paper compares existing model-agnostic explanations with its novel model-specific methods.Source: §V · p. 12
  • Different explanation methods perform differently across tasks and metrics, so further work is needed to characterize them and identify relevant evaluation criteria.The authors leave a full characterization of the methods’ relative merits for future work.Source: §V · p. 12
  • Characterizing quantum states fully can become classically intractable, and complex encodings can make explanations difficult regardless of task performance.The paper identifies a structure-complexity trade-off: less structured models require more complex explanation methods.Source: §V · p. 13
  • The authors identify future directions including more scalable explanation algorithms, kernel-based model studies, larger experiments, and extensions to other encodings and quantum-state inputs.They also suggest that model structures conducive to explanation could inform QML design.Source: §V · p. 13

Appendix A: Probabilistic functions for machine learning

The appendices relate probabilistic classical circuits to QML, illustrate layerwise relevance propagation, and derive the Taylor-∞ explanation. Together, they describe classical analogies and stepwise explanation constructions relevant to the paper’s methods.

Appendix A: Probabilistic functions for machine learning

  • A classical probabilistic analogue starts with a distribution, applies parametrized doubly stochastic transformations, and evaluates a fixed function’s expectation; unlike unitary transformations, doubly stochastic transformations cannot decrease Shannon entropy.The figure contrasts classical diagonal probability matrices with quantum states that also have complex off-diagonal entries.Source: Appendix A · p. 17, Figure 1 · p. 17

Appendix B: Illustrative presentation of LRP

  • LRP starts with the model output as relevance and propagates relevance backward through intermediate states, using each layer’s tensors and the relevance from the next layer.The final input explanation is the relevance assigned to the input state.Source: Appendix B · p. 18

Appendix C: Derivation of the Taylor-∞explanation

  • The Taylor-∞ derivation decomposes a trigonometric polynomial into terms involving derivatives with respect to individual variables and a residual containing cross-derivative contributions.The stated proposition assumes degree at most 1 over each variable.Source: Appendix C · pp. 18–19

Appendix D: Step-by-step derivation of a digital twin neural network

The digital twiNN rewrites a PQC using real-valued matrices for its data-dependent state and task-dependent observable, then computes their inner product. The appendix derives the construction and notes conditions for efficient implementation.

Appendix D: Step-by-step derivation of a digital twin neural network

  • The digital twiNN represents a PQC with a data-dependent feature matrix and task-dependent linear layer, whose inner product reproduces the model output.Its three steps create A(x), create M(ϑ), and compute f(x, ϑ) = 1/2 tr{A(x)M(ϑ)}.Source: Appendix D · p. 20
  • The construction maps complex matrices to larger real matrices while preserving matrix products, allowing the quantum state and observable to be handled in the real-valued representation.For Hermitian H, the mapped matrix has trace twice that of H.Source: Appendix D · p. 20
  • For the assumed encoding of d-dimensional data into d qubits using one RX(x_i) rotation per component, each entry of A(x) can be computed with complexity linear in d.The authors describe the entry formula as efficient; the observable construction assumes an efficiently described fixed Hamiltonian and variational circuit.Source: Appendix D · pp. 21–22

Appendix E: Derivation of quantum layerwise relevance propagation for the twiNN, linear rule, and encoding rule

The appendix presents a relevance propagation algorithm for the digital twiNN. At each step it uses the current and preceding tensors together with the relevance from the previous step.

Appendix E: Derivation of quantum layerwise relevance propagation for the twiNN, linear rule, and encoding rule

  • The proposed relevance propagation algorithm proceeds through the twiNN in two steps, applying a linear rule and an encoding rule.At each step, it accounts for the relevance tensor from the preceding step and the tensors at the current and previous steps.Source: Appendix E · p. 23
  • The derivation initializes relevance at the output with R(f) = f before deriving the two propagation rules.Source: Appendix E · p. 23

1. Linear rule

The linear rule assigns relevance to matrix entries in proportion to their values, conserving relevance exactly by construction. The encoding rule approximates relevance propagation through the data encoding using root points selected for each matrix entry.

1. Linear rule

  • The linear rule assigns each matrix entry relevance equal to its value times its associated relevance, ensuring exact conservation by construction.The passage identifies this as grad×input.Source: §1 · p. 23

2. Encoding rule

  • Because each A entry has trigonometric degree at most 1 in each input component, its expansion supports an approximately conservative relevance rule.Conservation depends on the quality of the Fourier-decomposition approximation.Source: §2 · pp. 23–24
  • Implementing the encoding rule requires evaluating A(x) and its first and second partial derivatives with respect to each input component.The paper says the trigonometric structure makes these derivatives straightforward to evaluate using the parameter-shift rule.Source: §2 · p. 24
  • The encoding rule seeks root points where individual entries of the data-dependent matrix A vanish, using the closest point to the input in Euclidean distance.A root point may serve multiple entries; the search assigns points by considering the input components and their distances to the relevant grid hyperplanes.Source: §2 · pp. 25–26
  • The root-point search assigns points that differ from the input in only one component, so relevance is propagated onto a component selected by encoding geometry rather than task information.The search is guaranteed to cover every pair (i, j) after at most O(d) iterations.Source: §2 · pp. 26–27

Appendix F: Evaluation metrics

The evaluation metrics compare input-feature explanations with a known relevance mask using alignment, correlation, and ROC-based scores. Together, they assess feature attribution from different perspectives, including across a set of inputs.

Appendix F: Evaluation metrics

  • Explanation alignment Q_A measures the fraction of absolute relevance assigned to the mask's relevant components.The mask marks the features considered relevant for each input.Source: Appendix F · p. 27
  • The Pearson correlation metric Q_P measures correlation between explanation values and mask values across input dimensions.It compares deviations from their respective means rather than absolute relevance magnitudes.Source: Appendix F · pp. 27–28
  • Q_ROC summarizes how well-explained and wrong-explained inputs vary across alignment thresholds, using the area under the resulting ROC curve.Unlike the other metrics, it is computed for a set of explanations rather than a single input.Source: Appendix F · p. 28

Appendix G: Experimental setup

The experimental setup uses a synthetic six-dimensional, four-class classification task in which each class has designated informative dimensions. Class data are sampled from Gaussian distributions on those dimensions and uniform distributions on the remaining dimensions.

1. Dataset and learning task

  • The task is a synthetic six-dimensional classification problem with four classes, each defined by three main dimensions and three remaining dimensions.The class specifications identify which dimensions play each role.Source: §1 · pp. 28–29, Table IV · p. 28
  • For each class, main-dimension values follow a class-specific Gaussian distribution, while remaining dimensions are sampled uniformly around the origin.The normal distributions are characterized by a mean in R^3 and standard deviation σ.Source: §1 · p. 29
  • The training data consist of labeled samples drawn from the described class distributions, with 1,000 samples generated for each class.The table captions identify the class dimension assignments and the normal and uniform distribution parameters.Source: §1 · p. 29, Table V · p. 29

2. Parametrized quantum circuits

The experiments use a rotationally encoded parametrized quantum circuit trained for the four-class task. The authors evaluate attribution methods against ground-truth feature masks using three metrics and summarize the scores across explanations.

2. Parametrized quantum circuits

  • The model embeds input values on different qubits using Pauli-X rotations and applies trainable strongly entangling layers.Predictions use expectation values of the Pauli-Z observable on the first four qubits.Source: §2 · p. 30

a. Training

  • The circuit is trained with categorical cross-entropy using Adam and a cosine decay schedule.The implementation uses PennyLane with the JAX backend for simulation and training.Source: a. Training · p. 30

b. Evaluation metrics

  • They evaluate local feature attributions against ground-truth input masks using metrics Q_A, Q_P, and Q_ROC; Q_A and Q_P are averaged over all inputs, while Q_ROC is reported on 200 inputs per class.Figure 4 summarizes numerical results across explanations and evaluation metrics.Source: b. Evaluation metrics · p. 32
Loading 2412.14753v1…