The Sign Code: The Hidden Binary Nature of Deep Networks
Organizations: Rudolf Peierls Centre for Theoretical Physics, University of Oxford, Oxford, UK · Kim Jaechul Graduate School of AI, KAIST, Seoul, South Korea
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 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 -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 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 decomposition helps explain these results: the sign-only contribution to each logit grows as in network width, dominating the magnitude residual. The natural unit of analysis for these networks may not be through their continuous weight space but instead through their discrete sign codes.
Figures & tables
Appendix figures & tables8 assets
Supplementary material from the paper’s appendix.
Appendix
| Architecture | Tensor | Code type | Full | § Section 3 |
| FFNN | Layer sign | ✓ | last only | |
| Output logits | — | |||
| ResNet | Stem ReLU output | Stem | ✓ | |
| Int. | ✓ | |||
| Out. | ✓ | last only | ||
| Avgpool / fc | — |
| SiLU | Tanh | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Width | Depth | ||||||||
| 64 | 6 | 0.94 | 8.39 | 1.46 | 0.007 | 0.84 | 0.86 | ||
| 64 | 12 | 0.93 | 6.53 | 1.44 | 0.003 | 0.89 | 1.00 | ||
| 256 | 6 | 0.86 | 3.68 | 1.40 | 0.000 | 0.87 | 1.26 | ||
| 256 | 12 | 0.71 | 1.82 | 2.53 | 0.001 | 0.75 | 1.17 | ||
| 1024 | 6 | 0.55 | 1.19 | 2.08 | 0.001 | 0.65 | 0.98 | ||
| Configuration | Sign causal (§ 4 ) | Sign-kNN tracks accuracy (§ 3.1 ) | certifies |
|---|---|---|---|
| FFNN + SiLU/GELU/ReLU | ✓ | ✓ | ✓ |
| FFNN + Tanh | ✓ | ✓ | × (small ) |
| ResNet-18 + SiLU | ✓ | ✓ | × (skip connections) |
| ViT + GELU | ✓ | ✓ | not tested |
Neural Network Generalization
Neural network generalization studies why trained models perform well on unseen data and how architecture, data, and training shape that ability.
See all 299 papers