Manuscript Offprint
arXiv:2610.26470On Learning Expand-and-Sparsify Representations
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
Expand-and-sparsify (EaS) representations lift an input to a much higher dimension through a linear map and keep only the k largest coordinates. Existing theory builds that map at random and needs the expanded dimension to grow exponentially in the input dimension, which puts the construction out of practical reach. We ask what is gained by learning the map by gradient descent instead, and how that gain depends on how wide the expansion is. We sweep 73 OpenML classification tasks and 48 regression tasks under a protocol that holds the datasets, expanded dimensions, sparsity levels and splits fixed across every method, and we summarise each comparison by a median over datasets and a Wilcoxon signed rank test. We report four findings. First, learning the expansion helps most when the expansion is narrowest, and its advantage over a random map decays to nothing by the widest expansions we run, so a learned EaS layer can be made small. Second, with the map learned, a top-k representation that keeps at most a tenth of its coordinates is indistinguishable from a dense ReLU layer of the same expanded dimension at every expansion factor we test, while GELU and SiLU are not. Third, when the representation is forced to be binary the sparse code is the better of the two, and the reason is that binarization costs it nothing while it costs the dense layer accuracy. Fourth, how sparse the representation can be is governed by how wide it is: the sparsity level that is free rises as the expansion grows, so there is no fixed limit on how sparse it can be. The regression tasks reproduce the first finding and qualify the second and third.
1 Introduction
Expand-and-sparsify or EaS representations are generated by projecting inputs in to a much larger dimensionality with , followed by a sparsification step which zeros out all but the top values in the -dimensional representation, with . This scheme is neuro-biologically inspired, where the top- sparsification is achieved via inhibitory signals common in biological systems. For example, a version of this is seen in the olfactory circuit of fruit-flies [Turner et al., 2008, Caron et al., 2013], olfactory circuit of rodents, the visual cortex of cats, and the electrosensory system of electric fish [Stettler and Axel, 2009, Olshausen and Field, 2004, Chacron et al., 2011]. This representation scheme has been used for locality sensitive hashing [Dasgupta et al., 2017] and outlier detection [Dasgupta et al., 2018]. Subsequent theoretical studies have shown that a linear model on top of these representations can approximately express any sufficiently smooth function [Dasgupta and Tosh, 2020, Sinha, 2024].
While these representations come with interesting theoretical properties, their practical viability has not been established to the best of our knowledge. The theoretical studies rely on expansions via prescribed constructions, and require , thus limiting practical use. Learned expansions for supervised problems via stochastic gradient descent (SGD) and backpropagation with more practical values of have not been explored. Expanded representations (with more practical values of ) are often employed in the single-hidden-layer feedforward networks,

(E)
| ReLU | Wins/Ties/Losses | Significant at |
|---|---|---|
| vs GELU | 302/56/186 | 5 of 8 |
| vs SiLU | 333/48/163 | 6 of 8 |
| vs topk (EaS) | 253/91/200 | 0 of 8 |
| vs LWTA@k (EaS) | 257/94/193 | 0 of 8 |
(F)
| Learned M | Wins/Ties/Losses | Significant at |
|---|---|---|
| vs Random M | 361/86/97 | 7 of 8 |
| vs Data-supp. M | 367/62/112 | 8 of 8 |
Figure 1: What we compare, and what we find. (A) A linear operator is applied to the input , giving us (B) an expanded representation , which is then either (C) thresholded, giving a dense ReLU layer, or (D) sparsified, giving the EaS representation. (E) The table compares ReLU against alternate activations with M learned throughout — GELU and SiLU are other dense activations, and topk and LWTA@k serve as EaS versions with different sparsification schemes. (F) The table compares a learned M against theoretical constructions from Dasgupta and Tosh [2020] with topk activation throughout. We summarize the results in the form of wins/ties/losses over the (dataset, ) configurations, and “significant at” counts how many of the 8 expansion factors reach under a two-sided Wilcoxon signed rank test (per-expansion factor results are in fig. 4 and table 1; more details are presented in section E and section F). The results show that the learned EaS representations not only significantly improve upon the theoretical constructions, but also provide competitive performance to standard activations used in feedforward networks.
serving as channel mixers in architectures such as the Transformer [Vaswani et al., 2017] or the MLP-mixer [Tolstikhin et al., 2021], and we think it is important to understand the capabilities of (learned) EaS representations relative to the commonly used learned unrestricted expanded representations.
Consequently, we believe that EaS can enable unique advantages in practical architectures. Because the expanded representation is extremely and predictably (always k nonzeros) sparse, (i) we can use sparse linear algebra kernels when available, (ii) we need only load the rows of the next layer's weights that correspond to the k nonzeros, (iii) we need only backpropagate through those same k nodes [Gupta et al., 2021], and (iv) any cache of intermediate activations [Grave et al., 2017, Wimbauer et al., 2024] shrinks by the same factor. Section B works through what each of these is worth.
Research question. Given these motivations for EaS representations, here we focus on understanding whether learning the EaS representations via standard SGD (i) not only improves over the existing theoretical EaS constructions, but also (ii) produces representations that are competitive with existing unrestricted expanded representations in terms of expressivity and generalization.
Findings. We consider an evaluation across 73 OpenML classification tasks (binary and multi-class) and 48 OpenML regression tasks, controlling for the expanded dimension (with the expansion factor ) and the sparsity (), training over roughly 50,000 configurations (more than 160,000 training runs across three train/validation/test splits for each configuration). Every number below is a median over datasets of the per-dataset difference, with significance from a two-sided Wilcoxon signed rank test. We make the following observations (see summary in fig. 1).
Note that the existing theory of EaS representations, either in regression for arbitrarily accurate function approximation [Dasgupta and Tosh, 2020] or in classification for a minimax-optimal convergence rate [Sinha, 2024], requires , and in the classification setting the existing lower bound on k is . In our setting m is not scaled exponentially in d, so we instead work in an artificially restricted high-sparsity regime of . See section H for the theoretical guarantees achievable in this regime of .
• Learned EaS representations outperform the theoretical constructions, and by the largest margin where the expansion is narrowest. That learning helps is expected, since only it sees the labels; the useful part is the decay. Against a data-independent construction the median gain falls from 3.0 accuracy points at m = d to 0.13 at m = 256d, significant up to m = 128d ( ) but not beyond. Regression behaves the same way, with a median gain of 0.185 in at m = d. Against the data-supported construction the gain does not decay: it stays between 0.65 and 1.68 points across the whole range and is significant at every expansion factor ( ). A learned EaS representation can therefore be made small, tolerating smaller values of .
• Learned EaS representations at are competitive with unrestricted ones. Against a ReLU layer of the same expanded dimension we see no significant difference at any expansion factor, with the median difference between and points and throughout. This is not something every alternative achieves: GELU and SiLU both fall significantly short of ReLU over most of the range. On regression the same parity holds for ; below that the EaS representation trails ReLU significantly, by a median 0.04 in at and 0.03 at .
• If the representation is restricted to be binary, the learned EaS representation is the better of the two from onward, by 0.50 to 0.62 accuracy points. Comparing each activation against its own value-passing form shows why: binarizing topk costs nothing at any expansion factor, while binarizing ReLU costs 0.4 points at . The sparse code is not gaining, it is simply not losing, since it already carries its information in which coordinates fire rather than how strongly. On regression binarizing costs every activation something, but it costs topk less than ReLU, so the binarized EaS representation is again ahead, at to 128d.
• How sparse the representation can be is governed by how large the expanded dimension is. At 90% sparsity it matches ReLU everywhere; at 99% it falls behind, but the deficit shrinks monotonically from 2.4 points at to 0.35 at . There is no single sparsity level at which EaS begins to lose; instead, the larger the expanded dimension, the sparser the representation can be before it costs accuracy.
Together these indicate that the practical benefits of EaS representations described above may be available without losing much in expressivity or generalization, which makes a case for their wider use in modern architectures.
Related work. EaS representations were introduced as a model of the fly olfactory circuit and used for similarity search [Dasgupta et al., 2017] and novelty detection [Dasgupta et al., 2018], and later applied to supervised classification [Sinha and Ram, 2021, Ram and Sinha, 2022]. Their expressivity has been studied theoretically by Dasgupta and Tosh [2020], Sinha [2024] and Sinha and Tosh [2026], all of whom construct the expansion by sampling its rows from a fixed distribution rather than by learning them. Two lines of work do learn the projection: Ryali et al. [2020] train it with an unsupervised, biologically motivated rule for similarity search, and Liang et al. [2021] train the same circuit on text to produce word embeddings. Both learn the expansion, but neither measures the resulting representation against a dense layer of the same expanded dimension under a fixed sparsity budget, which is the comparison we make. Sparsification by competition among units, without the expansion, was studied by Srivastava et al. [2013], and top-k activations have been used inside the feedforward block of a Transformer to reduce the memory cost of backpropagation [Gupta et al., 2021]. We further elaborate on how our setting relates to each of these in section A, including the sense in which Dasgupta and Tosh [2020, §5] already consider a data-dependent expansion.
Here M is the expansion matrix, is a nonlinear activation, W is the linear readout, and are the learnable parameters. If l is the number of classes, f is a multi-class classifier; if , this model is the feedforward channel mixer used in the Transformer and the MLP-Mixer. With a standard activation such as ReLU, eq. (1) is a single-hidden-layer feedforward network; with the topk function we get , which is the EaS representation. We can further restrict the representation to be binary, , in which case a standard activation reduces to the Heaviside function while the EaS representation has exactly ones and zeros. Given a loss , we learn by minimizing the population loss with SGD, for different activations and different values of and . With theoretical constructions of , we learn only .
Constructions of the expansion matrix. We compare three ways of obtaining the expansion matrix M (fig. 2), holding everything else fixed. In the learned construction, M is trained by SGD jointly with the readout W. In the data-supported construction, the m rows of M are drawn from the training inputs with replacement, so that the expansion directions lie in the support of the data, which is the setting Dasgupta and Tosh [2020, §5] analyze. In the data-independent construction, the rows are drawn i.i.d. from a fixed distribution (the uniform distribution on the unit sphere in , drawn by normalizing samples from ). In all three cases, W is fitted by SGD on all n training points.

Figure 2: The three constructions of M and what each may use. The random (data-independent) M uses neither X nor Y, the data-supported M samples its rows from X, and the learned M is trained by SGD on a loss that sees both.
Drawing with replacement matters for two reasons. It keeps the construction defined for every dataset at every expanded dimension, including , so the three constructions are compared on the same datasets throughout. And it is i.i.d. sampling from the empirical distribution, whereas drawing m distinct points is not i.i.d. at all. The cost is that M can hold at most n distinct rows, which section 3.1 shows is what eventually limits this construction.
Activations. The sparse activations are topk and local winner-take-all (LWTA@k), which splits the representation into blocks of size and selects the top-1 in each block [Srivastava et al., 2013], resulting in one nonzero per block; with blocks of size round that is exactly k nonzeros when k divides m and can be slightly more otherwise (section F). We treat LWTA@k as an alternative sparsification scheme within EaS rather than as a separate method: both keep (about) k of the m coordinates and so carry the same sparsity budget, and they differ only in which k survive. The topk activation lets all m units compete, while LWTA@k lets them compete only inside blocks of size . For any single input the two coincide under a permutation of the rows of M that puts the k winners in distinct blocks, and when M is learned the assignment of directions to blocks is learned along with the directions, so the network can partly arrange that for itself. We therefore expect the two to behave similarly, and section 3.2 finds that they do. We run each of them in a value-passing form, which forwards the surviving pre-activations, and in a binary form, which forwards their indicator and is trained through a straight-through estimator. The dense baselines are ReLU, GELU and SiLU. Binarizing any of these three gives the same function, the indicator of a positive pre-activation, so there is one dense binary baseline rather than three and we run only that one. The binary forms are evaluated against each other in section 3.3 and are not mixed into the comparisons among value-passing activations.
Parameterization. We report results as functions of the expansion factor and the sparsity level rather than of and . These are equivalent, but the ratios are comparable across datasets of differing dimension, and on its own cannot be separated from in our grid: since , a large absolute arises only at a large expanded dimension. We sweep
and , restricting throughout to .
Data. We use 73 classification tasks from OpenML, admitted by input dimension and sample size , with missing values imputed and categorical features one-hot encoded. Of these, 37 are binary and 36 are multi-class. We use a further 48 regression tasks admitted by the same criteria. We deliberately chose a large and varied set of tasks so that we can see how generally the behaviour of EaS holds.
Protocol. Every construction sees identical datasets, expanded dimensions, sparsity levels and train/test splits, so all comparisons are paired. We repeat every configuration on 3 random train/validation/test splits (70/10/20, stratified for classification), with a different seed for each, and report the mean test score. We train with Adam at a learning rate of , no weight decay and a batch size of 256, for up to 300 epochs with early stopping at a patience of 30. For each (dataset, m/d, activation, construction) configuration we select k on validation accuracy and report the corresponding test accuracy; the dense activations have no k and are unaffected by this selection. We cap due to computational limitations.
Two things follow from that cap and from being an integer, and both change which datasets are available at a given expansion factor. A dataset drops out at the wide end when exceeds the cap, which happens first for the highest-dimensional datasets. And it drops out at the narrow end when is too small for any integer to satisfy , which happens first for the lowest-dimensional ones. The pool is therefore not the same at every , so we compare methods only within an expansion factor and never read a trend along a row of counts. Section F gives the pool sizes at each expansion factor and which of the two causes is responsible.
Statistics. For each expanded dimension, we compare two methods only on the datasets where both are available, so every comparison is paired. Within a given m/d we use the same set of datasets for every method being compared, so that a method is never scored on an easier subset than the one it is being compared against. We report raw metrics (accuracy for classification, and for regression), except in fig. 3 where we use the scaled form of the metrics to aggregate performance across datasets [Ram and Sinha, 2022]. Because is unbounded below, we verify every regression conclusion twice, once with floored at zero and once left raw, and we say so wherever the two disagree. In both cases k is chosen on the raw validation score, so flooring changes what is reported but not which model is selected. When comparing a pair of methods we report the median difference, the inter-quartile range, the number of datasets on which the first method wins, ties or loses, and the p-value of a two-sided Wilcoxon signed rank test. We count a tie when the difference is at most 0.001 (that is 0.1 percentage points of accuracy or 0.001 in ).
3 Main Results
We organise the results around the four findings. Section 3.1 compares the three ways of building M. Section 3.2 compares the sparse representation against unrestricted ones at the same expanded dimension. Section 3.3 restricts both to binary codes. Section 3.4 fixes the sparsity level instead of tuning it. Classification and regression are reported together in each except section 3.4, which is classification only, and every comparison is paired within an expansion factor as described in section 2.
3.1 What is gained by learning the expansion?
Here we compare the performance of the learned expansion matrix to existing theoretical constructions, and the results are presented in fig. 3. We first compare the learned expansion to the data-independent one. The learned expansion gives higher accuracy at every expansion factor we consider, and the improvement is largest when the expansion is narrowest. The median gain over datasets

Figure 3: Scaled metrics (accuracy for classification, for regression; higher is better) of the three constructions of M against the expansion factor , with topk sparsification throughout. Rows are task types (binary classification, multi-class classification and regression) and columns are sparsity levels , with the rightmost column selecting k on validation. Each line is the median over datasets and the ribbon is the inter-quartile range. As discussed in section 2, evaluations for and are skipped so results for small m/d and small k/m are absent when d is small. Learned EaS improves upon both theoretical constructions at small expansion factors in every panel. As the expansion grows the random construction catches up, while the data-supported one mostly stays below (section 3.1).
is 3.0 accuracy points at , and it drops to 2.55 points at , 1.0 point at and 0.13 points at . We see a significant difference at every expansion factor up to (, and for ), and no significant difference at (). The regression tasks behave the same way: learning the projection is worth a median 0.185 in at , that gain falls to 0.002 at , and it is significant at every expansion factor up to and including but at neither of the two widest (), with raw or floored at zero. In other words, learning the expansion gives much of what a larger expanded dimension would have given anyway, and once it is large enough there is little left for learning to add. In practice this says a learned EaS layer can be made small.
We next compare the learned expansion to the data-supported one. Here the gain does not decay with the expanded dimension. It is 0.90 points at , 1.18 at , 0.65 at and 1.12 at , and we see a significant difference at every expansion factor (), on a pool that stays between 57 and 71 datasets throughout. On regression the gain shrinks, from 0.13 in at to 0.03 at , but it too is significant at every expansion factor (, raw or floored). So against a projection drawn without reference to the data learning stops paying once the expansion is wide, and against one whose rows come from the data it keeps paying. Section G traces this difference to the data-supported M running out of distinct rows as grows, on regression as on classification.

Figure 4: Per-dataset differences against ReLU at equal expanded dimension, with M learned for both methods and k selected on validation for the sparse activations. Rows are task types and columns are expansion factors. Each box is the distribution over datasets of the difference for one activation, so values above zero mean the activation beats ReLU on that dataset. Within a panel every activation is scored on the same datasets, and a star marks a significant difference from ReLU in that panel (two-sided Wilcoxon, p < 0.05). Whiskers extend to 1.5 times the interquartile range and outliers are not drawn. All differences are multiplied by 100: accuracy differences in percentage points for classification and differences in for regression.
3.2 How does EaS fare against unrestricted expanded representations?
Here we compare the learned EaS representations to standard (dense) expanded representations, and the results are presented in fig. 4 and table 1. In fig. 4 we can see that the boxes for topk and LWTA@k sit on zero at every expansion factor while those for GELU and SiLU sit below it once , and the table makes this precise. The EaS representation at is statistically indistinguishable from the unrestricted one at every expansion factor we study regardless of whether we use topk or LWTA@k for the sparsification (as we had expected): For topk, the median difference stays between -0.22 and +0.05 accuracy points and no Wilcoxon test reaches significance ( ); for LWTA@k, . The smooth activations instead do not necessarily match ReLU. GELU falls short of ReLU by a median 0.16 to 0.44 points and is significantly behind at , and SiLU falls short by 0.25 to 0.92 points and is significantly behind at every expansion factor from upwards. Parity with ReLU is therefore not something every alternative activation achieves. EaS trains no slower, but its train–test gap is larger (section I).
On the regression tasks, the EaS representation matches ReLU once the expansion is at least 4d. With topk it is significantly worse only at m = d and m = 2d. From m = 4d upwards no test is significant ( ) and the median difference stays within 0.014 of zero, whether is left raw or floored at zero. LWTA@k behaves the same way from m = 8d ( ). It is also significantly behind at m = 4d, but that result disappears when we remove the few configurations where LWTA@k keeps more than k units (section F). As on classification, the smooth activations fall short of ReLU: GELU is significantly behind at , and SiLU at every expansion factor up to m = 64d (and at m = 256d when is floored), by medians of 0.003 to 0.010 and 0.003 to 0.018 in respectively. Table 4 gives every value. This range overlaps the one where learning M still pays:
Table 1: Each activation against ReLU at equal expanded dimension on the 73 classification tasks, with M learned for both methods. Each cell gives wins/ties/losses over datasets and, in parentheses, the -value of a two-sided Wilcoxon signed rank test on the per-dataset differences; a star marks . Within a column every activation is scored on the same datasets. Five of the eight expansion factors are shown here; table 2 in the section E gives all eight.
| activation | m/d = 1 | m/d = 4 | m/d = 16 | m/d = 64 | m/d = 256 |
|---|---|---|---|---|---|
| top-k | 17/15/25 (.198) | 27/9/35 (.585) | 24/12/35 (.727) | 27/9/35 (.800) | 31/9/27 (.321) |
| LWTA | 19/14/24 (.517) | 25/9/37 (.425) | 25/11/35 (.373) | 21/16/34 (.725) | 28/13/26 (.616) |
| GELU | 25/3/29 (.899) | 23/4/44 (.023)* | 19/10/42 (.002)* | 21/8/42 (.005)* | 22/8/37 (.101) |
| SiLU | 21/6/30 (.255) | 21/4/46 (.001)* | 15/6/50 (<.001)* | 21/6/44 (.002)* | 20/11/36 (.007)* |

Figure 5: The effect of binarizing expanded representations on classification tasks. [Left] The signed difference between the accuracy of the binarized EaS and binarized ReLU representations (higher values indicate better EaS performance relative to the dense versions). [Right] Per-method performance degradation due to binarization (lower values imply larger degradations). Lines are medians over datasets and ribbons the interquartile range; filled markers are significant under a two-sided Wilcoxon signed rank test () and hollow ones are not. Table 3 gives every value.
at the learned M is ahead of a random one by a median 0.09 in , and it stays significantly ahead through . So between and the representation can be both learned and sparse at no measurable cost.
We state two important qualifications: (i) The sparsity level is selected on validation for the EaS representations, and the dense representations do not have any such equivalent knob. (ii) The aggregated classification results in table 1 hide a difference between the task types: topk is behind ReLU on the binary tasks at (0.85 points, ) and on the multi-class tasks at and (0.49 and 0.52 points, ). These are three small significant results out of the sixteen comparisons obtained by splitting each of the eight expansion factors by task type, and fig. 4 marks those at the expansion factors it shows.
3.3 How robust is EaS to binarization of expanded representations?
We now restrict the expanded representation to be binary, so that the expanded representations post-activation ; we learn the model parameters using the straight-through estimator. Figure 5 shows the classification comparisons and table 3 gives every value; the regression results close this section. Binarizing ReLU, GELU or SiLU gives the same function, so there is a single dense binary baseline.
On classification, the binarized EaS representation is the better of the two once the expanded dimension is large. With topk sparsification, we see no significant difference for , and then a median advantage of 0.58 points at ( ), 0.56 at ( ), 0.62 at ( ) and 0.50 at ( ). The binarized LWTA@k sparsification behaves the same way, reaching a median advantage of 0.52 points at ( ). So the advantage appears once is at least 16d.
That advantage could stem from the EaS representations improving or the dense one degrading. We separate the two by comparing each activation against its own value-passing form, which tells us what binarization costs it. Binarizing ReLU costs a median 0.43 points at ( ) and 0.39 points at ( ), and nothing detectable at smaller expanded dimensions. Binarizing topk costs nothing at any expansion factor we study: the median difference is zero throughout and no test comes close to significance ( ). Binarizing LWTA@k is the same, with one exception at where it is a small gain of 0.13 points ( ).
These results indicate that the advantage of EaS under binarization is not that the sparse representation improves, but that it loses nothing while the dense one loses about 0.4 accuracy points. The EaS representation can carry information in its nonzero coordinates and thus appears to handle the binarization without any degradation. The memory and compute savings of a binary representation (section B) are therefore available from EaS at no measurable cost in accuracy.
In regression (with 48 datasets) binarized topk representation is the better than binarized ReLU representations once the expansion is large — by a median 0.014, 0.028 and 0.017 in at , 64d and 128d ( , raw or floored), with no significant difference below or at . Binarized LWTA@k is ahead of ReLU at and 128d. The reason differs from classification. On regression, binarizing costs every activation something: topk loses a median 0.010 to 0.037 in , significantly at every expansion factor, and ReLU loses 0.015 to 0.068, significantly everywhere except at with floored. The EaS representation keeps its advantage because it loses less, not because it loses nothing. See detailed results in table 4 in section E.
3.4 How sparse can the representation be?
In section 3.2 we selected k on validation, so the sparsity level that ended up being used is tuned. Here we fix it instead (fig. 6, table 5), do no selection over k, and ask at which expanded dimensions each level is affordable. The point is not that more sparsity costs more accuracy, which is expected, but the rate at which a larger expanded dimension buys that cost back.
At 90% sparsity ( ) the EaS representation matches ReLU at every expansion factor, with a median difference of zero and no significant difference anywhere ( ). At 99% sparsity ( ) it is behind, and significantly so from upwards, but the deficit shrinks monotonically as the expanded dimension grows: 2.42 points at , 2.06 at , 2.00 at , 0.99 at , 0.61 at and 0.35 at . The 97% level sits between the two. It is significantly behind ReLU at , by a median 0.59, 0.53 and 0.33 points, and we see no significant difference from onwards.

Figure 6: The signed difference between topk based EaS at a fixed sparsity (k/m) and dense ReLU representations with varying expansion factors (m/d). Lines are medians over datasets, ribbons the interquartile range; filled markers are significant (p < 0.05). A point is drawn only where at least 30 datasets are present: 99% sparsity leaves 8 and 23 datasets at m = d and m = 2d. Table 5 gives every value.
We see the expected behaviour, with the cost of a sparsity level falling as the expanded dimension grows. What the numbers add is the exchange rate: the sparsity level that is free moves from 90% at to 97% at . There is therefore no single sparsity level at which EaS begins to lose; instead, the larger the expanded dimension, the sparser the representation can be before it costs accuracy.
4 Concluding Remarks
In this work, we considered an elaborate evaluation with 121 datasets spanning binary/multiclass classification and regression and roughly 50,000 configurations to study the empirical behaviour of the neurobiologically inspired and theoretically motivated EaS representations. Our results support the practical viability of these representations when learned via standard SGD: First, we see that the learned EaS representations perform significantly better than the existing theoretical constructions, especially when are of practical sizes (as opposed to the required for the theoretical constructions). Then, we see that these learned EaS representations are quite competitive to the standard expanded representation obtained with ReLU networks (and similar activations), and when restricted to binary representations, EaS even outperforms standard representations once the expansion is large enough.
Limitations. The main limitation of our work is that it is an empirical study without theoretical guarantees for the learned representations, limited to single-hidden-layer networks applied to tabular datasets (albeit over 120 of them). Our choice of this network is due to its prevalence in architectures such as Transformers and MLP-Mixers. However, we do not directly consider such architectures in our evaluations as they would introduce confounders that would make it hard to isolate the effect of the EaS representations. One thing of note is that the explicit k-sparsification in EaS representations allows us to tune the sparsity level in a problem specific manner, whereas the existing unrestricted expanded representations do not have any such knob (see section C). Furthermore, within our elaborate evaluation, we end up with some inconsistencies. First, the minimal sparsity requirement of and the computational limit of leads to situations where some configurations are not valid for datasets whose d is either too large or too small. While we do not have any solution for this, we report the size of the dataset pool for each expansion in section F. Second, with the data-supported construction, when m is large relative to n, the expansion matrix M ends up with repeated rows, thereby introducing redundancies and hampering the benefits of the expansion. Again, we do not have a solution for this but we report it in detail in section G.
AI use statement
In this work, we used generative AI tools for writing and editing portions of the text, for writing the experiment, analysis and plotting code (including the dataset preprocessing) from which every figure and table is generated, for proposing experimental designs and diagnostics, for helping interpret results, and for retrieving and summarizing prior work. We have not used generative AI tools to generate the research question or the hypotheses, which are the authors' own, and the remaining categories requiring disclosure are not applicable to this work.
We have reviewed all AI-assisted work. All code was run by the authors and its outputs verified; the analysis was cross-checked against a second, independently written script. Every citation and every attribution of a result to prior work was checked by the authors against the original paper; two claims of novelty produced this way were incorrect and were withdrawn following that check. We take responsibility for the final content of this work, including text, claims or artifacts produced with the aid of generative AI.
References
S. Boucheron, O. Bousquot, and G. Lugosi. Theory of classification: A survey of some recent advances. ESAIM: Probability and Statistics, 9:323–375, 2005.
Sophie J. C Caron, Vanessa Ruta, L. F Abbott, and Richard Axel. Random convergence of olfactory inputs in the drosophila mushroom body. Nature, 497(7447):113–117, 2013. URL https://doi.org/10.1038/nature12063.
M. Chacron, A. Longtin, and L. Maler. Efficient computation via sparse coding in electrosensory neural networks. Current Opinion in Neurobiology, 21(5):752–760, 2011. URL https://doi.org/10.1016/j.conb.2011.05.016.
Sanjoy Dasgupta and Christopher Tosh. Expressivity of expand-and-sparsify representations, 2020. URL https://arxiv.org/abs/2006.03741.
Sanjoy Dasgupta, Charles F. Stevens, and Saket Navlakha. A neural algorithm for a fundamental computing problem. Science, 358(6364):793–796, 2017. doi: 10.1126/science.aam9868. URL https://doi.org/10.1126/science.aam9868.
Sanjoy Dasgupta, Timothy C. Sheehan, Charles F. Stevens, and Saket Navlakha. A neural data structure for novelty detection. Proceedings of the National Academy of Sciences, 115(51):13093–13098, 2018. URL https://doi.org/10.1073/pnas.1814448115.
Edouard Grave, Armand Joulin, and Nicolas Usunier. Improving neural language models with a continuous cache. In International Conference on Learning Representations, 2017. URL https://openreview.net/forum?id=B184E5qee.
Ankit Gupta, Guy Dar, Shaya Goodman, David Ciprut, and Jonathan Berant. Memory-efficient transformers via top-k attention. In Proceedings of the Second Workshop on Simple and Efficient Natural Language Processing, pages 39–52, 2021. URL https://aclanthology.org/2021.sustainlp-1.5.
Yuchen Liang, Chaitanya Ryali, Benjamin Hoover, Leopold Grinberg, Saket Navlakha, Mohammed J Zaki, and Dmitry Krotov. Can a fruit fly learn word embeddings? In International Conference on Learning Representations, 2021. URL https://openreview.net/forum?id=xfmSoxdxFCG.
Bruno A Olshausen and David J Field. Sparse coding of sensory inputs. Current Opinion in Neurobiology, 14(4):481–487, 2004. URL https://doi.org/10.1016/j.conb.2004.07.007.
Parikshit Ram and Kaushik Sinha. Federated nearest neighbor classification with a colony of fruit-flies. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 36, pages 8097–8105, 2022. URL https://doi.org/10.1609/aaai.v36i7.20775.
Chaitanya Ryali, John Hopfield, Leopold Grinberg, and Dmitry Krotov. Bio-inspired hashing for unsupervised similarity search. In International conference on machine learning, pages 8295–8306. PMLR, 2020. URL https://proceedings.mlr.press/v119/ryali20a.html.
Shai Shalev-Shwartz and Shai Ben-David. Understanding Machine Learning: From Theory to Algorithms. Cambridge University Press, 2014. ISBN 9781107057135.
Kaushik Sinha. Non-parametric classification via expand-and-sparsify representation. In Advances in Neural Information Processing Systems, pages 29657–29696, 2024. URL https://doi.org/10.52202/079017-0933.
Kaushik Sinha and Parikshit Ram. Fruit-fly inspired neighborhood encoding for classification. In Proceedings of the 27th ACM SIGKDD Conference on Knowledge Discovery & Data Mining, pages 1470–1480, 2021. doi: 10.1145/3447548.3467246. URL https://doi.org/10.1145/3447548.3467246.
Kaushik Sinha and Christopher Tosh. Optimal rates for density and mode estimation with expand-and-sparsify representations. In Proceedings of the International Conference on Artificial Intelligence and Statistics, 2026. URL https://openreview.net/forum?id=kHuqnMOJwD.
Rupesh Kumar Srivastava, Jonathan Masci, Sohrob Kazerounian, Faustino Gomez, and Jürgen Schmidhuber. Compete to compute. In Advances in Neural Information Processing Systems, 2013. URL https://dl.acm.org/doi/10.5555/2999792.2999870.
Dan D. Stettler and Richard Axel. Representations of odor in the piriform cortex. Neuron, 63(6):854–864, 2009. URL https://doi.org/10.1016/j.neuron.2009.09.005.
Ilya O Tolstikhin, Neil Houlsby, Alexander Kolesnikov, Lucas Beyer, Xiaohua Zhai, Thomas Unterthiner, Jessica Yung, Andreas Steiner, Daniel Keysers, Jakob Uszkoreit, et al. Mlp-mixer: An all-mlp architecture for vision. Advances in neural information processing systems, 34:24261–24272, 2021. URL https://proceedings.neurips.cc/paper/2021/hash/cba0a4ee5ccd02fda0fe3f9a3e7b89fe-Abstract.html.
Glenn C. Turner, Maxim Bazhenov, and Gilles Laurent. Olfactory representations by drosophila mushroom body neurons. Journal of Neurophysiology, 99(2):734–746, 2008. URL https://doi.org/10.1152/jn.01283.2007.
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. Advances in neural information processing systems, 30, 2017. URL https://proceedings.neurips.cc/paper/2017/hash/3f5ee243547dee91fbd053c1c4a845aa-Abstract.html.
Felix Wimbauer, Bichen Wu, Edgar Schoenfeld, Xiaoliang Dai, Ji Hou, Zijian He, Artsiom Sanakoyeu, Peizhao Zhang, Sam Tsai, Jonas Kohler, Christian Rupprecht, Daniel Cremers, Peter Vajda, and Jialiang Wang. Cache me if you can: Accelerating diffusion models through block caching. In 2024 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 6211–6220, 2024. URL https://doi.org/10.1109/CVPR52733.2024.00594.
Tong Zhang. Statistical behavior and consistency of classification methods based on convex risk minimization. The Annals of Statistics, 32(1):56–134, Feb 2004.
A Related work
Expand-and-sparsify representations. An EaS representation maps to a much higher-dimensional sparse code by applying a linear map with and retaining only the largest coordinates. The construction formalizes a circuit in the Drosophila olfactory system, in which a -dimensional signal is lifted to roughly Kenyon cells through a connectivity pattern that appears random, after which feedback from a single inhibitory neuron suppresses all but the ( ) highest-firing cells [Dasgupta et al., 2017, 2018]. Similar motifs are reported in the olfactory system of rodents, the visual cortex of cats and the electrosensory system of electric fish. Dasgupta and Tosh [2020] give the framework we adopt: the rows of are drawn i.i.d. from a distribution over , and is sparsified either by -winner-take-all or by -thresholding. Dasgupta and Tosh [2020, Theorem 3] establishes universal approximation under -WTA with uniform on (the dimensional unit sphere), provided ; we restate their results, and the corresponding lower bounds on from Sinha [2024] and Sinha and Tosh [2026], in section D.
Data-dependent expansions. Dasgupta and Tosh [2020, §5] analyze what they call a data-dependent expansion mapping, in which the rows of M are drawn i.i.d. from a distribution whose support coincides with the support of the data distribution, so the rows of M take values over the same support as the inputs. Their Theorem 9 gives an approximation bound under this assumption with two properties the data-independent bounds lack: k may be taken as small as desired, and there is no dependence on the ambient dimension d, even in the constants. They describe this as “mild data-dependence” and note it “leads to significantly better approximation”, and their stated open problem is “more sophisticated forms of adaptivity, for instance based on a clustering of the data”.
The subsequent literature nonetheless works in the data-independent setting. Sinha and Ram [2021] and Ram and Sinha [2022] take random with nonzero entries per row. Sinha [2024] draws the rows i.i.d. uniform on or i.i.d. Gaussian , and closes by noting that “in both algorithms, the projection directions are chosen in a data-independent manner”, with data-dependent choices left to future work. Sinha and Tosh [2026] likewise sample the rows from a fixed .
Sparsity level and expanded dimension, empirically. Ram and Sinha [2022] tune over 70 OpenML datasets with and , and in a per-parameter study observe that for fixed , increasing improves accuracy but only up to a bound, and that increasing helps “up to a point after which it can hurt performance unless is increased as well”, since it reduces the sparsity of the code. Section 3.4 quantifies the same interaction against a ReLU baseline, which their study does not include.
Competition as an activation function. Srivastava et al. [2013] propose local winner-take-all layers, in which units are partitioned into blocks and only the maximum within each block propagates its activation. Their framework permits any block size and any activation, but in order to study competition in isolation they take the activation to be the identity and use blocks of size two throughout, which fixes the sparsity of the layer at exactly 50%. We are explicitly interested in the EaS setting where we first have an expansion to m dimensions followed by a k-sparsification with . Thus, our setting introduces the expansion, and the high sparsity regime, neither of which is considered in Srivastava et al. [2013]. But we consider LWTA@k as a different sparsification scheme in addition to topk considered in existing literature on EaS representations for completeness.
B What the sparsity is worth in practice
Section 3 measures accuracy. This appendix sets out what an extremely and predictably (always exactly nonzeros) sparse expanded representation buys in compute and memory, which is the reason the accuracy question is worth asking at all.
Loading the next layer’s weights. With as a k-sparse EaS representation, only the k nonzero coordinates of z contribute to Wz, so only the k columns of that multiply them need to be loaded. For a single input this is a factor fewer columns, which at our loosest setting is 10 and at our tightest is 1000. With a batch of b inputs the union of the active coordinates is what matters, so at most bk columns are needed. That bound is attained only when no two inputs in the batch share an active coordinate. In practice inputs that are close to each other activate overlapping sets, so the number of columns actually loaded is smaller than bk, and how much smaller depends on how correlated the batch is. Overall, this allows for a reduction of the memory overhead from the naive to load the whole W to where we just load the “batch-activated” rows of W. Sparse linear algebra kernels can also reduce the naive computational complexity of Wz from to for each z.
Backpropagation and caching. The same argument applies to the backward pass: gradients flow only through the k nodes that were active, so the memory needed to backpropagate through the layer scales with k rather than m [Gupta et al., 2021]. Where intermediate activations are cached rather than recomputed [Grave et al., 2017, Wimbauer et al., 2024], a representation with exactly k nonzeros can be stored as k index-value pairs instead of m values, which is a factor m/2k in the value-passing form and m/k indices alone in the binary form considered in section 3.3.
Binary codes. A binary EaS representation is fixed entirely by which coordinates are active, so it can be stored as indices of bits each and no values; at that is 15 bits per active unit. The next layer then needs no multiplications, since Wz is the sum of the columns of W that z selects. A binarized ReLU layer shares the second property, but the number of units it activates varies from input to input, so its storage cannot be fixed in advance. Section 3.3 shows that on classification EaS gets these savings at no measurable cost in accuracy.
Why predictability matters. A representation that is merely sparse on average still has to be allocated for its worst case. Top-k is sparse by construction, with the same count for every input, so the working set is known ahead of time and does not have to be sized for an unlucky batch. This is the property that separates EaS from sparsity that emerges from a ReLU, and it is why we hold k fixed rather than letting the layer choose how many units to activate.
C The tuning asymmetry
We select k on validation for top-k and LWTA, while ReLU, GELU and SiLU have no comparable hyper-parameter, so part of what section 3.2 compares is the freedom to tune. Two things bound that freedom. Every setting we allow keeps at most a tenth of the coordinates, so the sparse activations are under a constraint the dense ones do not face even at their loosest. And section 3.4 repeats the comparison at fixed sparsity levels with no selection over k at all, where the 90% level matches ReLU at every expansion factor. A reader who wants the strictest reading should take that result rather than section 3.2 as the headline. Validation also tends to pick the loosest level we allow: the selected k/m is the top of our grid (0.10) in about half of the classification configurations and in 59% to 69% of the regression ones, so the cap binds for the sparse activations rather than being a formality.
D Theoretical guarantees and the resulting constraint on k
This appendix collects the results referred to in section A. Nothing here is ours; we state it because the constraint it places on k is what makes our sparsity grid a departure from the theory rather than an instance of it.
Approximation under a data-independent projection. Dasgupta and Tosh [2020] draw the rows of M i.i.d. from a distribution over and sparsify either by -winner-take-all or by -thresholding, in which each coordinate has its own threshold set so that fires a fraction of the time. Their Theorem 3 establishes a universal approximation property under -WTA with uniform on : for -Lipschitz , an explicitly specified linear function of , denoted by , attains whenever . Their Theorem 4 shows that this scheme is not adaptive to manifold structure, since on a one-dimensional circle in most are never activated, while their Theorem 8 shows that -thresholding is.
Approximation under a data-supported projection. Theorem 9 of Dasgupta and Tosh [2020] gives an optimal of under their data-dependent sampling, an absolute quantity fixed by the intrinsic dimension . We do not use this as a prescription: is not known in practice, and parameterizing by has the practical advantage of controlling the sparsity of the representation directly, which is the quantity we want to vary.
The lower bounds on . The guarantees above constrain from below. Dasgupta and Tosh [2020] require for their cell-diameter bound; Theorem 3.12 of Sinha [2024] carries the same condition, and its empirical section accordingly sets ; Lemma 5.2 of Sinha and Tosh [2026] requires . These are lower bounds ensuring the response regions are well estimated, not prescriptions for an optimal , and they sit inside asymptotic regimes far from what is reachable in practice: Corollary 3.13 of Sinha [2024] sets , which is exponentially large in . We therefore parameterize by and report results as functions of . Since our is not exponential in , the extreme sparsity regime we work in, , is outside the range these bounds cover, and our results should be read as evidence about that regime rather than as a test of the theory.
E Wins, ties and losses at every expansion factor
The tables below give every comparison of section 3 at every expansion factor: table 2 the classification comparisons against ReLU summarized in table 1, table 4 the same comparisons and the binary ones on the regression tasks, table 3 the binary codes on classification, and table 5 the fixed sparsity levels of section 3.4.
Table 2: Table 1 at every expansion factor. Each cell gives wins/ties/losses and, below it, the Wilcoxon -value; a star marks .
| activation | ||||||||
|---|---|---|---|---|---|---|---|---|
| top- | 17/15/25 | 22/13/31 | 27/9/35 | 22/12/37 | 24/12/35 | 27/9/35 | 30/12/28 | 31/9/27 |
| (.198) | (.686) | (.585) | (.178) | (.727) | (.800) | (.574) | (.321) | |
| LWTA | 19/14/24 | 20/15/31 | 25/9/37 | 24/8/39 | 25/11/35 | 21/16/34 | 31/8/31 | 28/13/26 |
| (.517) | (.370) | (.425) | (.105) | (.373) | (.725) | (.757) | (.616) | |
| GELU | 25/3/29 | 31/5/30 | 23/4/44* | 22/7/42* | 19/10/42* | 21/8/42* | 23/11/36* | 22/8/37 |
| (.899) | (.922) | (.023) | (.014) | (.002) | (.005) | (.044) | (.101) | |
| SiLU | 21/6/30 | 28/3/35 | 21/4/46* | 20/4/47* | 15/6/50* | 21/6/44* | 17/8/45* | 20/11/36* |
| (.255) | (.321) | (.001) | (.002) | (<.001) | (.002) | (.003) | (.007) |
Table 3: Binary codes (section 3.3). The first two rows compare each binarized sparse code against the binarized dense layer; the last three give what binarizing costs each activation, as its binary form minus its own value-passing form. Each cell gives the median difference in accuracy points, wins/ties/losses over datasets and the two-sided Wilcoxon -value; a star marks . is learned on both sides.
| comparison | ||||||||
|---|---|---|---|---|---|---|---|---|
| top- bin. – ReLU bin. | 0.00 | 0.00 | 0.00 | +0.37 | +0.58 | +0.56 | +0.62 | +0.50 |
| 26/13/18 (.821) | 26/11/29 (.709) | 30/8/33 (.301) | 38/5/28 (.274) | 40/4/27* (.043) | 44/5/22* (.023) | 48/5/17* (<.001) | 43/2/22* (.002) | |
| LWTA bin. – ReLU bin. | 0.00 | 0.00 | 0.00 | 0.00 | +0.26 | +0.52 | +0.42 | +0.52 |
| 22/12/23 (.710) | 28/10/28 (.920) | 30/8/33 (.513) | 31/9/31 (.709) | 36/9/26 (.189) | 44/8/19* (.011) | 42/5/23* (.034) | 44/3/20* (.005) | |
| ReLU bin. – ReLU | 0.00 | 0.00 | -0.05 | -0.12 | 0.00 | -0.29 | -0.43 | -0.39 |
| 21/17/35 (.226) | 27/14/31 (.860) | 27/9/36 (.669) | 26/9/36 (.291) | 28/9/34 (.356) | 29/6/36 (.703) | 21/10/39* (.027) | 16/8/43* (.004) | |
| top- bin. – top- | 0.00 | -0.05 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 |
| 20/18/19 (.816) | 20/14/32 (.680) | 26/11/34 (.465) | 28/12/31 (.987) | 30/11/30 (.507) | 33/9/29 (.229) | 30/13/27 (.565) | 25/16/26 (.978) | |
| LWTA bin. – LWTA | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | +0.13 | 0.00 | 0.00 |
| 12/18/27 (.074) | 23/13/30 (1.000) | 30/9/32 (.886) | 26/16/29 (.666) | 30/14/27 (.438) | 36/16/19* (.025) | 25/18/27 (.779) | 29/12/26 (.476) |
Table 4: The comparisons of table 2 and table 3 on the 48 regression tasks, where the metric is , reported raw, with chosen on the raw validation score. Each cell gives the median difference, wins/ties/losses and the Wilcoxon -value; a star marks . The top block scores every activation on the same datasets within each expansion factor, 32 at , 48 at and , and 46 at ; the bottom block pairs each comparison on its own datasets. With floored at zero every verdict is the same except two, both at : SiLU becomes significantly behind ReLU and binarizing ReLU is no longer significant.
| comparison | ||||||||
|---|---|---|---|---|---|---|---|---|
| top- | -0.038 | -0.030 | -0.008 | -0.014 | -0.007 | -0.001 | -0.001 | 0.002 |
| 6/0/26* (<.001) | 8/1/34* (<.001) | 16/1/29 (.116) | 15/1/32 (.070) | 15/1/32 (.332) | 22/1/24 (.747) | 21/3/23 (.522) | 26/3/17 (.186) | |
| LWTA | -0.030 | -0.025 | -0.011 | -0.011 | -0.007 | 0.001 | 0.001 | 0.002 |
| 6/0/26* (.001) | 8/0/35* (<.001) | 14/1/31* (.023) | 15/1/32 (.082) | 15/2/31 (.120) | 23/3/21 (.861) | 23/4/20 (.273) | 25/1/20 (.251) | |
| GELU | -0.008 | -0.010 | -0.006 | -0.003 | -0.004 | -0.001 | -0.001 | -0.006 |
| 10/1/21* (.025) | 15/0/28* (.017) | 16/4/26 (.068) | 16/2/30* (.025) | 19/2/27 (.155) | 20/3/24 (.214) | 19/4/24 (.210) | 15/1/30* (.024) | |
| SiLU | -0.015 | -0.018 | -0.007 | -0.009 | -0.009 | -0.003 | -0.001 | -0.003 |
| 6/1/25* (.003) | 14/1/28* (.002) | 12/3/31* (.004) | 15/3/30* (.003) | 15/3/30* (.017) | 15/4/28* (.030) | 21/2/24 (.218) | 15/1/30 (.080) | |
| top- bin. – ReLU bin. | -0.035 | -0.007 | 0.010 | 0.009 | 0.014 | 0.028 | 0.017 | 0.016 |
| 11/0/21 (.243) | 20/0/23 (.518) | 27/1/18 (.132) | 28/0/20 (.102) | 30/0/18* (.030) | 35/0/12* (.001) | 29/3/15* (.009) | 26/0/20 (.068) | |
| LWTA bin. – ReLU bin. | -0.039 | -0.010 | 0.006 | -0.003 | 0.009 | 0.027 | 0.009 | 0.012 |
| 10/0/22 (.102) | 18/2/23 (.254) | 24/0/22 (.519) | 23/1/24 (.397) | 25/2/21 (.165) | 30/2/15* (.012) | 27/2/18* (.046) | 28/0/18 (.082) | |
| ReLU bin. – ReLU | -0.068 | -0.051 | -0.045 | -0.023 | -0.025 | -0.024 | -0.021 | -0.015 |
| 7/0/41* (<.001) | 5/0/43* (<.001) | 9/0/39* (<.001) | 11/0/37* (<.001) | 16/1/31* (.002) | 13/0/34* (.003) | 18/0/29* (.012) | 16/0/30* (.027) | |
| top- bin. – top- | -0.037 | -0.037 | -0.028 | -0.021 | -0.022 | -0.011 | -0.010 | -0.013 |
| 6/0/26* (<.001) | 7/0/36* (<.001) | 6/1/39* (<.001) | 10/0/38* (<.001) | 4/2/42* (<.001) | 10/3/34* (.001) | 8/3/36* (<.001) | 5/2/39* (<.001) | |
| LWTA bin. – LWTA | -0.055 | -0.033 | -0.029 | -0.025 | -0.021 | -0.016 | -0.013 | -0.011 |
| 4/0/28* (<.001) | 7/1/35* (<.001) | 6/2/38* (<.001) | 6/1/41* (<.001) | 9/0/39* (<.001) | 9/0/38* (<.001) | 7/0/40* (<.001) | 8/4/34* (<.001) |
Table 5: Fixed sparsity levels (section 3.4): top- at a fixed , with no selection over , minus ReLU at the same expanded dimension. Each cell gives the median difference in accuracy points, wins/ties/losses over datasets and the two-sided Wilcoxon -value; a star marks . is learned on both sides.
| comparison | ||||||||
|---|---|---|---|---|---|---|---|---|
| 90% () | 0.00 | 0.00 | 0.00 | -0.02 | 0.00 | -0.01 | 0.00 | +0.07 |
| 18/19/27 (.328) | 22/14/33 (.391) | 25/13/34 (.350) | 23/14/34 (.518) | 21/18/32 (.324) | 27/12/32 (.592) | 32/12/26 (.324) | 31/9/27 (.211) | |
| 97% () | -0.26 | -0.36 | -0.59 | -0.53 | -0.33 | -0.14 | -0.35 | -0.01 |
| 10/5/15 (.237) | 13/11/24 (.111) | 16/12/38* (.002) | 18/9/44* (.003) | 22/7/42* (.033) | 22/12/37 (.171) | 25/7/38 (.230) | 27/8/32 (.434) | |
| 99% () | -3.28 | 0.00 | -2.42 | -2.06 | -2.00 | -0.99 | -0.61 | -0.35 |
| 1/2/5 (.076) | 6/7/10 (.118) | 6/7/28* (<.001) | 5/7/41* (<.001) | 5/6/54* (<.001) | 16/5/50* (<.001) | 16/9/45* (.008) | 18/10/39* (.039) |
F Dataset counts per expansion factor
The number of datasets entering each comparison changes with , for three separate reasons, and we list them here so that no count in the main text is unexplained.
Table 6: Datasets supporting each group of methods at each expansion factor.
| 2 | 4 | 8 | 16 | 64 | 128 | 256 | ||
|---|---|---|---|---|---|---|---|---|
| dense activations | 73 | 72 | 72 | 71 | 71 | 71 | 70 | 67 |
| sparse activations | 57 | 66 | 71 | 71 | 71 | 71 | 70 | 67 |
| data-supported | 57 | 66 | 68 | 71 | 71 | 71 | 70 | 67 |
First, the integer- floor. The smallest sparsity level an integer can reach is , so a dataset admits a sparse method at only when . At this excludes the eight datasets with , taking the pool from 73 to 65. It does not account for the whole of the first column: the observed count is 57, eight lower again. That remainder is coverage of our sweep rather than a property of the method, and it is visible on its own at , where the floor binds on no dataset in our pool yet the sparse methods are supported by 66 rather than 73. From onwards the two rows agree to within one dataset.
Second, the cap, which is what reduces both rows from 71 to 67 between and . This affects every method equally and so does not bias any comparison.
Third, two gaps that are not about expansion factors at all. Three of the 76 admissible classification tasks are absent because they one-hot encode to an input dimension of roughly 10,000, which made every expansion too expensive for our budget. And our two sweeps used different sparsity grids, so the level is defined over only part of the expansion range and we do not report it.
The regression pool behaves the same way. The paired comparison against ReLU rests on 32 of the 48 tasks at , 43 at , 46 at and all 48 from onwards. The integer- floor admits 41, 48, 48 and 48 at those four expansion factors, so here too it sets the shape of the narrow end without being the whole of it, and the residual is again sweep coverage.
Table 7 gives the number of datasets behind every point of fig. 3, where a dataset counts only if all three constructions of are present at that expansion factor and sparsity level. A dash marks a point supported by fewer than 10 datasets, which the figure omits.
Table 7: Datasets behind each point of fig. 3, by task type, sparsity level and expansion factor.
| task | k/m | m/d=1 | 2 | 4 | 8 | 16 | 64 | 128 | 256 |
|---|---|---|---|---|---|---|---|---|---|
| binary | 0.01 | - | 12 | 26 | 28 | 37 | 37 | 37 | 35 |
| 0.1 | 27 | 34 | 34 | 35 | 37 | 37 | 37 | 35 | |
| tuned | 30 | 34 | 35 | 37 | 37 | 37 | 37 | 35 | |
| multi-class | 0.01 | - | 14 | 19 | 28 | 34 | 34 | 33 | 32 |
| 0.1 | 22 | 30 | 31 | 33 | 34 | 34 | 33 | 32 | |
| tuned | 27 | 32 | 33 | 34 | 34 | 34 | 33 | 32 | |
| regression | 0.01 | - | - | 16 | 27 | 33 | 32 | 32 | 31 |
| 0.1 | 17 | 19 | 31 | 32 | 33 | 32 | 32 | 31 | |
| tuned | 19 | 29 | 32 | 33 | 33 | 32 | 32 | 31 |
How many units LWTA@k keeps. LWTA@k keeps one unit per block of size round, which is units: exactly when divides , and otherwise usually or . Among the configurations selected on validation, keep exactly units, keep , keep between and , and two keep . The realised sparsity then exceeds in about of the classification configurations and of the regression ones, all at . Removing them changes no classification conclusion, and on regression it removes only the significance of LWTA@k's deficit at .
G Distinct rows of the data-supported expansion
Table 8: How many of the rows of a data-supported are distinct. The rows are drawn from the training inputs with replacement, so the count is bounded by and the fraction falls as grows. is the number of (dataset, sparsity level) configurations entering the column. Each row is a separate median over those configurations, so the last row is the median of the per-configuration fraction and not the quotient of the two rows above it.
| 2 | 4 | 8 | 16 | 64 | 128 | 256 | ||
|---|---|---|---|---|---|---|---|---|
| configurations | 120 | 166 | 192 | 207 | 237 | 275 | 285 | 276 |
| median | 58 | 106 | 184 | 296 | 592 | 2304 | 4096 | 6912 |
| median distinct rows | 54 | 102 | 158 | 244 | 326 | 622 | 665 | 693 |
| median fraction distinct | 96.9% | 94.7% | 89.9% | 85.2% | 75.6% | 38.5% | 21.6% | 12.0% |
The difference between the two comparisons in section 3.1 has a cause we can measure. The rows of a data-supported are training points, so it can never hold more than distinct directions however large becomes, while the other two constructions hold . The fraction of that is distinct falls from 97% at to 76% at and 12% at (table 8). Compared against a data-independent , the sampled one wins at , 2d and 4d, by a median 1.64, 1.55 and 0.91 points, all significant; is indistinguishable at and ; and loses from , by 0.41, 0.38 and 0.77 points, again all significant. The sign changes in exactly the range where the fraction of distinct rows falls through three quarters, which is what we would expect if its advantage comes from the directions being real data and its disadvantage from there not being enough of them. Regression shows the same crossover at the same expansion factors: the sampled M is ahead of a data-independent one at , by a median 0.044, 0.024 and 0.013 in (), indistinguishable at and , and behind from , by 0.019 to 0.024 (), with raw or floored.
The saturation is a property of sampling with replacement rather than of our data: once exceeds the training set size, no further distinct rows are available to draw. Its consequence is the crossover above: identical rows give identical pre-activations, so a top- over a saturated is choosing among ties, and the expansion has far fewer distinct directions than its nominal size.
H Approximation and generalization results
In this section we bound the excess Bayes risk when is random and is learned via SGD using binary cross entropy (bce) loss in the binary classification setting. SGD learns a function from the following function class:
where is the winners-take-all activation such that for any , sets the largest entries of to 1 and the rest to zero.
We first show that the bce loss and logistic loss are mathematically equivalent as this will help us work with logistic loss instead of bce loss. For any , let . Then the bce loss is defined as:
where is the sigmoid function. Note that . Next, the logistic loss function is defined as:
Note that here . It is easy to use the transformation and write the logistic loss in terms of as follows:
Lemma H.1. The bce loss given in equation 2 and the logistic loss given in equation 4 are equivalent.
Proof. For y = 1,
Similarly, for y = 0,
From now on, we will assume that the labels come from the set and because of the equivalency above, use the logistic loss given in equation 3.
To formalize the learning problem, we introduce a probabilistic setting, and let be an - valued random pair, modeling observation and its corresponding class. The distribution of the random pair may be described by the probability distribution of (given by the probabilities for all measurable subsets ) and conditional probability, . For any classifier , its probability of error (also known as risk) is given by
and given a training set sampled i.i.d. from , its empirical version is given by:
Given , one may easily construct a classifier with minimal probability of error, known as the Bayes optimal classifier as follows:
The minimal risk . Given a training set sampled i.i.d. from , we learn a function by minimizing empirical logistic loss using SGD and we aim to bound .
Theorem H.2. Let be the solution for the setting where is random and is obtained by minimizing empirical logistic loss using SGD. For the EaS representation, let . Fix any . Then with probability at least ,
Proof. Consider the logit cost function , which is a non-negative non-decreasing convex function satisfying and . For any function , note that cost functional is the expected logistic loss and its empirical version is . It is easy to check that and . Note that for any , we have
For each , define . Therefore, the function that minimizes the cost functional is given by
Since is strictly convex and differentiable, is well defined and the minimum is achieved for the value of for which , that is when,
Since and , plugging in these values and simplifying yields , that is . Note that is positive if and only if . Therefore, the function is the Bayes optimal classifier.
Let . Now we want to bound the excess probability of error in terms of . Towards this end we use an inequality from [Zhang, 2004] which says that if the function defined by and cost function is such that for some positive constants and it satisfies
then, for any function it holds that
In our case, since minimizes , plugging in this value and simplifying yields . Therefore, equation 8 holds with and .
Let be the function obtained by minimizing empirical logistic loss using SGD. Let whose weight vector is specified by , where (see [Dasgupta and Tosh, 2020] for details). Then we have,
where, inequality follows using elementary inequality (for example, see (2) of [Boucheron et al., 2005]) and inequality follows from Lemma H.3. Inequality is due to Lemma H.4, and inequality is due to our choice of .
Lemma H.3. (Estimation error) Let denote a uniform upper bound on and let be the Lipschitz constant of the logit cost function . Fix any . Then there exists a positive constant such that with probability at least , the following holds:
Proof. Let be the class of functions of the form . For the training set , let and . Let and , where . Using Theorem 3.2 of [Boucheron et al., 2005], with probability at least ,
where, inequality is due to contraction principle (Theorem 3.3 of [Boucheron et al., 2005], equality is due to the fact that Radamacher complexity (again, due to Theorem 3.3 of [Boucheron et al., 2005], and inequality is due to Theorem 26.10 of [Shalev-Shwartz and Ben-David, 2014]. Finally, inequality follows from the fact that beining a vector in , the quantity which is an upper bound on must be . Also, for any , since is a -sparse vector the quantity .
Lemma H.4. (Approximation error) Let and be as defined above. Assume to be Lipschitz. Pick any . Then with probability at least , over the choice of , we have,
where is a constant that depends on d and is a positive constant.
Proof.
where, inequality is due to Jensen's inequality, inequality follows from the fact that the function is 1-Lipschitz. Inequality holds with probability at least and follows from Theorem 3 of [Dasgupta and Tosh, 2020].
I Convergence and generalization gap
Beyond test performance, we ask whether a learned EaS representation takes longer to train than a dense one, and whether it overfits more. Both can be read from the runs behind section 3.2 without training anything new. For every configuration we record the number of epochs after which early stopping ended training (patience 30, at most 300 epochs) and the training score of the model that early stopping kept, each averaged over the three splits; the generalization gap is the training score minus the test score. We compare each activation against ReLU exactly as in section 3.2: M and w are learned in both, k is selected on validation and every quantity is read from the selected configuration, the comparison is paired within each expansion factor, and significance is a two-sided Wilcoxon signed rank test. Figure 7 shows the median differences for every activation, and tables 9 and 10 give the numbers for the sparse ones.
Convergence. The sparse activations do not take longer to train. The number of epochs until early stopping is not significantly different from ReLU at any expansion factor, on classification or on regression, for topk ( ) or for LWTA@k ( ). The medians stay within 3.3 epochs of ReLU on classification and within 4.5 (topk) and 10.3 (LWTA@k) on regression, against median training lengths of 57 and 106 epochs. It is the smooth dense activations that train longer: from m = 64d, GELU and SiLU stop a median 2.3 to 9.0 epochs later than ReLU on classification and 8.5 to 17.7 epochs later on regression, significantly at every one of these expansion factors except GELU on regression at m = 256d (p = 0.080). Two remarks qualify this. First, epochs measure optimization progress rather than wall-clock time, which depends on how the selection of the k largest units is implemented (section B). Second, the 300-epoch cap stopped a few runs before early stopping did (on all three splits in 2 of 544 classification cells for topk and 4 of 567 for ReLU, and in 14 of 357 and 42 of 380 regression cells); the cap truncates ReLU more often, so it does not make the sparse activations look faster than they are.
Generalization gap. The sparse activations do have a larger gap between training and test score than ReLU. For topk the difference is significant at every expansion factor on classification and from m = 4d on regression, and it is larger at wider expansions: a median of 0.85 to 1.41 accuracy points from m = 8d, and 0.055 to 0.070 in from m = 64d. LWTA@k is the same (significant at 7 and 6 of the 8 expansion factors). The larger gap comes from the training score, not from the test score: from m = 8d, topk reaches a significantly higher training score than ReLU on both tasks (by a median 0.73 to 1.59 accuracy points and 0.013 to 0.083 in ), while its test score is not significantly different at any expansion factor on classification and from m = 4d on regression (section 3.2). Where topk does trail ReLU on regression, at m = d and m = 2d, its training score top-k LWTA GELU SiLU

Figure 7: Convergence and generalization gap against ReLU at equal expanded dimension, with M and w learned for both methods and k selected on validation for the sparse activations. [Left] Epochs until early stopping ended training. [Middle] Training score. [Right] Training minus test score. Top row: the 73 classification tasks, in accuracy points; bottom row: the 48 regression tasks, in multiplied by 100. Lines are medians over datasets, ribbons the interquartile range; filled markers are significant (two-sided Wilcoxon, p < 0.05) and hollow ones are not. The test-score comparison is in fig. 4.
is lower too (by a median 0.033 and 0.018 in , significantly at m = d, p = 0.002), so there the sparse representation underfits rather than overfits. The smooth activations go the other way: GELU and SiLU reach a lower training score than ReLU (significantly at 6 of the 8 expansion factors on classification and at all 8 on regression) and have a smaller gap (from m = 64d on classification and at every expansion factor on regression), while their test score is also lower.
In summary, learning an EaS representation by gradient descent is not slower than learning a dense ReLU representation of the same size, and the learned EaS representation fits the training data more closely without losing test performance (from m = 4d on regression). Its gap is therefore larger, not smaller: the additional fit to the training data does not carry over to the test data. As in section C, k is selected for the sparse activations while ReLU has no comparable choice. That selection, like early stopping, uses the validation score and never the training score, so a higher training score is not what it optimizes for: the values of k chosen for their validation score also turn out to fit the training data more closely than ReLU.
Table 9: Convergence and generalization gap on the 73 classification tasks: each sparse activation minus ReLU, with M and w learned in both and k selected on validation. Epochs are counted until early stopping ended training; the training score and the gap (training minus test score) are in accuracy points. Each cell gives the median difference, wins/ties/losses over datasets and the two-sided Wilcoxon p-value; a star marks p < 0.05. The test-score comparison is in table 2.
| comparison | m/d = 1 | m/d = 2 | m/d = 4 | m/d = 8 | m/d = 16 | m/d = 64 | m/d = 128 | m/d = 256 |
|---|---|---|---|---|---|---|---|---|
| epochs, top-k | 0.0 | 0.0 | 0.0 | -3.3 | 0.0 | +1.3 | +0.8 | +1.0 |
| 18/12/27 | 28/11/27 | 29/8/34 | 28/4/39 | 34/4/33 | 38/1/32 | 37/2/31 | 39/0/28 | |
| (.245) | (.847) | (.479) | (.166) | (.788) | (.361) | (.465) | (.277) | |
| epochs, LWTA | 0.0 | 0.0 | 0.0 | -1.7 | +0.3 | +1.3 | -1.8 | -2.0 |
| 16/13/28 | 29/10/27 | 34/5/32 | 31/4/36 | 36/4/31 | 38/4/29 | 31/1/38 | 29/0/38 | |
| (.163) | (.893) | (.821) | (.352) | (.923) | (.474) | (.936) | (.500) | |
| training score, top-k | 0.00 | +0.06 | +0.19 | +1.00 | +0.73 | +0.95 | +1.41 | +1.59 |
| 23/13/21 | 31/13/22 | 36/9/26 | 40/10/21* | 46/9/16* | 51/8/12* | 52/10/8* | 52/7/8* | |
| (.874) | (.105) | (.056) | (<.001) | (<.001) | (<.001) | (<.001) | (<.001) | |
| training score, LWTA | 0.00 | 0.00 | +0.36 | +1.00 | +1.05 | +1.05 | +1.40 | +1.52 |
| 24/14/19 | 31/14/21 | 38/11/22* | 47/7/17* | 51/11/9* | 53/13/5* | 53/9/8* | 55/9/3* | |
| (.555) | (.143) | (.009) | (<.001) | (<.001) | (<.001) | (<.001) | (<.001) | |
| gap, top-k | +0.01 | +0.39 | +0.59 | +0.85 | +1.36 | +1.41 | +1.05 | +1.05 |
| 26/16/15* | 42/12/12* | 51/10/10* | 55/7/9* | 53/8/10* | 53/7/11* | 53/7/10* | 50/8/9* | |
| (.032) | (<.001) | (<.001) | (<.001) | (<.001) | (<.001) | (<.001) | (<.001) | |
| gap, LWTA | 0.00 | +0.29 | +0.84 | +1.11 | +1.52 | +1.24 | +1.44 | +1.32 |
| 24/14/19 | 41/15/10* | 56/6/9* | 57/8/6* | 58/9/4* | 58/8/5* | 55/8/7* | 54/8/5* | |
| (.320) | (<.001) | (<.001) | (<.001) | (<.001) | (<.001) | (<.001) | (<.001) |
Table 10: The comparisons of table 9 on the 48 regression tasks, with the training score and the gap in , reported raw. The test-score comparison is in table 4.
| comparison | m/d = 1 | m/d = 2 | m/d = 4 | m/d = 8 | m/d = 16 | m/d = 64 | m/d = 128 | m/d = 256 |
|---|---|---|---|---|---|---|---|---|
| epochs, top-k | 0.0 | +1.3 | -4.5 | -1.7 | -1.7 | +3.7 | +2.3 | +1.3 |
| 15/5/12 | 24/3/16 | 20/1/25 | 22/1/25 | 22/0/26 | 28/0/19 | 27/0/20 | 24/0/22 | |
| (.683) | (.984) | (.245) | (.377) | (.335) | (.615) | (.676) | (.611) | |
| epochs, LWTA | -1.7 | 0.0 | -1.0 | -6.5 | +10.3 | +4.3 | +2.7 | -1.0 |
| 10/5/17 | 20/3/20 | 20/2/24 | 21/0/27 | 28/0/20 | 25/0/22 | 27/0/20 | 22/0/24 | |
| (.100) | (.614) | (.246) | (.343) | (.678) | (.800) | (.804) | (.523) | |
| training score, top-k | -0.033 | -0.018 | +0.002 | +0.013 | +0.026 | +0.070 | +0.083 | +0.081 |
| 7/0/25* | 15/0/28 | 23/0/23 | 28/1/19* | 29/1/18* | 34/0/13* | 33/2/12* | 36/1/9* | |
| (.002) | (.136) | (.315) | (.019) | (.004) | (<.001) | (<.001) | (<.001) | |
| training score, LWTA | -0.036 | -0.025 | +0.005 | +0.021 | +0.055 | +0.078 | +0.076 | +0.085 |
| 7/0/25* | 16/0/27 | 23/2/21 | 28/1/19* | 31/3/14* | 36/1/10* | 37/1/9* | 36/0/10* | |
| (<.001) | (.160) | (.169) | (.006) | (<.001) | (<.001) | (<.001) | (<.001) | |
| gap, top-k | +0.008 | +0.012 | +0.016 | +0.034 | +0.032 | +0.055 | +0.070 | +0.065 |
| 18/1/13 | 29/0/14 | 32/3/11* | 33/2/13* | 35/1/12* | 34/4/9* | 35/2/10* | 36/1/9* | |
| (.472) | (.067) | (.001) | (<.001) | (<.001) | (<.001) | (<.001) | (<.001) | |
| gap, LWTA | -0.005 | +0.012 | +0.030 | +0.043 | +0.057 | +0.065 | +0.070 | +0.074 |
| 13/1/18 | 28/1/14 | 36/1/9* | 35/3/10* | 37/4/7* | 37/2/8* | 39/1/7* | 38/0/8* | |
| (.438) | (.104) | (<.001) | (<.001) | (<.001) | (<.001) | (<.001) | (<.001) |