Model selection in hybrid quantum neural networks with applications to quantum transformer architectures
Organizations: Quantum Lab, Fujitsu Research of India
Abstract
Quantum machine learning models generally lack principled design guidelines, often requiring full resource-intensive training across numerous choices of encodings, quantum circuit designs and initialization strategies to find effective configuration. To address this challenge, we develope the Quantum Bias-Expressivity Toolbox (), a framework for evaluating quantum, classical, and hybrid transformer architectures. In this toolbox, we introduce lean metrics for Simplicity Bias () and Expressivity (), for comparing across various models, and extend the analysis of to generative and multiclass-classification tasks. We show that enables efficient pre-screening of promising model variants obviating the need to execute complete training pipelines. In evaluations on transformer-based classification and generative tasks we employ a total of qubits for embeddings ( qubits each for query, key, and value). We identify scenarios in which quantum self-attention variants surpass their classical counterparts by ranking the respective models according to the metric and comparing their relative performance.
Figures & tables
| Model | Parameters Count of SAM block | AUC | EXP | Train Acc. (%) | Test Acc. (%) |
| Classical | 15936 | 39.5038 | 0.0781 | 47.75 0.40 | 47.48 0.70 |
| Hybrid | 12924 | 40.1737 | 0.0609 | 47.53 0.66 | 47.51 0.66 |
| Quantum | 12954 | 40.1710 | 0.0601 | 47.60 0.48 | 47.79 0.60 |
| Classical | 12984 | 40.1582 | 0.0602 | 47.59 0.44 | 47.51 0.64 |
| (HQC) | 12984 | 40.1579 | 0.0600 | 47.54 0.68 | 47.55 0.76 |
| Model | Parameters Count of SAM block | AUC | EXP | Uniqueness (%) | F1 Score |
| Classical | 648 | 41.9575 | 0.1355 | 17.76 2.21 | 26.32 2.50 |
| Hybrid | 684 | 42.7308 | 0.1089 | 18.36 1.11 | 24.96 1.38 |
| Quantum | 648 | 42.6167 | 0.1161 | 18.83 1.11 | 25.56 1.24 |
| Classical | 684 | 42.5963 | 0.1133 | 18.71 1.59 | 24.90 1.88 |
| (HQC) | 648 | 42.5546 | 0.1188 | 18.52 0.82 | 25.12 0.96 |
| 684 | 42.5461 | 0.1166 | 19.04 1.76 | 26.32 2.58 |
Appendix figures & tables18 assets
Supplementary material from the paper’s appendix.
Appendix
| Variant | Measurement @ Query/Key | Attention Method |
|---|---|---|
| Canonical | Pauli- expectation value on a single qubit | Gaussian Projection Method [ 44 ] |
| V1 | Pauli- expectation value on a single qubit | Gaussian Projection Method [ 44 ] |
| V2 | Pauli- expectation value on a single qubit | Post-processing + Softmax |
| V3 | Expectation values , Pauli operators | Classical Attention (Appendix C.1 ) |
| V4 | Expectation values , anti-commuting Pauli operators | Classical Attention (Appendix C.1 ) |
| Variant | Measurement @ Query/Key | Attention Method |
|---|---|---|
| Canonical | Pauli- expectation value on a single qubit | Gaussian Projection Method [ 44 ] |
| V1 | Pauli- expectation values for all qubits | Classical Attention (Appendix C.1 ) |
| V2 | Expectation values , anti-commuting Pauli operators | Classical Attention (Appendix C.1 ) |
| V3 | Pauli- expectation value on a single qubit | Post-processing + Softmax |
| AUC | EXP | Uniqueness (%) | F1 Score |
|---|---|---|---|
| 40.4123 | 0.1805 | 7.01 1.57 | 11.20 2.30 |
| 40.4231 | 0.1805 | 5.59 1.67 | 8.98 2.44 |
| 40.4237 | 0.1806 | 7.81 3.23 | 12.34 4.64 |
| 40.4260 | 0.1805 | 7.12 2.08 | 11.04 3.34 |
| 40.5348 | 0.1744 | 11.18 1.24 | 19.36 1.80 |
| 40.5581 | 0.1738 | 10.45 0.56 | 18.22 0.84 |
| Model | Parameters Count of SAM block | AUC | EXP | Validity (%) | Uniqueness (%) | Novelty (%) | F1 Score |
| Classical | 34656 | 39.1719 | 0.0808 | 79.45 2.01 | 62.41 1.29 | 29.94 1.19 | 69.91 1.54 |
| Hybrid | 31680 | 42.5136 | 0.0069 | 79.57 1.17 | 62.68 0.48 | 30.65 0.67 | 70.12 0.66 |
| Quantum | 31656 | 42.4999 | 0.0070 | 79.47 1.18 | 62.50 1.09 | 30.76 1.04 | 69.97 1.07 |
| Classical | 31632 | 42.4973 | 0.0093 | 77.13 1.54 | 61.02 0.75 | 30.90 0.62 | 68.13 0.97 |
| (HQC) | 31656 | 42.4918 | 0.0094 | 76.83 1.25 | 61.25 0.95 | 31.49 0.94 | 68.16 1.04 |
| 31632 | 42.4484 | 0.0074 | 79.09 0.76 | 62.93 0.63 | 31.31 1.40 | 70.09 0.49 |
| AUC | EXP | Validity (%) | Uniqueness (%) | Novelty (%) | F1 Score |
|---|---|---|---|---|---|
| 37.3303 | 0.1891 | 76.92 0.99 | 61.43 1.09 | 31.99 1.37 | 68.30 0.89 |
| 37.3305 | 0.1896 | 76.44 1.39 | 61.10 1.17 | 31.69 1.57 | 67.91 1.01 |
| 37.3346 | 0.1913 | 77.28 1.27 | 61.43 0.92 | 31.28 1.04 | 68.44 0.76 |
| 37.3442 | 0.1885 | 77.05 1.50 | 61.32 1.16 | 31.71 0.97 | 68.29 1.26 |
| 37.3473 | 0.1880 | 76.96 1.01 | 61.33 1.16 | 31.53 1.11 | 68.25 0.96 |
| 37.3511 | 0.1896 | 77.47 1.39 | 61.73 1.06 | 31.84 1.17 | 68.71 1.08 |