Source-linked AI summary

Variational Quantum Attention for Molecular Graph Learning

Yu-Cheng Lin, Yu-Chao Hsu, Tai-Yue Li, Nan-Yow Chen, Samuel Yen-Chi Chen

arXiv:2610.04588v1quant-phcs.AIcs.LG

TL;DR

The paper asks how variational quantum circuits affect attention behavior in molecular graphs, where prior formulations did not explicitly include bond attributes. It introduces edge-aware quantum attention and finds competitive benchmark performance alongside distinct, circuit- and chemistry-dependent weighting behavior.

  • Problem

    Existing quantum graph-attention formulations do not explicitly incorporate molecular bond attributes, and it remains unclear whether quantum scoring changes molecular weighting beyond predictive performance.

    Source: §1 · p. 3
  • Method

    QGAT uses a variational quantum circuit to score attention from the receiving atom, neighboring atom, and connecting bond, while retaining the classical message-passing pipeline.

    Source: §1 · p. 3
  • Results

    QGAT achieves competitive performance relative to matched GATv2 across five tasks, improves consistently on BBBP across evaluated ansatzes, and shows distinct Verubecestat-series weighting and attribution behavior.

    Source: §1 · p. 3, §6 · p. 12
  • Takeaways & Limitations

    Variational quantum attention is a viable alternative molecular attention parameterization, but its performance depends on circuit design and its distinct attribution behavior is not established as generally superior.

    Source: §6 · p. 12

    The framework is ligand-based, uses classical circuit simulation, and relies primarily on qualitative attribution analysis and a single case study, so broader quantitative validation is needed.

    Source: §6 · p. 12

Abstract

from arXiv · show

Molecular property prediction is central to computational drug discovery, where graph neural networks learn to weight neighboring atomic environments during message passing. Yet it remains unclear how variational quantum circuits alter learned attention behavior in molecular graphs. We introduce an edge-aware variational quantum attention mechanism for molecular graph learning, in which the receiving atom, neighboring atom, and connecting bond jointly determine the quantum attention state. Across five molecular property and bioactivity prediction tasks, QGAT achieves competitive performance relative to GATv2, with a consistent improvement on BBBP across all six evaluated circuit ansatzes. We further compare how the quantum and classical attention scores weight molecular structure beyond accuracy. In the Verubecestat BACE1 inhibitor series, QGAT achieves a higher Spearman correlation than GATv2 and assigns positive attributions to several structural changes consistent with reported structure-activity relationships (SARs). This case study shows that the two attention mechanisms can exhibit different prediction and attribution behavior across structurally related BACE1 analogues, while broader validation is required to determine how consistently these differences generalize across chemical series and targets. Circuit ablations further show that performance depends on the circuit design. Together, these results show that variational quantum attention can serve as a viable alternative molecular attention parameterization while inducing circuit- and chemistry-dependent behavior distinct from a matched classical scorer.

1 Introduction

The paper asks whether a bond-aware quantum attention scorer can compete with classical attention and alter molecular weighting. QGAT uses a variational quantum circuit for scoring while retaining classical message passing, and is evaluated on five prediction tasks and a BACE1 inhibitor series.

1 Introduction

  • The authors motivate quantum attention as a local, edge-wise alternative to encoding an entire graph, avoiding direct encoding of high-dimensional molecular features into a limited quantum state.The surrounding classical pipeline retains feature transformation, aggregation, readout, and prediction.Source: §1 · pp. 2–3
  • Existing quantum graph-attention formulations do not explicitly incorporate molecular bond attributes, although molecular relationships depend on the connecting bond.The paper asks whether edge-aware quantum scoring can be competitive and whether its parameterization changes molecular weighting.Source: §1 · p. 3
  • QGAT jointly uses the receiving atom, neighboring atom, and connecting bond to determine attention scores while leaving the remaining message-passing pipeline classical.This isolates the quantum scoring function as the principal architectural intervention against GATv2.Source: §1 · p. 3
  • Across five scaffold-split tasks, QGAT achieves competitive performance relative to matched GATv2, with consistent improvement on BBBP across evaluated ansatzes.Circuit ablations also show strong task dependence on ansatz and variational depth.Source: §1 · p. 3
  • In the Verubecestat series, QGAT achieves higher activity-ranking correlation than GATv2 and produces attribution patterns directionally consistent with reported SAR.The analysis uses substructure attribution, attention weights, and integrated gradients.Source: §1 · p. 3

2 Related Work

Prior quantum–classical drug-prediction work commonly uses quantum circuits for representation encoding or downstream prediction, while quantum graph-attention work has begun using circuits in message passing. This paper studies attention that directly incorporates molecular atom and bond features.

2 Related Work

  • Prior quantum–classical drug-prediction studies typically use quantum circuits for representation encoding or downstream prediction rather than determining graph-attention coefficients.The cited application areas include binding affinity, drug response, and molecular property prediction.Source: §2 · p. 4
  • Ning et al. (2025) used VQCs to generate attention coefficients from quantum-encoded node representations, while Faria et al. (2025) used quantum graph encoders to modulate neighboring-node contributions.The present work extends this line to molecular graphs by incorporating atom and bond features directly into attention.Source: §2 · p. 4
  • The paper asks whether replacing a classical scorer with a VQC changes which molecular information predictions rely on, since similarly accurate models may weight different structural signals.Source: §2 · p. 4

3 Preliminaries

The preliminaries describe neighborhood attention in GATs and the three-stage hybrid quantum–classical workflow used to produce classical outputs from quantum circuits.

3.1 Graph Attention Networks

  • GAT attention scores a neighboring node with an unnormalized logit, normalizes logits over the receiving node’s neighborhood, and uses the resulting coefficient to weight that neighbor’s contribution.Multi-head GATs perform the operation in parallel across heads.Source: §3.1 · p. 4

3.2 Quantum Machine Learning

  • A typical QML workflow transforms inputs classically, encodes the feature representation into a quantum state, and returns circuit measurement outcomes to classical computation.Source: §3.2 · pp. 4–5
  • Amplitude encoding represents a normalized 2^nq-dimensional feature vector using nq qubits, though preparing an arbitrary encoded state may require substantial circuit depth.Parameterized rotations and entangling gates process the state, and observable expectation values provide continuous classical outputs used to construct attention logits.Source: §3.2 · p. 5

4 Method

QGAT adapts quantum graph attention to molecular graphs by including atom and bond representations in the quantum attention computation, while retaining classical message passing and prediction. Its edge-aware scorer fuses projected atom and bond features before circuit processing.

4 Method

  • The quantum module replaces the attention scorer, while message passing and readout prediction remain classical.The architecture is presented as edge-aware QGAT for molecular property prediction.Source: §4 · p. 5, Figure 1 · p. 6

4.1 Molecular graph representation

  • Each molecule is represented as a graph whose nodes are atoms and whose edges are covalent bonds, with node and edge feature vectors.The paper points to Appendix A.3 for graph construction and descriptor details.Source: §4.1 · p. 6

4.2 Edge-aware variational quantum attention

  • For each edge, receiving-node, neighboring-node, and edge features are independently projected into a common multi-head representation and combined by element-wise addition, yielding 64 or 128 dimensions (6 or 7 qubits).Source: §4.2 · p. 6
  • The resulting attention weights are normalized over each receiving node’s neighborhood and used to weight classical neighbor messages, with outputs concatenated across heads.Source: §4.2 · p. 7

5 Experiments and Results

Across five scaffold-split molecular prediction tasks, QGAT is competitive with matched GATv2, while results vary by dataset and circuit design. Analysis of molecular attributions and attention also finds distinct behavior in ESOL and the Verubecestat series, with specific limits to those findings.

5.1 Experimental Settings

  • Evaluation covers five property and bioactivity tasks, uses scaffold-based five-fold splits, and compares models under shared features and training settings with GATv2 as the primary classical attention baseline.The tasks include BACE and BBBP classification, FreeSolv and ESOL regression, and a ChEMBL BACE1 bioactivity regression task.Source: §5.1 · pp. 7–8

5.2 Main Results on Molecular Property Prediction

  • 0.6808 to 0.7157 mean ROC-AUC on BBBP; QGAT is otherwise competitive with GATv2, with higher mean performance on BACE, ESOL, and both ChEMBL-BACE metrics but slightly higher RMSE on FreeSolv.The reported BBBP comparison is the largest difference; Table 1 reports results as mean ± standard deviation across five scaffold folds.Source: §5.2 · p. 8, Table 1 · p. 9

5.3 Ablation Study: The Effect of Variational Quantum Circuit Design

  • No single ansatz consistently dominates across datasets, making circuit architecture a task-dependent modeling choice.The six shallow ansatzes vary in rotation ordering and CNOT connectivity; Table 2 omits ansatz 6 results on ChEMBL-BACE because of simulation cost.Source: §5.3 · pp. 8–9, Table 2 · p. 9
  • Increasing variational depth does not improve performance monotonically; the strongest configurations use one to three layers, with the best depth varying by task.BACE and FreeSolv perform best with one layer, BBBP with three, and ESOL and ChEMBL-BACE with two.Source: §5.3 · p. 9

5.4 Analysis of Molecular Attention and Attribution

  • On ESOL, both models assign negative contributions to hydrophobic CF3 and tBu groups and positive contributions to several polar groups, while QGAT gives weaker positive contributions to several carbonyl groups.The reported carbonyl examples are C(=O)N, C(=O)CH3, and C(=O)OMe.Source: §5.4 · p. 10, Table 3 · p. 10
  • In the external Verubecestat case study, QGAT has higher Spearman correlation than GATv2 (0.8264 vs. 0.7954), while GATv2 has slightly lower RMSE (0.9920 vs. 1.0306).The series has no exact molecular matches in ChEMBL-BACE and is treated as a medicinal chemistry case study, not a strict chemical out-of-distribution benchmark.Source: §5.4 · p. 10
  • QGAT emphasizes additional binding-relevant Verubecestat regions and gives the 5-fluoropyridine a positive IG contribution, unlike GATv2, consistent with reported SAR.Both models assign positive contributions to the pyridine nitrogen; the attention-to-binding correspondence is a qualitative alignment, not a reconstruction of protein–ligand interactions.Source: §5.4 · pp. 10–11
  • Both models miss the fluorophenyl fluoride potency gain, while activity-cliff attribution shifts remain qualitative and do not establish a general advantage in activity-cliff sensitivity.For compounds 21–24, QGAT shows broader redistribution around the modified pyridyl-amide region; for compounds 30–32, both models respond to the benzene-to-pyridine replacement.Source: §5.4 · pp. 11–12

6 Discussion and Conclusion

QGAT performs comparably to matched GATv2, with its most consistent gain on BBBP, while showing distinct molecular weighting and attribution behavior in the Verubecestat series. Circuit design affects performance, and the evidence does not establish generally superior chemical interpretability.

6 Discussion and Conclusion

  • QGAT performs comparably to matched GATv2, with the most consistent gain on BBBP, and shows distinct weighting and attribution behavior in the Verubecestat series.In that series, QGAT has a higher activity-ranking correlation and assigns attribution directions to several structural modifications consistent with reported SAR, although neither model captures all observed effects.Source: §6 · p. 12
  • No single ansatz performs best across all tasks, and adding variational layers does not consistently improve predictive performance.Circuit architecture is therefore an important modeling choice, not a design factor that consistently improves performance.Source: §6 · p. 12
  • The framework is ligand-based, uses classically simulated circuits, and bases chemical interpretation mainly on qualitative attribution and one case study.The authors state that broader quantitative evaluation is needed to establish whether the approach generalizes as chemical interpretation.Source: §6 · p. 12

A.1 Datasets and Preprocessing

The appendix describes five molecular property and bioactivity datasets, a scaffold-based evaluation split, and the molecular graph features used to represent atoms and bonds.

A.1 Datasets and Preprocessing

  • The study uses five molecular property and bioactivity datasets spanning classification and regression, with dataset sizes, tasks, and target properties summarized in Table 4.The task set includes BACE inhibitor binding, BBBP penetration, ESOL solubility, FreeSolv hydration free energies, and a constructed ChEMBL BACE1 regression task using pIC50 values.Source: §A.1 · p. 19, Table 4 · p. 19
  • The benchmarks cover BACE binding, BBBP penetration, ESOL solubility, FreeSolv hydration free energy, and a constructed ChEMBL BACE1 regression task using transformed IC50 values.The ChEMBL activity values are normalized for model training.Source: §A.1 · p. 19

A.2 Scaffold Splitting

  • Scaffold splitting groups molecules by Bemis–Murcko core, reflecting chemical series that vary peripheral substituents and helping assess generalization beyond close analogues.The scaffold consists primarily of ring systems and connecting linkers, with terminal side chains removed.Source: §A.2 · p. 19
  • The split reserves 10% of molecules as a fixed scaffold-based test set and partitions the remainder into folds with 72% training and 18% validation.Molecules sharing a scaffold stay in the same partition, so evaluation emphasizes cores absent from the corresponding training set.Source: §A.2 · pp. 19–20

A.3 Graph Representation Method

  • Molecular graphs include explicit-hydrogen atoms as nodes and represent each covalent bond with chemical-bond and charge–distance edge types.Atoms use 92-dimensional features and both edge types use 21-dimensional features; charge and inverse-distance terms describe local electronic environment and geometry, not interaction energies.Source: §A.3 · p. 20

A.4 Hyperparameter and Training Details

The appendix specifies matched QGAT and GATv2 training configurations and a compact circuit search, then describes six circuit templates whose performance depends on task and parameterization.

A.4 Hyperparameter and Training Details

  • Models use Adam with a 1 × 10^-3 learning rate, 1 × 10^-4 weight decay, 0.05 dropout, and at most 500 epochs.Classification uses binary cross-entropy, regression uses mean squared error, and validation performance selects checkpoints.Source: §A.4 · p. 21
  • QGAT and matched GATv2 configurations share task-specific hyperparameters, while simulation overhead motivates compact hidden dimensions and four attention heads.The authors therefore do not perform an exhaustive search over substantially larger models.Source: §A.4 · p. 21, Table 6 · p. 21
  • Standard training computes quantum expectation values by exact state-vector simulation; noisy simulation is reserved for separate robustness experiments.Source: §A.4 · p. 22

B.1 Circuit Architectures

  • The six shallow circuit templates combine parameterized single-qubit rotations and CNOT gates, varying rotation sequence and entangling connectivity.Rotation order changes the variational unitary, and no single ansatz performs best across datasets.Source: §B.1 · p. 22

B.2 Effect of Variational Depth

QGAT’s best variational depth differs by task, and adding circuit blocks does not consistently improve performance. Deeper circuits offer limited benefit beyond these task-specific optima.

B.2 Effect of Variational Depth

  • BACE and FreeSolv perform best with one block, ESOL and ChEMBL-BACE with two, and BBBP with three.Table 7 reports mean ± standard deviation across five folds; unreported results reflect higher computational cost.Source: §B.2 · p. 22, Table 7 · p. 23
  • BACE performance falls from 0.8283 with one block to approximately 0.80 with two and three blocks, while FreeSolv RMSE gradually increases with depth.BBBP and ESOL also degrade at four blocks after their shallower-depth optima.Source: §B.2 · pp. 22–23
  • The six evaluated ansatzes are shallow hardware-efficient circuits using parameterized single-qubit rotations and CNOT gates, with different rotation patterns and entangling connectivity.The illustrated circuits use four qubits and one block.Source: Figure 5 · p. 23
  • The results suggest shallow circuits suffice for the evaluated tasks, while additional depth may increase optimization complexity without corresponding performance gains.Increasing block count does not improve performance universally.Source: §B.2 · p. 23

B.3 Post-training Robustness to Simulated Quantum Noise

The study tests QGAT’s post-training inference sensitivity to simulated depolarizing and amplitude-damping noise. Weak noise causes limited performance changes, while stronger noise produces task-dependent degradation.

B.3 Post-training Robustness to Simulated Quantum Noise

  • Noise is injected during inference after noiseless training, with strengths p ∈ {0.001, 0.01, 0.1, 0.2} assigned equally to single- and two-qubit operations within each noise model.The evaluation covers depolarizing noise and amplitude damping.Source: §B.3 · pp. 23–25
  • Noisy training is outside the evaluation because differentiating through density-matrix evolution after each operation would substantially increase computational and memory costs.The reported analysis concerns post-training inference sensitivity.Source: §B.3 · p. 25
  • At channel strengths up to 0.01, performance remains close to noiseless results across tasks; stronger noise causes larger, task-dependent degradation.ESOL and ChEMBL-BACE degrade sharply at p ≥ 0.1, while BACE and FreeSolv deteriorate gradually; amplitude damping generally causes slightly smaller losses at larger tested strengths.Source: §B.3 · p. 25
  • BBBP ROC-AUC changes only marginally under either noise model, even at the largest tested strength, though the mechanism remains unclear.The authors describe BBBP predictions as relatively stable under circuit perturbations.Source: §B.3 · p. 25

C Substructure Attribution Analysis

Substructure masking estimates how molecular groups affect predictions by suppressing their contributions at readout after message passing. The paper also examines dataset-wide attribution distributions and defines Integrated Gradients for the Verubecestat analysis.

C.1 Substructure Mask Explanation

  • Substructure Mask Explanation estimates a group’s contribution by comparing predictions before and after masking, then aggregates scores across functional-group occurrences.Masking is applied after message passing at graph readout, leaving the graph structure and message-passing process unchanged.Source: §C.1 · p. 25
  • A positive attribution means masking decreases model output, while a negative attribution means masking increases it; neither sign denotes an intrinsically favorable or unfavorable chemical effect..Source: §C.1 · p. 27

C.2 Complete Attribution Distributions

  • Across datasets, many functional groups have similar attribution directions between models, but selected groups differ in magnitude and distributional spread.Broad distributions spanning positive and negative values indicate context-dependent contributions rather than effects determined solely by functional-group identity.Source: §C.2 · pp. 27–28

D.1 Integrated Gradients for the Verubecestat Series

  • Integrated Gradients attributes input features by accumulating gradients along a straight-line path from baseline x′ to input x, measuring sensitivity relative to that baseline.The method is used for the Verubecestat series analysis.Source: §D.1 · p. 28

D.2 Activity Cliff Analysis for the Verubecestat Series

The additional medicinal-chemistry series show different ranking and RMSE comparisons between QGAT and GATv2. The Verubecestat activity-cliff maps are presented as qualitative examples, not a statistical evaluation.

D.2 Activity Cliff Analysis for the Verubecestat Series

  • The Verubecestat IG maps show attribution patterns for two activity-cliff pairs, compounds 21–24 and 30–32, with attributions normalized within each molecule.Only two pairs are available, so these are qualitative case studies rather than a statistical evaluation of activity-cliff prediction.Source: §D.2 · p. 28, Figure 13 · p. 35, Figure 14 · p. 36

D.3 Additional External Series: Umibecestat and LY3202626

  • Umibecestat mean Spearman correlation is 0.692 for QGAT versus 0.655 for GATv2, with comparable RMSE; LY3202626 is 0.788 versus 0.784, while GATv2 has lower RMSE.The series are used to assess qualitative generalization of ranking behavior, not as chemical OOD benchmarks.Source: §D.3 · pp. 28–29
Loading 2610.04588v1…