Attention Is Not All You Need: The Importance of Feedforward Networks in Transformer Models

Isaac Gerber
5/10/2025
cs.CLcs.LG

No confident code implementation found for this paper. 3 possible matches can be shown below.

Abstract

Decoder-only transformer networks have become incredibly popular for language modeling tasks. State-of-the-art models can have over a hundred transformer blocks, containing billions of trainable parameters, and are trained on trillions of tokens of text. Each transformer block typically consists of a multi-head attention (MHA) mechanism and a two-layer fully connected feedforward network (FFN). In this paper, we examine the importance of the FFN during the model pre-training process through a series of experiments, confirming that the FFN is important to model performance. Furthermore, we show that models using a transformer block configuration with three-layer FFNs with fewer such blocks outperform the standard two-layer configuration delivering lower training loss with fewer total parameters in less time.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 3 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{gerber2025attention,
  title  = {Attention Is Not All You Need: The Importance of Feedforward Networks in Transformer Models},
  author = {Isaac Gerber},
  year   = {2025},
  eprint = {2505.06633},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2505.06633v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2505.06633.svg)](https://codeofpaper.com/paper/2505.06633)

Discussion