Neural Classifiers as Error-Correcting Codes

Sergey Salishev, Anton Makarov, Oleg Granichin, Renata Avros, Zeev Volkovich · DOI

This paper provides a rigorous theoretical bridge between deep learning and classical information theory. The authors propose a unified framework that treats supervised classification as the process of decoding Error-Correcting Codes (ECC) in the sense of Claude Shannon. By recasting neural networks as communication channels, they show that standard components like softmax, cross-entropy, and the "Neural Collapse" phenomenon are not just empirical successes but optimal implementations of maximum-likelihood decoding.

TL;DR

Deep neural classifiers are mathematically equivalent to decoders for error-correcting codes, where the network learns to map inputs to "codewords" in a latent feature space. This perspective proves that cross-entropy optimization implicitly minimizes Hamming distances to class-specific codes, providing a geometric explanation for why deep models are so robust to noise and quantization.

What Problem Does This Paper Address?

Despite the ubiquity of deep learning, we often lack a "first principles" explanation for why certain architectural choices work so well. Why does the cross-entropy loss lead to such stable decision boundaries? Why do the features of a class "collapse" into a simple simplex geometry at the end of training (a phenomenon known as Neural Collapse)?

Previous attempts to link classification to coding theory, such as Error-Correcting Output Codes (ECOC), were often limited to the output layer and required manually designed codebooks. This paper addresses the gap by showing that the entire network acts as a sequence of noisy communication channels, and the "codebook" is something the network learns to build implicitly in its feature space.

Methods

The authors formalize classification as a transmission problem (see Figure 1). A "True Class" $x$ (the message) is encoded into a feature representation $c_x$ (the codeword), which is then corrupted by "Noise" $\xi$ (intra-class variability, occlusions, etc.) to produce the observed signal $y$.

Figure 1: Classification as a transmission model

Key theoretical contributions include:

  • Divergence as Distance: They prove that minimizing the Jeffreys divergence (a symmetric version of KL divergence) between predicted and true labels is mathematically equivalent to minimizing the Hamming distance between binary features.
  • Softmax as an ML Decoder: They show that a standard linear layer followed by a softmax function effectively implements a Maximum Likelihood (ML) decoder. In this view, the logits are not just scores; they are linearly transformed negative Hamming distances to the "ideal" class codewords.
  • Semantic Inversion: To test the informativeness of these "codewords," the authors developed a method to reconstruct images from the latent representations of a pre-trained RegNet by matching distributions via Jeffreys divergence.

Datasets

  • Synthetic Bernoulli Channel: Used to verify that cross-entropy training can recover a Bayes-optimal Hamming decoder from scratch using random binary codebooks.
  • ImageNet: Used for the "semantic inversion" experiments, where the authors reconstructed recognizable images from the latent codes of a 65-layer RegNet-3.2GF model.

Key Insights and Ideas

  • The Platonic Analogy: The authors compare classes to "Platonic Forms." A class like "table" is an ideal essence; every specific image of a table is a noisy, imperfect manifestation of that Form. The neural network's job is to strip away the "appearance" (noise) to recover the "form" (the codeword).
  • Neural Collapse is Optimal Packing: The "simplex" geometry observed in Neural Collapse is identified as the optimal way to arrange signals in Euclidean space to maximize inter-class distance—exactly what coding theory suggests for maximizing noise immunity.
  • Implicit Codebooks: Unlike classical ECOC, deep networks don't need a pre-defined codebook. They learn to partition the feature space into semantically coherent clusters that function as robust codewords.
  • Redundancy is Robustness: Increasing a network's width or depth is analogous to increasing the "code length" in ECC. This added redundancy allows the model to remain accurate even when its weights or activations are heavily quantized (compressed).

Key Results

  • Decoder Agreement: In synthetic tests, the learned softmax decoder's performance closely matched the Bayes-optimal Hamming decoder, especially in low-to-moderate noise regimes.
  • Semantic Fidelity: In the ImageNet inversion experiments, reconstructed images preserved high-level semantics (e.g., the "orangeness" of an orange or the "banananess" of a banana) even though they were not pixel-identical to the originals.
  • Human Evaluation: In a study with five independent raters, humans correctly identified that the reconstructed images belonged to the same category as the originals in 75.8% of cases, supporting the idea that the latent "codewords" capture essential semantic forms.

Limitations and Future Work

  • Dominant Codeword Assumption: Much of the theory relies on the "dominant codeword" regime, where the likelihood is concentrated on a single ideal representation. This may not hold in cases of extreme noise or highly ambiguous data.
  • Quantization Recipes: While the framework explains why quantization works, it does not yet provide a specific "recipe" or set of architectural constraints that guarantee 100% lossless quantization for any given model.
  • Self-Supervised Extension: The authors suggest this framework naturally extends to models like LeJEPA and VAEs, but more empirical work is needed to see if this perspective can improve the training of generative models.

Summary updated

Abstract

A unified framework is proposed that characterizes supervised deep classification as the decoding of error-correcting codes in the Shannon sense. Cross-entropy optimization is shown to align softmax classifiers with maximum-likelihood decoding, where logits map to Hamming distances to class-specific codewords. This correspondence explains the emergence of standard divergence objectives (e.g., Kullback-Leibler, Jeffreys) and provides a geometric basis for the stability of decision boundaries. Furthermore, the geometries of Neural Collapse and LeJEPA are identified as optimal constellations for decoding under isotropic noise. Unlike classical Error-Correcting Output Codes, deep networks are shown to learn effective codebooks in the feature space implicitly. This insight is leveraged to derive novel criteria for lossless quantization, improved knowledge distillation, and architectural regularization based on code redundancy. Finally, this perspective is extended to self-supervised encoders, offering a cohesive explanation for the geometry of latent representations in modern neural models.
BibTeX
@misc{salishev2026neural,
  author = {Sergey Salishev and Anton Makarov and Oleg Granichin and Renata Avros and Zeev Volkovich},
  title = {{Neural Classifiers as Error-Correcting Codes}},
  year = {2026},
  eprint = {2611.18239},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.18239},
}
Figure