QPERT: Quantum-Aware Perturbation Explanations for Variational Quantum Circuits
Ramesh Doddaiah ⋅ Garima Jain
Abstract
Perturbation-based explainers estimate feature importance by masking or substituting features independently of one another. Variational quantum circuits (VQCs) break that assumption along three axes. First, SHAP and LIME assume a deterministic $f(x)$, whereas a VQC returns probabilities estimated from finite measurement shots, so identical inputs yield different attributions. Second, angle encoding followed by entangling gates leaves features jointly encoded in the circuit state, so single-feature occlusion cannot represent the correlations the circuit actually sees. Third, zeroing an angle-encoded feature can drive the state off the training manifold, so naive masking measures out-of-distribution behavior rather than feature importance. We introduce QPERT, a post-hoc explainer that learns a continuous saliency mask $m \in \mathbb{R}^{d}$ per explained instance on a frozen model. Each entry scales its feature toward zero, $\tilde{x} = x \odot \sigma(m)$, where $\sigma$ is the sigmoid; the final explanation is $\sigma(m)$. The mask minimizes $$\mathcal{L}(m) = \lambda_{\mathrm{t}}\mathcal{L}_{\mathrm{target}} + \lambda_{\ell_1}\|\sigma(m)\|_{1} + \lambda_{\mathrm{f}}\mathcal{L}_{\mathrm{fid}} + \lambda_{\mathrm{e}}\mathcal{L}_{\mathrm{ent}} + \lambda_{\mathrm{s}}\mathcal{L}_{\mathrm{sup}},$$ with $\mathcal{L}_{\mathrm{ent}} = \frac{1}{|\mathcal{O}|}\sum_{(p,q)\in\mathcal{O}}|R_{pq}|$ over $\mathcal{O} = \{(p,q) : p \neq q\}$, and $$\mathcal{L}_{\mathrm{sup}} = \frac{\sum_{i}p_i^{2} - 1/N}{1 - 1/N} + \alpha\left(1 - \frac{H(p)}{\log N}\right).$$ $\mathcal{L}_{\mathrm{target}}$ pushes the mask toward features that support the predicted class, and the $\ell_1$ term keeps the mask sparse. $\mathcal{L}_{\mathrm{fid}}$ keeps the perturbed prediction close to the original, measured as Jensen-Shannon divergence between the two output distributions; we use this classical proxy in all reported experiments and leave statevector fidelity to future work. $\mathcal{L}_{\mathrm{ent}}$ penalizes the off-diagonal Pearson correlations $R_{pq}$ of mask entries across the explained batch, a tractable proxy discouraging lockstep ablation of features whose qubits are entangled. $\mathcal{L}_{\mathrm{sup}}$ acts on the predicted class distribution $p$ over $N$ classes, combining a participation ratio with normalized Shannon entropy $H(p)$ to keep heavily masked inputs from producing overconfident outputs. Because these objectives compete, they are introduced progressively rather than jointly: target, then $\ell_1$, then fidelity, then $\mathcal{L}_{\mathrm{ent}}$ and $\mathcal{L}_{\mathrm{sup}}$ together, over 1000 iterations. Gradients are hybrid: autograd for the differentiable terms, central finite differences for the terms that pass through the circuit, at a cost of $2d$ additional circuit evaluations per iteration. We measure faithfulness using the AUC Difference, the insertion AUC minus the deletion AUC under a zero-valued baseline, with features inserted or deleted in saliency-rank order. Evaluation uses this hard ablation rather than the soft $\sigma(m)$ scaling used during optimization, and the same protocol is applied to every method. Quantum runs use Qiskit AerSimulator with 2000 shots for Iris and 500 for MNIST-VQC. Loss coefficients were tuned once on Iris and reused unchanged for both MNIST settings. On the classical MLP, total variation replaces the mask-correlation term as the spatial analogue for images; the other four terms are unchanged. QPERT ranks first in all three settings. Reporting AUC Difference as QPERT / SHAP / LIME / Random: Iris with a 4-qubit VQC, $0.216$ / $0.106$ / $-0.057$ / $0.044$; MNIST with an MLP, $0.893$ / $0.173$ / $0.231$ / $-0.004$; MNIST with a 4-qubit VQC on PCA features, $0.018$ / $-0.018$ / $0.007$ / $-0.045$. On the MLP, insertion and deletion AUCs of 0.955 and 0.062 indicate that the selected pixels alone recover the prediction, so the optimization framework transfers to a fully differentiable model even though the encoding-specific term is not active there. On MNIST-VQC all methods cluster near zero and the ordering should be read as directional only: angle encoding places one feature per qubit, so 784-dimensional MNIST is compressed by PCA to four components (about 65 percent of variance), leaving insertion and deletion curves with five points each and bounding the achievable separation. Lifting that four-feature cap is ongoing work.
Chat is not available.
Successful Page Load