---
title: 'Mean-Expansion Layer: Theory & Applications'
url: https://www.emergentmind.com/topics/mean-expansion-layer
type: topic
---

# Mean-Expansion Layer: Theory & Applications

A mean-expansion layer is a technical construction in which mean structure is made explicit rather than treated as an incidental summary statistic. In the most direct current usage, it denotes a parameter-free linear reparameterization of action-values in Q-learning, mapping residual outputs to full \(Q\)-values through \( \mathbf{q} = \mathbf{z} + k\,\mu_{\mathbf{z}}\mathbf{1} \) [2606.29806]. Closely related usages appear in generalized-mean neural networks, where a layer outputs several generalized means of the same weighted inputs [2006.01606]; in convolutional architectures, where a mean map layer embeds distributions of local features through kernel mean embeddings [1511.04150]; in low-bit LLM training, where mean-residual splitting isolates a rank-one mean component before quantized GeMMs [2603.10444]; and in statistical physics, where an \(M\)-layer construction expands around a Bethe mean-field reference solution [1707.08499]. This suggests a broader family of methods in which mean information is elevated into a structured computational object rather than collapsed into a single scalar.

## 1. Definition and terminological scope

In the narrow architectural sense, a mean-expansion layer is a fixed transformation that augments a representation by exposing its mean component as a separate degree of freedom. The clearest formal instance is the reinforcement-learning layer \(M_k = I + \frac{k}{n}J\), where \(J\) is the all-ones matrix and \(n=|\mathcal A|\); this layer leaves the component orthogonal to \(\mathbf{1}\) unchanged while scaling the mean component by \(k+1\) [2606.29806]. In that setting, the layer is linear, invertible, parameter-free, and appended as the final map of a Q-network.

A broader but still architectural usage appears in generalized-mean networks. There, one replaces a single dot-product neuron by a multiplet of neurons sharing the same weighted inputs but differing in their mean parameters, so that the layer outputs a vector of mean-based statistics rather than a scalar [2006.01606]. A still broader interpretation occurs in deep mean maps, where local features are first expanded into random Fourier features and then averaged, so that the layer represents a distribution of features rather than a pooled vector [1511.04150]. In low-bit LLM training, the operative move is different again: the feature-wise mean over tokens is explicitly extracted, quantized separately, and recombined with a centered residual path, turning the dominant mean direction into a controllable computational channel [2603.10444].

A frequent source of confusion is that the same phrase also appears in non-neural contexts. In Bethe \(M\)-layer methods, the “layer” is a family of replicated and rewired models indexed by \(M\), with \(1/M\) organizing corrections around a Bethe mean-field solution rather than around a feedforward operator [1707.08499]. In geometric analysis, “mean-expansion” concerns foliations constrained by \(H\), \(P\), and null expansions, not neural averaging [2207.14025]. The common denominator is explicit manipulation of mean structure, but the mathematical objects differ substantially.

## 2. Generalized-mean multiplets and nonlinear mean statistics

In multiplet neural networks, the basic scalar neuron replaces the affine form \(b+\sum_i w_i x_i\) by a weighted Lehmer mean,
\[
M(\mathbf{x}) = b + m\,\frac{\sum_i w_i x_i^p}{\sum_i w_i x_i^{p-1}},
\]
and a multiplet layer outputs several such means with shared \(\mathbf{x}\) and \(\mathbf{w}\) but distinct \(p_j\), optionally with distinct \(m_j,b_j\) [2006.01606]. The two-parameter extension replaces the denominator exponent \(p-1\) by \(p-q\),
\[
M_{p,q}(\mathbf{x}) = b + m\,\frac{\sum_i w_i x_i^p}{\sum_i w_i x_i^{p-q}},
\]
so a layer computes a vector \(\{M_{p_j,q_j}(\mathbf{x})\}_{j=1}^{\psi}\). In this construction, the mean parameter controls the regime: \(p\to-\infty\) approaches \(\min_i x_i\), \(p=0\) gives the harmonic mean, \(p=1\) the arithmetic mean, \(p=2\) the contraharmonic mean, and \(p\to\infty\) approaches \(\max_i x_i\).

The paper provides derivatives with respect to the weights and the mean parameters \(p,q\), so the layer is backpropagatable. For the Gini-style form \(M=b+mN/D\) with \(N=\sum_i w_i x_i^p\) and \(D=\sum_i w_i x_i^{p-q}\), the weight derivative is
\[
\frac{\partial M}{\partial w_k}
=
m\,\frac{D\,x_k^p - N\,x_k^{p-q}}{D^2},
\]
and analogous formulas are given for \(\partial M/\partial p\) and \(\partial M/\partial q\) [2006.01606]. A practical limitation is that the derivative with respect to \(p\) becomes very small for large \(|p|\), so hard min/max behavior can induce vanishing gradients.

The expressive consequences are unusually explicit. The construction yields a soft XOR in two layers without an external activation function, exact multiplication for two inputs via the choice \((p,q)=(1,2)\), exact inverse-product for \((p,q)=(-1,-2)\), and multi-layer realizations of division, truncated power series, and Padé-like rational approximants [2006.01606]. The same work introduces a case slope score
\[
\nu=\tanh\left(\left|
\frac{\sum_i w_i z_i^6}{\sum_i w_i z_i^5}
-
\frac{\sum_i w_i z_i^{-3}}{\sum_i w_i z_i^{-4}}
\right|\right),
\]
used to modulate learning rates according to homogeneity of the selected elements, and reports that on Iris a 2-layer multiplet network with 12 parameters converged in about \(1/10\)th of the time of a 4-layer standard network with two 8-unit hidden layers while achieving comparable classification [2006.01606]. In this sense, mean-expansion is not merely pooling; it is a structured nonlinear basis over soft-min, soft-max, harmonic, arithmetic, and power-like aggregates.

## 3. Action-value mean-expansion in reinforcement learning

The explicitly named mean-expansion layer in deep RL is a reparameterization of the action-value vector \(\mathbf q \in \mathbb R^n\). Instead of predicting \(\mathbf q\) directly, the network predicts a residual vector \(\mathbf z\), and a fixed final layer computes
\[
\mathbf q = M_k \mathbf z
=
\left(I+\frac{k}{n}J\right)\mathbf z
=
\mathbf z + k\,\mu_{\mathbf z}\mathbf 1,
\]
where \(\mu_{\mathbf z}=\frac{1}{n}\sum_{i=1}^n z_i\) [2606.29806]. The implied baseline is
\[
b = \frac{k}{n}\sum_{i=1}^n z_i = k\,\mu_{\mathbf z},
\]
so each action-value is \(q_i = z_i + b\). The mean component is scaled by \(k+1\), while directions orthogonal to \(\mathbf 1\) are unchanged.

This reparameterization serves two purposes. First, it shares value across actions within a state: any update to one residual changes the shared baseline and hence all \(Q(s,a)\). In tabular implicit-baseline Q-learning, a TD update at \((s_t,a_t)\) yields
\[
Z(s_t,a_t)\leftarrow Z(s_t,a_t)+\alpha_t\delta_t\left(1+\frac{k}{n}\right),
\]
and for all \(a\neq a_t\),
\[
Z(s_t,a)\leftarrow Z(s_t,a)+\alpha_t\delta_t\left(\frac{k}{n}\right),
\]
so the TD error spreads across actions [2606.29806]. Second, it lowers the norm of the learned representation. The optimal explicit baseline for minimizing \(\|\mathbf u(\mathbf q,b)\|_2^2\), where \(\mathbf u(\mathbf q,b)=[q_1-b,\dots,q_n-b,b]^\top\), is
\[
b^*=\frac{\sum_{i=1}^n q_i}{n+1},
\]
and the paper shows that for suitable \(k>0\) the residual representation has strictly smaller norm than the direct \(Q\)-vector [2606.29806].

Architecturally, the layer is appended to standard DQN or IQN heads without altering replay, target networks, or the underlying Bellman objective. The resulting methods are denoted \(\mathrm{IB\text{-}DQN}(k)\) and \(\mathrm{IB\text{-}IQN}(k)\), with DQN recovered at \(k=0\) [2606.29806]. The reported effects are broad: in a \(5\times5\) stochastic gridworld, implicit-baseline Q-learning completed more than \(20\%\) more episodes than standard Q-learning within the first 1k timesteps across several \(k\); on Atari 57, \(\mathrm{IB\text{-}DQN}(k=n)\) achieved higher aggregate performance than DQN and reached DQN’s best IQM score by about 20M environment steps, while \(\mathrm{IB\text{-}IQN}(k=n)\) reached IQN’s best IQM score at about 33.75M steps [2606.29806]. The same study reports that \(\mathrm{IB\text{-}DQN}(k=n)\) reduced overestimation in every Atari 57 game, increased relative action gaps in the vast majority of games, and did so with a parameter-free final layer.

A limitation is conditioning. The eigenvalue along \(\mathbf 1\) is \(1+k\), so the condition number of \(M_k\) is \(k+1\); very large \(k\) degrades performance, especially with fixed learning rates [2606.29806]. The layer therefore changes optimization geometry rather than function class in isolation, and its empirical gains are tied to that geometry.

## 4. Mean-centered and distributional variants in deep networks

In FP4-quantized LLM training, the mean component appears not as a baseline over actions but as the dominant anisotropic direction of token representations. For an activation matrix \(X\in\mathbb R^{l\times m}\), the feature-wise mean is
\[
\mu_X=\frac{1}{l}\mathbf 1^\top X,
\qquad
M_X=\mathbf 1\,\mu_X,
\]
and the activations are decomposed as \(X=M+X_{\text{spike}}+X_{\text{tail}}\) with mutually orthogonal Frobenius components [2603.10444]. The paper reports that the mean vector is almost perfectly aligned with the top right singular vector, with cosine similarity about \(0.99\), and argues that this coherent rank-one mean bias is the principal driver of dynamic-range inflation under blockwise FP4 quantization. Averis, the proposed remedy, performs dynamic per-GeMM mean-residual splitting:
\[
X_R = X-\mathbf 1\mu_X,
\qquad
\hat Y = \mathbf 1(\bar\mu_X \bar W) + \bar X_R \bar W,
\]
with an analogous decomposition in the backward pass [2603.10444]. The method uses two reductions and two subtractions per GeMM, retains standard quantized kernels, and on Qwen3-0.6B trained for 100B tokens in W4A4G4 narrows the loss gap to BF16; at 10B tokens it reports average benchmark performance \(0.4661\) for Averis versus \(0.4564\) for BF16 across ARC-C, ARC-E, BoolQ, HellaSwag, LAMBADA, PIQA, and RACE [2603.10444]. Here the “mean-expansion” effect is a controlled splitting of mean and residual pathways, not a generalized-mean aggregator.

Deep Mean Maps take a different route. Given a top convolutional feature map \(C_i\in\mathbb R^{m\times h\times w}\), the spatial vectors \(C_{i,j,l}\in\mathbb R^m\) are treated as samples from a feature distribution, mapped through random Fourier features
\[
z(x)=\sqrt{\frac{1}{2D}}
\big(\cos(\omega_1^\top x+b_1),\dots,\cos(\omega_D^\top x+b_D)\big)^\top,
\]
and then averaged:
\[
\hat\mu_{X_i}=\frac{1}{hw}\sum_{j=1}^h\sum_{l=1}^w z(C_{i,j,l}) .
\]
The corresponding mean map layer is implemented with a \(1\times1\) convolution, cosine nonlinearity, and global average pooling [1511.04150]. This produces a finite-dimensional approximation to a kernel mean embedding, so the layer encodes a distribution of high-level local features rather than a globally pooled vector. The paper uses \(D=4096\) random features and reports improvements over baseline CNNs on Flickr Style, Wikipaintings, and Places-205, including about \(+1.5\) absolute top-1 for GoogLeNet on Places-205 in the best forked DMM variants [1511.04150]. In contrast to RL mean-expansion, the emphasis is not baseline sharing but nonparametric distributional representation.

## 5. Mean-field and Bethe expansions as layered mean structures

A different use of mean-expansion arises in mean-field theory. In multilayer mean-field networks, a layer is represented by probability measures over neuron parameters rather than by a finite matrix. For a vector-valued layer, each output component has the form
\[
F_i(x;\mu_i)=\mathbb E_{(a,w)\sim \mu_i}[a\,\sigma(w\cdot x)],
\]
with admissibility requiring that the measures \((\mu_i)\) share the same marginal on \(w\); multilayer networks are then compositions of such measure-valued layers [2304.01063]. The paper specializes to a 3-layer architecture and proves an algorithmic depth-separation result: the radial target \(f_*(x)=\sigma(1-\|x\|)\) can be learned efficiently by an overparameterized 3-layer mean-field network with widths \(m_1=\mathrm{poly}(d,1/\epsilon)\) and \(m_2=\Theta(1)\), whereas a 2-layer network of polynomial width cannot approximate it to comparable accuracy under the chosen distribution [2304.01063]. In this usage, a mean-expansion layer is an integral operator over a distribution of neurons.

The Bethe \(M\)-layer construction extends the idea from architectures to model families. One replicates the lattice \(M\) times, rewires each copied edge through a random permutation, and studies the resulting graph as \(M\to\infty\), where short loops occur with probability \(O(1/M)\) and the graph becomes locally tree-like [1707.08499]. The \(M\to\infty\) limit is exactly solvable by Bethe/cavity methods, and corrections organize as a \(1/M\) loop expansion in terms of fat-diagrams and non-backtracking paths. For the ferromagnetic Ising model, the one-loop \(M\)-layer calculation recovers the continuum \(g\phi^4\) theory with explicit parameters
\[
S[\phi]=\int d^Dx\left[\frac12\rho(\nabla\phi)^2+\frac12\tau\phi^2+\frac{g}{4!}\phi^4\right]+\dots,
\]
and yields the usual upper critical dimension \(D_U=4\) [2403.01171]. The contribution of a diagram has the same symmetry factors as in standard field theory, but its lines are not Gaussian propagators ab initio; they arise from one-dimensional chains with attached Bethe trees and then reduce to continuum propagators in the scaling limit [1707.08499]. The “layer” here is therefore a mean-field reference system around which fluctuations are added systematically.

## 6. Geometric, asymptotic, and analytic extensions

Outside machine learning and statistical physics, the phrase attaches to yet other structures. In geometric analysis of initial data sets \((M^{n+1},g,k)\), local foliations by hypersurfaces satisfying either
\[
H_{S_r}^2-P_{S_r}^2=\frac{n^2}{r^2}
\quad\text{or}\quad
H_{S_r^\pm}\pm P_{S_r^\pm}=\frac{n}{r}
\]
are treated as local “mean-expansion layers” around a point \(p\), with existence and uniqueness governed by the vanishing of specific local \(1\)-forms such as \(A_{\mathrm{ST}}\) and \(A_{\mathrm{CE}}\) and by invertibility conditions on their derivatives [2207.14025]. In this context, “mean” refers to mean curvature and “expansion” to null expansions, not to averaging in a neural representation.

For strongly anisotropic elliptic equations,
\[
-\varepsilon^{-2}\partial_x^2 u_\varepsilon - \partial_y^2 u_\varepsilon = f(x,y),
\]
the solution is decomposed into an \(x\)-mean \(u(y)=\int_0^1 u_\varepsilon(x,y)\,dx\) and a zero-mean fluctuation \(u_\varepsilon^\sim\) [1701.03353]. The leading-order solution is the sum of the mean part and a composite boundary-layer fluctuation, and the \(2n\)-th order composite approximation has error \(O(\varepsilon^{2(n+1)})\) in \(L^\infty(D)\) [1701.03353]. Here the mean-expansion structure is an asymptotic decomposition into bulk mean and boundary-layer corrections.

In the analytic theory of bivariate means, a smooth symmetric mean \(M\) admits near the diagonal the expansion
\[
M(x,y)=A+f_1(A)(x-y)^2+f_2(A)(x-y)^4+\dots,
\qquad
A=\frac{x+y}{2},
\]
and the characteristic function
\[
Q_M(x)=\frac{\partial^2 M}{\partial x^2}(x,x)
\]
governs the second-order term via \(f_1=\frac12 Q_M\) [2506.07601]. Inequalities between characteristic functions imply local inequalities between the corresponding means, and for homogeneous means they imply global inequalities; the paper develops this systematically for normal means, additive means, and several integral classes [2506.07601]. This is again a mean-expansion theory, but now in the literal sense of Taylor expansion of means near the first bisector.

The resulting conceptual boundary is sharp. “Mean-expansion layer” does not designate a single canonical operator across fields. In some papers it is a final linear layer on action-values; in others it is a vector of generalized means, a kernel-mean embedding, a rank-one mean-conditioning module, an expansion around a Bethe solution, a curvature foliation, or a mean-fluctuation asymptotic decomposition. The unifying theme is not implementation detail but the decision to expose mean structure explicitly, and then to build learning, approximation, or perturbation theory around that exposure.

Source: https://www.emergentmind.com/topics/mean-expansion-layer