Abstract
While the attention mechanism in Transformer architectures is well-studied, the Feed-Forward Network (FFN) layers—comprising the majority of model parameters—have remained largely opaque. This study investigates the functional role of FFNs by decomposing their outputs into the vocabulary space. We demonstrate that FFN layers operate as additive "concept promoters," pushing specific semantic and syntactic distributions into the residual stream. By identifying these human-interpretable "value vectors," we show that model behavior can be steered to reduce toxicity by 50% and inference can be accelerated by 20% through early-exit strategies.
1. Introduction
The Transformer architecture has revolutionized natural language processing, yet a significant portion of its internal computation remains a "black box." Specifically, Feed-Forward Networks (FFNs) account for approximately two-thirds of the parameters in models like GPT-2, yet their specific contribution to the final prediction has been difficult to characterize. While previous hypotheses suggested FFNs act as key-value memories, the mechanism by which these memories influence the final output was unclear. This paper bridges this gap by analyzing FFN updates through the "Logit Lens," revealing that these layers build predictions step-by-step by promoting specific concepts in the vocabulary space.
2. Methodology
The researchers utilized a technique known as the Logit Lens to interpret the hidden states of the model. By projecting the hidden state at any given layer into the vocabulary space using the model's pre-existing output embedding matrix, they could observe "proto-predictions" as they evolved through the network.
The core of the analysis involves the decomposition of FFN outputs. An FFN layer typically performs two linear transformations separated by a non-linear activation. The authors demonstrated that the output is a weighted sum of "value vectors" (the columns of the second weight matrix). To understand these vectors, the study:
- Projected individual value vectors into the vocabulary space to identify the specific words they promote.
- Employed NLP experts to categorize the top-scoring words for these vectors into semantic, syntactic, or naming patterns.
- Analyzed "Saturation," tracking the point at which FFN updates no longer significantly altered the top-ranked prediction.
The study was conducted using GPT-2 (various scales) and WIKILM (a 16-layer model) on the WikiText-103 and RealToxicPrompts datasets.
3. FFNs as Additive Concept Promoters
The findings suggest that FFN layers do not "recalculate" representations from scratch. Instead, they function as additive promoters. Each layer adds a "nudge" to the current distribution, pushing candidate words higher in the probability ranking rather than actively suppressing incorrect ones.
Crucially, these value vectors correspond to human-interpretable concepts. Between 40% and 70% of the analyzed vectors were associated with clear categories, such as:
- Semantic concepts: e.g., "mammals," "legal terminology," or "breakfast foods."
- Syntactic concepts: e.g., "past-tense verbs" or "pronouns."
4. Applications: Steering and Efficiency
Understanding the conceptual nature of FFNs allows for direct intervention in model behavior without the need for retraining.
4.1 Toxicity Suppression
By identifying value vectors associated with "safe" or "positive" concepts (e.g., peace, safety), the researchers were able to manually boost these vectors during inference. By boosting just 10 specific "safe" vectors out of tens of thousands, they reduced GPT-2's toxicity by nearly 50%, outperforming traditional self-debiasing baselines.
4.2 Early Exiting for Inference Efficiency
The study observed that once the sub-updates in a layer align with the current top prediction—a state termed "saturation"—the model rarely changes its mind in subsequent layers. By implementing a "sub-update rule" to detect this saturation, the authors enabled "early exiting," skipping the final layers of the model for many inputs. This resulted in a 20% reduction in computation on average while maintaining high accuracy.
5. Discussion and Limitations
While this research provides a significant step toward interpreting the "black box" of FFNs, several questions remain. A significant portion of value vectors (labeled "N/A" in the study) remains uninterpretable, potentially representing abstract features or sub-word patterns. Furthermore, the interplay between FFNs and Attention layers—which are interleaved in the Transformer architecture—requires further exploration to understand how concepts are moved or filtered across the network. Finally, while these results are robust for decoder-only models like GPT-2, further research is needed to confirm if encoder-only (BERT) or encoder-decoder (T5) architectures follow the same additive logic.
6. Conclusion
This paper demonstrates that Transformer FFN layers are not merely opaque processing units but are structured components that promote human-interpretable concepts. By viewing FFNs as additive contributors to the vocabulary distribution, we gain powerful tools for both steering model output and optimizing computational performance.
Summary updated