Skip to content
AI360Xpert
Beta

MViT Pools Attention Across Scales

MViT pools keys and values while widening channels stage by stage, so transformers shrink maps like CNNs for video and images.

Pooled keys shrink 3136 to 196 while channels double for cheap pyramids
Pooled keys shrink 3136 to 196 while channels double for cheap pyramids

Why Does This Exist?

ViT keeps width and resolution fixed, so video tokens explode. CNNs shrink space while growing channels, which video needs.

MViT copies that schedule. It extends convolutional layers staging, backs image classification pyramids, and scales to video via pretrained models.

Think of It Like This

Summary notes that get shorter but denser

Early lecture notes copy full sentences. Later pages condense to keywords but use richer terms. Length drops while meaning per line rises.

Pooling is condensing, channel growth is richer terms. Where it stops: over-condensing loses names, just as heavy pooling drops small motion.

How It Actually Works

Each stage pools KK and VV with stride ss via conv or maxpool, while QQ keeps full length early then pools later. Channels double as resolution halves. Attention is softmax(QKpoolT/d)Vpoolsoftmax(QK_{pool}^T/\sqrt{d})V_{pool} plus residual pooling on QQ for shape match.

Worked example

Stage 1 has 56×56=313656 \times 56 = 3136 queries. Pool KK stride 88 to 7×7=497 \times 7 = 49? MViT uses stride 44 here to 14×14=19614 \times 14 = 196. Pairs are 3136×196=614,6563136 \times 196 = 614{,}656 versus 9.89.8M full, about 1616 times cheaper. Channels grow 9696 to 192192 to 384384 to 768768 while maps shrink, matching ResNet logic.

Watch Out For

Pooling queries and keys with the same stride

Pooling QQ early throws away positions dense heads need. Symptom: coarse boxes only. Fix: pool K,VK,V aggressively but keep QQ full until later stages as the paper schedules.

The Quick Version

  • MViT pools K,VK,V while widening channels per stage like CNNs.
  • Queries stay fuller early, keys shrink fast.
  • Fixture 3136×1963136 \times 196 costs 16 times less than full 9.89.8M.
  • Channels 9696 to 768768 grow as maps 5656 to 77 shrink.
  • Pool K,VK,V first and QQ later to protect locations.