不塌缩的可移动锚点:面向视觉 Transformer 的排他区域锚点路由
摘要
论文研究视觉 Transformer 中锚点(anchor token)的路由方式:在共享主干上,Perceiver 风格通路与 AnchorFormer 风格通路都会塌缩成单一摘要(池化图相似度 0.99),而 Representative Attention 等其他软路由仍部分冗余(0.59–0.79)。作者提出 focus anchors,在保持所有锚点共享同一套排他 Voronoi 划分的同时,把多数锚点放在学习到的重要性图峰值处;逐组件对齐比较后,它在 CIFAR-100 上比 Representative Attention 高 2.4–3.6 个点。在 full-HD 交通标志识别任务上,两种变体以约五分之一的 FLOPs 追平带局部窗口的稠密注意力,其中固定划分每步训练比 FlashAttention 快 1.5 倍,但两者显存占用都更高。
查看原始标题和摘要
Anchors That Move Without Collapsing: Exclusive-Region Anchor Routing for Vision Transformers
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 Flas
核心要点
- 在共享主干上,Perceiver 风格通路与 AnchorFormer 风格通路塌缩为单一摘要(池化图相似度 0.99);该结论只涉及其模块内部的路由模块,不代表已发表的完整模型
- Representative Attention 等软通路仍保持部分冗余(相似度 0.59–0.79)
- 对 patch 网格做排他划分,按构造就不会塌缩;逐组件对齐后,在 CIFAR-100 上比 Representative Attention 高 2.4–3.6 个点
- focus anchors 在杂乱画布上比固定划分高 1.5 个点(95% CI [0.5, 2.6]),但在 full-HD 交通标志识别上没有提升
- 两种变体以约 1/5 的 FLOPs 追平带局部窗口的稠密注意力;固定划分每步训练比 FlashAttention 稠密注意力快 1.5 倍,但显存占用更高
- 硬排他分配是作者测试过的唯一既稳定又最准的区域分配方式:softmax 与 Sinkhorn 松弛会发散,Gumbel-softmax 可训练但精度更低
- 局限:在这一从零训练的设定下,ResNet-18 在其训练过的所有任务上都更准;锚点只有在约 1536×1536 像素以上时训练才快于 FlashAttention,且显存从不更低;ViT 在降采样输入上 mAP 减半
为什么值得后端工程师关注
对 Java 和后端工程师来说,这篇论文与业务代码没有直接关系;但如果你们提供视觉模型推理服务或需要选择 backbone,则有几点实际参考:把注意力稀疏化可以让计算量(FLOPs)降到约 1/5 而精度不降,代价是显存占用更高;训练速度优势只有在约 1536×1536 以上分辨率才会出现;在从零训练的小模型上,ResNet-18 仍然更准。不要把 FLOPs 直接等同于实际延迟或内存成本。