arXiv:2504.14386cs.CVcs.AI2025-04

优化视觉Transformer的补丁排列顺序,提升位置信息表达能力。

LOOPE: Learnable Optimal Patch Order in Positional Embeddings for Vision Transformers

  • 提出可学习的补丁排序方法LOOPE,动态优化位置编码顺序。
  • 在多个ViT架构上提升分类准确率,相对与绝对位置信息保留效果显著增强。
  • 设计新基准测试,揭示位置编码性能差异达30%以上,适合模型评估者使用。

位置编码(PE)在视觉变换器(ViTs)中至关重要,因其能弥补自注意力机制固有的置换不变性导致的空间信息缺失。尽管绝对位置编码(APE)相比相对位置编码(RPE)在理论上更具优势,尤其因正弦函数能保持单调性和平移不变性等空间归纳偏置,但在将二维网格映射为一维序列时仍面临根本挑战。现有方法大多忽略或未探索补丁排序对位置编码的影响。为此,我们提出LOOPE,一种可学习的补丁排序方法,针对特定频率集优化空间表示,提供了一种系统性的补丁排序优化方案。实验结果表明,所提位置编码在多种ViT架构上显著提升分类精度。为严格评估位置编码的有效性,我们引入“三格实验”这一新型基准框架,用于评估不同ViT架构下位置编码保持相对与绝对位置信息的能力。与常规评估中仅报告4至6%的性能差距不同,本方法揭示出高达30至35%的差异,提供了更敏感的诊断工具来衡量位置编码的效能。实验分析证实,提出的LOOPE在保留相对和绝对位置信息方面表现出更强的效能。

原文摘要 · Abstract (English)

Positional embeddings (PE) play a crucial role in Vision Transformers (ViTs) by providing spatial information otherwise lost due to the permutation invariant nature of self attention. While absolute positional embeddings (APE) have shown theoretical advantages over relative positional embeddings (RPE), particularly due to the ability of sinusoidal functions to preserve spatial inductive biases like monotonicity and shift invariance, a fundamental challenge arises when mapping a 2D grid to a 1D sequence. Existing methods have mostly overlooked or never explored the impact of patch ordering in positional embeddings. To address this, we propose LOOPE, a learnable patch-ordering method that optimizes spatial representation for a given set of frequencies, providing a principled approach to patch order optimization. Empirical results show that our PE significantly improves classification accuracy across various ViT architectures. To rigorously evaluate the effectiveness of positional embeddings, we introduce the "Three Cell Experiment", a novel benchmarking framework that assesses the ability of PEs to retain relative and absolute positional information across different ViT architectures. Unlike standard evaluations, which typically report a performance gap of 4 to 6% between models with and without PE, our method reveals a striking 30 to 35% difference, offering a more sensitive diagnostic tool to measure the efficacy of PEs. Our experimental analysis confirms that the proposed LOOPE demonstrates enhanced effectiveness in retaining both relative and absolute positional information.

视觉Transformer位置编码补丁排序模型优化

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。