Profile

Settings

Loading…

← Papers

Help

FAQ

Which features require signing in?

You can read the commentary, paper info, Model Structure and related papers of public papers without signing in. Sign in to manage your account or contact us about your inquiries.

Can I upload a PDF file?

Upload papers with an arXiv or DOI link; the commentary is public to everyone. Papers whose source and terms of use can't be verified, so the commentary can't be made public, can't be uploaded. Uploading PDF files and keeping papers private are for subscribers only, and a paper uploaded as a file is saved as private only. Searching for official info by title runs only when you press the button.

Are the figures and AI commentary accurate?

Figures come only from the original paper, and only those whose terms of use are verified are shown. The commentary is written by AI and may be wrong. Check important claims, numbers and figure context against the evidence in the original paper.

I want to report a copyright issue.

Terms of use and the source of the original paper are on the Paper info tab. If there's a problem, choose "Paper content, figures and copyright" under Contact us and send the paper link, the part in question, and evidence that you hold the rights. Receiving your report doesn't confirm any rights or remove anything right away. You can see the result of the review under My inquiries.

I forgot my password.

If you signed up with email, use Forgot password in the sign-in window to reset it with your verified email. If you signed up with Google, Naver or Kakao, change your password with that service.

What should I include in an inquiry?

Tell us which screen you were on and what you were doing when the problem happened, along with the paper link. Don't include personal information such as passwords, API keys, verification codes or phone numbers. Inquiries and replies are stored in Refivu and you can see them under My inquiries.

How do I delete my account?

In Settings, under My account, press Delete account. Review what will be deleted and complete identity verification to delete your account. For other requests, choose "Account" under Contact us.

Paper commentary

MLP-Mixer: An all-MLP Architecture for Vision

Simple MLP stacks can match CNNs and Transformers on image classification

  • Problem CNNs and attention-based Transformers lead computer vision, but it was unclear whether a design using only MLPs could match them on accuracy and cost. The question is whether convolution or attention is needed to mix spatial information.
  • Method MLP-Mixer cuts each image into patches and stacks layers that alternate two MLPs. One mixes channels within each patch, and the other mixes the same channel across all patches, with residual connections.
  • Results After JFT-300M pre-training, Mixer-H/14 reaches 87.94% top-1 on ImageNet, 0.5% below ViT-H/14. It runs at competitive cost against CNNs and Transformers.

Why ask whether MLPs suffice

CNNs have been the default architecture for computer vision, and Vision Transformers recently reached state-of-the-art results using self-attention. Convolutions supply locality and weight sharing, while self-attention lets tokens exchange information across positions, so the open question is whether either mechanism is needed to mix spatial information.

The architecture studied here drops both mechanisms and uses only MLPs to exchange information across space and across channels.

Accuracy alone would not settle whether such a design is useful, so the evaluation weighs three quantities together: downstream accuracy, the total cost of pre-training, and test-time throughput. The stated aim is not to beat the best published numbers but to show that a simple MLP model is competitive with the best convolutional and attention-based models on this trade-off.

Two mixing axes in one layer

An input image is cut into non-overlapping patches, and every patch is linearly projected to a hidden dimension C with one shared projection matrix. This produces a table with S rows, one per patch, and C columns, one per channel, where S equals HW/P^2 for an image of resolution (H,W) and patch resolution (P,P). The network keeps this patches-by-channels shape from the first layer to the last, so every layer has the same width.

The design keeps two kinds of operation apart: a per-location step that mixes channels, and a cross-location step that mixes tokens, instead of folding both into one attention or convolution operation. Channel-mixing MLPs take individual rows of the table, so the features of one patch are combined without reading other patches. Token-mixing MLPs take the columns of the table, so one channel is combined across all patch positions at once.

Each Mixer layer contains one of each, and the layers are stacked so that the two kinds of interaction alternate.

In an extreme reading, the design resembles a CNN with 1×1 convolutions for channel mixing and full-receptive-field depth-wise convolutions with shared weights for token mixing, although typical CNNs are not special cases of it.

The two residual MLP steps

Each Mixer layer is two residual sub-blocks in sequence, the token-mixing block first and the channel-mixing block second. The first sub-block applies layer normalization to its input, passes each column through a GELU-activated two-layer MLP, and adds the result back to the input, for every channel index i from 1 to C. Here \(\sigma\) is the element-wise GELU, and \(W_1\) has shape \(D_S \times S\), so it maps the S token positions to a hidden width \(D_S\).

The width \(D_S\) is a tunable choice that does not have to match the number of patches.

The second sub-block works on the output U row by row, so each patch is processed across its own channels. \(D_C\) is the tunable hidden width of the channel-mixing MLP, and the same weights are applied to every row. The equations omit layer indices, so they describe one layer, and the full network stacks N such layers.

Cost scaling and tied weights

Because the token-mixing width does not depend on the number of patches, the network's computational complexity is linear in the number of patches. ViT's complexity, by contrast, is quadratic in the number of patches. Since the channel-mixing width does not depend on patch size, total complexity is linear in the number of image pixels, as it is for a typical CNN.

Sharing one channel-mixing MLP across all patch positions gives positional invariance, a property usually associated with convolutions. The token-mixing MLPs share one full-receptive-field kernel across all channels, which limits how fast the parameter count grows with C or S. Separable convolutions instead use a different kernel for each channel.

The authors report that this sharing does not affect empirical performance and point to a supplementary ablation.

Pre-training and fine-tuning recipe

Downstream evaluation covers ImageNet with 1.3M training examples and 1k classes, CIFAR-10 and CIFAR-100, Oxford-IIIT Pets, Oxford Flowers-102, and the 19-dataset VTAB-1k benchmark with 1k training examples each. Upstream pre-training uses ImageNet-21k, which has 21k classes and 14M images, and JFT-300M, a proprietary set with 300M examples and 18k classes.

The largest experiment also pre-trains on JFT-3B, with roughly 3B images and 30k classes.

Pre-training runs at resolution 224 with Adam, beta1 = 0.9 and beta2 = 0.999, a batch size of 4 096, weight decay, and gradient clipping at global norm 1. The learning rate has a linear warmup over 10k steps followed by linear decay. ImageNet and ImageNet-21k runs add RandAugment, mixup, dropout and stochastic depth, while JFT-300M runs use a crop technique with random horizontal flips.

Pre-training data are de-duplicated against the test sets of the downstream tasks.

Fine-tuning uses momentum SGD with batch size 512, gradient clipping at global norm 1, a cosine schedule with linear warmup, and no weight decay. For a higher input resolution the patch size stays fixed, so the token sequence grows; the token-mixing weight matrix is enlarged with block-diagonal copies of the pre-trained weights, which only allows \(S' = K^2 S\) for an integer K.

Cost is measured as total pre-training time on TPU-v3, which combines theoretical FLOPs, hardware efficiency and data efficiency. Throughput is images per second per core on TPU-v3, with the batch size swept for each model and the highest value reported. Two results use few-shot accuracy from an l2-regularized linear regression on frozen features, in place of fine-tuning, because fine-tuning all models was too costly there.

ImageNet results and the cost trade-off

With ImageNet-21k pre-training and extra regularization, Mixer-L/16 reached 84.15% top-1 on ImageNet, a little behind the other models in the same table. Without that regularization Mixer overfits in this setting, a pattern the authors also saw for ViT.

With JFT-300M pre-training, Mixer-H/14 reached 87.94% top-1 on ImageNet, 0.5% above BiT-ResNet152x4 and 0.5% below ViT-H/14. Table 2 lists 40 img/sec/core for Mixer-H/14 and 15 for ViT-H/14, and the text reads this as Mixer-H/14 running 2.5 times faster. These Mixer models are fine-tuned at resolution 448, so the throughput figures belong to that setting.

The stated goal is competitive accuracy at a given cost rather than new state-of-the-art accuracy. The highest-accuracy entries per class in this table all use resolutions of 448 and above. At resolution 224, Mixer-L/16 pre-trained on ImageNet-21k reached 82.84% ImageNet top-1 at 420 img/sec/core, which shows how much throughput a lower resolution can buy.

The MPL and ALIGN rows come from pre-training on unlabelled or weakly labelled data, a different regime from the other rows.

Model size and pre-training data

Trained from random initialization on ImageNet, Mixer-B/16 reached 76.44% top-1 at resolution 224. That is 3% behind ViT-B/16, and since the two models reach very similar training losses, the gap is read as Mixer overfitting more. When pre-trained on JFT-300M and fine-tuned at resolution 224, Mixer-H/14 sits 0.3% behind ViT-H/14 on ImageNet while running 2.2 times faster.

The scale curves put Mixer slightly below the frontier at small scales and on it at large scales.

Mixer-B/32, Mixer-L/32 and Mixer-L/16 were pre-trained on 3%, 10%, 30% and 100% of JFT-300M for 233, 70, 23 and 7 epochs, so each run takes the same number of total steps. All Mixer models overfit strongly on the smallest subset, and BiT overfits to a lesser extent. As the data grows, Mixer-L/32 and Mixer-L/16 improve faster than BiT, Mixer-L/16 keeps improving while BiT plateaus, and the gap to ViT-L/16 shrinks.

The authors speculate that self-attention in ViT leads to learned functions that fit the true data distribution less well than those found by Mixer's MLPs.

A JFT-3B run of Mixer-L/16 extends the same comparison to roughly 3B images and 30k classes, with the same number of total steps.

Permutation sensitivity

The check trains Mixer-B/16 and ResNet50x1 on JFT-300M under the same setup, then evaluates linear 5-shot top-1 accuracy on ImageNet. Two input changes are compared with the original order: shuffling 16×16 patches with pixels inside each patch permuted by one shared permutation, and a global pixel permutation applied to all images.

The Mixer curves for the original order and for the patch-and-pixel shuffle match, which the authors read as invariance to patch order and to pixel order within patches. ResNet's accuracy falls clearly when patches are permuted, which the authors tie to a strong inductive bias on pixel order. Under global pixel shuffling, Mixer's accuracy drops by about 45% and ResNet's by about 75%.

The reported check uses linear 5-shot accuracy only, so the same shuffles are not evaluated with fine-tuned accuracy.

What token-mixing units learn

The visualization shows hidden units from the first three token-mixing MLPs of a Mixer-B/16 trained on JFT-300M. Each unit has 196 weights, one for each incoming patch of the 14×14 grid, and opposite-phase units are paired and sorted by filter frequency. Unlike a CNN kernel, where each weight is one pixel, each weight here stands for a 16×16 patch of the input.

Some units act on the whole image while others act on smaller regions. Deeper layers show no clearly identifiable structure, and the learned units depend on the hyperparameters. The authors note that the opposite-phase pairs resemble feature-detector pairs reported for CNNs. CNN first layers are often described as learning Gabor-like detectors on local pixel regions, while Mixer's token-mixing layers allow global information exchange.

Relation to CNNs and Transformers

The design pushes the small-kernel idea of sparse convolutions to the extreme, using a 1×1 kernel that becomes a dense matrix multiplication at each location for channel mixing. Spatial aggregation comes from dense matrix multiplications applied across all locations, which is the token-mixing step. Lin et al. and Neyshabur train fully connected networks, whereas Mixer uses token-mixing and channel-mixing MLPs with standard regularization and optimization, and scales to large data.

The MLP block design traces back to Transformers, and turning images into a sequence of patch embeddings comes from ViT. The authors frame Mixer as a step in a direction that does not rely on locality bias or attention.

Limits of the evidence

On data of modest scale, roughly 1-10M images with modern regularization, Mixer falls slightly short of specialized CNN architectures. Mixer overfits without regularization on ImageNet-21k and on ImageNet trained from random initialization. Trained from scratch on ImageNet, Mixer-B/16 reached 76.44% top-1, which the authors set against 84.7% for BotNet and 86.5% for NFNet.

The Table 2 comparison uses the highest-accuracy model per class at resolutions of 448 and above, and lower resolutions trade some accuracy for throughput. JFT-300M is proprietary, so the largest pre-training results cannot be reproduced from public data. BiT-ResNet152x4 is pre-trained with SGD with momentum and a long schedule, while Mixer is pre-trained with Adam, so the training recipes differ across rows.

The data-size and permutation studies use linear 5-shot accuracy as the transfer measure. The authors leave open how the learned features compare with those of CNNs and Transformers, and whether the design works in NLP or other domains.

Paper info

Authors
Ilya Tolstikhin, Neil Houlsby, Alexander Kolesnikov, Lucas Beyer, Xiaohua Zhai, Thomas Unterthiner, Jessica Yung, Andreas Steiner, Daniel Keysers, Jakob Uszkoreit, Mario Lucic, Alexey Dosovitskiy
Venue
arXiv · Preprint
First published
2021-5-4
Added
2026-11-12
Updated
2021-6-11
Version
v4
arXiv
2105.01601
Category
cs.CV · cs.AI · cs.LG
Original paper terms
arXiv non-exclusive 1.0
What we show
Paper info and commentary

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

Quote from the paper

Ilya Tolstikhin, Neil Houlsby, Alexander Kolesnikov, Lucas Beyer, Xiaohua Zhai, Thomas Unterthiner, Jessica Yung, Andreas Steiner, Daniel Keysers, Jakob Uszkoreit, Mario Lucic, Alexey Dosovitskiy (2021). MLP-Mixer: An all-MLP Architecture for Vision. arXiv:2105.01601v4. https://arxiv.org/abs/2105.01601v4

BibTeX
@misc{tolstikhin2021mixer,
  title = {{MLP-Mixer: An all-MLP Architecture for Vision}},
  author = {Ilya Tolstikhin and Neil Houlsby and Alexander Kolesnikov and Lucas Beyer and Xiaohua Zhai and Thomas Unterthiner and Jessica Yung and Andreas Steiner and Daniel Keysers and Jakob Uszkoreit and Mario Lucic and Alexey Dosovitskiy},
  year = {2021},
  eprint = {2105.01601},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2105.01601v4}
}

See related papersBrowse other papers

Paper preview
Account security

Connect Google account

If you connect a Google account, you can sign in with it too.

Refivu

Delete account

Refivu
Refivu

Sign up