Vision Transformer Neural Architecture Search for Out-of-Distribution Generalization: Benchmark and Insights

Sy-Tuyen Ho, Tuan Van Vo, Somayeh Ebrahimkhani, Ngai-Man Cheung
1/7/2025
cs.LG

No official code found. Best implementation: vovantuan1999a/OoD-ViT-NAS (15 stars, last commit 2024-12-03).

Abstract

While ViTs have achieved across machine learning tasks, deploying them in real-world scenarios faces a critical challenge: generalizing under OoD shifts. A crucial research gap exists in understanding how to design ViT architectures, both manually and automatically, for better OoD generalization. To this end, we introduce OoD-ViT-NAS, the first systematic benchmark for ViTs NAS focused on OoD generalization. This benchmark includes 3000 ViT architectures of varying computational budgets evaluated on 8 common OoD datasets. Using this benchmark, we analyze factors contributing to OoD generalization. Our findings reveal key insights. First, ViT architecture designs significantly affect OoD generalization. Second, ID accuracy is often a poor indicator of OoD accuracy, highlighting the risk of optimizing ViT architectures solely for ID performance. Third, we perform the first study of NAS for ViTs OoD robustness, analyzing 9 Training-free NAS methods. We find that existing Training-free NAS methods are largely ineffective in predicting OoD accuracy despite excelling at ID accuracy. Simple proxies like Param or Flop surprisingly outperform complex Training-free NAS methods in predicting OoD accuracy. Finally, we study how ViT architectural attributes impact OoD generalization and discover that increasing embedding dimensions generally enhances performance. Our benchmark shows that ViT architectures exhibit a wide range of OoD accuracy, with up to 11.85% improvement for some OoD shifts. This underscores the importance of studying ViT architecture design for OoD. We believe OoD-ViT-NAS can catalyze further research into how ViT designs influence OoD generalization.

View on arXivView PDF

Code Implementations(1)

[NeurIPS 2024] Official Code for the Paper OoD-ViT-NAS: Vision Transformer Neural Architecture Search for Out-of-Distribution Generalization: Benchmark and Insights

151Shell, PythonMay 22, 20241 years ago

Similar Papers

Cite this paper

@article{ho2025vision,
  title  = {Vision Transformer Neural Architecture Search for Out-of-Distribution Generalization: Benchmark and Insights},
  author = {Sy-Tuyen Ho and Tuan Van Vo and Somayeh Ebrahimkhani and Ngai-Man Cheung},
  year   = {2025},
  eprint = {2501.03782},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2501.03782v1},
  journal = {NEURIPS 2025 2025}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2501.03782.svg)](https://codeofpaper.com/paper/2501.03782)

Discussion