Standard Feed-Forward Network

The default dense feed-forward layer that expands, activates, and projects each token state after attention.

A standard feed-forward network, often shortened to standard FFN, is the default dense layer after attention in a transformer block, using one shared expand-activate-project path for every token.

At a glance

Released

June 2017

Authors

Ashish Vaswani, Noam Shazeer, Niki Parmar, et al.

Optimizes

  • Per Token Capacity

What It Is

A standard feed-forward network, often shortened to standard FFN, is the default dense feed-forward block used in most transformer layers. After attention updates a token state, the layer sends that state through one wide linear layer, applies a pointwise activation, and projects it back to the model width.

Why It Exists

The standard feed-forward network optimizes for a simple, uniform dense path after attention. Every token uses the same parameters and the same full hidden width, which keeps the block easy to reason about and easy to compare against later variants.

How It Works

The token state enters one shared dense block, expands into a wider hidden width, passes through an activation, and then projects back to the model width. No router chooses between experts, and no separate gate branch decides which hidden features stay active.

Math Or Compute Schema

The dense feed-forward formula below is the baseline for the whole family. It shows the single shared expand, activate, and project path that many later variants start from.
Standard dense feed-forward network
FFN(ht)=W2 σ(W1ht+b1)+b2\mathrm{FFN}(h_t) = W_2\,\sigma(W_1 h_t + b_1) + b_2
hth_t
Hidden state for token position t.
W1W_1
Projection into the wide hidden layer.
W2W_2
Projection back to model width.
σσ
Pointwise activation inside the hidden layer.

Compared To Nearby Modules

Compared with other feed-forward modules, the standard feed-forward network keeps the most direct dense path. The main tradeoff is that every token activates the full hidden block every time.
Comparison dimensionStandard feed-forwardSwiGLUMixture of experts
Path shapeOne dense expand -> activate -> project pathValue branch multiplied by a SiLU gate branchRouter chooses a few expert layers, then merges them
Active compute per tokenAll hidden units in one shared feed-forward blockAll hidden units plus a learned gateOnly top-k experts activate for each token
Main tradeoffSimple and predictable, but every token pays for the full blockMore expressive, but the block is less minimal than the dense baselineMuch more capacity, but routing and load balancing add complexity

Example Architectures

Many early and still-common transformer stacks use the standard dense feed-forward network as the default post-attention module.

Limitations And Tradeoffs

The standard feed-forward network activates the whole hidden path for every token, so it cannot add expert capacity sparsely the way a mixture-of-experts layer can. It also lacks the extra gating flexibility that later dense variants such as the swish gated linear unit introduce.

Why It Still Matters

Even when a paper introduces a new feed-forward variant, the standard feed-forward network remains the reference point that explains what changed. It is the baseline shape many readers still need first.

Tags

References

  1. Vaswani, Ashish, et al. "Attention Is All You Need." arXiv, 2017, https://arxiv.org/abs/1706.03762.