Sum-of-Parts: Self-Attributing Neural Networks with End-to-End Learning of Feature Groups

Weiqiu You, Helen Qu, Marco Gatti, Bhuvnesh Jain, Eric Wong

Introduction

In high-stakes fields like medicine or cosmology, we don't just need a prediction from an AI model; we need to know why it made that prediction. Self-Attributing Neural Networks (SANNs) are a class of models designed to be interpretable by construction. They decompose a final prediction into a linear sum of feature contributions, offering a transparent look into the model's decision-making process.

However, SANNs historically face a "performance tax." Most traditional SANNs evaluate features individually (per-feature attribution). This approach fails significantly when features are highly correlated—for instance, the individual pixels that make up a dog's ear. This paper addresses two main gaps in the field:

  1. The Theoretical Gap: Formally proving why per-feature attribution leads to high errors in high-dimensional data.
  2. The Practical Gap: Creating a flexible framework that allows high-performance, pre-trained models (like Vision Transformers or BERT) to become interpretable SANNs without sacrificing accuracy.

The Sum-of-Parts (SOP) Framework

To overcome the limitations of per-feature attribution, the authors introduce the Sum-of-Parts (SOP) framework. SOP transforms black-box neural networks into interpretable models by grouping features and evaluating them as cohesive units.

Sum-of-Parts Architecture

The framework consists of three main components:

  • Group Generator ($\Gamma$): A trained module utilizing self-attention that identifies "feature groups" (e.g., patches of an image or tokens in a sentence) and creates binary masks for them. Crucially, these groups are learned end-to-end without any manual labels or group supervision.
  • Backbone Predictor ($h$): A frozen, high-performance pre-trained model. It processes each masked group individually to generate a group-specific prediction.
  • Group Selector ($\theta$): A trained module using cross-attention that assigns a "contribution score" to each group's prediction.

The final output is a simple linear aggregation: $y = \sum (\text{score}_i \times \text{prediction}_i)$. Because this final step is a linear sum, the resulting explanation is perfectly faithful to the model's internal logic.

Key Insights and Theoretical Grounding

  • The "Per-Feature" Impossibility: The authors mathematically prove that for certain simple functions, the error of per-feature SANNs grows exponentially with the number of dimensions. This provides rigorous justification for why feature groups are necessary for interpretability in complex, high-dimensional data.
  • Unsupervised Semantic Grouping: Even though SOP is not provided with "object" labels, its group generator naturally learns to isolate semantically meaningful parts (like a bird's head or a galaxy cluster) because those cohesive groups are the most predictive.
  • No "Information Leakage": A common pitfall in interpretability is when the "mask" itself inadvertently reveals the label to the model. Through probing experiments, the authors demonstrate that SOP’s masks do not leak hidden label information.

Empirical Results and Applications

The authors evaluated SOP across distinct domains, including ImageNet-S (vision), CosmoGrid (cosmological image regression), and MultiRC (language comprehension).

Error vs. Sparsity on ImageNet
  • State-of-the-Art Performance: SOP outperformed 14 other interpretability baselines—including popular post-hoc methods like LIME and SHAP, as well as intrinsic methods like BagNet—in both accuracy and interpretability metrics.
  • Robustness to Sparsity: As shown above, SOP maintains significantly lower error rates than competing methods even when forced to rely on very few features (high sparsity).
  • Scientific Discovery: In the cosmology task, SOP revealed that "voids" (under-dense regions in space) contribute more significantly to predicting certain cosmic parameters than dense "clusters." This finding aligns with and reinforces recent astrophysical theories.
  • Model Debugging: SOP effectively identifies why a model fails, such as highlighting instances where a model over-relies on background textures rather than the actual object of interest.

Limitations

While SOP offers a powerful step forward for SANNs, it comes with trade-offs:

  • Computational Cost: SOP requires multiple forward passes through the backbone (one for each group, typically around 20). While more efficient than many perturbation-based methods, it is computationally heavier than standard black-box inference.
  • Backbone Dependency: The quality of the explanations is inherently tied to the pre-trained backbone. If the backbone contains biases, the SOP explanations will faithfully reflect those biases.
  • Out-of-Distribution (OOD) Risks: Masking out parts of an image can create unnatural inputs that the backbone did not encounter during training. While modern architectures like Transformers handle this relatively well, it can pose challenges for older models like ResNets.

Summary updated

BibTeX
@inproceedings{you2025sum,
  author = {Weiqiu You and Helen Qu and Marco Gatti and Bhuvnesh Jain and Eric Wong},
  title = {{Sum-of-Parts: Self-Attributing Neural Networks with End-to-End Learning of Feature Groups}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=r6y9TEdLMh},
}
Figure