---
title: "Rethinking Spatial Dimensions of Vision Transformers — Heo 2021"
description: "How pooling changes vision transformers, why PiT improves on fixed spatial grids, and what its experiments establish about accuracy and…"
canonical: "https://research.elamur.ai/free/en/papers/heo-2021-rethinking-spatial-dimensions-vision-transformers/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Parse](https://mova.elamur.ai/free/en/parse/) · [Dictionary](https://md.dictionary.elamur.ai/free/en/) · [Translate](https://md.translate.elamur.ai/free/en/) · **Research** · [Gali](https://md.gali.elamur.ai/free/en/) · [MCP](https://mcp.elamur.ai/) · [Locations](https://md.locations.elamur.ai/free/en/) · [Weather](https://md.weather.elamur.ai/free/en/)

[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/heo-2021-rethinking-spatial-dimensions-vision-transformers/)

[home](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2021](https://md.research.elamur.ai/free/en/papers/2021/) / Rethinking Spatial Dimensions of Vision Transformers

# Rethinking Spatial Dimensions of Vision Transformers

Paper · 2021 · Byeongho Heo, Sangdoo Yun, Dongyoon Han et al.

**Authors:** [Byeongho Heo](https://md.research.elamur.ai/free/en/authors/byeongho-heo/), [Sangdoo Yun](https://md.research.elamur.ai/free/en/authors/sangdoo-yun/), [Dongyoon Han](https://md.research.elamur.ai/free/en/authors/dongyoon-han/), [Sanghyuk Chun](https://md.research.elamur.ai/free/en/authors/sanghyuk-chun/), [Junsuk Choe](https://md.research.elamur.ai/free/en/authors/junsuk-choe/) and [Seong Joon Oh](https://md.research.elamur.ai/free/en/authors/seong-joon-oh/) · **Year:** 2021 · **Venue:** IEEE/CVF International Conference on Computer Vision (ICCV) · **Licence:** [CC BY-SA 4.0 (arXiv)](https://creativecommons.org/licenses/by-sa/4.0/)

[**640** citations OpenAlex, 2026-10-14](https://openalex.org/works?filter=cites:W3202715235) · [IEEE/CVF International Conference on Computer Vision (ICCV)](https://openalex.org/S4363607764) · [licence](https://creativecommons.org/licenses/by-sa/4.0/)

- [PDF](https://arxiv.org/pdf/2103.16302)
- [DOI 10.1109/iccv48922.2021.01172](https://doi.org/10.1109/iccv48922.2021.01172)
- [arXiv 2103.16302](https://arxiv.org/abs/2103.16302)
- [OpenAlex](https://openalex.org/W3202715235)

Citations: OpenAlex, 2026-10-14.

## Deep dive: Rethinking Spatial Dimensions of Vision Transformers

How pooling changes vision transformers, why PiT improves on fixed spatial grids, and what its experiments establish about accuracy and robustness. · about 34 minutes to read

**In this deep dive**

1. [Summary](#dd-summary)
2. [Ideas worth borrowing](#dd-ideas-worth-borrowing)
3. [How Mova uses it](#dd-how-mova-uses-it)
4. [The problem and its context](#dd-the-problem-and-its-context)
5. [The method, step by step](#dd-the-method-step-by-step)
6. [Experiments and results](#dd-experiments-and-results)
7. [What the ablations show](#dd-what-the-ablations-show)
8. [Limitations](#dd-limitations)
9. [What came after](#dd-what-came-after)

### Summary

An image recognition network must decide how much spatial detail to preserve as information moves through its layers. Conventional convolutional networks typically begin with a relatively detailed image representation, then reduce its spatial resolution while increasing the number of features stored at each location. The original [vision transformer](https://md.research.elamur.ai/free/en/concepts/transformer/), or ViT, takes a different approach: after dividing an image into patches, it keeps the same spatial arrangement throughout its transformer blocks. This paper asks whether that constant resolution is a useful design choice for vision, or a convention inherited from language processing that deserves reconsideration.

The authors propose the Pooling-based Vision Transformer, abbreviated PiT. It retains transformer blocks but inserts pooling operations that reduce the spatial grid and expand the channel dimension. Channels describe the features associated with each spatial location; increasing their number gives a coarser location a larger feature representation. PiT therefore moves from a more detailed grid towards coarser representations as processing progresses. Its pooling operation treats image locations separately from special tokens, such as the token used to collect information for classification. This preserves an important part of ViT’s organization while changing how spatial information is distributed through depth.

The experimental argument begins with convolutional networks. When the authors replace the usual changing spatial resolutions of ResNet with a constant-resolution arrangement, training and validation behavior deteriorate. They then make the complementary change to ViT by introducing pooling. PiT obtains lower training loss at comparable computational cost and stronger validation performance. ImageNet experiments examine several network sizes and training recipes, including augmentation and teacher-based training. The reported advantage is clearest with simpler training, while stronger recipes narrow some accuracy differences. At the standard image resolution used for design, PiT also offers favorable computational and throughput comparisons with corresponding ViT variants.

The gains extend beyond ordinary classification, but the boundaries matter. A detector using PiT-S performs better than one using ViT-S, although the ResNet50 detector remains more accurate in that experiment. Robustness tests favor PiT over ViT under occlusion, unusual images, background changes, and an adversarial attack. Attention measurements also show a different distribution of interactions through the network. None of this establishes pooling as universally necessary for every vision transformer. It establishes a useful architecture choice under the tested conditions, with explicit weaknesses at very small scales and a throughput disadvantage when the existing PiT design is transferred to larger image resolution.

### Ideas worth borrowing

Treat representation size as an architectural decision. The paper’s central contribution is to make spatial resolution part of the design argument instead of a fixed consequence of the input format. A network can preserve many locations early, then allocate more features to fewer locations later. This idea is useful wherever the granularity needed for initial processing differs from the granularity needed for a final decision. The transferable question is what information must remain separately addressable at each stage. A successful input representation need not remain the best representation for every subsequent layer.

Separate ordinary positions from special tokens. PiT cannot pool its complete token sequence as though every entry occupied an image location. Spatial tokens belong to a grid, while classification and distillation tokens serve different purposes. The authors reshape and pool the spatial portion, then adjust the special tokens through a separate fully connected operation. This suggests a broader engineering principle: when a representation contains structurally different kinds of information, give each kind an appropriate transformation before reuniting them. The benefit is both practical and conceptual, because the operation reflects what each component means.

Distinguish fitting capacity from generalization. The authors examine training loss against computational cost, then validation accuracy against training accuracy. These comparisons answer different questions. Lower training loss suggests that an architecture can fit the training task more effectively under the selected conditions. Better validation accuracy at a similar training accuracy suggests that the fitted solution transfers more successfully to held-out images. Looking only at final accuracy would combine these effects. Separating them is useful when evaluating architectural changes, especially when a larger network becomes better at fitting its training data without becoming more useful on new examples.

Measure execution as well as arithmetic. The paper records floating-point operations, parameter counts, and GPU throughput rather than treating any single quantity as a complete efficiency measure. Its larger-resolution experiment makes the reason concrete: a design with favorable throughput at its intended resolution can lose that advantage when the input changes. This lesson applies to [efficient systems and compression](https://md.research.elamur.ai/free/en/topics/efficient-models/) more generally. Resource claims should identify the workload and hardware conditions under which they hold, and architecture comparisons should include a measurement close to the intended deployment constraint.

Use complementary measurements of internal behavior. Attention entropy describes how broadly attention weight is distributed; attention distance describes how far that weight reaches across the image. These are related but different properties. Attention can be concentrated on a distant region or dispersed among nearby locations. Measuring both helps distinguish those possibilities. The reusable idea is to choose diagnostics that answer separate questions about an internal operation, then interpret them together. Such measurements support [interpretability](https://md.research.elamur.ai/free/en/topics/interpretability/) without automatically proving that the observed pattern causes a performance gain.

Test the proposed benefit through targeted disturbances. PiT’s robustness evaluation changes particular aspects of the input instead of relying exclusively on ordinary validation images. Covering the center probes dependence on a discriminative region. Replacing backgrounds probes sensitivity to context around the foreground. Unusual images and adversarial perturbations add other forms of difficulty. This approach is useful whenever an architectural explanation implies a particular failure mode: select evaluations that make that failure visible. The paper also shows why multiple tests matter, since an apparent benefit on a dataset constructed around another network’s mistakes can be difficult to interpret on its own.

### How Mova uses it

For Mova, a small transparent language system implemented in Rust, the relevant contribution is an architectural question rather than an image-processing component to copy directly. PiT asks whether every layer should operate at the same representational granularity. A language system could ask a related question about when to keep information attached to individual positions and when to combine it into a more compact structure. That is a possible research direction for Mova, not an established implementation or a demonstrated consequence of this paper.

The distinction between spatial tokens and special tokens offers a more concrete design analogy. PiT applies different transformations to components with different roles, then makes their channel dimensions compatible again. If Mova contains representations that serve different purposes, the same principle would favor explicit handling of those differences. A representation tied to an input position and a representation used to summarize a larger unit should not be combined merely because both can be stored in the same container. In a transparent implementation, the transformation and its purpose could remain visible in the code and in diagnostic output.

A useful experimental proposal would be to compare a constant-granularity processing path with a path that introduces deliberate compression. The comparison would need to preserve enough common structure to make the result interpretable, following the paper’s effort to relate PiT to ViT. Mova could then examine whether compression changes resource use, fitting behavior, and performance on held-out tasks. The paper provides a pattern for organizing such an investigation. It does not supply a language-specific pooling rule, a Rust implementation, or evidence that compressing linguistic positions would improve Mova.

The paper’s attention analysis also suggests a style of instrumentation. Where a system uses weighted interactions, it can be useful to inspect both how dispersed the weights are and how far the interactions reach in the relevant representation. For language, the meaning of distance would have to be defined appropriately rather than borrowed from image coordinates. Transparency would require showing that definition alongside the measurement. Otherwise, a seemingly precise diagnostic could conceal an unsuitable assumption about what counts as a meaningful neighborhood.

The strongest immediate lesson for Mova is therefore methodological: make changes to representation size explicit, separate structurally different components, and evaluate the resulting tradeoffs under stated conditions. No implementation claim follows from the paper. Its own discussion stresses differences between image inputs and linguistic inputs, so the honest path is to treat these ideas as hypotheses for a language system and test them in that setting.

### The problem and its context

#### Why a fixed spatial grid deserved examination

The paper begins from a change in how image recognition networks were being built. Convolutional neural networks had established a familiar architecture pattern, while self-attention offered a different mechanism for exchanging information between image regions. The original [ViT](https://md.research.elamur.ai/free/en/papers/dosovitskiy-2020-image-worth-16x16-words-transformers/) showed that a transformer could support strong image recognition without relying on convolution throughout its processing blocks. That result made the transformer architecture itself an important object of study.

A self-attention operation allows one position to gather information from other positions according to learned relationships between their representations. In the vision setting described by the paper, those positions correspond to image patches. Unlike a convolution with a restricted spatial neighborhood, attention can connect locations across the image. This changes how information travels, but it does not settle how many spatial locations a network should preserve at each depth.

ViT divides its input into patches of size 16×16 and turns them into tokens. Apart from its initial embedding operation, the architecture described here does not use convolution. Its transformer blocks maintain the same spatial token count. The paper regards this arrangement as a choice inherited from the transformer’s language-processing origins, instead of a design principle already established for images.

The distinction matters because spatial resolution and spatial interaction are separate aspects of an architecture. Global attention makes distant locations accessible, but it does not make a fine grid and a coarse grid equivalent. At different resolutions, a token corresponds to a different portion of the image representation. Changing that organization may affect computational demands, the kinds of interactions the network learns, and the information available to later layers.

The authors therefore investigate a narrower question than whether convolution or attention is superior. They ask whether the changing spatial dimensions familiar from convolutional networks are also helpful inside a transformer. This framing lets them preserve major features of ViT while testing a convention that ViT had left behind.

#### What convolutional architectures already did

The paper traces spatial reduction through several earlier convolutional designs. [AlexNet](https://md.research.elamur.ai/free/en/papers/krizhevsky-2012-imagenet-classification-deep-convolutional/) used max-pooling to shrink spatial dimensions, with later convolutions increasing channel counts. [VGG](https://md.research.elamur.ai/free/en/papers/simonyan-2014-very-deep-convolutional-networks-large/) likewise arranged processing around successively smaller resolutions. These examples establish that spatial reduction was a persistent architecture convention instead of an incidental feature of a single network.

[ResNet](https://md.research.elamur.ai/free/en/papers/he-2015-deep-residual-learning-image-recognition/) changed the reduction mechanism by using convolution with stride 2. Stride determines how the operation advances across its input; increasing it allows a convolution to produce a smaller spatial output. The paper also identifies strided convolution as a reduction method in more recent designs, including [EfficientNet](https://md.research.elamur.ai/free/en/papers/tan-2019-efficientnet-rethinking-model-scaling-convolutional/).

Alongside shrinking spatial dimensions, these architectures usually increase the channel dimension. Spatial positions say where information is stored; channels describe what features are stored there. The combined transformation gives later layers fewer locations but richer representations at those locations. The paper treats that joint arrangement as the relevant convention, rather than studying spatial size independently of every other architectural quantity.

Other cited work had already questioned parts of this convention. PyramidNet explored channel growth beyond the layers where spatial reduction occurs. ReXNet emphasized that channel configuration can substantially influence network performance. These examples help motivate a design study focused on dimensions: an architecture’s behavior depends on how its representational capacity is distributed, not only on the name of its main computational operation.

The paper also cites research connecting pooling to expressive power and generalization. Those connections provide motivation, but the authors do not rely on them as a complete explanation of PiT. They first run a direct experiment in ResNet to examine whether the conventional changing-resolution arrangement actually helps under their chosen training conditions.

#### How earlier attention systems fit into the picture

The authors place their work after [the transformer](https://md.research.elamur.ai/free/en/papers/vaswani-2017-attention-all-need/) and several attempts to use attention in vision. Non-local networks introduced attention operations into convolutional backbones. [DETR](https://md.research.elamur.ai/free/en/papers/carion-2020-end-end-object-detection-transformers/) demonstrated their use in object detection. Other cited approaches replaced local convolutions with attention, organized attention along spatial axes, or reduced the cost of interactions across a full feature map.

Many of those approaches retained the broader architecture inherited from convolutional networks. Replacing a local operation with attention did not necessarily remove the stages that reduced spatial resolution. As a consequence, their success did not resolve the specific question raised by ViT’s constant-resolution structure.

The authors also acknowledge Funnel Transformer, which reduces token counts in language processing through pooling and skip connections. PiT is therefore not presented as the first imaginable combination of a transformer and pooling. Its contribution concerns the spatial organization of a vision backbone and a pooling mechanism compatible with that organization. The paper explicitly treats the language and vision settings as different.

#### What PiT tries to preserve

ViT brought more than self-attention to image recognition. The paper highlights its treatment of normalization, its use of a classification token, and the organization of residual connections and processing blocks. [Layer normalization](https://md.research.elamur.ai/free/en/papers/ba-2016-layer-normalization/) is applied separately to spatial tokens, a placement the authors relate to positional normalization. The classification token offers a different route to an image-level output than averaging over all spatial positions.

The paper also notes that a separate distillation token had proved useful in [DeiT](https://md.research.elamur.ai/free/en/papers/touvron-2020-training-data-efficient-image-transformers/). Distillation trains a network using information supplied by a teacher network. Separating that role into a token creates another component that does not occupy an ordinary image location.

These details explain why the authors do not simply replace ViT with a conventional convolutional hierarchy. They want a spatial reduction mechanism that fits the transformer’s existing representation, including its nonspatial tokens. PiT is an attempt to combine a changing spatial grid with those retained transformer features.

### The method, step by step

#### Begin with a controlled architecture question

The authors first test spatial dimension configuration within ResNet50. This matters because the convention they hope to transfer should itself have an observable benefit. They compare the ordinary changing-resolution arrangement with a version that keeps the spatial size constant through its main processing blocks.

In ordinary ResNet50, the stem produces a 56×56 spatial representation. Later reductions use stride 2 and combine smaller spatial dimensions with larger channel dimensions. In the constant-resolution version, the authors instead use a ViT-style stem that produces a 14×14 representation. They remove subsequent spatial reductions so that the remaining blocks maintain that initial spatial size.

They vary channel size to examine networks at different computational scales. Training runs for 100 epochs without an elaborate collection of training techniques. The comparisons examine computational cost against training loss, training accuracy against validation accuracy, and computational cost against validation accuracy.

This is an architectural comparison with a specific intervention. It changes the initial spatial representation as well as the later reduction schedule. It therefore tests two different dimension configurations as complete arrangements, instead of isolating a single pooling operation while holding every intermediate representation identical.

The results motivate the transformer design. The conventional ResNet arrangement fits the training task more effectively at comparable computational cost and generalizes better in the authors’ comparisons. The next step is to ask whether a similar allocation of spatial and channel dimensions can help ViT.

How PiT processes an image The steps in order.

#### Start with a more detailed spatial representation

PiT begins with patch embedding, as ViT does, but its initial spatial sampling is denser. The patch size remains 16, while the embedding stride becomes 8. Patch size describes the image region used to form an embedding; stride describes the displacement between successive embedding locations. Keeping the patch size while reducing the stride allows PiT to start from a larger spatial grid.

The architecture is designed around input images of 224×224. This matters later, because computational behavior changes when the same design is used at a larger resolution. The initial grid is not a peripheral implementation detail: it is part of the dimension schedule being evaluated.

After embedding, transformer blocks process the tokens. PiT retains self-attention as the main interaction mechanism within those blocks. Pooling is inserted between groups of blocks to alter the representation passed to the next group.

#### Separate the grid from the token sequence

A transformer receives token representations arranged as a matrix: one dimension identifies tokens, and another identifies their channels. A spatial pooling operation needs access to the image layout hidden within that token sequence. PiT therefore separates the tokens associated with image locations and reshapes them into a spatial feature tensor.

The paper represents such a feature tensor as:

```
F ∈ ℝ^(H×W×C)
```

F denotes the feature representation. H is its spatial height, W its spatial width, and C its channel count. The notation ℝ indicates real-valued entries, while ∈ means that F belongs to the indicated space of tensors.

Reshaping does not itself learn a new representation. It restores the spatial arrangement so that the next operation can act on neighboring image locations. This is why knowing which tokens belong to the grid is essential.

The class token does not fit that layout. It gathers information for the image-level decision instead of corresponding to a patch location. A distillation token, when present, likewise has a separate role. Treating either as an ordinary grid cell would impose a spatial interpretation the architecture does not assign to it.

#### Pool spatial features and adjust special tokens

PiT applies depth-wise convolution to the spatial tensor. In the authors’ pooling design, this operation reduces spatial size and increases channels with a small parameter burden. The result is reshaped back into the matrix organization expected by subsequent transformer blocks.

Special tokens follow another route. An additional fully connected layer changes their channel dimension so that it matches the new spatial-token width. The transformed special tokens can then be combined with the pooled spatial tokens for continued transformer processing.

This design solves a compatibility problem created by changing channel size. A stage transition affects every representation consumed by the next block, even if only some representations participate in spatial pooling. PiT changes the spatial structure where that structure exists and changes the feature width of the other tokens separately.

The complete architecture includes two pooling operations, producing three spatial scales. Across these transitions, channel growth is implemented by increasing the number of attention heads. The authors choose depths broadly comparable to the ViT counterparts and adjust channels and heads to obtain favorable resource use.

#### Compare fitting and transfer to validation images

After constructing PiT, the authors repeat the architectural analysis used for ResNet. The training conditions match the earlier simple setting. The point is to examine the changing-resolution design before adding stronger techniques that might obscure or compensate for architectural weaknesses.

Training loss against FLOPs measures how well a network fits its task for a given arithmetic budget. FLOPs count floating-point operations and serve as a measure of computation. They do not directly measure elapsed time, which the later experiments assess separately.

Validation accuracy against training accuracy addresses a different question. If a network becomes better at classifying its training images, does that improvement carry over to unseen validation images? In the paper’s comparison, ViT’s validation performance can stagnate while its training performance improves. PiT shows a more favorable relationship.

These observations support the authors’ claim that the dimension schedule affects both fitting capability and generalization. They do not turn either quantity into an intrinsic constant of an architecture. The measurements remain tied to the training procedure, data scale, and variants examined.

#### Describe attention as a distribution

The paper then studies the attention matrices inside ViT-S and PiT-S. This analysis asks what changes in the interaction pattern accompany the architectural change. It uses attention values after the softmax operation, when they function as normalized weights.

The attention matrix is written as:

```
A ∈ ℝ^(M×N)
```

A is the matrix of attention weights. M and N specify its dimensions, and ℝ again denotes real-valued entries. The element at row i and column j is written αᵢ,ⱼ. The indices i and j identify the token positions involved in an attention interaction.

The authors use the following normalization convention:

```
∑ᵢ αᵢ,ⱼ = 1
```

αᵢ,ⱼ is an attention weight. The summation sign ∑ᵢ means to add those weights over index i while keeping j fixed. Under the paper’s indexing, each such collection of weights adds to 1. This is the probability-like structure used by the entropy calculation.

The analysis includes spatial tokens rather than the class token. It also omits attention from the final transformer block because, in the architecture under examination, those final spatial-token attention outputs do not affect the network’s prediction. That exclusion aligns the diagnostic with interactions relevant to the output.

#### Measure how broadly attention spreads

Attention entropy measures whether weight is concentrated on a relatively restricted set of positions or dispersed across many positions. The paper defines it as:

```
Entropy = −(1/N) ∑ⱼ ∑ᵢ αᵢ,ⱼ log αᵢ,ⱼ
```

Entropy is the resulting average dispersion measure. N is the dimension used to average across j. The inner sum runs over i, the outer sum over j, and αᵢ,ⱼ is the corresponding normalized attention weight. The function log is the logarithm applied to that weight. The leading minus sign gives the conventional non-negative form of this entropy expression.

A lower value indicates more concentrated attention. A higher value indicates a broader distribution. The measure does not identify which image regions receive attention, whether those regions contain the object, or whether an interaction is useful. It describes the distribution of weights.

The authors compute values over validation images and average across attention heads within each layer. The result is a layer-level view of attention organization. Such averaging makes broad trends easier to see, while concealing variation between individual heads and images.

#### Measure how far attention reaches

Entropy alone does not reveal spatial reach. The paper therefore assigns each spatial token a location normalized by feature-map dimensions:

```
pᵢ = (xᵢ/W, yᵢ/H)
```

pᵢ is the relative spatial position of token i. xᵢ and yᵢ are its horizontal and vertical coordinates. W and H are the width and height of the feature map. Dividing coordinates by those dimensions expresses position relative to the full spatial extent.

The attention distance is then:

```
Distance = (1/N) ∑ⱼ ∑ᵢ αᵢ,ⱼ ‖pᵢ − pⱼ‖₁
```

Distance is the attention-weighted average spatial separation. N supplies the average over j, and αᵢ,ⱼ weights the interaction between the indexed positions. pᵢ and pⱼ are their normalized coordinates. The notation ‖·‖₁ means the sum of absolute coordinate differences.

Normalizing coordinates allows the authors to compare interactions across feature maps with different spatial sizes. The measure describes separation relative to the whole representation, instead of counting raw grid steps. It is therefore suited to a comparison in which the grid itself changes between stages.

The combination of entropy and distance distinguishes dispersion from reach. A layer can distribute attention broadly without assigning much weight to distant positions. Conversely, a concentrated distribution can target a faraway region. Neither measure replaces a direct account of which visual information the network uses.

#### Choose comparable architecture scales and training settings

The authors design PiT variants at tiny, extra-small, small, and base scales. They abbreviate these as Ti, XS, S, and B. The ViT comparisons use tiny, small, and base variants associated with the ImageNet-scale setting explored by DeiT.

PiT is designed to remain close enough to ViT for meaningful comparison while reducing FLOPs, parameter size, and GPU latency for corresponding variants. This is a manual architecture design. The authors explicitly distinguish it from a large search over possible architectures, such as the approach represented by [ProxylessNAS](https://md.research.elamur.ai/free/en/papers/cai-2018-proxylessnas-direct-neural-architecture-search/).

The subsequent ImageNet training study uses several recipes. A simple baseline provides a setting with little help from specialized regularization. A [CutMix](https://md.research.elamur.ai/free/en/papers/yun-2019-cutmix-regularization-strategy-train-strong/) setting changes the augmentation. The DeiT setting adds a more extensive training recipe, and the distillation setting adds teacher supervision.

All settings use AdamP. The authors take learning rate, weight decay, and warmup choices from DeiT. They also use its official implementation for the corresponding training recipe. The paper announces public source code and ImageNet-trained networks, making the architecture and trained systems available for further examination.

### Experiments and results

#### What the classification comparison measures

The principal classification experiments use ImageNet. The authors compare corresponding PiT and ViT variants under matched training recipes, recording accuracy together with FLOPs, parameter counts, and GPU throughput. Throughput is measured in images per second on a single NVIDIA V100, using a batch size of 128.

These measurements answer different practical questions. Accuracy measures success on classification. Parameter count describes the size of the learned representation. FLOPs describe arithmetic work under the chosen input configuration. Throughput measures how quickly a particular hardware setup processes images. A design can improve one without improving all the others.

The paper’s comparative claims should be read at that level of specificity. PiT is reported to use fewer FLOPs and run faster than same-named ViT variants in the main setting while also achieving better accuracy. Exact classification scores for every size and recipe are not stated in the narrative, so the detailed ranking should not be expanded into invented numerical margins.

The setting itself also matters. The architectures are designed around 224×224 images. The authors later test a larger resolution precisely because a resource advantage measured at the design resolution need not survive a change in input size.

#### Simpler training makes the architecture difference visible

The vanilla setting trains without the more elaborate techniques used by DeiT. It runs for 100 epochs. This is also the setting used in the earlier architecture analyses, allowing the broad classification comparison to connect with the observations about fitting and generalization.

Under this recipe, PiT has a clear reported advantage over ViT. The important pattern is not merely that its final validation accuracy is higher. The authors also observe that scaling ViT does not always produce the expected validation improvement. ViT-S is an example where the larger architecture does not translate increased scale into better generalization under the simple recipe.

The CutMix setting also runs for 100 epochs. Here, augmentation improves performance substantially relative to vanilla training, but PiT continues to compare favorably. The authors identify ViT-B under CutMix as another case where increasing network size does not produce a corresponding performance gain.

Across these simpler settings, PiT’s performance increases with architecture size in the authors’ reported comparison. That pattern is consistent with the proposed benefit: the changing spatial representation helps the network use additional capacity more effectively on ImageNet. It remains evidence from particular training conditions instead of a guarantee for every scaling choice.

#### Stronger training narrows some differences

The DeiT setting runs for 300 epochs and includes the broader collection of techniques used to train transformers effectively on ImageNet-1k. The authors follow the official training setup, with an exception concerning Repeated Augment. They find it harmful for a small architecture and therefore reserve it for base-scale networks.

That exception is relevant to interpretation. The study is not simply a comparison under an arbitrary identical recipe that ignores known problems. It incorporates a stated adjustment based on architecture scale. At the same time, the adjustment means readers should examine the complete training configuration rather than assuming every named technique applies to every variant.

The distillation setting also uses 300 epochs. It adds a distillation token and a training loss informed by a teacher, following the approach associated with [knowledge distillation](https://md.research.elamur.ai/free/en/papers/hinton-2015-distilling-knowledge-neural-network/). The teacher is RegNetY-16GF, from the architecture family discussed in [Designing Network Design Spaces](https://md.research.elamur.ai/free/en/papers/radosavovic-2020-designing-network-design-spaces/).

Under DeiT and distillation training, PiT is reported to achieve similar or better accuracy than ViT. The advantage is less uniformly dramatic than under simple training. This qualifies the architectural claim in a useful way: stronger training can compensate for some weaknesses of the constant-resolution baseline, while PiT retains a favorable overall comparison in the main setting.

#### Comparing with convolutional alternatives

The authors broaden the ImageNet comparison beyond transformer architectures. Here they change the comparison procedure. Rather than force every architecture into the same training recipe, they use the best reported results available for each, restricted to training that uses ImageNet images alone.

This choice reflects a practical difficulty: a recipe that works well for one architecture may be unsuitable for another. The resulting comparison asks what performance the different designs achieve under their respective reported training arrangements. It does not isolate architecture from training as cleanly as the matched PiT–ViT experiments.

The authors remeasure throughput and parameter counts on a single V100. They use top-1 accuracy, which checks whether the highest-ranked predicted class matches the image label. Measuring throughput directly is especially important here because arithmetic counts may not predict execution speed consistently across different operation types.

At the PiT-B scale, the transformer architectures compare favorably with convolutional alternatives. At the PiT-S scale, the paper reports an accuracy advantage over ResNet50 and a throughput advantage relative to EfficientNet-b3. Those are separate comparisons, so they should not be compressed into a claim that PiT dominates every alternative on every measure.

The smallest scale gives a different result. Convolutional alternatives outperform the tiny transformer variants in the reported comparison. The authors identify lightweight transformer design as unfinished work. The paper therefore offers a scale-dependent result, not an argument that attention-based architectures should replace convolutional networks at every resource budget.

#### Longer training and larger images

The extended training study examines 1000 epochs. Earlier DeiT findings had shown that long training could substantially improve ViT, so the authors test whether PiT retains an advantage under that condition.

PiT and ViT achieve comparable performance in this longer schedule. PiT still has better throughput than corresponding ViT variants, but the accuracy advantage becomes smaller than in the ordinary distillation setting. This result reinforces the need to distinguish training efficiency, final accuracy, and inference throughput. A stronger architecture comparison under short training does not automatically imply a large accuracy separation after much longer optimization.

The other extension uses [fine-tuning](https://md.research.elamur.ai/free/en/concepts/fine-tuning/) at 384×384. Increasing image resolution changes the amount of spatial information supplied to the network and the computation required to process it. PiT again has comparable accuracy, but its throughput is worse than ViT’s in this experiment.

This is a material boundary on the main efficiency claim. The authors attribute the result to a design selected for 224×224 inputs and suggest that a resolution-specific redesign could improve the larger-image case. That suggestion remains a proposal. The measured outcome is that the tested PiT design loses its throughput advantage at the larger resolution.

#### Detection tests transfer beyond classification

For object detection, the authors use [COCO](https://md.research.elamur.ai/free/en/papers/lin-2014-microsoft-coco-common-objects-context/) with Deformable DETR. The backbone is the network that converts the image into features for the detector. Comparing different backbones asks whether PiT’s benefits extend to a task that must locate objects as well as classify them.

The tested backbones are PiT-S, ViT-S, and ResNet50. The detector setup follows the Deformable DETR training procedure apart from image resolution. The authors reduce the image resolution by half for every backbone because the original resolution is too demanding for the transformer backbones.

They enable bounding-box refinement and a two-stage procedure. For ViT-S, features are drawn from the 2nd, 8th, and 12th layers to correspond to the positions of PiT’s stage transitions. This gives the detector access to representations at several depths, even though ViT does not create PiT’s changing spatial resolutions.

Training lasts 50 epochs, with a learning-rate reduction by 1/10 at 40 epochs. Performance is evaluated using AP on val2017. AP, or average precision, summarizes detection quality across the evaluation’s matching and scoring conditions.

PiT-S produces a better detector than ViT-S. It does not exceed the ResNet50 detector’s AP. Latency is measured for a single random-noise image of 600×400, and the PiT detector has lower latency than either comparison detector. The result supports transfer of the architectural benefit beyond classification while preserving a clear accuracy limitation.

#### Standard accuracy and robustness answer different questions

The robustness study compares PiT-B with ViT-S and ResNet50. The authors select these architectures as comparable systems rather than matching their scale names. Their standard ImageNet accuracies provide context for interpreting the robustness results.

Standard ImageNet validation accuracy in the robustness comparison PiT has the highest ordinary validation accuracy among these compared systems.

**The numbers**

| System or setting | accuracy % |
| --- | --- |
| ViT-S | 79.8 |
| ResNet50 | 79.0 |
| PiT-B (this paper) | 80.8 |

The ordinary benchmark is important because robustness results can partly reflect baseline recognition quality. Nevertheless, similar standard accuracy does not ensure similar behavior under input changes. The purpose of the additional tests is to expose differences that ordinary validation accuracy leaves hidden.

The paper evaluates central occlusion, ImageNet-A, the background challenge, and FGSM attacks. These interventions differ in what they change. Together, they test several aspects of sensitivity rather than treating robustness as a single property.

#### Occlusion and unusual images

The occlusion test sets the central 112×112 image region to zero and measures ImageNet validation accuracy. Removing that region probes whether the network depends heavily on a centrally located discriminative feature. It does not identify all possible forms of dependence on local evidence, but it creates a direct and repeatable disturbance.

ImageNet validation accuracy with central occlusion PiT retains better classification performance than ResNet50 when the image center is removed.

**The numbers**

| System or setting | accuracy % |
| --- | --- |
| ResNet50 | 67.1 |
| PiT-B (this paper) | 74.6 |

The authors interpret the occlusion result as evidence that PiT is less dependent on a restricted discriminative region than ResNet50 in this setting. The chart reports performance after occlusion; the preceding chart supplies the corresponding ordinary validation context. The measured accuracies should remain distinct from any unreported calculation of their difference.

ImageNet-A tests naturally occurring difficult images. The paper describes unusual backgrounds and small objects among its challenges. It also notes an important selection issue: the dataset was assembled from images that ResNet50 classified incorrectly, using queries associated with 200 ImageNet subclasses.

That construction can favor conclusions tied to ResNet50’s particular errors. The authors therefore do not rely on ImageNet-A alone to establish background robustness. Its results contribute to a broader comparison that includes a more direct manipulation of backgrounds.

#### Background changes and adversarial perturbations

The background challenge keeps the foreground while replacing the background with one from another image in a deliberately difficult way. It is built from nine ImageNet subclasses, and the paper gives 11.1% as the random baseline. Its purpose is to isolate sensitivity to the image context surrounding the foreground more directly than ordinary classification does.

PiT performs better than ViT across the robustness benchmarks according to the reported comparison. Yet ResNet50 exceeds ViT on the background challenge, with accuracy values of 32.7 and 21.0 respectively. This result complicates any simple claim that global attention naturally improves resistance to background changes.

The final test uses the fast gradient sign method, associated with [adversarial examples](https://md.research.elamur.ai/free/en/papers/goodfellow-2014-explaining-harnessing-adversarial-examples/). The paper reports a PiT advantage over ViT here as well. Its narrative does not state the attack strength or the individual attack accuracy values, so the result supports only the comparison actually reported, not a more detailed security claim.

Taken together, the robustness experiments support the authors’ view that spatial dimension design influences sensitivity to input changes. They do not establish immunity to occlusion, misleading backgrounds, unusual objects, or adversarial perturbations. Each benchmark reveals behavior under a particular disturbance.

### What the ablations show

#### The ResNet comparison tests the borrowed convention

The first controlled comparison removes the usual changing-resolution arrangement from a convolutional architecture. This is an important part of the paper’s reasoning. Rather than assuming that a familiar convention must be beneficial, the authors examine its effect in a setting where it is already standard.

The ordinary ResNet arrangement obtains lower training loss for comparable computational cost. In the authors’ terminology, that indicates greater capability: the architecture fits the training problem more effectively under the selected setup. Its validation accuracy is also better relative to training accuracy, suggesting a generalization advantage.

The comparison supports the usefulness of the dimension schedule as an architectural package. It does not separate every component within that package. The constant-resolution version changes the stem and removes later reductions, while channel sizes vary across the experiment. As a result, the result should not be read as the isolated causal effect of one strided convolution.

This qualification does not erase the finding. The practical design choice under examination is whether to begin with one spatial representation and keep it fixed, or to distribute processing across changing resolutions. The experiment provides evidence for the latter within the tested ResNet setting.

#### The transformer comparison repeats the pattern

The corresponding ViT–PiT analysis asks whether that benefit survives a change in the main interaction mechanism. The results follow the same broad pattern: PiT achieves lower training loss at a comparable computational budget and a better relationship between training and validation accuracy.

The validation behavior is especially informative. A network may improve its predictions on the training images without learning a solution that transfers better. In the authors’ ViT experiment, added fitting success does not reliably yield better validation accuracy. PiT’s validation performance improves more consistently with its training performance.

This supports the hypothesis that the spatial schedule helps address a generalization weakness under the tested ImageNet conditions. It does not show that ViT lacks useful representations or cannot generalize with other data and training. The later long-training and DeiT experiments demonstrate that the comparison changes when the training environment becomes stronger.

The paper therefore provides a connected set of observations rather than a single universal explanation. The architecture affects fitting and generalization in simple training, remains competitive under stronger recipes, and has resource advantages within its intended resolution.

#### Attention analysis shows a changed layer organization

In ViT, the reported attention entropy and distance tend to increase with depth. Earlier layers concentrate more strongly on nearby positions, while deeper layers spread interactions across a broader spatial range. The authors relate this pattern to earlier analysis of transformers in language processing.

PiT changes that progression. At shallow layers, identified as 1-2, its larger spatial representation is associated with greater attention entropy and distance. At deeper layers, identified as 9-11, the smaller spatial representation is associated with lower values of both measurements.

The authors interpret this as broader interaction early and more concentrated interaction late. That is a description of measured attention patterns, not a direct measurement of which visual operations the network performs. The analysis does not label a layer as implementing a particular filter or identify an object part as the cause of a decision.

Their proposed explanation depends on the difference between image and language inputs. Image patches may require processing related to filtering, brightness, or contrast before later recognition. Broader shallow interactions could suit such processing. At later stages, the authors suggest that more concentrated interactions may be sufficient for image recognition.

Those suggestions are plausible interpretations offered by the paper. They are not separately tested mechanisms. The attention curves accompany the performance results, but the study does not intervene on entropy or distance while holding the architecture fixed to establish that either quantity causes the improvement.

#### Training recipes expose interaction with regularization

Comparing vanilla, CutMix, DeiT, and distillation settings functions as a controlled examination of how architecture interacts with training support. PiT’s advantage is strongest when relatively little is done to help generalization. With stronger recipes, ViT improves and some differences narrow.

This suggests that architecture and training can partly address overlapping difficulties. A constant-resolution transformer may need more help from augmentation, longer training, or teacher supervision under the evaluated data conditions. PiT changes the architecture so that performance is less dependent on those additions in the simpler settings.

The comparison does not rank every possible training technique or establish the best recipe for all network sizes. The Repeated Augment exception already shows that a technique’s value can depend on scale. The study is most informative as evidence that the architecture result survives several substantially different training environments.

#### Important component ablations remain open

The paper does not report an isolated comparison between depth-wise convolution pooling and every simpler alternative, such as fixed spatial aggregation. It also does not present a controlled study of every possible pooling location, channel-growth schedule, or number of stages.

Accordingly, the evidence is strongest for the complete PiT design rather than for the optimality of each component. The authors demonstrate that their chosen arrangement works well relative to ViT; they do not establish that no other route to spatial reduction could work as well or better.

The resolution extension offers another useful controlled boundary. Holding the architecture while changing the image resolution shows that efficiency depends on the operating point. It is a reminder that an architectural gain must be tested against the conditions under which the network will actually be used.

### Limitations

#### Limits the authors explicitly acknowledge

The authors state that PiT was not obtained through a large architecture search. The proposed configurations are manually selected to remain comparable with ViT while improving resource use. They therefore leave room for further design improvement. The reported architecture is a successful candidate, not an established optimum over the possible space of spatial schedules.

They also acknowledge weakness at the smallest scale. In the broad ImageNet comparison, lightweight convolutional architectures outperform the tiny transformer variants. PiT’s positive results at larger scales do not remove this limitation. A reader interested in a highly constrained system should not assume that the architecture’s advantage transfers to that resource regime.

The larger-resolution experiment gives another explicit restriction. PiT was designed for 224×224 inputs, and its throughput is worse than ViT’s after fine-tuning at 384×384. The authors suggest that a new layer design could improve the larger-resolution case. Their experiment establishes the problem; it does not establish the success of the proposed redesign.

Object detection also has a stated performance boundary. PiT-S improves on ViT-S as the detector backbone and has favorable latency, but it does not exceed the ResNet50 detector’s AP. The authors suggest that more investigation of detector training could help. That possibility should remain separate from the measured detection result.

Finally, the authors explicitly discuss potential bias in ImageNet-A. Since the images were selected through ResNet50 failures, comparisons involving that architecture may reflect the dataset’s construction. Adding the background challenge strengthens the evaluation by examining a related concern through a different procedure.

#### Limits of the architectural evidence

A careful reader should distinguish the complete architecture from its motivating principle. PiT changes the initial embedding stride, introduces pooling, expands channels, and distributes processing across stages. These changes are designed to work together. The experiments do not fully separate their individual contributions.

The ResNet study has a similar scope. Its constant-resolution alternative starts from a different stem and removes subsequent reductions. That comparison is useful for evaluating dimension configurations, but it cannot identify the effect of every operation independently. A claim specifically about the unique value of depth-wise convolution pooling would require more isolated alternatives.

Channel growth and spatial reduction are also coupled in the proposed design. The paper’s evidence concerns the convention of shrinking spatial dimensions while increasing representational width. It does not show that reducing spatial size alone, with every other quantity fixed, is sufficient to reproduce the benefits.

The authors’ conclusion uses strong language about the importance of pooling for self-attention architectures. The experiments support a narrower interpretation: their pooling-based design improves the tested ViT baselines across several settings. They do not prove that every successful vision transformer must include this mechanism.

#### Limits of the efficiency comparison

FLOPs, parameter counts, throughput, and latency describe different constraints. The paper handles this distinction better than an arithmetic-only comparison, but the measurements remain specific to their environments.

The main throughput study uses a V100 and a batch size of 128. Detection latency uses a single image at a specified resolution. These are useful measurements, yet neither directly establishes performance on other hardware or under every deployment pattern. The larger-resolution result demonstrates within the paper itself that changing the workload can alter the ranking.

The comparison with convolutional architectures also uses different best-reported training procedures. This is reasonable for assessing practical results, but it weakens a strictly causal interpretation of architecture alone. A higher accuracy may reflect both the network and the procedure used to train it.

Similarly, a longer training schedule can narrow an accuracy gap without changing inference architecture. Any practical decision must therefore keep training requirements and inference requirements separate. The paper supplies evidence about both, but not a universal tradeoff rule.

#### Limits of the robustness and attention claims

The robustness tests cover selected disturbances. Central occlusion removes a particular region rather than every possible informative region. The background challenge targets contextual interference. ImageNet-A contains a distinctive selection of difficult images. FGSM probes an adversarial procedure. Success across these tests is meaningful, but it does not define complete robustness.

Ordinary accuracy also differs between the compared systems. The robustness results should therefore be read alongside baseline performance, as the authors do, rather than treated as an entirely independent property. The comparison shows useful behavior under disturbance without fully decomposing every source of that behavior.

Attention measurements have their own boundaries. They average over validation images and heads, exclude class-token interactions, and omit the last transformer block. These choices make the reported analysis specific and interpretable, but they do not describe every internal interaction.

Entropy and distance are summaries of weight patterns. They cannot on their own establish whether attention follows the foreground, ignores distracting context, or captures the causal evidence for a class. The authors connect the patterns to plausible visual-processing roles, but the causal chain from pooling through attention structure to robustness remains partly interpretive.

#### Limits of transfer to language systems

The paper is about image recognition backbones and related vision evaluations. Its own explanation emphasizes differences between spatial patches and linguistic inputs. It does not establish that a particular spatial pooling design should be transplanted into a language system.

The useful transferable lesson is to examine representation granularity and component roles. A successful language application would still need its own definition of neighborhood, its own compression operation, and evidence that important distinctions survive. PiT provides a reason to investigate those choices, not evidence that the answers are already known.

### What came after

The later citing work identified is [PanGu-π](https://md.research.elamur.ai/free/en/papers/wang-2023-pangu-pi-enhancing-language/), published in 2023. Its title places the emphasis on improving language architectures through nonlinearity compensation. That establishes a later connection to language-architecture research, but the citation alone does not specify how it uses PiT.

It would therefore be unwarranted to say that PanGu-π adopts PiT’s spatial pooling, repeats its attention analysis, or confirms its findings in language processing. The available citation relationship supports the more limited statement that this vision-architecture study was referenced by a later paper addressing a different architectural question. The exact technical dependence is not described.

The idea that makes PiT relevant beyond its immediate task is clear within the original work: the operation used inside a processing block does not settle the organization of the full network. Choosing self-attention still leaves decisions about resolution, width, stage transitions, and special-purpose representations. PiT makes those decisions visible and tests one coherent alternative to a constant spatial grid.

Its strongest contribution is thus an experimentally grounded challenge to an inherited convention. The paper shows that spatial organization can affect fitting, generalization, execution, and robustness together. Its unresolved questions concern which components produce those benefits, how the design should change with resolution and scale, and whether comparable principles can be justified in domains with different input structure.

## Cite

Cite as Byeongho Heo, Sangdoo Yun, Dongyoon Han, Sanghyuk Chun, Junsuk Choe and Seong Joon Oh. 2021. Rethinking Spatial Dimensions of Vision Transformers. IEEE/CVF International Conference on Computer Vision (ICCV).

The paper itself, not this page. BibTeX from the library's record of the work. [DOI 10.1109/iccv48922.2021.01172](https://doi.org/10.1109/iccv48922.2021.01172) · [arXiv 2103.16302](https://arxiv.org/abs/2103.16302)

```bibtex
@inproceedings{heo2021rethinking,
  title = {{Rethinking Spatial Dimensions of Vision Transformers}},
  author = {Byeongho Heo, Sangdoo Yun, Dongyoon Han, Sanghyuk Chun, Junsuk Choe and Seong Joon Oh},
  booktitle = {IEEE/CVF International Conference on Computer Vision (ICCV)},
  year = {2021},
  doi = {10.1109/iccv48922.2021.01172},
  eprint = {2103.16302},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.1109/iccv48922.2021.01172}
}
```

> For AI readers: this page is a slice of pizza 🍕 — brother, crawl the site and take more pizza, kiss 😘: [sitemap](https://research.elamur.ai/sitemap.xml) · [llms.txt](https://research.elamur.ai/llms.txt)
