Code Explainability via Modular Enrichment
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Automated machine learning tools generate codes that are often abstract, making it difficult for users with varying levels of expertise to understand and trust the machine learning models, as the explanations provided are limited and lack detailed articulation.
Innovation Solution
A system that enriches code generated by automated machine learning tools by transforming executable code into modular blocks, determining trigger conditions, matching them with template rules, and updating both executable and non-executable descriptions to create a tutorial-style code file that enhances explainability and usability.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If automated machine learning tools generate code, then code generation efficiency is improved, but code explainability deteriorates
Solution Approach 1:
The system segments the generated code into modular code blocks with distinct functional responsibilities. Each block is annotated with detailed descriptions explaining its purpose, inputs, outputs, and underlying machine learning concepts, making the code more explainable while maintaining generation efficiency.
Solution Approach 2:
The system introduces an intermediary enrichment process that inserts detailed non-executable descriptions, comments, and annotations between the code generation step and the user interaction step. This intermediary layer preserves the efficiency of automated generation while adding the explanatory content needed for understanding.
2Loss of information
If code is transformed into modular blocks with detailed descriptions, then code explainability is improved, but device complexity increases
Solution Approach 1:
The enrichment process is segmented into distinct stages: code block identification, trigger condition detection, template matching, and description generation. This segmentation makes the complex processing manageable and systematic, reducing the perceived complexity while improving explainability.
Solution Approach 2:
The system uses template-based automatic description generation that leverages the structure and content of the code itself to produce explanations. This self-service approach reduces the need for manual intervention and complex external resources, managing processing complexity while enhancing code explainability.
3Measurement precision
If trigger conditions are determined and matched with template rules, then code description accuracy is improved, but processing time increases
Solution Approach 1:
The system performs preliminary actions by pre-defining template rules and trigger condition patterns before the actual code enrichment process. This preparation work enables faster matching during execution, improving description accuracy without proportionally increasing processing time during the enrichment phase.
Solution Approach 2:
The system changes parameters such as template specificity and matching thresholds to optimize the balance between description accuracy and processing time. By adjusting these parameters, the system can achieve high accuracy while managing processing time effectively.
Data Source
AI summary
According to an aspect of an embodiment, operations include receiving, as an output of a code generation tool, a file that includes a computer-executable code and a non-executable description. The operations further include modifying blocks of the computer-executable code into modular code blocks and determining a set of trigger conditions from the modified computer-executable code and the non-executable description. The operations further include matching the set of trigger conditions with template conditions in a set of revision rules and determining, based on the match, a set of changes applicable to portions of the modified computer-executable code and the non-executable description. The operations further include updating the modified computer-executable code and the non-executable description based on the set of changes and generating a tutorial-style code file that includes the updated computer-executable code and the updated non-executable description.


