Introduction
Vision Transformers (ViTs) have established themselves as the state-of-the-art architecture for computer vision tasks. However, their internal decision-making processes remain largely opaque. When a ViT classifies an image—for instance, identifying a "Crested Auklet"—it is often unclear whether the model is focusing on diagnostic features like the orange beak or irrelevant background artifacts.
Existing explanation methods often fail to bridge this gap for two primary reasons. First, many techniques designed for Convolutional Neural Networks (CNNs) do not translate well to the patch-based, self-attention mechanisms of ViTs. Second, most methods provide unstructured "heat maps" that lack a connection to broader, dataset-wide concepts. To address these challenges, we introduce PACE (ProbAbilistic Concept Explainers), a variational Bayesian framework designed to provide structured, stable, and faithful conceptual explanations.
Defining Trustworthy Explanations
A core contribution of this work is the formalization of what constitutes a "trustworthy" explanation. Rather than relying on subjective human interpretation, PACE is built upon five mathematical desiderata:
- Faithfulness: The explanation must accurately reflect the model's underlying logic.
- Stability: Explanations should remain consistent under minor input perturbations (e.g., noise or cropping).
- Sparsity: Explanations should focus on a small number of highly relevant concepts.
- Multi-Level Structure: The framework should connect global dataset-level concepts to local image-level and patch-level instances.
- Parsimony: The explanation should use the simplest possible set of concepts to explain the model's behavior.
The PACE Framework
PACE is a post-hoc explainer, meaning it analyzes a pre-trained ViT without requiring architectural changes or retraining. It utilizes a Variational Bayesian framework to treat internal patch embeddings as observed data generated by latent "concepts."
Hierarchical Modeling
PACE models concepts as a Mixture of Gaussians across three distinct levels:
- Global Level: Discovers concepts across the entire dataset (e.g., "long wings" or "pointed beaks").
- Image Level: Determines the distribution of these concepts within a specific image.
- Patch Level: Assigns specific image patches to the most relevant discovered concepts.
Attention Integration and Stability
To ensure the explanation is grounded in the model's actual behavior, PACE incorporates the ViT’s internal attention weights as "virtual counts" for patches. This ensures that patches the model ignored are not given weight in the explanation. Furthermore, to satisfy the stability desideratum, PACE includes a stability term ($L_s$) in its objective function. Inspired by contrastive learning, this term ensures that an image and its slightly perturbed version yield similar conceptual activations.
Experimental Evaluation
We evaluated PACE against state-of-the-art baselines, including SHAP, LIME, and CRAFT, across four datasets: a synthetic Color benchmark, Oxford 102 Flowers, Stanford Cars, and CUB-200-2011 (Birds).
Quantitative Results
PACE significantly outperformed existing methods across all key metrics:
- Faithfulness: On the synthetic Color dataset, PACE achieved a perfect 1.00 faithfulness score, indicating that a linear model could perfectly predict the ViT's output using only PACE’s discovered concepts.
- Stability: PACE demonstrated superior robustness to noise, scoring 0.11 on sensitivity metrics compared to 0.43 for the next best method (Saliency).
- Sparsity: PACE produced "cleaner" explanations, successfully isolating relevant features without the noise common in gradient-based methods.
Qualitative Insights
In the CUB-200-2011 dataset, PACE successfully identified biologically meaningful concepts without human supervision. For example, it isolated "Ocean Background" for Albatrosses and "Orange Beak" for Auklets, demonstrating its ability to extract high-level semantic features that align with human understanding while remaining faithful to the model's internal representations.
Limitations and Future Directions
While PACE represents a significant step forward in model interpretability, several areas for improvement remain. Currently, the number of concepts ($K$) must be pre-defined by the user; future iterations may utilize non-parametric approaches to discover the optimal number of concepts automatically. Additionally, as a "white-box" method, PACE requires access to internal hidden states and attention weights, which may not be feasible for API-only models. Finally, the Bayesian inference process involves higher computational overhead than simple saliency maps, though this is mitigated by the fact that it only requires a single inference pass after the initial learning phase.
Conclusion
PACE provides a rigorous, probabilistic foundation for explaining Vision Transformers. By moving beyond simple heat maps toward a multi-level, stable, and faithful conceptual framework, PACE offers a path toward truly transparent and trustworthy computer vision systems.
Summary updated