Transformer in Transformer
Abstract
Domain fit: AI-adjacent · Paper appears method- or tooling-adjacent to AI workflows with partial ecosystem coverage.
Transformer is a new kind of neural architecture which encodes the input data as powerful features via the attention mechanism. Basically, the visual transformers first divide the input images into several local patches and then calculate both representations and their relationship. Since natural images are of high complexity with abundant detail and color information, the granularity of the patch dividing is not fine enough for excavating features of objects in different scales and locations. In this paper, we point out that the attention inside these local patches are also essential for building visual transformers with high performance and we explore a new architecture, namely, Transformer iN Transformer (TNT). Specifically, we regard the local patches (e.g., 16$\times$16) as "visual sentences" and present to further divide them into smaller patches (e.g., 4$\times$4) as "visual words". The attention of each word will be calculated with other words in the given visual sentence with negligible computational costs. Features of both words and sentences will be aggregated to enhance the representation ability. Experiments on several benchmarks demonstrate the effectiveness of the proposed TNT architecture, e.g., we achieve an 81.5% top-1 accuracy on the ImageNet, which is about 1.7% higher than that of the state-of-the-art visual transformer with similar computational cost. The PyTorch code is available at https://github.com/huawei-noah/CV-Backbones, and the MindSpore code is available at https://gitee.com/mindspore/models/tree/master/research/cv/TNT.
Results and benchmarks
Transformer is a new kind of neural architecture which encodes the input data as powerful features via the attention mechanism.
Benchmark evidence is limited
Evidence graph: 3 refs, 3 links.
Utility signals: depth 90/100, grounding 75/100, status high.
Implementation
No direct implementation yet
Maintained implementation evidence is not confirmed for this paper yet.
Use the implementation status and reproduction sections for the current action plan.
No verified maintained repo yet
There is no verified maintained implementation yet. Use this baseline plan to decide whether to prototype now or defer.
- No maintained paper-verified implementation was found; start with the closest related repositories below.
- Compare repo methods against the paper equations/algorithm before trusting metrics.
- Create a minimal baseline implementation from the paper and use adjacent repos as references.
Time to first repro: a few days
fengbintu/Neural-Networks-on-Silicon is the closest maintained adjacent implementation (Matches contextual method/domain keyword: architecture). It is not paper-verified; validate algorithm and evaluation setup against the paper before trusting reported metrics. Community adoption signal: 2114 GitHub stars.
- Adjacent implementations are not paper-verified
- Recommended repository is adjacent and not paper-verified.
Reproduction readiness
No repo
No verified implementation available
- No maintained repository has been identified for this paper. Check adjacent implementations or HF artifacts below.
Hardware requirements
- Expect multi-day setup/compute for meaningful reproduction based on current guidance.
Framework baselines
- Hugging Face Transformers training guide
Modern transformer training baseline.
- PyTorch nn.Transformer docs
Reference transformer building block implementation.
Repositories and ecosystem
Closest related implementations
These are not paper-verified. Use them as reference points when no direct implementation is available.
- fengbintu/Neural-Networks-on-Silicon Adjacent · Confidence: Medium · 2,114 stars
Matches contextual method/domain keyword: architecture
- gokayfem/awesome-vlm-architectures Adjacent · Confidence: Medium · 1,306 stars
Matches contextual method/domain keyword: architecture
No additional verified repositories beyond the primary recommendation.
These repositories had low-confidence matching signals and are hidden by default.
- huggingface/transformers
Confidence: Low · 164,300 stars
Hugging Face artifacts
No trustworthy direct or curated related Hugging Face artifacts were found yet. Use targeted searches to quickly locate candidate models, datasets, and demos.
Tip: start with models, then check datasets and spaces if you need evaluation data or demos.
Research context
1,017
Citations
51
References
Tasks
Computer science, Sentence, Granularity, Physical Sciences
Methods
Transformer, Architecture
Domains
Artificial intelligence, Computer Vision and Pattern Recognition
Related papers
- A Study of a New Colour Granularity FormulaSearch on Paper2Code
1981 · Semantic similarity
- Information granularity,information entropy and decision treeSearch on Paper2Code
2009 · Semantic similarity
- Study of Approximate Periodicity Mining with Multi-granularity TimeSearch on Paper2Code
2010 · Semantic similarity
- Dynamic granularity selection based on local weighted accuracy and local likelihood ratioSearch on Paper2Code
2020 · Semantic similarity
- Research on Granularity Pair and It’s Related PropertiesSearch on Paper2Code
2011 · Semantic similarity
- Accelerated multi-granularity reduction based on neighborhood rough setsSearch on Paper2Code
2022 · Semantic similarity
Open this paper in HFEPX to review benchmark signals, evaluation modes, and human-feedback protocol context.
Open in HFEPXJump to Paper2Code search queries derived from this paper's research context.