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

Towards Interactively Improving ML Data Preparation Code via "Shadow Pipelines"

Stefan Grafberger, Paul Groth, Sebastian Schelter · DOI

Introduction

Developing machine learning (ML) pipelines is currently a manual, iterative "guess-and-check" process. Real-world pipelines are often brittle, with issues like mislabeled training data, typos, or poor performance on specific demographic slices going unnoticed until after deployment. While existing tools provide some debugging capabilities, they typically require developers to proactively search for specific errors. This paper proposes Shadow Pipelines: an interactive, proactive support system that functions like a "Grammarly for ML pipelines," suggesting fixes as the developer writes code.

Methodology: Shadow Pipelines

The core concept involves instrumenting a user’s Python-based ML pipeline to create hidden, automatically generated variants called Shadow Pipelines. These background processes perform four key functions:

  1. Issue Detection: Identifying mislabeled data using Shapley values or underperforming subsets via SliceLine.
  2. Root Cause Analysis: Tracing errors back to specific operators or input rows.
  3. Fix Evaluation: Automatically testing modifications, such as adding spelling correction or translation steps.
  4. Actionable Suggestions: Presenting the user with code improvements accompanied by a predicted accuracy boost.
Overview of an instrumented user pipeline with shadow pipelines detecting label errors, data slices, and data errors.

To achieve the low latency required for interactive use, the system employs Incremental View Maintenance (IVM) to compute only the necessary changes rather than re-running the entire pipeline. Additionally, Proxy Models—computationally cheaper versions of complex models—are used to rapidly estimate the impact of proposed changes.

Experimental Evaluation

The approach was evaluated using a synthetic NLP dataset of 1,000 rows designed to mimic social media posts for depression detection. This dataset allowed for controlled testing of the system's ability to detect specific errors like typos, mislabels, and non-English posts while avoiding the sensitivities of real-world clinical data.

Key Results

Preliminary experiments demonstrate that shadow pipelines are computationally feasible for real-time interaction. Key findings include:

  • Initial Run Speedup: Hardcoded optimizations reduced shadow pipeline runtime by up to 38x (and up to 55x with proxy models) compared to naive re-execution.
  • Incremental Update Efficiency: When a user modifies code (e.g., updating a regex), incremental maintenance was up to 626x faster than a full re-run.
  • Sub-Second Latency: In nearly all tested scenarios, updating the shadow pipeline took less than one second, enabling truly interactive feedback during the coding process.
Runtime performance comparison for incremental updates across different error detection scenarios, highlighting the efficiency of optimized shadow pipelines.

Discussion and Future Work

While the technical results are promising, several areas for future development remain. Currently, optimizations are manually applied; the authors aim to automate these IVM and parallelization techniques for any user-defined pipeline. Future work will also explore building the runtime on high-performance engines like DuckDB and integrating Large Language Models (LLMs) to automatically generate code for suggested fixes. Finally, user studies are needed to ensure that these proactive suggestions enhance productivity without overwhelming the developer.

Summary updated

BibTeX
@inproceedings{grafberger2024towards,
  author = {Stefan Grafberger and Paul Groth and Sebastian Schelter},
  title = {{Towards Interactively Improving ML Data Preparation Code via "Shadow Pipelines"}},
  booktitle = {DEEM@SIGMOD},
  year = {2024},
  doi = {10.1145/3650203.3663327},
}
Figure