Toward a Unified Framework for Debugging Gray-box Models

Andrea Bontempelli, Fausto Giunchiglia, Andrea Passerini, Stefano TesoarXiv 2021

Abstract

Concept-based models (CBMs) offer a path toward interpretable machine learning by mediating predictions through human-understandable concepts. However, debugging these "gray-box" models remains a fragmented and often brittle process. This paper proposes a unified framework for systematically addressing bugs in both concept definitions and aggregation logic. We introduce a "Robust Aggregation Loss" to prevent the "whack-a-mole" effect, where models re-learn discarded biases in new internal representations during retraining. Our framework establishes a hierarchical debugging loop that prioritizes concept quality before aggregation logic.

Introduction

Interpretability in deep learning often relies on concept-based models (CBMs), which decompose the prediction process into two stages: identifying high-level concepts (e.g., "wings" or "beaks" for a bird) and aggregating these concepts into a final label. Despite their promise, debugging CBMs is challenging because they can fail in two distinct ways. First, Aggregation Bugs occur when the model identifies the correct concepts but combines them incorrectly—for instance, relying on a background watermark rather than anatomical features to identify a species. Second, Concept Bugs occur when the concepts themselves are poorly defined, uninterpretable, or capture unintended "shortcuts" in the data.

Background: The Landscape of Concept-Based Models

Existing CBMs vary significantly in their architectural choices, ranging from autoencoder-based concepts to arbitrary neural representations. This diversity makes it difficult to apply a single debugging tool across different models.

Comparison of existing concept-based model (CBM) architectures across concept types, aggregators, and training regimes.

As shown in the table above, models like ProtoPNet and IAIA-BL use convolutional filters as concepts, while CBM (Koh et al. 2020) allows for arbitrary concept definitions. Some models require extra annotations like concept attributes or labels, and training regimes vary between end-to-end and multistep processes. This diversity necessitates a unified approach to debugging that is agnostic to the specific implementation of concepts or aggregators.

A Unified Debugging Framework

The proposed framework follows a three-step hierarchical process to ensure model reliability:

  1. Assessing Concept Quality: Evaluating whether the current concept set is sufficient, interpretable, and semantically meaningful for the task.
  2. Fixing Aggregation Weights: Correcting the logic used to combine high-quality concepts once they are validated.
  3. Fixing Concept Definitions: Providing additional supervision to refine or replace inadequate concepts when the existing vocabulary is insufficient.

Technical Innovation: Robust Aggregation Loss

A significant challenge in debugging CBMs is the "whack-a-mole" effect. When a developer penalizes a specific concept index to remove a bias, the model's inherent flexibility allows it to simply re-learn the same bias at a different internal index during retraining. To counter this, we introduce a Robust Aggregation Loss ($\ell_{aggr}$).

Instead of penalizing a fixed index, this loss function penalizes any concept that is semantically similar to a forbidden concept stored in a "memory" ($M$). By using a kernel-based approach to measure similarity between activation maps (using product kernels $\kappa_{act}$ and $\kappa_{attr}$), the framework ensures that human corrections remain effective even as internal representations shift. If a human expert dictates that a visual shortcut should not be used, the model is penalized for using anything that acts like that shortcut, regardless of its position in the network.

Conceptification

The framework also introduces the idea of "conceptification," which treats individual concepts as mini-CBMs. This allows for recursive debugging: if a specific concept is activating for the wrong reasons, the user can investigate its own underlying logic and apply the same debugging framework at a deeper level. This recursive property bridges the gap between debugging the final output and debugging intermediate features.

Evaluation and Insights

This work is primarily a theoretical and framework-oriented contribution. The authors demonstrate the framework's utility using illustrative "toy" examples, such as identifying shapes (e.g., green circles vs. pink triangles) where confounding variables can subvert traditional debugging. While it references standard implementations like ProtoPNets and IAIA-BL, it focuses on the formalization of the debugging loop rather than a new benchmark dataset.

Key insights from this approach include:

  • Representation Invariance: Debugging must move beyond fixed neurons to semantic representations to be effective in end-to-end trained models.
  • Human-in-the-loop Priority: Users should first validate the "vocabulary" (concepts) before trying to fix the "grammar" (aggregation).

Conclusion and Future Work

This paper provides a structured blueprint for interactive troubleshooting in gray-box models. By generalizing Explanatory Interactive Learning (XIL) to be robust against concept drift, it offers a more stable path for human-AI collaboration. Future research will focus on empirical validation on larger datasets, reducing the supervisory burden on human experts, and addressing systemic bugs like model capacity constraints.

Summary updated

BibTeX
@misc{bontempelli2021toward,
  author = {Andrea Bontempelli and Fausto Giunchiglia and Andrea Passerini and Stefano Teso},
  title = {{Toward a Unified Framework for Debugging Gray-box Models}},
  year = {2021},
  eprint = {2109.11160},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2109.11160},
}
Figure