FFN
The feed-forward neural network layer in the Transformer architecture, typically composed of two linear transformations and an activation function. It operates independently on each token in a sequence, and its parameters account for a large share of the model's total parameters.
Core Facts
Timeline (last 90 days)
Sequence compression directly reduces the number of tokens, causing the computation of the FFN and per-token projections to drop proportionally, a benefit that the "cheaper per token" approach cannot achieve.
The FFN in a Transformer often accounts for more than two-thirds of the model's total parameters, and its computation is O(sequence length × hidden dimension × intermediate dimension), growing linearly with sequence length; attention computation is O(sequence length² × dimension), growing quadratically with length.
Current mainstream LLM efficiency optimization methods (shrinking the KV cache, limiting the receptive field, replacing attention operators) mainly reduce the attention cost per token but do not reduce the number of tokens flowing through the network, so the computation of the FFN and per-token projections still grows with the full sequence length.
The MoE architecture splits the feed-forward network (FFN) layers in the Transformer into multiple parallel experts, and each token is routed to only a few experts for computation.
The author of the experiment characterized the result of replacing the FFN with shared product-key memory as a "negative result."
An experiment shared in the Reddit community replaced the FFN with a shared product-key memory, matching the performance of MoE models at a scale of 23 million parameters.
In the Transformer architecture, feed-forward network (FFN) layers typically account for more than two-thirds of the model's parameters.
In Transformers, product-key memory is typically inserted after the attention layer, as a replacement for or supplement to the FFN.
Compared with a standard FFN Transformer, the shared product-key memory approach did not demonstrate a clear advantage.
reViT introduces a shared expert bank, representing the FFN at each recursion depth as a convex combination of the expert bank weights, with a depth-invariant parameter pool paired with depth-varying combination weights.
5 more timeline events
All Facts (14)
The Mixture-of-Experts (MoE) architecture is a sparsely activated design that splits a single large model into multiple expert sub-networks, where each expert is usually a set of independent feed-forward layer (FFN) weights, and a lightweight router network decides which few experts to assign to based on input token features.
90%UnverifiedThe feed-forward neural network (FFN) is responsible for storing knowledge, transforming contextual information into implicit knowledge stored in the network parameters in vector form
60%UnverifiedIn the standard Transformer architecture, the feed-forward network (FFN) accounts for approximately two-thirds of the model's total parameter count.
60%UnverifiedThe FFN in a Transformer often accounts for more than two-thirds of the model's total parameters, and its computation is O(sequence length × hidden dimension × intermediate dimension), growing linearly with sequence length; attention computation is O(sequence length² × dimension), growing quadratically with length.
50%UnverifiedSequence compression directly reduces the number of tokens, causing the computation of the FFN and per-token projections to drop proportionally, a benefit that the "cheaper per token" approach cannot achieve.
50%UnverifiedCurrent mainstream LLM efficiency optimization methods (shrinking the KV cache, limiting the receptive field, replacing attention operators) mainly reduce the attention cost per token but do not reduce the number of tokens flowing through the network, so the computation of the FFN and per-token projections still grows with the full sequence length.
50%UnverifiedThe MoE architecture splits the feed-forward network (FFN) layers in the Transformer into multiple parallel experts, and each token is routed to only a few experts for computation.
50%UnverifiedIn the Transformer architecture, feed-forward network (FFN) layers typically account for more than two-thirds of the model's parameters.
50%UnverifiedIn Transformers, product-key memory is typically inserted after the attention layer, as a replacement for or supplement to the FFN.
50%UnverifiedreViT introduces a shared expert bank, representing the FFN at each recursion depth as a convex combination of the expert bank weights, with a depth-invariant parameter pool paired with depth-varying combination weights.
50%UnverifiedIn the MoE (Mixture of Experts) architecture, optimization for knowledge storage is primarily focused on the FFN layer
50%UnverifiedThe FFN feed-forward network module upscales vectors via the up layer (e.g., 4K→8K), passes them through an activation function (such as SwiGLU gated activation), and then reduces them back to the original dimension via the down layer.
50%UnverifiedFFN层的隐藏维度一般是模型维度的4倍
50%Unverified以GPT-3的1750亿参数为例,大约2/3的参数分布在FFN层中,1/3在注意力层中
50%