Extremely Simple Activation Shaping for Out-of-Distribution Detection
Andrija Djurisic, Nebojsa Bozanic, Arjun Ashok, Rosanne Liu
Abstract
The separation between training and deployment of machine learning models implies that not all scenarios encountered in deployment can be anticipated during training, and therefore relying solely on advancements in training has its limits. Out-of-distribution (OOD) detection is an important area that stress-tests a model's ability to handle unseen situations: Do models know when they don't know? Existing OOD detection methods either incur extra training steps, additional data or make nontrivial modifications to the trained network. In contrast, in this work, we propose an extremely simple, post-hoc, on-the-fly activation shaping method, ASH, where a large portion (e.g. 90%) of a sample's activation at a late layer is removed, and the rest (e.g. 10%) simplified or lightly adjusted. The shaping is applied at inference time, and does not require any statistics calculated from training data. Experiments show that such a simple treatment enhances in-distribution and out-ofdistribution distinction so as to allow state-of-the-art OOD detection on ImageNet, and does not noticeably deteriorate the in-distribution accuracy. Video, animation and code can be found at: https://andrijazz.github.io/ash .
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext dd59edb5-2756-4a9e-ad29-981f98456b2bCited by top-tier papers103
- INSIDE: LLMs' Internal States Retain the Power of Hallucination DetectionChao Chen, Kai Liu, Ze Chen, Yi Gu et al.ICLR 2024 · 281 citations
- Dream the Impossible: Outlier Imagination with Diffusion ModelsXuefeng Du, Yiyou Sun, Jerry Zhu, Yixuan LiNeurIPS 2023 · 114 citations
- Scaling for Training Time and Post-hoc Out-of-distribution Detection EnhancementKai Xu, Rongyu Chen, Gianni Franchi, Angela YaoICLR 2024 · 81 citations
- Negative Label Guided OOD Detection with Pretrained Vision-Language ModelsXue Jiang, Feng Liu, Zhen Fang, Hong Chen et al.ICLR 2024 · 73 citations
- Learning to Augment Distributions for Out-of-distribution DetectionQizhou Wang, Zhen Fang, Yonggang Zhang, Feng Liu et al.NeurIPS 2023 · 59 citations
Builds on11
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
- Learning Transferable Visual Models From Natural Language SupervisionAlec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh et al.ICML 2021 · 47,906 citations
- Photorealistic Text-to-Image Diffusion Models with Deep Language UnderstandingChitwan Saharia, William Chan, Saurabh Saxena, Lala Li et al.NeurIPS 2022 · 8,965 citations
- Locating and Editing Factual Associations in GPTKevin Meng, David Bau, Alex Andonian, Yonatan BelinkovNeurIPS 2022 · 3,415 citations
- Energy-based Out-of-distribution DetectionWeitang Liu, Xiaoyun Wang, John D. Owens, Yixuan LiNeurIPS 2020 · 2,213 citations
Related papers
- AdaSCALE: Adaptive Scaling for OOD DetectionSudarshan RegmiICML 2026 · 9 citations
- Activation Subspaces for Out-of-Distribution DetectionBaris Zöngür, Robin Hesse, Stefan RothICCV 2025 · 2 citations
- Towards Optimal Feature-Shaping Methods for Out-of-Distribution DetectionQinyu Zhao, Ming Xu, Kartik Gupta, Akshay Asthana et al.ICLR 2024 · 14 citations
- ReAct: Out-of-distribution Detection With Rectified ActivationsYiyou Sun, Chuan Guo, Yixuan LiNeurIPS 2021 · 733 citations
- Activation Shape Matters: OOD Detection with Norm-Entropy FusionJiawei Gu, Ziyue Qiao, Zechao LiACM MM 2025 · 2 citations
