Max depth, FFN without residuals: ≈ 10 layers (quasi-linear region)
X
· Wᵀ
ŷ
σ(·)
p̂
∂L/∂p̂
p̂ = σ(ŷ) = 1 / (1 + e−ŷ)
╍ H(ŷ) for comparison
∂p̂/∂ŷ = σ(ŷ)(1 − σ(ŷ)) ≤ 0.25
positive everywhere, but small
Problem 1: the gradient shrinks. ∂p̂/∂ŷ ≤ 0.25, so every sigmoid layer cuts the back-propagated gradient by at least 4×, and by far more once |ŷ| is large.
Problem 2: the mean is not zero. σ(0) = 0.5. With weights initialised for the quasi-linear region, the mean's share of the second moment, E[p̂²] = Var[p̂] + E[p̂]², grows layer over layer.
Sigmoid fixes zero gradients but brings two new problems: shrinking gradients and a non-zero mean.
Fixed: the gradient. ∂p̂/∂ŷ = 1 for every ŷ > 0, so active units pass the back-propagated gradient through unchanged, however many layers deep.
Still there: the non-zero mean. p̂ ≥ 0, so E[p̂] > 0, and the mean's share of E[p̂²] = Var[p̂] + E[p̂]² still grows layer over layer. That leads to correlated representations: a shared positive offset makes features move together. It also leads to dying neurons: a unit pushed to ŷ ≤ 0 for every input gets zero gradient and never recovers.
ReLU fixes the shrinking gradient but keeps the non-zero mean.
ReLU's gradient is exactly zero for every ŷ < 0; SiLU's is small but not zero
ReLU
ŷ · H(ŷ)
∂/∂ŷ
ReLU′
SiLU
ŷ · σ(ŷ)
∂/∂ŷ
SiLU′
ReLU: ∂p̂/∂ŷ = H(ŷ)
SiLU: ∂p̂/∂ŷ = σ(ŷ) + ŷ · σ(ŷ)(1 − σ(ŷ))
ŷ
3
1
0
−1
−3
ReLU′
1
1
0
0
0
SiLU′
1.088
0.928
0.500
0.072
−0.088
ReLU′(0) taken as 0. Both are ≈ 1 on the positive side.
In later layers, correlated activations push many ReLU units below zero on every input. Those units are always off: ReLU′ = 0, so no gradient reaches their weights and they stop learning. SiLU still passes a small gradient for moderate ŷ < 0, so an off unit can recover.
SiLU keeps a small gradient where ReLU has none, so switched-off neurons can still learn.
SwiGLU already multiplies two projections of the input
X
· Wᵀ
· Vᵀ
σ(·)
needed?
⊙
⊙
XWᵀ
XVᵀ
P̂
P̂ = σ(XWᵀ) ⊙ XWᵀ ⊙ XVᵀ
explicit nonlinearityproduct of two projections
x is linear. x · x is not.╍ x━ x · x
Multiplying two linear functions of the input already bends the output.
So drop the σ?
P̂ = XWᵀ ⊙ XVᵀ
p̂ₖ = (x · wₖ)(x · vₖ) = Σᵢ Σⱼ Wₖᵢ Vₖⱼ xᵢ xⱼ
x is one row of X; wₖ, vₖ are row k of W, V. Every output is a quadratic in x, built from products of input features xᵢ xⱼ. This is the bilinear layer (Mnih & Hinton, 2007; Dauphin et al., 2017).
If the product is already nonlinear, does the extra σ earn its place?
x · x is already nonlinear, so the σ in SwiGLU may be a nonlinearity we don't need.
e = examples, f = backbone features, hₖ = hidden width of block k, hₒ = hidden width of the output head, o = outputs
+
+
+
Linear Wout: f × h₁
SwiGLU
Norm
Linear Wout: f × h₂
SwiGLU
Norm
Linear Wout: f × h₃
SwiGLU
Norm
Down projection W: f × din
Norm
SwiGLU
Linear W: o × hₒ
Softmax
e×f
e×h₁
e×f
e×f
e×h₂
e×f
e×f
e×h₃
e×f
Block 1
Block 2
Block 3
X₀ e × f
X₁ e × f
X₂ e × f
X₃ e × f
final norm
output projection
e×f
e×hₒ
e×o
P̂
e × o, class probabilities
x, e × din
Each block normalizes the stream, applies SwiGLU (f → hₖ), projects back with Wout (f × hₖ) and adds the result to the stream. The next slide opens up the SwiGLU boxes.
Experts 2 and 3 get almost no tokens, so almost no gradient: the dead-unit problem, per expert.
With a balancing term
tokens
Expert 14 tokens
Expert 24 tokens
Expert 34 tokens
Every expert gets tokens and keeps learning.
Keeping every expert in use
A skipped expert gets no gradient, so routing can collapse onto a few experts
L = Ltask + α · N · Σᵢ fᵢ Pᵢ
fᵢ: fraction of tokens sent to expert i (a count, no gradient) Pᵢ: mean router probability for expert i (has a gradient) Smallest when every fᵢ = Pᵢ = 1/N; α = 0.01.
This term balances load. The sparsity still comes from top-k.
The extra loss term balances load across experts; top-k supplies the sparsity.