Gate activation
×Weight each capped gate feature by the sigmoid of 1.702 times itself.
- in
- [B batch, T positions, 2880 expert d_ff]
- out
- [B batch, T positions, 2880 expert d_ff]
SiLU is the same with a slope of 1; α = 1.702 is swiglu’s default, which the block does not change (model.py 249, 323).
Sources
In codex_glu * torch.sigmoid(alpha * x_glu) · 254
Direct evidence
The experts’ activation: the gate features are the even features of the projection, counted from zero, the linear features the odd ones; the gate is capped at the limit from above, the linear bounded to ±limit; the gate times the sigmoid of 1.702 times itself, multiplied by the linear plus one.
model.py 249–256 ↗ · openai/gpt-oss @ 5681a6b65526
Excerpt
def swiglu(x, alpha: float = 1.702, limit: float = 7.0):
x_glu, x_linear = x[..., ::2], x[..., 1::2]
# Clamp the input values
x_glu = x_glu.clamp(min=None, max=limit)
x_linear = x_linear.clamp(min=-limit, max=limit)
out_glu = x_glu * torch.sigmoid(alpha * x_glu)
# Note we add an extra bias of 1 to the linear layer
return out_glu * (x_linear + 1)