On the Necessity of Attention-FFN Split in Vision Transformers
cs.CV
Submitted: 2026-10-07
Updated: 2026-10-07
License: http://creativecommons.org/licenses/by/4.0/
The gist: The standard Transformer architecture relies on a rigid pattern that alternates Attention and Feed-Forward Network (FFN) layers.
Terminology
Abstract
The standard Transformer architecture relies on a rigid pattern that alternates Attention and Feed-Forward Network (FFN) layers. Despite its widespread adoption, the inductive bias imposed by this strict separation has not been systematically examined. In this work, we investigate the necessity of the Attention-FFN dichotomy in Vision Transformers (ViTs). To facilitate this analysis, we introduce the AttenFeed module, a unified component that integrates the functional properties of both Attention and FFN. Based on this module, we devise the unified Vision Transformer (uViT), which replaces the conventional alternating Attention-FFN structure with a sequence of AttenFeed modules. We then use uViT as a control group that relaxes the Attention-FFN dichotomy of the standard ViT and systematically compare the two models across multiple datasets and model scales. Our experiments reveal that the Attention-FFN dichotomy can hinder performance at smaller model scales due to the rigid parameter allocation of ViTs. The AttenFeed module and uViT serve as new analytical tools for understanding the Attention-FFN structure and offer theoretical insights into the heuristically designed architecture of conventional ViTs.
Sources
- GPT-4 Technical Report
- What Does BERT Look At? An Analysis of BERT's Attention
- Vision Transformers Need Registers
- An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- A Primer on the Inner Workings of Transformer-based Language Models
- Accurate, Large Minibatch SGD: Training ImageNet in 1 Hour
- What Matters in Transformers? Not All Attention is Needed
- ConceptAttention: Diffusion Transformers Learn Highly Interpretable Features
- Gaussian Error Linear Units (GELUs)
- Attention-Only Transformers and Implementing MLPs with Attention Heads
- Repeat After Me: Transformers are Better than State Space Models at Copying
- Towards Understanding Inductive Bias in Transformers: A View From Infinity
- GELU Activation Function in Deep Learning: A Comprehensive Mathematical Analysis and Performance
- Decoupled Weight Decay Regularization
- Sparsing Law: Towards Large Language Models with Greater Activation Sparsity
- How Do Vision Transformers Work?
- A Theoretical Explanation of Activation Sparsity through Flat Minima and Adversarial Robustness
- Massive Activations in Large Language Models
- Universal Properties of Activation Sparsity in Modern Large Language Models
- Analyzing Multi-Head Self-Attention: Specialized Heads Do the Heavy Lifting, the Rest Can Be Pruned
Related papers
- Loss Knows Best: Detecting Annotation Errors in Videos via Loss Trajectories
- AnchorWeave: World-Consistent Video Generation with Retrieved Local Spatial Memories
- Benchmarking the Robustness of Foundation Models for Mammography under Domain Shift
- MambaX-Net: Dual-Input Mamba-Enhanced Cross-Attention Network for Longitudinal MRI Segmentation
- TeleOCR: Navigating Document Parsing Across Digital and Camera-Captured Documents
- A Survey on Efficient Vision-Language-Action Models