Summary
Neural networks are widely assumed to use superposition to represent more features than they have dimensions. A stronger claim is that they also compute in superposition (CiS), i.e., implement more nonlinear functions than they have neurons (Hänni et al. 2024). CiS remains poorly understood, and until recently there were no examples of it arising through training rather than being hand-designed. Toy models of CiS are desirable for two reasons: they’re small enough that we can hope to fully reverse-engineer them, and they provide ground-truth solutions against which to test interpretability methods, in particular parameter decomposition methods like APD and SPD, which is what the compressed computation toy model of Braun et al. 2025 was originally built for. That model is a single hidden layer of 50 ReLU neurons that must compute the ReLU of each of 100 sparse input features. But Bhagat et al. 2025 then showed that the trained solution wasn’t actually computing in superposition: its advantage over naive baselines came from a mixing term introduced by the residual connection, not from sharing neurons across features.
In this work, we train a version of this model that does perform computation in superposition. Following Bhagat et al.’s analysis we drop the residual connection, and, the key change, we train under
We then reverse-engineer the solution: the encoder implements redundancy by assigning each feature a sparse binary codeword over 5–7 neurons, and the decoder is close to a scaled pseudoinverse of the encoder — each feature is read out along the same neurons that encode it. Given the codewords, a description with just three scalars (on-code value, off-code value, decoder scale) recovers most of the trained network’s performance (reaching
Key results
We train a toy model of compressed computation with
loss and argue that it performs computation in superposition.We reverse-engineer the trained network: it assigns each feature a sparse binary codeword over neurons and decodes it with a pseudoinverse of the encoder. Given these codewords, a 3-scalar parameterization (on-code value, off-code value, decoder scale) recovers
its loss.We validate this description by substituting hand-designed binary codes in the same 3-parameter family, yielding equivalent networks at
the trained model’s loss.
Why we think this matters
First, this gives one of the first toy models of computation in superposition arising through training rather than being designed by hand (concurrently with Gibson 2026, who studies a related but different task).
Second, it restores the compressed computation setup to its original purpose. It was built as a testbed for parameter decomposition methods, then shown not to contain the phenomenon it was meant to test them on. Now it does — and since we’ve reverse-engineered the solution, it comes with a known ground-truth mechanism to compare decompositions against, which is what we plan to use it for next.
The rest of this post is copied from the paper, except for the abstract and the list of contributions. Code is available at github.com/FranciscoHS/toy-model-cis-code.
Introduction
Neural networks are widely assumed to make use of superposition to represent more concepts than they have dimensions (Elhage et al., 2022). A natural follow-up is whether they also compute in superposition, i.e., implement more non-linear functions than they have dimensions (Hänni et al., 2024; Adler & Shavit, 2024).
While representation in superposition is increasingly well understood, computation in superposition (CiS) is not. In particular, until very recently (Gibson, 2026) there were no toy models of computation in superposition in the wild, i.e., arising through training rather than being hand designed. Such toy models are desirable: they allow studying CiS at a scale where we can hope to fully reverse engineer the trained networks.
Braun et al. (2025) introduced the toy model of compressed computation, where a single-hidden-layer network must compute more ReLUs than its hidden width. However, Bhagat et al. (2025) showed that this toy model did not actually elicit computation in superposition.
In this work, we train a version of the compressed computation toy model under
Related Work
Comparable empirical work. Gibson (2026) is concurrent work similar in spirit to ours: both partially reverse-engineer one-layer ReLU networks that learn binary codes, and the aspects that remain unexplained are nearly identical — non-uniform on-codeword values, a decoder that deviates from a scaled pseudoinverse, and a trained network that outperforms designed alternatives. The key difference is the task. Both networks take continuous sparse inputs, but ours has a regression task (compute the ReLU of each input), whereas Gibson’s network must identify which inputs are active, outputting a fixed value at each active index regardless of its magnitude.
Theoretical constructions for CiS. Gibson (2025) considers a task in which a continuous input passes through one of many small circuits sharing a single wider network, with exactly one circuit active per forward pass. They provide a hand-designed zero-error construction for computation in superposition via sparse memory blocks; we find a sparse-coding solution arising through training.
Random sparse binary codes. Hänni et al. (2024) proposes random sparse binary codes for computation in superposition. Our work appears to be an empirical instance of their constructions.
The compressed computation toy model. Braun et al. (2025) introduced the toy model of compressed computation, and Bhagat et al. (2025) showed that it does not elicit computation in superposition. We train a version of this model under
Methodology
Our network (Figure 1) is the compressed-computation toy model of Braun et al. (2025) with the residual connection removed (see below). The input is
Figure 1. Network architecture: a linear encoder
Beyond setting aside the incidental embedding, we also remove the residual connection, motivated by Bhagat et al. (2025)‘s analysis. They show that, in Braun et al.’s model, the residual connection is equivalent to a mixing matrix
The change we make that elicits CiS is the loss. We train under
Results
Evidence for computation in superposition
As evidence that
Figure 2. Per-feature MSE on
As there are more features than neurons, achieving low error on all features requires sharing neurons across features, i.e., superposition. Eliciting this solution is not unique to
The mechanism
We characterize the
Figure 3 shows the distribution of the entries of the encoder
The codewords are quite regular (Figure 4): every feature uses—
Figure 3. Encoder entries are bimodal: pooled histogram of all entries of the encoder
Figure 4. The binary code is regular: number of large encoder entries (those exceeding
If the codewords serve as the network’s internal identifier for each feature, then transplanting feature
Figure 5. Codeword swap test: the hidden magnitudes produced by feature
Finally, the decoder seems to do little more than invert the encoder: the decoder
Together, these findings paint the picture in Figure 6: a binary-code encoder followed by a pseudoinverse decoder. One feature of this picture is that the decoded output is attenuated: the network systematically under-shoots the true ReLU. This is a response to interference — because codewords overlap, an active feature leaks through its shared neurons into the outputs of the (far more numerous) inactive features, and shrinking every active output keeps that leakage small. The single-feature input–output response in Figure 12 (Appendix B) shows this directly.
Figure 6. Mechanism for a single active feature: the encoder produces large positives on the feature’s codeword neurons and small negatives elsewhere; ReLU zeros the negatives; the pseudoinverse decoder reads the codeword and outputs a peak at the same index.
A 3-parameter description given a binary code
The mechanism depicted in Figure 6 suggests a simple ansatz. We extract the binary codeword matrix
Fitting these three scalars to the trained network’s codewords gives an
The support carries little information. We test how much the specific support matters by replacing
Figure 7.
Figure 7 shows the result. Overlap minimization matters: without it both families sit at—
Open Questions
The three-scalar ansatz built from the trained codewords reaches
Table 1. What each ingredient accounts for. For each construction we list the encoder, the decoder, and the resulting
Encoder | Decoder | ||
|---|---|---|---|
Designed code (K=5), 3 scalars | random, no overlap-min. | pinv | 1.90× |
biregular, no overlap-min. | pinv | 1.67× | |
random, overlap-min. | pinv | 1.36× | |
biregular, overlap-min. | pinv | 1.12× | |
Trained support | 3 scalars | pinv | 1.13× |
free per-entry | pinv | 1.05× | |
3 scalars | trained | 1.06× | |
Trained encoder | full trained encoder | pinv | 1.15× |
trained (decoder tied to pinv) | pinv | 1.05× | |
full trained encoder | trained | 1.00× |
First, the per-entry encoder values. Replacing the two on/off scalars with the trained network’s individual entries, while still decoding with a scaled pseudoinverse, lowers the loss to
Second, the decoder. The trained decoder is close to a scaled pseudoinverse of the encoder (Frobenius cosine
Finally, it is unclear whether the trained network’s binary support is special at all: in the three-scalar family it is not, as a designed biregular
Together, these results account for most of the trained network’s performance and pin down its main mechanism — a sparse binary code decoded by a near-pseudoinverse — leaving the encoder’s specific per-entry values and the decoder’s small residual structure as the pieces we have not fully explained.
Discussion and Future Work
Our reverse-engineered network looks like an empirical instance of the random sparse binary codes that Hänni et al. (2024) propose for computation in superposition: through training it independently arrives at the sparse-code-over-neurons motif their constructions predict. The match is suggestive rather than exact, as their analysis targets Boolean U-AND while our network computes continuous ReLUs.
The original motivation for this toy model was a testbed for parameter-decomposition methods such as APD (Braun et al., 2025) and SPD (Bushnaq et al., 2025). Now that we have elicited superposition and reverse-engineered the network, we can and will use it as a ground-truth solution against which to test these and other interpretability methods.
More broadly, we would like to know how far this picture extends: to deeper and more realistic networks, and to more realistic kinds of computation than the elementwise ReLU studied here. Does superposition still arise once there are several layers and bottlenecks, can we still reverse-engineer the resulting solution, and does anything resembling the error-correction layers of Hänni et al. (2024) appear?
Appendix A: The embedded model
The main text studies a model in which the
Figure 8. Embedded architecture (cf. Figure 1). The input is embedded as random near-orthogonal directions in a
We retain the embedded variant because the compressed-computation toy model’s original purpose was as a testbed for parameter-decomposition methods such as APD (Braun et al., 2025) and SPD (Bushnaq et al., 2025), for which the non-axis-aligned features of the embedded model are the more challenging and realistic setting. For the narrower claim that the trained network computes in superposition, the axis-aligned model in the main text is cleaner: with axis-aligned input features there is no random embedding that could, even in principle, be credited with the network’s performance over the non-superposition baselines.
A.1 The embedded model reproduces the axis-aligned solution
We verify directly that adding the embedding changes nothing of substance. We train the embedded model under the same loss, optimizer, and schedule, and recompute every quantity from the main text. Table 2 reports the comparison. Across all of them — the per-feature loss spread, the codeword-length distribution, the swap test, the decoder’s agreement with a pseudoinverse, and the three-scalar description — the two models are quantitatively the same; even the three fitted ansatz scalars
Table 2. The solution is unchanged by adding the random embedding. Headline quantities for the axis-aligned model (main text) and an otherwise identical model trained with Braun et al. (2025)’s random embedding. CV is the coefficient of variation of the per-feature MSE across the
Quantity | Axis-aligned | Embedded |
|---|---|---|
Per-feature MSE CV ( | 0.031 | 0.031 |
Per-feature MSE CV ( | 0.999 | 0.999 |
Codeword length | 5-7 | 5-7 |
Swap-test pass rate | 100% | 99.9% |
Decoder–pinv cosine | 0.996 | 0.996 |
On/off-code value | +0.34 / −0.02 | +0.34 / −0.02 |
3-scalar ansatz ratio | 1.13× | 1.13× |
Figure 9. Embedded model, per-feature MSE (cf. Figure 2). As in the axis-aligned model, the emulate-bias baseline and
Figure 10. Embedded model, effective-encoder entries (cf. Figure 3). Pooled histogram of the entries of the effective encoder
Figure 11. Embedded model, codeword regularity (cf. Figure 4). Large-entry counts per feature column and per neuron row for the effective encoder; the code is close to biregular, as in the axis-aligned model.
A.2 Transpose versus pseudoinverse unembedding
The embedded model reads its output back out with the transpose
A.3 Other model sizes
To check that the solution is not specific to our
Appendix B: Output attenuation
Following Bhagat et al. (2025), we examine the network’s input–output response by driving a single feature
This attenuation is a response to interference. Because features are sparse (active with probability
Figure 12. Single-feature input–output response. For each feature
Appendix C: Codeword overlap minimization
When two features are active at once, their codewords interfere: neurons in both codewords receive contributions from both features, and the decoder must disentangle them. The size of this interference is set by the pairwise overlap
Let the pairwise overlap matrix be
At each iteration: sample two edges
We run
Interesting result.
Irrespective of training, the solution given in the post should theoretically work for fairly general as well, correct?
Suppose , with inputs , , and . [If can modify so that it is in an arbitrarily small region around the origin, while staying in required form]
Divide the network width into blocks of size .
Have the th feature write to a subset of blocks (With corresponding to the binary codewords in the post). [i.e: Write to the blocks so that if there are no collisions between active codewords, will be the contents of the block.]
Now apply the remainder of (apart from ) block-wise. And then read off as usual, while applying .
The blocks in without collisions will have computed exactly. And then we just need errors to not blow up on collided blocks. If we are told that the final hidden layer of is bounded on the typical input distribution then can append a truncation layer to bound how disruptive collided blocks can be.