MaxViT Splits Attention Into Grids
MaxViT alternates blocked local attention with dilated grid attention, so every layer sees detail and far layout at linear cost.
Why Does This Exist?
Window attention is cheap but blind beyond its pane. Full attention sees all but costs quadratic maps.
MaxViT gets both. It builds on convolutional layers, serves image classification backbones, and feeds object detection pyramids.
Think of It Like This
Neighbors then district reps
Each street meets locally, then one rep per street meets on a city grid. Local needs settle fast and city patterns still spread.
Blocks are streets, grids are rep meetings. Where it stops: reps compress detail, just as grid attention samples sparsely.
How It Actually Works
Each MaxViT block has MBConv, blocked attention, then grid attention. Blocked splits into windows () with tokens each. Grid samples every -th cell into groups, linking far spots. Both cost linear in pixels.
Worked example
tokens split into windows of . Blocked pairs are . Grid with makes groups of for the same . Sum versus full M, about times cheaper with global reach.
Watch Out For
Using tiny windows that starve the grid
Window fragments textures and grid links carry too little. Symptom: noisy small maps. Fix: keep or windows as in the paper before tuning grids.
The Quick Version
- MaxViT alternates blocked local and dilated grid attention plus MBConv.
- Blocked handles -token detail, grid links far cells.
- Fixture K pairs replace M, about 32 times cheaper.
- Both steps stay linear in pixel count.
- Keep windows near 7 to protect texture.