What PoolFormer is
Vision Transformers, MLP-Mixer and their relatives differ mostly in their token mixer, the sublayer that lets image patches exchange information: attention, a learned MLP, a Fourier transform. Yu et al. (2021) asked whether the mixer matters as much as the block around it, and tested an extreme case: replace attention with 3 × 3 average pooling, which has no parameters at all. The resulting PoolFormer still performed well; the paper reports 82.1 % ImageNet-1K top-1 accuracy, ahead of DeiT-B and ResMLP-B24 with 35 % and 52 % fewer parameters. The authors named the general block MetaFormer: a Transformer block with the token mixer left open.
The page records the smallest model, PoolFormer-S12, on four images, in the two blocks of its last stage, where the image is a 7 × 7 grid of tokens 32 pixels square. Its top-1 guesses are Egyptian cat (46 %) for the cat, beagle (56 %) for the beagle, puck (44 %) for the astronaut and envelope (13 %) for the coloured shapes.
The MetaFormer block
Every block has the same two residual sublayers:
The norm is a GroupNorm with one group, which normalises each token grid over its channels and positions together. The MLP mixes channels within each token; only the token mixer moves information between tokens. and are learned per-channel scales, the layer scale of CaiT; the page notes 's range over the first 64 channels under the image.
Pooling as a token mixer
For token with 3 × 3 neighbourhood , the mixer computes
Cells outside the grid are left out of the mean rather than counted as zeros, so is 9 inside the grid, 6 along an edge and 4 in a corner. The token's own value is subtracted because the block adds it back through the residual connection; the mixer contributes only how the token differs from the average around it. The same weights apply to every channel.
One fixed matrix
On the 7 × 7 grid the mixer is a single 49 × 49 matrix, drawn on the Pooling mixer card as Pool − I. Row holds on the other cells of 's window, on itself and zero elsewhere, so each row sums to zero (in the recording, to within ). Unlike attention, the matrix is the same for every image and all 512 channels; nothing in it is learned. The Token grid marks the selected token's window on the image, and the row's popup lists its weights and checks that the matrix reproduces the model's pooling output.
Up to sign, Pool − I is a discrete Laplacian on the grid: adding a small positive multiple of it to the input is a step of diffusion that smooths each channel towards its neighbours. The learned sets the size and sign of that step, channel by channel.
Why so little can work
One pooling layer only reaches a token's 8 neighbours, but PoolFormer-S12 stacks 12 blocks in four stages, 2, 2, 6 and 2 blocks with 64, 128, 320 and 512 channels, and halves the grid between stages, from 56 × 56 tokens to 7 × 7 for a 224-pixel image. A 3 × 3 window on the last stage already spans 96 × 96 pixels, and the receptive field grows with every block before it. The learned MLPs, the norms and the residual structure do the rest. The paper's conclusion is that this general structure, not the particular mixer, accounts for most of the competence of Transformer-like vision models.
Where it came from
ViT (2020) brought attention to image patches; MLP-Mixer and ResMLP (2021) showed that learned MLPs over the tokens can stand in for it (the Mixer tab), and FNet a Fourier transform (the FNet tab). MetaFormer generalised the observation. Its follow-up, MetaFormer Baselines (2022), tried identity and random mixers and combined separable convolutions with attention in its ConvFormer and CAFormer models. ConvNeXt (the ConvNeXt tab) reaches a similar block from the other direction, by modernising a ResNet.
Papers
- MetaFormer Is Actually What You Need for Vision PoolFormer and the MetaFormer hypothesis: the block structure matters more than the token mixer.
- MetaFormer Baselines for Vision Identity, random, convolutional and attention mixers in the same MetaFormer block.
- An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale The Vision Transformer, whose attention mixer PoolFormer replaces.
- MLP-Mixer: An all-MLP Architecture for Vision A learned MLP as the token mixer, one of the results MetaFormer generalises (the Mixer tab).
- Going deeper with Image Transformers CaiT, which introduced the per-channel layer scale γ used in every PoolFormer block.
- Group Normalization The normalisation before PoolFormer's mixer, here with a single group.