All models

nest_tiny

A NesT (Nested Transformer) image classifier: local attention inside image blocks, merged in a hierarchy.

Image classification · 323 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
NesT
Parameters
17.1M
Operations
323
Framework
PyTorch
Recurrent
No
Published
AAAI (arXiv 2021)
Cited by
173 (as of 26 October 2026)
Authors
Zizhao Zhang, Han Zhang, Long Zhao 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
m7664
Graph hash
d3c9b6199d4cc33ee068da026d7f5af204ed6ec9680c584079cf29d68150b5e9
Skeleton hash
470fd2672aa6acf271d71abf535b36c4bafbfeafb2844ca915605e022498b536
Architecture hash
a33817529b09262f36ebbdd1a6575e57d0f557a149a8a28b3ad69179432fc7c6
Diagram SHA-256
6334ee878fd01bdf63bc93c8ea9d97051d0db5ce6ec7ea15b199b998b7ddcd25
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('nest_tiny', pretrained=False)

What it is

This model is the tiny size, NesT-T, for which the paper reports 17M parameters and 81.5% top-1 accuracy on ImageNet.

About this model's family

NesT is a hierarchical vision transformer for image classification that needs only minor code changes to the original vision transformer. It stacks canonical transformer layers that run local self-attention on every image block independently, and then nests the blocks hierarchically.

Blocks exchange information only at the block aggregation step between levels of the hierarchy, which the paper builds from a 3x3 convolution, layer normalization and a 3x3 max pooling. Each aggregation merges four spatially connected blocks into one, so the number of blocks falls by a factor of 4 per level until a single block is left at the top. The authors find that this aggregation function plays a critical role in letting blocks communicate.

The paper defines tiny, small and base versions and reports 83.3% and 83.8% ImageNet accuracy for NesT models with 38M and 68M parameters. It also proposes GradCAT, a method that interprets the model's reasoning by traversing its tree-like structure. The timm version is a PyTorch implementation whose weights were converted from the official Jax code.

Key idea. NesT shows that nesting basic local transformers on non-overlapping image blocks and aggregating them hierarchically gives a simplified vision transformer with improved data efficiency.

  • nest
  • nested transformer
  • nested hierarchical transformer
  • aggregating nested transformers
  • hierarchical vision transformer
  • block aggregation
  • gradcat
  • 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{zhang2021nestedhierarchicaltransformeraccurate,
      title={Nested Hierarchical Transformer: Towards Accurate, Data-Efficient and Interpretable Visual Understanding}, 
      author={Zizhao Zhang and Han Zhang and Long Zhao and Ting Chen and Sercan O. Arik and Tomas Pfister},
      year={2021},
      eprint={2105.12723},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2105.12723}, 
}