NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Error Correction Code Transformer

Yoni Choukroun, Lior Wolf

Error correction codes are a fundamental component of the physical communication layer, ensuring the reliable transfer of data over noisy channels. While optimal decoding is theoretically NP-hard, classical algorithms like Belief Propagation (BP) have long been the industry standard. Recently, neural decoders have shown the potential to outperform classical techniques, but they often struggle with severe overfitting or restrictive inductive biases.

This paper introduces the Error Correction Code Transformer (ECCT), the first Transformer architecture designed specifically for the soft decoding of linear error correction codes. By combining a novel reliability-scaled embedding with a custom self-attention mask based on the code's parity check matrix, the model shatters previous state-of-the-art neural decoding benchmarks while requiring a fraction of the computational complexity.

What Problem Does This Paper Address?

Researchers have increasingly tried using deep learning to build better decoders for noisy channels. However, these attempts generally fall into two traps:

  1. Model-based decoders: These approaches simply unroll classical BP algorithms into neural networks. While easy to train, they are bottlenecked by the restrictive inductive bias of the underlying Tanner graph (the bipartite graph defining the code).
  2. Model-free decoders: These use standard MLPs or RNNs to learn decoding from scratch. However, they suffer from the curse of dimensionality—the number of possible codewords grows exponentially with the message size. This causes severe overfitting and makes it incredibly difficult for the network to learn the actual algebraic rules of the code.
The standard communication pipeline featuring the neural decoder.

This paper bridges the gap, proposing a model-free Transformer that successfully injects the rigorous domain knowledge of algebraic coding directly into its architecture, avoiding both restrictive graph biases and exponential overfitting.

Methods

The authors adapt the standard Transformer architecture with three major innovations tailored specifically for error correction:

  • Smart Preprocessing: To avoid the exponential cost of training on all possible codewords, the model preprocesses the channel output into its absolute magnitude and its binary syndrome (which indicates if errors are present). This makes the network mathematically invariant to the transmitted codeword, meaning it can be trained entirely on a noisy "zero codeword."
  • Positional Reliability Encoding: Instead of standard positional embeddings, the model projects each bit into a high-dimensional space and scales it by the magnitude of the channel output. This acts as a "reliability" encoding: if a received bit is highly corrupted (low magnitude), its embedding vanishes toward zero, naturally telling the attention mechanism to ignore it.
  • Code-Aware Masked Self-Attention: Standard Transformers use $O(n^2)$ all-to-all attention, which is computationally heavy and ignores the structure of the code. The authors introduce a custom attention mask derived directly from the code's parity check matrix. Bits are only allowed to attend to other bits that share a parity check equation.
Relationship between the Parity Check Matrix, the Attention Mask, and the Tanner Graph.

Key Insights and Ideas

  • The Power of the Mask: By hardcoding the parity check matrix into the attention mask, the model gets the best of both worlds. It retains the flexible, powerful learning dynamics of a Transformer, but doesn't have to waste time "learning" the rules of the code from scratch.
  • Beyond the Tanner Graph: Traditional Belief Propagation passes messages strictly back and forth between variable nodes and check nodes. The masked self-attention mechanism allows for a "two-ring" connectivity, enabling the model to simultaneously cross-analyze related bits in a way that classical BP cannot.
  • Sparsity Equals Speed: The code-aware mask isn't just an accuracy booster; it acts as a massive computational shortcut. Because error correction codes (like LDPC) are inherently sparse, the mask drops the quadratic bottleneck of self-attention down to a highly sparse operation, making Transformers viable for this domain.

Key Results

The model was trained and evaluated on simulated data using an Additive White Gaussian Noise (AWGN) channel across three standard families of linear block codes: Polar codes, BCH codes, and LDPC codes.

  • Accuracy: The ECCT outperforms existing state-of-the-art neural decoders (like Autoregressive BP) by large margins, improving the Bit Error Rate (BER) by up to two orders of magnitude at high Signal-to-Noise Ratios (SNRs).
  • Efficiency: The model achieves these SOTA results using incredibly shallow architectures (e.g., just 2 to 6 Transformer layers). In contrast, competing BP-based neural networks require up to 50 iterations (effectively a 100-layer network) to converge.
  • Complexity Reduction: The code-aware masking technique reduces the standard self-attention computational complexity by an average of 84% across the tested codes. Furthermore, ablation studies showed that using the mask reduced the training loss by roughly 70% compared to an unmasked Transformer.

Limitations and Future Work

While the proposed Transformer is highly efficient compared to other neural decoders, the authors acknowledge that it still requires more memory, power, and computational resources than highly optimized, non-learning hardware decoders (like dedicated ASICs).

For future work, they suggest applying neural network acceleration techniques—such as pruning and quantization—to bridge this gap and make the Transformer viable for actual deployment in physical communication layers.

Summary updated

BibTeX
@inproceedings{choukroun2022error,
  author = {Yoni Choukroun and Lior Wolf},
  title = {{Error Correction Code Transformer}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2022},
  url = {https://openreview.net/forum?id=4F0Pd2Wjl0},
}
Figure