Neural Minimum Weight Perfect Matching
- NMWPM is a hybrid quantum error correction decoder that leverages neural networks to predict syndrome-dependent edge weights for the classical MWPM algorithm.
- It integrates a Graph Neural Network and Transformer encoder to capture both local and global features of the syndrome graph, producing dynamic weights for matching.
- NMWPM achieves improved logical error rates on toric and rotated surface codes under different noise models while maintaining near distance-independent parameter efficiency.
Neural Minimum Weight Perfect Matching (NMWPM) is a data-driven hybrid decoding framework designed to improve quantum error correction (QEC) performance by integrating learned syndrome-dependent edge weights with the classical Minimum Weight Perfect Matching (MWPM) algorithm. The method combines a Graph Neural Network (GNN) and a Transformer encoder to predict the probability that each edge in a syndrome graph should be included in the correction, translating these probabilities into edge weights for MWPM. NMWPM maintains the provable correctness of MWPM while leveraging machine learning to enhance logical error rate (LER) performance across quantum code families, particularly toric and rotated surface codes under independent and depolarizing noise models (Peled et al., 1 Jan 2026).
1. Architectural Design and Inference Pipeline
NMWPM retains the MWPM algorithm for final decoding but introduces the Quantum Weight Predictor (QWP), a neural component tasked with producing syndrome-dependent edge weights. The architecture consists of:
- GNN Backbone (TransformerConv): Encodes local spatial and topological syndrome features through multiple stacked graph attention layers on the defect syndrome graph.
- Transformer Encoder: Captures long-range and global dependencies between candidate error chains (edges) across the entire lattice.
- Nonlinear Weight Mapping: The QWP outputs edge-inclusion probabilities for each directed edge; the final MWPM edge weights are constructed as , with for the undirected edge.
During inference, the following sequence is performed:
- Construct the defect graph from the raw syndrome , including feature-rich representations for nodes and edges.
- Run QWP on the syndrome to output for every edge.
- Aggregate probabilities and convert them to MWPM weights via the negative log transform.
- Execute the classical MWPM algorithm on using these dynamic weights to produce the correction.
2. Feature Engineering and Representation
The method distinguishes between local feature encoding (via the GNN) and global reasoning (via the Transformer):
- Node Features: For each stabilizer , the input consists of two-dimensional coordinates , a stabilizer type indicator (X vs Z), distance to the lattice center , a sinusoidal positional encoding , and a learned embedding . Inactive stabilizers retain only their positional encoding. All features are projected through small MLPs into a hidden dimension .
- Edge Features: For an ordered pair , features include Manhattan distance , displacements , and an error-type flag . The scalar is embedded and concatenated to the result of an MLP applied to the remaining features.
- Local Aggregation: -layer GNN (TransformerConv) with multi-head attention, residual updates, and feedforward MLPs using GELU activation, producing refined node embeddings .
- Global Edge Reasoning: Form vectors for each edge and input the sequence to a -layer Transformer encoder, enabling the model to assess global edge competition before producing output probabilities via a final sigmoid projection.
3. Integration with Minimum Weight Perfect Matching
Classically, MWPM seeks a perfect matching of with nonnegative weights that minimizes total weight:
In NMWPM, the weights are determined dynamically:
Higher output probability yields a lower weight, biasing MWPM toward selecting the corresponding edge. This scheme allows MWPM to remain the underlying decoding routine, while adjusting its input weights flexibly based on the observed syndrome.
4. Differentiable Proxy Loss and Training Strategy
Because the MWPM (Blossom) algorithm is non-differentiable, the training objective is recast as a proxy binary edge classification task. Let denote the predicted edge inclusion probability for the th directed edge, with as the ground-truth indicator. Given directed edges, the loss is:
- Binary Cross-Entropy:
- Entropy Regularization:
- Full Loss: , with
This composite objective encourages peaked confidence in edge predictions, yielding probability distributions that are strongly bimodal. Such peaky distributions, in turn, foster clear separations in MWPM weights, resulting in improved matching accuracy.
5. Training Data Generation and Optimization Procedure
Ground-truth labels for supervised training are created via the following process:
- Error Simulation: Simulate random physical errors under independent or depolarizing noise models.
- Clustering and Extraction: Group qubits by shared stabilizers and extract the syndrome endpoints.
- Local Matching: Apply local MWPM per cluster based on lattice distance to propose a matching .
- Correction Validation: If leads to a logical error, permutation or brute-force search is used to yield a valid matching.
Training data is sampled across code sizes and physical error rates , generating approximately – examples per epoch. Optimization employs Adam with batch size 32, an initial learning rate of decayed to via cosine annealing. Each epoch consists of 500 mini-batches, with total training running for 200–1000 epochs depending on code size. Hardware utilized for experiments includes an NVIDIA L40 GPU with 48 GB of memory. Major hyperparameter settings are:
- (GNN), attention heads
- (Transformer)
- (entropy regularization)
6. Benchmark Performance and Parameter Efficiency
Quantitative comparison was conducted against classical MWPM (distance-based), BPOSD-2, and QECCT (state-of-the-art Transformer decoder):
| Code & Noise Model | Threshold (NMWPM) | Threshold (competing methods) |
|---|---|---|
| Toric, independent | MWPM: , BPOSD-2: , QECCT: , ML bound: | |
| Toric, depolarizing | MWPM/BPOSD-2: , QECCT: , ML bound: |
For toric codes of size under depolarizing noise, at NMWPM reduces the logical error rate by $17$– relative to traditional MWPM and exceeds the performance of QECCT at . On rotated surface codes (depolarizing noise), NMWPM outperforms MWPM and matches or slightly surpasses QECCT at larger code distances.
NMWPM exhibits a nearly distance-independent parameter count of approximately $3.9$ million, compared to QECCT’s $6.71$ million at .
7. Component Insights, Scalability, and Future Prospects
Although no full ablation table is provided, analysis indicates that entropy regularization drives edge probabilities to a highly bimodal distribution, directly aiding MWPM by separating candidate edges for selection. Complexity analysis reveals that the GNN scales as and the Transformer as , which may constrain practical scalability for large code distances without further innovations such as sparsification or approximate attention (e.g., BigBird).
The ground-truth generation process involves heuristic assignment and brute-force correction steps; refinement or replacement with exact methods could alleviate potential label noise. Current experiments focus on toric and rotated surface codes under independent and depolarizing channels; extension to correlated noise or QLDPC codes is a prospective direction. In hardware-constrained regimes, efficiency optimizations (e.g., network pruning or quantization) and rapid on-the-fly adaptation are promising avenues for practical deployment.
NMWPM exemplifies the integration of algorithmic and data-driven approaches in QEC decoding—combining the reliability of MWPM with syndrome-adaptive, learned edge weighting to achieve enhanced logical error rates and noise thresholds across multiple code families and error models (Peled et al., 1 Jan 2026).