NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Data Debugging with Shapley Importance over Machine Learning Pipelines

Bojan Karlaš, David Dao, Matteo Interlandi, Sebastian Schelter, Wentao Wu, Ce Zhang

TL;DR: Existing data debugging tools often ignore the complex preprocessing pipelines that transform raw data into model features, making it hard to find errors in the original source. Datascope bridges this gap by using data provenance and efficient approximations to compute Shapley-based data importance over entire ML pipelines, delivering orders-of-magnitude speedups while remaining as effective as slow, traditional methods.

The Problem: Ignoring the Pipeline

When a machine learning model fails—perhaps it exhibits bias or poor accuracy—the culprit is usually the training data. To find the "bad" examples, researchers often use the Shapley value, a concept from game theory that assigns a score to each data point based on its marginal contribution to the model's performance.

However, there is a major practical hurdle: real-world ML doesn't just involve a standalone model; it involves a complex pipeline. Data is joined from different tables, scaled, augmented, and transformed before the model ever sees it. Traditional Shapley methods treat the model as a black box and ignore these preprocessing steps. To calculate importance for the source data using existing methods, you would have to re-run the entire pipeline for thousands of different data subsets, which is computationally ruinous.

Existing methods assume data is already preprocessed, but errors often occur in the source datasets before transformations.

The Datascope Framework

To make pipeline-aware data debugging feasible, the authors introduce Datascope. Their approach relies on three main pillars:

  1. Data Provenance: Instead of treating the pipeline as a black box, Datascope uses data provenance to track exactly how specific source tuples flow through the pipeline to become output features.
  2. Canonical Pipelines: The authors identify three "canonical" pipeline structures: Map (1-to-1), Fork (1-to-many, like data augmentation), and Join (many-to-1). They demonstrate that most real-world pipelines can be represented or closely approximated by these fundamental structures.
  3. The KNN Proxy & ADDs: To avoid retraining complex target models (like XGBoost or ResNets) thousands of times, Datascope uses a K-Nearest Neighbor (KNN) model as a proxy. By combining the structure of canonical pipelines with the local properties of KNN, they utilize Additive Decision Diagrams (ADDs)—a specialized data structure—to count data subsets in polynomial time rather than exponential time.

Key Insights

  • Pipelines are "White Boxes": By looking inside the pipeline rather than just at the model, we can exploit the mathematical structure of data transformations to skip redundant computations.
  • The "Approximately Canonical" Reality: A surprising finding from a case study of 500,000 Microsoft pipelines was that over 90% of real-world workflows are either purely canonical or can be easily converted into a canonical form by isolating "reduce" operations (like calculating a mean for scaling).
  • Interactive Debugging: Because Datascope is so fast, it enables "interactive" data debugging. Practitioners can repair a few labels, recompute importance scores almost instantly, and then find the next most likely errors—a workflow far more effective than a single-pass repair.

Experimental Results

The authors evaluated Datascope across diverse tabular, image, and text benchmarks (including Folktables Adult, CIFAR-N, and 20NewsGroups). The primary takeaway is that practitioners do not have to sacrifice accuracy for speed.

  • Massive Speedups: Datascope achieved remarkable efficiency gains. For example, on the Folktables dataset, traditional Monte Carlo methods took over 600 seconds to compute importance scores, while Datascope's KNN-based approach took only 1.5 seconds.
  • High Effectiveness: In label repair tasks (finding and fixing mislabeled data), Datascope performed as well as—and sometimes better than—computationally expensive Monte Carlo baselines.
  • Debugging for Fairness: The framework isn't limited to accuracy. Using metrics like "Equalized Odds," Datascope successfully identified data points that were contributing most to model bias.
Datascope's KNN proxy (red) finds dirty labels as effectively as Monte Carlo methods but reduces compute time from over 600 seconds to just 1.5 seconds.

Limitations and Future Work

While Datascope handles most common operators, it still struggles with highly complex, non-linear "reduce" operations that don't fit the standard estimator-transformer pattern. Additionally, the reliance on a KNN proxy assumes that data importance for a KNN model correlates well with importance in the target model (e.g., a Deep Neural Network). While results suggest this is often true, edge cases may exist where the proxy fails to capture model-specific sensitivities. Future work will explore extending these techniques to more complex join types and diverse model proxies.

Summary updated

BibTeX
@inproceedings{karlas2024data,
  author = {Bojan Karlaš and David Dao and Matteo Interlandi and Sebastian Schelter and Wentao Wu and Ce Zhang},
  title = {{Data Debugging with Shapley Importance over Machine Learning Pipelines}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=qxGXjWxabq},
}
Figure