NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Variational quantum algorithm for unconstrained black box binary optimization: Application to feature selection

Christa Zoufal, Ryan V. Mishmash, Nitin Sharma, Niraj Kumar, Aashish Sheshadri, Amol Deshmukh, Noelle Ibrahim, Julien Gacon, Stefan WoernerQuantum 2023

Abstract

Feature selection is a fundamental challenge in data science, characterized by an exponential search space of $2^n$ possible combinations for $n$ features. While quantum algorithms like the Quantum Approximate Optimization Algorithm (QAOA) offer potential advantages, they typically require an explicit Quadratic Unconstrained Binary Optimization (QUBO) formulation. This paper presents VarQFS (Variational Quantum Feature Selection), a variational quantum algorithm designed for black-box binary optimization. By integrating quantum sampling with classical model evaluation and utilizing Quantum Natural SPSA (QN-SPSA) for optimization, VarQFS effectively navigates the feature selection landscape without requiring a predefined mathematical objective. Experimental results on credit risk datasets demonstrate that VarQFS outperforms standard classical heuristics in both simulation and on real quantum hardware.

Introduction

In machine learning, selecting the optimal subset of input variables is crucial for model performance and interpretability. However, as the number of features grows, exhaustive search becomes computationally prohibitive. Classical practitioners often rely on greedy heuristics like Recursive Feature Elimination (RFE), which may converge to local optima.

Existing quantum optimization approaches often struggle with real-world feature selection because they require the objective function to be expressed as a QUBO. In practice, the objective—such as the log-loss of a trained logistic regression model—is a "black box." This research, a collaboration between IBM Quantum and PayPal, introduces a framework to bridge this gap by treating the quantum computer as a generator of feature subset candidates that are evaluated classically.

The VarQFS Framework

VarQFS operates through a hybrid quantum-classical loop. Each feature in the dataset is mapped to a qubit. A measurement in the computational basis yields a bitstring where $|1\rangle$ indicates the inclusion of a feature and $|0\rangle$ its exclusion.

The black-box optimization loop of VarQFS, showing the transition from quantum sampling to classical model training and performance scoring.

As shown in the figure above, the process involves:

  1. Sampling: The quantum circuit generates bitstrings representing feature subsets.
  2. Model Training: These subsets are passed to a classical computer to train a model (e.g., Logistic Regression).
  3. Performance Scoring: The classical model returns a fitness score (Log-Loss), which serves as the cost function for the quantum optimizer.

To optimize the circuit parameters, the authors employ Quantum Natural SPSA (QN-SPSA). This technique approximates Quantum Natural Gradients, which are theoretically linked to Quantum Imaginary Time Evolution (QITE). This approach helps the algorithm avoid barren plateaus and navigate complex optimization landscapes more effectively than standard gradient descent.

Variational Ansatz

The algorithm utilizes a RealAmplitudes circuit as its variational ansatz. This circuit structure is designed to explore the probability space of feature subsets efficiently using $RY$ rotation gates and $CNOT$ entanglers.

The RealAmplitudes quantum circuit used as the variational ansatz, featuring RY gates and a ladder of CNOT entanglers across 20 qubits.

By entangling the qubits, the algorithm can capture high-order correlations between features—dependencies that greedy classical methods often overlook. The circuit depth can be adjusted to balance expressivity with the noise constraints of near-term (NISQ) hardware.

Experimental Evaluation and Results

The researchers benchmarked VarQFS using the German Credit Risk Dataset, which expands to 59 features after one-hot encoding. The algorithm was compared against standard classical methods, including RFE and RFECV (Recursive Feature Elimination with Cross-Validation).

Hardware and Simulation Performance

  • Quantum Hardware: On a 20-qubit sub-problem executed on the ibmq_montreal processor, VarQFS successfully identified the optimal training score (0.5351), surpassing the classical RFECV benchmark.
  • Large-Scale Simulation: Using a Matrix Product State (MPS) simulator for the full 59-qubit problem, VarQFS consistently discovered feature subsets that yielded superior log-loss scores on both training and unseen test data compared to classical heuristics.

Discussion and Conclusion

VarQFS demonstrates that variational quantum algorithms can be applied to optimization problems where the objective function is not explicitly known. A key insight is that by representing the entire subset simultaneously in a quantum state, the algorithm can account for joint correlations between features that classical greedy methods might miss.

While the algorithm faces challenges such as classical overhead for model training and sensitivity to initial seeds, it provides a robust theoretical and empirical foundation for using NISQ devices in practical data science workflows. Future work may involve exploring Hamming-weight preserving circuits to allow for constrained feature selection, further refining the utility of quantum optimization in high-dimensional data analysis.

Summary updated

BibTeX
@article{zoufal2023variational,
  author = {Christa Zoufal and Ryan V. Mishmash and Nitin Sharma and Niraj Kumar and Aashish Sheshadri and Amol Deshmukh and Noelle Ibrahim and Julien Gacon and Stefan Woerner},
  title = {{Variational quantum algorithm for unconstrained black box binary optimization: Application to feature selection}},
  journal = {Quantum},
  year = {2023},
  doi = {10.22331/q-2023-01-26-909},
}
Figure