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 · DOI

Introduction

For decades, computer vision has been built on the foundation of "locality"—the inductive bias that neighboring pixels are more semantically related than distant ones. From the local receptive fields of Convolutional Neural Networks (ConvNets) to the 16x16 patchification used in Vision Transformers (ViTs), this bias has been considered essential for learning spatial hierarchies. This paper challenges that assumption, asking a radical question: Is locality actually necessary? By treating individual pixels as independent tokens in a vanilla Transformer, the authors demonstrate that models can learn the structure of the visual world from scratch, often outperforming their locality-biased counterparts.

Methodology: The "Bag of Pixels" Approach

The researchers implemented a "pixels-as-tokens" architecture that strips away the 2D grid structure. Instead of grouping pixels into patches, they used 1x1 patches, treating every RGB pixel as a unique token.

Architecture overview: treating individual pixels as tokens.

To ensure no spatial knowledge was "baked in," the model utilized randomly initialized, learnable position embeddings rather than fixed 2D sine-cosine functions. This forces the model to learn the spatial relationships between pixels entirely from the data. The architecture remains a standard Transformer encoder (ViT) or Diffusion Transformer (DiT), with the only change being the granularity of the input tokens. To further reduce reliance on numerical pixel relationships, the authors also experimented with dictionary-based embeddings, where each intensity value (0-255) maps to a learned vector.

Key Results and Insights

The most striking finding is that "locality-free" Transformers frequently achieve superior results compared to patch-based models of equivalent size. On ImageNet classification, a pixel-based ViT-L/1 achieved 76.9% Acc@1, surpassing the 2x2 patch-based ViT-L/2 at 75.6%. Similar gains were observed in self-supervised learning and image generation.

Impact of patch size on model performance.

Resolution as the Primary Driver

The study suggests that the success of modern Vision Transformers may be less about the "patches" themselves and more about the high resolution (sequence length) they enable. When resolution is maintained but the patch grouping is removed, performance actually improves. This indicates that patchification is a useful heuristic for computational efficiency rather than a requirement for effective learning.

Robustness and Generative Quality

Pixel-based models also showed increased robustness to image downsizing algorithms. Because they do not rely on local smoothing inherent in interpolation, they handle raw pixel-dropping more effectively than patch-based models. In generative tasks, the pixel-based Diffusion Transformer (DiT-L/1) achieved a better FID score (4.05) than the baseline (4.16), producing images with significantly finer details.

Limitations and Future Work

The primary hurdle for pixel-level Transformers is computational complexity. Since standard Transformers scale quadratically with sequence length ($O(L^2)$), a standard 224x224 ImageNet crop results in over 50,000 tokens—a sequence length that is currently prohibitively expensive for most hardware.

However, the authors argue that as efficient attention mechanisms (like FlashAttention) and specialized hardware continue to evolve, the community should move toward these "purer" architectures. By letting the data speak for itself rather than forcing it through a 16x16 filter, we may unlock more flexible and powerful vision models.

Summary updated

BibTeX
@inproceedings{nguyen2025image,
  author = {Duy-Kien Nguyen and Mahmoud Assran and Unnat Jain and Martin R. Oswald and Cees G. M. Snoek and Xinlei Chen},
  title = {{An Image is Worth More Than 16x16 Patches: Exploring Transformers on Individual Pixels}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=tjNf0L8QjR},
}
Figure