Manuscript Offprint
arXiv:2610.38479Recurrent Bipartite Graph Neural Networks for QC-MDPC Error Decoding in McEliece Cryptosystems
Abstract
As the advent of large-scale quantum computing threatens classical encryption, Quasi-Cyclic Moderate Density Parity-Check (QC-MDPC) codes have emerged as a foundational element of Post-Quantum Cryptography (PQC). However, decoding these relatively dense codes using classical Belief Propagation algorithms often leads to failures caused by short graph cycles that stall the decoder. In cryptographic applications, these failures are severe security vulnerabilities that leak secret key information. To address this, this paper proposes a Recurrent Bipartite Graph Neural Network (R-BGNN) as proof of concept. By integrating Gated Recurrent Units (GRUs) into the message-passing framework and employing a multi-topology curriculum training strategy, the R-BGNN actively learns to break limit-cycle oscillations. Evaluated across 20 unseen matrix topologies, the proposed architecture significantly outperforms classical Bit-Flipping and Min-Sum baselines, reducing the Decoding Failure Rate (DFR) by 63.7% at moderate noise levels () while converging in fewer iterations.
Keywords: Post-Quantum Cryptography, QC-MDPC Codes, Graph Neural Networks, Belief Propagation, Gated Recurrent Units, Decoding Failure Rate, McEliece Cryptosystem
1 Introduction
Public key encryption (PKE) was a breakthrough in the field of modern cryptography, majorly relying on hard mathematical problems such as prime factorization and discrete logarithms. However, algorithms designed for large-scale quantum computers possess the potential to solve these mathematical defenses in polynomial time, rendering current encryption protocols at threat [1]. This anticipated future vulnerability, termed ‘Quantum D-Day’, will render modern public-key standards such as RSA and Elliptic Curve Cryptography (ECC) completely insecure, compelling an urgent global transition toward Post-Quantum Cryptography (PQC).
In response, lattice-based, hash-based and code-based cryptography have emerged as highly promising fields within PQC [2]. Among these, the McEliece public-key cryptosystem stands out as one of the most thoroughly cryptanalyzed candidates [3]. However, traditional McEliece variants utilizing Goppa codes faced significant deployment barriers due to their requirement for very large public keys. To overcome this limitation, [4] introduced the Quasi-Cyclic Moderate Density Parity-Check (QC-MDPC) McEliece variant, which relies on MDPC codes to provide highly compact keys. By adopting a quasi-cyclic (QC) structure, each circulant block of the parity-check matrix can be compactly represented by its first row, significantly reducing memory overhead and positioning QC-MDPC codes as a primary foundation for National Institute of Standards and Technology (NIST) PQC finalists like the Bit-Flipping Key Encapsulation (BIKE) cryptosystem [5].
1.2 Classical BP Decoding & Its Failure Points
To decipher encrypted messages, QC-MDPC systems utilize iterative decoding algorithms such as Belief Propagation (BP) or Bit-Flipping [9, 10]. In standard implementations, exact BP requires heavy computational complexity due to the use of hyperbolic tangent functions [10]. To reduce this, the Min-Sum algorithm simplifies node updates into basic sign-multiplication and minimum-value comparisons [11]. However, this simplification comes at a severe cost: classical Min-Sum relies on over-approximations that drastically overestimate Log-Likelihood Ratio (LLR) magnitudes, degrading the error-correction capability of the decoder [10, 11]. Because short, dense codes are plagued by harmful short cycles, the fundamental assumption of BP, that incoming messages are statistically independent, is violated [12]. These short cycles give rise to dense “trapping sets” that artificially correlate messages and degrade LLR updates across iterative decoding rounds [12].
Classical attempts to resolve this have proven computationally burdensome. For instance, [13] proposed Multiple-Bases Belief-Propagation (MBBP), which attempts to decode high-rate algebraic block codes which are error-correcting codes that divide data into fixed-length blocks of bits and add redundant parity bits to detect and correct errors, by running multiple BP decoders in parallel over structurally diverse parity-check matrix permutations; however, this approach linearly multiplies hardware complexity. More recently, [14] proposed modifying the Tanner graph itself by constructing Low-Weight Parity-Check (LWPC) matrices and inserting auxiliary variable nodes (AVNs) alongside redundant check nodes to physically break 4-cycles. While effective at cycle elimination, introducing AVNs, which lack direct soft channel observations, can weaken cycle connectivity and unacceptably expand graph dimensions, thereby throttling expected performance gains [12].
Consequently, iterative decoding on QC-MDPC graphs exhibits an alarming “error floor” behavior where Decoding Failure Rates (DFR) stall at unacceptable levels as block length increases [15]. In cryptographic applications, this decoder failure is not merely a reliability issue, but a severe security flaw. [16] introduced the reaction attack mechanics, which was later designated as the “GJS Attack” in subsequent literature [5, 15], wherein an adversary systematically injects specific error patterns and observes whether the target’s decoder fails or succeeds. Because decoding failures correlate strongly with the distance between non-zero entries in the secret parity-check matrix, an attacker can use these failure reactions to construct a “distance spectrum” and entirely reconstruct the private key [16]. Therefore, lowering the DFR is paramount to defending against reaction-based key-recovery attacks and ensuring Chosen-Ciphertext Attack (IND-CCA2) security.
1.3 Deep Unrolled Neural Decoders
To overcome the catastrophic error floors of classical iterative decoding without manually altering the graph topology, researchers have increasingly turned to deep learning frameworks. The pioneering approach in this domain is “deep unrolling,” which maps the discrete, iterative steps of the BP algorithm directly into the hidden layers of a feed-forward neural network [17]. By assigning trainable weights to the edges of the Tanner graph, this architecture creates a “soft” Tanner graph capable of actively scaling and damping messages to compensate for the detrimental effects of short cycles [17].
A critical structural requirement of these unrolled networks is the preservation of message-passing symmetry [17]. Mathematically, this prevents the neural decoder from developing a bias toward specific bit patterns and drastically simplifies network training by allowing the model to be trained entirely on the all-zero codeword rather than an exponentially large dataset of messages [17].
Despite their success in improving error-correction thresholds, early unrolled neural networks introduced significant engineering bottlenecks. Assigning individual weights to every edge of a dense MDPC graph leads to massive parameter explosion, making the models exceptionally difficult to train. Recent literature has addressed this by introducing shared-weight architectures, such as the Shared Neural Normalized Min-Sum (SNNMS) decoder, which enforces the sharing of correction factors across all edges within the same iteration layer, where a single decoding iteration represents one complete round of bipartite message passing comprising check-to-variable (C2V) and variable-to-check (V2C) message updates across the Tanner graph, reducing parameter complexity for a Tanner graph of edges and number of maximum iterations, from to and drastically improving training stability [10]. Nevertheless, a major limitation persists within the deep unrolling paradigm: standard unrolled neural networks lack topological scalability. Because the neural architecture is hard-coded to a specific Tanner graph, the model cannot seamlessly scale to varying code lengths or rates without undergoing computationally expensive retraining from scratch [18].
1.4 Graph Neural Networks (GNNs) for Decoding
To resolve the topological rigidity and scalability limitations of deep unrolled networks, contemporary research has pivoted towards Graph Neural Networks (GNNs). They abstract the decoding process into generalized graph operations that naturally achieve “algorithmic alignment” with the message-passing structure of BP on bipartite Tanner graphs [18]. Rather than relying on rigid, handcrafted update formulas, GNN decoders treat channel error correction as a node-classification task on the graph, dynamically learning adaptive message-passing rules that handle loopy topologies and short-cycle trapping structures far more effectively than standard BP [19,20].
Edge-Weighted GNNs (EW-GNN) have proven highly effective for short block codes. By employing a feed-forward neural network to compute multiplicative edge weights dynamically based on local neighborhood message reliabilities, EW-GNNs suppress unreliable messages generated by short cycles [18]. Crucially, because the neural weight generator works on local node features rather than fixed Tanner graph positions, the parameter count remains completely independent of codeword length ( constant parameter footprint). This allows the model trained on a smaller code topology (e.g., ) to be applied directly to a larger, more complex code (e.g., ) without any parameter adjustment [18].
Further bridging the gap between classical theory and deep learning, hybrid models such as Neural Enhanced Belief Propagation (NEBP) combine mathematically rigorous BP updates with GNN-generated message refinements at each iteration [21]. By operating conjointly with classical algorithms, NEBP leverages the adaptive learning capability of GNNs to handle complex, non-Gaussian, or bursty noise profiles where standard BP fails to converge [21]. Recent studies
Table 1: Summary of various architectures
| Architecture | Literature | Weight Granularity & Parameter Complexity | Scalability across Lengths | Secret Key Graph Preserved? | Primary Application Domain |
|---|---|---|---|---|---|
| Deep Unrolled BP | [17] | Per-edge per-layer: | No (Hard-coded to fixed graph) | Yes | High-Density Algebraic Block Codes |
| Attentive SNNMS (A-SNNMS) | [10] | Per-layer shared: | No (Requires retraining per code size) | Yes | Telecommunication LDPC (5G / Wi-Fi 6) |
| Edge-Weighted GNN (EW-GNN) | [18] | MLP edge weight generator: constant | Yes (Transferable across ) | Yes | Short Block Communication Codes |
| Neural Enhanced BP (NEBP) | [21] | Factor Graph GNN refinement: | Partial (Graph-dependent) | Yes | Non-Gaussian / Bursty Noise Channels |
| Differentiable Factor Graph | [22] | Gradient optimization of binary matrix | N/A (Code design tool) | Alters matrix | Differentiable Short Code Design |
by [20] demonstrate that integrating attention-weighted message aggregation and skip connections into graph decoders accelerates convergence, requiring significantly fewer iterations than classical BP while maintaining superior bit error rates across dynamic channel conditions. Complementing these decoder-focused developments, differentiable tensor reformulations of BP now allow data-driven optimization of the factor graph itself, enabling researchers to gradient-optimize the binary parity-check matrix directly under channel noise simulations [22]. Table 1 summarizes the complexity, scalability and applications of some of the architectures cited in this paper.
1.5 Factor Graph Optimization & The Research Gap
While the integration of GNNs into channel decoding represents a significant leap forward, critical deficiencies remain when applying these models to the specific constraints of PQC. Literature reveals that static message passing in both classical and early neural decoders ignores real-time reliability differences across iterations [10]. Consequently, standard iterative decoders structurally fail when encountering near-codeword absorbing states, where the syndrome resulting from the decoding is of very low Hamming weight [15] and dense 4-cycle graph topologies [5] inherently present in QC-MDPC matrices.
As established, classical workarounds like MBBP parallel decoders [13] and AVN graph expansions [14] introduce high hardware overhead or alter key dimensions. Furthermore, while gradient-based optimization over factor graphs has proven capable of discovering superior binary parity-check matrix structures [22], standard unrolled neural decoders operate purely as feed-forward architectures, lacking the recurrent memory states necessary to track temporal message dynamics or detect when decoding has stalled in an absorbing state.
Therefore, a distinct research gap emerges at the intersection of deep learning and PQC. There is an urgent need to combine unrolled graphical message passing with recurrent memory mechanisms such as Gated Recurrent Units (GRUs) [23], to actively retain prior decoding states, dynamically break limit cycles in PQC matrices, and suppress the DFR required to prevent reaction-based key-recovery attacks, all without artificially altering the underlying Tanner graph.
To address this gap, this paper introduces a Recurrent Bipartite Graph Neural Network (R-BGNN) for QC-MDPC decoding in McEliece-style cryptosystems by embedding GRUs directly into the check and variable nodes of the Tanner graph to provide temporal memory across unrolled iterations. To ensure the model generalizes well to new keys, we use topological degree normalization and train the network on dynamically sampled matrix topologies using a curriculum learning approach. Finally, we evaluate the model's accuracy and convergence speed across unseen master key topologies under exact cryptographic error weights, comparing its performance against classical Bit-Flipping and Min-Sum BP decoders.
2 Methods
The methodology encompasses five primary phases: dataset generation, formulation of classical mathematical baselines, design of the R-BGNN, implementation of the training loop, and execution of an evaluation protocol.
2.1 The QC-MDPC Decoding Process
To establish a clear foundational framework for evaluating neural and classical decoders, it is necessary to formalize the mechanics of syndrome decoding on a bipartite graph. In McEliece-style code-based cryptosystems, an encrypted ciphertext is generated by encoding a plaintext message using a public systematic generator matrix and adding a random binary noise vector of Hamming weight , such that [4,9].
At the receiver, the secret parity-check matrix is used to isolate the noise from the message by computing the syndrome vector :
Because , the syndrome vector depends strictly on the error vector and the secret matrix [9]. Each entry in the syndrome vector indicates whether the -th parity-check constraint is satisfied () or unsatisfied (). Decoding is complete when the estimated error vector satisfies , yielding a zero residual syndrome .
This decoding process is mapped onto a bipartite Tanner graph , where variable nodes correspond to codeword bit positions, check nodes correspond to parity-check equations, and an edge connects check node to variable node if and only if [8,18].
Within this graphical framework, a single decoding iteration represents one complete two-phase round of message passing across all edges in the Tanner graph [8,24]. Let denote the set of check nodes connected to variable node , and let denote the set of variable nodes connected to check node . At each iteration , extrinsic reliability messages in the form of LLRs are exchanged across connected edges via two distinct phases:
Check-to-Variable (C2V) Update: Each check node computes the extrinsic check-to-variable message transmitted back to variable node by evaluating parity constraints across all connected variable nodes except :
Here, denotes the set of all variable nodes connected to check node , excluding the recipient node .
Variable-to-Check (V2C) Update: Each variable node aggregates its intrinsic initial channel observation with incoming extrinsic messages from all connected check nodes except to produce the outgoing variable-to-check message :
Here, represents the set of all check nodes connected to variable node , excluding the target check node .
At the conclusion of iteration , the total posterior LLR for each bit is computed by summing the intrinsic observation with all incoming check messages:
A hard-decision bit estimate is produced via:
If the resulting error vector satisfies , decoding terminates; otherwise, message passing advances to iteration up to iterations.
Defining an iteration as this complete C2V and V2C exchange provides a standardized baseline for comparing the convergence speed and parameter efficiency of feed-forward, unrolled, and recurrent decoders.
2.2 Dataset Generation
The foundational step of the research framework involves generating QC-MDPC matrices used by McEliece-style PQC candidates [4]. A QC-MDPC code is defined by its block index , circulant block size , and uniform row weight . For this paper, the framework generates codes with parameters , block size , and total block length .
The parity-check matrix is constructed by generating two random, sparse circulant blocks and [4]. The first row of each block is constructed by randomly allocating non-zero entries such that the row weight of each block equals , yielding a total row weight of . Subsequent rows are formed via cyclic right-shifts of the preceding row. This structure ensures a uniform row degree of for all check nodes and a uniform column degree of for all variable nodes [7]. Figure 1 shows the structure of one such matrix generated using these specifications.
Because cryptographic security dictates that these matrices remain relatively dense () compared to telecommunication LDPC codes (), they inherently generate loopy graph structures [4,7]. To quantify this, the framework executes a topological profiling phase upon matrix generation. The profiling engine calculates the check-node intersection spectrum by analyzing the inner product matrix . The off-diagonal entries (for ) denote the number of shared variable nodes between check nodes and ; an overlap of mathematically guarantees the existence of a length-4 cycle (4-cycle) in the bipartite Tanner graph [5].
Figure 2 shows the tally of the check node interactions with the shared variable nodes. A standard matrix generated under the parameters established by the profiling engine contains over 1,143 exact 4-cycles. Figure 3 provides visual proof of the existence of 4-cycles within the Tanner graph of the generated matrix. These specific structures form dense trapping sets that cause classical message-passing algorithms to stall [12,15].

Figure 1: A random sample binary Parity-Check Matrix, (black dots represent set bits)

Figure 2: Check-Node Intersection Frequency plot showing 1000+ intersections of more than two shared Variable Nodes
Tanner Subgraph (4-Cycles Highlighted in Red)

Figure 3: Tanner Subgraph showing 4-cycles (edges in red form cycles)
To generate the evaluation dataset, the framework utilizes an intentional sparse error injection model. Binary error vectors of fixed Hamming weight are generated uniformly at random, and their corresponding syndrome vectors are computed over via . This discrete binary formulation directly mirrors the operational setting of code-based key encapsulation mechanisms [4]. Unlike standard telecommunication decoding literature that models continuous physical channel corruption using Additive White Gaussian Noise (AWGN) [10,18], continuous channel noise is inapplicable to cryptographic error correction [16].
2.3 Classical Baselines
To evaluate the R-BGNN, its performance is benchmarked against two standard algorithms utilized in code-based cryptography.
Bit-Flipping Decoder: The first baseline is a hard-decision Bit-Flipping algorithm [9,25]. In each iteration, the decoder computes the number of unsatisfied parity-check equations associated with each bit. Variable Nodes that participate in unsatisfied checks exceeding a threshold are flipped, and the syndrome is recomputed [9]. The framework dynamically tunes this threshold fraction (evaluating thresholds between and ) on a validation suite to ensure the classical algorithm operates at optimal efficiency before comparing it to the neural network.
Syndrome-Based Min-Sum BP: The second baseline is an Attenuated Min-Sum decoding heuristic [10,11]. Standard BP utilizes hyperbolic tangent (tanh) functions to exchange LLRs [17]. However, exact BP is numerically unstable on dense, short-block graphs [17]. The Min-Sum algorithm mitigates this by reducing check node updates to sign-multiplication and minimum-value magnitude comparisons [10]. To prevent LLR overestimation, a primary failure point of Min-Sum algorithms on loopy graphs, an attenuation factor of is applied to all outgoing C2V messages [10]. Both classical baselines are constrained to a maximum of iterations.
2.4 The R-BGNN Architecture
The core contribution of this methodology is the Recurrent Bipartite Graph Neural Network (R-BGNN). The architecture abstracts the iterative Tanner graph message-passing protocol into a deep unrolled GNN, incorporating GRUs as discrete memory cells [18,21].
2.4.1 Topological Degree Normalization
A critical design choice in the R-BGNN is the initial embedding of syndrome features, which are the binary parity-check failure vector indicating unsatisfied check equations. Rather than passing raw unsatisfied parity checks directly into the network, the framework applies topological degree normalization [18]. The initial signal at each variable node is calculated as:
where represents the set of check nodes connected to variable node , is the syndrome bit and is the column degree (). This mathematical scaling ensures that input embeddings remain invariant to matrix density, enabling the network to generalize across random key topologies [18].
2.4.2 Message Passing Rules
The R-BGNN executes unrolled message-passing iterations. In each iteration , messages are non-linearly scaled using Multi-Layer Perceptrons (MLPs) [26]. The MLPs project concatenated node features through an expansion layer () before compressing them back to the embedding dimension (), employing Sigmoid Linear Unit (SiLU) activation functions.
The Variable-to-Check (V2C) message and Check-to-Variable (C2V) message are computed as:
2.4.3 Breaking Limit Cycles with GRU Memory
Standard unrolled decoders map iterations strictly to feed-forward layers, operating without memory of prior states [10,17]. This feed-forward operation causes standard networks to fall into oscillating limit-cycles when encountering dense trapping sets [15]. To overcome this, the R-BGNN aggregates incoming messages and processes them through discrete GRU cells situated at every check and variable node [23]:
The hidden state acts as a temporal memory vector. By referencing prior trajectories, the network detects when message magnitudes are oscillating, a signature of an absorbing near-codeword set [15], and actively dampens attention weights to break out of the limit cycle. A final readout MLP projects variable node embeddings into binary classification logits . The architectural parameters are detailed in Table 2.
Table 2: R-BGNN Architectural Hyperparameters
| Component | Hyperparameter / Configuration | Parameter Count |
|---|---|---|
| Variable Node Embedding | 4,288 | |
| Check Node Embedding | 4,288 | |
| V2C Message MLP | 24,768 | |
| C2V Message MLP | 24,768 | |
| Check Node Memory | GRUCell(Input : 64, Hidden : 64) | 24,960 |
| Variable Node Memory | GRUCell(Input : 64, Hidden : 64) | 24,960 |
| Readout Classifier | 2,113 | |
| Total Trainable Parameters | Constant Parameter Footprint | 110,145 |
2.5 Training
A primary limitation in deep unrolling literature is overfitting neural weights to a single, static Tanner graph [18]. To enforce true algorithmic generalization, this methodology implements a Dynamic Train and Static Evaluate paradigm.
Rather than training on a single static key instance, the dataset generator samples 8 new, mathematically independent QC-MDPC parity-check matrices () at the start of each training epoch. Furthermore, a curriculum training strategy is applied where the injected error weight is sampled from for every batch. Because the graph edges change constantly across epochs, the R-BGNN cannot memorize specific graph connections, forcing it to learn a graph-agnostic error-correction algorithm [18].
The network is optimized over 60 epochs using the AdamW optimizer [27] with a Cosine Annealing learning rate schedule (decaying from to ). To optimize both bit-level decision accuracy and parity satisfaction, we formulate a composite loss function combining class-weighted Binary Cross-Entropy () and differentiable syndrome loss () [22]:
where . The syndrome loss term computes the cross-entropy between the target syndrome and the differentiable syndrome probability vector , explicitly penalizing bit predictions that violate parity-check constraints [22].
2.6 Evaluation
To guarantee statistical integrity, evaluating decoders on a single matrix is insufficient, as performance could reflect an unusually “strong” or “weak” key instance [5,25]. To address this, the evaluation phase locks all neural weights and benchmarks the R-BGNN, Bit-Flipping, and Min-Sum baselines against an ensemble of 20 unseen, independently generated master matrices.
To quantify decoder performance, evaluation is conducted using Decoding Failure Rate (DFR) and Bit Error Rate (BER). The DFR measures the proportion of evaluated frames where the decoder fails to reach an exact zero-syndrome state () within iterations. In code-based PQC, DFR is a critical security parameter rather than a simple reliability metric. For example, a DFR of 10% (0.10) implies that 1 in every 10 decryption attempts fail to recover the shared secret. In static-key deployments, an adversary observing these 10% failure reactions can exploit the correlation between decoding failures and private key structures via the GJS reaction attack to reconstruct the secret key [15, 16]. While DFR provides a binary frame-level success metric, BER quantifies fine-grained convergence by measuring the fraction of residual uncorrected bits remaining in the message vector. For instance, a decoder exhibiting a 10% DFR could still achieve a near-zero BER (e.g., ), proving that even when a frame fails absolute cryptographic zero-syndrome verification, the decoder systematically isolated and corrected most error bits rather than failing catastrophically across the codeword.
Benchmarking is executed across an error weight spectrum of , processing 1,000 frames per per graph (totalling evaluated frames per decoder). The arithmetic mean across the 20 matrices is reported for both DFR and BER. Multi-matrix testing allows the framework to compute and plot standard deviations across the 20 topologies. Finally, Wilson Confidence Intervals are derived for all error rates, and McNemar's test is computed to confirm statistical significance between neural and classical decoding failures.
3 Results
By testing the decoders across 20 independent master matrices rather than a single topology, this methodology captures the exact standard deviations of the decoding metrics. As heavily emphasized in cryptographic standardization efforts, capturing this variance ensures statistical significance, proving that the observed performance is a universal architectural advantage rather than a biased claim derived from selecting a single, best-case matrix structure. In Figure 4, Figure 5, and Figure 6, the shaded regions represent the standard deviation of performance across the independent matrix configurations.
3.1 Decoding Performance and Convergence Speed
Starting with DFR, Figure 4, at low-to-moderate noise levels (), both Classical Min-Sum and the R-BGNN achieve a flawless 0.00% DFR (0/20,000 failed frames per error weight), whereas the Bit-Flipping baseline degrades early, exhibiting a DFR of at and at . As noise weight increases to and , Bit-Flipping collapses rapidly to and failure rates, respectively. In contrast, Classical Min-Sum and R-BGNN remain virtually error-free at , with both decoders sustaining an extremely low DFR of (dfr).
The critical performance divergence occurs in the moderate-to-high noise regime (). At , Bit-Flipping saturates at failure rate. Classical Min-Sum begins to experience cycle-induced trapping sets, yielding a DFR of (dfr). The R-BGNN achieves a lower DFR of (dfr), cutting decoding failures by 52.3%. At , Bit-Flipping reaches . Classical Min-Sum degrades sharply to a mean DFR of (1.79% in pooled frame evaluations). At this exact same noise weight, the R-BGNN maintains a mean DFR of (0.55% pooled), successfully correcting over 69.5% of the frames that cause the classical Min-Sum baseline to fail. At , Bit-Flipping fails almost completely at . Classical Min-Sum collapses to a failure rate (9.63% pooled). The R-BGNN maintains a robust DFR (3.49% pooled), achieving a 63.7% relative error reduction over Min-Sum. At and , while Bit-Flipping saturates completely (99.69% at ; 99.97% at ), the R-BGNN retains a significant advantage over Min-Sum, recording vs. at (a 44.0% relative improvement), and vs.
Decoding Failure Rate (DFR)

Figure 4: Performance of Decoding Failure Rate (DFR) waterfall curves illustrating the R-BGNN (evaluated across 20 unseen QC-MDPC matrices).
at t = 12.
Furthermore, the shaded standard deviation error bands plotted around the R-BGNN curve in Figure 4 ( at ; at ) are substantially narrower than those of Classical Min-Sum () and Bit-Flipping (). This mathematical tightness proves that the R-BGNN maintains robust, key-agnostic stability across entirely different random matrix topologies, rather than relying on a favourable key instance.
For BER analysis in Figure 5, throughout the moderate-to-high noise spectrum (), the R-BGNN consistently maintains a lower BER trajectory than both Bit-Flipping and Min-Sum baselines. At , Bit-Flipping exhibits a high BER of (1.22%), whereas Min-Sum and R-BGNN record near-zero BERs of and , respectively. As noise scales to and , the R-BGNN achieves a BER reduction over Min-Sum at ( vs. ) and a reduction at ( vs. ). At , R-BGNN limits BER to (0.13%), compared to (0.40%) for Min-Sum and (16.23%) for Bit-Flipping.
Contrasting the BER trajectory alongside the DFR waterfall reveals a profound secondary advantage of the neural architecture: even when the R-BGNN registers an uncorrected frame failure at high error weights, it leaves significantly fewer residual error bits per failed frame than classical decoders. To address print visibility constraints in graphical plots where Min-Sum error counts appear small alongside Bit-Flipping (as noted in data inspections), exact numerical residual error distributions were extracted directly from benchmark logs. When Bit-Flipping fails, residual bit errors spread broadly across a wide histogram range, leaving an average of 20 to 50+ uncorrected bit errors per frame. When Min-Sum fails at and , message passing stalls in isolated topological trapping sets, leaving an average cluster of 4 to 6 uncorrected bit errors per frame. When the R-BGNN fails at and , its residual error distribution concentrates sharply at the lowest possible non-zero values, leaving an average of only 1 to 3 remaining bit errors per frame on average ( BER). This tight clustering confirms that the MLPs and attention layers inside the R-BGNN systematically isolate and resolve bit errors, rather than

Figure 5: Bit Error Rate (BER) trajectories evaluated across 20 unseen QC-MDPC matrices
making uncoordinated, random bit flips when confronted with unfamiliar 4-cycle topologies.
Convergence speed in Figure 6 measures the mean number of decoding iterations required for an algorithm to successfully recover a valid codeword () and halt. In iterative graph decoding, a single decoding iteration represents one complete two-phase round of bipartite message passing across the Tanner graph, comprising a C2V parity update followed by a V2C bit likelihood update.
At light noise weights (), all three decoders converge near-instantaneously, averaging 1.00 to 1.29 iterations per frame for Min-Sum and R-BGNN. However, as error weight increases, the iteration trajectory of Bit-Flipping curves upward aggressively, requiring iterations at , iterations at , iterations at , and fully saturating the iteration cap () at (12.22 at ; 12.84 at ).
Comparing Classical Min-Sum against the R-BGNN demonstrates that recurrent neural memory actively accelerates convergence. At , Min-Sum requires iterations; R-BGNN requires iterations. At , Min-Sum requires iterations; R-BGNN requires iterations (4.3% faster). At , Classical Min-Sum requires iterations to converge or fail, whereas the R-BGNN reaches its halting state in iterations (10.3% faster). At , Min-Sum requires iterations; R-BGNN requires iterations (9.2% faster).
This measurable reduction in average iterations proves that by integrating GRUs at Tanner graph nodes, the R-BGNN not only corrects more corrupted frames than classical algorithms but also converges to valid cryptographic codewords in fewer iterations when successful.
3.2 Trapping Set and Residual Error Analysis
To evaluate how each decoder responds to loopy Tanner graph topologies under escalating noise levels, residual error histograms were evaluated across four error weight regimes (). Figure 7 illustrates the remaining uncorrected bit errors per frame on the x-axis against logarithmic frequency on the y-axis, providing clear visual evidence of classical trapping sets and neural
Convergence Speed

Figure 6: Average iterations required for convergence
error-isolation mechanics.
Across all four noise thresholds, the hard-decision Bit-Flipping baseline exhibits severe absorbing-state behaviour. As error weight increases from 7 to 10, the zero-residual frame count for Bit-Flipping collapses from 11,308 down to just 394 out of 20,000 evaluated frames. Uncorrected frames form a wide, dispersed distribution spanning between 2 and 50+ residual errors, reflecting dense subgraph cycles where threshold-based decisions stall permanently.
Conversely, both soft-decision and neural architectures maintain dominant zero-error peaks but reveal distinct failure trajectories as noise saturates.
At and , both Min-Sum and R-BGNN maintain near-flawless convergence, retaining 19,956 and 19,979 zero-error frames at , respectively. However, Min-Sum failure frames spread across small clusters of 3 to 16 residual errors, whereas R-BGNN failures remain tightly bounded (with 8 out of 21 failed frames retaining only a single residual error).
At , classical Min-Sum registers 357 frame failures clustered primarily between 3 and 10 residual errors, illustrating standard trapping set stall points. In contrast, the R-BGNN limits total failures to 97 frames, with over half of these failed frames (49 out of 97) retaining exactly 1 residual bit error.
At , Min-Sum failures expand significantly to 1,926 frames spreading across up to 43 residual errors. The R-BGNN suppresses total failures to 698 frames while keeping residual errors heavily concentrated at minimal bit counts (1 to 3 bit errors per frame on average).
3.3 Latent Space Linear Separability (PCA)
To verify that the neural network is executing logical mathematical operations, Principal Component Analysis (PCA) was performed on the 64-dimensional latent variable node embeddings generated by the final GRU layer. The resulting 2D scatter plot (Figure 8) demonstrates remarkable linear separability.
The visual clustering clearly isolates the safe bits (0) into a dense, stable region, while the injected error bits (1) are dynamically separated across the boundary line. This distinct linear

(a)

(b)
(c)
(d)
Figure 7: Residual error distribution at (a) t = 7, (b) t = 8, (c) t = 9, (d) t = 10. The hard-decision Bit-Flipping decoder exhibits severe absorbing-state behavior, leaving dense clusters of unresolvable bits. Conversely, the proposed R-BGNN successfully navigates the dense graph topology alongside Min-Sum having comparatively lesser residual errors.
GNN Latent Space Linear Separability (PCA)

Figure 8: Principal Component Analysis (PCA) projection of the final R-BGNN latent space.
separability proves that the neural network is mathematically isolating error features within its high-dimensional space. By leveraging the edge-attention weights generated by the V2C MLP, the architecture actively scales and suppresses noisy topological edges, allowing the true error bits to be cleanly classified by the final readout layer.
To evaluate practical feasibility, the total offline training time was recorded. Training the R-BGNN across 60 epochs (with 8 dynamically generated QC-MDPC matrices per epoch, totalling 480 unique Tanner graph topologies) required approximately 20 minutes on a single NVIDIA GeForce RTX 5080 GPU. This modest computational requirement confirms that dynamic multi-matrix neural training is highly accessible and practically feasible for PQC decoder design.
A critical evaluation of any neural architecture must address computational complexity and execution latency. Latency benchmarks on our evaluation platform reveal that the R-BGNN requires approximately 314 milliseconds per 1,000 frames, compared to 87.5 milliseconds for the Classical Min-Sum and 82.1 milliseconds for the Bit-Flipping baselines. The classical baseline was vectorized in PyTorch to eliminate standard Python loops, providing a strict performance benchmark.
4 Discussion
This section provides discussion and evaluates the R-BGNN's empirical performance against the existing literature of error correction in PQC.
4.1 Overcoming QC-MDPC Error Floor
As evidenced by the multi-threshold residual error distributions in Section 3, the R-BGNN successfully navigates loopy Tanner graph topologies to prevent decoder stalling. Even under heavy noise saturation ( and ), the proposed architecture suppresses total frame failures while isolating residual errors to minimal bit counts. This empirical resilience aligns directly with theoretical failure mechanisms established in recent PQC literature. [15] proved that error floors in QC-MDPC codes under iterative decoding are driven by near-codewords that act as absorbing traps for message passing. In classical decoders, message passing within these absorbing states produces rigid limit cycles. In contrast, by utilizing recurrent memory cells to dynamically scale edge messages based on historical trajectory, the R-BGNN breaks out of these near-codeword absorbing states, driving the overall DFR into deep waterfall decay.
Expanding on these graph-level vulnerabilities, [5] linked decoding failures to the prevalence of short 4-cycles in the code's Tanner graph. Crucially, they established a structural distinction between inter-circulant 4-cycles (which bridge across different circulant submatrices) and intra-circulant (or intra-block) 4-cycles (which lie entirely within a single circulant block ), proving that intra-circulant 4-cycles are the primary driver of weak-key decoding failures due to their high local density of overlapping check connections. At higher error weights ( and ), Classical Min-Sum degrades sharply due to cycle-induced LLR overestimation [10]. In contrast, the R-BGNN maintains significantly lower failure rates and tight error variance ( vs. ) across all 20 unseen, randomly generated master matrix topologies. This empirical consistency proves that the R-BGNN provides active, key-agnostic robustness against short 4-cycle variations, neutralizing the performance gap between standard and weak-key configurations.
4.2 Comparison Against Static Neural Decoders
The dynamic design of the R-BGNN directly addresses the structural limitations of prior neural decoding architectures. Early unrolled BP networks assign edge-specific weights to a fixed Tanner graph, preventing them from generalizing across varying code lengths or unobserved key instances without retraining from scratch [17]. While contemporary advancements like the SNNMS decoder reduce parameter complexity to via layer-wise factor sharing [10], they remain constrained to sparse telecommunication standards () and operate purely as feed-forward architectures lacking temporal memory.
The advantage of the R-BGNN lies in the integration of GRUs at check and variable nodes. Because feed-forward decoders are memoryless across iteration layers, message updates oscillate endlessly when trapped in short cycles. In contrast, the GRU memory cells maintain a persistent hidden state vector () across iterations. This temporal memory enables the network to track message trajectory histories, recognize when updates have entered periodic 4-cycle oscillations within dense trapping sets (), and dynamically adjust edge attention weights to break absorbing states. By combining an constant parameter footprint with recurrent state tracking, the R-BGNN overcomes the rigid, graph-bound limitations of conventional unrolled decoders.
4.3 Cryptographic Security and the Capacity-Complexity Trade-off
Although the R-BGNN exhibits a higher per-frame execution latency than classical message-passing algorithms, this computational trade-off is strongly justified by security necessity. Even so, the non-linear MLP message projections and recurrent GRU updates in the R-BGNN inherently require more computational time per iteration due to dense tensor operations compared to the simple sign-multiplication of Classical Min-Sum [10].
However, in the domain of PQC, this is an acceptable trade-off. As established in recent literature, a non-zero DFR is not merely a performance bottleneck; it actively allows adversaries to exploit decryption errors via the GJS reaction attack to reconstruct the secret key [15]. Therefore, although this evaluation was conducted as a small-scale proof-of-concept run (), trading inference speed for a measurably lower DFR is a mandatory upgrade to ensure absolute IND-CCA2 security in PQC protocols [16].
5 Conclusion
This paper presented a Recurrent Bipartite Graph Neural Network (R-BGNN) designed to resolve cycle-induced decoding stalls in QC-MDPC codes for PQC. By embedding GRUs within the message-passing framework and utilizing a multi-topology curriculum training strategy, the architecture learns graph-agnostic error-correction dynamics that effectively break 4-cycle limit-cycle oscillations.
Comprehensive benchmarking across frames over 20 unseen, randomly generated test matrices confirmed the superiority of the proposed model. Under heavy noise saturation (), the R-BGNN suppresses the DFR to , achieving a 63.7% relative error reduction compared to Classical Min-Sum () while converging in fewer iterations (5.12 vs. 5.71). Furthermore, decoding failures are isolated to a minimal residual of 1 to 3 remaining bits per frame. Although the neural tensor updates introduce higher software latency (314 ms vs. 87.5 ms per 1,000 frames), this trade-off is strictly justified in PQC, where suppressing DFR is mandatory to defend against reaction-based key-recovery attacks. Future research will explore fixed-point hardware quantization and scaling the architecture to full NIST BIKE parameters.
Acknowledgments
The author would like to thank Dr Elisabeth Fink for her excellent mentorship, valuable feedback, and great support during this project. Her guidance was essential to this paper. Further, the author is grateful to the Department of Computer Science and the IT technician team at Middlesex University for providing the server infrastructure and resources that made this research possible.
References
[1] Shor, P.W.: Polynomial-Time Algorithms for Prime Factorization and Discrete Logarithms on a Quantum Computer. SIAM Rev. 41, 303–332 (1997). https://doi.org/10.1137/S0036144598347011
[2] Dam, D.-T., Tran, T.-H., Hoang, V.-P., Pham, C.-K., Hoang, T.-T.: A Survey of Post-Quantum Cryptography: Start of a New Race. Cryptography. 7, 40 (2023). https://doi.org/10.3390/cryptography7030040
[3] McEliece, R.J.: A Public-Key Cryptosystem based on Algebraic Coding Theory. Coding Thv. 4244, 114–116 (1978)
[4] Misoczki, R., Tillich, J.-P., Sendrier, N., Barreto, P.S.L.M.: MDPC-McEliece: New McEliece variants from Moderate Density Parity-Check codes. In: 2013 IEEE International Symposium on Information Theory. pp. 2069–2073 (2013)
[5] Matthews, G.L., McMillon, E.: A combinatorial approach to avoiding weak keys in the BIKE cryptosystem: A combinatorial approach to avoiding weak keys. Des. Codes Cryptography. 93, 3413–3436 (2025). https://doi.org/10.1007/s10623-025-01643-7
[6] Gallager, R.: Low-density parity-check codes. IRE Transactions on Information Theory. 8, 21–28 (1962)
[7] Zhang, X., Xie, Z.: Sparsity-Aware Medium-Density Parity-Check Decoder for McEliece Cryptosystems. IEEE Transactions on Circuits and Systems II: Express Briefs. 70, 3343–3347 (2023). https://doi.org/10.1109/TCSII.2023.3264578
[8] Tanner, R.: A recursive approach to low complexity codes. IEEE Transactions on Information Theory. 27, 533–547 (1981). https://doi.org/10.1109/TIT.1981.1056404
[9] Maurich, I.V., Oder, T., Güneysu, T.: Implementing QC-MDPC McEliece Encryption. ACM Trans. Embed. Comput. Syst. 14, 44:1–44:27 (2015). https://doi.org/10.1145/2700102
[10] Zheng, F., Wang, L., Liu, K., Zhang, Z.: A-SNNMS: An Attentive Shared Neural Normalized Min-Sum Decoder for LDPC Codes. Electronics. 15, 1023 (2026). https://doi.org/10.3390/electronics15051023
[11] Fossorier, M.P.C., Mihaljevic, M., Imai, H.: Reduced complexity iterative decoding of low-density parity check codes based on belief propagation. IEEE Transactions on Communications. 47, 673–680 (1999). https://doi.org/10.1109/26.768759
[12] Shen, Y., Li, Z., Boutillon, E., Song, W., Ren, Y., Zhang, C., You, X., Burg, A.: Belief Propagation Decoding for Short Codes on Structured Sparse Parity-Check Matrices. In: 2025 IEEE International Symposium on Information Theory (ISIT). pp. 1–6 (2025)
[13] Hehn, T., Huber, J.B., Laendner, S., Milenkovic, O.: Multiple-Bases Belief-Propagation for Decoding of Short Block Codes. In: 2007 IEEE International Symposium on Information Theory. pp. 311–315 (2007)
[14] Li, Z., Shen, Y., Ren, Y., Huang, Y., You, X., Zhang, C.: Belief Propagation Decoding for Short-Length Codes Based on Sparse Tanner Graph. IEEE Communications Letters. 28, 969–973 (2024). https://doi.org/10.1109/LCOMM.2024.3366293
[15] Arpin, S., Lau, J.B., Mesnard, A., Perlner, R., Robinson, A., Tillich, J.-P., Vasseur, V.: Error floor prediction with Markov models for QC-MDPC codes, https://eprint.iacr.org/2025/153, (2025)
[16] Guo, Q., Johansson, T., Stankovski, P.: A Key Recovery Attack on MDPC with CCA Security Using Decoding Errors. In: Cheon, J.H. and Takagi, T. (eds.) Advances in Cryptology – ASIACRYPT 2016. pp. 789–815. Springer, Berlin, Heidelberg (2016)
[17] Nachmani, E., Be’ery, Y., Burshtein, D.: Learning to decode linear codes using deep learning. In: 2016 54th Annual Allerton Conference on Communication, Control, and Computing (Allerton). pp. 341–346 (2016)
[18] Tian, K., Yue, C., She, C., Li, Y., Vucetic, B.: A Scalable Graph Neural Network Decoder for Short Block Codes. In: ICC 2023 - IEEE International Conference on Communications. pp. 1268–1273 (2023)
[19] Gong, A., Cammerer, S., Renes, J.M.: Graph Neural Networks for Enhanced Decoding of Quantum LDPC Codes. In: 2024 IEEE International Symposium on Information Theory (ISIT). pp. 2700–2705 (2024)
[20] Bajpai, A.: Intelligent LDPC Decoding Using Graph Neural Networks for Beyond 5G Communication Systems. Journal of Information and Communication Convergence Engineering. 23, 227–235 (2025). https://doi.org/10.56977/jicce.2025.23.4.227
[21] Satorras, V.G., Welling, M.: Neural Enhanced Belief Propagation on Factor Graphs. In: Proceedings of The 24th International Conference on Artificial Intelligence and Statistics. pp. 685–693. PMLR (2021)
[22] Choukroun, Y., Wolf, L.: Factor Graph Optimization of Error-Correcting Codes for Belief Propagation Decoding, http://arxiv.org/abs/2406.12900, (2024)
[23] Chung, J., Gulcehre, C., Cho, K., Bengio, Y.: Empirical evaluation of gated recurrent neural networks on sequence modeling. arXiv preprint arXiv:1412.3555 (2014)
[24] Richardson, T.J., Urbanke, R.L.: Efficient encoding of low-density parity-check codes. IEEE Transactions on Information Theory. 47, 638–656 (2001). https://doi.org/10.1109/18.910579
[25] Vasseur, V.: Post-quantum cryptography: a study of the decoding of QC-MDPC codes, https://theses.hal.science/tel-03254461, (2021)
[26] Murtagh, F.: Multilayer perceptrons for classification and regression. Neurocomputing. 2, 183–197 (1991). https://doi.org/10.1016/0925-2312(91)90023-5
[27] Loshchilov, I., Hutter, F.: Decoupled Weight Decay Regularization, http://arxiv.org/abs/1711.05101, (2019)