Hybrid Mamba-Transformer Decoder for Error-Correcting Codes

Shy-el Cohen, Yoni Choukroun, Eliya Nachmani · DOI

Abstract

Error-correcting codes (ECC) are fundamental to modern digital communication, ensuring data integrity across noisy channels. While deep learning decoders, particularly Transformers, have achieved state-of-the-art accuracy, their quadratic computational complexity poses challenges for high-speed, real-time systems. We present ECCM (Error Correction Code Mamba), a hybrid neural decoder that integrates the linear-time efficiency of Mamba (State-Space Models) with the global receptive field of Transformers. By employing bi-directional processing, domain-specific parity-check masking, and an early-exit mechanism, ECCM achieves superior decoding accuracy and significant inference speedups over existing models.

Introduction

Digital communication systems rely on ECCs like BCH, Polar, and LDPC to recover messages from noise. Traditional algorithms like Belief Propagation are efficient but often sub-optimal for certain code structures. Recent "model-free" neural decoders have shown that Transformers can learn complex global dependencies, yet their computational overhead remains a bottleneck. The ECCM architecture aims to bridge this gap by combining the strengths of sequential state-space models and attention-based global modeling.

Methodology: The ECCM Architecture

The core of ECCM is a hybrid stack that alternates between Mamba and Transformer layers. This design ensures that the model maintains a global context while benefiting from the efficiency of linear-time sequential processing.

Overview of the ECCM architecture, including the hybrid block structure, Mamba block details, and output processing for early exit.

Bi-Directional Mamba and Parity-Check Masking

Unlike natural language, codewords do not have a strict temporal order. To address this, ECCM utilizes a bi-directional Mamba block that processes data in both forward and backward directions. Crucially, the model incorporates a novel masking strategy, $f(H)$, derived from the code's parity-check matrix $H$. This mask restricts interactions within the Mamba blocks to bits that share a parity check, effectively embedding the code's mathematical structure into the learning process.

Detailed structure of the bi-directional Mamba block featuring parity-check matrix-based masking $f(H)$.

Progressive Loss and Early Exit

To optimize inference, ECCM employs a progressive layer-wise loss. The model is supervised at every layer, allowing for an "Early Exit" strategy. If a middle layer successfully decodes the codeword—verified via a syndrome check—the computation halts immediately. This significantly reduces average latency, especially in high Signal-to-Noise Ratio (SNR) environments where errors are infrequent.

Experimental Setup

The ECCM model was evaluated on a diverse set of binary linear block codes, including BCH, Polar, LDPC, and MacKay codes, with block lengths up to $N=128$. Performance was measured in an Additive White Gaussian Noise (AWGN) channel using BPSK modulation.

Results and Discussion

ECCM demonstrates significant improvements in both accuracy and efficiency:

  • Accuracy: The model consistently outperforms state-of-the-art decoders like ECCT and CrossMPT. For BCH(63,45) codes, ECCM achieved an 18% improvement in the negative natural log of the Bit Error Rate (BER).
  • Efficiency: On an NVIDIA RTX 4090, ECCM was approximately 3x faster than CrossMPT for LDPC(49,24) codes, reducing latency from 222.57 $\mu$s to 72.08 $\mu$s.
  • Robustness: The architecture maintains high performance across various SNR levels (4dB to 6dB).

Conclusion

ECCM represents a significant step forward in neural ECC decoding by successfully balancing accuracy and computational efficiency. Future work will explore scaling the architecture to longer codewords, extending it to non-binary codes, and optimizing it for resource-constrained hardware deployment.

Summary updated

BibTeX
@misc{cohen2025hybrid,
  author = {Shy-el Cohen and Yoni Choukroun and Eliya Nachmani},
  title = {{Hybrid Mamba-Transformer Decoder for Error-Correcting Codes}},
  year = {2025},
  eprint = {2505.17834},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2505.17834},
}
Figure