All models

gcvit_xxtiny

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

Image classification · 749 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 (17 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
12M
Operations
749
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
m5139
Graph hash
8e0005ff9bee244f1d304b740ccd7e59d03f4d4f3db260bb45c2b589145c022e
Skeleton hash
3f34e86c8b5c80c3903ca2f28f9dfd2ed74cf7f3387cddeb25518e0bd7d95f66
Architecture hash
fdf1e0cc4f10f53935fd8ec0ead0c8bbcc501795b009f54af19fcb0901c45a53
Diagram SHA-256
3b2b418ca9d7114ab7304591e40f99716c38359f62b2aad6353e5792ed1b8b78
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_xxtiny', 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}, 
}