Schaalwetten in Patchificatie: Een Afbeelding Is 50.176 Tokens Waard en Meer
Scaling Laws in Patchification: An Image Is Worth 50,176 Tokens And More
February 6, 2025
Auteurs: Feng Wang, Yaodong Yu, Guoyizhe Wei, Wei Shao, Yuyin Zhou, Alan Yuille, Cihang Xie
cs.AI
Samenvatting
Sinds de introductie van de Vision Transformer (ViT) wordt patchificatie al lange tijd beschouwd als een de facto benadering voor beeldtokenisatie voor eenvoudige visuele architecturen. Door de ruimtelijke grootte van afbeeldingen te comprimeren, kan deze benadering effectief de tokenreeks verkorten en de rekenkundige kosten van ViT-achtige eenvoudige architecturen verminderen. In dit werk is ons doel om grondig te onderzoeken welke informatie verloren gaat door dit op patchificatie gebaseerde compressieve encoderingsparadigma en hoe dit van invloed is op visueel begrip. We voeren uitgebreide experimenten uit met het schalen van patchgroottes en observeren met enthousiasme een intrigerende schaalwet in patchificatie: de modellen kunnen consequent profiteren van afnemende patchgroottes en verbeterde voorspellende prestaties behalen, totdat de minimale patchgrootte van 1x1 is bereikt, d.w.z. pixel-tokenisatie. Deze conclusie is breed toepasbaar op verschillende visuele taken, diverse invoerschalen en verschillende architecturen zoals ViT en de recente Mamba-modellen. Bovendien ontdekken we als bijproduct dat met kleinere patches taakspecifieke decoderingskoppen minder cruciaal worden voor dichte voorspelling. In de experimenten schalen we succesvol de visuele reeks op tot een uitzonderlijke lengte van 50.176 tokens, waarbij we een competitieve testnauwkeurigheid van 84,6% behalen met een model van basiskwaliteit op de ImageNet-1k benchmark. We hopen dat deze studie inzichten en theoretische fundamenten kan bieden voor toekomstige werken aan het bouwen van niet-compressieve visiemodellen. De code is beschikbaar op https://github.com/wangf3014/Patch_Scaling.
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.Summary
AI-Generated Summary