SwiGLU splits a transformer feed-forward input into two projected paths, applies SiLU to one path, then multiplies the two results element by element. The second projection is not an auxiliary statistic: its values directly gate the activated path before the output projection.

For hidden state x, a common structural form is:

g = SiLU(x W_gate)
u = x W_up
h = g * u
y = h W_down

Bias terms, projection orientation, intermediate width, and parameter names vary across architectures. The defining boundary is the element-wise product between a nonlinear projected branch and another projected branch.

The gate is input-dependent

A conventional two-projection feed-forward block can be sketched as:

h = activation(x W_up)
y = h W_down

SwiGLU adds another projection from the same input:

h = SiLU(x W_gate) * (x W_up)

Each intermediate coordinate therefore depends on two linear responses to x. One response passes through SiLU; the other remains linear before multiplication. The product can attenuate, amplify, reverse, or zero a coordinate according to the values produced by both branches.

Calling this operation a gate does not imply a probability. SiLU is not constrained to [0, 1], and the linear branch is also unbounded for unrestricted finite inputs. The product is a multiplicative interaction, not a binary switch or normalized routing weight.

SwiGLU is a GLU variant with SiLU on the gated branch

The broader gated linear unit family combines two projected branches with element-wise multiplication. Variants differ in the function applied to the branch conventionally described as the gate.

SwiGLU uses the SiLU function, also written as Swish with unit beta:

SiLU(z) = z * sigmoid(z)

Substituting it into the gated form gives:

SwiGLU(x) = SiLU(x W_gate) * (x W_up)

This naming identifies the nonlinear gate form. It does not fix the transformer’s residual layout, normalization placement, tensor-parallel partitioning, or exact intermediate dimension.

Parameter count depends on intermediate width

A plain feed-forward block with model width d and intermediate width m commonly has two large matrices with approximate weight count:

P_plain = d*m + m*d = 2*d*m

A SwiGLU block has three large matrices:

P_swiglu = d*m + d*m + m*d = 3*d*m

if all three use the same intermediate width m and biases are omitted.

That comparison does not mean a SwiGLU model must carry 50 percent more feed-forward weights than a corresponding nongated model. Architectures can choose a smaller m for the gated block. Matching the leading matrix count of a plain block gives the simple relation:

3*d*m_gated ~= 2*d*m_plain
m_gated ~= (2/3) * m_plain

Real checkpoints may round widths for hardware alignment or choose them from separate architecture criteria. The checkpoint configuration, not the activation name, determines the actual parameter count.

Projection order is part of checkpoint semantics

The two input projections are not interchangeable merely because they have the same shape. SiLU is applied to one branch before multiplication:

SiLU(x W_gate) * (x W_up)

Swapping the stored matrices changes the function in general:

SiLU(x W_up) * (x W_gate)

Element-wise multiplication itself is commutative, but moving SiLU from one projected value to the other is not generally function-preserving. A model converter can therefore produce shape-correct tensors and still corrupt the feed-forward computation by mapping gate and up projections incorrectly.

The output projection has a different role again. It maps the gated intermediate representation back to the block’s output width. Treating it as one of the two input branches changes both tensor flow and checkpoint meaning.

Multiplication changes the numeric surface

The intermediate product introduces a numeric behavior absent from a single activated branch. Large finite values from both projected paths can produce a product with substantially larger magnitude, while a small value on either path can suppress a coordinate.

Finite-precision runtimes may fuse the projections, SiLU, multiplication, or surrounding operations. Fusion can alter rounding boundaries and memory traffic without changing the intended mathematical graph. Accumulator precision, casting points, and kernel implementation remain runtime details that can create small numeric differences.

SwiGLU itself does not bound the intermediate tensor. SiLU grows approximately linearly for large positive inputs, and the other branch is linear, so the product has no architecture-independent finite bound for unrestricted input magnitude.

Tensor parallelism must preserve branch alignment

In distributed implementations, the gate and up projections can be partitioned across devices. The element-wise product requires corresponding intermediate coordinates from the two branches to remain aligned.

A runtime may fuse both input projections into one larger matrix operation and split its output logically afterward. That is an implementation transformation, not a different SwiGLU definition. The split point and weight layout must still reconstruct the checkpoint’s gate and up tensors correctly.

Communication placement depends on the chosen tensor-parallel scheme. SwiGLU alone does not mandate a specific collective operation. Claims about all-reduce, all-gather, or communication volume require the concrete sharding layout and runtime strategy.

The gated block remains local to each token

In the standard transformer feed-forward position, the projections operate independently on each token’s hidden vector with shared weights. SwiGLU changes channel interaction inside that per-token transformation; it does not introduce token-to-token communication.

Attention remains the component that mixes information across token positions in a conventional transformer block. A SwiGLU feed-forward layer can be evaluated for different token positions in parallel once their input hidden states are available.

This boundary matters when attributing serving costs. Sequence-dependent attention work and per-token feed-forward work scale through different tensor dimensions and can have different hardware bottlenecks. The presence of SwiGLU identifies a gated feed-forward computation, not a claim about which sublayer dominates latency.

SwiGLU’s architectural contract is specific: two projections consume the same hidden state, SiLU transforms the designated gate branch, the branches multiply coordinate-wise, and an output projection maps the result onward. Intermediate width, bias policy, sharding, fusion, and numeric execution remain properties of the concrete model and runtime.