arXiv:2502.03738cs.CV2025-02ICML被引 37

越小的图像块,模型表现越好,甚至像素级编码更优。

Scaling Laws in Patchification: An Image Is Worth 50,176 Tokens And More

  • 通过调整图像块大小,发现模型性能随块变小持续提升
  • 最大序列达50,176个标记,ImageNet-1k上准确率84.6%
  • 小块使任务特定解码器不再关键,适合构建非压缩视觉模型

自视觉变换器(ViT)提出以来,图像分块(patchification)被视为视觉架构中默认的图像标记化方法。该方法通过压缩图像空间尺寸,有效缩短标记序列并降低类似ViT的纯视觉架构的计算开销。本文系统研究了这种基于分块的压缩编码范式带来的信息损失及其对视觉理解的影响。我们进行了广泛的分块大小缩放实验,意外发现分块中的一个有趣缩放规律:模型可持续从更小的分块中获益,并在达到最小分块尺寸1×1(即像素级标记)时性能仍继续提升。这一结论在多种视觉任务、不同输入尺度及多种架构(如ViT和近期的Mamba模型)中均成立。此外,作为副产物,我们发现使用更小分块时,任务特定解码器在密集预测任务中变得不那么关键。实验中,我们成功将视觉序列扩展至空前的50,176个标记,在ImageNet-1k基准上以基础尺寸模型实现84.6%的测试准确率。本研究希望为未来非压缩视觉模型的构建提供洞见与理论基础。代码已开源:https://github.com/wangf3014/Patch_Scaling。

原文摘要 · Abstract (English)

Since the introduction of Vision Transformer (ViT), patchification has long been regarded as a de facto image tokenization approach for plain visual architectures. By compressing the spatial size of images, this approach can effectively shorten the token sequence and reduce the computational cost of ViT-like plain architectures. In this work, we aim to thoroughly examine the information loss caused by this patchification-based compressive encoding paradigm and how it affects visual understanding. We conduct extensive patch size scaling experiments and excitedly observe an intriguing scaling law in patchification: the models can consistently benefit from decreased patch sizes and attain improved predictive performance, until it reaches the minimum patch size of 1x1, i.e., pixel tokenization. This conclusion is broadly applicable across different vision tasks, various input scales, and diverse architectures such as ViT and the recent Mamba models. Moreover, as a by-product, we discover that with smaller patches, task-specific decoder heads become less critical for dense prediction. In the experiments, we successfully scale up the visual sequence to an exceptional length of 50,176 tokens, achieving a competitive test accuracy of 84.6% with a base-sized model on the ImageNet-1k benchmark. We hope this study can provide insights and theoretical foundations for future works of building non-compressive vision models. Code is available at https://github.com/wangf3014/Patch_Scaling.

视觉模型分块机制缩放定律图像编码

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