Intermediate Layer Classifiers for OOD generalization
Arnas Uselis, Seong Joon Oh
Abstract
Deep classifiers are known to be sensitive to data distribution shifts, primarily due to their reliance on spurious correlations in training data. It has been suggested that these classifiers can still find useful features in the network's last layer that hold up under such shifts. In this work, we question the use of last-layer representations for out-of-distribution (OOD) generalisation and explore the utility of intermediate layers. To this end, we introduce Intermediate Layer Classifiers (ILCs). We discover that intermediate layer representations frequently offer substantially better generalisation than those from the penultimate layer. In many cases, zero-shot OOD generalisation using earlier-layer representations approaches the few-shot performance of retraining on penultimate layer representations. This is confirmed across multiple datasets, architectures, and types of distribution shifts. Our analysis suggests that intermediate layers are less sensitive to distribution shifts compared to the penultimate layer. These findings highlight the importance of understanding how information is distributed across network layers and its role in OOD generalisation, while also pointing to the limits of penultimate layer representation utility. Code is available at https://github.com/oshapio/ intermediate-layer-generalization .
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
2 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- MLP-Mixer: An all-MLP Architecture for Vision cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- Swin Transformer: Hierarchical Vision Transformer using Shifted Windows cites MLP-Mixer: An all-MLP Architecture for Vision
- Swin Transformer: Hierarchical Vision Transformer using Shifted Windows cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- On the rankability of visual embeddings cites An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
- On the rankability of visual embeddings cites Does Data Scaling Lead to Visual Compositional Generalization?
- Does Data Scaling Lead to Visual Compositional Generalization? cites On the rankability of visual embeddings
Cited by top-tier papers2
Builds on27
- Swin Transformer: Hierarchical Vision Transformer using Shifted WindowsZe Liu, Yutong Lin, Yue Cao, Han Hu et al.ICCV 2021 · 31,683 citations
- An Image is Worth 16x16 Words: Transformers for Image Recognition at ScaleAlexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn et al.ICLR 2021 · 21,477 citations
- MLP-Mixer: An all-MLP Architecture for VisionIlya O. Tolstikhin, Neil Houlsby, Alexander Kolesnikov, Lucas Beyer et al.NeurIPS 2021 · 3,862 citations
- The Many Faces of Robustness: A Critical Analysis of Out-of-Distribution GeneralizationDan Hendrycks, Steven Basart, Norman Mu, Saurav Kadavath et al.ICCV 2021 · 2,294 citations
- Decoupling Representation and Classifier for Long-Tailed RecognitionBingyi Kang, Saining Xie, Marcus Rohrbach, Zhicheng Yan et al.ICLR 2020 · 1,496 citations
Related papers
- Mysteries of the Deep: Role of Intermediate Representations in Out of Distribution DetectionIgnacio Meza De La Jara, Cristian Rodriguez Opazo, Damien Teney, Damith Ranasinghe et al.NeurIPS 2025 · 8 citations
- Channel Importance Matters in Few-Shot Image ClassificationXu Luo, Jing Xu, Zenglin XuICML 2022 · 57 citations
- Characterizing Generalization under Out-Of-Distribution Shifts in Deep Metric LearningTimo Milbich, Karsten Roth, Samarth Sinha, Ludwig Schmidt et al.NeurIPS 2021 · 26 citations
- Enhancing Out-of-Distribution Detection in Natural Language Understanding via Implicit Layer EnsembleHyunsoo Cho, Choonghyun Park, Jaewook Kang, Kang Min Yoo et al.EMNLP Findings 2022 · 6 citations
- Improving Continual Learning Performance and Efficiency with Auxiliary ClassifiersFilip Szatkowski, Yaoyue Zheng, Fei Yang, Tomasz Trzcinski et al.ICML 2025
