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

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.

Paper

Similar papers

Peer review

Reviewer f7Da8/10 · confidence 4/52024-07-07

Summary

The paper shows that in-domain accuracy and Training-free NAS accuracy predictions correlate poorly with out-of-domain accuracy, while characteristics of the model such as Flops, Params and Embed-Dim (number of channels) correlate much better with out-of-domain accuracy. To do this, they train a supernet that contains all possible architectures (subnets), then they validate these subnets on 9 datasets ImageNet/C/D/P/O/A/R/Sketch/Stylaized.

Strengths

They explore various ways for increasing OOD accuracy, which is most important for real-world problems. They show that conventional approaches, such as Training-free NAS or relying on in-domain accuracy, do not work. While they found that Flops, Param and Embed-dim correlated well with OOD accuracy. To do this, they introduce OoD-ViT-NAS benchmark for NAS research on ViT’s OOD generalization, that includes 3000 diverse ViT architectures which are evaluated on 9 datasets. This allows us to look for new and better approaches for finding new models structures to improve OOD accuracy.

Weaknesses

You show that the embedding dimension has the highest impact among ViT architectural attributes, while network depth has a slight impact on OoD generalization. But the paper lacks an explanation that although embed-dim (number of channels) correlates with OOD accuracy better than depth, this does not necessarily mean that to increase OOD accuracy only embed-dim should be increased, since the computational cost and memory costs may be different for embed-dim and depth. Therefore, to create either the largest and most accurate model that fits in memory, or the most optimal model in terms of speed and accuracy, it may be optimal to increase the depth rather than embed-dim. There are also papers [1,2,3] that show that it is necessary to simultaneously increase several model parameters (depth, number of channels, resolution) in optimal proportions. You present charts of OOD accuracy and number of parameters (Fig. 4, K19 - K24), but it would also be great to present charts of OOD-accuracy and latency, and OOD-accuracy and GPU memory consumption. Because these 3 model characteristics (OOD-accuracy, Latency, Memory consumption) are the most important for real-world problems. 1. EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks, Mingxing Tan, Quoc V. Le, 2019 2. EfficientNetV2: Smaller Models and Faster Training, Mingxing Tan, Quoc V. Le, 2021 3. EfficientDet: Scalable and Efficient Object Detection, Mingxing Tan, Ruoming Pang, Quoc V. Le, 2019

Questions

- Have you tried plotting OOD-accuracy versus Latency or GPU memory consumption while increasing various model parameters such as: embed_dim, depth, MLP-ratio, num of heads, etc.? Or find correlations between ODE accuracy and these parameters, taking into account their impact on latency and memory consumption. - Have you tried to find optimal model scaling factors (similar to works [1, 2, 3]) to increase OOD-accuracy in optimal way with respect to latency or memory consumption? 1. EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks, Mingxing Tan, Quoc V. Le, 2019 2. EfficientNetV2: Smaller Models and Faster Training, Mingxing Tan, Quoc V. Le, 2021 3. EfficientDet: Scalable and Efficient Object Detection, Mingxing Tan, Ruoming Pang, Quoc V. Le, 2019

Rating

8

Confidence

4

Soundness

3

Presentation

3

Contribution

4

Limitations

It might be worth adding to the limitations: The results obtained on Imagenet classification datasets may not correlate with the results of real-life problems. Because Imagenet classification requires to predict the class of only one usually large object in the low resolution image without predicting its location (box, polygon or mask), whereas in real problems it is usually necessary to predict the class and position of many objects, incl. very small in high resolution image. Moreover, there is ambiguous in the Imagenet classification task, the class of which of the many objects in the image should be predicted? Thus, a continuation of the research in this direction may be the finding of correlations, NAS approaches, new network structures, their parameters and scaling factors to achieve the highest OOD accuracy on tasks close to real ones (such as Dense prediction tasks: Segmentation, Detection, etc. ) in an optimal way with respect to latency and memory consumption.

Reviewer Lm5n6/10 · confidence 4/52024-07-11

Summary

This paper introduces OoD-ViT-NAS, a benchmark designed for evaluating ViT architectures' ability to generalize under Out-of-Distribution (OoD) shifts. This paper reveals that ViT design significantly impacts OoD generalization, In-Distribution (ID) accuracy does not reliably predict OoD performance, and simpler metrics like parameter count can sometimes predict OoD accuracy better than complex training-free NAS methods.

Strengths

This paper propose a new benchmark for ViT NAS.

Weaknesses

1. While the paper introduces a new benchmark, it doesn't sufficiently discuss the practical implications of the findings or potential applications. Including a section on how these insights can influence future ViT designs would add significant value. Furthermore, assessing whether ViTs designed based on these insights outperform those designed by humans would be meaningful to include in experiments and results. 2. The analysis of the experimental results is somewhat superficial. It presents observations without delving into deeper discussions. There should be more profound insights and detailed discussions on why certain ViT architectural attributes perform better under OoD conditions. This could involve providing theoretical justifications or proposing hypotheses that could be explored in future research. 3. The paper states that simple proxies like #Param and #Flop outperform more complex Training-free NAS methods but does not provide enough insight into why this might be the case. A deeper analysis of these findings, including possible reasons and implications, would strengthen the argument.

Questions

Please address the weaknesses mentioned above.

Rating

6

Confidence

4

Soundness

3

Presentation

2

Contribution

3

Limitations

No potential negative societal impact.

Authorsrebuttal2024-08-11

Thank you Reviewer Lm5n for the prompt feedback

>**QA-Q1:** A2 and A3 have largely addressed my concerns. A1 has partially addressed my concerns. Although I think the author's response in A1 is not perfect, I acknowledge that this is an open issue worthy of further discussion, so what the authors have done so far is acceptable. **QA-A1:** We are deeply grateful to the reviewer for taking the time to review our rebuttal. We are glad that we have addressed the reviewer's concerns. >**QA-Q2:** One remaining concern is regarding #Param and #Flop in A4. From the results in Fig. 4 of the paper, it appears that the model's performance is generally monotonically related to #Param and #Flop. Does this mean that for this task, fine-grained architectural design might not be necessary, and that simply increasing the model size could improve performance? **QA-A2:** Thank you for your comment. We note that variance in Fig. 4 suggests that simply increasing the model size may not always improve; this is also supported by Tab. 2 in our main paper showing that #Param and #Flop are not accurate Training-free NAS. Importantly, other factors need to be considered (e.g. fine-grained architecture design as we investigate in our paper). The observation of variance is also mentioned by the Reviewer. >**QA-Q3:** Besides, the conclusion that larger models perform better seems very intuitive, but aside from demonstrating that the architecture scales well, what further conclusions can be drawn from this? **QA-A3:** From Fig. 4, larger models perform better in general but there is some variance (also mentioned by reviewer), thus it is not necessarily true that scaling up architecture can get better performance. Our analysis on architecture attributes suggests we need to scale up architecture carefully, e.g. with more focus on embedding dimension as our work points out. >**QA-Q4:** Additionally, this correlation trend is overall, but within certain #Param and #Flop ranges, there is some variance. So, when model size and computational cost are in certain ranges, does this #Param and #Flop-based approach become ineffective? **QA-Q4:** Yes, they do. As shown in Fig. 4, within certain ranges of #Param, some architectures outperform others. This suggests that #Param and #Flop-based approaches become ineffective for predicting architecture performance within specific model size ranges. To further address Reviewer’s question, we analyze the correlation of #Param for models in certain ranges, with results presented in Tab. C1.a-b below. Specifically, to illustrate the constraint on #Param, we conduct a Kendall τ correlation analysis on our benchmark using architectures sampled from Autoformer-Small, applying different constraints on #Param ranges. **Table C1. a.** Kendall τ ranking correlation between the OoD accuracies and the #Param proxy. To illustrate the constraint on #Param, we gradually reduce the constraints on #Param | #Param range (M) | Correlation with ID Acc | Correlation with OoD Acc | |:----------------:|:-----------------------:|:------------------------:| | 14-34 | 0.7885 | 0.5789 ± 0.2944 | | 14-30 | 0.7851 | 0.5754 ± 0.2819 | | 14-26 | 0.7633 | 0.5741 ± 0.2314 | | 14-22 | 0.7728 | 0.5487 ± 0.2003 | | 14-18 | 0.5692 | 0.3056 ± 0.1988 | | **Table C1. b.** Kendall τ ranking correlation between the OoD accuracies and the #Param proxy. To illustrate the constraint on #Param, we investigate different ranges of #Param | #Param range (M) | Correlation with ID Acc | Correlation with OoD Acc | |:----------------:|:-----------------------:|:------------------------:| | 14-34 | 0.7885 | 0.5789 ± 0.2944 | | 30-34 | 0.1577 | 0.1419 ± 0.0818 | | 26-30 | 0.4591 | 0.1998 ± 0.2906 | | 22-26 | -0.0471 | 0.0513 ± 0.2215 | | 18-22 | 0.7247 | 0.4036 ± 0.2225 | | 14-18 | 0.5605 | 0.2955 ± 0.1945 | | >**QA-Q5:** Is it difficult to more accurately assess the performance differences between two models of similar size? **QA-Q5:** Yes, this is challenging, but our work makes contribution on this. Specifically, by creating the OoD-ViT-NAS benchmark with fine-grained architectural differences and a range of ViT attributes, we enable the assessment of performance differences between two models of similar size. This is possible as hinted by Fig. 4: we can specify the range of models of similar size, and examine these models' OoD accuracy. We hope that reviewer can consider increasing the rating if our response can address your concerns.

Reviewer Lm5n2024-08-11

Thank you for your response. I believe most of my concerns have been addressed. I also believe this paper may have a moderate-to-high impact on the field. Therefore, I would adjust my rating to a weak accept.

Authorsrebuttal2024-08-12

Thank you for the insightful comments and increased rating

We are deeply grateful to the reviewer for the positive comments and the increased rating. We are glad that our response has addressed your concerns. Once again, we thank reviewer's valuable time, which we appreciate a lot. If convenient, **we would really appreciate if the initial category assessment (Soundness, Presentation, Contribution) may be reviewed.**

Reviewer Lm5n2024-08-13

Thanks for the reminder. I've updated the scores accordingly.

Reviewer pt1z6/10 · confidence 4/52024-07-12

Summary

This paper studies the out of distribution generalization of vision transformer architecture designs. Specifically the paper studies how in-distribution accuracies relate to OOD accuracies for a set pf 3000 architectures. In addition the paper also studies the correlation between different zero-cost proxies and OOD accuracies (on different variants of imagenet), observing that simply parameters or FLOPs are good proxies. Furthermore, the paper also studies the impact of different architectural decisions on the OOD accuracies, discovering that embedding dimension is of utmost importance for OOD generalization. The authors release code and the raw results to reproduce their experiments on AutoFormer-T,B and S space.

Strengths

- The paper is the first one to study out-of-ditribution generalization of architectures discovered by NAS - The paper also studies zero cost proxies on the ViT space showing ineffectiveness of modern/newer ZCPs - The paper is written in a clear and easy to understand manner - Experiments on ZCPs are thorough and the results are insigntful

Weaknesses

- Currently I am missing the potential use-cases of the benchmark. The paper is more of a study and not a method (and fits better in the datasets and benchmark track of NeurIPS). Also though the paper is posed as a benchmark,I miss the intended use-case of the benchmark. Do the authors intend on releasing surrogates based on proxies, to allow API based querying these metrics for any possible architecture? - The authors only study 3000 architectures, which are too few to lead to generalizable insights. - Analysis of architecture importance: The search space of AutoFormer is a bit biased in the sense that there is a larger (factor two) variabilities in embedding dimension and a less variability for number of layers. I wonder if this is the reason embedding dimension has a higher correlation with OOD accuracy compared to other architecture dimensions like number of heads, embedding dimensions? - Multi-Objective Search: Since inheriting weights of a supernet and evaluation is fast, generally one would perform multi-objective random or evolutionary search directly on the pretrained supernet. This would lead to different Pareto-Fronts for different dataset distributions. Could the authors also present the results of multi-objective search directly on the OOD datasets? - What is the cost/search time different in computing Pareto-Fronts based on MO-search v/s Zero-Cost-Proxies (a lot of these proxies are actually not zero cost)?

Questions

- Do the authors train their own supernet, or train a one-shot supernet from scratch? - How does this benchmark contribute to aiding development of future NAS techniques for OOD generalization? - Check weakness

Rating

6

Confidence

4

Soundness

3

Presentation

3

Contribution

2

Limitations

The authors discuss limitations and broader impact sufficiently.

Reviewer HQRy7/10 · confidence 3/52024-07-13

Summary

This work presented OoD-ViT-NAS, a comprehensive NAS benchmark with a focus on out-of-distribution generalisation of vision Transformer architectures. The authors created a benchmark with 3000 diverse ViT architectures evaluated on 8 common large-scale OoD datasets, and provided the first comprehensive investigation of how ViT architectures affect OoD generalisation. They also conducted the first study exploring NAS for ViT’s OoD, analysing the impact of individual ViT architectural attributes on OoD generalisation.

Strengths

This study introduces the first large-scale benchmark for ViT OoD generalisation, which could be a valuable resource to the NAS field. The authors conducted a thorough investigation on the impact of ViT architectures in relation to OoD generalisation, covering multiple aspects such as architectural attributes, correlation between ID and OoD performance and the effectiveness of training-free NAS methods. This study reported several findings, such as the low correlation between ID and OoD accuracy, the superiority of simple proxies, i.e., model params and FLOPs, over more computationally complex training-free metrics. Although the latter has been revealed in other work on computer vision tasks, the authors further validate that point on the OoD tasks. The reproducibility of this work is good as the authors provided a substantial amount of details of their methodology, hyper-parameters and computational resources.

Weaknesses

This study is limited to the Autoformer architecture space, which may limit the generalisability of the findings to other ViT architectures. Also it comprises the novelty of this work. Although the empirical studies are comprehensive, there are not many theoretical explanations for the observed phenomena. More analysis and insights should be provided to support this work. The presentation can be improved. For example, Fig 1 appears on Page 2, but is first mentioned at Line 226, Page 7.

Questions

Line 119 shows that the work is based on Autoformer. What is the reason behind this choice? What is new? Line 145, OoD Classification Accuracy, what is the difference to the ID Acc in Line 142? Maybe a formula could clearly explain that. Line 154, we make use of the One-Shot NAS approach. Why not use zero shot NAS instead? What are the benefits that one short NAS can bring but not zero shot NAS? Table 2 shows correlations of some zero proxies. Can SWAP be applied here as it demonstrates a much higher correlation than those on the table? SWAP-NAS: Sample-Wise Activation Patterns for Ultra-fast NAS. Peng et. al. ICLR'24.

Rating

7

Confidence

3

Soundness

3

Presentation

3

Contribution

3

Limitations

The authors discussed the limitations of this work, but in the appendix instead of the main text.

Reviewer Lm5n2024-08-10

Thank you for your response. One remaining concern is regarding #Param and #Flop in A4.

Thank you for your responses and the latest results provided in A2. A2 and A3 have largely addressed my concerns. A1 has partially addressed my concerns. Although I think the author's response in A1 is not perfect, I acknowledge that this is an open issue worthy of further discussion, so what the authors have done so far is acceptable. One remaining concern is regarding #Param and #Flop in A4. From the results in Fig. 4 of the paper, it appears that the model's performance is generally monotonically related to #Param and #Flop. Does this mean that for this task, fine-grained architectural design might not be necessary, and that simply increasing the model size could improve performance? Besides, the conclusion that larger models perform better seems very intuitive, but aside from demonstrating that the architecture scales well, what further conclusions can be drawn from this? Additionally, this correlation trend is overall, but within certain #Param and #Flop ranges, there is some variance. So, when model size and computational cost are in certain ranges, does this #Param and #Flop-based approach become ineffective? Is it difficult to more accurately assess the performance differences between two models of similar size?

Reviewer f7Da2024-08-11

I leave the same rating: Strong Accept.

Thanks to the authors for additional comparison results that add confidence to the conclusions of the paper. It can be seen that increasing embed-dim increases OOD accuracy in an optimal way relative to increasing the inference latency. Two minor remarks to the rebuttal: 1. It is better in tables R.1 and R.2 to use GPU memory consumption instead of the number of parameters, which do not always correlate well with GPU memory consumption . 2. In the Figure R.2, it is better to use larger ranges for MLP-Ratio and #Heads, so that curves are visible instead of points in one place.

Authorsrebuttal2024-08-12

Thank you for the insightful comments and the Strong Accept rating

We sincerely appreciate the reviewer’s positive feedback and the time taken to review our rebuttal. Thank you for your suggestion, we will update our paper in the revision.

Reviewer pt1z2024-08-12

Response to rebuttal

I thank the authors for their response. I am increasing my score to 6.

Authorsrebuttal2024-08-12

Thank you for the positive feedback and increased rating

We sincerely appreciate Reviewer pt1z for the positive feedback and the increased rating.

Authorsrebuttal2024-08-14

Official Comment by Authors

Dear Reviewer pt1z We would like to summarize the contributions of our work following the discussion: - Our goal is to conduct an in-depth investigation into the impact of ViT architecture on OoD generalization. - To achieve this, we construct a comprehensive benchmark due to the lack of existing data that would allow for our in-depth analysis. This benchmark is not only crucial for our research but also valuable for future studies and other use cases. We are pleased that the discussion allowed us to clarify some potential applications of this benchmark. - With this benchmark at hand, we conduct ViT architectural studies on OoD generalization through the lens of Training-Free NAS and ViT structural attributes. - We are glad that you found our study into Training-Free NAS thorough and insightful. We also appreciate your comments on this study and are glad to provide additional results for Evolutionary Search directly on the OoD dataset. - Our key insight, increasing embedding dimensions enhances the OoD generalization of ViTs, leads to a simple yet effective method that can produce high-performing ViT architectures. This finding has been validated not only within our benchmark but also in established human-designed ViTs. - Your comment regarding the bias in the Autoformer search space for ViT structural attributes is greatly appreciated. During the discussion, we provided additional results to confirm that our findings are not affected by such bias. Once again, we sincerely appreciate your valuable time, insightful comments, and for raising the overall rating. **If convenient, we would be grateful if you could review the initial assessments of Soundness, Presentation, and Contribution.** Thank you very much.

Reviewer HQRy2024-08-13

The score is increased to 7 as the rebuttal has addressed most of my concerns and questions.

Authorsrebuttal2024-08-14

We are glad that our rebuttal addresses your concerns and Thank you for the increased rating

We are deeply grateful to the reviewer for the positive comments and the increased rating. We are glad that our response has addressed your concerns.

Authorsrebuttal2024-08-14

Summary for AC and Reviewer discussion

Thank you AC for handling our paper. We thank the reviewers for all of their insightful comments and for taking the time to thoroughly review our paper. We would like to briefly summary our work and Author-Reviewer discussion. **Main contribution.** In this work, we conduct an in-depth investigation into the impact of ViT architecture on OoD generalization. To achieve this, we first construct a comprehensive OoD-ViT-NAS benchmark covering 8 large-scale OoD datasets and 3,000 ViT architectures. This benchmark allows us to thoroughly study the impact of ViT architecture on OoD generalization, revealing that ViT architectures have a considerable impact on OoD generalization. Then, we conduct the ViT architectural studies on OoD generalization through the lens of (Training-Free) NAS and ViT structural attributes. Importantly, we discover that, among ViT structural attributes, increasing embedding dimensions improves OoD generalization leading to a simple yet effective method that can produce high OoD performance ViTs architectures. **Reproducibility.** Our submission includes the program code, OoD-ViT-NAS benchmark, and detailed instructions for reproducibility purposes. All of these will be released to the public to facilitate future OoD research. **Rebuttal.** In total we receive four reviews for our work. We are particularly grateful for the reviewers' constructive feedback to further improve our work. These have led to: - Additional experiment to validate finding on embedding dimension's effectiveness for established human design ViT, e.g., ViT [1] and Swin [3] - Additional High-Frequency analysis to support our embedding dimension finding - Additional latency and model size analysis - Additional experiment on the comparison of Training-Free NAS and Evolutionary Search Importantly, additional results consistently support our findings in the main paper. **Final Reviewers’ Decision.** After we submitted our rebuttal, we received positive feedback from all reviewers. In the end, we received the above acceptance threshold across the board (i.e., 6, 6, 7, 8) including a “Strong Accept” rating (Reviewer f7Da) and a feedback on the moderate-to-high impact on the field (Reviewer Lm5n). This encouraging feedback motivates us to further explore this research direction. One again, we sincerely thank all reviewers and AC again for their valuable time on this work. Best Regards.

Program Chairsdecision2024-09-25

Decision

Accept (poster)

© 2026 NYSGPT2525 LLC