In this article
A position-wise feed-forward block shares a learned feature transformation across positions, while token-to-token communication comes from other explicitly connected operations.
A Transformer layer contains more than its attention operation. The feed-forward sublayer applies a learned nonlinear transformation to each position’s features. Its weights can be shared across positions even though the contextual input at each position differs.
A feature transformation is reused across positions
In the familiar position-wise feed-forward formulation, learned projections and an activation operate on each token’s hidden features. The same parameter values are applied at different positions. Sharing the function does not require identical outputs because the input representations can already contain different contextual information. The term position-wise describes the local operation’s direct dependencies. It does not imply that the position has never received information from elsewhere; attention earlier in the block or prior layers may already have supplied it.
Intermediate width creates another feature space
The first projection can map hidden features into a different intermediate width, where a nonlinearity or gated interaction is applied. The final projection returns a representation suitable for the surrounding block. This is a change in feature coordinates, not a direct increase in sequence length. The width influences parameter and computation accounting, while the activation changes the representable function. A wider intermediate space is not by itself a guarantee of better behavior; its learned use belongs to the training and evaluation of the complete model.
A position perturbation reveals direct and indirect dependence
As a conceptual exercise, hold the inputs to a position-wise sublayer fixed everywhere except one position. Its direct output change should follow that local input under the specified formulation. Now place the same sublayer after attention and perturb an earlier token in the original sequence. Multiple feed-forward inputs can change because attention altered their contextual representations first. These experiments distinguish local algebra from the dependency structure of the whole network. They prevent the phrase independent positions from being misread as independent final language-model predictions.
Read the exact feed-forward variant in the checkpoint
Plain activation blocks, gated variants and expert-routed feed-forward designs have different parameter relationships. Their shared broad label does not establish identical matrices or execution. Identify projection dimensions, activation, gating and any routing before mapping weights into an implementation. Compare a small block against a reference, then test the surrounding residual and normalization order. The result is a precise account of how feature processing complements attention: one mechanism communicates across selected positions, while the specified position-wise transformation develops the contextual features delivered to it.
Primary research and implementation references
Related engineering context
Reproducible inference stacks: preserving a GPU pilot’s result; A GPU inference benchmark you can trust.
Earn rental income from GPUs
Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.