All models

gcvit_xtiny

A hierarchical vision transformer that alternates local window attention with global context attention.

Image classification · 1,029 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (25 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Family
GC ViT
Parameters
20M
Operations
1,029
Framework
PyTorch
Recurrent
No
Published
ICML (arXiv 2022)
Cited by
258 (as of 26 November 2026)
Authors
Ali Hatamizadeh, Hongxu Yin, Greg Heinrich and others
License
Apache-2.0
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m5138
Graph hash
195a14f7498fd84a3eea73c1cb61424f83ae0efc110c5916a580baa58c71298b
Skeleton hash
3ad0a9d7d709e8b8239fc9670b38467799c8b5070710570700fa25059451897d
Architecture hash
b20e17d1a9860217d7244b7ee25c224018d8d851bb661d0f4aebab1487b0d671
Diagram SHA-256
25b4d16eaee9e3ec5a20df3753eaf277df5317169e3b2761549dac6d9aef7f18
TorchLens version
2.35.3
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

How this diagram was made

timm.create_model('gcvit_xtiny', pretrained=False)

What it is

About this model's family

GC ViT, short for global context vision transformer, is a hierarchical vision transformer that pairs global context self-attention with standard local self-attention. The aim is to model both long and short-range spatial interactions without expensive operations such as computing attention masks or shifting local windows.

Every GC ViT stage is composed of alternating local and global self-attention modules. Both operate in local windows like Swin Transformer, but the global self-attention has access to global features extracted by a global query generator. The query generator is a CNN-like module that extracts features from the entire image only once at every stage. After each stage, a downsampling block decreases the spatial resolution by 2 and increases the number of channels by 2. That block uses a modified Fused-MBConv block, which the paper says provides inductive bias and modeling of inter-channel dependencies.

On ImageNet-1K classification, the paper reports 84.3%, 85.0% and 85.7% Top-1 accuracy for GC ViT models with 51M, 90M and 201M parameters, at 224 image resolution and without any pre-training. The timm implementation is free of any code related to the NVIDIA GCVit implementation and was written from scratch in the style of timm swin_transformer_v2_cr.py.

Key idea. GC ViT pairs global context self-attention modules with standard local self-attention to model both long and short-range spatial interactions without attention masks or shifted local windows.

  • GC ViT
  • GCViT
  • Global Context Vision Transformer
  • global context vit
  • gcvit_xxtiny
  • GC ViT-XXT
  • hierarchical vision transformer
  • global query tokens
  • image classification

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{hatamizadeh2023globalcontextvisiontransformers,
      title={Global Context Vision Transformers}, 
      author={Ali Hatamizadeh and Hongxu Yin and Greg Heinrich and Jan Kautz and Pavlo Molchanov},
      year={2023},
      eprint={2206.09959},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2206.09959}, 
}