betaFeedback

WorksComputer Science

The Ball and the Box: Two Geometries of Computation in Superposition

Abstract

Neural representations can encode more features than they have dimensions, a phenomenon known as superposition. We study the dimension needed to compute Boolean gates from such representations. For a single threshold layer with a Gaussian random dictionary and uniformly random sparse Boolean inputs, we derive sharp dimension thresholds under two error criteria. A vanishing expected error count can require more dimensions than correctness of every output with high probability. Shared reads explain the gap: rare realizations can produce many errors at once. The expected-count threshold has ball geometry, while joint reliability has box geometry when a gate is evaluated on every feature tuple. Optimizing shared readout weights and biases gives explicit thresholds for conjunction, disjunction, and majority. For pairwise conjunction, the analysis also describes the transition near the threshold, in agreement with exact simulations.

Introduction

A network computes in superposition when many decisions read a vector that stores more features than it has dimensions ([18, 23, 1]). Each feature has a direction in Rd\mathbb{R}^{d}, and a threshold unit reads a weighted sum of these directions. If only kk of mm features are active, a unit probe sees interference of order k/d\sqrt{k/d}. This controls one decision. What dimension is needed when a whole family of decisions shares the same stored vector? We count the width dd of that vector; each gate has its own readout unit.

Pairwise conjunction gives a concrete example. Store mm binary features in a Gaussian dictionary and read all (m2)\binom{m}{2} products xixjx_i x_j with probes ei+eje_i+e_j. There are two choices: require the expected number of wrong outputs to vanish, or require every output to be correct with probability tending to one. The bias can be fixed at the midpoint 3/23/2 or optimized. These choices give four sharp thresholds (Table 1). When log⁡k=o(log⁡m)\log k=o(\log m), the constants are 16, 8, 4 and 2 in units of klog⁡mk\log m. When log⁡m∼log⁡k\log m\sim\log k, all four thresholds equal 32klog⁡k32k\log k to first order.

Reliability retains dependence between gate errors. Group gates by their active-input pattern z∈{0,1}rz\in\{0,1\}^{r}. A gate in this class has weights aa and margin szs_z; it fails when its interference crosses the margin. Counting errors uses only the law of each gate. Its answer is unchanged if the NzN_z interference vectors are independent Gaussian points, whose extreme projections have the support function of a ball of radius 2log⁡Nz\sqrt{2\log N_z}. Reliability uses the actual joint law. In the family of all gates, every interference vector is assembled from the same active and inactive feature reads. Their extremes form a box (Figure 1), with half-sides λ1=2log⁡k\lambda_1=\sqrt{2\log k} and λ0=2log⁡(m−k)\lambda_0=\sqrt{2\log(m-k)} according to the input state. In either case, a class costs

Two geometries for the one-active class of pairwise conjunction

Figure 1. Two geometries for the one-active class of pairwise conjunction. Left: independent vectors have the extreme projections of a disc of radius 2log⁡N\sqrt{2\log N}, where N=k(m−k)N = k(m-k). Right: shared active and inactive reads form a grid in [−λ1,λ1]×[−λ0,λ0][-\lambda_1,\lambda_1] \times[-\lambda_0,\lambda_0]. A gate fails beyond the line normal to a=(1,1)a = (1,1) at distance sz/(σd∥a∥)s_z/(\sigma_d\lVert a\rVert). The expected count must clear the disc; reliability must clear the rectangle. Here λ0=3λ1\lambda_0 = 3\lambda_1; points are illustrative.

d≈kh(a)2sz2,(1)d\approx k\frac{h(a)^2}{s_z^2}, \tag*{(1)}

where h(a)=∥a∥2log⁡Nzh(a)=\lVert a\rVert\sqrt{2\log N_z} for the ball and h(a)=∑l∣al∣λzlh(a)=\sum_l\lvert a_l\rvert\lambda_{z_l} for the box. The box lies inside the ball to first order. The Cauchy–Schwarz inequality between their support functions explains why the expected count can require more dimensions than reliability. Optimizing the bias produces a separate reduction by assigning more margin to classes with larger extremes.

Results The exact read law gives a common probabilistic reduction (Theorem 3.1). Expected-count thresholds depend on class sizes; reliability depends on Gaussian suprema (Theorems 4.1 and 5.1). The optimized count is a second-order cone program with a converse over all gate-local readouts (Theorem 4.2). For the universal family, the box program has a converse over common representations, even if chosen after observing the reads (Theorem 5.4). Symmetric threshold gates have closed forms (Theorem 6.1). Pairwise conjunction has explicit Gumbel–Poisson windows, tested by exact simulation (Theorem 7.1).

Previous work Superposition explains polysemantic neurons in models of sparse features ([32, 18]). Hänni et al. [23] and Adler and Shavit [1] study neural computation with superposed hidden activations. Here we ask which Boolean functions a single threshold layer can read from one stored code. Newgas [31] studies learned universal-AND circuits; Bhagat et al. [6] distinguish compressed computation from computation in superposition. Garg et al. [22] distinguish linear storage from threshold accessibility, and

Midpoint biasOptimized bias
Count errors, EX→0\mathbb{E}X \to0 (ball)8k(λ12+λ02)8k(\lambda_1^2+\lambda_0^2)<br> ∼16klog⁡m\sim16k\log m2k(2λ1+(λ12+λ02)1/2)22k\left(\sqrt{2}\lambda_1+(\lambda_1^2+\lambda_0^2)^{1/2}\right)^2<br> ∼4klog⁡m\sim4k\log m
Forbid errors, P(X=0)→1\mathbb{P}(X=0)\to1 (box)4k(λ1+λ0)24k(\lambda_1+\lambda_0)^2<br> ∼8klog⁡m\sim8k\log mk(3λ1+λ0)2k(3\lambda_1+\lambda_0)^2<br> ∼2klog⁡m\sim2k\log m

Table 1. Sharp first-order thresholds for pairwise conjunction, with λ1=2log⁡k\lambda_1=\sqrt{2\log k} and λ0=2log⁡(m−k)\lambda_0=\sqrt{2\log(m-k)}. Second lines give the limit when log⁡k=o(log⁡m)\log k=o(\log m). All entries are 32klog⁡k32k\log k to first order when log⁡m∼log⁡k\log m\sim\log k.

Ivanitskiy et al. (2026) analyze feature recovery from superposition. Our comparison with recovery uses the same dictionary, input law and error criterion.

Sharp thresholds also appear in compressed sensing and support recovery [11, 15, 16, 21, 44]. Sparse superposition codes supply the Gaussian conditioning identity used here [4, 26]; vector-symbolic architectures also store superposed random vectors [34, 40]. Different error criteria change capacity constants in associative memories [29]. The present geometry identifies that difference for threshold gate families. The proofs use Gaussian concentration and comparison [7, 41, 37] and Gaussian extreme-value theory [28, 35]. The gap between the expected and typical error counts is an annealed–quenched distinction [13].

Model and criteria

Let E=[e1∣⋯∣em]∈Rd×mE=[e_1|\cdots|e_m]\in\mathbb{R}^{d\times m} have independent columns ei∼N(0,Id/d)e_i\sim N(0,I_d/d). Independently choose SS uniformly among the kk-subsets of [m][m]. Write x=1Sx=\mathbf{1}_S, n=m−kn=m-k and

u=Ex=∑i∈Sei,R=ETu.(2)u=Ex=\sum_{i\in S}e_i,\qquad R=E^\mathsf{T}u. \tag*{(2)}

The feature read is Ri=⟨ei,u⟩R_i=\langle e_i,u\rangle. Throughout, k→∞k\to\infty and m/k→∞m/k\to\infty; other restrictions are stated where needed.

Gates and classes A gate is an ordered tuple I=(I1,…,Ir)I=(I_1,\ldots,I_r) of distinct features and a nonconstant threshold function g:{0,1}r→{0,1}g:\{0,1\}^r\to\{0,1\}. Its target is g(xI)g(x_I). A family F\mathcal{F} has common arity rr and function gg. Finitely many types can be treated separately. The class of a gate is its input pattern z=xIz=x_I, and Fz(S)\mathcal{F}_z(S) contains the gates of that class. With falling factorials (a)j(a)_j and ∣z∣=∑lzl|z|=\sum_l z_l,

Nz=E∣Fz(S)∣=∣F∣(k)∣z∣(n)r−∣z∣(m)r.(3)N_z=\mathbb{E}|\mathcal{F}_z(S)|=|\mathcal{F}|\frac{(k)_{|z|}(n)_{r-|z|}}{(m)_r}. \tag*{(3)}

The universal family Ur(g)\mathcal{U}_r(g) contains all (m)r(m)_r tuples. Its class sizes are deterministic: Nz=(k)∣z∣(n)r−∣z∣N_z=(k)_{|z|}(n)_{r-|z|}. For symmetric gates, unordered subsets change these counts only by constant factors and leave first-order thresholds unchanged.

Readouts and margins Gate γ\gamma outputs 1{⟨wγ,u⟩>θγ}\mathbf{1}\{\langle w_\gamma,u\rangle> \theta_\gamma\}. A gate-local rule chooses (wγ,θγ)(w_\gamma,\theta_\gamma) from its own columns EIE_I and independent randomness, before drawing the input. Rules may differ between gates. They can use their own column lengths and angles, but cannot use the support or other columns. A canonical rule uses wγ=∑laleIlw_\gamma= \sum_l a_l e_{Il} and a common bias θ\theta. The pair (a,θ)(a,\theta) represents gg when

sz(a,θ)=(2g(z)−1)(⟨a,z⟩−θ)>0for all z.(4)s_z(a,\theta) = (2g(z)-1)(\langle a,z\rangle-\theta) > 0 \quad\text{for all } z. \tag*{(4)}

Write Rep⁡(g)\operatorname{Rep}(g) for these representations and ζz=(−1)g(z)\zeta_z = (-1)^{g(z)} for the error direction. Pairwise conjunction with a=(1,1)a=(1,1) has clean scores 0,1,20,1,2 and margins θ,θ−1,2−θ\theta,\theta-1,2-\theta.

Error criteria Let XX count wrong outputs on a draw of (E,S)(E,S). We study

EX→0andP(X=0)→1.(5)\mathbb{E}X \to0 \qquad\text{and} \qquad\mathbb{P}(X=0)\to1. \tag*{(5)}

The first implies the second by Markov’s inequality. The converse can fail: one rare draw can produce many errors. A sharp threshold D(k,m)D(k,m) has a multiplicative 1±ε1\pm\varepsilon transition for every fixed ε∈(0,1)\varepsilon\in(0,1). Below it, failure means EX→∞\mathbb{E}X\to\infty for the count and P(X=0)→0\mathbb{P}(X=0)\to0 for reliability.

Levels and prices Set

λ1=2log⁡k,λ0=2log⁡n,β=λ0/λ1.(6)\lambda_1=\sqrt{2\log k}, \qquad\lambda_0=\sqrt{2\log n}, \qquad\beta=\lambda_0/\lambda_1. \tag*{(6)}

References

  1. [1]Micah Adler and Nir Shavit. On the complexity of neural computation in superposition. arXiv:2409.15318, 2024. URL https://arxiv.org/abs/2409.15318.
  2. [2]Richard Arratia, Larry Goldstein, and Louis Gordon. Two moments suffice for Poisson approximations: The Chen–Stein method. The Annals of Probability, 17(1):9–25, 1989. doi: 10.1214/aop/1176991491.DOI
  3. [3]A. D. Barbour, Lars Holst, and Svante Janson. Poisson Approximation, volume 2 of Oxford Studies in Probability. Oxford University Press, Oxford, 1992. doi: 10.1093/oso/9780198522355.001.0001.
  4. [4]Andrew R. Barron and Antony Joseph. Analysis of fast sparse superposition codes. In 2011 IEEE International Symposium on Information Theory Proceedings, pages 1772–1776, 2011. doi: 10.1109/ISIT.2011.6033853.
  5. [5]Alexander Barvinok. MATH 669: Combinatorics of polytopes, 2010. URL https://sites.lsa.umich.edu/barvinok/wp-content/uploads/sites/1434/2025/05/polynotes669.pdf. Winter 2010 lecture notes, University of Michigan, Theorem 15.2.
  6. [6]Jai Bhagat, Sara Molas-Medina, Giorgi Gjelmanian, and Stefan Heimersheim. Compressed computation is (probably) not computation in superposition. arXiv:2606.14673, 2026. URL https://arxiv.org/abs/2606.14673.
  7. [7]Christer Borell. The Brunn–Minkowski inequality in Gauss space. Inventiones Mathematicae, 30(2): 207–216, 1975. doi: 10.1007/BF01425510.DOI
  8. [8]Stéphane Boucheron, Gábor Lugosi, and Pascal Massart. Concentration Inequalities: A Nonasymptotic Theory of Independence. Oxford University Press, Oxford, 2013. doi: 10.1093/acprof:oso/978019953255.001.0001.
  9. [9]R. Creighton Buck. Partition of space. The American Mathematical Monthly, 50(9):541–544, 1943. doi: 10.1080/00029890.1943.11991447.DOI
  10. [10]Emmanuel J. Candès and Yaniv Plan. Near-ideal model selection by ℓ₁ minimization. The Annals of Statistics, 37(5A):2145–2177, 2009. doi: 10.1214/08-AOS653.DOI
  11. [11]Emmanuel J. Candès and Terence Tao. Near-optimal signal recovery from random projections: Universal encoding strategies? IEEE Transactions on Information Theory, 52(12):5406–5425, 2006. doi: 10.1109/TIT.2006.885507.DOI
  12. [12]Thomas M. Cover. Geometrical and statistical properties of systems of linear inequalities with applications in pattern recognition. IEEE Transactions on Electronic Computers, EC-14(3):326–334, 1965. doi: 10.1109/PGEC.1965.264137.DOI
  13. [13]Bernard Derrida. Random-energy model: An exactly solvable model of disordered systems. Physical Review B, 24(5):2613–2626, 1981. doi: 10.1103/PhysRevB.24.2613.DOI
  14. [14]Bernard Derrida. A generalization of the Random Energy Model which includes correlations between energies. Journal de Physique Lettres, 46(9):401–407, 1985. doi: 10.1051/jphyslet:01985004609040100.DOI
  15. [15]David L. Donoho. Compressed sensing. IEEE Transactions on Information Theory, 52(4):1289–1306, 2006. doi: 10.1109/TIT.2006.871582.DOI
  16. [16]David L. Donoho and Jared Tanner. Counting faces of randomly projected polytopes when the projection radically lowers dimension. Journal of the American Mathematical Society, 22(1):1–53, 2009. doi: 10.1090/S0894-0347-08-00600-0.DOI
  17. [17]Hanna Döring, Sabine Jansen, and Kristina Schubert. The method of cumulants for the normal approximation. Probability Surveys, 19:185–270, 2022. doi: 10.1214/22-PS7. arXiv:2102.01459.DOI
  18. [18]Nelson Elhage, Tristan Hume, Catherine Olsson, Nicholas Schiefer, Tom Henighan, Shauna Kravec, Zac Hatfield-Dodds, Robert Lasenby, Dawn Drain, Carol Chen, Roger Grosse, Sam McCandlish, Jared Kaplan, Dario Amodei, Martin Wattenberg, and Christopher Olah. Toy models of superposition. Transformer Circuits Thread (Anthropic), 2022. URL https://transformer-circuits.pub/2022/toy_model/index.html. arXiv:2209.10652.
  19. [19]William S. Evans and Leonard J. Schulman. Signal propagation and noisy circuits. IEEE Transactions on Information Theory, 45(7):2367–2373, 1999. doi: 10.1109/18.796377.DOI
  20. [20]Xavier Fernique. Régularité des trajectoires des fonctions aléatoires gaussiennes. In École d’Été de Probabilités de Saint-Flour IV—1974, volume 480 of Lecture Notes in Mathematics, pages 1–96. Springer, Berlin, 1975. doi: 10.1007/BFb0080190.DOI
  21. [21]Alyson K. Fletcher, Sundeep Rangan, and Vivek K. Goyal. Necessary and sufficient conditions for sparsity pattern recovery. IEEE Transactions on Information Theory, 55(12):5758–5772, 2009. doi: 10.1109/TIT.2009.2032726.DOI
  22. [22]Nikhil Garg, Jon Kleinberg, and Kenny Peng. How many features can a language model store under the linear representation hypothesis? In Steve Hanneke and Tor Lattimore, editors, Proceedings of Thirty Ninth Conference on Learning Theory, volume 336 of Proceedings of Machine Learning Research, pages 5358–5376. PMLR, 2026. URL https://proceedings.mlr.press/v336/garg26a.html.arxiv.org/abs/2602.11246
  23. [23]Kaarel Hänni, Jake Mendel, Dmitry Vaintrob, and Lawrence Chan. Mathematical models of computation in superposition. ICML 2024 Mechanistic Interpretability Workshop; arXiv:2408.05451, 2024. URL https://arxiv.org/abs/2408.05451.
  24. [24]Johan Håstad. On the size of weights for threshold gates. SIAM Journal on Discrete Mathematics, 7(3): 484–492, 1994. doi: 10.1137/S0895480192235878.DOI
  25. [26]Antony Joseph and Andrew R. Barron. Fast sparse superposition codes have near exponential error probability for R < C. IEEE Transactions on Information Theory, 60(2):919–942, 2014. doi: 10.1109/TIT.2013.2289865.
  26. [27]Béatrice Laurent and Pascal Massart. Adaptive estimation of a quadratic functional by model selection. The Annals of Statistics, 28(5):1302–1338, 2000. doi: 10.1214/aos/1015957395.
  27. [28]M. R. Leadbetter, Georg Lindgren, and Holger Rootzén. Extremes and Related Properties of Random Sequences and Processes. Springer Series in Statistics. Springer-Verlag, New York, 1983. doi: 10.1007/978-1-4612-5449-2.
  28. [29]Robert J. McEliece, Edward C. Posner, Eugene R. Rodemich, and Santosh S. Venkatesh. The capacity of the Hopfield associative memory. IEEE Transactions on Information Theory, 33(4):461–482, 1987. doi: 10.1109/TIT.1987.1057328.
  29. [30]Saburo Muroga. Threshold Logic and Its Applications. Wiley-Interscience, New York, 1971. ISBN 978-0-471-62530-8.
  30. [31]Adam Newgas. Compressed computation: Dense circuits in a toy model of the universal-AND problem. arXiv:2507.09816, 2025. URL https://arxiv.org/abs/2507.09816.
  31. [32]Chris Olah, Nick Cammarata, Ludwig Schubert, Gabriel Goh, Michael Petrov, and Shan Carter. Zoom in: An introduction to circuits. Distill, 5(3), 2020. doi: 10.23915/distill.00024.001.DOI
  32. [33]Valentin V. Petrov. Sums of Independent Random Variables, volume 82 of Ergebnisse der Mathematik und ihrer Grenzgebiete. Springer-Verlag, Berlin, 1975. doi: 10.1007/978-3-642-65809-9.DOI
  33. [34]Tony A. Plate. Holographic reduced representations. IEEE Transactions on Neural Networks, 6(3):623–641, 1995. doi: 10.1109/72.377968.DOI
  34. [35]Sidney I. Resnick. Extreme Values, Regular Variation, and Point Processes, volume 4 of Applied Probability. Springer-Verlag, New York, 1987.
  35. [36]Dai Shi, Xiaoyu Li, Andi Han, and José Miguel Hernández-Lobato. Feature superposition in neural networks: From theory to practice. arXiv:2609.06862, 2026. URL https://arxiv.org/abs/2609.06862.
  36. [37]David Slepian. The one-sided barrier problem for Gaussian noise. Bell System Technical Journal, 41(2): 463–501, 1962. doi: 10.1002/j.1538-7305.1962.tb02419.x.DOI
  37. [38]Vladimir N. Sudakov. Gaussian random processes and measures of solid angles in Hilbert space. Soviet Mathematics Doklady, 12:412–415, 1971.
  38. [40]Anthony Thomas, Sanjoy Dasgupta, and Tajana Rosing. A theoretical perspective on hyperdimensional computing. Journal of Artificial Intelligence Research, 72:215–249, 2021. doi: 10.1613/jair.1.12664.DOI
  39. [41]Boris S. Tsirel’son, Ildar A. Ibragimov, and Vladimir N. Sudakov. Norms of Gaussian sample functions. In Proceedings of the Third Japan–USSR Symposium on Probability Theory, volume 550 of Lecture Notes in Mathematics, pages 20–41. Springer, Berlin, 1976. doi: 10.1007/BFb0077482.
  40. [42]Roman Vershynin. High-Dimensional Probability: An Introduction with Applications in Data Science. Cambridge University Press, Cambridge, 2018. doi: 10.1017/9781108231596.DOI
  41. [43]John von Neumann. Probabilistic logics and the synthesis of reliable organisms from unreliable components. In Claude E. Shannon and John McCarthy, editors, Automata Studies, number 34 in Annals of Mathematics Studies, pages 43–98. Princeton University Press, 1956. doi: 10.1515/9781400882618-003.DOI
  42. [44]Martin J. Wainwright. Sharp thresholds for high-dimensional and noisy sparsity recovery using ℓ₁-constrained quadratic programming (Lasso). IEEE Transactions on Information Theory, 55(5):2183–2202, 2009. doi: 10.1109/TIT.2009.2016018.DOI
  43. [45]Robert O. Winder. Partitions of N-space by hyperplanes. SIAM Journal on Applied Mathematics, 14(4):811–818, 1966. doi: 10.1137/0114068.DOI

Paper details

vlnc:W_bwpn5em8
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

AI tools

View statement
Looking for related papers…
Contents