## New Research In

### Physical Sciences

### Social Sciences

#### Featured Portals

#### Articles by Topic

### Biological Sciences

#### Featured Portals

#### Articles by Topic

- Agricultural Sciences
- Anthropology
- Applied Biological Sciences
- Biochemistry
- Biophysics and Computational Biology
- Cell Biology
- Developmental Biology
- Ecology
- Environmental Sciences
- Evolution
- Genetics
- Immunology and Inflammation
- Medical Sciences
- Microbiology
- Neuroscience
- Pharmacology
- Physiology
- Plant Biology
- Population Biology
- Psychological and Cognitive Sciences
- Sustainability Science
- Systems Biology

# Efficiency of quantum vs. classical annealing in nonconvex learning problems

Edited by William Bialek, Princeton University, Princeton, NJ, and approved January 2, 2018 (received for review June 26, 2017)

## Significance

Quantum annealers are physical quantum devices designed to solve optimization problems by finding low-energy configurations of an appropriate energy function by exploiting cooperative tunneling effects to escape local minima. Classical annealers use thermal fluctuations for the same computational purpose, and Markov chains based on this principle are among the most widespread optimization techniques. The fundamental mechanism underlying quantum annealing consists of exploiting a controllable quantum perturbation to generate tunneling processes. The computational potentialities of quantum annealers are still under debate, since few ad hoc positive results are known. Here, we identify a wide class of large-scale nonconvex optimization problems for which quantum annealing is efficient while classical annealing gets stuck. These problems are of central interest to machine learning.

## Abstract

Quantum annealers aim at solving nonconvex optimization problems by exploiting cooperative tunneling effects to escape local minima. The underlying idea consists of designing a classical energy function whose ground states are the sought optimal solutions of the original optimization problem and add a controllable quantum transverse field to generate tunneling processes. A key challenge is to identify classes of nonconvex optimization problems for which quantum annealing remains efficient while thermal annealing fails. We show that this happens for a wide class of problems which are central to machine learning. Their energy landscapes are dominated by local minima that cause exponential slowdown of classical thermal annealers while simulated quantum annealing converges efficiently to rare dense regions of optimal solutions.

Quantum annealing (QA) aims at finding low-energy configurations of nonconvex optimization problems by a controlled quantum adiabatic evolution, where a time-dependent many-body quantum system which encodes for the optimization problem evolves toward its ground states so as to escape local minima through multiple tunneling events (1⇓⇓⇓–5). Classical simulated annealing (SA) uses thermal fluctuations for the same computational purpose, and Markov chains based on this principle are among the most widespread optimization techniques across science (6). Quantum fluctuations are qualitatively different from thermal fluctuations, and in principle, QA algorithms could lead to extremely powerful alternative computational devices.

In the QA approach, a time-dependent quantum transverse field is added to the classical energy function leading to an interpolating Hamiltonian that may take advantage of correlated fluctuations mediated by tunneling. Starting with a high transverse field, the quantum model system can be initialized in its ground state, i.e., all spins aligned in the direction of the field. The adiabatic theorem then ensures that by slowly reducing the transverse field, the system remains in the ground state of the interpolating Hamiltonian. At the end of the process, the transverse field vanishes, and the systems ends up in the sought ground state of the classical energy function. The original optimization problem would then be solved if the overall process could take place in a time bounded by some low-degree polynomial in the size of the problem. Unfortunately, the adiabatic process can become extremely slow. The adiabatic theorem requires the rate of change of the Hamiltonian to be smaller than the square of the gap between the ground state and the first excited state (7⇓–9). For small gaps, the process can thus become inefficient. Exponentially small gaps are not only possible in worst-case scenarios, but have also been found to exist in typical random systems where comparative studies between quantum and classical annealing have so far failed in displaying quantum exponential speed-up, e.g., at first-order phase transition in quantum spin glasses (10, 11) or 2D spin-glass systems (12⇓–14). More positive results have been found for ad hoc energy functions in which global minima are planted in such a way that tunneling cascades can become more efficient than thermal fluctuations (4, 15). As far as the physical implementations of quantum annealers is concerned, studies have been focused on discriminating the presence of quantum effects rather than on their computational effectiveness (16⇓–18).

Consequently, a key open question is to identify classes of relevant optimization problems for which QA can be shown to be exponentially faster than its classical thermal counterpart.

Here, we give an answer to this question by providing analytic and simulation evidence of exponential speed-up of quantum vs. classical SA for a representative class of random nonconvex optimization problems of basic interest in machine learning. The simplest example of this class is the problem of training binary neural networks (described in detail below): Very schematically, the variables of the problem are the (binary) connection weights, while the energy measures the training error over a given dataset.

These problems have been very recently found to possess a rather distinctive geometrical structure of ground states (19⇓⇓–22): The free-energy landscape has been shown to be characterized by the existence of an exponentially large number of metastable states and isolated ground states and a few regions where the ground states are dense. These dense regions, which had previously escaped the equilibrium statistical physics analysis (23, 24), are exponentially rare, but still possess a very high local internal entropy: They are composed of ground states that are surrounded, at extensive but relatively small distances, by exponentially many other ground states. Under these circumstances, classical SA (as any Markov chain satisfying detailed balance) gets trapped in the metastable states, suffering ergodicity breaking and exponential slowing down toward the low-energy configurations. These problems have been considered to be intractable for decades and display deep similarities with disordered spin-glass models, which are known to never reach equilibrium.

The large deviation analysis that has unveiled the existence of the rare dense regions has led to several novel algorithms, including a Monte Carlo scheme defined over an appropriate objective function (20) that bears close similarities with a quantum Monte Carlo (QMC) technique based on the Suzuki–Trotter transformation (5). Motivated by this analytical mapping and by the geometrical structure of the dense and degenerate ground states which is expected to favor zero-temperature kinetic processes (25, 26), we have conducted a full analytical and numerical statistical physics study of the QA problem, reaching the conclusion that in the quantum limit, the QMC process, i.e., simulated QA (SQA), can equilibrate efficiently, while the classical SA gets stuck in high-energy metastable states. These results generalize to multilayered networks.

While it is known that other quasioptimal classical algorithms for the same problems exist (20, 27, 28), here, we focus on the physical speed-up that a QA approach could provide in finding rare regions of ground states. We provide physical arguments and numerical results supporting the conjecture that the real-time QA dynamics behaves similarly to SQA.

As far as machine learning is concerned, dense regions of low-energy configurations (i.e., quasiflat minima over macroscopic length scales) are of fundamental interest, as they are particularly well-suited for making predictions given the learned data: On the one hand, these regions are by definition robust with respect to fluctuations in a sizable fraction of the weight configurations and, as such, are less prone to fit the noise. On the other hand, an optimal Bayesian estimate, resulting from a weighted consensus vote on all configurations, would receive a major contribution from one of such regions, compared with a narrow minimum; the centroid of the region (computed according to any reasonable metric which correlates the distance between configurations with the network outcomes) would act as a representative of the region as a whole (29). In this respect, it is worth mentioning that in deep learning (30), all of the learning algorithms which lead to good prediction performance always include effects of a systematically injected noise in the learning phase, a fact that makes the equilibrium Gibbs measure not the stationary measure of the learning protocols and drives the systems toward wide minima. We expect that these results can be generalized to many other classes of nonconvex optimization problems where local entropy plays a role, ranging from robust optimization to physical disordered systems.

Quantum gate-based algorithms for machine learning exist; however, the possibility of a physical implementation remains a critical issue (31).

## Energy Functions

As a working example, we first consider the problem of learning random patterns in single-layer neural network with binary weights, the so-called binary perceptron problem (23). This network maps vectors of N inputs

Following the standard SQA approach, we identify the binary variables σ with one of the components of physical quantum spins, say, **1** acting in the longitudinal direction z and a magnetic field Γ acting in the transverse direction x. The interpolating Hamiltonian reads:

The replicated system needs to be studied in the limit

## Connection with the Local Entropy Measure

The effective Hamiltonian Eq. **3** can be interpreted as many replicas of the original systems coupled through one-dimensional periodic chains, one for each original spin (Fig. 1*B*). Note that the interaction term γ diverges as the transverse field Γ goes to 0. This geometrical structure is very similar to that of the robust ensemble (RE) formalism (20), where a probability measure that gives higher weight to rare dense regions of low-energy states is introduced. There, the main idea is to maximize *C*).

The Suzuki–Trotter representation and the RE formalism differ in the topology of the interactions between replicas and in the scaling of the interactions, but for both cases, there is a classical limit,

For the sake of clarity, we should remind that in the classical limit and for

## Phase Diagram: Analytical and Numerical Results

Thanks to the mean field nature of the energetic part of the system, Eq. **3**, we can resort to the replica method for calculating analytically the phase diagram. As discussed in *SI Appendix*, this can be done under the so-called static approximation, which consists of using a single-parameter

In Fig. 2, we report the analytical predictions for the average classical component of the energy of the quantum model as a function of the transverse field Γ. We compare the results with the outcome of extensive simulations performed with the reduced-rejection-rate (RRR) Monte Carlo method (37), in which Γ is initialized at 2.5 and gradually brought down to 0 in regular small steps, at constant temperature, and fixing the total simulation time to *Materials and Methods* and *SI Appendix*. The size of the systems, the number of samples, and the number of Trotter replicas are scaled up to large values, so that both finite size effects and the quantum limit are kept under control. A key point is to observe that the results do not degrade with the number of Trotter replicas: The average ground-state energy approaches a limiting value, close to the theoretical prediction, in the large y quantum limit. The results appear to be rather insensitive to both N and the simulation time-scaling parameter τ. This indicates that Monte Carlo appears to be able to equilibrate efficiently, in a constant (or almost constant) number of sweeps, at each Γ. The analytical prediction for the classical energy only appears to display a relatively small systematic offset (due to the static approximation) at intermediate values of Γ, while it is very precise at both large and small Γ; the expectation of the total Hamiltonian, on the other hand, is in excellent agreement with the simulations (*SI Appendix*).

In the same plot, we display the behavior of classical SA simulated with a standard Metropolis–Hastings scheme, under an annealing protocol in β that would follow the same theoretical curve as SQA if the system were able to equilibrate (*Materials and Methods* and *SI Appendix*): As expected (34), SA gets trapped at very high energies (increasing with problem size; in the thermodynamic limit, it is expected that SA would remain stuck at the initial value

In Fig. 2 *Inset*, we report the analytical prediction for the transverse overlap parameter

In Fig. 3, we provide the profiles of the classical energy minima found for different values of Γ in the case of SQA and different temperatures for SA. These results are computed analytically by the cavity method (see *Materials and Methods* and *SI Appendix* for details) by evaluating which is the most probable energy found at a normalized Hamming distance d from a given configuration. As it turns out, throughout the annealing process, SQA follows a path corresponding to wide valleys, while SA gets stuck in steep metastable states. The quantum fluctuations reproduced by the SQA process drive the system to converge toward wide flat regions, despite the fact that they are exponentially rare compared with the narrow minima.

The physical interpretation of these results is that quantum fluctuations lower the energy of a cluster proportionally to its size or, in other words, that quantum fluctuations allow the system to lower its kinetic energy by delocalizing; see refs. 25, 26, and 39 for related results. Along the process of reduction of the transverse field, we do not observe any phase transition which could induce a critical slowing down of the QA process, and we expect SQA and QA to behave similarly (11, 36).

This is in agreement with the results of a direct comparison between the real-time quantum dynamics and the SQA on small systems (*SI Appendix*, we have performed extensive numerical studies of properly selected small instances of the binary perceptron problem, comparing the results of SQA and QA and analyzing the results of the QA process and the properties of the Hamiltonian. To reproduce the conditions that are known to exist at large values of N, we have selected instances for which a fast annealing schedule SA gets trapped at some positive fraction of violated constraints, and yet the problems display a sufficiently high number of solutions. We found that the agreement between SQA and QA on each sample is excellent. The measurements on the final configurations reached by QA qualitatively confirm the scenario described above, that QA is attracted toward dense, low-energy regions without getting stuck during the annealing process. Finally, the analysis of the gap between the ground state of the system and the first excited state as Γ decreases shows no signs of the kind of phenomena which would typically hamper the performance of QA in other models: There are no vanishingly small gaps at finite Γ (compare discussion in the introduction). We benchmarked all these results with “randomized” versions of the same samples, in which we randomly permuted the classical energies associated with each spin configuration, so as to keep the distribution of the classical energy levels while destroying the geometric structure of the states. Indeed, for these randomized samples, we found that the gaps nearly close at finite

As concluding remarks, we report that the models with

For the sake of completeness, we have checked that the performance of SQA in the *SI Appendix*.

## Conclusions

We conclude by noticing that, at variance with other studies on spin-glass models in which the evidence for QA outperforming classical annealing was limited to finite values of y, thereby just defining a different type of classical SA algorithms, in our case the quantum limit coincides with the optimal behavior of the algorithm itself. We believe that these results could play a role in many optimization problems in which optimality of the cost function needs to also meet robustness conditions (i.e., wide minima). As far as learning problems are concerned, it is worth mentioning that for the best-performing artificial neural networks, the so-called deep networks (30), there is numerical evidence for the existence of rare flat minima (40) and that all of the effective algorithms always include effects of systematic injected noise in the learning phase (41), which implies that the equilibrium Gibbs measure is not the stationary measure of the learning protocols. For the sake of clarity, we should remark that our results are aimed to suggest that QA can equilibrate efficiently, whereas SA cannot; i.e., our notion of quantum speed-up is relative to the same algorithmic scheme that runs on classical hardware. Other classical algorithms for the same class of problems, besides the above-mentioned ones based on the RE and the SQA itself, have been discovered (27, 38, 42⇓–44); however, all of these algorithms are qualitatively different from QA, which can provide a huge speed-up by manipulating single physical bits in parallel. Thus, the overall solving time in a physical QA implementation (neglecting any other technological considerations) would have, at worst, only a mild dependence on N.

Our results provide further evidence that learning can be achieved through different types of correlated fluctuations, among which quantum tunneling could be a relevant example for physical devices.

## Materials and Methods

### Simulated QA Protocol.

All SQA simulations were performed by using the RRR Monte Carlo method (37). We fixed the total number of spin flip attempts at

### Classical SA Protocol.

The results for SA presented in Fig. 2 used an annealing protocol in β designed to make a direct comparison with QA: We found analytically a curve *SI Appendix*, Fig. S1. The SA protocol thus consisted of setting

Other more standard annealing protocols (e.g., linear, exponential, or logarithmic) yielded very similar qualitative results, as expected from the analysis of ref. 34.

### Estimation of the Local Energy and Entropy Landscapes.

To compute the local landscapes of the energy and the entropy around a reference configuration, Fig. 3, we used the belief propagation algorithm. We added an external field in the direction of the configuration of interest to focus on regions surrounding that configuration. The strength of the field allowed us to control the size of the region (parameter d in Fig. 3). Typical energies are computed by setting the temperature to infinity, while local entropies are computed by setting the temperature to 0. The details of the algorithm are presented in *SI Appendix*.

### Real-Time QA Simulations on Small Instances.

The real-time quantum dynamics simulations on small systems were performed by solving the time-dependent Schrödinger equation for the Hamiltonian of Eq. **2** by using the short iterative Lanczos method (45), which consists of computing the evolution with the Lanczos algorithm, at fixed Γ for a short time interval

## Acknowledgments

We thank G. Santoro, B. Kappen, and F. Becca for discussions. This work was supported by Office of Naval Research Grant N00014-17-1-2569.

## Footnotes

↵

^{1}C.B. and R.Z. contributed equally to this work.- ↵
^{2}To whom correspondence may be addressed. Email: carlo.baldassi{at}unibocconi.it or riccardo.zecchina{at}unibocconi.it.

Author contributions: C.B. and R.Z. designed research, performed research, contributed new reagents/analytic tools, analyzed data, and wrote the paper.

The authors declare no conflict of interest.

This article is a PNAS Direct Submission.

This article contains supporting information online at www.pnas.org/lookup/suppl/doi:10.1073/pnas.1711456115/-/DCSupplemental.

- Copyright © 2018 the Author(s). Published by PNAS.

This open access article is distributed under Creative Commons Attribution-NonCommercial-NoDerivatives License 4.0 (CC BY-NC-ND).

## References

- ↵
- Ray P,
- Chakrabarti BK,
- Chakrabarti A

- ↵
- ↵
- ↵
- Farhi E, et al.

- ↵
- ↵
- Moore C,
- Mertens S

- ↵
- Born M,
- Fock V

- ↵
- Landau L

- ↵
- ↵
- Altshuler B,
- Krovi H,
- Roland J

- ↵
- Bapst V,
- Foini L,
- Krzakala F,
- Semerjian G,
- Zamponi F

- ↵
- Santoro GE,
- Martoňák R,
- Tosatti E,
- Car R

- ↵
- Martoňák R,
- Santoro GE,
- Tosatti E

- ↵
- Heim B,
- Rønnow TF,
- Isakov SV,
- Troyer M

- ↵
- Rønnow TF, et al.

- ↵
- ↵
- ↵
- Langbein W, et al.

- ↵
- Baldassi C,
- Ingrosso A,
- Lucibello C,
- Saglietti L,
- Zecchina R

- ↵
- Baldassi C, et al.

- ↵
- Baldassi C,
- Ingrosso A,
- Lucibello C,
- Saglietti L,
- Zecchina R

- ↵
- Baldassi C,
- Gerace F,
- Lucibello C,
- Saglietti L,
- Zecchina R

- ↵
- Krauth W,
- Mézard M

- ↵
- ↵
- ↵
- Biroli G,
- Zamponi F

- ↵
- Hubara I,
- Courbariaux M,
- Soudry D,
- El-Yaniv R,
- Bengio Y

- ↵
- Courbariaux M,
- Bengio Y,
- David JP

- ↵
- MacKay DJ

- ↵
- ↵
- Aaronson S

- ↵
- ↵
- Huang H,
- Kabashima Y

- ↵
- Horner H

- ↵
- Bapst V,
- Semerjian G

- ↵
- Bapst V,
- Semerjian G

- ↵
- Baldassi C

- ↵
- Baldassi C,
- Braunstein A,
- Brunel N,
- Zecchina R

- ↵
- ↵
- Keskar NS,
- Mudigere D,
- Nocedal J,
- Smelyanskiy M,
- Tang PTP

- ↵
- Bottou L,
- Curtis FE,
- Nocedal J

- ↵
- ↵
- Baldassi C

- ↵
- Baldassi C,
- Braunstein A

- ↵
- Schneider BI,
- Guan X,
- Bartschat K

## Citation Manager Formats

## Sign up for Article Alerts

## Article Classifications

- Physical Sciences
- Computer Sciences