All models

gcvit_small

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
51.1M
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
m5136
Graph hash
408609a19f138cf3d39dcfc6b7e257ee97603cac702574dbb9a3e3506683fd30
Skeleton hash
9b5b620f6dc95f17f8ea0bf4fe175239ac3d5a83572e6ecd1c8bc81e3e5d54c0
Architecture hash
c3b72ae20f906ca1f99af64fe9dd8cab4a525b563635a180f2a4573b9f039296
Diagram SHA-256
1a1caa622ef7de584cb735ef52549905b2f99f9f5dce6f32a39f71e7535d77e9
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_small', 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}, 
}