ML Model Data Dependency Extraction Using AST-Based Analysis
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing systems struggle to efficiently manage and track data dependencies of machine learning (ML) models, leading to performance degradation due to outdated data sources and complex, nebulous dependencies that are difficult to identify and resolve.
Innovation Solution
A method and system that utilize lexical analysis to generate tokens from a textual representation of an ML model, construct an abstract syntax tree (AST), and identify data dependencies through AST nodes, enabling detection of potential issues and alert notifications.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If traditional methods are used to manage data dependencies in ML models, then system complexity is reduced, but the ability to detect and respond to data source changes deteriorates
Solution Approach 1:
The system segments the ML model representation into discrete tokens through lexical analysis, then organizes these tokens into a hierarchical abstract syntax tree structure. This segmentation enables granular tracking of data dependencies by associating metadata with individual AST nodes, thereby improving detection capability without overwhelming system complexity.
Solution Approach 2:
The patent introduces an intermediary processing layer that generates AST representations from ML model code. This intermediary structure serves as a bridge between the raw model code and the dependency detection mechanism, enabling reliable tracking of data sources while maintaining manageable system complexity through structured intermediate representation.
2Measurement precision
If AST-based analysis is implemented to track data dependencies, then detection precision improves, but processing time increases
Solution Approach 1:
The system performs preliminary lexical analysis and AST generation during model development or deployment phases, creating a reusable dependency map before actual inference occurs. This preliminary action enables rapid dependency queries during runtime without repeatedly parsing the entire model code, thereby reducing processing time while maintaining high detection precision.
Solution Approach 2:
The patent applies local quality by generating metadata and dependency information only for specific AST nodes that are relevant to data sources, rather than processing the entire AST uniformly. This selective approach improves detection precision for critical data dependencies while minimizing unnecessary processing time for unrelated model components.
3Reliability
If comprehensive data dependency tracking is implemented, then model performance reliability improves, but system resource consumption increases
Solution Approach 1:
The system extracts only the essential data dependency information from the ML model by identifying and tracking specific AST nodes that correspond to data source references. This extraction approach maintains model performance reliability by monitoring critical data dependencies while avoiding the resource consumption associated with tracking all model components comprehensively.
4Adaptability or versatility
If language-agnostic dependency detection is implemented, then system versatility improves, but implementation complexity increases
Solution Approach 1:
The patent implements a universal AST-based representation that can accommodate multiple programming languages and ML frameworks through a common structural framework. This universal approach enables language-agnostic dependency detection by translating diverse ML model syntaxes into a standardized AST format, thereby improving versatility while managing implementation complexity through a unified processing pipeline.
Data Source
Figure 1
Figure 2
Figure 3
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.