VMamba Scans Four Ways for 2D
VMamba cross scans rows and columns both directions, so 2D locality survives linear state modeling for dense tasks.
Why Does This Exist?
Row-only scans separate vertical neighbors by a full row length. Masks then streak horizontally.
Cross scans fix adjacency. VMamba builds on vision mamba selection, serves semantic segmentation density, and aids object detection grids.
Think of It Like This
Plowing a field lengthwise plus crosswise
One pass plow leaves ridges. Cross plowing levels both ways with two linear passes.
Row scans are lengthwise, column scans crosswise. Where it stops: four passes cost four times one, just as SS2D trades speed for fairness.
How It Actually Works
Unfold map to four sequences: rows forward, rows backward, cols forward, cols backward. Run selective S6 per pass, reshape, sum plus gate. Hierarchical stages shrink like CNNs.
Worked example
. Row neighbors distance , column neighbors distance in row order. Column scan makes column distance . Four passes each K mults total K versus M attention, about times cheaper with 2D fairness.
Watch Out For
Summing passes without gating
Equal sums blur direction cues. Symptom: orientation errors on thin lines. Fix: keep the paper gating that weights passes per token.
The Quick Version
- VMamba scans rows plus columns both ways and merges.
- Four passes keep vertical plus horizontal neighbors close.
- Fixture K mults replace M, 98 times cheaper.
- Hierarchical stages suit dense heads.
- Gate passes per token to keep direction cues.