Spectral-Aligned Pruning for Universal Error-Correcting Code Transformers

Sanghyeon Cho, Taewoo Park, Seong-Joon Park, Dae-Young Yun, Hee-Youl Kwak, Sang-Hyo Kim, Yongjune Kim

TL;DR

Foundation transformers can now decode nearly any digital error-correcting code using a single universal model, but they are far too heavy for real-world wireless receivers. This paper introduces Spectral-Aligned Pruning (SAP), a clever trick from classical graph theory that shrinks these bulky transformers by 40% without losing accuracy. Even better, by reducing a code's entire mathematical structure down to a two-number "fingerprint," SAP lets totally different codes share the exact same pruning blueprint.

What Problem Does This Paper Address?

Every digital message sent over Wi-Fi, 5G, or satellite relies on Error-Correcting Codes (ECCs)—like LDPC, Polar, or BCH codes—to reconstruct data corrupted by noisy channels. Historically, every code family needed its own custom-built decoding algorithm. Recently, researchers introduced the Foundation Error Correction Code Transformer (FECCT), a single neural network architecture capable of decoding almost any linear block code.

There's a catch: transformers are compute-hungry memory hogs, and your smartphone's modem operates on a strict energy and silicon budget. Structured pruning—physically slicing away redundant attention heads and feed-forward channels—is a great way to slim down a transformer. However, figuring out which parts to cut requires an expensive search process for each code. If a "universal" decoder has to support dozens or hundreds of codes with wildly different lengths and structures, computing and storing a custom-pruned model for every single one defeats the whole purpose of universality.

The authors ask: When can two completely different error-correcting codes safely share the same pruning mask?

Methods

Every linear error-correcting code is defined by a parity-check matrix, which can be visualized as a bipartite graph connecting message bits to parity-check equations. Because these graphs vary in size depending on block length and code rate, you can't compare two codes directly matrix-to-matrix.

Figure 1: Overview of SAP. For a target PCM, SAP computes a two-eigenvalue spectral signature, retrieves or derives a pruning mask through thresholded library matching, applies the selected mask to the common FECCT backbone, and performs code-specific LoRA recovery.

Here is how SAP bridges classical coding theory and modern model compression:

  • The Novel 2D Spectral Signature: Instead of comparing raw matrices, SAP computes the two largest eigenvalues ($\lambda_1, \lambda_2$) of the code's bipartite graph adjacency matrix. In spectral graph theory, $\lambda_1$ captures connection density (degree scale), the gap $\lambda_1 - \lambda_2$ measures how fast information mixes across the graph (expansion), and together they bound codeword separation (minimum distance). Every code—regardless of size—gets mapped to a tiny 2D coordinate: $[\lambda_1, \lambda_2]$.
  • Thresholded Mask Library: SAP maintains a small library of pre-computed structured pruning masks (originally derived via standard Fisher-information importance scores). When a new target code arrives, SAP checks the Euclidean distance between its 2D signature and the library entries. If a close match exists above a similarity threshold, SAP instantly reuses that neighbor's pruning mask. If the new code is an outlier, SAP computes a fresh mask and adds it to the library.
  • Standard Recovery via LoRA: Pruning inevitably dings decoding accuracy. Rather than fine-tuning and saving an entire pruned model per code, SAP freezes the shared backbone and trains tiny, code-specific Low-Rank Adaptation (LoRA) adapters using binary cross-entropy and knowledge distillation from the unpruned teacher model.

Datasets

In coding theory, data is generated synthetically on the fly rather than pulled from static files. All experiments simulate Binary Phase-Shift Keying (BPSK) modulation over standard Additive White Gaussian Noise (AWGN) channels:

  • Pretraining: All-zero codewords across 12 codes spanning BCH, LDPC, and Polar families ($E_b/N_0$ sampled from 2 to 7 dB).
  • SAP Reference Library: Initialized with just 6 standard codes: BCH (31,16), BCH (63,51), LDPC (96,64), LDPC (121,60), Polar (64,48), and Polar (128,86).
  • Evaluation: Tested on both seen and unseen code lengths/rates across BCH, LDPC, and Polar families, practical standardized 5G NR LDPC codes—such as LDPC (256, 224) and (320, 296)—and out-of-library families like Turbo and Reed-Muller codes. No new static benchmarks are introduced, though the multi-code pruning setup itself is a new evaluation protocol.

Key Insights and Ideas

  • Two eigenvalues tell the whole story: Across 46 diverse code pairs, spectral similarity correlates remarkably well with actual pruning-mask overlap (Pearson $\rho = 0.87$). Simple heuristics fail here: matching codes by family label only gets $\rho = 0.68$, and matching by code rate gets $\rho = -0.27$. Even cross-family reuse works—for instance, an unseen LDPC (32,16) code successfully borrows a BCH (31,16) mask!
  • Dimensionality sweet spot: Adding more eigenvalues to create higher-dimensional signatures selected the exact same library masks in evaluations as just using the top two.
  • Naive mask sharing breaks decoding: Pruning masks are not universally interchangeable. Forcing two spectrally distant codes—like LDPC (49,24) and Polar (64,32)—to swap masks noticeably degrades bit error rates, even after LoRA recovery. Graph alignment matters.

Key Results

  • Compute & Memory: At a 40% FLOPs structured pruning ratio, physically removing pruned heads and channels drops the active model size from 1.22M parameters to roughly 0.67M–0.73M.
  • Tiny Per-Code Storage: Instead of saving a full 1.22M-parameter model for every supported code, SAP stores one shared backbone plus per-code LoRA adapters that require only 0.086M–0.090M parameters (7.05% to 7.39% of the original model).
  • Zero Material Accuracy Loss: Across seen and unseen BCH, LDPC, and Polar codes at 4–6 dB, SAP's reused masks match dedicated per-code pruning masks almost identically (gaps in $-\ln(\text{BER})$ are near zero, mostly within $\pm 0.15$).
  • 5G Readiness: On longer 5G NR LDPC codes, SAP retrieves a short LDPC (96,64) library mask and matches both dedicated per-code pruning and classical 50-iteration Belief Propagation (BP) decoding.
Figure 3: Decoded BER on 5G NR LDPC codes. We compare BP with 50 iterations, dedicated per-code pruning with recovery, and SAP mask reuse with recovery.

Limitations and Future Work

While SAP skips the expensive mask-search phase for spectrally similar codes, it is not strictly "zero-shot" deployment—every new target code still requires a 100-epoch LoRA retraining stage (alongside teacher distillation) to recover post-pruning accuracy, and requires maintaining an unpruned copy of the FECCT backbone in storage to materialize different pruned subnetworks on demand. Looking ahead, the authors point toward combining SAP with complementary hardware-friendly optimizations like weight quantization (such as ternary weights) and architecture-level sparsification to push neural decoders closer to real-world silicon receivers.

Summary updated

BibTeX
@inproceedings{cho2026spectral,
  author = {Sanghyeon Cho and Taewoo Park and Seong-Joon Park and Dae-Young Yun and Hee-Youl Kwak and Sang-Hyo Kim and Yongjune Kim},
  title = {{Spectral-Aligned Pruning for Universal Error-Correcting Code Transformers}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=Y5hbfFtOH1},
}
Figure