arXiv:2610.26470cs.LGOct 2026

Manuscript Offprint

arXiv:2610.26470

On Learning Expand-and-Sparsify Representations

Alireza Asghari, Parikshit Ram, Kaushik Sinha

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 RdR^d to a much larger dimensionality RmR^m with m≫dm \gg d, followed by a sparsification step which zeros out all but the top kk values in the mm-dimensional representation, with k≪mk \ll m. This scheme is neuro-biologically inspired, where the top- kk 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 m∼O(exp⁡(d))m \sim O(\exp(d)), thus limiting practical use. Learned expansions for supervised problems via stochastic gradient descent (SGD) and backpropagation with more practical values of m≫dm \gg d have not been explored. Expanded representations (with more practical values of m≥dm \geq d) are often employed in the single-hidden-layer feedforward networks,

Figure

(E)

ReLUWins/Ties/LossesSignificant at
vs GELU302/56/1865 of 8
vs SiLU333/48/1636 of 8
vs topk (EaS)253/91/2000 of 8
vs LWTA@k (EaS)257/94/1930 of 8

(F)

Learned MWins/Ties/LossesSignificant at
vs Random M361/86/977 of 8
vs Data-supp. M367/62/1128 of 8

Figure 1: What we compare, and what we find. (A) A linear operator M∈Rm×d\mathbf{M} \in \mathbb{R}^{m \times d} is applied to the input x∈Rd\mathbf{x} \in \mathbb{R}^d, giving us (B) an expanded representation Mx∈Rm\mathbf{M}\mathbf{x} \in \mathbb{R}^m, 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, m/dm/d) configurations, and “significant at” counts how many of the 8 expansion factors reach p<0.05p < 0.05 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 (k≪m)(k \ll m) 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 m/d∈[1,256]m / d \in [1, 256]) and the sparsity (k≤0.1mk \leq 0.1m), training over roughly 50,000 configurations (more than 160,000 training runs across three train/validation/test splits for each configuration). 1^{1} 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).

1^{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 m∼O(exp⁡(d))m \sim O(\exp(d)) , and in the classification setting the existing lower bound on k is Ω(dlog⁡m)\Omega(d \log m) . In our setting m is not scaled exponentially in d, so we instead work in an artificially restricted high-sparsity regime of k≤0.1mk \leq 0.1m . See section H for the theoretical guarantees achievable in this regime of (m,k)(m, k) .

• 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 ( p≤0.006p \leq 0.006) but not beyond. Regression behaves the same way, with a median gain of 0.185 in R2R^2 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 ( p≤0.0011p \leq 0.0011). A learned EaS representation can therefore be made small, tolerating smaller values of m≥dm \geq d.

• Learned EaS representations at k≤0.1mk \leq 0.1m 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 −0.22-0.22 and +0.05+0.05 points and p≥0.177p \geq 0.177 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 m≥4dm \geq 4d; below that the EaS representation trails ReLU significantly, by a median 0.04 in R2R^2 at m=dm = d and 0.03 at m=2dm = 2d.

• If the representation is restricted to be binary, the learned EaS representation is the better of the two from m=16dm = 16d 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 m≥128dm \geq 128d. 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 m=16dm = 16d 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 m=4dm = 4d to 0.35 at m=256dm = 256d. 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.

References (49)