Sparse Autoencoders for Interpretable Out-of-Distribution Detection

📅 2026-07-13
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This work addresses the problem of overconfidence in machine learning models when encountering out-of-distribution (OOD) samples by proposing an interpretable OOD detection method based on sparse autoencoders. It introduces, for the first time, sparse autoencoders into OOD detection to learn sparse and interpretable feature representations from intermediate layer activations of a pre-trained network. The method constructs an OOD detection score by measuring the cosine similarity between the activation pattern of a test sample and the average activations of in-distribution (ID) classes. Experimental results demonstrate that the proposed approach achieves state-of-the-art performance on standard OOD benchmarks. Moreover, it reveals fundamental differences in feature activation between ID and OOD samples, offering interpretable insights into how distributional shifts affect model representations.
📝 Abstract
Reliable detection of out-of-distribution (OOD) samples is crucial for the safe deployment of machine learning models. Neural networks often produce overconfident predictions for inputs that deviate from their training data, leading to significant degradation in performance. While many OOD detection methods focus on the final output layer, they neglect the rich hierarchical information present in intermediate network layers. This paper introduces a novel approach that leverages sparse autoencoders (SAEs) to learn interpretable features from these intermediate activations. We find that in-distribution (ID) and OOD data activate distinct sets of these sparse features. We propose a new OOD score derived from the cosine similarity between the sparse feature activations of a test sample and the mean activations of ID classes. Our post-hoc detection method not only achieves state-of-the-art performance on standard OOD detection benchmarks, but yields interpretable insights into how distribution shift affects learned representations.
Problem

Research questions and friction points this paper is trying to address.

out-of-distribution detection
sparse autoencoders
interpretable features
distribution shift
intermediate activations
Innovation

Methods, ideas, or system contributions that make the work stand out.

Sparse Autoencoders
Out-of-Distribution Detection
Interpretable Features
Intermediate Activations
Cosine Similarity