Synthetic Labeled Data for Machine Learning Program Analysis

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Machine learning-based program analysis is imprecise due to the lack of labeled data, as source code from public repositories includes both correct and buggy code, but labels are unknown, leading to false positives and incomplete analysis, especially when code relies on external libraries or different languages.

Innovation Solution

Synthetically generated labeled data is created by using the results of non-machine learning-based program analysis to train machine learning models, where correct code is mutated to include errors, providing training data for error detection models to improve accuracy.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Extent of automation

If machine learning-based program analysis is used, then analysis coverage and automation are improved, but measurement precision and reliability deteriorate due to lack of labeled data and false positives

Engineering Contradiction:
Improveprogram analysis automationVSAvoidbug detection precision
Core Design Contradiction:
Extent of automationVSMeasurement precision

Solution Approach 1:

The system performs preliminary program analysis using traditional static analysis tools to identify potential bugs and generate candidate bug reports before training the machine learning model. These preliminary results serve as the foundation for creating synthetically labeled training data, allowing the ML model to learn from pre-processed, partially annotated information.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system uses its own program analysis results to automatically generate training data labels without requiring external manual annotation. The static analysis tool's bug detections are automatically used as ground truth labels for training the machine learning model, enabling the system to self-generate training data and improve its own performance iteratively.

Inventive Principle:
Principle #25Self-service

2Measurement precision

If traditional program analysis is used, then measurement precision is maintained through sound analysis, but adaptability deteriorates when analyzing code with external libraries or different languages

Engineering Contradiction:
Improveanalysis accuracyVSAvoidcross-language and library adaptability
Core Design Contradiction:
Measurement precisionVSAdaptability or versatility

Solution Approach 1:

The machine learning model is trained to perform multiple bug detection tasks across different programming languages and code contexts. By using synthetically generated training data that encompasses various language constructs and library usage patterns, the model learns universal bug detection patterns that generalize across different languages and external libraries, making the analysis system adaptable to diverse codebases.

Inventive Principle:
Principle #6Universality (Multi-functionality)

3Measurement precision

If synthetically generated labeled data is used for training, then measurement precision improves by reducing false positives, but device complexity increases due to the synthetic data generation pipeline

Engineering Contradiction:
Improvebug detection precisionVSAvoiddata generation system complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The system introduces an intermediary synthetic data generation layer between the traditional static analysis tool and the machine learning training process. This intermediary component automatically transforms static analysis results into structured training examples with synthetic labels, bridging the gap between traditional analysis outputs and ML training requirements without requiring complex manual data preparation pipelines.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentUS11593675B1Machine learning-based program analysis using synthetically generated labeled data
Publication Date: 2023.02.28 AMAZON TECH INC
  • US11593675B1 patent drawing
  • US11593675B1 patent drawing
  • US11593675B1 patent drawing

AI summary

Techniques for performing machine learning-based program analysis using synthetically generated labeled data are described. A method of performing machine learning-based program analysis using synthetically generated labeled data may include receiving a request to perform program analysis on code, determining a first portion of the code associated with a first error type, sending the first portion of the code to an endpoint of a machine learning service associated with an error detection model to detect the first error type, the error detection model trained using synthetically generated labeled data, and receiving inference results from the error detection model identifying one or more errors of the first error type in the first portion of the code.