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

Debugging Machine Learning Tasks

Aleksandar Chakarov, Aditya V. Nori, Sriram K. Rajamani, Shayak Sen, Deepak VijaykeerthyarXiv 2016

Abstract

In traditional software, bugs are found in code; in machine learning (ML), they are often hidden in the training data. This paper introduces Psi, a debugging framework that applies Judea Pearl’s theory of causal inference to automatically pinpoint mislabeled training instances causing specific test-set errors. By employing probabilistic programming and "gray-box" approximations of the training process, Psi identifies these data-centric bugs without the need for computationally expensive model retraining.

Introduction: The Data-Centric Debugging Challenge

In standard software engineering, an incorrect output can be traced back to a specific line of code using tools like program slicing or step-through debuggers. Machine learning flips this paradigm. The underlying code—the ML library—is typically correct, but the "program" (the model) is induced from voluminous, often noisy data.

When a trained classifier $h$ makes a mistake on a test point from set $\Delta$, identifying the root cause is non-trivial. The model's parameters depend on the entire training set $\Gamma$, making it impossible to trace dependencies backward in a traditional sense. While one could theoretically flip training labels and retrain the model to see if the error persists, the combinatorial explosion of possible subsets makes this approach computationally intractable.

Standard ML Pipeline and Notation

Methodology: Causal Debugging with Psi

The authors formalize the debugging process using structural equations of causation. The core metric is the Probability of Sufficiency (PS), which quantifies the likelihood that flipping a specific training point's label would "cause" a misclassified test point to be corrected across various counterfactual scenarios.

To make the computation of PS feasible, the authors developed Psi, which incorporates three key optimizations:

  1. Probabilistic Programming: PS computation is encoded as a probabilistic program, enabling the use of sampling-based inference engines for efficient estimation.
  2. Gray-Box Approximations: Rather than treating the training algorithm $\mathcal{A}$ as a black box, Psi profiles intermediate values (e.g., gradient steps or tree splits) to build a simplified linear approximation of the model.
  3. Exploiting ML Robustness: ML algorithms are designed to be robust to minor input perturbations. Psi leverages this property, using its gray-box approximations to predict output changes from label flips without retraining from scratch.

Experimental Setup

Psi was evaluated on datasets with 10% injected noise to simulate real-world data collection errors:

  • Real-world (Systematic Noise): sentiment (IMDB reviews) and income (Census data).
  • Synthetic (Random Noise): 2gauss and concentric (Gaussian distributions).

Key Insights: Robustness and Model Architecture

A primary finding is that ML robustness is a "double-edged sword." While it allows models to generalize, it makes black-box debugging difficult because single-point changes rarely alter global predictions. However, Psi turns this into an advantage by using robustness to justify its mathematical approximations.

Visualization of Decision Boundaries and Data Classification

Furthermore, the choice of model architecture significantly impacts debuggability. The authors found that Gradient Boosted Decision Trees (GBDT) are much easier to debug than Logistic Regression (LR). As illustrated in Figure 2, LR fits a global hyperplane (the solid line), where every training point exerts some influence on the entire boundary. In contrast, Decision Trees partition data into local regions; a test point's outcome is only influenced by the training points within its specific leaf, narrowing the search space for the "bug."

Results and Performance

Psi demonstrated high efficacy in identifying systematic noise. On the sentiment dataset, while a random guess has a 10% success rate, Psi achieved 58% accuracy for LR and 100% accuracy for GBDT. Similar results were seen on the income dataset (70% for LR, 100% for GBDT).

Correcting the "root cause" points identified by Psi led to a monotonic reduction in validation error. For GBDT on real-world data, validation errors dropped by approximately 20%. However, the tool struggled with purely random noise in high-variance datasets like concentric, where noise does not systematically shift the decision boundary.

Limitations and Future Work

Currently, Psi supports Logistic Regression and GBDT. Future work involves extending gray-box approximations to Deep Neural Networks and Support Vector Machines. Additionally, while the current framework focuses on mislabeled data, it could be expanded to address other "bugs" like poor feature selection or hyperparameter misalignment. Finally, scaling these probabilistic inference techniques to handle industrial-scale datasets with millions of rows remains a significant challenge.

Summary updated

BibTeX
@misc{chakarov2016debugging,
  author = {Aleksandar Chakarov and Aditya V. Nori and Sriram K. Rajamani and Shayak Sen and Deepak Vijaykeerthy},
  title = {{Debugging Machine Learning Tasks}},
  year = {2016},
  eprint = {1603.07292},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1603.07292},
}
Figure