MLP-Mixer

The paper tested whether competitive vision backbones require convolution or attention by separating image modeling into token-mixing MLPs and channel-mixing MLPs.

Metadata

FieldValue
PaperMLP-Mixer: An all-MLP Architecture for Vision
AuthorsIlya Tolstikhin, Neil Houlsby, Alexander Kolesnikov, Lucas Beyer, Xiaohua Zhai, Thomas Unterthiner, Jessica Yung, Andreas Steiner, Daniel Keysers, Jakob Uszkoreit, Mario Lucic, Alexey Dosovitskiy
Year2021
VenueNeurIPS 2021
arXiv2105.01601
ProceedingsNeurIPS 2021
Statusfull note started

Question

CNNs build image-specific inductive bias through locality, translation sharing, and hierarchy. Vision Transformers replace most convolutional structure with global self-attention over image patches. MLP-Mixer asks a sharper architecture question:

The paper’s answer is conditional:

This makes MLP-Mixer useful as an architecture control case. It removes both convolutional spatial filters and content-dependent attention, then checks how far a simpler token/channel mixing factorization can go.

Main Claim

MLP-Mixer shows that a vision backbone can be built from MLPs alone:

The durable claim is not that MLP-Mixer dominates CNNs or Transformers. The durable claim is that strong image classification does not logically require either convolution or attention:

This separates two axes that are often bundled together:

AxisQuestion
token mixinghow do spatial positions or patches exchange information?
channel mixinghow does each token transform its feature vector?

Architecture Contract

ItemContract
Inputimage tensor
Tokenizationsplit image into fixed-size non-overlapping patches
Patch embeddinglinear projection from flattened patch to channel dimension
Internal representationmatrix of patches by channels
Token mixingMLP across patch positions, applied per channel
Channel mixingMLP across channels, applied per patch
Readoutglobal average pooling over tokens, then linear classifier
Natural task in paperimage classification

For an image of height , width , and patch size , the number of patches is:

After patch embedding, the Mixer input is:

where is the number of patches and is the channel dimension.

Mixer Block

Each Mixer block has two residual MLP sublayers:

  1. token-mixing MLP;
  2. channel-mixing MLP.

A compact block equation is:

Here:

SymbolMeaning
token-by-channel activations
layer normalization
nonlinearity, usually GELU-style
, token-axis MLP weights
, channel-axis MLP weights

The transpose is the key implementation clue. Token mixing treats each channel as a length- vector and applies an MLP over patches. Channel mixing treats each patch as a length- vector and applies an MLP over features.

Token Mixing vs Channel Mixing

SublayerAxis MixedApplied ToSimilar Role
token-mixing MLPpatch positionseach channel columnspatial/token interaction
channel-mixing MLPfeature channelseach patch rowTransformer feed-forward block

In a Transformer encoder, token mixing is content-dependent self-attention:

In MLP-Mixer, token mixing is a learned but input-independent function over patch positions. That removes attention’s pairwise content-dependent routing:

This makes the model simpler, but also less adaptive to variable sequence length and pairwise image content.

Relation to CNN, ViT, and ConvNeXt

Model FamilyToken or Spatial MixingChannel MixingMain Bias
CNNconvolution over local neighborhoodspointwise convolution or dense channel mixinglocality and translation sharing
ViTglobal self-attention over patchesTransformer FFNglobal content-dependent token mixing
MLP-Mixertoken-axis MLP over patcheschannel-axis MLPlearned fixed patch interaction
ConvNeXtdepthwise convolutionpointwise MLP-style channel mixingmodernized local ConvNet bias

MLP-Mixer is therefore best read between Vision Transformer and ConvNeXt. It keeps ViT-style patchification but removes attention, then makes the axis separation explicit.

Complexity and Resolution Dependence

Let the token-mixing hidden width be and the channel-mixing hidden width be .

Token mixing cost is roughly:

because a token-axis MLP is applied for each channel.

Channel mixing cost is roughly:

because a channel-axis MLP is applied for each token.

If the token-mixing MLP expands proportionally to , the spatial mixing parameters and compute become tied to the number of patches. This is different from convolution, which shares a local kernel over spatial positions, and from attention, which can operate over variable token counts with the same projection weights.

Evidence to Read Carefully

The main evidence is image-classification performance under large-scale pretraining or strong regularization. The paper is most convincing as a comparison against the assumption that attention or convolution must be present in every strong vision backbone.

The evidence should be read with these qualifiers:

QualifierWhy It Matters
large dataweak image-specific bias often needs more data
regularizationtraining recipe can close much of the gap
classification focusdense prediction and localization are less directly tested
fixed patch gridtoken-mixing parameters depend on the patch count
no content-dependent routinginteractions are learned by position, not by pairwise token content

What This Paper Teaches

MLP-Mixer is useful because it exposes a model-design decomposition:

For architecture reading, this is more important than treating it as a permanent state-of-the-art model. It gives a clean vocabulary for asking whether a newer backbone improves because of:

  • better token mixing;
  • better channel mixing;
  • stronger training recipe;
  • more data;
  • better scaling;
  • stronger task-specific inductive bias.

Limits

  • The token-mixing MLP is tied to the number and ordering of image patches.
  • It has weaker locality and translation bias than CNNs.
  • It lacks the content-dependent token interactions of self-attention.
  • The paper’s strongest results depend on scale or modern regularization.
  • It is primarily an image-classification backbone, not a complete dense prediction recipe.

Concepts