Feed-Forward Network (FFN)
Also known as: FFN, MLP Layer
Category: Neural Networks & Architectures
A fully connected neural network layer within each transformer block that processes each position independently through two linear transformations with a nonlinearity.
Full Explanation
The feed-forward network (FFN) in a transformer block consists of two linear transformations with a nonlinear activation in between, applied identically and independently to each position. Typically, the inner dimension is 4x the model dimension, creating a bottleneck expansion that allows the network to process information in a higher-dimensional space. The FFN accounts for the majority of parameters in a transformer layer (about two-thirds in standard configurations). Recent research suggests that FFN layers function as key-value memory stores, with the first layer acting as keys that match input patterns and the second as values that produce corresponding outputs. Variants like the gated FFN (used in LLaMA and PaLM) add a gating mechanism for improved performance. In MoE models, the FFN is the component that is typically replicated across experts.
Related Terms
More in Neural Networks & Architectures
Explore More
- AI Tools Library — Discover AI tools related to Feed-Forward Network (FFN)
- AI Education — Courses to learn about Neural Networks & Architectures
- AI News — Latest news and updates