Sparse Autoencoders for Interpretable Out-of-Distribution Detection

Ayush Karmacharya, Luke Luschwitz, Lucia Romero, Yanan Niu, Joseph Campbell
7/13/2026
cs.LGcs.AI

No confident code implementation found for this paper.

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{karmacharya2026sparse,
  title  = {Sparse Autoencoders for Interpretable Out-of-Distribution Detection},
  author = {Ayush Karmacharya and Luke Luschwitz and Lucia Romero and Yanan Niu and Joseph Campbell},
  year   = {2026},
  eprint = {2607.12094},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2607.12094v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2607.12094.svg)](https://codeofpaper.com/paper/2607.12094)

Discussion