Elastic Attention Cores for Scalable Vision Transformers
作者: Alan Z. Song, Yinjie Chen, Mu Nan, Rui Zhang, Jiahang Cao, Weijian Mai, Muquan Yu, Hossein Adeli, Deva Ramanan, Michael J. Tarr, Andrew F. Luo
分类: cs.CV, cs.LG
发布日期: 2026-05-12
备注: Project repository here: https://github.com/alansong1322/VECA
💡 一句话要点
提出VECA:通过弹性注意力核心实现可扩展的视觉Transformer
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 视觉Transformer 自注意力机制 线性复杂度 核心注意力 弹性计算
📋 核心要点
- 传统ViT计算复杂度随图像分辨率呈二次方增长,限制了其在高分辨率场景的应用。
- VECA通过引入少量可学习的核心token,使图像patch仅通过核心token进行信息交换,实现线性复杂度。
- VECA在分类和密集预测任务上,以更低的计算成本实现了与先进视觉基础模型相当的性能。
📝 摘要(中文)
视觉Transformer (ViT) 通过利用全连接自注意力实现了强大的数据驱动扩展。然而,这种灵活性带来了计算成本,该成本随图像分辨率呈二次方增长,限制了 ViT 在高分辨率领域的应用。这种方法的根本假设是,成对的token交互对于学习丰富的视觉语义表示是必要的。在这项工作中,我们挑战了这一假设,证明了无需任何直接的patch-to-patch交互也可以学习有效的视觉表示。我们提出了 VECA (Visual Elastic Core Attention),这是一种视觉Transformer架构,它使用高效的线性时间核心-外围结构化注意力,由一小组学习到的核心启用。在 VECA 中,这些核心充当通信接口:patch token 仅通过核心token交换信息,核心token从头开始初始化并在层之间传播。由于 N 个图像patch仅与分辨率不变的 C 个学习到的“核心”嵌入直接交互,因此对于预定的 C,这会产生线性复杂度 O(N),从而绕过二次方缩放。与之前的交叉注意力架构相比,VECA 维护并迭代更新完整的 N 个输入token集,避免了小的 C 路瓶颈。结合沿核心轴的嵌套训练,我们的模型可以在推理期间弹性地权衡计算和准确性。在分类和密集任务中,VECA 实现了与最新的视觉基础模型相媲美的性能,同时降低了计算成本。我们的结果表明,弹性核心-外围注意力是视觉Transformer的一种可扩展的替代构建块。
🔬 方法详解
问题定义:现有Vision Transformer (ViT) 模型依赖于全局自注意力机制,计算复杂度为O(N^2),其中N是图像patch的数量。这使得ViT在高分辨率图像处理时计算成本过高,难以扩展到实际应用中。现有的交叉注意力架构虽然降低了复杂度,但可能引入信息瓶颈,影响模型性能。
核心思路:VECA的核心思想是引入一组数量较少的、可学习的“核心”token,图像patch不再直接相互交互,而是通过这些核心token进行信息传递。这样,计算复杂度就从O(N^2)降低到O(N*C),其中C是核心token的数量,且C远小于N。通过这种核心-外围结构,VECA在降低计算复杂度的同时,避免了信息瓶颈。
技术框架:VECA的整体架构类似于标准的Transformer,但自注意力模块被替换为弹性核心注意力模块。该模块包含以下几个步骤:1) 将输入图像划分为patch token;2) 初始化一组可学习的核心token;3) 每个patch token与所有核心token进行注意力交互,聚合核心token的信息;4) 将聚合后的核心token信息传递给对应的patch token;5) 对更新后的patch token进行后续处理。核心token在每一层都会被更新,从而学习到更有效的视觉表示。
关键创新:VECA的关键创新在于其弹性核心注意力机制。与传统的自注意力相比,VECA避免了patch token之间的直接交互,从而实现了线性复杂度。与交叉注意力相比,VECA保留了所有patch token的信息,避免了信息瓶颈。此外,VECA还引入了嵌套训练策略,允许在推理时弹性地调整核心token的数量,从而在计算成本和模型性能之间进行权衡。
关键设计:VECA的关键设计包括:1) 核心token的初始化方式(从头开始学习);2) 核心token的数量C的选择(影响计算复杂度和模型性能);3) 注意力机制的具体实现(例如,使用scaled dot-product attention);4) 嵌套训练策略的实现(允许在不同核心token数量下训练模型)。损失函数通常采用交叉熵损失或类似的分类/回归损失。
🖼️ 关键图片
📊 实验亮点
VECA在ImageNet分类任务上取得了与DeiT-III相当的性能,同时显著降低了计算成本。在密集预测任务(例如语义分割)上,VECA也表现出优异的性能,超过了许多现有的ViT变体。通过调整核心token的数量,VECA可以在推理时弹性地权衡计算成本和模型精度,使其能够适应不同的应用场景。
🎯 应用场景
VECA具有广泛的应用前景,尤其是在需要处理高分辨率图像或视频的场景中,例如自动驾驶、医学影像分析、遥感图像处理等。其线性复杂度的特性使其能够部署在资源受限的设备上,例如移动设备或嵌入式系统。此外,VECA的弹性计算特性使其能够根据实际需求动态调整计算资源,从而实现更高效的推理。
📄 摘要(原文)
Vision Transformers (ViTs) achieve strong data-driven scaling by leveraging all-to-all self-attention. However, this flexibility incurs a computational cost that scales quadratically with image resolution, limiting ViTs in high-resolution domains. Underlying this approach is the assumption that pairwise token interactions are necessary for learning rich visual-semantic representations. In this work, we challenge this assumption, demonstrating that effective visual representations can be learned without any direct patch-to-patch interaction. We propose VECA (Visual Elastic Core Attention), a vision transformer architecture that uses efficient linear-time core-periphery structured attention enabled by a small set of learned cores. In VECA, these cores act as a communication interface: patch tokens exchange information exclusively through the core tokens, which are initialized from scratch and propagated across layers. Because the $N$ image patches only directly interact with a resolution invariant set of $C$ learned "core" embeddings, this yields linear complexity $O(N)$ for predetermined $C$, which bypasses quadratic scaling. Compared to prior cross-attention architectures, VECA maintains and iteratively updates the full set of $N$ input tokens, avoiding a small $C$-way bottleneck. Combined with nested training along the core axis, our model can elastically trade off compute and accuracy during inference. Across classification and dense tasks, VECA achieves performance competitive with the latest vision foundation models while reducing computational cost. Our results establish elastic core-periphery attention as a scalable alternative building block for Vision Transformers.