Ranked Activation Shift for Post-hoc Out-of-Distribution Detection
Abstract
State-of-the-art post-hoc out-of-distribution detection meth-ods rely on intermediate layer activation editing. However, they exhibitinconsistent performance across datasets and models. We show that thisinstability is driven by differences in the activation distributions, andidentify a failure mode of scaling-based methods that arises when penul-timate layer activations are not rectified. Motivated by this analysis,we propose RAS, a hyperparameter-free post-hoc method that replacessorted activation magnitudes with a fixed in-distribution reference profile.Our simple plug-and-play method shows strong and consistent perfor-mance across datasets and architectures without assumptions on thepenultimate layer activation function, and without requiring any hyperpa-rameter tuning, while empirically preserving in-distribution classificationaccuracy. We further analyze what drives the improvement, showing thatboth inhibiting and exciting activation shifts independently contribute tobetter out-of-distribution discrimination1 .