Machine Learning Model Dependency Extraction Using AST Parsing

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing ML systems face challenges in managing and detecting complex data dependencies, such as circular and transitive dependencies, which are difficult to identify and manage efficiently, leading to model performance degradation and instability.

Innovation Solution

A method and system that utilize lexical analysis and abstract syntax trees (ASTs) to generate tokens from ML models, identify data dependencies, and transmit alert notifications for potential issues, providing a language-agnostic and performant process.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Difficulty of detecting and measuring

If traditional methods are used to manage data dependencies in ML systems, then system simplicity is maintained, but the ability to detect and manage complex data dependencies (such as circular and transitive dependencies) deteriorates

Engineering Contradiction:
Improvedata dependency detectionVSAvoiddependency management system
Core Design Contradiction:
Difficulty of detecting and measuringVSDevice complexity

Solution Approach 1:

The patent introduces an intermediary system that uses abstract syntax trees (ASTs) as a mediating representation to analyze ML model code and automatically extract data dependencies. This intermediary layer translates complex code analysis into structured dependency information without requiring direct complex management of all dependencies, thereby improving detection capability while managing system complexity through abstraction.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The patent replaces manual or simple mechanical tracking methods with automated programmatic analysis using ASTs. By substituting the mechanical approach of tracking dependencies with automated code parsing and analysis, the system achieves superior detection of complex dependencies without proportionally increasing management complexity.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

2Productivity

If manual tracking of data dependencies is used, then system complexity is low, but response time to data source changes deteriorates

Engineering Contradiction:
Improveresponse speed to data changesVSAvoiddependency management system
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The patent performs preliminary action by automatically generating and analyzing ASTs to pre-identify all data dependencies before any changes occur. This advance analysis creates a structured map of dependencies that enables rapid response to data source changes, as the system already knows what dependencies exist and can quickly assess impacts without manual tracking overhead.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system performs self-service by automatically monitoring and detecting changes in data sources through the AST analysis framework. Once dependencies are established through automated parsing, the system can autonomously detect when data sources change and assess impacts without requiring manual intervention, thereby improving response speed while keeping management complexity manageable through automation.

Inventive Principle:
Principle #25Self-service

3Reliability

If comprehensive data dependency tracking is implemented, then model reliability is improved, but system complexity increases

Engineering Contradiction:
Improvemodel performance stabilityVSAvoiddependency management system
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent segments the complex task of dependency tracking into manageable components through AST analysis. By dividing the ML model code into syntactic units represented in the AST, the system can systematically analyze each segment for data dependencies. This segmentation enables comprehensive tracking while managing complexity through structured, modular analysis of code components.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent changes the parameter representation of dependencies from opaque manual tracking to structured AST node relationships. By transforming dependency information into a standardized parameter format based on AST node connections, the system achieves comprehensive and reliable dependency tracking while managing complexity through consistent parameter representation and automated analysis.

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentUS12417346B2Method and system to extract data dependencies for machine learning models
Publication Date: 2025.09.16 MICROSOFT TECHNOLOGY LICENSING LLC
  • US12417346B2 patent drawing
  • US12417346B2 patent drawing
  • US12417346B2 patent drawing

AI summary

Example aspects include techniques for anomaly detection via sparse judgmental samples. These techniques may include generating, via lexical analysis, a plurality of tokens from a textual representation of a machine learning (ML) model and generating, via a parser, based on the plurality of tokens, an abstract syntax tree (AST) corresponding to the ML model. In addition, the techniques may include identifying a data dependency of the ML model based on an AST node within the AST, the AST node corresponding to a data source and the data dependency indicating the ML model depends on the data source. Further, the techniques may include detecting a potential issue associated with the data source, and transmitting, based on the data dependency, an alert notification in response to the potential issue.