Anchors That Move Without Collapsing: Exclusive-Region Anchor Routing for Vision Transformers
Organizations: Scaler School of Technology, Bengaluru, India
Abstract
Anchor tokens let a vision transformer exchange global information through a few summaries, but nothing forces different anchors to summarise different things. On one shared backbone we show that a Perceiver-style pathway and an AnchorFormer pathway collapse to a single summary, the latter despite its mass normalisation (pooling-map similarity 0.99), while other soft pathways, including Representative Attention, stay partly redundant (0.59-0.79). These results concern the routing modules inside our block, not the full published models. An exclusive partition of the patch grid cannot collapse by construction, and matched component by component it is 2.4-3.6 points more accurate than Representative Attention on CIFAR-100. We then propose focus anchors, which place most anchors at the peaks of a learned importance map while all anchors keep one exclusive Voronoi partition. Focus anchors beat a fixed partition on a cluttered canvas (+1.5 points, 95% CI [0.5, 2.6]) but not on full-HD traffic-sign recognition. There, both variants match dense attention with local windows at about a fifth of its FLOPs, and the fixed partition also trains 1.5x faster per step than dense attention with FlashAttention, though both use more memory; a ViT on a downsampled input loses half its mean average precision. Hard exclusive assignment is the only region assignment we tested that is both stable and most accurate: softmax and Sinkhorn relaxations diverge, and Gumbel-softmax trains but is less accurate. We also report the limits: a ResNet-18 is more accurate on every task we trained it on in this from-scratch regime, and anchors train faster than FlashAttention only from about 1536x1536 pixels and never use less memory.
Figures & tables
| Pathway | Test accuracy (%) | Map similarity | Spread |
|---|---|---|---|
| perceiver | 40.92 0.30 | 0.998 | 0.00 |
| anchorformer | 42.52 0.68 | 0.990 | 0.06 |
| competitive | 42.14 0.67 | 0.792 | 0.22 |
| paca | 42.02 0.07 | 0.592 | 0.18 |
| rpattention (with its conv) | 47.54 0.73 | 0.683 | 0.27 |
| dense (no anchors) | 40.93 0.95 | – | – |
| Cluttered CIFAR-10 | Tiny IN | ||||
| Model | Params | GFLOPs | 10 ep. | 30 ep. | 15 ep. |
| focus -16 | 11.4M | 5.49 | 49.84 0.26 | 66.82 0.66 | 17.68 0.33 |
| focus -4 | 11.4M | 5.45 | 47.52 1.11 | 64.67 0.26 | – |
| fixed -16 | 11.4M | 5.49 | 46.71 1.72 | 65.29 0.94 | 16.73 0.46 |
| dense-win | 12.8M | 7.25 | – | 65.10 0.45 | 20.50 0.29 |
| ViT, | 9.3M | 5.28 | 46.74 0.42 | 61.99 0.54 | 18.25 0.33 |
| Megapixel MNIST | DFG, | |||
| Model | , test | test | validation | GFLOPs |
| focus -64 | 91.15 0.92 | 30.28 0.88 | 38.89 1.52 | 187 |
| fixed -64 | 91.87 0.35 | 29.62 0.20 | 40.00 1.30 | 187 |
| dense-win | 91.40 0.20 | 30.28 0.85 | 38.92 1.65 | 912 |
| Dense ViT, full resolution | 86.10 0.96 | 28.60 0.64 | 39.54 0.88 | 846 |
| ViT, / -wide | 93.37 2.40 | – | – | – |
| Resolution | Dense ViT, FlashAttention | Dense ViT, plain | fixed -64 | focus -64 |
|---|---|---|---|---|
| 11.5 (0.9) | 44.8 (2.6) | 44.7 (1.4) | 196.9 (1.5) | |
| 58.9 (3.0) | 548.6 (30.0) | 68.5 (4.8) | 196.7 (5.3) | |
| 198.4 (6.3) | out of memory | 134.9 (10.5) | 296.2 (11.5) | |
| 533.6 (11.1) | out of memory | 232.1 (18.5) | 288.2 (20.2) | |
| 187.9 (6.4) | out of memory | 128.0 (10.4) | 204.2 (11.3) |
| Variant | Test accuracy (%) | Note |
|---|---|---|
| Reference: hard assignment, own anchor | 53.78 0.09 | |
| Soft (softmax) assignment | 10.00 / 10.00 / 10.00 | diverged in all seeds |
| Soft + Sinkhorn balancing | 9.98 / 10.00 / 12.44 | peaked at 26–39%, then diverged |
| Soft Gumbel-softmax, annealed | 22.08 / 49.53 / 51.30 | seed 42 diverged at epoch 9 |
| Read from 2 nearest anchors | 53.76 0.19 | 0.03 [ 0.35, +0.30] |
| Read from 3 nearest anchors | 54.61 0.55 | +0.83 [ 0.55, +2.20] |
Appendix figures & tables5 assets
Supplementary material from the paper’s appendix.
Appendix
| Collapse | Cluttered, 10 ep. | Cluttered, 30 ep. | Tiny IN | High resolution | |
| Data | CIFAR-100 | CIFAR-10 canvas | CIFAR-10 canvas | Tiny IN canvas | MMNIST / DFG |
| Epochs | 10 | 10 | 30 | 15 | 30 / 20 |
| Batch | 128 | 128 | 128 | 128 | 32 |
| Learning rate | |||||
| Clip / warmup | – | – ∗ | 1.0 / 2 | 1.0 / 2 | 1.0 / 2 |
| Augmentation | flip | flip | flip | flip | none |
| seed 42 | seed 43 | seed 44 | mean | 95% CI | |
|---|---|---|---|---|---|
| 4 anchors | +1.71 | +1.23 | +1.51 | +1.48 | [+0.88, +2.08] |
| 16 anchors | +1.53 | +2.90 | +4.96 | +3.13 | [ 1.16, +7.42] |
| Setting | Test accuracy (%) | |
|---|---|---|
| 53.98 | +0.30 | |
| 49.33 | 4.35 | |
| 53.59 | 0.09 | |
| 21.88 | 31.80 | |
| 52.90 | 0.78 | |
| 52.26 | 1.42 |
| focus -64 | fixed -64 | dense-win | Dense ViT | ViT 480-wide | ResNet-18 | |
|---|---|---|---|---|---|---|
| mAP | 8.10 | 8.14 | 12.35 | 11.02 | 8.76 | 8.33 |
| Model | GFLOPs | Train step | Train memory | Inference |
|---|---|---|---|---|
| focus -16 | 5.49 | 99.3 ms | 4.53 GB | 5,259 img/s |
| focus -4 | 5.45 | 70.8 ms | 4.24 GB | 6,207 img/s |
| fixed -16 | 5.49 | 60.7 ms | 4.31 GB | 6,408 img/s |
| ViT, | 5.28 | 32.4 ms | 3.11 GB | 11,176 img/s |
| ViT, | 1.21 | 20.6 ms | 1.17 GB | 39,339 img/s |
| PVTv2-B0 | 1.51 | 52.4 ms | 4.94 GB | 6,310 img/s |
Vision Transformer
Vision Transformers (ViTs) use self-attention over image patches to learn visual representations for recognition, segmentation, and other tasks.
See all 396 papers