Code Execution Trace Prediction Using Curriculum-Trained LLMs
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing methods for obtaining a code execution trace require executing the program or instrumenting it, which may not be feasible in all scenarios.
Innovation Solution
Pre-training a large language model using curriculum learning to predict code execution traces without executing the program, utilizing a unified cross-modal neural transformer model with attention and a dataset generated through mutation-based data augmentation.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If program execution or instrumentation is used to obtain code execution trace, then the trace is accurate and reliable, but the method is not feasible when program execution is not possible
Solution Approach 1:
The patent creates synthetic execution traces by copying and transforming code structures through mutation operations. Instead of executing actual programs, the system generates artificial trace data by applying mutations to code and synthesizing corresponding execution paths, enabling trace generation without program execution while maintaining structural accuracy
Solution Approach 2:
The patent introduces a code execution trace model as an intermediary between the code and the trace generation process. This model learns the mapping between code structures and execution traces through training on synthetic data, allowing it to predict traces for new code without execution, thus bridging the gap between static code analysis and dynamic execution behavior
2Measurement precision
If curriculum learning with progressive complexity is used to train the model, then the model achieves higher prediction accuracy, but the training process requires more time and computational resources
Solution Approach 1:
The patent performs preliminary actions by pre-processing code into abstract syntax trees and pre-generating mutation operations before training. The curriculum learning framework itself is a preliminary action that structures training data in advance from simple to complex cases, allowing the model to learn progressively without requiring extensive real-time computation during training
Solution Approach 2:
The patent segments the training process into distinct stages with increasing complexity (curriculum learning). The code is segmented into basic blocks and abstract syntax trees, and training data is segmented into batches of varying difficulty. This segmentation allows efficient processing at each stage while building toward higher accuracy, reducing overall training time compared to training on all complex data from the start
Data Source
AI summary
A large language model, previously pre-trained on multiple source code modeling tasks, is pre-trained, through curriculum learning, to learn to predict a code execution trace given a source code program. The model is pre-trained using a variety of pre-training datasets consisting of pairs of a source code sample and a corresponding execution trace. The curriculum pre-training starts with a pre-training dataset of single line executions and adds in additional pre-training datasets with more increasing complex behaviors. The pre-training datasets include mutation-augmented source code samples and their corresponding execution traces.


