分辨率过高反而稀释注意力:Vision Transformer 的免训练重缩放方法
Spread Too Thin: How Higher Resolution Dilutes a Vision Transformer's Attention, and a Training-Free Rescaling
视觉 Transformer 在高于训练分辨率下推理时,softmax 注意力被更多 patch 稀释,寄存器等 sink 分到的权重随之下降。研究提出免训练补救:将每个分数(含 sink)乘以测试与训练 token 数对数之比,在 DINOv2 等公开模型上使寄存器权重近乎持平,并在几乎所有模型中于测试时恢复部分精度损失。该重缩放无法还原模型已学到的注意力,其增益机制仍待解释。
arXiv:2611.18680v1 Announce Type: new Abstract: A vision transformer read at a higher resolution than it was trained at spreads each attention row over many more patches, yet every row must still hand out exactly one unit of weight. A law of softmax attention predicts that a growing crowd of bounded scores dilutes the attention on any patch or register whose score stays fixed. The same law gives a remedy that needs no training: multiply every score, the sink's included, by the ratio of the logarithms of the test and training token counts. Given sufficient margins at the training resolution, this keeps the attention on a match when one is present, and on a sink such as a register when none is, though trained models need not meet those margins. We test these predictions in public vision transformers and in controlled models read far above their training token count. Attention spreads as predicted. Registers lose their share, though production models compensate in part, and the rescaling holds the share of DINOv2's registers nearly level. Applied at test time without training, the rescaling recovers part of the lost accuracy in nearly every model, with absolute or rotary positions and with registers, and on images with native detail. The calibrated multiplier rises with the logarithmic ratio on average and varies across models. Its rise is steeper than the square-root rule used in image generators; in controlled models the log ratio is also more accurate, while in the public models the two rules' accuracy difference remains unresolved. The rescaling does not restore the attention a model learned, and why it helps, beyond countering the dilution, remains open.
来源:arXiv (AI + Vision + Imaging) · arxiv.org