Generalization in quantum machine learning from few training data

Matthias C. Caro, Hsin-Yuan Huang, Marco Cerezo, Kunal Sharma, Andrew T. Sornborger, Lukasz Cincio, Patrick J. ColesarXiv 2021 · DOI

Abstract: Modern quantum machine learning (QML) methods involve variationally optimizing a parameterized quantum circuit on a training data set, and subsequently making predictions on a testing data set (i.e., generalizing). In this work, we provide a comprehensive study of generalization performance in QML after training on a limited number $N$ of training data points. We show that the generalization error of a quantum machine learning model with $T$ trainable gates scales at worst as $\sqrt{T/N}$. When only $K \ll T$ gates have undergone substantial change in the optimization process, we prove that the generalization error improves to $\sqrt{K / N}$. Our results imply that the compiling of unitaries into a polynomial number of native gates, a crucial application for the quantum computing industry that typically uses exponential-size training data, can be sped up significantly. We also show that classification of quantum states across a phase transition with a quantum convolutional neural network requires only a very small training data set. Other potential applications include learning quantum error correcting codes or quantum dynamical simulation. Our work injects new hope into the field of QML, as good generalization is guaranteed from few training data.

Overcoming the Exponential Wall

A persistent concern in the development of Quantum Machine Learning (QML) has been the "exponential wall" of data requirements. Because quantum states exist in a Hilbert space that grows exponentially with the number of qubits, it was feared that training a model to generalize—to perform well on unseen data—would require a similarly exponential amount of training data. If a 50-qubit system required $2^{50}$ data points to train, QML would be practically unfeasible.

This research addresses this fundamental challenge by providing rigorous theoretical bounds on generalization error. The authors demonstrate that the amount of data needed depends primarily on the complexity of the quantum circuit (the number of trainable gates) rather than the size of the Hilbert space. This shift in perspective suggests that QML can be effective even with surprisingly small training sets.

Theoretical Framework and the "Mother Theorem"

The researchers treated variational QML models as parameterized quantum channels. To quantify the data requirements, they employed mathematical tools from statistical learning theory, such as covering numbers and metric entropy, to measure the "expressiveness" of various circuit architectures.

Schematic of various Quantum Machine Learning Model (QMLM) architectures, including gate-sharing and variable structures, for which generalization bounds were derived.

A key contribution of this work is the derivation of a "Mother Theorem"—a highly general master equation that accounts for practical circuit scenarios. This includes architectures with gate sharing (reusing parameters), variable structures, and optimization-dependent bounds. The theorem establishes that generalization error is upper-bounded by approximately $\sqrt{T/N}$, where $T$ is the number of trainable gates and $N$ is the number of training points. Furthermore, if an optimizer only significantly modifies a small subset of gates ($K$), the bound tightens to $\sqrt{K/N}$.

Empirical Validation: Phase Recognition and Unitary Compiling

The theoretical findings were validated through extensive numerical simulations across two primary domains:

  1. Quantum Phase Recognition: Using a Quantum Convolutional Neural Network (QCNN), the researchers classified ground states of a 1D spin chain into different topological phases. They proved that QCNNs require only $O(\text{polylog } n)$ training data due to their inherent gate-sharing symmetry.
  2. Unitary Compiling: The team trained circuits to "learn" complex operations like the Quantum Fourier Transform (QFT). They demonstrated that the QFT could be compiled using a number of training states that scales linearly with the number of qubits, a significant improvement over previous assumptions of exponential data needs.
Numerical results for quantum phase recognition. Testing accuracy closely tracks training accuracy even with small training sets (N), demonstrating strong generalization across different system sizes (n).

As shown in the empirical results, testing accuracy (performance on unseen states) tracks training accuracy very closely even with very small $N$. For a 16-qubit system, as few as 25-30 data points were sufficient to achieve high testing accuracy, confirming that the models were effectively learning the underlying physics rather than simply memorizing the training set.

Key Insights and Future Directions

The most significant takeaway is that Parameters > Qubits. Generalization performance is tied to the number of trainable gates, not the number of qubits. This insight moves the primary challenge of QML away from a "data bottleneck" and back toward the challenge of trainability—specifically, overcoming "barren plateaus" where gradients vanish during optimization.

While these results provide a worst-case theoretical upper bound, numerical evidence suggests that real-world QML models may perform even better. Future work will likely focus on distribution-specific tightenings to determine if certain types of quantum data are inherently easier to learn, and how specific data-to-quantum encoding schemes might further optimize these bounds.

Summary updated

BibTeX
@misc{caro2021generalization,
  author = {Matthias C. Caro and Hsin-Yuan Huang and Marco Cerezo and Kunal Sharma and Andrew T. Sornborger and Lukasz Cincio and Patrick J. Coles},
  title = {{Generalization in quantum machine learning from few training data}},
  year = {2021},
  eprint = {2111.05292},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2111.05292},
}
Figure