ML Code Provenance Tracking via Workflow Intermediate Representation

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Machine learning models deployed in regulated environments face challenges in tracking data provenance end-to-end, which is crucial for maintaining compliance with regulations like HIPAA and GDPR, and for debugging and optimizing models due to data staleness and potential errors in model construction.

Innovation Solution

A system and method that parse machine learning model code into a workflow intermediate representation (WIR), generate provenance relationships, and semantically annotate these relationships using a knowledge base to identify data sources used for training, enabling tracking of data provenance from data sources to model predictions.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If ML models are deployed in regulated environments to improve model performance and reliability, then model accuracy and business value increase, but tracking data provenance becomes complex and difficult to maintain

Engineering Contradiction:
Improvemodel reliabilityVSAvoidprovenance tracking complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The system performs preliminary actions by instrumenting data science scripts during the development phase to automatically capture provenance information. This includes inserting tracking code that records data transformations, feature engineering steps, and model training parameters before the models are deployed, thereby establishing provenance tracking infrastructure in advance rather than attempting to reconstruct it after deployment

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system introduces an intermediary provenance tracking layer that sits between the data science scripts and the ML model deployment pipeline. This intermediary automatically captures and stores provenance information in a structured format, mediating between the complex script execution and the compliance requirements without requiring direct intervention in either domain

Inventive Principle:
Principle #24Intermediary (Mediator)

2Reliability

If comprehensive data provenance tracking is implemented to ensure compliance with regulations like HIPAA and GDPR, then regulatory compliance improves, but the system complexity and implementation overhead increase

Engineering Contradiction:
Improveregulatory complianceVSAvoidsystem complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The system enables self-service by automatically generating compliance artifacts and provenance records without requiring manual intervention from data scientists or compliance officers. The instrumentation embedded in the scripts autonomously captures all necessary provenance information and formats it for regulatory compliance, making the compliance process self-executing rather than externally managed

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The system implements feedback mechanisms that continuously monitor and record provenance information throughout the ML pipeline execution. This feedback loop captures data transformations, feature engineering operations, and model training parameters in real-time, providing ongoing verification of compliance rather than relying on periodic manual audits

Inventive Principle:
Principle #23Feedback

3Manufacturing precision

If data transformations and feature engineering operations are performed to optimize model performance, then model accuracy improves, but tracking the origin and transformations of data becomes more difficult

Engineering Contradiction:
Improvemodel accuracyVSAvoiddata origin information
Core Design Contradiction:
Manufacturing precisionVSLoss of information

Solution Approach 1:

The system applies segmentation by breaking down the ML pipeline into discrete, instrumented operations. Each data transformation and feature engineering step is captured as a separate provenance record with unique identifiers, allowing the system to track the origin and transformations of individual data elements through multiple processing stages without losing traceability

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The system creates copies of provenance information at each transformation step rather than attempting to modify the original data structures. This copying approach preserves the complete lineage of data elements while allowing transformations to proceed, ensuring that origin information is replicated and maintained throughout the processing pipeline

Inventive Principle:
Principle #26Copying

Data Source

PatentUS20230394369A1Tracking provenance in data science scripts
Publication Date: 2023.12.07 MICROSOFT TECHNOLOGY LICENSING LLC
  • US20230394369A1 patent drawing
  • US20230394369A1 patent drawing
  • US20230394369A1 patent drawing

AI summary

Embodiments described herein enable tracking machine learning (“ML”) model data provenance. In particular, a computing device is configured to accept ML model code that, when executed, instantiates and trains an ML model, to parse the ML model code into a workflow intermediate representation (WIR), to semantically annotate the WIR to provide an annotated WIR, and to identify, based on the annotated WIR and ML API corresponding to the ML model code, data from at least one data source that is relied upon by the ML model code when training the ML model. A WIR may be generated from an abstract syntax tree (AST) based on the ML model code, generating provenance relationships (PRs) based at least in part on relationships between nodes of the AST, wherein a PR comprises one or more input variables, an operation, a caller, and one or more output variables.