Source-linked AI summary
Layerwise learning for quantum neural networks
Andrea Skolik, Jarrod R. McClean, Masoud Mohseni, Patrick van der Smagt, Martin Leib
TL;DR
Barren plateaus and sampling noise make parametrized quantum circuit training difficult on noisy devices. The paper proposes layerwise learning and reports higher success probability and lower runtime than full-circuit training under realistic measurement conditions.
Problem
Barren-plateau gradients can vanish exponentially with qubit number and become indistinguishable from hardware noise or require exponentially many measurements.
Method
Layerwise learning successively grows the circuit and training parameter set while freezing earlier layers, beginning with a shallow zero-initialized circuit.
Results
Up to 40% higher training success probability is reported for handwritten-digit image classification with restricted precision from shot noise.
Takeaways & Limitations
Under experimentally realistic measurement strategies, layerwise learning outperforms concurrent full-circuit training on average and can reduce sampling requirements and runtime.
Abstract
from arXiv · showhide
With the increased focus on quantum circuit learning for near-term applications on quantum devices, in conjunction with unique challenges presented by cost function landscapes of parametrized quantum circuits, strategies for effective training are becoming increasingly important. In order to ameliorate some of these challenges, we investigate a layerwise learning strategy for parametrized quantum circuits. The circuit depth is incrementally grown during optimization, and only subsets of parameters are updated in each training step. We show that when considering sampling noise, this strategy can help avoid the problem of barren plateaus of the error surface due to the low depth of circuits, low number of parameters trained in one step, and larger magnitude of gradients compared to training the full circuit. These properties make our algorithm preferable for execution on noisy intermediate-scale quantum devices. We demonstrate our approach on an image-classification task on handwritten digits, and show that layerwise learning attains an 8% lower generalization error on average in comparison to standard learning schemes for training quantum circuits of the same size. Additionally, the percentage of runs that reach lower test errors is up to 40% larger compared to training the full circuit, which is susceptible to creeping onto a plateau during training.
I. INTRODUCTION
Parametrized quantum circuits are promising for NISQ applications, but barren plateaus make gradient-based training difficult because gradients can vanish and become indistinguishable from sampling noise. The paper proposes layerwise learning, which grows circuits and trains parameter subsets successively to improve trainability under realistic noise.
- Motivation: Gradient-based training of QNNs is challenging because PQC gradients can vanish exponentially with circuit size and depend strongly on the cost function.The barren plateau effect is especially severe for global cost functions.
- Motivation: Small gradients slow or prevent optimization, can cause false convergence, and create poor signal-to-noise ratios on NISQ devices.Quantum sampling can require exponentially many measurements to resolve small gradient magnitudes.
- Layerwise learning: Layerwise learning successively adds circuit components while growing the trained parameter set and restricting randomization to parameter subsets.The strategy begins with a shallow circuit and freezes earlier layers as new layers are added.
- Results: Up to 40% more handwritten-digit runs successfully train under shot-noise-limited precision with layerwise learning than with zero-parameter initialization.The method concentrates gradient magnitude into fewer components, producing meaningful training signal with fewer circuit repetitions.
- Context: Prior approaches include identity-like initialization, parameter tying, and classical layerwise strategies, while this work evaluates layerwise learning for handwritten-digit classification.The paper’s numerical demonstration focuses on image classification using handwritten digits.
II. BARREN PLATEAUS IN TRAINING LANDSCAPES
Barren plateaus arise when random PQCs become sufficiently deep and approach approximate 2-designs, causing expectation values and gradient statistics to concentrate. The resulting nearly flat regions make local optimization difficult, especially as circuit size and depth increase.
- Barren plateaus: Barren plateaus are regions of quantum-circuit training landscapes where first and higher-order derivatives vanish without corresponding to an objective minimum.They are associated with high-dimensional geometric concentration effects.
- Barren plateaus: A circuit piece that approximately forms a 2-design is sufficient for the whole random PQC to exhibit exponentially vanishing gradients.This condition is sufficient but not necessary.
- Origin: Sufficiently deep random gate sequences approximate Haar-distributed unitaries, causing expectation values to concentrate across parameter choices.Approximate 2-designs provide an efficient route to reproducing the relevant first and second moments.
- Implication: Randomly initialized PQCs with large depth become increasingly difficult to train for optimization methods unable to avoid or escape plateaus.Figure 1 uses an initial Hadamard layer to avoid bias from all-zero initialization, while the average gradient remains zero.
- Numerical reference: The variance of partial derivatives exponentially decays with the number of qubits and layers as random all-to-all circuits approach the 2-design regime.The reference calculation uses 1000 random circuit instances for each qubit-and-layer combination.
III. LAYERWISE LEARNING
Layerwise learning constructs and trains parametrized quantum circuits incrementally, using shallow circuits and restricted parameter subsets to improve training under sampling and hardware noise. The method grows layers during optimization, then trains larger contiguous partitions until convergence or a target depth is reached.
- Layerwise learning: Layerwise learning constructs the circuit ansatz during optimization and trains only subsets of parameters simultaneously to maintain a favorable signal-to-noise ratio.The strategy is designed for parametrized quantum circuits under stochastic and hardware noise.
- Phase one: The first phase starts with a shallow circuit of s start layers, such as s = 2, and successively adds layers during training.Initial-layer parameters are initialized to zero.
- Phase one: After a fixed number of epochs, newly added layers are optimized with existing parameters, while earlier parameters can later be frozen according to hyperparameters p and q.The number of epochs per layer, el, controls training duration for each layer.
- Phase two: The second phase trains larger contiguous layer partitions in alternating optimization sweeps until convergence.The fraction of parameters trained in one step is controlled by hyperparameter r.
- Circuit structure: The circuit uses successive single-qubit rotation gates and two-qubit gates in all-to-all connected layers, with data input applied once at the beginning.For the handwritten-digit classification example, measurement is added to the last qubit after the final layer.
A. Setup
The study trains fully connected quantum circuits for binary handwritten-digit classification using PCA-based qubit encoding, binary cross-entropy, and parameter-shift gradients. Layerwise learning is evaluated on circuits whose depth reaches the 2-design regime.
- A. Setup: The experiments train fully connected parametrized quantum circuits on a binary handwritten-digit classification task.Fully connected layers are used for numerical convenience because they reach a 2-design with relatively few qubits and layers.
- A. Setup: The objective is average binary cross-entropy, using a rescaled Z-direction expectation value from one readout qubit as the prediction.The expectation value is mapped from [-1, 1] to [0, 1], and the final qubit is used for binary classification.
- A. Setup: Gradients are computed with the parameter-shift rule from differences between two shifted circuit expectation values.The shift uses s = π/4r with r = 0.5.
- A. Setup: PCA reduces each image to a number of principal components matching the circuit’s qubit count before qubit encoding.For 10 qubits, each image is represented by a 10-component vector.
B. Sampling requirements
Sampling noise makes gradient precision a central resource constraint for quantum-circuit training. When gradients are smaller than the expectation-value estimation error, updates can resemble a random walk rather than optimization.
- B. Sampling requirements: Gradient precision depends on estimating the two expectation values used by the parameter-shift rule.The required number of circuit samples is therefore tied to the precision of these expectation values.
- B. Sampling requirements: For most near-term operator-averaging implementations, sampling cost scales as O(1/ϵ^2) for estimation error ϵ.This sampling behavior resembles classical central-limit-theorem statistics.
- B. Sampling requirements: If every objective gradient magnitude is much smaller than ϵ, gradient-based training behaves more like a random walk than optimization.Small derivatives reduce the achievable signal-to-noise ratio at fixed sampling cost.
C. Comparison to CDL strategies
Layerwise learning is compared with zero initialization followed by conventional full-circuit training. Its rationale is that shallow circuits produce larger gradients and therefore require fewer samples for a given precision.
- C. Comparison to CDL strategies: The comparison baseline sets all circuit parameters to zero and then applies conventional deep learning to the full circuit.This strategy is intended to avoid unfavorable random initialization on a barren plateau.
- C. Comparison to CDL strategies: Layerwise learning trains smaller circuit components, while conventional learning updates the full circuit during each step.Restricting training and randomization to fewer components concentrates gradient magnitude in the active subset.
- C. Comparison to CDL strategies: Shallow circuits provide larger gradients, reducing the samples needed to achieve a target precision under 1/ϵ^2 sampling behavior.This is the sampling-efficiency argument for layerwise learning.
- C. Comparison to CDL strategies: The approaches are compared by their probability of reaching a target test accuracy and the expected number of repeated training restarts.Average runtime is estimated from quantum-device sample counts using a 10kHz sampling rate.
D. Numerical results
Numerical experiments compare layerwise learning with conventional full-circuit learning under noisy sampling. Layerwise learning reaches lower test error with shorter runtime and requires fewer restarts, while conventional runs can randomize or diverge during training.
- D. Numerical results: The experiments use 8 qubits, 21 total layers, and layerwise-learning hyperparameters p = q = 2 and el = 10.One initial layer remains active; later layers are trained in contiguous partitions during successive phases.
- D. Numerical results: LL reaches lower average test error with lower runtime than CDL among runs ending below 0.5 test error.The best LL configuration takes approximately half as much time to converge as the CDL configuration with the highest success probability.
- D. Numerical results: The later increase in averaged CDL test error reflects a growing fraction of randomized or diverged runs rather than overfitting.Individual randomization typically appears as a sudden test-error jump followed by failure to resume regular training.
- D. Numerical results: Less than two restarts are needed on average for successful LL training across the tested η = 0.01 and η = 0.005 configurations.Their expected repetition count stays almost constant as the desired accuracy increases.
- D. Numerical results: 3 to 7 restarts are required by the best CDL configurations to reach similarly low test errors as LL.The strongest CDL configurations use η = 0.001 and η = 0.005.
- D. Numerical results: Above 0.65 accuracy, CDL configurations have success probability below 0.3, whereas LL exceeds 0.7 in both tested cases.Some runs for both methods fail to learn under the small measurement count and low batch size.
V. CONCLUSION AND OUTLOOK
Layerwise learning dampens barren-plateau effects by limiting randomization and concentrating gradient contributions in fewer circuit components. Under realistic measurement strategies, it outperforms conventional training and can reduce experiment repetitions.
- Layerwise learning dampens barren-plateau effects by avoiding Haar-random initialization and randomization during training.
- LL and CDL perform similarly with noiseless simulation and exact analytical gradients, but LL outperforms CDL on average with experimentally realistic measurement strategies.
- Concentrating training-gradient contributions into fewer known components decreases sample requirements for a favorable signal-to-noise ratio with stochastic quantum samples.
- LL reaches lower objective-function values with few measurements and reduces experiment repetitions until convergence to roughly half those needed by CDL in the highest-success configurations.
- The basic scheme adds a new layer after a fixed number of epochs, while smarter convergence criteria, gate replacement, and coordinate grouping remain future research directions.
APPENDIX
With infinite measurements and exact gradients, LL and CDL show similar training and test performance. In this idealized regime, gradient magnitude has limited impact because Adam uses adaptive learning rates.
- With infinite measurements, LL and CDL with zero or random initialization perform similarly under exact-gradient conditions.
- In the perfect-simulation regime, Adam’s adaptive learning rates handle different gradient magnitudes when computed gradients retain variance.
- LL uses fewer parameters and more epochs, whereas CDL requires more quantum-device calls per update but fewer epochs to converge.
- Both LL and CDL converge to a cross entropy of roughly 0.51 under the idealized conditions.
- All approaches except randomly initialized CDL approach nearly zero test error before settling around roughly 0.1.