All models

gcvit_tiny

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

Image classification · 1,639 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 (18 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
28.2M
Operations
1,639
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
m5137
Graph hash
a720c97783b60dfb7b518cb15d6d57e04d730b426fe4d028599f6608ee2b0646
Skeleton hash
4e377f3e0118276eb2ac7a996f6564da86e7d7c5c95ddb1694b6b484303bd962
Architecture hash
0806895f30a0c8aba3f71c9f01877d043ec06164fb8daf463ace38ba4a1e3118
Diagram SHA-256
f73f0784222c2424271a7b5fa2dd0fb15a49b4cbedf063113788e0f365737cb6
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_tiny', 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}, 
}