An Image is Worth More Than 16x16 Patches: Exploring Transformers on Individual Pixels
Duy-Kien Nguyen, Mahmoud Assran, Unnat Jain, Martin R. Oswald, Cees G. M. Snoek, Xinlei Chen
TL;DR
This work questions the necessity of locality as an inductive bias in vision models by applying Transformer architectures directly to individual pixels as tokens, with learnable position embeddings and no 2D grid priors. Across three case studies—supervised classification/ regression, self-supervised MAE pretraining, and diffusion-based image generation—the pixel-token Transformer demonstrates competitive or superior performance relative to patch-based ViT baselines, despite substantially longer sequence lengths (up to L = H · W). The study also analyzes two locality designs in ViT, showing patchification exerts a stronger locality bias than position embeddings, and demonstrates that removing locality is feasible but challenging in practice due to computational costs. The findings advocate rethinking inductive biases in vision architectures and highlight that locality is not strictly fundamental, though patch-based methods remain effective trade-offs between accuracy and efficiency. Overall, the work broadens the design space for future vision models by validating locality-free Transformers as a viable research direction under scalable computation and diverse tasks, including generative modeling with latent-token space representations.
Abstract
This work does not introduce a new method. Instead, we present an interesting finding that questions the necessity of the inductive bias of locality in modern computer vision architectures. Concretely, we find that vanilla Transformers can operate by directly treating each individual pixel as a token and achieve highly performant results. This is substantially different from the popular design in Vision Transformer, which maintains the inductive bias from ConvNets towards local neighborhoods (e.g. by treating each 16x16 patch as a token). We showcase the effectiveness of pixels-as-tokens across three well-studied computer vision tasks: supervised learning for classification and regression, self-supervised learning via masked autoencoding, and image generation with diffusion models. Although it's computationally less practical to directly operate on individual pixels, we believe the community must be made aware of this surprising piece of knowledge when devising the next generation of neural network architectures for computer vision.
