Superposition in a toy model
Runs in your browser
Survey: §5.2 The Superposition Hypothesis
A network can represent more features than it has dimensions if the features are rarely active at the same time. This model has 5 input features and only 2 hidden dimensions. Drag the sparsity slider and retrain to see when it starts sharing dimensions.
With 2 dimensions the model keeps only the 0 most important features.
What is being computed
This is the ReLU-output toy model of Elhage et al. (2022): h = Wx, x′ = ReLU(Wᵀh + b). Training minimises importance-weighted reconstruction error, Σi Ii(xi − x′i)². Each feature is 0 with probability S and otherwise drawn from Uniform[0, 1]. Training is Adam (learning rate 0.01, batch 512) for 1,500 steps with a seeded random number generator, so the same settings give the same result every time.
Checked results (seed 1, importance decay 0.9, tested in tests/sim.test.ts): at S = 0 the model represents only 2 of 5 features, at S = 0.7 it represents 4, and at S = 0.9 it represents all 5. A feature counts as represented when ‖Wi‖ > 0.5. This reproduces the qualitative finding of the original paper: sparsity drives superposition.
Go further
- Notebook: Superposition Hypothesis · Open in Colab