Manuscript Offprint
arXiv:2610.23296Learning angles for quantum approximate optimization
Johannes Jakubik, Isabelle Wittmann, Zaheed Gaffoor, Gciniwe Simphiwe Baloyi, Craig Mahlasi, Etienne Vos, Thomas Brunschwiler, and Daniel J. Egger
IBM Research
The Quantum Approximate Optimization Algorithm (QAOA) and its variants are leading algorithms to help solve challenging combinatorial optimization problems. QAOA maps these problems to Ising Hamiltonians such that their ground state is the desired solution. Candidate solutions are then drawn from a variational quantum circuit. The performance of QAOA hinges on a set of variational angles. However, finding good angles is an instance-specific and computationally expensive non-convex classical optimization task. Here, we learn the mapping from the problem instance to high-quality QAOA angles. Our learned models replace the per-instance optimization, that we call the solver, with a single forward pass that is several orders of magnitude faster than the solver with a near identical quality. Our models further generalize to unseen topologies such as Barabási–Albert and 2D grid graphs. Experiments on quantum hardware confirm that QAOA samples with angles produced by our open-source models are indistinguishable from solver angles. Crucially, models sensitive to the topology of the problem instance increase the quality of the QAOA angles. Our work amortizes a major bottleneck in QAOA by an up-front data generation and training cost. Importantly, this cost can be amortized over time in settings where many similar problems are optimized on a regular basis, as is often the case in applications for industry.
I. INTRODUCTION
Combinatorial optimization underlies problems throughout logistics, finance, and the physical sciences [1–3]. Yet, many of the most important instances are NP-hard and remain intractable for exact classical methods at scale [4, 5]. By processing information with the laws of quantum mechanics, quantum computers offer new algorithmic tools to tackle such problems [6]. The quantum approximate optimization algorithm (QAOA) [7] aims to solve combinatorial problems by finding the ground state of a corresponding Hamiltonian [8]. QAOA samples candidate solutions from a quantum state built by alternating p layers of and . Here, is the mixer Hamiltonian, whose easy-to-prepare ground state is the initial state. Crucially, the performance of QAOA depends on the 2p angles , . Finding good angles is, however, expensive: the optimization landscape is non-convex and rugged, and locating high-quality angles can be NP-hard [9].
This bottleneck motivates many QAOA angle selection methodologies [10], ranging from analytic fixed-angle conjectures [11] to a wide variety of machine-learning (ML) strategies to predict, transfer, extrapolate, or optimize ( , ). Methods that directly predict instance-specific QAOA angles are often confined to small, classically simulable graphs of up to roughly 20 nodes and shallow depths. Other approaches reach larger graph sizes or depths through angle transfer, depth extrapolation, or continued instance-specific optimization. Existing ML approaches therefore address distinct aspects of the broader problem of learning QAOA angles under substantially varying experimental settings, see App. A. Therefore, it remains an open question whether learned models can directly predict high-quality angles across a broad range of problem sizes and topologies without further per-instance optimization.
To address this question, we frame QAOA angle selection as a supervised, graph-level regression problem. For a given target depth , a single neural network maps a weighted graph representing the optimization problem directly to the QAOA angles. This replaces costly per-instance angle optimization with a single inexpensive forward pass. The following points summarize our contributions: (i) We train and evaluate a wide range of ML models on a dataset of QAOA angles comprising 12 191 weighted MAXCUT instances spanning random regular, Erdős–Rényi, and heavy-hex topologies with up to 144 nodes. By rescaling on a per-instance basis, we remove the weight-dependent scale of and enable a single model to learn across graph families and weight distributions. (ii) Across circuit depths , the predicted angles achieve approximation ratios close to those obtained by COBYLA [12] without post-prediction optimization. This reduces the time to obtain and by several orders of magnitude, yielding a favorable trade-off between solution quality and runtime. (iii) A single trained model generalizes to graphs substantially larger than those seen in training (up to 200 nodes) and to unseen topologies such as Barabási–Albert and 2D-grid graphs, without any per-instance retraining or fine-tuning. (iv) We evaluate our predicted angles on IBM superconducting quantum hardware for heavy-hex graphs up to depth and open-source our training and inference code together with pretrained model weights.
The rest of the paper is organized as follows. Sec. II reviews ML approaches for QAOA and provides a high-level overview of our method. Sec. III introduces QAOA and the analytic fixed-angle baseline. Sec. IV describes the
Corresponding authors: johannes.jakubik1@ibm.com, deg@zurich.ibm.com.
data generation process and ML models. Sec. V presents and discusses the results. We conclude in Sec. VI.
Direct Angle Prediction methods use ML to infer QAOA angles directly from a problem instance. Most approaches use supervised regressors that map a graph to an angle vector. Early work applies Multilayer Perceptrons (MLPs) to flattened adjacency matrices [13], which are sensitive to node relabeling. Later approaches use Graph Neural Networks (GNNs) that can operate on the graph itself [14, 15]. QSeer [16] further incorporates physics-inspired constraints and supports weighted graphs. Generative approaches instead learn conditional distributions over QAOA angles or layer structures. Meng et al. [17] use a denoising diffusion model to generate initial angles at a fixed depth, whereas QAOA-GPT [18] uses an autoregressive transformer to jointly generate QAOA layers and their associated angles. Prior direct predictors have largely been trained and evaluated on classically simulable graphs with at most 20 nodes and up to p = 4.
Angle Transfer methods exploit the concentration of optimal angles across similar graphs by reusing angles from suitable donor instances [19, 20]. While classical approaches use fixed angles or handcrafted similarity measures, ML-based methods identify donors through learned graph embeddings and clustering [21, 22]. Such methods can approach full optimization at lower cost and have been evaluated on graphs with up to 100 nodes and depths up to [23], but rely on angles from related instances.
Depth-Based Extrapolation methods use ML to infer angles for deeper QAOA circuits from solutions at lower depths. Building on iterative heuristics such as INTERP and FOURIER [24], learning-based approaches include one-shot regressors that map angles to higher depths [25] and autoregressive models that predict angles layer by layer [26]. Across these methods, the inferred higher-depth angles are used to initialize subsequent classical optimization at the target depth.
Learned Optimization methods use ML to guide an iterative search rather than directly outputting QAOA angles. Reinforcement-learning approaches learn angle-update policies or edge-selection strategies for recursive QAOA variants [27–30]. Recurrent models learn optimization trajectories from previously solved instances [31, 32], while surrogate-based methods iteratively select angle configurations using predicted objective values [33]. Neural QAOA [34] predicts graph partitions and topology-aware initial angles for divide-and-conquer QAOA, using a differentiable surrogate. Other approaches use Monte Carlo Tree Search to explore the parameter landscape [35]. Related configuration-selection methods predict QAOA performance rather than angle updates. QAOA-Predictor [36] estimates the success probability of linear-ramp QAOA from the problem instance, ramp parameter, and circuit depth, enabling selection of a suitable parameterization and minimal depth. Most such methods have been evaluated on problems with up to 30 nodes. Neural QAOA considers problems with up to 1,000 variables by decomposing them into subproblems of at most 10 qubits [34].
Across these categories, evaluation settings differ, making direct comparison of approaches challenging. Most results rely on classical simulation, with notable hardware exceptions including DARBO [33] and utility-scale benchmarks of transferred angles [10]. Appendix A provides a comparison of evaluation settings across related work.
Our work falls under direct angle prediction. We infer angle vectors for fixed-depth standard QAOA directly from the problem graph, using a single forward pass and no instance-specific refinement. We compare various model architectures under a common protocol, train them across several graph families, circuit depths up to p = 5 and evaluate graphs with up to 200 nodes. Two additional graph families test out-of-distribution generalization. Crucially, we benchmark the inferred angles against known fixed-angle baselines with strong performance guarantees and validate the angles for heavy-hex instances on quantum hardware.
III. QAOA AND FIXED ANGLES
QAOA approximates the ground state of a cost Hamiltonian that encodes a classical optimization problem. Depth p QAOA samples from the variational ansatz state
Here, is the mixing Hamiltonian and , are real variational parameters. These angles are optimized to minimize the expected energy
to drive the ansatz state toward the ground state of .
As a benchmark, we consider the weighted MAXCUT problem. Here, we seek a partition of the vertex set V of a graph such that the total weight of edges crossing the cut is maximized. For binary decision variables indicating the side of the cut containing
| Combinatorial Optimization Problem | Machine learning | Quantum approximate optimization | |||
|---|---|---|---|---|---|
| Conceptual level | Instantiation: Maximum cut | Raw edges | Global features | ||
| Combinatorial problem | Node Count | Avg. Regularity | |||
| Ising reformulation | (u, v, edge weight) | Feature encoding | |||
| Normalization | Edge or node Representation | Global Feature Representation | |||
| Graph or hypergraph representation | Backbone alternatives | Transformers | |||
| Edge-aware message passing | Transformer blocks | ||||
| Mean pooling | Opt.: Mean pooling | ||||
| Linear projection | |||||
FIG. 1. Learning angles for QAOA: In Phase (1), we cast the optimization problem into a (hyper-)graph representation via a normalized Hamiltonian, which allows us to train a deep learning model in Phase (2) across varying graph types. Deep learning models mostly rely on information of the raw graph topologies as well as aggregated global features. Backbones can be distinguished into Graph Neural Network-type models and Transformer-type models. In Phase (3), we describe the inference, where we derive angles via single forward passes and test their quality through simulation and on quantum hardware.
vertex , the objective is
where is the weight of edge . To solve weighted MAXCUT on a quantum computer, we map the binary variables to spin variables , and promote the spin variables to Pauli-Z operators . Using the ground-state convention above, this yields the weighted MAXCUT Hamiltonian
We measure the quality of angles by the approximation ratio
where and are the maximum and minimum cut values, respectively, obtained with CPLEX, a classical optimizer. Furthermore, is the average cut value of the candidate solutions sampled from . The approximation ratio therefore lies in the interval .
For a given graph, generated using NetworkX [37], the angles and can be obtained through a variety of strategies [10]. We find instance specific angles by first performing a two-dimensional grid scan in the interval over at . This is crucial because it avoids multi-modal QAOA angle distributions, e.g., caused by reflections and -shifts, that would complicate model training. Next, we refine the resulting angles with COBYLA set to a small initial trust region of and a maximum of 100 iterations. At depth we evaluate the energy exactly [38]. Finally, we iterate the linear interpolation of Zhou et al. [24] from to 5. We compute the energy at with Pauli Propagation with maximum Pauli weights and coefficients of 4 and , respectively [39, 40]. This avoids a full statevector simulation at the cost of an approximate energy evaluation. We refer to this approach as the solver. The solver results in high AR but requires a long runtime.
By contrast to the solver, a fixed-angle approach derives high-quality QAOA angles by exploiting the local structure seen by QAOA on random regular graphs [11]. For a random -regular graph with no loops smaller than , the local subgraphs relevant at QAOA depth are identical trees. The energy in Eq. (2) is thus written as , where denotes the energy associated with the corresponding tree graph, as illustrated in Fig. 2 for . QAOA angles optimal to tree graphs with non-leaf nodes of degree lower bound the approximation ratio of random -regular graphs. Since the quantum circuits underlying on tree graphs can be evaluated with tree tensor networks, fixed angles have been computed, and stored in a database, for depths up to for random three-regular graphs. With

FIG. 2. Tree graph underlying the fixed-angles design for random four-regular graphs. The purple nodes show the tree seen by depth-one QAOA. The purple and blue nodes show the tree seen by depth-two QAOA.
such a database, obtaining the fixed angles reduces to a constant-time lookup. For graphs that are not regular we use the fixed angles of the -regular graph in the database with the closest degree to the average node degree of . For heavy-hex graphs, we use fixed-angles that have been specifically tailored to this graph topology for up to .
IV. DEEP LEARNING FOR QAOA
The fixed-angle approach relies on the local subgraph structures that characterize the QAOA circuit at a given depth. For random regular graphs, these structures are repetitive, identical tree structures, allowing a single set of tree-derived angles to generalize across graph instances. General graphs instead contain a heterogeneous distribution of local subgraph structures and edge weights, whose individual contributions and relative frequencies collectively determine the QAOA energy. This suggests that a mapping from graph structure to high-quality QAOA angles can be learned from a diverse set of solved instances, avoiding the need for per-instance optimization.
We therefore formulate QAOA angle prediction as supervised graph-level regression. Given a weighted graph , we learn a mapping to the angles
For each circuit depth , we train a single model across multiple graph families, with the aim of generalizing across graph sizes, edge weight distributions, and both seen and unseen topologies. The remainder of this section describes the generation of optimized QAOA training labels and the graph-based models used to learn this mapping.
A. Data Generation
Supervised training requires a sufficiently large dataset of graph instances paired with high-quality QAOA angles as labels. We generate training examples across four graph families, namely, unweighted random -regular graphs, Erdős–Rényi graphs, and Heavy-Hex graphs with edges weights uniformly drawn from either or , see Fig. 3(a)-(c). Table I summarizes the graph properties and number of instances for each setting.
TABLE I. Distribution of the graph instances for the four graph families. Here, is the number of graph instances in the dataset. The heavy-hex graphs have rows and columns. The number of rows and columns of the 2D grid graphs are chosen from .
| Family | Size | Properties | |
|---|---|---|---|
| In distribution | |||
| random d-regular | 1,561 | 10 - 100 | |
| Erdős-Rényi | 6,430 | 10 - 100 | |
| Heavy-hex (uniform) | 2,100 | 10 - 144 | |
| Heavy-hex (discrete) | 2,100 | 10 - 144 | |
| Out of distribution | |||
| Barabási-Albert | 100 | 10 - 50 | |
| 2D grid | 25 | 4 - 100 | |
| Erdős-Rényi | 20 | 150, 200 | |
We obtain the corresponding QAOA training labels and up to with the solver described in Sec. III. Since Pauli propagation provides an approximate energy evaluation, we validate its accuracy on instances with 20 nodes. Here, the approximation ratios obtained using QAOA angles optimized with Pauli propagation are nearly identical to those obtained from angles optimized on the same graph instances using an exact state-vector energy evaluator, see Fig. 4. Additional implementation details regarding the data generation, distributions of training examples, and the data splits are provided in App. B.
In addition to the in-distribution graphs we also generate out of distribution graphs to evaluate the extrapolation performance of the models. Erdős–Rényi graphs with 150 and 200 nodes allow us to test model extrapolation to unseen graph sizes. Barabási–Albert (BA) and 2D grid graphs allow us to test models on unseen graph topologies. In particular, when building the BA graphs we attach each new node to existing nodes to ensure that the average node degree is in the fixed angles database. Moreover, the edge weights for both BA and 2D grid graph families were sampled uniformly at random from the discrete set .
B. Target normalization
The QAOA applies the unitary , such that a global rescaling of the cost Hamiltonian results in an inverse rescaling of the corresponding angles. Graph instances with large edge weights therefore generally require small values. The scale of can vary substantially since it depends on the problem at hand. This introduces an additional variation in the regression targets. We reduce this dependency through a per-instance rescaling of
In-distribution (training topologies)
(a) Erdős-Rényi (n=50, p≈12%)
(b) Random 4-regular (n=50)
Out-of-distribution (zero-shot)
(c) Heavy-hex (discrete) (n=48)
(d) Barabási-Albert (n=50, m=2)

(e) Grid 2D (6×8, n=48)
(f)
(g)
(h)
(i)
FIG. 3. Panels (a), (b), and (c) exemplify in-distribution Erdős–Rényi, random-regular, and heavy-hex graphs, respectively. Panels (d) and (e) exemplify out-of-distribution Barabási–Albert and 2D grid graphs, respectively. Panels (f) and (g) show the distribution of the and angles, respectively, obtained from the solver at prior to rescaling . (h) Distribution of the angles before and after rescaling with Eq. (7). (i) Per-instance cost-operator scale factor across all five graph topologies.

FIG. 4. Quality validation of the QAOA angle training with Pauli propagation at and 20 nodes. (a) AR loss of the angles optimized with Pauli propagation versus the AR of angles optimized with a state vector. Each marker is one of either 160 random -regular graphs with or 160 Erdős–Rényi graphs with . The ARs of all the trained angles are evaluated with a state vector. (b) Distribution of the loss in AR.
the cost operator, i.e., , where
following Eq. (8) of Ref. [41]. Here, denotes the mean squared magnitude of the cost operator's Pauli coefficients grouped by locality order. For example, only has second order terms such that with on a weighted graph. We use as the training target, while the angles remain unchanged. At inference time, the predicted values are divided by to recover the angles used for circuit evaluation. On the training data, the rescaled have a smaller range than , see Fig. 3(g)-(i). We find that this rescaling is crucial to train a single model on the different graph families.
C. Machine learning models
We evaluate seven machine learning architectures for QAOA angle prediction. As a non-structural baseline, we use a multi-layer perceptron (MLP) that takes global graph features as input, including the number of nodes and edges, mean degree, and degree standard deviation. A sequence of fully connected layers maps these features directly to the 2p output angles, providing a reference for how well QAOA angles can be predicted from coarse graph properties alone. All global features are standardized using statistics from the training set.
The remaining models additionally use the graph structure and edge weights. For comparison, we group our implementations into three classes according to how this information is represented and processed, see Fig. 5. Edge-token transformers represent each edge through its endpoints and weight as a separate token, together with a global token constructed from the global graph features. The tokens are processed jointly using self-attention [42], after which the global token is projected onto the output angle vector. Node-based graph encoders instead represent the graph through node features, such as node degree, and process them together with the graph connectivity using either Graph Transformer [43] or graph convolu-tional [44] layers. The resulting node representations are averaged, concatenated with the global graph features, and mapped to the output angles using an MLP. Message-passing graph networks similarly operate on node representations and graph connectivity, but update node features by passing information between neighboring nodes along the edges [45]. In our models, the node representations are initialized from the global graph features and updated through edge-aware message-passing layers before being pooled and mapped to the output angles.
Within these three classes, we evaluate an Edge Transformer (EdgeTF) and a diffusion-based transformer (DiffTF), a Graph Transformer (GraphTF) and graph convolutional network (GCN), and a Graph Neural Network (GNN) and Graph Isomorphism Network (GIN), respectively. Further architectural and implementation details are provided in App. E. This comparison tests the value of coarse graph statistics for QAOA angle prediction and how performance depends on the representation of graph structure.

FIG. 5. Schematic overview of the three classes of graph-based models used for QAOA angle prediction. The models differ in how graph structure and global graph features are represented, processed, and combined before predicting the QAOA angles.
D. Model training
For each architecture and circuit depth, training is performed jointly across all four graph families described in Sec. IV A. We use fixed training, validation, and test splits that are shared across all model architectures, see App. B. The mean-squared error (MSE) between the predicted and target angle vectors ( ) is the training objective. To identify suitable hyperparameters across models, we perform a grid search over combinations of learning rates and batch sizes based on validation performance. We use the Adam optimizer [46] along with a selected learning rate of and batch size of 64, a 5-epoch linear warm-up, and cosine annealing for the remaining epochs. Throughout training the gradient norms are clipped to 1.0. The models are trained for a maximum of 100 epochs with early stopping based on validation loss. To obtain robust performance estimates, we train each model using five independent random seeds (42–46). Unless stated otherwise, all reported results are averaged over these five training runs.
V. RESULTS
First, we characterize runtime–accuracy trade-offs by locating our learned models relative to the fixed-angles baseline and the upper bound formed by the solver. Second, we assess predictive quality across circuit depths. Third, we probe generalization to graph sizes and topologies not seen during training. Fourth, we aim to better comprehend limitations of MSE-style proxy training objective compared to the underlying energy landscape. Finally, we investigate the quality of predicted angles on real quantum hardware.
A. Pareto fronts
The central advantage of learned angle inference is the cost of obtaining angles. We study the Pareto frontier of approximation ratio against runtime for (i) the solver, defined in Sec. IV A; (ii) the fixed angles, obtained by an lookup into the existing database [47]; and (iii) the deep-learning models, which predict angles in a single forward pass. For each method, we report the average per-instance cost of producing angles—the optimization time for the solver, the inference time for the learned models. We exclude all one-time costs that amortize over all future instances, i.e., deep learning model trainings and precomputation of the fixed-angle database.
We average over the test set, defined in App. B2, for Erdős–Rényi and random-regular graphs, see Fig. 6(a) and (b), and over the two heavy-hex graph families, see Fig. 6(c) and (d). The fixed-angle lookup and the solver span the two extremes of the frontier, see Fig. 6(a) and (c). A fixed-angle lookup is effectively free but yields the lowest ARs. By contrast, the solver achieves the highest quality at the cost of a full per-instance optimization, see e.g., Fig. 6(a). The learned models sit between these extremes. In addition to the AR, we report the solver-relative AR defined as
for an instance i. Reach therefore directly measures how much of the solver performance is recovered when the per-instance optimization is replaced by another angle-setting method. It is an empirical normalization and not a theoretical approximation guarantee.


FIG. 6. Pareto front of the trade-off between method runtime and AR for p = 1 to 5 averaged over the Test Set. Panels (a) and (b) show the AR and Reach, respectively, for Erdős–Rényi and random-regular graphs. Panels (c) and (d) show the AR and Reach, respectively, for the heavy-hex graphs with uniform and discrete weighted. We only show methods that are on the Pareto front.
Importantly, the learned models are closer to the solver in quality and often closer to fixed angles in terms of runtime, see Fig. 6(b) and (d). The model inference costs are several orders of magnitude below the solver's per-instance optimization time, while their approximation ratios generally recover over 99% of the solver's accuracy. Because inference is a single forward pass whose cost is largely independent of the optimization landscape's ruggedness, whereas the solver's cost grows with depth, we see larger runtime gaps between learned models and the solver as p increases.
B. Solver-relative performance across instances
Since the mean Reach is consistently close to one across the learned models, average performance shows only small differences between the different model architectures. To capture these differences, we report the fraction of test instances that meet or exceed a given Reach threshold . For model m and depth p, we define
Here, N is the size of the test set.
We compute separately for each training run and report the mean and standard deviation across the five random seeds. The results reveal larger differences between the architectures than the mean Reach, see Tab. II. Across the seven learned models, mean Reach ranges only from 99.973% to 99.996% at p = 1 and from 93.025% to 99.692% at p = 5. In contrast, the fraction of instances with Reach separates the models more clearly as circuit depth increases. This difference is particularly pronounced for the GNN and GIN compared with the global-feature MLP. At p = 3, the GNN obtains at least 99.9% of the solver AR for 86.64% of the test instances, compared with 51.02% for the MLP. We visualize the strong differences in the corresponding cumulative distribution functions in Fig. 7. At p = 4, the corresponding fractions are 84.39% and 51.48%. The GIN shows a similar pattern, reaching the threshold for 81.40% and 79.38% of the instances at p = 3 and p = 4, respectively.
Overall, the GNN and GIN outperform the MLP more as p increases. This suggests that predicting QAOA angles based on graph structure is beneficial and that the models are not merely transferring angles based on concentration.
| Model | p = 1 | p = 2 | p = 3 | p = 4 | p = 5 |
|---|---|---|---|---|---|
| GNN | 99.6 ± 0.1 | 95.1 ± 0.2 | 86.6 ± 0.9 | 84.4 ± 0.8 | 52.0 ± 0.0 |
| GIN | 99.7 ± 0.1 | 94.0 ± 0.3 | 81.4 ± 1.7 | 79.4 ± 1.0 | 49.4 ± 0.0 |
| GT | 98.0 ± 0.3 | 85.8 ± 1.1 | 62.2 ± 4.7 | 64.1 ± 2.4 | 37.3 ± 0.0 |
| GCN | 96.6 ± 0.4 | 80.1 ± 1.2 | 58.2 ± 1.9 | 60.6 ± 1.6 | 33.1 ± 0.1 |
| DT | 95.2 ± 0.3 | 78.5 ± 0.5 | 57.5 ± 0.5 | 60.7 ± 1.0 | 39.9 ± 0.0 |
| ET | 95.6 ± 0.5 | 79.2 ± 0.2 | 57.4 ± 1.9 | 62.4 ± 0.6 | 35.4 ± 0.0 |
| MLP | 94.7 ± 0.3 | 76.0 ± 1.1 | 51.0 ± 6.8 | 51.5 ± 6.5 | 44.2 ± 0.0 |
TABLE II. Fraction of multi-topology test instances for which the predicted angles obtain at least 99.9% of the solver AR. We report results across all depths . Values are percentages and show mean ± standard deviation across five independent training runs.

FIG. 7. Empirical cumulative distributions of instance-level Reach at (lower is better). Vertical line represents Reach of as an important threshold.

FIG. 8. Inference results on unseen 2D grid (a) and Barabási-Albert (b) graph topologies for at various node counts. The bars show the median Reach and the error bars correspond to the and quantiles across the five random seeds.
C. Generalization to unseen graph families
We now infer angles for 2D grid graphs and BA networks to study how our models generalize to unseen graph topologies. BA networks exhibit a scale-free power-law degree distribution characterized by heavy-tailed hubs: a small fraction of nodes maintain high degree while most have low degrees, see Fig. 3(d). In contrast, 2D grids possess strong spatial locality with a bounded maximum degree of 4, see Fig. 3(e). These graph families provide a clear structural contrast between scale-free connectivity and local spatial lattices. They complement our training distribution, see Tab. I, thus allowing us to benchmark out-of-distribution performance. These topological differences cause a significant shift in angles found by the solver, see Fig. 3(f).
For both graph families, we evaluate the Reach for depth , the solver found angles are discussed in App. D 2. As a baseline, we compare against the fixed-angles based on average node degree without any further optimization, see fixed-angles in Fig. 8. Because the fixed angles are derived for unweighted regular graphs, applying them to our instances is an approximation.
Across both grid and Barabási–Albert (BA) graph topologies, the learned architectures consistently and substantially outperform the fixed-angle baseline, with median Reach improving from roughly 0.81–0.94 for fixed-angles to over 0.95 for most trained models. This improvement holds across nearly the full range of node counts tested (4–100 nodes for grids, 10–50 nodes for BA graphs), indicating that the learned parameter-prediction approach generalizes well beyond the naive heuristic baseline. Architectures such as EdgeTF, GCN, GIN, GraphTF, and MLP achieve high median Reach with tight, largely symmetric interquartile ranges throughout, reflecting both strong accuracy and low instance-to-instance variability as graph size increases. The one clear exception is the GNN architecture, which behaves very differently depending on graph topology: it performs reliably on grids but becomes unstable on BA graphs at higher node counts. The instability of the GNN is particularly interesting as GNN models outperform other models on in-distribution data. Thus, our results on BA graphs suggest that improved fitting of the structure of in-distribution graphs limits the transfer to unseen topologies. Contrary, generic models that leverage only aggregated data like MLP perform more reliably in transfer scenarios while they underperform on in-distribution data. Overall, the results show a strong zero-shot transfer from random regular, Erdős–Rényi, and heavy-hex training graphs to structurally distinct 2D grid and BA test graphs.
D. Generalization to unseen graph sizes
We now measure the performance of the models when applied to unseen graph sizes. We generate ten Erdős–Rényi graphs with 150 and 200 nodes, and find their angles with the solver for depths . We then compare the inference results from our deep learning models to the performance of the solver and fixed angles. All deep

FIG. 9. Inference on unseen graph sizes at the example of large-scale Erdős–Rényi graph topologies with 150 nodes (blue) and 200 nodes (purple).
learning models have only seen Erdős–Rényi graphs with up to 100 nodes during training. Thus, all graphs in this experiment are outside of the training distribution with respect to node size. We provide an overview on how the training and testing distributions shift in this example in the appendix.
Overall, the angles inferred by graph models, e.g., GNN, GIN, under-perform plain transformer architectures, e.g., Edge transformer, Diffusion transformer, see Fig. 9. One possible explanation for this behavior is that message passing is better suited to capture specific graph characteristics and, therefore, fits the training data more strongly making generalization to unseen, larger graphs more challenging.
E. Limitations of MSE-style proxy objectives
Ideally, QAOA angles should minimize the energy . However, the training objective for the models is the MSE with respect to pre-trained angles. In the following ablation, we investigate potential de-correlation of our MSE training objective with . Conceptually, we visualize iso-MSE lines and the corresponding spans for an Erdős–Rényi graph with 100 nodes and edge probability of 5% from our validation dataset. In this example, the energy landscape is periodic, but as the distance to the optimum increases the iso-MSE rings become increasingly instable, see Fig. 10. Importantly, the span of the iso-MSE rings increase with increasing distance from the optimum, suggesting a decreasing correlation of the MSE objective with the energy landscape. Plotting the iso-MSE rings against the radiant shows increasing fluctuations when MSE scores decrease, see Fig. 10. This suggests that larger MSE errors in the predicted angles correspond to less reliable energy estimates. Overall, for easy-to-fit periodic energy landscapes, MSE can serve as a proxy objective when MSE errors are low enough so that they are still reasonably well correlated to the energy landscape. However, for more complex energy landscapes, MSE objectives might be ill-defined for learning surrogates over the energy function.

FIG. 10. Visualizing de-correlation of an MSE proxy objective and the underlying energy landscape for increasing MSE errors at the example of a 100 node Erdős–Rényi graph.

FIG. 11. Inference across data fractions for all Deep Learning architectures at p = 3. These results demonstrate that even 10(%) of the training data is sufficient to outperform fixed angles for all models except the MLP trained on 10(%) of the training data.
We highlight the de-correlation of standard deep learning regression losses and the underlying energy landscape because the important trade-off it implies: Deep learning regression objectives like the MSE are fast to compute, but can impose non-negligible inaccuracies. More involved and more accurate objectives, like the energy function itself, imply significant computational overheads that slow down the training of deep learning models substantially—particularly with increasing QAOA depth.
F. Scaling behavior with dataset size
To understand if we generate enough training data, or perhaps too much, we investigate model performance as a function of the dataset size. Overall, we observe a similar scaling between the different models of their ARs with increasing dataset size, see Fig. 11 for p = 3. The highest approximation ratios of 87.71% and 87.70% were observed from the GNN and GIN, respectively, with all of the training data. The MLP showed the lowest approximation ratio 86.89% at 10% of the training data. Minor inconsistencies for GCN and Graph Transformer are within the range of statistical noise. Importantly, all models that have access to the graph topology generally outperform the fixed-angles conjecture. This demonstrates that even with moderate data generation effort, data-driven approaches can outperform mathematically derived angles. With increasing dataset size, the models generally close the gap toward the solver. This shows a clear correlation for the quality of the predicted angles and additional high quality data.
G. Hardware validation
We now demonstrate the practical utility of our deep learning models by predicting angles for noisy quantum hardware. The training of the deep learning models and the evaluation results in previous sections are based on QAOA angles optimized by COBYLA with evaluated using Pauli propagation. Since this energy evaluation is approximate, we additionally validate the predicted QAOA angles on ibm_boston. To avoid noise from SWAP routing, we validate 630 hardware-native heavy-hex graphs. The graph sizes range from 12 to 144 nodes and, importantly, are not in the training data. For each deep learning model, we infer the QAOA angles and draw 8192 samples x on ibm_boston from the corresponding QAOA circuit at depths p = 1, 2, and 3. The resulting sample distributions are compared to the solver and the fixed angles. As performance metric, we compute the Conditional Value at Risk at a level (CVaR ) of the ARs for each graph. We use CVaR since it is more robust to noise than the mean [48]. To compute the CVaR , we first calculate the AR of each sample . Next, we average over the tail of the resulting distribution ranging from the quantile to 1, see an example for the quantile in Fig. 12 (a). For a given , each graph results in a CVaR and we report the CVaR averaged over all 630 graphs. In Fig. 12 (b), we report CVaRs at , , and for each method and observe that the performance of the proposed deep learning models is largely indistinguishable from the solver and outperforms the fixed-angle conjecture. Therefore, for heavy-hex graphs, we simultaneously demonstrate both that our deep learning models show an excellent performance and Pauli propagation is a suitable approximate energy evaluator.
VI. DISCUSSION AND CONCLUSION
In this work, we reframe QAOA angle selection as a supervised, graph-level regression problem, replacing a per-instance classical optimization with a single forward pass of a neural network. Trained on roughly twelve thousand weighted MAXCUT instances across four graph families, a single model predicts angles that recover a large fraction of the solver's approximation ratio, while

FIG. 12. (a) Example CVaR computation. The pink line shows the cumulative distribution function (CDF) of the AR of the 8192 samples for a graph with 144 nodes. The solid, dashed, and dotted lines show the , 95%, and 99% quantiles. The pink area represents the samples that we average over to compute CVaR . (b) Average approximation ratio of 630 heavy-hex graphs measured on ibm_boston. The lower error bars, markers, and upper error bars indicate the average over the 630 graphs of the CVaR of the quantum samples at the , 95%, and 99%-level, respectively. FA indicates the fixed angles.
reducing the time to obtain angles by several orders of magnitude. A central ingredient that makes it possible to train a single model on the different graph families is the rescaling of the angles. This rescaling lets one network learn across random regular, Erdős–Rényi, and heavy-hex graphs at once.
Two aspects of our results are particularly relevant in practice. First, the learned models sit in a favorable part of the runtime–accuracy Pareto fronts. They are close to the solver in quality and approach the fixed-angle lookup in runtime. Because inference is a single forward pass, its cost is largely independent of circuit depth, so the runtime advantage over the solver grows as p increases. The instance-level analysis further shows that similar mean performance can mask differences in consistency across graphs. On the multi-topology test set, the more advanced graph models (GNN, GIN) most consistently achieve near-solver performance, while the MLP remains competitive in mean Reach but performs less consistently across individual instances as circuit depth increases. Second, a single trained model can transfer to unseen graphs without retraining or fine-tuning. Some models generalize to Erdős–Rényi graphs of 150 and 200 nodes, and to Barabási–Albert and 2D-grid topologies not seen during training. Here, we observe a consistent pattern: plain transformer architectures generalize to larger and unseen graphs more reliably than message-passing networks, which appear to fit the training topologies more strongly at the expense of transfer. The strong distribution shift we observe for 2D grid graphs marks the point at which topology-specific behavior begins to dominate.
Our analysis also clarifies the limits of the approach. The MSE objective is only a proxy for the energy, and holds only where the two remain correlated. As our iso-MSE analysis shows, this correlation degrades with increasing distance from the optimum, so that a given MSE error translates less reliably into an energy error on more rugged landscapes. This points to a trade-off between fast, differentiable regression losses and slower but more accurate energy-based objectives, which becomes more pressing at higher depth. A related limitation is that our labels inherit the approximations of the data-generation pipeline, in particular the truncated Pauli-propagation evaluation for p > 1, which bounds the quality any model trained against them can reach.
These limitations suggest several directions for future work. Closing the remaining gap to the solver may require moving beyond pure regression towards objectives that incorporate the energy more directly, or using the predicted angles as warm starts for a short classical refinement that recovers the final percentage points of AR at little additional cost. Extending the formulation beyond MAXCUT to other problems, and validating the predicted angles on quantum hardware rather than in simulation, are natural next steps towards practical deployment.
VII. DATA AVAILABILITY
We open-source our trained models and inference code across depths , providing a fast, drop-in replacement for per-instance QAOA optimization that generalizes across graph sizes and topologies. The code we used to create and train the deep learning models can be found under https://github.com/jhnnsjkbk1/qaoa_ai_model_training. We open-source pretrained models at https://huggingface.co/collections/ibm-research/angles-for-quantum-approximate-optimization, which can be used via an inference engine provided by the QAOA Training Pipeline https://github.com/qiskit-community/qaoa_training_pipeline. More broadly, we hope that reframing angle selection—from optimizing each instance separately to learning the map from problem structure to angles—helps remove one of the standing bottlenecks to deploying QAOA at scale.
VIII. ACKNOWLEDGMENTS
We are thankful for the help of Romeo Kienzler and Daniela Szwarcman from IBM Research that allowed to enhance the code base and providing ONNX support for the deep learning models. We are thankful to Ehud Karavani and Yishai Shimoni for providing us with fixed-angles for the heavy-hex graphs. We acknowledge Stefan Woerner for useful conversations.
[1] G. B. Dantzig and J. H. Ramser, The truck dispatching problem, Manage. Sci. 6, 80 (1959).
[2] H. Markowitz, Portfolio selection, J. Finance 7, 77 (1952).
[3] N. Mohseni, P. L. McMahon, and T. Byrnes, Ising machines as hardware solvers of combinatorial optimization problems, Nat. Rev. Phys. 4, 363 (2022).
[4] R. M. Karp, Reducibility among combinatorial problems, in Complexity of Computer Computations, edited by R. E. Miller, J. W. Thatcher, and J. D. Bohlinger (Springer, Boston, MA, 1972) pp. 85–103.
[5] M. R. Garey and D. S. Johnson, Computers and Intractability: A Guide to the Theory of NP-Completeness (W. H. Freeman, San Francisco, CA, 1979).
[6] A. Abbas, A. Ambainis, B. Augustino, A. Bärtschi, H. Buhrman, C. Coffrin, G. Cortiana, V. Dunjko, D. J. Egger, B. G. Elmegreen, et al., Challenges and opportunities in quantum optimization, Nat. Rev. Phys. 6, 718 (2024).
[7] E. Farhi, J. Goldstone, and S. Gutmann, A quantum approximate optimization algorithm (2014), arXiv:1411.4028 [quant-ph].
[8] A. Lucas, Ising formulations of many np problems, Front. Phys. 2, 5 (2014).
[9] L. Bittel and M. Kliesch, Training variational quantum algorithms is np-hard, Phys. Rev. Lett. 127, 120502 (2021).
[10] M. Guo, J. Jurado Diaz, A. Ramesh, C. J. Haupt, A. Bardi, D. Athanasakos, M. E. Sahin, O. Wallis, G. Pennington, C. Arenz, S. Brandhofer, G. Korpas, I. Čepaitė, J. A. Montañez-Barrera, J. Marecek, D. Venturelli, S. Eidenbenz, D. E. Bernal Neira, and D. J. Egger, Setting angles in quantum approximate optimization at utility-scale (2026), arXiv:2606.05311 [quant-ph].
[11] J. Wurtz and D. Lykov, Fixed-angle conjectures for the Quantum Approximate Optimization Algorithm on regular MaxCut graphs, Phys. Rev. A 104, 052419 (2021).
[12] M. J. D. Powell, A direct search optimization method that models the objective and constraint functions by linear interpolation, in Advances in Optimization and Numerical Analysis, edited by S. Gomez and J.-P. Hennart (Springer, Dordrecht, 1994) pp. 51–67.
[13] O. Amosy, T. Danzig, O. Lev, E. Porat, G. Chechik, and A. Makmal, Iteration-free quantum approximate optimization algorithm using neural networks, Quantum Mach. Intell. 6, 38 (2024).
[14] A. Deshpande and A. Melnikov, Capturing symmetries of quantum optimization algorithms using graph neural networks, Symmetry 14, 2593 (2022).
[15] Z. Liang, G. Liu, Z. Liu, J. Cheng, T. Hao, K. Liu, H. Ren, Z. Song, J. Liu, F. Ye, et al., Graph learning for parameter prediction of quantum approximate optimization algorithm, in Proc. ACM/IEEE Des. Autom. Conf.
(2024) pp. 1–4.
[16] L. Jiang, C. Zhang, and F. Chen, Qseer: A quantum-inspired graph neural network for parameter initialization in quantum approximate optimization algorithm circuits (2025), arXiv:2505.06810.
[17] F. Meng, X. Zhou, P. Zhu, and Y. Luo, Conditional diffusion-based parameter generation for quantum approximate optimization algorithm, EPJ Quantum Technol. 12, 100 (2025).
[18] I. Tyagin, M. H. Farag, K. Sherbert, K. Shirali, Y. Alexeev, and I. Safro, QAOA-GPT: Efficient generation of adaptive and regular quantum approximate optimization algorithm circuits (2025), arXiv:2504.16350 [quant-ph].
[19] A. Galda, X. Liu, D. Lykov, Y. Alexeev, and I. Safro, Transferability of optimal qaoa parameters between random graphs, in IEEE Int. Conf. Quantum Comput. Eng. (QCE) (2021) pp. 171–180.
[20] A. Galda, E. Gupta, J. Falla, X. Liu, D. Lykov, Y. Alexeev, and I. Safro, Similarity-based parameter transferability in the quantum approximate optimization algorithm, Front. Quantum Sci. Technol. 2, 1200975 (2023).
[21] C. Moussa, H. Wang, T. Bäck, and V. Dunjko, Unsupervised strategies for identifying optimal parameters in quantum approximate optimization algorithm, EPJ Quantum Technol. 9, 11 (2022).
[22] H. Xu, X. Liu, A. Pothen, and I. Safro, Qaoa parameter transferability for maximum independent set using graph attention networks (2025), arXiv:2504.21135.
[23] J. Falla, Q. Langfitt, Y. Alexeev, and I. Safro, Graph representation learning for parameter transferability in quantum approximate optimization algorithm, Quantum Mach. Intell. 6, 46 (2024).
[24] L. Zhou, S.-T. Wang, S. Choi, H. Pichler, and M. D. Lukin, Quantum approximate optimization algorithm: Performance, mechanism, and implementation on near-term devices, Phys. Rev. X 10, 021067 (2020).
[25] M. Alam, A. Ash-Saki, and S. Ghosh, Accelerating quantum approximate optimization algorithm using machine learning (2020), arXiv:2002.01089.
[26] N. Xie, X. Lee, D. Cai, Y. Saito, and N. Asai, Quantum approximate optimization algorithm parameter prediction using a convolutional neural network, in J. Phys.: Conf. Ser., Vol. 2595 (2023) p. 012001.
[27] S. Khairy, R. Shaydulin, L. Cincio, Y. Alexeev, and P. Balaprakash, Learning to optimize variational quantum circuits to solve combinatorial problems, in Proc. AAAI Conf. Artif. Intell., Vol. 34 (2020) pp. 2367–2375.
[28] J. Yao, M. Bukov, and L. Lin, Policy gradient based quantum approximate optimization algorithm, in Math. Sci. Learn. (2020) pp. 605–634.
[29] M. M. Wauters, E. Panizon, G. B. Mbeng, and G. E. Santoro, Reinforcement-learning-assisted quantum optimization, Phys. Rev. Res. 2, 033446 (2020).
[30] Y. J. Patel, S. Jerbi, T. Bäck, and V. Dunjko, Reinforcement learning assisted recursive QAOA, EPJ Quantum Technol. 11, 6 (2024).
[31] P. Chandarana, P. S. Vieites, N. N. Hegade, E. Solano, Y. Ban, and X. Chen, Meta-learning digitized-counterdiabatic quantum optimization, Quantum Sci. Technol. 8, 045007 (2023).
[32] K.-C. Chen, H. Matsuyama, and W.-H. Huang, Learning to learn with quantum optimization via quantum neural networks (2025), arXiv:2505.00561.
[33] L. Cheng, Y.-Q. Chen, S.-X. Zhang, and S. Zhang, Quantum approximate optimization via learning-based adaptive optimization, Commun. Phys. 7, 83 (2024).
[34] Z. Zheng, J. Wu, and S. Liu, Neural QAOA : Differentiable joint graph partitioning and parameter initialization for quantum combinatorial optimization (2026), arXiv:2605.13072 [quant-ph].
[35] A. Agirre, E. van Nieuwenburg, and M. M. Wauters, A Monte Carlo tree search approach to QAOA: finding a needle in the haystack, New J. Phys. 27, 043014 (2025).
[36] R. Coelho, G. Kruse, and J. M. Lorenz, QAOA-Predictor: Forecasting success probabilities and minimal depths for efficient fixed-parameter optimization (2026), arXiv:2603.02990 [quant-ph].
[37] A. Hagberg, P. J. Swart, and D. A. Schult, Exploring network structure, dynamics, and function using NetworkX, Tech. Rep. (Los Alamos National Laboratory (LANL), 2007).
[38] D. J. Egger, J. Mareček, and S. Woerner, Warm-starting quantum optimization, Quantum 5, 479 (2021).
[39] P. Rall, D. Liang, J. Cook, and W. Kretschmer, Simulation of qubit quantum circuits via pauli propagation, Phys. Rev. A 99, 062337 (2019).
[40] M. S. Rudolph, T. Jones, Y. Teng, A. Angrisani, and Z. Holmes, Pauli propagation: A computational framework for simulating quantum systems (2025), arXiv:2505.21606.
[41] S. H. Sureshbabu, D. Herman, R. Shaydulin, J. Basso, S. Chakrabarti, Y. Sun, and M. Pistoia, Parameter Setting in Quantum Approximate Optimization of Weighted Problems, Quantum 8, 1231 (2024).
[42] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, L. Kaiser, and I. Polosukhin, Attention is all you need, in Adv. Neural Inf. Process. Syst., Vol. 30 (2017) pp. 5998–6008.
[43] V. P. Dwivedi and X. Bresson, A generalization of transformer networks to graphs (2021), arXiv:2012.09699 [cs.LG].
[44] C. Morris, M. Ritzert, M. Fey, W. L. Hamilton, J. E. Lenssen, G. Rattan, and M. Grohe, Weisfeiler and leman go neural: Higher-order graph neural networks, in Proc. AAAI Conf. Artif. Intell., Vol. 33 (2019) pp. 4602–4609.
[45] J. Gilmer, S. S. Schoenholz, P. F. Riley, O. Vinyals, and G. E. Dahl, Neural message passing for quantum chemistry, in Proc. Int. Conf. Mach. Learn. (2017) pp. 1263–1272.
[46] D. P. Kingma and J. Ba, Adam: A method for stochastic optimization (2017), arXiv:1412.6980 [cs.LG].
[47] J. Wurtz and D. Lykov, Fixed angles QAOA, https://github.com/danlkv/fixed-angle-QAOA (2021), github repository.
[48] S. V. Barron, D. J. Egger, E. Pelofske, A. Bärtschi, S. Eidenbenz, M. Lehmkuehler, and S. Woerner, Provable bounds for noise-free expectation values computed from noisy samples, Nat. Comput. Sci. 4, 865 (2024).
[49] I. Goodfellow, Y. Bengio, and A. Courville, Deep Learning (MIT Press, 2016).
[50] L. Bergen, T. J. O'Donnell, and D. Bahdanau, Systematic generalization with edge transformers, in Adv. Neural Inf. Process. Syst., Vol. 34 (2021) pp. 1265–1277.
[51] J. Ho, A. Jain, and P. Abbeel, Denoising diffusion probabilistic models (2020), arXiv:2006.11239.
[52] D. Lim, J. Robinson, L. Zhao, T. Smidt, S. Sra, H. Maron, and S. Jegelka, Sign and basis invariant net-works for spectral graph representation learning (2022), arXiv:2202.13013 [cs.LG].
[53] D. Kreuzer, D. Beaini, W. L. Hamilton, V. Létourneau, and P. Tossou, Rethinking graph transformers with spectral attention (2021), arXiv:2106.03893 [cs.LG].
[54] C. Ying, T. Cai, S. Luo, S. Zheng, G. Ke, D. He, Y. Shen, and T.-Y. Liu, Do transformers really perform bad for graph representation? (2021), arXiv:2106.05234 [cs.LG].
[55] G. Corso, H. Stark, S. Jegelka, T. Jaakkola, and R. Barzilay, Graph neural networks, Nat. Rev. Methods Primers 4, 17 (2024).
[56] K. Xu, W. Hu, J. Leskovec, and S. Jegelka, How powerful are graph neural networks? (2018), arXiv:1810.00826.
Appendix A: Experimental settings of prior work
Research on ML approaches for setting QAOA angles is difficult to compare, as methods are evaluated using different problem sizes, circuit depths, and dataset sizes. Furthermore, some approaches apply additional classical optimization and performance results can be obtained with simulation or quantum hardware. Table III summarizes these evaluation choices for the methods discussed in Sec. II, grouped according to the introduced taxonomy. Four patterns are relevant to our work.
First, direct angle prediction is largely studied on small graphs containing up to 20 nodes, with fixed-depth experiments reaching at most p = 4, with the exception of QAOA-GPT that uses ADAPT-QAOA. Our models instead are trained on graphs with up to 144 nodes and evaluated on graphs with up to 200 nodes and depths up to p = 5. Prior angle transfer methods evaluate larger target graphs, most notably 100 nodes at p = 3 in Falla et al. [23], but reuse angles obtained from other instances.
Second, some works evaluate ML-predicted angles directly, while others further optimize them. For instance, Meng et al. [17] apply 100 optimization steps after ML prediction, QSeer [16] reports both direct and 100-step refined results, and prior depth-extrapolation approaches similarly use their predictions to initialize further optimization. Such refined results are therefore not directly comparable to direct prediction methods. Our models instead predict the full QAOA angle vector without instance-specific post-prediction optimization.
Third, most prior methods are evaluated using classical quantum-circuit simulation, while hardware evaluation remains uncommon. DARBO [33] reports both simulation and experiments on superconducting quantum hardware, whereas RL-RQAOA [30] computes the required depth-one QAOA quantities classically using analytical expressions. Alongside our simulation-based results, we also evaluate our predictions on IBM superconducting quantum hardware for heavy-hex graphs up to p = 3.
Finally, public code and pretrained models are available only for a subset of methods. Neural QAOA [34] and Xie et al. [26] provide both, while Amosy et al. [13], Falla et al. [23], and Wauters et al. [29] release code only. We release training and inference code together with pretrained model weights.
Appendix B: Dataset generation and validation
This section provides details on the dataset and training-label generation described in Sec. IV A. We analyze QAOA performance and detail the data split design choices for the model training.
1. Distribution of QAOA angles and ARs
Since model quality depends on the quality of the training data we carefully validate that the QAOA angles produce high AR increasing with QAOA depth p for all graph instances. For each graph the solver gives us the optimized angles and the corresponding expected energy, evaluated with Pauli propagation. We convert this energy to a cut value and then to an AR. We plot the distribution of the ARs for the different graph families in Fig. 13 and observe high ARs that increase with p. A few graph instances show an AR > 1 which we attribute to approximation errors in the QAOA energy introduced by Pauli propagation. Furthermore, for each graph instance we compute the difference in AR between p and which we label . All but ten instances have indicating that the QAOA at depth has a smaller Pauli propagation estimated energy than the QAOA at depth p, as expected.
2. Training, validation, and test data split
To construct representative datasets for training and evaluation, we first split the labeled problem instances within each graph family into disjoint training, validation, and test sets and then combine the corresponding subsets across graph families. The training set is used to update the model parameters, while the validation set is evaluated during training and used exclusively for early stopping when the validation loss no longer improves. The test set is held out, with graph instances kept consistent across circuit depth, from both model training and model selection and is used only for the final reported results. Within each graph family, 15% of the instances are first reserved for testing. Of the remaining instances, 90% are assigned to the training set and 10% to the validation set, see Tab. IV for the resulting counts. The splits are constructed to approximately preserve the distributions of graph size and topology-specific parameters, such as degree for random d-regular graphs and edge probability for Erdős–Rényi graphs, see Tab. I.
While we aim to maintain comparable dataset and split sizes across circuit depths, some differences remain. First, the number of Erdős–Rényi instances is reduced at higher depths to limit computational cost during label generation and validation, see Tab. IV. Second, several of
TABLE III. Comparison of ML methods for QAOA angle setting
| Method | Problem | Size | Training | Instances | Post-opt. | Eval. | Release | |
|---|---|---|---|---|---|---|---|---|
| Direct angle prediction | ||||||||
| Amosy et al. [13] | MC (uw) | 16 | 2 (4) | 5k/setup | ER | 0 / ~ 1 iter. | Sim. | Code |
| Deshpande and Melnikov [14] | MC (uw) | 8 (9) | 3 | connected, non-isomorphic | - | Sim. | - | |
| Liang et al. [15] | MC (uw) | 15 | RR | - | Sim. | - | ||
| QSeer [16] | MC (w/uw) | 20 | 3 | non-isomorphic, ER (OOD: RR) | 0 / 100 iter. | Sim. | - | |
| Meng et al. [17] | MC (uw) | 8 (16) | 3 | 10k | random, RR, WS | 100 iter. | Sim. | - |
| QAOA-GPT [18] | MC (w) | 14 | adapt. | ER (OOD: BA, bipartite, RR, WS) | - | Sim. | - | |
| Ours | MC (w/uw) | 144 (200) | 5 | 12k | RR, ER, heavy-hex (OOD: BA, Grid2D) | - | Sim. + HW | Code + model |
| Angle transfer | ||||||||
| Moussa et al. [21] | MC (uw); dense QUBO | 18 | 3 | ER; dense | 0 ( 10 calls) | Sim. | - | |
| GAT-MIS [22] | MIS (uw) | 14 (25)local | 2 | 3k | ER (OOD: SuiteSparse) | - | Sim. | - |
| Falla et al. [23] | MC (uw) | 40 (100)20, | 10 | 30k ()4.5k () | random (OOD: RR, WS) | 0 / 10 iter. | Sim. | Code |
| Depth extrapolation | ||||||||
| Alam et al. [25] | MC (uw) | 8 | 6 | 66 | ER | to tol. | Sim. | - |
| Xie et al. [26] | MC (uw) | 8 | 10 | 66 | ER | 34 – 1.2k calls | Sim. | Code + model |
| Learned optimization | ||||||||
| Khairy et al. [27] | MC (uw) | 8 (22) | 4 | 7 | ER, ladder, barbell, caveman | 0 / 96 calls | Shot sim. | - |
| PG-QAOA [28] | Quantum control | 20 | 60 | Per-instance | Ising chains | Sim. | - | |
| Wauters et al. [29] | TFIM | 8 (128) | 15 | 1/size | uniform / disordered chains | opt. (iter.) | Sim. | Code |
| RL-RQAOA [30] | MC (w) | 200 | 1 | Per-instance | RR, 3-RR, cage | Analytical Partial code | ||
| Chandarana et al. [31] | MC (w/uw)SK | 10 (18) | 2 | 3-RR, complete | iter. | Sim. | - | |
| Chen et al. [32] | MC; SK | 7 (16) | ER, complete | Sim. | - | |||
| DARBO [33] | MC (w)QUBO | 16 (5 HW) | 10 | Per-instance | 3-RR; general QUBO | Sim. + HW | Code | |
| Neural QAOA [34] | MC (w)QUBO; Ising | 10 local | 3 | benchmark graphs | 20 iter. | Sim. | Code + model | |
| SSR-MCTS [35] | MC (uw)MAX-3-SAT | 11 | 10 | Per-instance | 3-RR (MC); – (3-SAT) | opt. (iter.) | Sim. | Code |
| QAOA-Predictor [36] | 12 QUBO classes | 15 (20) | 500 | 92k | ER, BA, complete bipartite | - | Shot sim. | - |
Size. Refers to the largest training graph size, with larger evaluation sizes in parentheses, for per-instance methods, it gives the largest evaluated graph. Local indicates that the method evaluates global graphs through local subproblems.
Training. Counts refer to unique graph/problem instances, excluding repeated depths, angle sets, labels, configurations, and episodes; per-instance denotes no cross-instance training.
Post-opt. – denotes no further optimization after ML angle setting; opt. denotes optional optimization.
Public code/models. Code + model denotes publicly available implementation and pretrained model weights; code denotes a public implementation without pretrained weights; partial code denotes an incomplete training or inference workflow.
Notation. MC: MaxCut; w/uw: weighted/unweighted; HW: Hardware; ER: Erdős–Rényi; RR: random regular; WS: Watts–Strogatz; BA: Barabási–Albert; TFIM: transverse-field Ising model; inferred from the reported setup; : not reported; : not applicable.

FIG. 13. Distribution of AR, and the delta in per-instance Ars between successive circuit depth. (a) and (b) AR and AR for Random d-regular graphs. (c) and (d) AR and AR for Erdős–Rényi graphs. (e) and (f) AR and AR for heavy-hex graphs with uniform edge weights. (g) and (f) AR and AR for heavy-hex graphs with discrete edge weights.
the remaining large and dense Erdős–Rényi and random -regular graphs at higher depths could not be optimized within the available compute budget and were therefore excluded. Third, the ten heavy-hex instances at with a lower energy than at were removed since it indicates an unsuccessful optimization.
Appendix C: Additional results and ablations
This section provides additional analyses that complement the main results. We first examine the distribution of solver-relative performance (Reach) and then study selected modeling choices through targeted ablations.
1. Solver-relative performance distributions
Here, we examine the instance-level Reach distributions and additional lower-tail statistics in more detail. Besides the mean Reach, we report the lower fifth and tenth per- centiles and the minimum Reach for all models, see Tab. V. These quantities characterize the lower-performing part of the instance distribution without relying on a single threshold. E.g., for , the instances on which the GNN performs worst still obtain of the solver accuracy on average. For each training run, the statistics are first computed across test instances and are then averaged across the five random seeds. We additionally report the lowest minimum Reach observed across any of the five runs. For example, for the GNN model on , the instance that performs worst across all five seeds still attains of the solver performance. The lower-tail statistics show the same pattern as the cumulative distributions. However, differences are more visible in the lower end of the distribution. At , for example, the fifth percentile is for the GNN and for the MLP. At , the corresponding values are and . The minimum values show larger instance-specific deviations, while the fifth and tenth percentiles remain substantially closer to the solver. The GNN and GIN provide the strongest overall lower-tail performance at the larger circuit depths.
TABLE IV. Number of instances in the training, validation, and test sets for each graph family and QAOA depth. The union across graph families forms the corresponding multi-topology datasets.
| Depth | Graph family | Train | Validation | Test | Total |
|---|---|---|---|---|---|
| Erdős-Rényi | 4,896 | 544 | 216 | 5,656 | |
| Random Regular | 1,194 | 133 | 227 | 1,554 | |
| Heavy Hex (Uniform) | 1,606 | 179 | 315 | 2,100 | |
| Heavy Hex (Discrete) | 1,606 | 179 | 315 | 2,100 | |
| Erdős-Rényi | 4,896 | 544 | 216 | 5,656 | |
| Random Regular | 1,194 | 133 | 227 | 1,554 | |
| Heavy Hex (Uniform) | 1,606 | 179 | 315 | 2,100 | |
| Heavy Hex (Discrete) | 1,606 | 179 | 315 | 2,100 | |
| Erdős-Rényi | 1,237 | 125 | 216 | 1,578 | |
| Random Regular | 1,194 | 133 | 227 | 1,554 | |
| Heavy Hex (Uniform) | 1,606 | 179 | 315 | 2,100 | |
| Heavy Hex (Discrete) | 1,606 | 179 | 315 | 2,100 | |
| Erdős-Rényi | 1,221 | 125 | 216 | 1,562 | |
| Random Regular | 1,194 | 133 | 227 | 1,554 | |
| Heavy Hex (Uniform) | 1,606 | 179 | 315 | 2,100 | |
| Heavy Hex (Discrete) | 1,606 | 179 | 315 | 2,100 | |
| Erdős-Rényi | 1,137 | 118 | 216 | 1,471 | |
| Random Regular | 1,163 | 131 | 227 | 1,521 | |
| Heavy Hex (Uniform) | 1,602 | 175 | 315 | 2,092 | |
| Heavy Hex (Discrete) | 1,605 | 178 | 315 | 2,098 |
2. Joint versus topology-specific training
Our main models are trained jointly across all graph families. To assess whether joint training reduces predictive performance, we additionally train the GNN and the Graph Transformer models separately on each graph
TABLE V. Distribution of solver-relative Reach on the multi-topology test set. All values are percentages. Mean Reach, the minimum, and the fifth and tenth percentiles are averaged across five independent training runs. The worst minimum is the lowest instance-level Reach observed across the five runs. denotes the fraction of test instances with and is reported as mean standard deviation across seeds.
| p | Model | Mean | Min. | Worst min. | 5th perc. | 10th perc. | |
|---|---|---|---|---|---|---|---|
| 1 | GNN | 99.996 | 99.76 | 99.74 | 99.99 | 99.99 | 99.62 0.05 |
| 1 | GIN | 99.994 | 99.67 | 99.58 | 99.98 | 99.99 | 99.65 0.07 |
| 1 | GraphTF | 99.988 | 99.40 | 99.22 | 99.95 | 99.97 | 98.02 0.27 |
| 1 | GCN | 99.981 | 99.43 | 99.37 | 99.93 | 99.96 | 96.64 0.39 |
| 1 | DiffTF | 99.977 | 99.17 | 99.02 | 99.90 | 99.95 | 95.23 0.32 |
| 1 | EdgeTF | 99.974 | 99.20 | 99.13 | 99.91 | 99.94 | 95.55 0.45 |
| 1 | MLP | 99.973 | 99.17 | 99.12 | 99.90 | 99.94 | 94.70 0.31 |
| 2 | GNN | 99.983 | 98.41 | 98.38 | 99.90 | 99.95 | 95.09 0.19 |
| 2 | GIN | 99.976 | 98.31 | 98.20 | 99.89 | 99.93 | 93.99 0.30 |
| 2 | GraphTF | 99.949 | 98.29 | 98.17 | 99.79 | 99.87 | 85.78 1.07 |
| 2 | GCN | 99.932 | 98.47 | 97.93 | 99.74 | 99.83 | 80.12 1.19 |
| 2 | DiffTF | 99.928 | 98.12 | 98.06 | 99.69 | 99.80 | 78.51 0.54 |
| 2 | EdgeTF | 99.929 | 98.07 | 97.99 | 99.70 | 99.80 | 79.23 0.23 |
| 2 | MLP | 99.914 | 97.89 | 97.76 | 99.66 | 99.78 | 75.96 1.06 |
| 3 | GNN | 99.946 | 94.54 | 94.06 | 99.80 | 99.88 | 86.64 0.88 |
| 3 | GIN | 99.930 | 94.32 | 93.41 | 99.74 | 99.83 | 81.40 1.72 |
| 3 | GraphTF | 99.830 | 94.25 | 93.91 | 99.34 | 99.62 | 62.21 4.72 |
| 3 | GCN | 99.769 | 89.07 | 87.53 | 99.31 | 99.60 | 58.20 1.91 |
| 3 | DiffTF | 99.820 | 94.59 | 94.31 | 99.35 | 99.58 | 57.50 0.52 |
| 3 | EdgeTF | 99.814 | 94.46 | 94.35 | 99.35 | 99.59 | 57.39 1.92 |
| 3 | MLP | 99.759 | 93.88 | 92.54 | 99.13 | 99.47 | 51.02 6.81 |
| 4 | GNN | 99.934 | 97.28 | 96.55 | 99.76 | 99.86 | 84.39 0.81 |
| 4 | GIN | 99.921 | 97.65 | 96.12 | 99.70 | 99.82 | 79.38 0.95 |
| 4 | GraphTF | 99.803 | 92.11 | 88.30 | 99.32 | 99.64 | 64.06 2.36 |
| 4 | GCN | 99.742 | 87.58 | 82.80 | 99.26 | 99.61 | 60.62 1.59 |
| 4 | DiffTF | 99.834 | 93.63 | 93.40 | 99.43 | 99.64 | 60.67 0.98 |
| 4 | EdgeTF | 99.837 | 93.38 | 93.17 | 99.41 | 99.63 | 62.37 0.59 |
| 4 | MLP | 99.727 | 92.04 | 88.77 | 99.01 | 99.46 | 51.48 6.54 |
| 5 | GNN | 99.692 | 88.79 | 86.35 | 98.91 | 99.31 | 52.02 0.01 |
| 5 | GIN | 99.544 | 88.14 | 69.04 | 97.95 | 99.05 | 49.43 0.01 |
| 5 | GraphTF | 98.461 | 77.31 | 50.43 | 93.94 | 95.37 | 37.35 0.03 |
| 5 | GCN | 93.025 | 54.39 | 47.84 | 66.57 | 71.10 | 33.14 0.12 |
| 5 | DiffTF | 98.073 | 78.86 | 76.35 | 91.91 | 93.55 | 39.90 0.03 |
| 5 | EdgeTF | 99.260 | 87.22 | 87.16 | 97.20 | 97.96 | 35.47 0.01 |
| 5 | MLP | 99.606 | 89.68 | 87.45 | 98.45 | 99.25 | 44.28 0.01 |
family. Overall, joint training closely matches topology-specific training. The differences in AR are small across graph families and both architectures, see Fig. 14 for and . At , all differences are below . At , the largest difference is about and occurs for the Graph Transformer on random -regular graphs, where joint training performs better. These results show that a single model can be trained across multiple graph families without a consistent loss compared to a topology-specific training.
3. Influence of global graph features
The MLP predicts QAOA angles only from global graph statistics and nevertheless achieves a strong mean performance. To understand this result, we ablate the input features at . Using only the number of nodes reduces the AR, see Fig. 15. However, the mean degree alone recovers most of the performance of the full MLP. Adding graph size or degree variation provides a small further improvement. Additional structural statistics do not improve over the simpler degree-based feature sets. This indicates that degree information explains a large part of the predictive signal available to the global-feature MLP.

FIG. 14. Difference in approximation ratio between models trained jointly across all graph families and topology-specific models at p = 1 and p = 3. Results are shown for the GNN and Graph Transformer across the four training graph families. Positive values indicate higher approximation ratio for joint training. Error bars show variation across the five independent training runs.

---- optimizer (0.8778) ---- full GNN (0.8773) ---- full MLP, 5 global feats (0.8757)
FIG. 15. MLP input-feature ablation at p = 3 on the multi-topology test set. Bars show the mean approximation ratio for models trained with different subsets of global graph features. Dashed lines indicate the approximation ratios of the solver, the full GNN, and the full MLP.
Appendix D: Distribution-shift experiments
As discussed in the main text, we evaluate generalization beyond the training distribution in both graph size and topology. Here, we provide additional details on these graph instances and the classically optimized QAOA angles used as reference solutions. In addition, we further discuss the implications of our findings in the out-of-distribution experiments.
1. Large-scale graphs
To assess extrapolation to unseen graph sizes, we evaluate the learned models on graphs with 150 and 200 nodes. These instances lie beyond the graph sizes in the training set. The distributions of the angles of the in-distribution Erdős–Rényi graphs used for training in the main paper differ significantly from the distributions of the angles of the out-of-distribution Erdős–Rényi graphs used in this experiment, see Fig. 16. In addition, we notice different graph characteristics between the in-distribution Erdős–Rényi graphs and the larger-scale, out-of-distribution Erdős–Rényi graphs as the graph-level statistics differ. This causes a distribution shift in the input to the deep learning models. Therefore, we expect that the inferred angles of the deep learning models may have a sub-optimal performance. We confirm this hypothesis in the main text, where we report a decline in the AR. This finding leaves room for two research directions. (i) Continuously train models on larger graph instances at the cost of generating more training data. (ii) Decompose larger graphs into sub-graphs which fit the current models and re-compose for a final set of angles. We expect that this re-composition processes could also benefit from deep learning.
2. Unseen graph topologies
In the main text, we evaluate how our models generalize to weighted Barabási–Albert and 2D grid graphs. Neither appear in the training set. The distributions of the solver optimized QAOA angles and for Barabási–Albert and 2D grid instances are concentrated within and are unimodal, with no secondary clusters or -shifts (data not shown). The angles follow a smooth schedule across the QAOA layers. This resembles the monotone parameter schedules reported for QAOA and their connection to adiabatic evolution and is a consequence of the Interp. training [24]. The approximation ratio distributions shift to higher values as increases from 1 to 4, see Fig. 17(a) and (c). The gains in AR, i.e., , are non-negative for all evaluated instances, see Fig. 17(b) and (d). Therefore, increasing never reduces the AR, as expected. Overall, the strong unimodal concentration of angles in benefits models during extrapolation as even when input distributions change, the targets are aligned with the distribution of the training targets.
Appendix E: Model architecture details
This section provides additional implementation details for the seven model architectures introduced in Sec. IV C. Following the organization in the main text, we consider a non-structural MLP baseline and six graph-based models grouped into three classes: edge-token transformers (EdgeTF and DiffTF), node-based graph encoders (GraphTF and GCN), and message-passing graph networks (GNN and GIN). The models differ primarily in how they represent and process the graph structure and edge weights before mapping the resulting graph representation to the QAOA angles. Let be a graph with nodes and edges , and let denote the QAOA circuit depth. For each depth, a separate model is trained to predict the variational parame-
TABLE VI. Performance metrics (approximation ratio and reach, %, median (IQR)) averaged over 5 independent runs across 4 quantum circuit depths () and 7 model architectures.
| Depth | Architecture | Barabasi-Albert | 2D Grids | ||
|---|---|---|---|---|---|
| AR | Reach | AR | Reach | ||
| 1 | GNN | 70.96 (3.74) | 99.56 (1.30) | 74.54 (1.00) | 99.97 (0.03) |
| GIN | 71.21 (3.07) | 99.63 (0.42) | 74.45 (1.02) | 99.85 (0.10) | |
| GCN | 71.23 (2.94) | 99.68 (0.55) | 74.50 (1.02) | 99.91 (0.06) | |
| DiffTF | 71.08 (3.06) | 99.42 (0.56) | 73.88 (1.17) | 99.05 (0.52) | |
| EdgeTF | 71.24 (2.83) | 99.62 (0.36) | 74.50 (1.01) | 99.93 (0.05) | |
| GraphTF | 71.26 (2.80) | 99.61 (0.45) | 74.38 (1.02) | 99.77 (0.08) | |
| MLP | 71.37 (2.81) | 99.78 (0.27) | 74.53 (0.99) | 99.96 (0.03) | |
| Fixed Angle | 66.17 (3.43) | 92.50 (2.61) | 66.96 (0.51) | 90.01 (0.97) | |
| Solver | 71.59 (-) | - | 74.57 (-) | - | |
| 2 | GNN | 67.12 (24.05) | 83.96 (29.37) | 83.36 (1.35) | 99.61 (0.13) |
| GIN | 78.24 (3.31) | 98.51 (2.01) | 83.11 (1.35) | 99.38 (0.28) | |
| GCN | 79.37 (2.41) | 99.57 (0.72) | 82.80 (1.31) | 99.00 (0.53) | |
| DiffTF | 77.31 (3.14) | 96.92 (2.07) | 80.74 (1.66) | 96.41 (0.94) | |
| EdgeTF | 79.05 (2.57) | 99.16 (0.97) | 83.18 (1.31) | 99.40 (0.23) | |
| GraphTF | 78.75 (2.79) | 98.77 (1.50) | 82.85 (1.35) | 99.12 (0.26) | |
| MLP | 79.25 (2.56) | 99.45 (0.78) | 83.24 (1.30) | 99.49 (0.11) | |
| Fixed Angle | 69.17 (3.36) | 86.32 (3.00) | 71.24 (0.73) | 85.23 (1.03) | |
| Solver | 79.86 (-) | - | 83.72 (-) | - | |
| 3 | GNN | 69.07 (24.44) | 81.83 (28.95) | 87.07 (1.63) | 99.48 (0.71) |
| GIN | 80.63 (4.42) | 95.65 (3.61) | 86.89 (1.31) | 99.03 (0.45) | |
| GCN | 81.43 (3.59) | 96.43 (3.07) | 84.54 (2.17) | 96.35 (2.12) | |
| DiffTF | 81.35 (3.14) | 96.05 (2.17) | 83.59 (2.03) | 95.33 (1.52) | |
| EdgeTF | 82.83 (2.52) | 97.81 (1.50) | 85.71 (1.65) | 97.73 (0.93) | |
| GraphTF | 82.76 (2.63) | 97.76 (1.70) | 86.01 (1.74) | 98.24 (1.03) | |
| MLP | 83.51 (2.57) | 98.56 (1.29) | 84.41 (1.94) | 96.12 (1.39) | |
| Fixed Angle | 69.01 (4.11) | 82.01 (4.21) | 72.83 (0.98) | 82.88 (1.03) | |
| Solver | 84.49 (-) | - | 87.75 (-) | - | |
| 4 | GNN | 67.81 (31.30) | 77.72 (36.32) | 88.90 (1.69) | 98.98 (0.93) |
| GIN | 82.88 (4.32) | 94.97 (4.19) | 88.23 (1.42) | 98.23 (0.60) | |
| GCN | 84.77 (3.33) | 96.96 (2.40) | 87.07 (2.01) | 97.18 (1.50) | |
| DiffTF | 82.59 (3.71) | 94.28 (3.07) | 85.46 (2.08) | 94.94 (1.52) | |
| EdgeTF | 85.52 (2.81) | 97.44 (1.70) | 86.91 (1.82) | 96.72 (1.21) | |
| GraphTF | 85.52 (2.74) | 97.77 (1.90) | 88.10 (1.58) | 97.99 (0.67) | |
| MLP | 86.20 (2.73) | 98.37 (1.35) | 84.82 (1.90) | 94.35 (1.38) | |
| Fixed Angle | 67.98 (4.00) | 78.03 (3.87) | 71.85 (1.01) | 79.75 (1.16) | |
| Solver | 87.36 (-) | - | 89.99 (-) | - | |
ters that minimize the QAOA expected energy on the Max-Cut cost Hamiltonian.
1. Multilayer Perceptron
As a non-structural baseline, we use a Multilayer Perceptron (MLP), a standard feedforward neural network composed of fully connected layers [49], that operates exclusively on the global graph-level features. The model consists of four hidden layers, each comprising a linear transformation followed by a ReLU activation and dropout regularization. Layer normalization is applied after the final hidden layer, followed by a linear projection to the QAOA angles. Since the MLP does not use the graph structure or edge weights, it provides a reference for how well the angles can be predicted from coarse global graph properties alone.
Let denote the input feature vector. For each hidden layer , the intermediate representation is computed as:
where and denote the weight matrix and bias vector, respectively, and denotes the ReLU activation function. Layer normalization is applied after the final hidden layer, followed by a linear output

num edges
node degree
FIG. 16. Distribution of graph properties and optimized QAOA angles at depth for the training set ( , blue) and the larger-graph extrapolation set ( , purple). Shown are the number of edges, node-degree distribution, and the optimized angles ( ). Histograms are normalized separately to show the fraction of instances in each set.
projection,
where denotes the predicted QAOA angles.
2. Edge-token transformer models
Edge-token transformer models represent each graph edge as a separate token and process all edge tokens jointly using self-attention. Each edge token encodes information about its two endpoint nodes and the corresponding edge weight. A global token constructed from graph-level

Approximation ratio (AR)
(c)
(d)
Approximation ratio (AR)
AR
FIG. 17. MAXCUT performance and depth-wise scaling on weighted Barabási–Albert and 2D grid graphs. Panels (a) and (c) are histograms of approximation ratios for circuit depths (teal), (blue), (magenta), and (coral). Panels (b) and (d) are empirical distributions of consecutive layer gains .
features is processed together with the edge tokens and provides the graph-level representation used to predict the QAOA angles. We consider two models in this category: the Edge Transformer (EdgeTF) and the diffusion-based Edge Transformer (DiffTF). DiffTF extends EdgeTF by introducing diffusion-inspired noise conditioning during training.
a. Edge transformer
The edge-token transformer (EdgeTF) uses a standard Transformer encoder [42] to process the edge and global tokens. This enables interactions between all graph edges through self-attention, rather than restricting information exchange to local neighborhood updates. In addition to the edge tokens, a global token is constructed from the global graph features and processed jointly with the edges.
The graph-level feature vector , containing the number of nodes , number of edges , mean degree , and degree standard deviation , is projected into the Transformer embedding space using a single linear layer to produce a global token .
For each edge , the two endpoint node indices are independently encoded using sinusoidal positional encodings [42], producing vectors . To obtain an endpoint-order-invariant edge representation, the mean and absolute difference of the two endpoint encodings are concatenated with the scalar edge weight ,
(E3) which is then linearly projected to , yielding one edge token per edge. The global token and all edge tokens are concatenated into a sequence of length and passed through an -layer Transformer encoder with attention heads and feedforward width , where multi-head self-attention allows every token to attend to every other token simultaneously, capturing pairwise and higher-order structural dependencies across the full edge set. After the final Transformer layer, the updated global token , enriched through attention over the edge tokens, is used as the graph-level representation and decoded by a final linear layer to predict the QAOA angles,
Since the endpoint encodings depend on the node indices, we randomly relabel the nodes during training before constructing the edge tokens. This prevents the model from learning fixed node identities and encourages predictions that are insensitive to the arbitrary labeling of the graph. We use sinusoidal rather than learned node-index embeddings, which also allows the same encoding to be applied to graphs with more nodes than those encountered during training.
Our edge-token representation is conceptually related to the Edge Transformer of Bergen et al. [50], which represents relations between node pairs directly rather than relying only on node representations. In contrast to their architecture, which maintains representations for all node pairs and uses triangular attention, our EdgeTF represents only the observed graph edges and processes them using standard self-attention.
b. Diffusion-based edge-token transformer
The diffusion-based edge-token transformer (DiffTF) extends EdgeTF by introducing diffusion-inspired noise conditioning during training, based on the forward diffusion process of Denoising Diffusion Probabilistic Models (DDPMs) [51]. In DDPM, data are gradually corrupted with Gaussian noise according to a predefined noise schedule and the model is trained to learn the reverse denoising process through variational inference. In our implementation, we use the forward noising process as a stochastic regularizer, while retaining the deterministic regression setting of EdgeTF.
We apply a linear noise schedule that interpolates from to over timesteps. The cumulative signal-retention coefficients are defined as , and the forward diffusion process corrupts the input according to
where, during training, a timestep is sampled and the resulting noised input is used. At inference, the model acts as a deterministic regressor on the clean input . Thus, in contrast to a generative DDPM, no iterative reverse-diffusion chain is performed.
Given a graph , the noised features are first projected into a latent space of dimension via a linear transformation, yielding . A sinusoidal timestep embedding [42] is processed by a two-layer SiLU MLP and added to the projected features to provide information about the noise level. The conditioned representation is then passed to the same edge-token Transformer backbone as EdgeTF.
As described above for EdgeTF, an edge token is constructed for every edge from sinusoidal encodings of the endpoint indices, their mean and absolute difference, and the corresponding edge weight . A global token represents the conditioned graph-level features. The global token and edge tokens are then concatenated into a sequence and processed by an L-layer, H-head Transformer encoder. The output corresponding to the global token is taken as the graph-level representation. Finally, the graph representation is passed through layer normalization, dropout, and a linear output layer to predict the QAOA angles .
As for EdgeTF, node indices are randomly relabeled during training before constructing the edge tokens. Sinusoidal rather than learned node-index embeddings are used, allowing the same encoding to be evaluated for node indices beyond those encountered during training.
3. Node-based graph encoders
Unlike the edge-token models, node-based graph encoders represent the graph through node features that are updated using the graph connectivity and edge weights. The resulting node representations are pooled into a graph-level representation and combined with global graph features to predict the QAOA angles. We consider two models in this category: the Graph Transformer (GraphTF) and the Graph Convolutional Network (GCN).
a. Graph Transformer
The Graph Transformer (GraphTF) processes the node representations using multi-head self-attention, with attention restricted to neighboring nodes according to the graph connectivity. Edge weights are incorporated through an additional learned bias in the attention scores.
In our implementation, the nodes are initialised with two scalar features: the log-transformed node degree and signed-log-transformed weighted-degree. These are linearly projected to higher dimensional space to obtain the initial node embeddings,
(E6) where is the learned projection matrix and is the two-dimensional feature vector of node . Laplacian positional encodings are computed using the symmetric normalised Laplacian [43],
where A is the binary adjacency matrix and D the corresponding degree matrix. The eigenvectors corresponding to the smallest nontrivial eigenvalues are used as positional encodings. To address the inherent sign ambiguity of the Laplacian eigenvectors, each eigenvector is multiplied by a random sign (+1 or -1) with equal probability [52, 53] during training. The positional encodings are then linearly projected and added to the initial node embeddings,
The resulting node embeddings are passed through Transformer layers with edge-masked multi-head self-attention. For attention head h, the scaled dot-product attention score is
Attention scores for non-neighboring nodes are set to . This effectively reduces to an attention weight of zero, which ultimately restricts attention to only node neighbors [43]. If edge weights are available, a per-attention-head additive bias is produced and added to the attention scores:
where is the attention score between node i and node j for attention head h specifically. is compression of edge weight ij which is passed on to a small learned MLP to produce one scalar bias per attention head [54]. After the final layer, the node representations are mean-pooled into a graph-level vector, concatenated with the projected global graph features, and passed through an MLP to predict the QAOA angles.
b. Graph Convolutional Network
As a standard node-based graph architecture, we include a graph convolutional network based on the GraphConv operator [44]. The model represents each node by a feature vector and iteratively updates this representation using information from directly connected nodes. For our weighted graphs, the contribution from each neighboring node is scaled by the corresponding edge weight. Formally, for a graph with N nodes, feature matrix , and edge weights , the layer-wise update for node i is given by
where denotes the representation of node at layer , with , and and are trainable layer-specific weight matrices. Each layer therefore combines the current representation of a node with a weighted sum of the representations of its immediate neighbors. We group this model with the node-based graph encoders, since each layer updates the node representations through a direct weighted aggregation over neighboring nodes. The message-passing graph networks introduced below differ in that the information passed along each edge is itself learned before aggregation.
For our implementation, the initial node features are given by the one-dimensional node degree vector, z-score normalized within each graph. The network consists of two such GraphConv layers, each followed by a ReLU activation and dropout regularisation. A global mean-pooling readout then aggregates the node embeddings into a single, fixed-size graph representation. This graph representation is concatenated with global graph-level features before being passed to a two-layer prediction head that outputs the 2p QAOA angles.
4. Message-passing graph networks
Message-passing graph networks update node representations by exchanging and aggregating information along graph edges [45, 55]. In our implementations, this involves three steps: message computation, neighborhood aggregation, and node-state updates. We consider two models in this class: a Graph Neural Network (GNN) and a Graph Isomorphism Network (GIN).
a. Graph Neural Network
Graph Neural Networks (GNNs) extend deep learning to graph-structured data by iteratively refining node representations. By combining structural connectivity with feature attributes, they learn representations at the node, edge, and graph levels. Under the Message-Passing Neural Network (MPNN) framework [45], a GNN updates node states across L layers through local neighborhood aggregation. At layer , the update for node is governed by three functions:
(E14) where is the set of 1-hop neighbors of node . Here is the receiving node and ranges over its neighbors.
The output layer depends on the task. A node-level task projects the final node embeddings directly. An edge-level task combines pairs of node embeddings. A graph-level task applies a permutation-invariant pooling operation over all nodes V.
Let be the number of nodes and the initial node feature matrix. We construct by projecting global graph-level statistics into the node embedding space. Every node receives the same context vector.
In each message-passing layer, we scale the neighbor's embedding element-wise by the edge weight, concatenate it with the receiver's embedding, and pass the result through the message MLP. Equation (E12) thus becomes
where is the edge-weighted neighbor embedding.
Conditioning the message on the receiver embedding is a deliberate design choice. The message depends on what the receiver already knows, which gives a form of attention-like selectivity without an explicit attention mechanism. Edges arriving at different nodes can therefore produce different messages. The message MLP is a two-layer network with a ReLU in between.
Nodes then sum the incoming messages, so Equation (E13) becomes
This is a plain sum with no degree normalization. High-degree nodes accumulate larger aggregates. This makes the representation sensitive to local connectivity density, which is relevant for QAOA because high-degree nodes appear in more terms of the cost Hamiltonian.
Finally, each node is updated by concatenating its current embedding with the aggregated neighborhood signal and passing both through an MLP. Equation (E14) becomes
Like the message MLP, the update MLP is a two-layer network with a ReLU after the first layer.
Among our message-passing models, the GNN is the only one whose message function uses both endpoints of an edge. The network stacks L such message-passing layers. A global mean-pooling readout then aggregates the node embeddings into a fixed-size graph representation. This representation is concatenated with the raw graph-level features and passed to a prediction head with dropout, which outputs the QAOA parameters.
b. Graph Isomorphism Network
The GIN was proposed by Xu et al. [56] to address the non-injective aggregation and pooling of standard GCNs. The authors show that any message-passing GNN is at most as expressive as the 1-dimensional Weisfeiler-Leman (1-WL) graph isomorphism test. They design the GIN to reach this bound by making both its update and its readout injective. Unlike GCN or GraphSAGE, which aggregate neighbors with mean or max pooling, the GIN uses sum aggregation, which the authors prove is a universal, injective function over multisets. At layer , node u is updated as
where is a parameterized MLP, is a fixed or learnable self-loop scaling parameter, and the sum aggregates the neighborhood. For an injective graph-level readout, the authors further propose concatenating the summed node representations from every layer,
so that structurally distinct graphs cannot map to identical embeddings.
The equations above state the conditions that make a GIN as powerful as the 1-WL test. Our implementation follows this design but adapts it in two practical ways, described below.
First, we condition messages on edge weights. Before summation, each neighbor embedding is scaled by its scalar edge weight, so the aggregation becomes . We refer to these as edge-conditioned GIN layers.
Second, we use a single global pooling step rather than the layer-wise concatenated readout above. By default we pool node embeddings with a mean operation. The sum-based, injective readout is therefore available but not the default configuration in our experiments.
The GIN regressor takes as input a graph representing a QAOA instance, together with a graph-level feature vector of global statistics. These statistics are the number of nodes , the number of edges , the edge-to-node ratio , the mean degree , and the degree standard deviation . Since nodes carry no explicit attributes, is first projected through a two-layer ReLU MLP into a global embedding . This embedding is broadcast to all nodes and optionally concatenated with pre-computed per-node structural features, such as the degree z-score. A second two-layer ReLU MLP then fuses these into a uniform initial node embedding for every .
The embeddings are refined through L stacked edge-conditioned GIN layers. Each layer applies a residual connection followed by Layer Normalization, which together prevent representational collapse at depth. After the final layer, a pre-pooling projection MLP is applied and the node embeddings are pooled into a graph-level vector . Finally, is concatenated with to form , which a three-layer output MLP with dropout decodes into the predicted QAOA parameters .