The Sign Code: The Hidden Binary Nature of Deep Networks

Niclas Alexander Göring, Shuofeng Zhang, Roi Holtzman, Yoonsoo Nam, Ard A. LouisNeurIPS 2026

TL;DR

We usually think of deep neural networks as continuous machines, carefully sculpting subtle numerical activations across millions of floating-point weights. This paper reveals that beneath that continuous surface, overparameterized vision networks are secretly acting like discrete binary routers: whether a neuron outputs a positive or negative number—its sign—matters vastly more than the actual size of that number. In fact, you can replace every single activation magnitude in a ResNet with random noise, and as long as you keep the original signs intact, the network barely breaks a sweat.

What Problem Does This Paper Address?

For years, theorists loved studying ReLU networks because they chop input space into clean, piecewise-linear regions—each neuron is either "on" or "off," acting like a binary gate. Modern architectures, however, have largely moved on to smooth activations like GELU, SiLU, and tanh, which don't have neat linear regions, causing those theoretical tools to break down.

The authors ask a fundamental question: does that underlying binary structure survive the move to smooth activations? Every neuron’s output in a "sign-preserving" activation (where positive inputs stay positive and negative stay negative, like ReLU, SiLU, GELU, and tanh) can be split into two parts: its binary sign ($\{-1, +1\}$, telling you which side of the neuron's hyperplane an input lands on) and its continuous magnitude (telling you how far from the hyperplane it is). The authors investigate which of these two channels actually carries the classification signal and drives generalization.

Decomposing neuron outputs into binary signs and continuous magnitudes reveals a massive asymmetry when perturbed.

Methods

To disentangle the role of signs versus magnitudes across Feedforward Networks (FFNNs), CNNs, ResNets, and Vision Transformers (ViTs), the authors design four clever probes:

  • Sign-$k$NN: They throw away the network's final weights, logits, and activation magnitudes, keeping only the binary sign vector of the last hidden layer. They then classify test images using a simple $k$-nearest neighbor vote based on Hamming distance (counting how many signs differ).
  • Soft Nearest-Codeword Posterior: To compare test losses and data scaling laws (which require probabilities rather than hard votes), they weight training sign codes exponentially by their Hamming distance to form a probability distribution.
  • Channel-Isolating Interventions: In Intervention 1, they randomly flip a fraction $\alpha$ of neuron signs and let the corruption cascade. In Intervention 2, they cache the clean signs from a normal forward pass, replace a fraction $\alpha$ of magnitudes at every layer with random $| \mathcal{N}(0,1) |$ noise, and enforce the clean signs downstream to see if magnitudes are needed at all.
  • Within-Class Sign Repulsion ($\mathcal{L}_{\text{rep}}$): To test generalization, they introduce a differentiable regularizer during training that actively pushes same-class examples to have different sign codes, while measuring local sign-code clustering using a train-only neighborhood metric ($Q$).

Datasets

The authors train and evaluate their models on standard small-scale vision classification benchmarks: MNIST, SVHN, CIFAR-10, and CIFAR-100. No new datasets are introduced.

Key Insights and Ideas

  • Overparameterization triggers a binary phase transition: In shallow or narrow networks, discarding magnitudes hurts accuracy. But once a network is sufficiently wide and deep, the "sign gap" vanishes—the binary sign code of the last layer alone contains enough information to match the full continuous model.
  • Depth builds the margin; width builds the resolution: Using a geometric margin argument, the authors explain why overparameterization makes networks binary. Depth separates classes in representation space (creating a margin), while width adds more hyperplane "cuts," shrinking the geometric cells until binary Hamming distance accurately resolves continuous distances.
  • Routing dominates raw strength: Deep networks—especially residual ones—behave less like analog signal processors and more like discrete routing circuits. Knowing which side of each hyperplane an input falls on throughout the network renders the exact distances largely redundant.
  • Generalization lives in shared sign geometry: A network can memorize training data using arbitrary, fragmented sign codes. True generalization happens when inputs of the same class share coherent, neighboring sign codes.
Figure 2: a) The sign gap ∆sgn (Eq. 6) as a function of network depth and width for three architectures (FFNN, ResNet, ViT) with SiLU on CIFAR-10. The gap shrinks with increasing depth and width, with a clear phase boundary (yellow lines) beyond which ∆sgn < 0.03. b) Sign-kNN accuracy versus full model test accuracy across standard architectures (rows: FFNN, ResNet-18, ViT), activations (columns: ReLU, SiLU, GELU, Tanh), and datasets (colours: MNIST, CIFAR-10, CIFAR-100). The dashed line is y=x. Training and model details for all figures are in Appendix E.

Key Results

  • Informational Sufficiency: Across 540 overparameterized models (FFNN, ResNet-18, ViT across 4 activations and 3 datasets), last-layer Sign-$k$NN matches full model test accuracy, with the error gap $\Delta_{\text{sgn}}$ dropping below 0.03 past the depth–width phase boundary.
  • Scaling Laws Match: Across 89 networks trained on data ladders from 2k to 65k images, the sign code's calibrated negative log-likelihood stays within 15% of the full network's loss, and its power-law scaling exponents agree within 15%.
The binary sign code's error exponent closely tracks the full continuous network's data scaling exponent across architectures.
  • Perturbation Asymmetry: Flipping just 20% of neuron signs ($\alpha = 0.2$) collapses test accuracy to near random chance (~10%) across all architectures and activations. Conversely, replacing 100% of magnitudes in every layer with random noise ($\alpha = 1$) leaves ResNet-18 on CIFAR-10 at ~90% accuracy across all four activations.
  • Generalization Collapse: Adding the sign-repulsion regularizer $\mathcal{L}_{\text{rep}}$ to a SiLU network on SVHN leaves training accuracy near 98%, while test accuracy and the train-only sign coherence metric $Q$ (which correlates with test accuracy at Spearman $\rho = 0.92$) plummet together.

Limitations and Future Work

The authors note several clear boundaries to their work:

  • Scope of tasks and scale: All empirical evidence comes from small-scale vision classification benchmarks. Whether the sign code dominates in large-scale vision, regression tasks, or autoregressive language modeling remains an open question.
  • Activation constraints: The framework strictly targets sign-preserving activations (excluding functions like Softplus, which is strictly positive).
  • Theoretical gaps: While their theory proves how width resolves distances for random hyperplanes given a separated representation, the comparison to trained neurons is empirical, and the theory does not explain why gradient descent creates class separation across depth in the first place.

Summary updated

Abstract

Every neuron in a trained network outputs a number that can be separated into its sign (positive or negative) and its magnitude (absolute size). We call the set of all neuron signs the \textit{sign code}. This raises a key question: does classification depend more on the sign code or on the magnitudes? For overparameterized vision classifiers with sign-preserving activations, the answer is overwhelmingly the sign code. A $k$-nearest neighbor classifier operating only on this binary sign code achieves accuracy comparable to the full model across different architectures, activation functions, and datasets. Moreover, replacing all magnitudes in every layer with random noise while keeping the original signs barely changes residual network performance. In contrast, flipping just 20\% of the signs reduces accuracy to near chance. Models generalize well when same-class inputs share similar sign codes. When this overlap is disrupted by a regularizer, training accuracy remains high, but test performance collapses. A margin argument helps explain when the sign code suffices. The natural unit of analysis for these networks may not be through their continuous weight space but instead through their discrete sign codes.
BibTeX
@inproceedings{goring2026sign,
  author = {Niclas Alexander Göring and Shuofeng Zhang and Roi Holtzman and Yoonsoo Nam and Ard A. Louis},
  title = {{The Sign Code: The Hidden Binary Nature of Deep Networks}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=4WN4vV8RCR},
}
Figure