The Principle of Diversity: Training Stronger Vision Transformers Calls for Reducing All Levels of Redundancy

Tianlong Chen, Zhenyu Zhang, Yu Cheng, Ahmed Hassan Awadallah, Zhangyang Wang

TL;DR

Vision Transformers (ViTs) often suffer from "over-smoothening," where their internal representations become highly redundant, wasting the model's high capacity. This paper introduces a "principle of diversity" by applying regularizers across three levels—patch embeddings, attention maps, and model weights—to reduce redundancy and significantly boost accuracy across various ViT architectures.

What Problem Does This Paper Address?

While Vision Transformers have revolutionized computer vision, they are notoriously difficult to train and often fail to reach their full potential. A major culprit is over-smoothening: as data passes through the global self-attention layers, the representations of different image patches tend to become overly similar. This effectively "collapses" the model's depth, as multiple layers end up doing the same redundant work.

Previous research has tried to fix this by injecting convolutional layers or diversifying patch embeddings. However, the authors of this paper argue that redundancy is a "tri-level" problem. It isn't just the patches that become similar; the attention heads often focus on the same regions, and the model weights themselves can fall into a low-rank subspace. This paper provides the first systematic "head-to-toe" assessment of redundancy and proposes a unified framework to eliminate it.

Figure 2. (Left) A overall pipeline of vision transformers [21,54]. Each image is divided into patches and transformed into embeddings via a linear projection layer. Then, embeddings are fed to the transformer encoder consists of MHA and FFN modules. Other operations like softmax and normalization are omitted here. (Right) An illustration of the redundancy of embedding, attention, and weight.

Methods

The authors propose three distinct groups of diversity regularizers to be added to the standard training loss:

  1. Patch Embedding Diversity: To keep image tokens distinct, they use cosine similarity constraints and contrastive loss. This prevents patches from merging into a uniform "blur" both within a single layer and across different layers.
  2. Attention Diversity: To ensure that multi-head attention (MHA) actually uses its "multiple heads" effectively, they apply orthogonality regularization. This forces different heads to attend to different parts of the image, capturing a wider array of features.
  3. Weight Diversity: To prevent the parameter space from becoming redundant, they use hyperspherical uniformity regularizers (like Minimum Hyperspherical Separation). This encourages weight vectors to spread out uniformly, maximizing the model's representative capacity.

These regularizers are "plug-and-play," meaning they can be added to existing ViT training pipelines with minimal architectural changes.

Datasets

The primary benchmark used for evaluation is ImageNet-1k, the gold standard for image classification. The authors tested their methods on several popular backbones:

  • Vanilla ViT (Small and Base)
  • DeiT (Data-efficient Image Transformers)
  • Swin Transformer (Hierarchical ViT with shifted windows)

Key Insights and Ideas

  • Redundancy is Ubiquitous: Even sophisticated models like Swin and DeiT exhibit significant redundancy. As shown in Figure 1, similarity scores are high across all blocks before the proposed diversification is applied.
  • Deeper Models Benefit More: The performance gains were most pronounced in deeper architectures (like DeiT-Small24). This makes sense, as deeper models are more prone to the "collapse" caused by over-smoothening.
  • The "Aha" Moment in Visualization: The paper uses t-SNE visualizations to show that semantically different patches (like a human hand vs. a dog toy) that were previously "overlapped" in the embedding space become clearly separated after diversification.
  • Complementary Effects: While fixing patch redundancy provides the biggest single boost (~0.4%), the best results come from addressing all three levels simultaneously, proving that these redundancies are distinct issues.
t-SNE visualization shows that diversified embeddings (green) separate distinct objects much better than the baseline (orange).

Key Results

The "Diverse-ViT" approach yielded consistent accuracy improvements across the board:

  • Vanilla ViT-Base: Achieved a 2.06% accuracy boost on ImageNet.
  • DeiT-Small24: Saw a significant 1.76% improvement.
  • Swin-Base: Even though Swin is already designed to be more efficient, it still gained 0.32% in accuracy.

Qualitatively, the attention maps of the diversified models are much more "focused" and cover more relevant parts of the objects compared to the baseline models, which often have diffused or redundant attention patterns.

Figure 5. Attention visualizations of DeiT on ImageNet. Heatmaps in the 1st and 2nd rows are from baseline and our diversified variant. Tools of interpreting ViTs in [6] are adopted to produce visualization.

Limitations and Future Work

The authors acknowledge a few limitations:

  • Domain Specificity: The study focuses exclusively on Vision Transformers. Whether these tri-level redundancies exist and can be mitigated similarly in Natural Language Processing (NLP) remains an open question for future work.
  • Training Overhead: While the regularizers are computationally "cheap" (using power iteration methods), they do increase training time by roughly 10-20% depending on the configuration.
  • Societal Impact: As with any improvement in fundamental AI performance, the authors note the potential for misuse in surveillance or other sensitive areas, suggesting that licensing or access controls might be necessary for advanced models.

Summary updated

BibTeX
@misc{chen2022principle,
  author = {Tianlong Chen and Zhenyu Zhang and Yu Cheng and Ahmed Hassan Awadallah and Zhangyang Wang},
  title = {{The Principle of Diversity: Training Stronger Vision Transformers Calls for Reducing All Levels of Redundancy}},
  year = {2022},
  eprint = {2203.06345},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2203.06345},
}
Figure