# A Smaller Transformer in Your Transformer

- **ID:** 1074
- **Kind:** paper
- **URL:** https://arxiv.org/abs/2609.20100
- **Authors:** Dhananjay Tomar*, Marius Aasan*, Andreas Kleppe, Adín Ramírez Rivera (*equal contribution)
- **Venue:** arXiv / BMVC 2026 / Oslo University Hospital; University of Oslo; UiT SFI Visual Intelligence
- **Publisher:** arXiv / BMVC 2026 / Oslo University Hospital; University of Oslo; UiT SFI Visual Intelligence
- **Published:** 2026
- **Source:** arxiv
- **Language:** en
- **Access:** free
- **License:** Author copyright (BMVC-style free unchanged distribution); arXiv preprint; GitHub dsb-ifi/TWT (no SPDX at catalog time)
- **License family:** Other (auto-classified)
- **Tags:** twt, transformer-within-transformer, vit, block-redundancy, depth-pruning, distillation, histopathology, dinov2, dinov3, deit-iii, raptor, toast, bmvc-2026, arxiv-2609.20100, dsb-ifi
- **Topics:** vision transformers; depth pruning; block redundancy; distillation; histopathology; model compression
- **Added:** 2026-09-26
- **Verified:** 2026-09-26
- **Research status:** done
- **Needs deep evaluation:** no
- **Page:** https://papers.projxon.ai/entries/1074

## Summary

arXiv 2609.20100v1 (cs.CV; submitted 2026-09-17; accepted BMVC 2026). Formalises ViT block redundancy (contiguous layers with high functional similarity) and proposes Transformer-Within-Transformer (TWT): max–min DP discovery of redundant phases, auditioned single-layer surrogate init, then single-stage deep-supervision distillation. Unlike Raptor/BRH (recurrent shared layer keeps FLOPs) or TOAST linear maps (lose token mixing), TWT replaces each phase with one ViT layer. Natural images: ~6-layer TWT ~half FLOPs, competitive ImageNet (e.g. DINOv2 B/14 84.2% vs 84.6% baseline / 84.0% Raptor-6). Histopathology H0-mini/Hibou-B: often matches or improves MIL QWK/accuracy at 3–5 layers. ADE20k denser drop. Code: https://github.com/dsb-ifi/TWT.

## Attributes

- **Purpose:** Post-hoc fuse contiguous redundant ViT layers into single learned surrogate layers (TWT) to cut params and inference FLOPs with competitive accuracy
- **Scale:** DeiT-III/DINOv2/DINOv3 B natural-image ImageNet+ADE20k; H0-mini & Hibou-B histopathology (PANDA, TCGA-PRAD, CAMELYON16/17) with ABMIL/TransMIL; typically 12→6/5 (natural) or 12→5/4/3 (histo) layers; FLOPs ~half vs baseline when depth halved
- **Domain:** vision transformers; depth pruning; block redundancy; distillation; histopathology; model compression
- **Used for:** ViT depth compression; histopathology foundation-model pruning; compare to Raptor/BRH, TOAST, NOSE, WDPruning
- **Time period:** arXiv 2026-09-17 (v1); BMVC 2026 accepted; UiO news ~2026-08-09; cataloged 2026-09-26
- **Author type:** academia (Oslo University Hospital; University of Oslo; UiT The Arctic University of Norway / SFI Visual Intelligence)

## From the source (fetched 2026-10-03)

- **Published:** Sep 17, 2026 (arXiv)
- **arXiv categories:** cs.CV (arXiv)
- **Author comment:** 22 pages, 6 figures, 6 tables. Accepted at the 37th British Machine Vision Conference (BMVC 2026) (arXiv)
- **Citations:** 0 (Semantic Scholar)
- **References:** 0 (Semantic Scholar)

## Abstract

Recent findings indicate that Vision Transformers settle into locally similar computational phases, implying a level of depthwise computational redundancy. However, existing methods to exploit this redundancy either fail to reduce inference compute or severely degrade model expressivity. In this work, we formalise a unified view of block redundancy that decouples the geometry from specific surrogate interventions. We then introduce Transformer-Within-Transformer (TWT), a post-hoc method that fuses contiguous groups of redundant layers into a single learned surrogate layer. TWT reduces parameter count and inference compute while remaining competitive with original models using half the depth on natural images, and in several downstream histopathology settings, TWT matches or even improves on the original baseline.

## Research notes

- Hudson user-fed 2026-09-26 via AlphaXiv https://www.alphaxiv.org/abs/2609.20100 (mirror); cataloged from canonical arXiv abs/API/PDF. Local dump: /workspace/curator/research/arxiv-2609.20100-20260926 (abs.html, api.xml, paper.pdf, paper.txt, alphaxiv.html, uio-news.html, CATALOG_NOTES.md). Code https://github.com/dsb-ifi/TWT (0★ at check; license field empty). No HF model/dataset. No Discord fill (local-only job).

## Similar entries

- [LingBot-Vision](https://papers.projxon.ai/entries/603) (code, #603)
- [NVIDIA Model Optimizer (ModelOpt)](https://papers.projxon.ai/entries/763) (code, #763)
- [Adversaries can still steal reasoning from American frontier models via Third-Party Cloud Aggregators ("Stolen Thoughts" update)](https://papers.projxon.ai/entries/822) (paper, #822)
- [Gumbel Straight Flow: Distilling Autoregressive Models into One-step Flow Maps](https://papers.projxon.ai/entries/1200) (paper, #1200)
- [Mid-Harness: Scaling Actions Between Model and Harness for Terminal Agents](https://papers.projxon.ai/entries/1229) (paper, #1229)
- [Trajectory-Refined Distillation](https://papers.projxon.ai/entries/1121) (paper, #1121)
