Syndrome-Guided Bit Flipping (SGBF)
- SGBF is an iterative decoding technique for binary linear codes that uses parity-check failures (syndrome) to guide bit flipping decisions.
- Variants incorporate soft reliability measures and dynamic weighting, achieving notable coding gains over traditional hard-decision decoders.
- Recent developments include learned flipping policies and post-failure re-decoding for FDPC codes, illustrating SGBF’s adaptability across decoding architectures.
Syndrome-Guided Bit Flipping (SGBF) is a family of iterative decoding methods for binary linear codes in which the current syndrome determines which bit positions should be flipped. The unifying idea is that parity-check violations identify where the present estimate is locally inconsistent with the code constraints, so the decoder uses the syndrome either directly, through unsatisfied-check counts, or indirectly, through reliability scores derived from the syndrome, soft information, or re-decoding outcomes. In the literature, SGBF ranges from classical hard-decision bit-flipping rules for LDPC-like codes to dynamic reliability-weighted decoders, reinforcement-learned flipping policies, threshold-adaptive MDPC decoders, and post-failure list re-decoding attached to layered normalized min-sum decoders for FDPC codes (Carpi et al., 2019, Hosseinzadeh et al., 1 Oct 2025).
1. Formal setting and decoding principle
Let be a parity-check matrix of a binary linear code. Codewords satisfy . Given a current binary estimate , the syndrome is
A component indicates that check is unsatisfied, while indicates that it is satisfied. If 0 denotes the set of checks incident to bit 1, then iterative SGBF seeks to drive 2 to zero by flipping bits whose neighborhoods are strongly implicated by the present pattern of unsatisfied checks (Carpi et al., 2019, Chang et al., 2010).
This viewpoint admits both hard-decision and soft-decision forms. In AWGN with BPSK signaling, one may use 3 directly or the log-likelihood ratio 4 as channel reliability. In bipolar notation, a satisfied check has 5 and an unsatisfied check has 6, which is convenient for weighted formulations and ML-related cost relaxations. The Tanner-graph interpretation is standard: variable nodes represent bits, check nodes represent parity constraints, and the syndrome records which check nodes currently fail under 7 (Chang et al., 2010).
The central operational fact is that flipping bit 8 toggles the syndrome components for all checks in 9. Classical SGBF therefore ranks bits by how many unsatisfied checks they touch. More elaborate variants retain this mechanism but modify the ranking rule, the selection rule, the update schedule, or the stopping criterion.
2. Classical counters and weighted syndrome guidance
The canonical SGBF metric is the unsatisfied-check count
0
A standard rule is to select
1
and flip bit 2 if 3 exceeds a threshold 4; decoding stops if 5 or if a maximum number of iterations is reached. This is the form emphasized in the reinforcement-learning literature as the classical syndrome-guided decoder, and it is particularly natural on the BSC, where all 6 are equal (Carpi et al., 2019).
Weighted bit-flipping (WBF) generalizes this by assigning reliabilities to checks and, in some cases, to variables. A common metric is
7
with 8 reflecting check reliability. A widely used AWGN instantiation defines
9
and
0
so satisfied and unsatisfied checks contribute with opposite signs, while highly reliable bits are penalized against flipping (Carpi et al., 2019). Closely related LDPC formulations include Gallager’s unweighted flipping function,
1
together with WBF, IMWBF, RRWBF, GDBF, and NGDBF variants that incorporate checksum weights, channel magnitudes, damping, or perturbations (Chang et al., 2015).
The literature therefore uses “SGBF” in a broad sense: the syndrome remains the primary control signal, but the actual bit-ranking functional may be an integer counter, a weighted syndrome sum, a channel-penalized score, or a more elaborate dynamic reliability measure.
| Family | Representative rule | Distinguishing feature |
|---|---|---|
| Classical SGBF | 2 | Unsatisfied-check count |
| WBF / IMWBF | Weighted syndrome plus 3 term | Soft-information aware |
| CRBF | Local cost 4 with 5 | Adaptive check reliability |
| DWBF | Dynamic 6 and M1/M2-FBS | Iteration-by-iteration reliability tracking |
| LNMS+SGBF | 7 | Post-failure candidate re-decoding |
3. Reliability-aware SGBF for LDPC decoding
A major refinement is the Check Reliability Based Bit-Flipping (CRBF) framework, which derives a relaxed ML-related global cost
8
and decomposes it into local costs
9
Here 0 is interpreted as the reliability of bit 1. The key addition is a per-edge check reliability
2
A check contributes to bit 3 only when its other participating bits appear reliable; unreliable neighborhoods force the contribution to zero. Soft-CRBF updates
4
while Hard-CRBF replaces 5 by the hard decision 6 (Chang et al., 2010).
The reported gains are substantial. On the 7 EG-LDPC code with 8, Soft-CRBF outperforms SPA, WBF, and MWBF by about 9, 0, and 1 respectively at 2, while Hard-CRBF outperforms standard BF by about 3 at 4. On MacKay’s 5 LDPC code with 6, Soft-CRBF gives 7 gain relative to WBF variants at 8, and Hard-CRBF gives 9 gain over standard BF at 0. On the 1 IEEE 802.15.3c LDPC code, Soft-CRBF outperforms IMWBF and MWBF by about 2 at 3 and yields 4 gain over WBF; on the 5 IEEE 802.3a/n LDPC code, it yields near-SPA performance and outperforms WBF, MWBF, and IMWBF by more than 6 at 7 (Chang et al., 2010).
Dynamic Weighted Bit-Flipping (DWBF) pushes the same idea further by updating checksum weights every iteration. Its flipping function is
8
with
9
The clipping threshold 0 suppresses unreliable checks, and the forgetting factor 1 limits accumulation of stale reliabilities. DWBF also introduces richer flipped-bit selection rules, notably M1-FBS and M2-FBS, and selective checksum-weight update schedules SWUS-A and SWUS-B derived from a time-expanded factor graph interpretation (Chang et al., 2015).
The reported behavior is code-dependent but consistent. For Code 1, MacKay 2 with 3, S-DWBF-B and S-DWBF-F provide 4 and 5 gains over RRWBF at 6, while S-DWBF-A yields 7 gain. For Code 2, EG-LDPC 8 with 9, S-DWBF-A achieves about 0 gain over IMWBF at 1 and S-DWBF-B adds about 2 more. In multi-bit mode, DWBF with M2-FBS approaches NMS within about 3 on Code 1, while on Code 2 M1-DWBF-B is within about 4 of NMS and M2-DWBF-A/B are very close to NMS, with fewer loops and good convergence (Chang et al., 2015).
4. SGBF as post-failure re-decoding for FDPC codes
In FDPC decoding, SGBF appears in a different role: not as the primary iterative decoder, but as a post-failure enhancement to layered normalized min-sum (LNMS). FDPC codes are described as a recently introduced class designed for high-rate regimes, constructed from a structured base parity-check matrix with all columns of weight 2 and then extended by stacking permuted copies of the base matrix. The LNMS decoder partitions check nodes into non-conflicting layers using conflict-graph coloring, with adjacency matrix
5
and performs immediate variable-node updates after each layer. The check update uses normalized min-sum,
6
with fixed normalization 7 and no offset or damping terms (Hosseinzadeh et al., 1 Oct 2025).
SGBF is activated only if LNMS reaches 8 iterations and the final syndrome remains nonzero. For each variable 9, the decoder counts
0
and forms the reliability
1
The 2 least reliable positions are selected, with experiments using 3 and ties broken by smaller index. The decoder then creates 4 candidate channel-LLR vectors by flipping the sign of a single initial channel LLR,
5
restarts LNMS independently on each candidate with the same layered schedule and early stopping, and chooses the candidate with minimum syndrome weight
6
If the minimum syndrome weight is zero, that candidate is accepted; otherwise the decoder retains the original LNMS output (Hosseinzadeh et al., 1 Oct 2025).
This formulation is technically distinct from greedy one-bit-per-iteration SGBF. The syndrome does not directly choose a single flip in the current iterate; instead it enters a reliability metric that defines a single-bit candidate list, and LNMS re-decoding evaluates those candidates. Complexity reflects this hybrid structure. LNMS itself is 7 with message memory 8, while the extra SGBF cost on failure is
9
in the worst case, with smaller average cost due to early stopping and the factor 00 multiplying the failure-triggered overhead (Hosseinzadeh et al., 1 Oct 2025).
The empirical results on FDPC01 are specific: with 02 and a maximum of 03 iterations, LNMS+SGBF achieves approximately a 04 coding gain over standalone LNMS at 05. Against 5G-LDPC and polar codes of the same length and rate, under BP/NMS decoders, FDPC with LNMS+SGBF shows approximately 06–07 coding gain over a range of SNRs. The paper also reports similar gains for FDPC08, FDPC09, and FDPC10, monotonic FER improvement as 11 grows over 12 with diminishing returns beyond 13, and 14–15 gains at 16 under matched-average-complexity comparisons to 5G-LDPC (Hosseinzadeh et al., 1 Oct 2025).
5. Learned flipping policies and the MDP formulation
SGBF can also be cast as a sequential decision problem. In the learned bit-flipping framework, the MDP state is the syndrome 17 on the BSC, or either 18 with 19 or a syndrome obtained after a reliability-driven permutation in the AWGN case. The action space is the bit index set 20, and the transition is deterministic:
21
where 22 is column 23 of 24. The reward is
25
so terminal success receives a bonus and nonterminal flips are penalized by reliability-weighted cost (Carpi et al., 2019).
In tabular form, Q-learning updates
26
The fitted-Q version uses a fully connected neural network with syndrome input, one hidden layer of 500 neurons for most codes and 1500 for RM27, ReLU activation, and a linear output layer of size 28. The loss is
29
Goal-biased exploration supplements 30-greedy action selection by choosing a random action from the support of the current error pattern with probability 31, which the paper reports as significantly accelerating convergence relative to pure 32-greedy on RM33 (Carpi et al., 2019).
The relation to classical SGBF is explicit: instead of using a hand-crafted score such as 34, the learned decoder estimates 35 directly from rewards. The paper therefore interprets 36 as a data-driven, state-dependent flipping score that subsumes SGBF-like heuristics while adapting to code and channel structure (Carpi et al., 2019).
The reported performance spans several regimes. On the BSC, standard BF with an overcomplete parity-check matrix 37 for RM38 essentially matches optimal syndrome decoding, while learned BF converges to near-optimal performance for RM39 and BCH40; for RM41, learned BF is virtually identical to standard BF with 42. With fitted Q-learning, neural-network LBF closely tracks tabular Q for RM43, and for BCH44 with 45 it is within about 46 of optimal at 47. On AWGN, WBF with 48 lies within about 49–50 of order-3 OSD, and sort-and-discard LBF for RM codes performs close to WBF, closing a substantial fraction of the gap to OSD even though reliabilities are discarded after permutation (Carpi et al., 2019).
6. Threshold selection and two-iteration SGBF for regular binary codes
For 51-regular binary codes, SGBF has also been studied as a parallel hard-decision decoder with explicitly optimized thresholds. Let 52 be the unsatisfied parity-check counter for variable 53. In iteration 54, bit 55 is flipped if 56. The syndrome guides the thresholds themselves: the first threshold is a function of the initial syndrome weight 57, and the second threshold is a function of
- 58: the number of checks satisfied in 59 that became unsatisfied in 60,
- 61: the number of checks unsatisfied in 62 that remained unsatisfied in 63, so that 64 (Annechini et al., 23 Jan 2025).
The first threshold is chosen by minimizing the expected residual discrepancy after iteration 1:
65
where
66
The second threshold is chosen as
67
using a model that conditions on the observed syndrome evolution after the first iteration (Annechini et al., 23 Jan 2025).
A distinctive contribution is the parity-aware model for the initial syndrome weight. Under the independence approximation,
68
but because the syndrome is the XOR of 69 columns of weight 70, the parity of 71 must equal the parity of 72. Conditioning the binomial on that parity produces a tighter finite-length fit. The post-first-iteration syndrome is modeled through a non-homogeneous Markov chain for 73, which is then used to compute the second-iteration flip probabilities and the overall two-iteration DFR (Annechini et al., 23 Jan 2025).
The practical conclusions are explicit. Dynamic thresholds are recommended, static majority thresholds are suboptimal, and 74 grows almost linearly with 75. For a BIKE-like QC-MDPC rate-76 set with 77, 78, 79, 80, 81, and 82, the model gives
83
together with
84
so the first threshold lies near the mid-separation, approximately 85–86, but is optimized per observed 87. The paper reports that two-iteration SGBF reduces the average residual discrepancies by approximately 88 to 89 compared to BIKE’s syndrome-weight-dependent thresholds with margin 90, and yields dramatic DFR improvements over majority thresholds across LDPC and MDPC densities (Annechini et al., 23 Jan 2025).
7. Trapping sets, near-codewords, and QC-MDPC-specific SGBF
A persistent limitation of bit-flipping decoders is their sensitivity to trapping sets. For QC-MDPC codes, the most relevant trapping sets are near-codewords, defined for a double-circulant parity-check matrix 91 by
92
Each near-codeword induces a syndrome of Hamming weight exactly 93. For a 94-almost near-codeword, the decoder is prone to confuse true errors on the near-codeword support (“bad bits”) with non-errors lying on the same support (“suspicious bits”). The paper gives the approximation, for 95,
96
so when 97, suspicious bits have larger counters than bad bits and a standard threshold near 98 tends to flip the wrong positions, increasing overlap with the near-codeword (Baldelli et al., 20 Apr 2026).
The proposed remedy is decoder-agnostic and minimal. After each baseline BF iteration, the decoder checks whether the residual syndrome has weight 99. If so, it tests whether
00
using a lookup table 01 containing the supports of the 02 near-codeword syndromes. On a match, the decoder flips the support of the corresponding near-codeword 03, which sets 04 and returns success. The extra cost is one conditional per iteration and, when 05, a single binary search over sorted supports (Baldelli et al., 20 Apr 2026).
The storage and time bounds are explicit. The lookup table requires
06
bits, and each access costs
07
comparisons. For BIKE NIST Category 1 parameters 08, 09, and 10, the memory is approximately
11
which the paper describes as negligible relative to the per-iteration BF cost 12 for QC-MDPC (Baldelli et al., 20 Apr 2026).
The empirical effect is concentrated in the floor region. On toy codes with 13 and 14, the near-codeword-aware modification reduces the DFR for BF-Max, Majority-Logic Decoding, and Out-of-Place BF, with the largest gains for BF-Max. On BIKE Category 1 parameters, the modified BF-Max, BGF, and BIKE-flip all benefit substantially, especially for large overlap 15; most notably, the modified BF-Max has zero observed decoding failures across all tested 16 values, that is, 17 failures per 18, and outperforms the two decoders used by BIKE within the NIST competition (Baldelli et al., 20 Apr 2026).
A common misconception is that SGBF is inherently a single hard-decision heuristic with a fixed unsatisfied-check counter. The published record shows a broader picture. SGBF has served as a classical counter-based decoder, a reliability-weighted LDPC decoder, a dynamic reliability-tracking framework, a learned sequential policy, a threshold-adaptive MDPC decoder, a near-codeword-aware QC-MDPC recovery mechanism, and a post-failure list re-decoding stage attached to LNMS for FDPC codes. What remains invariant is not the score itself, but the use of syndrome structure as the primary guide for deciding which bit positions, or candidate bit positions, are most likely responsible for residual inconsistency.