SPoT: Subpixel Placement of Tokens in Vision Transformers

Martine Hjelkrem-Tan, Marius Aasan, Gabriel Y. Arteaga, Adín Ramírez Rivera

TL;DR

Standard Vision Transformers (ViTs) are locked into rigid, discrete patch grids, which forces key image features to be split across boundaries and degrades performance in sparse token regimes. SPoT (Subpixel Placement of Tokens) solves this by allowing tokens to be placed continuously at subpixel coordinates within an image. By optimizing where tokens look rather than just how many are used, SPoT enables massive token reductions (down to 12.5% of the original budget) while maintaining high accuracy.

What Problem Does This Paper Address?

While Vision Transformers naturally accommodate sparsity (e.g., dropping uninformative patches to speed up inference), they inherit a fundamental limitation from text-based transformers: they treat images as a discrete sequence of grid-aligned tokens.

This rigid grid structure creates a "misalignment problem." If a critical image feature happens to fall on the border of two patches, or at the intersection of four, its semantic information is fragmented across multiple tokens. When trying to run models efficiently by selecting only a sparse subset of tokens, this grid constraint forces awkward compromises—like choosing multiple patches just to capture one poorly aligned feature. The authors liken this to "eating soup with a fork: possible, but decidedly inefficient and frustrating."

Figure 2: Grids cannot align over all key features. (a) A 5 × 5 patch grid (gray) with three optimal region placements for sparse feature selection. The green patch is well aligned (A), yellow straddles two cells (B), and red lies on a corner (C) and leaks into four cells. Translating the grid only swaps which peak is misaligned—one patch is always bad. (b) Our subpixel tokenizer drops fixed-size windows (green squares) directly on each peak, eliminating the alignment trade-off while still allowing conventional grid tokens when they are well aligned.

Methods

The authors introduce two core components to liberate ViT tokenization from the grid:

  1. SPoT (Subpixel Placement of Tokens): Instead of defining patch locations on a fixed discrete grid, SPoT parametrizes token positions as continuous coordinates $s_i = (h, w)$. To extract features from these arbitrary subpixel locations in a differentiable way, SPoT employs a bilinear interpolation function. Because the interpolation is differentiable, gradients can flow directly back to the token coordinates, enabling gradient-based optimization of token placement.
  2. SPoT-ON (Oracle-guided Neighborhood search): To discover the absolute upper bound of what subpixel token placement can achieve, the authors design an "oracle" tool. For a given frozen ViT encoder, SPoT-ON uses gradient descent on a per-image basis to find the mathematically optimal coordinates for a fixed budget of tokens to minimize classification loss.

The authors also evaluate several spatial initialization priors for SPoT tokens before optimization, including Uniform, Gaussian (center-biased), Sobol (quasirandom coverage), Isotropic (even subpixel grid), Center, and Salient (using a pretrained saliency model).

Figure 1: (Left) A standard ViT splits the image into a fixed grid of non-overlapping patches. (Right) With SPoT, a continuously sampled set of subpixel-precise patches are extracted.

Datasets

The approach was evaluated using standard ViT-B/16 architectures on:

  • ImageNet-1k: Used for retrofitting, fine-tuning, and downstream classification evaluation.
  • ImageNet-21k: Used as the pre-training dataset for one of the supervised baseline models before retrofitting.

Key Insights and Ideas

  • Off-Grid Flexibility is a Superpower: Allowing tokens to shift by even fractions of a pixel yields massive performance gains over forcing those same optimized tokens back onto the nearest discrete grid coordinates.
  • The Sparsity Dilemma (Object-Centric vs. Coverage): The ideal spatial prior changes based on your token budget. In highly sparse regimes (e.g., only 25 tokens), object-centric and center-biased priors perform best because the model must prioritize the main subject. However, in dense regimes, uniform coverage becomes superior because object-focused features quickly saturate, and the model benefits more from broader background context.
  • Tokens Seek Context, Not Just Saliency: When the oracle optimizes token locations, they don't simply cluster on the highest-saliency pixels of an object. Instead, they often position themselves around or near the object. This suggests that token interdependency—positioning tokens to provide complementary context that self-attention can exploit—is more important than pure object saliency.
  • Optimal Placements Transfer Across Models: Remarkably, token coordinates optimized by SPoT-ON for one model (e.g., a supervised ViT) can be transferred to a completely different, independently trained model (e.g., a self-supervised MAE) and still provide significant performance boosts. This proves that SPoT-ON captures genuine, model-agnostic image structure.

Key Results

  • Massive Sparsity with High Accuracy: In an extreme sparse setting using only 25 tokens (~12.5% of the standard 196 tokens in a ViT-B/16), SPoT-ON achieved 90.9% top-1 accuracy on ImageNet-1k. This outperformed the grid-constrained version of the same optimization by 16.9 percentage points.
  • Superior Throughput-Accuracy Trade-off: SPoT consistently outperformed existing inference-time sparsity techniques like PatchDropout and Token Merging (ToMe). For instance, at a 100-token budget, SPoT achieved a 3.31× speed-up with a minimal accuracy drop (-1.13% for MAE-IN1k), whereas ToMe achieved less speed-up (1.94×) with a larger accuracy penalty (-4.87%).
  • Negligible Overhead: The bilinear interpolation step introduces an additional cost of only $O(T \cdot C)$ complexity (where $T$ is tokens and $C$ is channels), which is asymptotically negligible compared to the $O(T^2 \cdot C)$ cost of the self-attention blocks.

Limitations and Future Work

The primary limitation of this work is that SPoT-ON is an oracle analysis tool, not a practical inference method, because running gradient descent per image to find token locations is computationally expensive.

To bridge this gap, the authors propose that future work should focus on training a lightweight "policy network" (such as a small CNN or MLP). This network would act as a structured regressor, predicting the optimal continuous subpixel token placements in a single, fast forward pass based on low-level image features. Additionally, exploring how SPoT applies to tasks requiring explicit spatial reasoning—like object localization, detection, and video understanding—remains an open and promising direction.

Summary updated

BibTeX
@article{hjelkremtan2026spot,
  author = {Martine Hjelkrem-Tan and Marius Aasan and Gabriel Y. Arteaga and Adín Ramírez Rivera},
  title = {{SPoT: Subpixel Placement of Tokens in Vision Transformers}},
  journal = {Trans. Mach. Learn. Res.},
  year = {2026},
}
Figure