The Discrete Charm of the MLP: Binary Routing of Continuous Signals in Transformer Feed-Forward Layers
Abstract
We show that MLP layers in transformer language models perform binary routing of continuous signals: the decision of whether a token needs nonlinear processing is well-captured by binary neuron activations, even though the signals being routed are continuous. In GPT-2 Small (124M parameters), we find that specific neurons implement a consensus architecture -- seven "default-ON" neurons and one exception handler (N2123 in Layer 11) that are 93-98% mutually exclusive -- creating a binary routing switch. A cross-layer analysis reveals a developmental arc: early layers (L1-3) use single gateway neurons to route exceptions without consensus quorums; middle layers (L4-6) show diffuse processing with neither gateway nor consensus; and late layers (L7-11) crystallize full consensus/exception architectures with increasing quorum size (1 to 3 to 7 consensus neurons). Causal validation confirms the routing is functional: removing the MLP at consensus breakdown costs 43.3% perplexity, while at full consensus removing it costs only 10.1% -- exceeding a 4x difference. Comparing binary vs. continuous features for the routing decision confirms that binarization loses essentially no information (79.2% vs. 78.8% accuracy), while continuous activations carry additional magnitude information (R^2 = 0.36 vs. 0.22). This binary routing structure explains why smooth polynomial approximation fails: cross-validated polynomial fits (degrees 2-7) never exceed R^2 = 0.06 for highly nonlinear layers. We propose that the well-established piecewise-affine characterization of deep networks can be complemented by a routing characterization: along the natural data manifold, the piecewise boundaries implement binary decisions about which tokens need nonlinear processing, routing continuous signals through qualitatively different computational paths.
Figures & tables
| Layer | Deg 2 | Deg 3 | Deg 4 | Deg 5 | Deg 6 | Deg 7 |
|---|---|---|---|---|---|---|
| L9 | 0.062 | 0.041 | 0.041 | 0.034 | 0.022 | 0.022 |
| L11 | 0.170 | 0.248 | 0.260 | 0.262 | 0.202 | 0.208 |
| Clustering Method | Avg Val | Best Cluster |
|---|---|---|
| KMeans (input) | 0.068 | 0.021 |
| KMeans (delta dir.) | 0.023 | 0.008 |
| KMeans (joint) | 0.061 | 0.020 |
| Spectral (delta dir.) | 2.182 | 0.013 |
| UMAP + KMeans | 0.030 | 0.021 |
| Neuron | Linear % | High-NL % | Semantic Role | |
|---|---|---|---|---|
| 2123 | 0.4% | 80.7% | +80.3 | Exception handler |
| 2 | 99.1% | 26.1% | 73.0 | General punctuation |
| 2361 | 93.2% | 22.6% | 70.6 | Subordinate clauses |
| 2460 | 86.1% | 19.8% | 66.3 | Content words |
| 2928 | 80.4% | 16.2% | 64.2 | Default-ON |
| 1831 | 79.9% | 17.7% | 62.2 | Default-ON |
| Neuron Pair | Both Fire | Union Fire | Exclusivity |
|---|---|---|---|
| 2123 vs N2 | 18,259 | 429,427 | 95.7% |
| 2123 vs N2361 | 21,792 | 394,781 | 94.5% |
| 2123 vs N2460 | 14,199 | 436,944 | 96.8% |
| 2123 vs N2928 | 18,846 | 473,231 | 96.0% |
| 2123 vs N1831 | 8,522 | 394,259 | 97.8% |
| 2123 vs N1245 | 12,471 | 439,196 | 97.2% |
| Threshold | N2123 FR | Def-ON FR | Exclusivity | Monotonic | Range |
|---|---|---|---|---|---|
| 0.01 | 13.1% | 79.2% | 94.1% | ✓ | 96.4pp |
| 0.05 | 12.2% | 77.2% | 95.0% | ✓ | 95.9pp |
| 0.10 | 11.3% | 74.5% | 95.8% | ✓ | 94.3pp |
| 0.50 | 7.9% | 50.9% | 98.5% | ✓ | 66.3pp |
| 1.00 | 6.2% | 23.4% | 99.3% | ✓ | 23.0pp |
| Layer | Phase | Mean | Exception | Excl. | #Cons | Gateway | Monotonic |
| 0 | Scaffold | 10.9 | N2053 (9%) | 94% | 1 | — | ✓ |
| 1 | Scaffold | 8.2 | — | — | — | N2882 (19/20) | |
| 2 | Scaffold | 11.4 | — | — | — | N2380 (20/20) | |
| 3 | Scaffold | 11.7 | — | — | — | N746 (17/20) | |
| 4 | Diffuse | 11.9 | — | — | — | — | |
| 5 | Diffuse | 13.9 | — | — | — | — |
| Consensus | N tokens | Base PPL | No-MLP PPL | % |
|---|---|---|---|---|
| 0 / 7 | 11,351 | 5.4 | 7.7 | +43.3% |
| 1 / 7 | 19,110 | 7.3 | 9.7 | +32.6% |
| 2 / 7 | 19,121 | 12.2 | 16.1 | +31.6% |
| 3 / 7 | 26,169 | 20.3 | 25.7 | +26.7% |
| 4 / 7 | 52,994 | 19.5 | 23.3 | +19.1% |
| 5 / 7 | 95,194 | 39.1 | 46.0 | +17.6% |
| Consensus | N | KL div | Boost | Rank |
|---|---|---|---|---|
| 0 / 7 | 11,351 | 0.414 | 1.15 | 33.9 |
| 1 / 7 | 19,110 | 0.338 | 1.08 | 45.1 |
| 2 / 7 | 19,121 | 0.315 | 1.05 | 22.4 |
| 3 / 7 | 26,169 | 0.290 | 1.03 | 12.3 |
| 4 / 7 | 52,994 | 0.238 | 0.97 | 8.4 |
| 5 / 7 | 95,194 | 0.222 | 0.94 | 9.9 |
Appendix figures & tables4 assets
Supplementary material from the paper’s appendix.
Appendix
| Consensus | Count | % | N2123 Fire Rate | Avg |
|---|---|---|---|---|
| 0 / 7 | 11,358 | 2.3% | 94.7% | 194.1 |
| 1 / 7 | 19,131 | 3.8% | 83.6% | 155.5 |
| 2 / 7 | 19,142 | 3.8% | 56.5% | 126.1 |
| 3 / 7 | 26,189 | 5.2% | 24.4% | 102.4 |
| 4 / 7 | 53,042 | 10.6% | 10.3% | 88.6 |
| 5 / 7 | 95,267 | 19.1% | 4.5% | 82.3 |
| Consensus | Count | % | N2123 Fire Rate | Avg Norm |
|---|---|---|---|---|
| 0 / 7 | 116,024 | 58.0% | 1.7% | 25.6 |
| 1 / 7 | 70,100 | 35.1% | 1.9% | 25.3 |
| 2 / 7 | 12,312 | 6.2% | 2.7% | 26.9 |
| 3 / 7 | 1,408 | 0.7% | 2.2% | 27.7 |
| Consensus | Count | % | N2123 Fire Rate | Avg Norm |
|---|---|---|---|---|
| 0 / 7 | 115,182 | 57.6% | 1.6% | 40.8 |
| 1 / 7 | 67,693 | 33.9% | 3.0% | 43.7 |
| 2 / 7 | 14,941 | 7.5% | 5.4% | 46.6 |
| 3 / 7 | 1,945 | 1.0% | 10.1% | 47.0 |
| 4 / 7 | 168 | 0.1% | 8.3% | 48.8 |
| PCA dims | ||||
|---|---|---|---|---|
| 10 | 0.038 | 0.039 | 0.037 | 0.029 |
| 20 | 0.042 | 0.043 | 0.040 | 0.031 |
| 50 | 0.041 | 0.041 | 0.038 | 0.030 |
| 100 | 0.039 | 0.038 | 0.035 | 0.028 |