Language-Model Code Improvement With Execution Performance Feedback
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing code improvement processes are inefficient and require repetitive manual code rewriting, execution, and evaluation, lacking an automated and systematic approach to enhance code performance.
Innovation Solution
A code improvement device and method utilizing a language model to generate and evaluate improved code based on prompts, with an execution unit, evaluation unit, and determination unit to assess and determine the suitability of the improved code.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If manual code rewriting and evaluation are repeated, then code performance can be improved, but the process becomes inefficient and time-consuming
Solution Approach 1:
The system enables self-service by having the language model automatically generate improved code versions without requiring manual intervention. The code improvement device autonomously iterates through multiple versions, executing and evaluating each to determine the optimal performance, thereby eliminating the time-consuming manual rewriting process while maintaining code performance improvement
Solution Approach 2:
The system implements feedback mechanisms where the evaluation unit assesses the execution performance of each code version and feeds this information back to the code improvement unit. This feedback loop allows the system to learn from previous evaluations and progressively improve the code, automatically selecting versions that demonstrate superior performance without manual intervention
2Productivity
If automated code improvement is implemented, then efficiency is improved, but system complexity increases
Solution Approach 1:
The system achieves universality by using a single language model that can perform multiple functions: generating initial code, creating improved versions, and providing guidance for iterations. This multi-functional approach consolidates what would otherwise require separate specialized components, reducing overall system complexity while maintaining high productivity in code improvement
Solution Approach 2:
The language model serves as an intermediary between the code improvement device and the code generation process. Rather than requiring complex automated rewriting mechanisms, the system uses the language model as a mediator that translates improvement instructions into actual code modifications, simplifying the overall system architecture while enabling efficient automated improvement
Data Source
AI summary
A code improvement device includes a code improvement unit, an execution unit, an evaluation unit, and a determination unit. The code improvement unit improves a code of a program, to generate a post-improvement code, using a language model that improves a code of a program based on a prompt indicating an improvement content of the code of the program. The execution unit executes a process using the post-improvement code. The evaluation unit evaluates the execution performance of the code based on the execution result of the post-improvement. The determination unit determines whether to use the post-improvement code based on the evaluation result of the execution performance.


