Abstract
Deep neural networks (DNNs) are often criticized for their "black box" nature, making it difficult to audit their internal decision-making logic. This paper introduces Cluster Paths, a post-hoc interpretability framework that transforms high-dimensional activations into a human-readable sequence of cluster IDs. By mapping an input's journey through a network as a concise "concept path," this method provides a "glocal" (global + local) explanation. Our evaluation shows that Cluster Paths are highly faithful to model logic, can expose reliance on spurious shortcuts, and serve as a state-of-the-art out-of-distribution (OOD) detector, achieving an AUROC of 0.97.
Introduction
While DNNs achieve remarkable accuracy, understanding why they make specific decisions remains a challenge. Existing tools typically offer either local attribution (e.g., saliency maps) or example-based explanations (e.g., k-Nearest Neighbors). However, these methods often fail to capture how information is processed across layers or are too computationally expensive for large-scale deployment. Cluster Paths address this gap by providing a scalable, concise, and faithful representation of a model's internal representations.
Methodology
The core of the framework is layer-wise clustering. The process involves three main steps:
- Activation Recording: For a pre-trained model, activations are recorded at specific layers for the entire training dataset.
- Clustering: $k$-means clustering is applied to these activations at each layer to define representative "concepts."
- Path Generation: Any new input is passed through the network, and its activations are assigned to the nearest cluster at each layer. The resulting sequence of cluster IDs (e.g., $0 \rightarrow 3 \rightarrow 1$) forms the "Cluster Path."
To enhance interpretability, the authors utilize "divergence analysis" paired with Large Language Models (LLMs). By comparing groups of images that share a path up to a certain layer before diverging, an LLM can generate natural language descriptions of the visual features that distinguish the clusters.
Experimental Results
Faithfulness and Robustness
The researchers evaluated the method on the CelebA hair color classification task, achieving 90% Decision-Alignment Faithfulness (DAF). This indicates that the cluster path alone is a highly accurate proxy for the model's final output. Furthermore, the method demonstrated high stability, maintaining 96% path agreement under mild Gaussian noise.
Shortcut Exposure
A critical application of Cluster Paths is identifying "shortcut learning." Using a custom SpuriousCIFAR10 dataset—where specific classes are associated with colored background patches—the authors showed that cluster paths clearly separate images based on these spurious cues rather than the actual object features.
Out-of-Distribution Detection
Cluster Paths proved to be an exceptional tool for OOD detection. By identifying inputs that follow "rare" or previously unseen paths, the system can flag anomalous data. In tests against benchmarks like SVHN and LSUN, the method achieved an AUROC of 0.97, significantly outperforming standard baselines like ODIN.
Discussion and Conclusion
Cluster Paths offer a unique balance of interpretability and efficiency. Unlike memory-intensive methods like Deep k-Nearest Neighbors (DkNN), Cluster Paths only require storing cluster centroids, making them viable for edge deployment.
While the current implementation uses $k$-means for its scalability, future work may explore more complex clustering algorithms to better capture non-linear manifolds. Additionally, extending this framework to Large Language Models (LLMs) presents a promising frontier for understanding the internal logic of generative AI. Ultimately, Cluster Paths provide a robust map for navigating the complex internal landscapes of modern neural architectures.
Summary updated