Error Discovery By Clustering Influence Embeddings

Fulton Wang, Julius Adebayo, Sarah Tan, Diego Garcia-Olano, Narine Kokhlikyan

Machine learning models rarely fail uniformly across all data. Instead, they often exhibit "blind spots"—specific subgroups of data, or slices, where performance drops significantly. These failures might stem from spurious correlations (e.g., a model identifying "pneumonia" based on a hospital's specific X-ray scanner tag rather than medical features), noisy labels, or underrepresented "rare" classes.

The task of finding these problematic groups is known as Slice Discovery. However, existing methods often struggle with coherence: they might group failing examples together simply because they look visually similar, even if the model is failing on them for completely different reasons.

In this paper, the authors tackle the challenge of formalizing and achieving coherence—ensuring that all errors in a discovered slice share the same "root cause" from the perspective of the training data. To solve this, they introduce InfEmbed, a novel slice discovery method that identifies groups of test examples where a model fails for the same underlying reason.

The InfEmbed Method

InfEmbed moves beyond simple feature clustering by looking at how the training data "influences" model predictions. It provides a mathematically grounded way to group errors by their root causes.

Overview of the InfEmbed clustering process.

The method breaks down into several key steps:

  1. Influence Functions: The method starts with influence functions, which estimate how much a specific training example contributed to the loss of a specific test example.
  2. Influence Explanations: For every test point, the authors define an "influence explanation"—a massive vector representing the influence of every training point on that test point. If two test points have similar vectors, they are "influenced similarly" by the training set.
  3. Influence Embeddings: Because these vectors are too large to cluster directly (their size equals the number of training points), the authors derive a low-dimensional representation called influence embeddings. These embeddings preserve a "dot-product property": the influence of a training point on a test point is approximately the dot product of their respective embeddings.
  4. Clustering (InfEmbed): The core algorithm simply applies K-Means clustering to these influence embeddings. This groups test points that the model "thinks about" in the same way.
  5. Slice Opponents: To explain why a slice is failing, the method identifies "slice opponents"—the training examples that most negatively impacted the model's performance on that specific group.

Key Insights

The authors argue that a slice is only useful for debugging if its errors are "wrong for the same reason." Influence functions provide the perfect mathematical lens for this, as they link test-time failures directly back to specific training data.

Interestingly, clustering by influence naturally groups examples with similar labels and predictions. While previous methods had to add explicit "error-aware" terms to achieve this, it emerges as a natural byproduct of the influence-based derivation in InfEmbed. Furthermore, because InfEmbed can incorporate gradients from multiple layers (not just the final feature layer), it can catch more complex error patterns that might be missed by looking at high-level features alone.

Key Results and Real-World Debugging

The authors evaluated InfEmbed across a diverse range of benchmarks, including dcbench (a massive benchmark of 1,235 pre-trained models across natural and medical images) and SpotCheck (a synthetic benchmark for recovering known blindspots).

  • State-of-the-Art Performance: On the dcbench benchmark, InfEmbed consistently outperformed the previous leader, Domino. For example, in the "rare class" task for natural images, InfEmbed achieved a precision of 0.65 compared to Domino's 0.40.
  • Superior Discovery Rates: On the SpotCheck benchmark, InfEmbed reached a discovery rate of 0.91, surpassing the previous state-of-the-art PlaneSpot (0.85).

Beyond benchmarks, InfEmbed proved highly effective in qualitative case studies.

Examples of discovered slices and their corresponding training opponents.

In real-world debugging scenarios, InfEmbed successfully identified subtle error patterns. For instance, it found that a BERT model was misclassifying "Business" news as "World" news specifically when the text contained country names. In medical imaging tests, the method isolated slices affected by injected scanner "tags," and the "slice opponents" correctly pointed back to the training images containing those exact same tags.

Limitations and Future Work

While powerful, InfEmbed does have limitations. First, it requires a validation or test set that actually contains the types of errors you want to detect; if your test set is perfectly balanced and clean, InfEmbed won't find the "hidden" biases in your model.

Second, while InfEmbed identifies the slices and the "opponent" training points, it still requires a human-in-the-loop to look at those opponents and infer the actual semantic feature causing the error (e.g., realizing that a clock hand is being mistaken for a snake). Finally, computing influence requires Hessian-vector products. Although the authors use efficient approximations, this can still be computationally intensive for extremely large models compared to simple feature clustering.

Summary updated

BibTeX
@inproceedings{wang2023error,
  author = {Fulton Wang and Julius Adebayo and Sarah Tan and Diego Garcia-Olano and Narine Kokhlikyan},
  title = {{Error Discovery By Clustering Influence Embeddings}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=yBVLXvJ1sb},
}
Figure