On Optimizing Hyperparameters for Quantum Neural Networks

Sabrina Herbst, Vincenzo De Maio, Ivona Brandic · DOI

Abstract

Quantum Machine Learning (QML) represents a frontier in computational science, yet the practical implementation of Quantum Neural Networks (QNNs) remains hindered by complex training landscapes. This paper presents a large-scale empirical study investigating the impact of hyperparameter selection on QNN performance. By systematically evaluating over 1,500 configurations, the research identifies critical factors—most notably parameter initialization and optimizer selection—that mitigate the "Barren Plateau" problem and enhance model accuracy across diverse datasets.

1. Introduction

Training Quantum Neural Networks is currently characterized by significant volatility. Unlike classical deep learning, where "best practices" for hyperparameters like learning rates and weight initialization are well-established, QML practitioners often rely on heuristic choices. The primary obstacle in this domain is the phenomenon of Barren Plateaus (BP), where the gradient of the cost function vanishes exponentially as the number of qubits increases. This leaves optimizers trapped in a flat landscape, unable to find a path toward convergence.

This study seeks to transition QNN design from intuition-based selection to data-driven optimization. By testing a wide array of optimizers, circuit architectures (ansatzes), and initialization strategies, the researchers provide a roadmap for building more robust and efficient quantum models.

2. Experimental Methodology

The researchers utilized the IBM Qiskit framework to conduct an exhaustive grid search. The experimental design focused on five primary dimensions:

  • Optimizers: A comparison between COBYLA (Constrained Optimization by Linear Approximation), SPSA (Simultaneous Perturbation Stochastic Approximation), and the Nelder-Mead algorithm.
  • Ansatz Structures: Evaluation of four Variational Quantum Circuit (VQC) types: PauliTwoDesign, RealAmplitudes, EfficientSU2, and TwoLocal.
  • Initialization Strategies: Testing the impact of Uniform, Normal, and Beta distribution initializations on the starting parameters.
  • Data Encoding: Comparing the ZFeatureMap and ZZFeatureMap for mapping classical data into quantum states.
  • Preprocessing: Evaluating dimensionality reduction techniques, specifically Principal Component Analysis (PCA) and Linear Discriminant Analysis (LDA).

To ensure practical relevance, experiments were conducted on both ideal simulators and noisy models based on the 7-qubit IBM "Perth" hardware.

3. Data and Preprocessing

The study employed four distinct classification datasets, scaled to fit the constraints of Near-Intermediate Scale Quantum (NISQ) devices:

  1. KDD Cup 1999: Network intrusion detection.
  2. Cover Type: Forest cover classification.
  3. Glass Identification: Forensic material analysis.
  4. Rice: Binary variety classification.

Dimensionality was reduced to seven features to match the qubit count of the target hardware. Notably, the study found that Linear Discriminant Analysis (LDA) generally outperformed PCA. This suggests that LDA creates a feature space that is more conducive to the optimization landscapes of quantum circuits.

4. Key Insights and Results

4.1 The Critical Role of Initialization

The most significant finding was the superior performance of Beta distribution initialization. Across nearly all datasets, initializing parameters using a Beta distribution consistently yielded higher accuracy than standard normal or uniform distributions. Post-hoc analysis revealed that the benefit was derived primarily from the range of values provided by the Beta distribution rather than its specific shape. This suggests that certain initial parameter ranges are naturally better at positioning the model outside of Barren Plateaus.

4.2 Optimizer Efficiency

In the hierarchy of optimizers, COBYLA and SPSA emerged as the clear leaders. COBYLA was particularly noted for its speed and robustness, achieving convergence in fewer iterations than SPSA while maintaining high accuracy. Nelder-Mead was found to be significantly less effective for these specific quantum tasks.

4.3 Circuit Architecture and Entanglement

While entanglement is a cornerstone of quantum advantage, the study found that the specific pattern of entanglement (e.g., circular vs. linear) had a negligible impact on performance. The presence of entanglement is essential, but the complexity of the entangling strategy does not necessarily translate to better results, simplifying the design requirements for practitioners.

4.4 Performance Metrics

  • Accuracy: The best configurations achieved up to 97% accuracy on the KDD Cup dataset in noiseless environments.
  • Noise Resilience: Hardware noise typically induced an accuracy drop of 4% to 10%. However, certain configurations using Beta initialization and COBYLA showed remarkable resilience to these errors.
  • Impact: Switching from uniform to Beta initialization boosted accuracy by 12-16% in specific ZZFeatureMap configurations.

5. Limitations and Future Directions

While the study provides a comprehensive baseline, it is limited by the current scale of quantum simulation. Training was restricted to 400 samples and low qubit counts due to computational overhead. Future research will focus on whether these hyperparameter advantages persist as systems scale to hundreds or thousands of qubits and will explore the underlying geometry of the loss landscapes to further explain why the Beta distribution is so effective.

6. Conclusion

Optimizing QNNs requires careful attention to initialization and optimizer choice. For practitioners, the study recommends starting with COBYLA as the optimizer and Beta distribution for parameter initialization, while utilizing LDA for dimensionality reduction. These choices provide the most reliable defense against Barren Plateaus and maximize the performance of near-term quantum classification models.

Reference: Herbst, S., De Maio, V., & Brandic, I. (2024). On Optimizing Hyperparameters for Quantum Neural Networks. arXiv:2403.18579v1 [cs.LG].

Summary updated

BibTeX
@inproceedings{herbst2024optimizing,
  author = {Sabrina Herbst and Vincenzo De Maio and Ivona Brandic},
  title = {{On Optimizing Hyperparameters for Quantum Neural Networks}},
  booktitle = {QCE},
  year = {2024},
  doi = {10.1109/qce60285.2024.00174},
}
Figure