Take the gate
×The even features of the projection, counted from zero (the 1st, 3rd, …): 2,880 gate features.
- in
- [B batch, T positions, 5760 expert gate and up features]
- out
- [B batch, T positions, 2880 expert d_ff]
The gate’s and the up branch’s features alternate in the projection’s output; counted from zero, the gate’s are the even ones.
Sources
In codex[..., ::2] · 250
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)