Optimization program determination method and device based on large model and intelligent agent

By constructing a dual database of difference degree and performance indicators, the problem of population diversity decline and local optima caused by elitist strategies is solved, realizing efficient and accurate global exploration of program optimization and adapting to the optimization needs of different scenarios.

CN121349463APending Publication Date: 2026-01-16BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202511376994.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-24
Publication Date
2026-01-16

AI Technical Summary

Technical Problem

In existing technologies, elitist strategies lead to a rapid decline in population diversity, algorithms are prone to getting stuck in local optima and cannot continue exploring, and multi-objective optimization is inefficient, making it difficult to balance multiple conflicting objectives in program optimization.

Method used

A large model-based optimization procedure determination method is adopted. By constructing a first database and a second database, respectively, optimization procedures that meet the set conditions for difference degree and the target distribution characteristics for performance index are stored, ensuring coverage of population diversity and performance trade-off space. Candidate optimization procedures are generated and evaluated using a large model.

Benefits of technology

It improves the efficiency and accuracy of program optimization, enhances global exploration capabilities, and can identify target programs with better performance and adaptability in complex scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121349463A_ABST
    Figure CN121349463A_ABST
Patent Text Reader

Abstract

The invention provides an optimization program determination method and device based on a large model and an intelligent agent, and relates to the technical fields of program optimization, large models, intelligent agents, coding agents, auxiliary programming and the like. According to the specific implementation scheme, candidate optimization programs corresponding to a program to be optimized and performance indexes of the candidate optimization programs are determined; updating at least one of the first database and the second database according to the candidate optimization program and the performance index of the candidate optimization program; wherein the first database is used for storing the optimization program, the difference degree between the optimization program and the optimization program stored in the first database meets a set condition, and the second database is used for storing the optimization program, the performance index of which meets the target distribution characteristic; and determining a target optimization program corresponding to the to-be-optimized program according to the updated first database or the updated second database.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of program optimization, large model, agent, encoding agent, auxiliary programming, and the like, and in particular to a large model-based optimized program determination method and device and agent. BACKGROUND

[0002] In related technologies, program optimization is performed in combination with a large-scale pre-training model (such as a large language model) and an evolutionary algorithm to explore a large program space through an iterative "generate-evaluate-select" loop. The elite strategy is a key link to ensure the convergence of the algorithm, which ensures that the discovered high-quality individuals are not lost in subsequent iterations by retaining the best individuals in each generation.

[0003] However, because the elite strategy tends to retain individuals with the best performance but similar structures, it can lead to a rapid decline in population diversity, ultimately causing the algorithm to fall into a local optimum and fail to continue exploring. SUMMARY

[0004] The present disclosure provides a large model-based optimized program determination method and device and agent.

[0005] According to an aspect of the present disclosure, a large model-based optimized program determination method is provided, which includes determining a candidate optimized program corresponding to a to-be-optimized program and a performance indicator of the candidate optimized program; updating at least one of a first database and a second database according to the candidate optimized program and the performance indicator of the candidate optimized program; wherein the first database is used to store optimized programs whose difference degree with the optimized programs already stored in the first database meets a set condition, and the second database is used to store optimized programs whose performance indicator meets a target distribution characteristic; and determining a target optimized program corresponding to the to-be-optimized program according to the updated first database or the updated second database.

[0006] According to another aspect of the present disclosure, a large model-based optimized program determination device is provided, which includes a first determination module configured to determine a candidate optimized program corresponding to a to-be-optimized program and a performance indicator of the candidate optimized program; an update module configured to update at least one of a first database and a second database according to the candidate optimized program and the performance indicator of the candidate optimized program; wherein the first database is used to store optimized programs whose difference degree with the optimized programs already stored in the first database meets a set condition, and the second database is used to store optimized programs whose performance indicator meets a target distribution characteristic; and a second determination module configured to determine a target optimized program corresponding to the to-be-optimized program according to the updated first database or the updated second database.

[0007] According to another aspect of the present disclosure, an agent is provided, comprising: an input module configured to obtain a program to be optimized; a processing module configured to determine a target optimization program corresponding to the program to be optimized based on the large model-based optimization program determination method proposed in the present disclosure; and an output module configured to output the target optimization program.

[0008] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the large model-based optimization program determination method proposed in the present disclosure.

[0009] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, the computer instructions being configured to cause a computer to perform the large model-based optimization program determination method proposed in the present disclosure.

[0010] According to another aspect of the present disclosure, a computer program product is provided, comprising computer programs / instructions, which, when executed by a processor, implement the large model-based optimization program determination method proposed in the present disclosure.

[0011] It should be understood that the content described in this section is not intended to identify key or important features of the embodiments of the present disclosure, nor is it used to limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS

[0012] The accompanying drawings are used to better understand the present scheme, and do not limit the present disclosure. Among them:

[0013] Figure 1 A flowchart of a large model-based optimization program determination method provided by an embodiment of the present disclosure is shown;

[0014] Figure 2 A flowchart of another large model-based optimization program determination method provided by an embodiment of the present disclosure is shown;

[0015] Figure 3 A flowchart of another large model-based optimization program determination method provided by an embodiment of the present disclosure is shown;

[0016] Figure 4 A flowchart of another large model-based optimization program determination method provided by an embodiment of the present disclosure is shown;

[0017] Figure 5A structure schematic diagram of a large model-based optimization program determination device provided by an embodiment of the present disclosure is provided.

[0018] Figure 6 A structure schematic diagram of an intelligent agent is provided.

[0019] Figure 7 A schematic block diagram of an example electronic device 700 that can be used to implement embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0020] Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, which include various details of the embodiments of the present disclosure to assist in understanding, which should be considered in a descriptive sense only. Thus, it will be apparent to one of ordinary skill in the art that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Also, for the sake of brevity and clarity, descriptions of well-known functions and constructions are omitted from the following description.

[0021] In related technologies, program optimization is performed in combination with a large-scale pre-training model (such as a large language model) and an evolutionary algorithm, and a large program space is explored through an iterative "generate-evaluate-select" loop. Among them, the elite strategy is a key link to ensure the convergence of the algorithm, which ensures that the discovered high-quality individuals will not be lost in subsequent iterations by retaining the best individuals in each generation.

[0022] The elite strategy is divided into single-objective elite strategy and multi-objective elite strategy according to the number of optimization objectives.

[0023] Among them, the single-objective elite strategy calculates the fitness score (for example, the average pass rate on all test cases) of each program individual after the end of each generation evolution. Then, the top N individuals in the fitness score are saved in a separate elite library. When generating new individuals, parent individuals will be selected from this elite library with a higher probability.

[0024] The multi-objective elite strategy adopts a multi-objective evolutionary algorithm (such as NSGA-II). When facing multiple optimization objectives, the multi-objective evolutionary algorithm no longer uses a single fitness score, but stratifies the population through "non-dominated sorting", where individuals in the first layer are considered the current best and are saved in a separate elite library. In order to maintain diversity, the crowding distance of each individual in the elite library is further calculated, and when selecting parent individuals, individuals with higher (better) non-dominated levels and larger (more sparse around) crowding distances are preferred.

[0025] However, the single-objective elitist strategy tends to retain a large number of high-score programs that are similar in function but differ slightly in implementation details, resulting in a rapid decline in population diversity and ultimately trapping the algorithm in a local optimum.

[0026] Moreover, the single-objective elitist strategy cannot identify and retain "trade-off solutions". For example, a program that is extremely fast but slightly less accurate (98%) and a program that is extremely accurate (99.5%) but very slow, under the single-objective framework, only one of them can be retained, and the other valuable "trade-off solution" is discarded.

[0027] Although multi-objective evolutionary algorithms such as NSGA-II maintain the diversity of the elite pool through crowding, their selection mechanism (such as tournament selection) is still relatively blind when selecting parents from the elite pool (which may contain hundreds or even thousands of solutions) for the next iteration. It cannot actively identify and preferentially use solutions that represent "key trade-off points" (such as "inflection point solutions") or "extreme solutions" that define performance boundaries, resulting in a waste of a large amount of computational resources on repeated, minor improvements in similar areas of the elite pool.

[0028] Moreover, multi-objective evolutionary algorithms couple diversity maintenance (through crowding) and performance convergence (through non-dominated sorting) within a unified selection framework, lacking an independent and more powerful mechanism to force the algorithm to jump out of the existing exploration area and explore completely new and possibly completely different solution space areas. When the exploration area stagnates, it lacks effective means to break through.

[0029] Therefore, how to overcome the problem of rapid decline in population diversity due to the elitist strategy's tendency to retain individuals with the best performance but similar structures, ultimately trapping the algorithm in a local optimum and preventing further exploration, and how to design an efficient elitist selection mechanism in scenarios where multiple conflicting objectives of a program need to be balanced (such as correctness, efficiency, robustness, code quality, etc.), so that it can intelligently select the "most informative" parents from a vast pool of optimal solution exploration areas to guide subsequent iterations and avoid redundant and inefficient exploration in similar trade-off points is worth studying.

[0030] The present disclosure proposes a large model-based optimized program determination method, device and agent to solve the problems of population diversity decay, easy trapping in local optimum and low efficiency of multi-objective optimization in related technologies.

[0031] The large model-based optimized program determination method, device and agent of the embodiments of the present disclosure are described below with reference to the accompanying drawings.

[0032] Figure 1 A flowchart of a large model-based optimization program determination method provided by an embodiment of the present disclosure is shown.

[0033] As shown in Figure 1 The large model-based optimization program determination method can include the following steps:

[0034] Step S101, determine the candidate optimization program corresponding to the to-be-optimized program, and the performance indicators of the candidate optimization program.

[0035] It should be noted that the execution subject of the large model-based optimization program determination method in the embodiments of the present disclosure can be a hardware device with data processing capability and / or the necessary software required to drive the hardware device to work. Alternatively, the execution subject can include servers, user terminals, intelligent agents, and other intelligent devices. Alternatively, the user terminal includes but is not limited to mobile phones, computers, smart voice interaction devices, etc. Alternatively, the server includes but is not limited to a network server, an application server, and can also be a server of a distributed system, or a server combined with a blockchain, etc. The embodiments of the present disclosure are not limited specifically.

[0036] Among them, the intelligent agent refers to a computer program based on a large language model, which has the ability to plan, remember, and use tool functions, and can independently complete a given task.

[0037] Among them, the to-be-optimized program can be any program that needs to be optimized.

[0038] Among them, the candidate optimization program corresponding to the to-be-optimized program is an optimization program generated based on the to-be-optimized program, which meets one or more optimization objectives of the to-be-optimized program.

[0039] Among them, the number of to-be-optimized programs can be one or more, and the number of candidate optimization programs corresponding to any to-be-optimized program can also be one or more, which is not limited specifically here and can be set according to actual needs.

[0040] Among them, the performance indicators of the candidate optimization program are indicators for indicating the performance of the candidate optimization program.

[0041] Among them, the performance indicators may, for example, include at least one of the following: output quality, time complexity, space complexity, energy consumption, code length, logical complexity, interpretability (or can be referred to as readability), dependency, etc. Here, it is not limited specifically and can be set according to actual needs.

[0042] In some embodiments, one or more to-be-optimized programs can be determined, and for any to-be-optimized program, a large model is used to generate the candidate optimization program corresponding to the to-be-optimized program, and the performance indicators of each candidate optimization program are determined.

[0043] In step S102, at least one of the first database and the second database is updated according to the candidate optimization program and the performance indicator of the candidate optimization program.

[0044] The first database is used to store optimization programs whose difference degrees with the optimization programs already stored in the first database satisfy a set condition, and the second database is used to store optimization programs whose performance indicators satisfy a target distribution characteristic.

[0045] The difference program is a program that has a difference degree in structure, function, behavior, semantics, etc.

[0046] The set condition may include, for example, a difference degree higher than a first preset value, a difference degree within a preset interval, a ratio of a difference degree to a reference value higher than a second preset value, etc. Here, no specific limitation is made, and the set condition may be set according to actual needs.

[0047] The target distribution characteristic may include, for example, a distribution characteristic indicating an optimal solution in a single optimization target, a distribution characteristic indicating a solution in which a small sacrifice in one optimization target can bring a significant improvement in another optimization target, etc. Here, no specific limitation is made, and the target distribution characteristic may be set according to actual needs.

[0048] In this way, the first database ensures that there are diversified solutions in the population in the database by requiring that a new individual entering the database must improve the overall difference of the population in the database, thereby expanding the search space, increasing the probability of finding a global optimal solution, and enhancing the global exploration capability. The second database ensures that the database retains “representative boundary solutions” (such as “extreme solutions” defining a performance boundary, solutions representing a “key trade-off point” (such as a “turning point solution”), etc.) representing the optimal trade-off in multiple performance dimensions, thereby achieving comprehensive coverage of the performance trade-off space.

[0049] In some embodiments, the performance indicators of the optimization programs stored in the second database satisfy a target distribution characteristic in a performance indicator space, wherein the performance indicator space includes performance indicators of multiple candidate optimization programs.

[0050] In some embodiments, the candidate optimization program can be updated to at least one of the first database and the second database according to the candidate optimization program and the performance indicator of the candidate optimization program.

[0051] It should be noted that the same candidate optimization program can be updated to both the first database and the second database, or can be updated to only the first database or only the second database.

[0052] The candidate optimization program is updated to the first database on the premise that the difference between the candidate optimization program and the optimization program stored in the first database meets a set condition, and the candidate optimization program is updated to the second database on the premise that the performance index of the candidate optimization program meets a target distribution feature.

[0053] In step S103, the target optimization program corresponding to the to-be-optimized program is determined according to the updated first database or the updated second database.

[0054] In some embodiments, the target optimization program corresponding to the to-be-optimized program can be determined from the updated first database or the updated second database.

[0055] In some embodiments, in order to ensure that the finally determined target optimization program reaches a better level in performance, adaptability, etc., a plurality of rounds of iterative optimization processes can be performed according to the updated first database or the updated second database, at least one of the first database and the second database is updated in each round of iterative optimization process, and then the target optimization program is determined from the first database or the second database updated in the last round of iterative optimization process. The number of rounds of iterative optimization processes can be preset.

[0056] In some embodiments, in each round of iterative optimization process, one or more to-be-optimized programs can be selected from the updated first database or the updated second database (i.e., parent selection), a corresponding candidate optimization program is generated based on the one or more to-be-optimized programs, and at least one of the first database and the second database is updated according to the generated candidate optimization program and the performance index thereof.

[0057] The optimization program determination method based on a large model provided by the embodiments of the present disclosure ensures that there are diversified programs in the population in the database by requiring that the difference between the newly entered program and the already entered program meets a set condition, thereby enhancing the global exploration ability; the optimization program determination method based on a large model provided by the embodiments of the present disclosure ensures that the program representing the optimal trade-off in multiple performance dimensions is retained in the database by requiring that the performance index of the newly entered program meets a target distribution feature, thereby achieving comprehensive coverage of the performance trade-off space. Thus, by maintaining two functionally complementary databases in parallel, not only the efficiency and accuracy of program optimization can be improved, but also the optimization requirements in different scenarios can be adapted, and the finally determined target optimization program can reach a better level in performance, adaptability, etc.

[0058] Figure 2 A flowchart of another optimization program determination method based on a large model provided by the embodiments of the present disclosure is shown.

[0059] As Figure 2As shown, the large model-based optimization program determination method can include the following steps:

[0060] In step S201, a candidate optimization program corresponding to the to-be-optimized program is determined, and a performance indicator of the candidate optimization program is determined.

[0061] In some embodiments, a large model is used to generate a candidate optimization program corresponding to the to-be-optimized program according to a set optimization target, and a performance indicator of the candidate optimization program is determined according to a set multi-dimensional index system.

[0062] In the embodiments of the present disclosure, a large model is used to generate a candidate optimization program of the to-be-optimized program according to a set optimization target, which can quickly analyze the logical structure and performance bottleneck of the to-be-optimized program by virtue of the powerful language understanding and code generation capability of the large model, and automatically generate a multi-dimensional and high-quality candidate optimization program, thereby reducing the time for developers to write code from scratch. By constructing a multi-dimensional index system to evaluate the performance of the candidate optimization program, the performance of the candidate optimization program in multiple dimensions (such as execution efficiency, resource consumption, maintainability, etc.) can be quantified systematically.

[0063] As an example, the set multi-dimensional index system may, for example, include:

[0064] I. First Dimensional Index

[0065] The first dimensional index is used to measure the functionality and correctness of the program, including:

[0066] 1. Test Case Performance Score

[0067] The test case performance score is used to indicate the performance of the program in executing one or more test cases in at least one test case set.

[0068] Each test case set corresponds to an optimization target, and the test case performance score can be estimated by measuring the performance of the program in executing one or more test cases in at least one test case set in the corresponding optimization target.

[0069] For example, at least one test case can be divided into at least one test case set:

[0070] Basic Function Test Case Set

[0071] Boundary and Abnormal Test Case Set

[0072] Adversarial Test Case Set

[0073] The optimization target corresponding to the basic function test case set is to optimize the output performance of the program under regular / expected input.

[0074] The optimization goal corresponding to the boundary and exception test case set is to optimize the robustness of the program when processing boundaries and exceptions, such as whether the program can handle null values, maximum values, illegal inputs, etc. without throwing exceptions;

[0075] The optimization goal corresponding to the adversarial test case set is to optimize the performance of the program when facing inputs carefully designed to induce errors.

[0076] Further, the performance score of the test case can be estimated by measuring the output correctness rate of the program when executing one or more test cases in the basic function test case set;

[0077] The performance score of the test case can be estimated by measuring the normal execution rate of the program when executing one or more test cases in the boundary and exception test case set;

[0078] The performance score of the test case can be estimated by measuring the output correctness rate of the program when executing one or more test cases in the adversarial test case set.

[0079] 2. Output quality score

[0080] The output quality score is used to indicate the quality of the program output result (such as the reliability / suitability / degree of excellence of the output result, etc.). For example, in classification, regression or generation tasks, the output quality score can be accuracy, F1 score, BLEU (Bilingual Evaluation Understudy) score.

[0081] It can be understood that in the case of a program executing a non-binary (correct / incorrect) output task, more refined metrics can be introduced, such as FID score for image generation, ROUGE (Recall-Oriented Understudy for Gisting Evaluation) score for text summary, etc.

[0082] II. Second dimension index

[0083] The second dimension index is used to measure the efficiency and resource consumption of the program, including:

[0084] 1. Time complexity

[0085] For example, the time complexity can be estimated by fitting analysis of the program execution time, or by static analysis of its loop nesting structure.

[0086] 2. Space complexity

[0087] For example, the space complexity can be estimated by measuring the peak memory usage of the program during runtime.

[0088] 3. Energy consumption

[0089] For example, the energy consumption can be estimated by measuring the average power consumption of the CPU / GPU during execution on the supported hardware.

[0090] III. Third dimension indicators

[0091] The third dimension indicators are used to measure the code quality and maintainability of the program, including:

[0092] 1. Code length

[0093] For example, the code length can be estimated by the number of SLOC (Source Lines of Code) or AST (Abstract Syntax Tree Node).

[0094] The code length can be used as an indicator of the simplicity of the program.

[0095] 2. Logical complexity

[0096] For example, the logical complexity can be quantified by the number of independent paths in the program using standard software metrics such as Cyclomatic Complexity. The number of independent paths in the program reflects the difficulty of understanding and testing the program.

[0097] 3. Explainability / Readability

[0098] For example, the explainability / readability can be estimated by the scores given by static analysis tools such as code comment density and variable naming standardization.

[0099] 4. Dependency

[0100] For example, the dependency can be estimated by the number of external libraries or modules introduced by the program.

[0101] The dependency can be used as an indicator of the deployment complexity of the program.

[0102] The explanation of step S201 can be referred to the related description in any embodiment of the present disclosure, which will not be repeated here.

[0103] In step S202, according to the performance indicators of the candidate optimized program, it is determined whether the candidate optimized program meets the first indicator condition of the first database, and whether the candidate optimized program meets the second indicator condition of the second database.

[0104] In the embodiments of the present disclosure, the first database and the second database have corresponding index conditions for the optimization program to be stored, for example, the code length of the newly stored optimization program is required to be within a set interval, the time complexity, space complexity, energy consumption, and logic complexity are not higher than the corresponding set threshold, and the like.

[0105] In some embodiments, the performance indicators of the candidate optimization program can be used to determine whether the candidate optimization program meets the first index condition of the first database and whether the candidate optimization program meets the second index condition of the second database.

[0106] In step S203, in response to the candidate optimization program meeting the first index condition, the first database is updated according to the difference degree between the candidate optimization program and the stored optimization program in the first database.

[0107] The difference degree between the candidate optimization program and the stored optimization program in the first database can be quantified by a difference degree quantification index.

[0108] In some embodiments, the difference degree quantification index between the candidate optimization program and the stored optimization program in the first database can be used to determine the difference degree quantification value between the candidate optimization program and the stored optimization program in the first database. In response to the difference degree quantification value being higher than a set difference degree threshold, it is determined that the difference degree between the candidate optimization program and the stored optimization program in the first database meets a set condition. The candidate optimization program is updated to the first database.

[0109] The difference degree quantification index is a quantification index for measuring the difference between two or more programs in terms of structure, function, behavior, semantics, and the like. The specific numerical value reflects the similarity or difference between the programs.

[0110] The difference degree quantification index may, for example, include distance (such as structural distance, behavior distance, semantic distance, feature distance, and the like), similarity (such as text similarity, AST (Abstract Syntax Tree) similarity, CFG (Control Flow Graph) similarity, data flow graph similarity, and the like), and the like. The specific limitation is not made here, and can be set according to actual needs.

[0111] The structural distance may be, for example, an edit distance calculated based on a syntax representation (such as an AST, a CFG, a data flow graph, etc.) of the programs; the behavioral distance may be, for example, a distance between output results or execution traces of different programs under the same input; the semantic distance may be, for example, a distance between logical functions or abstract semantics of different programs; and the feature distance may be, for example, a distance between static features (such as code complexity (such as time complexity, space complexity, logical complexity, etc.), code metrics (such as code length, function call times, etc.), etc.) of different programs.

[0112] In the embodiments of the present disclosure, the difference degree quantification value is obtained by analyzing the difference degree quantification indicators between the candidate optimization program and the optimization programs stored in the first database, and whether the candidate optimization program is updated to the first database is determined by comparing the difference degree quantification value with the set difference degree threshold value, so that the candidate optimization program stored in the first database can improve the overall difference of the program population in the first database, and the repeated or inefficient candidate optimization program with a small difference from the optimization programs stored in the first database is avoided to be included in the first database.

[0113] In some embodiments, the difference degree quantification indicators include distances; at least one distance between the candidate optimization program and any optimization program stored in the first database can be determined; a target distance between the candidate optimization program and the optimization program is determined according to the at least one distance between the candidate optimization program and the optimization program; and the difference degree quantification value is determined according to the target distance between the candidate optimization program and the at least one optimization program stored in the first database.

[0114] The at least one distance may, for example, include the structural distance, the behavioral distance, the semantic distance, the feature distance, etc.

[0115] As an example, at least one distance between any candidate optimization program and any optimization program stored in the first database may be determined, such as a tree edit distance (measuring the minimum number of operations (insertion / deletion / replace nodes) required to convert the AST of one program into the AST of another program), a graph edit distance (quantifying the difference in program control flow or data flow through graph isomorphism or subgraph matching algorithms (such as maximum common subgraph)), a distance between output results (the distance calculated after converting the output results of two programs under the same input into vectors), etc.

[0116] The process of determining the target distance between the candidate optimization program and the optimization program according to at least one distance between the candidate optimization program and the optimization program may be, for example, determining the distance between the candidate optimization program and the optimization program as the target distance in response to the distance between the candidate optimization program and the optimization program being one kind; or performing weighted summation on the multiple distances to obtain the target distance in response to the distance between the candidate optimization program and the optimization program being multiple kinds.

[0117] In the embodiments of the present disclosure, the difference between two programs is quantified by a distance measurement method, and the target distance is determined according to at least one distance between the candidate optimization program and the optimization program, so that the difference between the programs can be comprehensively measured, and the quantified value of the difference can accurately reflect the difference between the candidate optimization program and the optimization program stored in the first database.

[0118] In some embodiments, in order to accurately and objectively measure the difference between the candidate program and the optimization program stored in the first database, the target distances between the candidate optimization program and at least one optimization program stored in the first database can be summed to obtain a first distance sum; and the quantified value of the difference is determined according to the first distance sum and the number of optimization programs stored in the first database.

[0119] The calibration in the number dimension can make the quantified value of the difference more consistent with the actual size of the first database.

[0120] In some embodiments, in one example, the process of determining the quantified value of the difference according to the first distance sum and the number of optimization programs stored in the first database may be, for example, determining the ratio between the first distance sum and the number of optimization programs stored in the first database; and determining the ratio as the quantified value of the difference.

[0121] In another example, the process of determining the quantified value of the difference according to the first distance sum and the number of optimization programs stored in the first database may be, for example, determining the ratio between the first distance sum and the number of optimization programs stored in the first database; and determining the distance change between the first database and a candidate first database, wherein the candidate first database is a database obtained by adding the candidate optimization program to the first database, the distance change is used to indicate the change between a second distance sum and a third distance sum, the second distance sum is the sum of distances between the optimization programs stored in the first database, and the third distance sum is the sum of distances between the optimization programs stored in the candidate first database; and determining the sum of the ratio and the distance change as the quantified value of the difference.

[0122] The second distance sum and can be a sum of any distance between all different pairs of optimization programs in the first database (without the candidate optimization program), or a sum of target distances between all different pairs of optimization programs in the first database (without the candidate optimization program), which is not specifically limited here and can be set according to actual needs.

[0123] Similarly, the third distance sum and can be a sum of any distance between all different pairs of optimization programs in the candidate first database (with the candidate optimization program), or a sum of target distances between all different pairs of optimization programs in the candidate first database (with the candidate optimization program), which is not specifically limited here and can be set according to actual needs.

[0124] In the embodiments of the present disclosure, the ratio between the first distance sum and the number of stored optimization programs in the first database is determined as the difference program quantification value between the candidate optimization program and the stored optimization programs in the first database, so that the difference degree quantification value not only covers the individual difference information between the candidate optimization program and the stored optimization programs in the first database, but also reflects the general level of the difference through the number average, so that the quantification of the difference degree is more comprehensive and objective.

[0125] In the embodiments of the present disclosure, the ratio between the first distance sum and the number of stored optimization programs in the first database, and the sum of the distance changes of the first database before and after the candidate optimization program is added are determined as the difference degree quantification value, which not only retains the general difference characteristics reflected by the ratio, but also includes the dynamic influence reflected by the sum of the distance changes, so that the difference degree quantification value not only covers the static individual and overall relationship, but also includes the dynamic system structure change, which is more suitable for actual application scenarios.

[0126] In some embodiments, the second distance sum and is a set value, or is obtained by summing the target distances between any two optimization programs of the plurality of stored optimization programs in the first database; and the third distance sum and is obtained by summing the target distances between any two optimization programs of the plurality of stored optimization programs in the candidate first database.

[0127] That is, the second distance sum and is a sum of target distances between all different pairs of optimization programs in the first database (without the candidate optimization program), and the third distance sum and is a sum of target distances between all different pairs of optimization programs in the candidate first database (with the candidate optimization program).

[0128] The set value can be 0, for example, and when there is only one optimization program in the first database, the second distance sum and is a set value (0).

[0129] In the embodiments of the present disclosure, the distance change quantity of the first database before and after the joining of the candidate optimization program is determined according to the sum of the target distances between all different pairs of optimization programs in the first database before and after the joining of the candidate optimization program, so that the distance change quantity can reflect the influence of the joining of the candidate optimization program on the overall structure of the first database, and further realize multi-dimensional and deep-level quantification of the difference degree.

[0130] In some embodiments, the optimization programs stored in the first database are provided with a quantity threshold; the determination process of the candidate first database may, for example, be that the candidate optimization program is added to the first database to obtain a reference first database; in response to the number of optimization programs stored in the reference first database not exceeding the quantity threshold, the reference first database is determined as the candidate first database; in response to the number of optimization programs stored in the reference first database exceeding the quantity threshold, a to-be-removed optimization program is determined according to the difference degree quantification value between any optimization program in the reference first database and at least one optimization program other than the optimization program in the reference first database; and the to-be-removed optimization program is removed from the reference first database to obtain the candidate first database.

[0131] That is, if the number of optimization programs stored in the reference first database does not exceed the quantity threshold, the reference first database is directly determined as the candidate first database; if the number of optimization programs stored in the reference first database exceeds the quantity threshold, the optimization program needs to be removed from the reference first database to obtain the candidate first database.

[0132] The determination process of the difference degree quantification value between any optimization program in the reference first database and at least one optimization program other than the optimization program in the reference first database is described above and will not be repeated here.

[0133] It should be noted that since the reference first database is fixed, there is no distance change quantity, and therefore the difference degree quantification value between any optimization program in the reference first database and at least one optimization program other than the optimization program in the reference first database can only be the ratio of the sum of the target distances between any optimization program in the reference first database and at least one optimization program other than the optimization program in the reference first database to the number of optimization programs already stored in the reference first database.

[0134] In an example, the optimization program based on a large model with the smallest difference degree quantification value in the reference first database can be determined as the to-be-removed optimization program.

[0135] In the embodiments of the present disclosure, a quantity threshold is set for the optimization programs stored in the first database, and the candidate first database is flexibly determined by checking whether the quantity of the optimization programs in the first database exceeds the quantity threshold after the candidate optimization program is added: if the quantity threshold is not exceeded, the first database is directly taken as the candidate first database; if the quantity threshold is exceeded, the corresponding program is removed according to the difference degree quantization value, which can effectively control the size of the first database and avoid the problems of management complexity and efficiency reduction caused by too many programs.

[0136] In step S204, the second database is updated according to the distribution of the plurality of candidate optimization programs satisfying the second index condition in the performance index space.

[0137] The performance index space includes the performance indexes of the plurality of candidate optimization programs satisfying the second index condition.

[0138] In some embodiments, a plurality of reference optimization programs are determined according to the performance indexes of the plurality of candidate optimization programs satisfying the second index condition; whether the plurality of reference optimization programs satisfy a target distribution characteristic is determined according to the distribution of the plurality of reference optimization programs in the performance index space; and the reference optimization program is updated to the second database in response to any reference optimization program satisfying the target distribution characteristic.

[0139] If the reference optimization program A is not inferior to the reference optimization program B in all performance indexes and strictly superior to the reference optimization program B in at least one performance index, the reference optimization program A is said to dominate the reference optimization program B, and the mutual non-domination means that the above-mentioned domination relationship is not satisfied between any two reference optimization programs.

[0140] As an example, if there are 4 reference optimizers, the performance indicators include code length, test case performance score, and the code length of reference optimizer 1 is 45, the test case performance score is 70; the code length of reference optimizer 2 is 50, the test case performance score is 80; the code length of reference optimizer 3 is 40, the test case performance score is 75; the code length of reference optimizer 4 is 35, the test case performance score is 70. Comparing reference optimizer 1 and reference optimizer 2, the test case performance score of reference optimizer 2 is higher, but the code length is also longer, so reference optimizer 1 and reference optimizer 2 are not dominated by each other, and reference optimizer 1 and reference optimizer 2 are retained; comparing reference optimizer 1 and reference optimizer 3, the test case performance score of reference optimizer 3 is higher, and the code length is also shorter, so reference optimizer 1 is dominated by reference optimizer 3, reference optimizer 1 is excluded, and reference optimizer 3 is retained; in turn, the two-by-two comparison is performed, and finally the multiple mutually non-dominated reference optimizers include reference optimizer 2, reference optimizer 3, and reference optimizer 4.

[0141] In some embodiments, the target distribution feature includes at least one of:

[0142] an extreme distribution feature, the extreme distribution feature being a distribution feature with an optimal value of any performance indicator in the performance indicator space;

[0143] a turning point distribution feature, the turning point distribution feature being a distribution feature of a target curvature of a target distribution curve or a target distribution surface in the performance indicator space, wherein the target distribution curve is a distribution curve of the plurality of reference optimizers in the performance indicator space, and the target distribution surface is a distribution surface of the plurality of reference optimizers in the performance indicator space;

[0144] a sparse distribution feature, the sparse distribution feature being a distribution feature with sparse distribution in the performance indicator space.

[0145] The target curvature can be a curvature with a local or global maximum curvature value.

[0146] The extreme distribution feature can be understood as a distribution feature of an “extreme solution”, wherein the “extreme solution” refers to a solution that is optimal in each single objective dimension. For example, a solution with the shortest running time, a solution with the highest score on a basic test case set, a solution with the shortest code length, etc.

[0147] The inflection point distribution feature can be understood as a distribution feature of an "inflection point solution", wherein the "inflection point solution" refers to a solution of a region with maximum curvature on a distribution curve or a distribution surface of the plurality of reference optimization programs in the performance index space, and the "inflection point solution" represents a "most cost-effective" trade-off point at which a small sacrifice of one target can bring a significant improvement of another target.

[0148] The sparse distribution feature can be understood as a distribution feature of a "sparse solution", wherein the "sparse solution" refers to a solution of a relatively sparse region on a distribution curve or a distribution surface of the plurality of reference optimization programs in the performance index space, and the "sparse solution" represents a unique and unusual trade-off strategy that can provide a new direction for subsequent evolution.

[0149] By explicitly defining the target distribution feature, the second database can not retain mutually non-dominated solutions as in the related art, but can filter mutually non-dominated solutions and retain only representative boundary solutions, so as to avoid redundant and inefficient exploration at similar trade-off points.

[0150] In the embodiments of the present disclosure, the mutually non-dominated reference optimization programs are determined according to the performance indicators of the candidate optimization programs that meet the second index condition, so that optimization programs with respective advantages and without one being dominated by the other can be accurately filtered out, and then the reference optimization programs that meet the target distribution feature are updated to the second database, so as to ensure that the programs in the library represent the optimal trade-off in multiple performance dimensions and achieve comprehensive coverage of the performance trade-off space.

[0151] It should be noted that steps S203 and S204 can be executed alternatively or jointly, and no limitation is made thereto.

[0152] In step S205, the target optimization program corresponding to the to-be-optimized program is determined according to the updated first database or the updated second database.

[0153] The explanation of step S205 can refer to the related description in any embodiment of the present disclosure, and will not be repeated here.

[0154] The optimization program determination method based on a large model provided in the embodiments of the present disclosure can ensure that the basic performance of the programs in the first database meets the standard, and the first database always remains simple and diverse, so as to facilitate quick retrieval of optimization programs with unique value. The second database is updated based on the distribution of a plurality of candidate optimization programs that meet the second index condition in the performance index space, so as to ensure that the basic performance of the programs in the second database meets the standard, and the distribution of the programs in the second database is more consistent with the actual performance requirement space, thereby strengthening the coverage capability of the second database for complex scenarios.

[0155] Figure 3 FIG. 1 shows a flowchart of another method for determining an optimization program based on a large model according to an embodiment of the present disclosure.

[0156] As shown in Figure 3 the method for determining an optimization program based on a large model can include the following steps:

[0157] In step S301, a candidate optimization program corresponding to the optimization program to be optimized is determined, and a performance indicator of the candidate optimization program is determined.

[0158] In step S302, at least one of the first database and the second database is updated according to the candidate optimization program and the performance indicator of the candidate optimization program.

[0159] The first database is used to store optimization programs that meet a set condition in terms of difference from optimization programs already stored in the first database, and the second database is used to store optimization programs that meet a target distribution characteristic in terms of performance indicators.

[0160] The explanations and descriptions of steps S301-S302 can be found in the relevant descriptions in any embodiment of the present disclosure, and will not be repeated here.

[0161] In step S303, a plurality of rounds of iterative optimization processes are performed according to the updated first database or the updated second database.

[0162] In each round of the iterative optimization processes, at least one of the first database and the second database corresponding to the round of the iterative optimization processes is updated.

[0163] In some embodiments, the first database corresponding to the first round of the iterative optimization processes is the updated first database, and the second database corresponding to the first round of the iterative optimization processes is the updated second database. Each round of the iterative optimization processes includes: determining, from the first database or the second database corresponding to the round of the iterative optimization processes, an optimization program to be optimized corresponding to the round of the iterative optimization processes; determining a candidate optimization program corresponding to the round of the iterative optimization processes according to the optimization program to be optimized corresponding to the round of the iterative optimization processes; determining a performance indicator of the candidate optimization program corresponding to the round of the iterative optimization processes; updating at least one of the first database and the second database corresponding to the round of the iterative optimization processes according to the candidate optimization program corresponding to the round of the iterative optimization processes and the performance indicator of the candidate optimization program corresponding to the round of the iterative optimization processes; determining a first database corresponding to a next round of the iterative optimization processes, and determining a second database corresponding to the next round of the iterative optimization processes.

[0164] In each round of iterative optimization process, the number of corresponding to-be-optimized programs determined can be one or more, and the number of corresponding candidate optimization programs determined for any to-be-optimized program can also be one or more, which is not specifically limited here and can be set according to actual needs.

[0165] In the process of determining the candidate optimization program corresponding to the current round of iterative optimization process, for example, for any to-be-optimized program corresponding to the current round of iterative optimization process, a large model can be used to generate a candidate optimization program corresponding to the to-be-optimized program according to the set optimization target, and the candidate optimization program corresponding to the to-be-optimized program is taken as the candidate optimization program corresponding to the current round of iterative optimization process.

[0166] In the process of determining the performance indicator of the candidate optimization program corresponding to the current round of iterative optimization process, for example, a multi-dimensional index system can be set to determine the performance indicator of the candidate optimization program corresponding to the current round of iterative optimization process.

[0167] The multi-dimensional index system set can refer to the related explanations in the above content, which will not be repeated here.

[0168] In each round of iteration, at least one of the first database and the second database corresponding to each round of iterative optimization process is updated, which can also refer to the related explanations in the above content, which will not be repeated here.

[0169] In the process of determining the first database corresponding to the next round of iterative optimization process and determining the second database corresponding to the next round of iterative optimization process, for example, if the first database corresponding to the current round of iterative optimization process is updated, the updated first database corresponding to the current round of iterative optimization process is determined as the first database corresponding to the next round of iterative optimization process, otherwise the first database corresponding to the current round of iterative optimization process is determined as the first database corresponding to the next round of iterative optimization process; if the second database corresponding to the current round of iterative optimization process is updated, the updated second database corresponding to the current round of iterative optimization process is determined as the second database corresponding to the next round of iterative optimization process, otherwise the second database corresponding to the current round of iterative optimization process is determined as the second database corresponding to the next round of iterative optimization process.

[0170] In the embodiments of the present disclosure, through the selection of to-be-optimized programs from the corresponding database, the generation of candidate optimization programs and the evaluation of their performance indicators in each round of iterative optimization process, optimization programs with better performance can be continuously selected, and at the same time, the knowledge and experience stored in the database can be continuously accumulated and optimized with iteration, so as to finally realize the rapid convergence and efficient improvement of program performance.

[0171] In some embodiments, in order to improve the accuracy and pertinence of the to-be-optimized program selection, enhance the target orientation, the to-be-optimized program corresponding to the current iteration optimization process can be determined according to a set selection strategy from the first database or the second database corresponding to the current iteration optimization process.

[0172] The set selection strategy includes at least one of the following:

[0173] If the to-be-optimized program has been determined from the second database for a first set number of consecutive iteration optimization processes, the to-be-optimized program is determined from the first database in the target iteration optimization process;

[0174] The to-be-optimized program is determined from the first database according to a first set probability, and the to-be-optimized program is determined from the second database according to a second set probability; wherein the second set probability is determined based on the first set probability.

[0175] If the target set is the same for a second set number of consecutive iteration optimization processes, the probability of determining the to-be-optimized program from the first database is increased, otherwise the probability of determining the to-be-optimized program from the first database is decreased; wherein the target set includes the optimization program stored in the second database corresponding to any iteration optimization process, and a plurality of mutually non-dominated reference optimization programs corresponding to any iteration optimization process determined according to the performance indicators of a plurality of candidate optimization programs meeting the second index condition corresponding to any iteration optimization process.

[0176] As an example, in the multiple iteration optimization processes, a fixed rhythm strategy can be used to determine the to-be-optimized program corresponding to each iteration optimization process from the corresponding database, for example, after determining the to-be-optimized program from the second database for 3 rounds, it is forced to determine the to-be-optimized program from the first database for 1 round; a probabilistic strategy can also be used, for example, the to-be-optimized program is determined from the first database with a first set probability p, and the to-be-optimized program is determined from the second database with a second set probability (1-p), for example, the to-be-optimized program is determined from the first database with a probability of 0.2, and the to-be-optimized program is determined from the second database with a probability of 0.8; an adaptive adjustment strategy can also be used to determine the to-be-optimized program, for example, if the target set (composed of the optimization program stored in the second database corresponding to any iteration optimization process, and a plurality of mutually non-dominated reference optimization programs corresponding to any iteration optimization process determined by any iteration optimization process) does not change for N consecutive rounds (i.e. stagnation), the probability of determining the to-be-optimized program from the first database is increased, and new diversity is introduced to break the deadlock. Conversely, if the target set is rapidly expanding, the probability of determining the to-be-optimized program from the first database is reduced, and the current exploration area is further mined.

[0177] In the embodiments of the present disclosure, different setting selection strategies are flexibly selected in the multi-round iterative optimization process, which can make the determination of the to-be-optimized program more suitable for the iteration requirements. The strategy of continuously selecting from the second database and then forcibly selecting from the first database can avoid the solidification of the optimization direction caused by long-term reliance on a single database, and balance exploration and deep cultivation. The strategy of selecting sources according to a set probability can flexibly regulate the utilization proportion of different databases according to actual needs, and balance stability and diversity. The strategy of dynamically adjusting the selection probability of the first database according to the changes of the target set can inject new vitality by increasing the selection probability of the first database when the target set is stagnant to break the deadlock, and reduce the probability when the target set is dynamically changing to cultivate the current area, thereby realizing adaptive regulation of the optimization process.

[0178] In some embodiments, the process of determining the to-be-optimized program from the second database may, for example, be as follows: de-duplicating the plurality of optimization programs stored in the second database, so as to retain any one of the plurality of optimization programs implementing the same function for the plurality of optimization programs implementing the same function; determining the crowding distance of any two adjacent optimization programs for the plurality of de-duplicated optimization programs, so as to stratify the plurality of de-duplicated optimization programs based on the crowding distance, to obtain a plurality of strata and the optimization programs corresponding to any stratum; and determining a target stratum from the plurality of strata, so as to determine the to-be-optimized program from the optimization programs corresponding to the target stratum.

[0179] As an example, functional hash calculation can be performed on all optimization programs stored in the second database, and programs with the same function are regarded as a logical entity to avoid repeated sampling. For the plurality of de-duplicated optimization programs, the crowding distance algorithm similar to that in NSGA-II is used to calculate the crowding distance. Optimization programs with high crowding distance represent that the region where they are located is very crowded, while optimization programs with low crowding distance represent that they are in a sparse region. According to the crowding distance value, the plurality of de-duplicated optimization programs are divided into three or more levels of high, medium and low.

[0180] In the embodiments of the present disclosure, by de-duplicating the plurality of optimization programs stored in the second database, redundant programs with the same function can be effectively eliminated, repeated processing of the same function program can be avoided, and processing efficiency can be improved. Then, the crowding distance of adjacent optimization programs after de-duplication is calculated and stratified, and the to-be-optimized program is determined from the target stratum, which can ensure that the finally determined to-be-optimized program is representative and meets the actual optimization requirements.

[0181] In some embodiments, according to the crowding degree indicated by the plurality of strata, a first set number of strata with low crowding degree are determined as target strata; and according to the selection frequency of the at least one optimization program corresponding to the target stratum, a second set number of optimization programs based on the large model with low selection frequency are determined as the to-be-optimized program.

[0182] Among them, the first set number of hierarchical layers with low congestion degree are determined as target hierarchical layers, the focus can be focused on the group with more sparse distribution and more significant differentiation, the second set number of optimization programs with low selection frequency in the target hierarchical layer are determined as optimization programs to be optimized, and the programs that are ignored but may have optimization value can be targetedly mined, and the coverage of program optimization is improved.

[0183] In some embodiments, in order to avoid ignoring other programs that may be more valuable or more in need of optimization due to over-optimizing some programs, ensure the balance and rationality of program optimization, if the frequency of any optimization program being determined as an optimization program to be optimized exceeds the set frequency threshold, the selection probability of the optimization program is reduced.

[0184] Step S304, determining the target optimization program from the candidate optimization programs stored in the first database or the second database corresponding to the last round of iterative optimization process.

[0185] The method for determining optimization programs based on large models provided by the embodiments of the present disclosure performs multiple rounds of iterative optimization processes based on the updated first database or second database, and at least one of the corresponding first database and second database is updated in each round of iterative optimization process, which can allow the optimization process to be continuously adjusted and deepened based on new information and data, and gradually generate candidate optimization programs that are more in line with actual needs, thereby improving the depth and breadth of optimization. The target optimization program is determined from the candidate optimization programs stored in the database corresponding to the last round of iterative optimization process, which can ensure that the selected program is the optimal choice after comprehensive and deep optimization, thereby improving the accuracy and reliability of the optimization result.

[0186] Figure 4 Another flowchart of the method for determining optimization programs based on large models provided by the embodiments of the present disclosure.

[0187] As shown in Figure 4 The method for determining optimization programs based on large models can include the following steps:

[0188] Step S401, determining optimization programs to be optimized.

[0189] The number of optimization programs to be optimized can be one or more.

[0190] Step S402, determining candidate optimization programs corresponding to the optimization programs to be optimized.

[0191] For any optimization program to be optimized, a large model can be used to generate at least one candidate optimization program corresponding to the optimization program to be optimized according to a set optimization target.

[0192] Step S403, determining the performance indicators of the candidate optimization programs.

[0193] In order to better achieve multi-objective optimization, a multi-dimensional index system can be set, and the performance index of each candidate optimization program is determined according to the set multi-dimensional index system.

[0194] The set multi-dimensional index system can refer to the related explanations of the above content, and will not be repeated here.

[0195] Step S404, updating at least one of the first database and the second database.

[0196] The first database is used to store the optimization program whose difference degree with the stored optimization program in the first database meets the set condition, and the second database is used to store the optimization program whose performance index meets the target distribution characteristics.

[0197] In some embodiments, for any candidate optimization program, first, according to the performance index of the candidate optimization program, it is determined whether the candidate optimization program meets the first index condition of the first database, and if it meets, the first database is updated according to the difference degree between the candidate optimization program and the stored optimization program in the first database.

[0198] The difference degree between the candidate optimization program and the stored optimization program in the first database can be quantified by a quantitative index, and the difference degree quantitative value between the candidate optimization program and the stored optimization program in the first database is determined; in response to the difference degree quantitative value being higher than the set difference degree threshold, it is determined that the difference degree between the candidate optimization program and the stored optimization program in the first database meets the set condition; the candidate optimization program is updated to the first database.

[0199] The difference degree quantitative index includes distance, at least one distance between the candidate optimization program and any optimization program stored in the first database can be determined; according to the at least one distance between the candidate optimization program and the optimization program, the target distance between the candidate optimization program and the optimization program is determined; according to the target distance between the candidate optimization program and at least one optimization program stored in the first database, the difference degree quantitative value is determined.

[0200] As an example, the first database adopts the "diversity gain access" rule, which forces new individuals to be able to improve the overall diversity of the population in the library to ensure global exploration ability.

[0201] To comprehensively measure the "difference" between the programs, a weighted combination of one or more distance measurement methods can be used to determine the target distance between the programs. Further, when a candidate optimization program P cand is to be updated to the first database, if the optimization programs stored in the first database include P 1, P 2,..., P n, the difference degree quantification value can be the diversity gain ΔD, and the calculation formula of the diversity gain ΔD is as follows:

[0202] ΔD = (Σ i = 1 to n dist (P cand, P i) ) / n.

[0203] Wherein, the diversity gain ΔD can be understood as the average distance between the new individual and all individuals in the library.

[0204] Wherein, the calculation of the diversity gain ΔD can also add the distance change of the first database before and after P cand is stored in the library, that is, the change between the sum of distances between all different individuals in the first database before P cand is stored in the library and the sum of distances between all different individuals in the first database after P cand is stored in the library.

[0205] Only when ΔD is greater than a preset threshold (for example, 0), the candidate optimization program P cand is allowed to be updated to the first database.

[0206] In some embodiments, for any candidate optimization program, according to the performance index of the candidate optimization program, it is determined whether the candidate optimization program meets the second index condition of the second database, and if so, the second database is updated according to the distribution of a plurality of candidate optimization programs meeting the second index condition in the performance index space, wherein the performance index space includes the performance index of a plurality of candidate optimization programs meeting the second index condition.

[0207] Wherein, according to the performance index of a plurality of candidate optimization programs meeting the second index condition, a plurality of mutually non-dominated reference optimization programs can be determined; according to the distribution of a plurality of reference optimization programs in the performance index space, it is determined whether the plurality of reference optimization programs meet the target distribution characteristic; in response to any reference optimization program meeting the target distribution characteristic, the reference optimization program is updated to the second database.

[0208] Wherein, the target distribution characteristic includes at least one of the following:

[0209] Extreme distribution characteristic, the extreme distribution characteristic is a distribution characteristic in which any performance index in the performance index space takes the optimal value;

[0210] Inflection point distribution characteristics are the distribution characteristics of the target curvature of the target distribution curve or target distribution surface in the performance index space. The target distribution curve is the distribution curve of multiple reference optimization programs in the performance index space, and the target distribution surface is the distribution surface of multiple reference optimization programs in the performance index space.

[0211] Sparse distribution characteristics refer to the sparse distribution characteristics in the performance index space.

[0212] As an example, the second database preserves "representative boundary solutions" that represent the optimal trade-offs across multiple performance dimensions.

[0213] The goal of the second database is to maintain a high-quality, high-information-density set of optimization programs. After identifying several non-dominant reference optimization programs based on their performance metrics that satisfy the second criterion, a screening process is performed based on whether the reference optimization programs satisfy the target distribution characteristics, retaining only the "representative boundary solutions." These "representative boundary solutions" include:

[0214] "Extreme solution": The solution that performs best in every single objective dimension. For example, the solution with the shortest running time, the solution with the highest score on the basic use case set, the solution with the shortest code length, etc.

[0215] "Inflection point solution": The solution with the maximum curvature in the distribution curve or distribution surface of multiple reference optimization programs in the performance index space. The "inflection point solution" represents the "most cost-effective" trade-off point where a small sacrifice of one objective can be exchanged for a significant improvement in another objective.

[0216] "Sparse solution": A solution that is distributed in a relatively sparse region on the distribution curves or surfaces of multiple reference optimization programs in the performance index space. "Sparse solution" represents a unique and unusual trade-off strategy that can provide new directions for subsequent evolution.

[0217] like Figure 4 As shown, after updating at least one of the first database and the second database, the program to be optimized can be re-determined from the updated first database or the second database, and the above process can be repeated.

[0218] In some embodiments, multiple rounds of iterative optimization processes can be performed based on the updated first database or second database; wherein, in each round of iterative optimization, at least one of the first database and the second database corresponding to each round of iterative optimization is updated; and the target optimization program is determined from the candidate optimization programs stored in the first database or the second database corresponding to the last round of iterative optimization.

[0219] Wherein, when determining the to-be-optimized program from the second database, a method of hierarchical de-duplication and repetition suppression sampling is adopted for sampling:

[0220] Hierarchical de-duplication: firstly, functional hash calculation is performed on all the stored optimization programs in the second database, and programs with the same function are regarded as a logical entity to avoid repeated sampling, and then, for the plurality of optimization programs after de-duplication, a crowded distance algorithm similar to that in NSGA-II is adopted to calculate the crowded distance. The optimization program with high crowded distance indicates that the region where it is located is very crowded, and the optimization program with low crowded distance represents that it is in a sparse region. According to the crowded distance value, the plurality of optimization programs after de-duplication are divided into three or more levels of high, medium and low.

[0221] Repetition suppression sampling: a recent sampling history record is maintained. When sampling (such as using tournament selection method), in addition to considering the non-dominated level and crowded level, a "cooling penalty" is also applied to the solutions that are frequently selected recently, and the probability of being selected is dynamically reduced. Sampling will preferentially select individuals that have not been used recently from the solutions in the "high crowded level" (the sparsest).

[0222] Therefore, when determining the to-be-optimized program from the second database, the method of hierarchical de-duplication and repetition suppression sampling is adopted to preferentially select solutions that are located in sparse regions and have not been frequently used recently, which can ensure the depth and efficiency of convergence.

[0223] Wherein, how to determine when to "explore" (determine the to-be-optimized program from the first database) and when to "utilize" (determine the to-be-optimized program from the second database) is a key point, and the following strategies can be adopted:

[0224] Fixed rhythm strategy: for example, after performing 3 rounds of "utilization" type iterations from the second database, 1 round of "exploration" type iterations from the first database is forced to be performed;

[0225] Probabilistic strategy: determine the to-be-optimized program from the first database with a first set probability p, and determine the to-be-optimized program from the second database with a second set probability (1-p);

[0226] Adaptive adjustment strategy: for example, if the target set (consisting of the optimization programs stored in the second database corresponding to any round of iteration optimization process, and the plurality of mutually non-dominated reference optimization programs determined by any round of iteration optimization process corresponding to any round of iteration optimization process) does not change for N consecutive rounds (i.e. stagnation), the probability of determining the to-be-optimized program from the first database is increased to introduce new diversity to break the situation. On the contrary, if the target set is expanding rapidly, the probability of determining the to-be-optimized program from the first database is reduced to further explore the current exploration region.

[0227] The optimization procedure determination method based on a large model provided in this disclosure maintains two complementary databases in parallel: the first database employs a "diversity gain admission" rule, forcing new individuals to enhance the overall diversity of the population within the database to ensure global exploration capability; the second database retains "representative boundary solutions" that represent optimal trade-offs across multiple performance dimensions. During multi-round iterations, when determining the procedure to be optimized, a selection is made from either database according to a preset strategy (such as fixed rhythm, probability, or adaptive adjustment). Specifically, when selecting from the second database, a hierarchical deduplication and repetition suppression sampling method is used, prioritizing solutions located in sparse regions and not frequently used recently, ensuring convergence depth and efficiency. Thus, by dynamically switching between the two strategies of diversity exploration and performance convergence, the efficiency of the automatic generation of complex procedures and the overall quality of the final solution are improved.

[0228] The optimization procedure determination method based on a large model provided in this disclosure can be applied to:

[0229] Automated software engineering and AI (Artificial Intelligence) assisted programming platforms: used to automatically generate, repair, or optimize complex code snippets, functions, or entire programs that meet multiple constraints (such as performance, security, and maintainability).

[0230] Algorithm model automatic design systems (such as AutoML (Automated Machine Learning)) are used to automatically search for and optimize machine learning models, deep learning network architectures, or data processing flows, while balancing multiple key indicators such as model accuracy, inference speed, and memory usage.

[0231] Automated test case generation tool: Generates test cases that can cover code boundaries, exception paths, and adversarial scenarios through evolution, while optimizing the simplicity and execution efficiency of test cases.

[0232] For example, in the automatic optimization scenario of core algorithms in high-performance computing libraries, for tasks such as matrix calculation and numerical optimization, developers can input part of the program into the IDE (Integrated Development Environment) and explore better numerical algorithms and improve computational efficiency through the optimization program determination method based on a large model provided in this disclosure embodiment.

[0233] For example, in the context of automated design and compression of deep learning models, for image recognition, speech recognition, and other tasks, a large model automatically generates a large number of different model architectures by modifying the number of layers, convolution kernel size, activation function, connection mode, and the like of the network model. The first database and / or the second database retains those models with very unique architectures and outstanding performance in certain aspects. Finally, the model that best meets the hardware budget and performance requirements is selected for deployment. This process does not require a large amount of manpower for manual model design, pruning, and quantization.

[0234] Compared with the competitive solutions in the related art that rely on large models to directly generate code or use traditional evolutionary algorithms, the method for determining an optimization program based on a large model provided by the embodiments of the present disclosure can bring the following advantages through its unique double-database collaborative mechanism:

[0235] I. Multi-dimensional deep optimization

[0236] The related art often stops at generating functionally correct code, while the double database and the extensible multi-dimensional index system of the present disclosure can simultaneously optimize the speed, memory occupancy, robustness, and even the code conciseness of the program, and other key indicators;

[0237] II. Accelerate the discovery efficiency of optimal solutions and shorten the algorithm iteration period

[0238] The related art often performs a large number of blind or redundant explorations during optimization. The present disclosure can intelligently identify and focus on the area with the largest amount of information and the most sparseness for exploration by using the hierarchical deduplication and repetition suppression sampling method in the second database. This efficient utilization strategy reduces invalid iterations on similar solutions and accelerates the convergence speed of the optimal solution set;

[0239] III. Avoid homogenization trap

[0240] The solution of the related art that relies on a single performance indicator is prone to fall into a local optimum, resulting in serious homogenization of the output results. The first database of the present disclosure uses the "diversity gain access" rule to ensure that it can break free from the constraints of conventional ideas and explore solutions with novel structures and unique logic;

[0241] IV. Establish an adaptive closed loop of exploration and utilization to realize continuous self-evolution

[0242] The optimization program selection strategy of the present disclosure, such as the adaptive adjustment strategy, can monitor the optimization process in real time, such as whether the second database is stagnant, and dynamically adjust the policy focus, such as increasing the probability of determining the optimization program from the first database when the second database is stagnant to break through, and decreasing the probability of determining the optimization program from the first database when the second database has made a breakthrough to further explore.

[0243] Figure 5A structural schematic diagram of a large model-based optimization program determination apparatus provided by an embodiment of the present disclosure.

[0244] As shown in Figure 5 The large model-based optimization program determination apparatus 500 of the present embodiment includes a first determination module 501, an update module 502, and a second determination module 703.

[0245] The first determination module 501 is configured to determine a candidate optimization program corresponding to the to-be-optimized program, and a performance indicator of the candidate optimization program.

[0246] The update module 502 is configured to update at least one of a first database and a second database according to the candidate optimization program and the performance indicator of the candidate optimization program, wherein the first database is configured to store optimization programs whose difference degrees from optimization programs already stored in the first database satisfy a set condition, and the second database is configured to store optimization programs whose performance indicators satisfy a target distribution characteristic.

[0247] The second determination module 503 is configured to determine a target optimization program corresponding to the to-be-optimized program according to the updated first database or the updated second database.

[0248] In an embodiment of the present disclosure, the update module 502 includes a first determination unit configured to determine whether the candidate optimization program satisfies a first indicator condition of the first database and whether the candidate optimization program satisfies a second indicator condition of the second database according to the performance indicator of the candidate optimization program, an update unit configured to update the first database according to a difference degree between the candidate optimization program and optimization programs already stored in the first database in response to the candidate optimization program satisfying the first indicator condition, and / or update the second database according to a distribution of a plurality of candidate optimization programs satisfying the second indicator condition in a performance indicator space, wherein the performance indicator space includes performance indicators of the plurality of candidate optimization programs satisfying the second indicator condition.

[0249] In an embodiment of the present disclosure, the update unit is further configured to determine a difference degree quantization value between the candidate optimization program and the optimization programs already stored in the first database according to a difference degree quantization indicator between the candidate optimization program and the optimization programs already stored in the first database, determine that the difference degree between the candidate optimization program and the optimization programs already stored in the first database satisfies the set condition in response to the difference degree quantization value being higher than a set difference degree threshold, and update the candidate optimization program to the first database.

[0250] In an embodiment of the present disclosure, the difference degree quantification index comprises a distance; the updating unit is further configured to: determine at least one distance between the candidate optimization program and any optimization program stored in the first database; determine a target distance between the candidate optimization program and the optimization program according to the at least one distance between the candidate optimization program and the optimization program; and determine the difference degree quantification value according to the target distance between the candidate optimization program and the at least one optimization program stored in the first database.

[0251] In an embodiment of the present disclosure, the updating unit is further configured to: sum the target distances between the candidate optimization program and the at least one optimization program stored in the first database to obtain a first distance sum; and determine the difference degree quantification value according to the first distance sum and a number of the optimization programs stored in the first database.

[0252] In an embodiment of the present disclosure, the updating unit is further configured to: determine a ratio between the first distance sum and the number of the optimization programs stored in the first database; and determine the ratio as the difference degree quantification value.

[0253] In an embodiment of the present disclosure, the updating unit is further configured to: determine a ratio between the first distance sum and the number of the optimization programs stored in the first database; determine a distance variation between the first database and a candidate first database, the candidate first database being a database obtained by adding the candidate optimization program to the first database, the distance variation being used to indicate a variation between a second distance sum and a third distance sum, the second distance sum being a sum of distances between the optimization programs stored in the first database, and the third distance sum being a sum of distances between the optimization programs stored in the candidate first database; and determine a sum of the ratio and the distance variation as the difference degree quantification value.

[0254] In an embodiment of the present disclosure, the second distance sum is a set value, or is obtained by summing the target distances between any two optimization programs of the plurality of optimization programs stored in the first database; and the third distance sum is obtained by summing the target distances between any two optimization programs of the plurality of optimization programs stored in the candidate first database.

[0255] In an embodiment of the present disclosure, the optimization programs stored in the first database are provided with a quantity threshold; the device comprises: a processing module configured to add the candidate optimization program to the first database to obtain a reference first database; a third determination module configured to determine the reference first database as the candidate first database in response to the quantity of the optimization programs stored in the reference first database not exceeding the quantity threshold; a fourth determination module configured to determine the to-be-removed optimization program according to the difference degree quantification value between any optimization program in the reference first database and at least one optimization program other than the optimization program in the reference first database in response to the quantity of the optimization programs stored in the reference first database exceeding the quantity threshold; and a removal module configured to remove the to-be-removed optimization program from the reference first database to obtain the candidate first database.

[0256] In an embodiment of the present disclosure, the updating unit is further configured to: determine a plurality of reference optimization programs that are mutually incommensurable according to the performance indicators of the plurality of candidate optimization programs that satisfy the second index condition; determine whether the plurality of reference optimization programs satisfy a target distribution characteristic according to the distribution of the plurality of reference optimization programs in the performance indicator space; and update the reference optimization program to the second database in response to any reference optimization program satisfying the target distribution characteristic.

[0257] In an embodiment of the present disclosure, the target distribution characteristic comprises at least one of the following: an extreme distribution characteristic, the extreme distribution characteristic being a distribution characteristic in which any performance indicator in the performance indicator space has an optimal value; a turning point distribution characteristic, the turning point distribution characteristic being a distribution characteristic in which a target curvature of a target distribution curve or a target distribution surface in the performance indicator space, wherein the target distribution curve is a distribution curve of the plurality of reference optimization programs in the performance indicator space, and the target distribution surface is a distribution surface of the plurality of reference optimization programs in the performance indicator space; and a sparse distribution characteristic, the sparse distribution characteristic being a distribution characteristic in which the distribution in the performance indicator space is sparse.

[0258] In an embodiment of the present disclosure, the second determination module 503 comprises: a processing unit configured to execute a plurality of rounds of iterative optimization processes according to the updated first database or the updated second database; wherein at least one of the first database and the second database corresponding to each round of iterative optimization process is updated in each round of iterative optimization process; and a second determination unit configured to determine the target optimization program from the candidate optimization programs stored in the first database or the second database corresponding to the last round of iterative optimization process.

[0259] In an embodiment of the present disclosure, the first database corresponding to the first round of iterative optimization process is the updated first database, and the second database corresponding to the first round of iterative optimization process is the updated second database; the processing unit is further configured to: determine the to-be-optimized program corresponding to the current round of iterative optimization process from the first database or the second database corresponding to the current round of iterative optimization process; determine the candidate optimization program corresponding to the current round of iterative optimization process according to the to-be-optimized program corresponding to the current round of iterative optimization process; determine the performance indicator of the candidate optimization program corresponding to the current round of iterative optimization process; update at least one of the first database and the second database corresponding to the current round of iterative optimization process according to the candidate optimization program corresponding to the current round of iterative optimization process and the performance indicator of the candidate optimization program corresponding to the current round of iterative optimization process; determine the first database corresponding to the next round of iterative optimization process, and determine the second database corresponding to the next round of iterative optimization process.

[0260] In an embodiment of the present disclosure, the processing unit is further configured to: determine the to-be-optimized program corresponding to the current round of iterative optimization process from the first database or the second database corresponding to the current round of iterative optimization process according to a set selection strategy.

[0261] In an embodiment of the present disclosure, the set selection strategy comprises at least one of the following: if the to-be-optimized program has been determined from the second database for a first set number of consecutive rounds before a target round of iterative optimization process, the to-be-optimized program is determined from the first database in the target round of iterative optimization process; the to-be-optimized program is determined from the first database according to a first set probability, and the to-be-optimized program is determined from the second database according to a second set probability; wherein the second set probability is determined based on the first set probability; if the target set is the same for a second set number of consecutive rounds before any round of iterative optimization process, the probability of determining the to-be-optimized program from the first database is increased, otherwise the probability of determining the to-be-optimized program from the first database is decreased; wherein the target set comprises the optimization programs stored in the second database corresponding to any round of iterative optimization process, and a plurality of mutually non-dominated reference optimization programs corresponding to any round of iterative optimization process determined according to the performance indicators of a plurality of candidate optimization programs satisfying the second indicator condition corresponding to any round of iterative optimization process.

[0262] In an embodiment of the present disclosure, the processing unit is further configured to: deduplicate the plurality of optimization programs stored in the second database to retain any one of the plurality of optimization programs implementing the same function for the plurality of optimization programs implementing the same function; determine the crowding distance between any two adjacent optimization programs for the plurality of deduplicated optimization programs to stratify the plurality of deduplicated optimization programs based on the crowding distance to obtain a plurality of strata and the optimization programs corresponding to any stratum; and determine the to-be-optimized program from the optimization programs corresponding to the target stratum.

[0263] In one embodiment of this disclosure, the processing unit is further configured to: determine a first set number of layers with low congestion as target layers based on the congestion levels indicated by the multiple layers; and determine a second set number of optimization programs based on a large model with low selection frequencies as programs to be optimized based on the selection frequency of at least one optimization program corresponding to the target layer.

[0264] In one embodiment of this disclosure, if the frequency at which any optimization program is identified as a program to be optimized exceeds a set frequency threshold, the selection probability of the optimization program is reduced.

[0265] In one embodiment of this disclosure, the first determining module 501 is further configured to: use a large model to generate candidate optimization programs corresponding to the program to be optimized according to the set optimization objectives; and determine the performance indicators of the candidate optimization programs according to the set multi-dimensional indicator system.

[0266] The large-model-based optimization program determination device provided in this disclosure has two databases. The first database requires that the degree of difference between newly added programs and existing programs meets set conditions, ensuring that there are always diverse programs in the database population and enhancing global exploration capabilities. The second database requires that the performance indicators of newly added programs meet the target distribution characteristics, ensuring that programs representing optimal trade-offs in multiple performance dimensions are retained in the database, achieving comprehensive coverage of the performance trade-off space. Thus, by maintaining two complementary databases in parallel, not only can the efficiency and accuracy of program optimization be improved, but it can also adapt to the optimization needs in different scenarios, ensuring that the finally determined target optimization program achieves a better level in terms of performance and adaptability.

[0267] Figure 6 This is a schematic diagram of the structure of an intelligent agent provided in an embodiment of this disclosure.

[0268] like Figure 6 As shown, the intelligent agent 600 of this embodiment includes an input module 601, a processing module 602, and an output module 603.

[0269] The input module 601 is used to obtain the program to be optimized.

[0270] The processing module 602 is used to determine the target optimization program corresponding to the program to be optimized based on the large model-based optimization program determination method described above.

[0271] Output module 603 is used to output the target optimization program.

[0272] The acquisition, storage, and application of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0273] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0274] Figure 7 A schematic block diagram of an example electronic device 700 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0275] like Figure 7 As shown, device 700 includes a computing unit 701, which can perform various appropriate actions and processes based on computer programs / instructions stored in read-only memory (ROM) 702 or loaded from storage unit 706 into random access memory (RAM) 703. RAM 703 may also store various programs and data required for the operation of device 700. The computing unit 701, ROM 702, and RAM 703 are interconnected via bus 704. Input / output (I / O) interface 705 is also connected to bus 704.

[0276] Multiple components in device 700 are connected to I / O interface 705, including: input units 706 such as keyboard, mouse, etc.; output units 707 such as various types of displays, speakers, etc.; storage units 708 such as disks, optical disks, etc.; and communication units 709 such as network cards, modems, wireless transceivers, etc. Communication unit 709 allows device 700 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0277] The computing unit 701 can be various general and / or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 701 performs various methods and processes described above, such as the large model based optimization procedure determination method or. For example, in some embodiments, the large model based optimization procedure determination method or can be implemented as a computer software program tangibly embodied in a machine readable medium, such as the storage unit 706. In some embodiments, part or all of the computer program / instructions can be loaded and / or installed onto the device 700 via the ROM 702 and / or the communication unit 709. When the computer program / instructions are loaded into the RAM 703 and executed by the computing unit 701, one or more steps of the large model based optimization procedure determination method described above can be performed. Alternatively, in other embodiments, the computing unit 701 can be configured to perform the large model based optimization procedure determination method or by any other suitable means, such as by means of firmware.

[0278] Various implementations of the systems and techniques described above can be realized in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a programmable logic device (PLD), a computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.

[0279] Program code for carrying out methods of the present disclosure can be written in any combination of one or more programming languages. The program code can be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the program code, when executed by the processor or controller, produces a means for implementing the functions / acts specified in the flowcharts and / or block diagrams. The program code can be executed entirely on a machine, partially on a machine, partially on a machine as a stand-alone software package, partially on a machine and partially on a remote machine or entirely on a remote machine or server.

[0280] In the context of this disclosure, a machine-readable medium can be a tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include but is not limited to an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of the machine-readable storage medium would include a linearly-programmed electrical connection, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0281] To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the computer. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.

[0282] The systems and techniques described here can be implemented in a computing system that includes a back end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front end component (e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), the Internet, and a blockchain network.

[0283] The computer system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, a server of a distributed system, or a server combined with a blockchain.

[0284] It should be understood that the various forms of flow shown above can be re-ordered, added to, or have steps deleted, using the steps disclosed in the present disclosure. For example, the steps disclosed in the present disclosure can be performed in parallel, in series, or in a different order, as long as the desired results of the technical solutions disclosed in the present disclosure are achieved, and the present disclosure is not limited herein.

[0285] The above detailed description does not constitute a limitation on the protection scope of the present disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent replacements, and improvements made within the spirit and principles of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A method for determining an optimization program based on a large model, the method comprising: determining a candidate optimization program corresponding to a to-be-optimized program, and a performance indicator of the candidate optimization program; updating at least one of a first database and a second database according to the candidate optimization program and the performance indicator of the candidate optimization program, wherein the first database is used to store optimization programs that satisfy a set condition in terms of a difference degree between the optimization programs and optimization programs already stored in the first database, and the second database is used to store optimization programs that satisfy a target distribution characteristic in terms of performance indicators; determining a target optimization program corresponding to the to-be-optimized program according to the updated first database or the updated second database.

2. The method of claim 1, wherein, The updating at least one of the first database and the second database according to the candidate optimization program and the performance indicator of the candidate optimization program comprises: determining whether the candidate optimization program satisfies a first indicator condition of the first database and whether the candidate optimization program satisfies a second indicator condition of the second database according to the performance indicator of the candidate optimization program; updating the first database according to a difference degree between the candidate optimization program and optimization programs already stored in the first database in response to the candidate optimization program satisfying the first indicator condition; and / or updating the second database according to a distribution of a plurality of candidate optimization programs that satisfy the second indicator condition in a performance indicator space, wherein the performance indicator space includes performance indicators of the plurality of candidate optimization programs that satisfy the second indicator condition. The updating the first database according to the difference degree between the candidate optimization program and the optimization programs already stored in the first database comprises:

3. The method of claim 2, wherein, determining a difference degree quantification value between the candidate optimization program and the optimization programs already stored in the first database according to a difference degree quantification indicator between the candidate optimization program and the optimization programs already stored in the first database; determining that the difference degree between the candidate optimization program and the optimization programs already stored in the first database satisfies the set condition in response to the difference degree quantification value being higher than a set difference degree threshold value; and updating the candidate optimization program to the first database. The difference degree quantification indicator comprises a distance, and the determining the difference degree quantification value between the candidate optimization program and the optimization programs already stored in the first database according to the difference degree quantification indicator between the candidate optimization program and the optimization programs already stored in the first database comprises:

4. The method of claim 3, wherein, determining at least one distance between the candidate optimization program and any optimization program already stored in the first database; determining a target distance between the candidate optimization program and the optimization program according to the at least one distance between the candidate optimization program and the optimization program; and determining the difference degree quantification value according to the target distance between the candidate optimization program and at least one optimization program already stored in the first database. ​ 5. The method of claim 4, wherein, The determining the difference degree quantification value according to the target distance between the candidate optimization program and the at least one optimization program stored in the first database comprises: summing the target distances between the candidate optimization program and the at least one optimization program stored in the first database to obtain a first distance sum; determining the difference degree quantification value according to the first distance sum and the number of the optimization programs stored in the first database.

6. The method of claim 5, wherein, The determining the difference degree quantification value according to the first distance sum and the number of the optimization programs stored in the first database comprises: determining a ratio between the first distance sum and the number of the optimization programs stored in the first database; determining the ratio as the difference degree quantification value.

7. The method of claim 5, wherein, The determining the difference degree quantification value according to the first distance sum and the number of the optimization programs stored in the first database comprises: determining a ratio between the first distance sum and the number of the optimization programs stored in the first database; determining a distance change amount between the first database and a candidate first database, wherein the candidate first database is a database obtained by adding the candidate optimization program to the first database, the distance change amount is used to indicate a change amount between a second distance sum and a third distance sum, the second distance sum is a sum of distances between the optimization programs stored in the first database, and the third distance sum is a sum of distances between the optimization programs stored in the candidate first database; determining a sum of the ratio and the distance change amount as the difference degree quantification value.

8. The method of claim 7, wherein, The second distance sum is a set value, or is obtained by summing the target distances between any two optimization programs of the plurality of optimization programs stored in the first database; The third distance sum is obtained by summing the target distances between any two optimization programs of the plurality of optimization programs stored in the candidate first database.

9. The method of claim 7, wherein, The optimization programs stored in the first database are provided with a number threshold; The determining process of the candidate first database comprises: adding the candidate optimization program to the first database to obtain a reference first database; in response to the number of the optimization programs stored in the reference first database not exceeding the number threshold, determining the reference first database as the candidate first database; in response to the number of the optimization programs stored in the reference first database exceeding the number threshold, determining a to-be-removed optimization program according to the difference degree quantification value between any optimization program in the reference first database and at least one optimization program in the reference first database except the optimization program; removing the to-be-removed optimization program from the reference first database to obtain the candidate first database.

10. The method of claim 2, wherein, The updating the second database according to the distribution of the plurality of candidate optimization programs satisfying the second index condition in the performance index space comprises: determining a plurality of reference optimization programs that are not dominated by each other according to the performance indexes of the plurality of candidate optimization programs satisfying the second index condition; According to the distribution of the plurality of reference optimization programs in the performance index space, it is determined whether the plurality of reference optimization programs satisfy the target distribution characteristic; In response to any of the reference optimization programs satisfying the target distribution characteristic, the reference optimization program is updated to the second database.

11. The method of claim 10, wherein, The target distribution characteristic includes at least one of: An extreme distribution characteristic, which is a distribution characteristic in which any of the performance indexes in the performance index space takes an optimal value; An inflection point distribution characteristic, which is a distribution characteristic of a target curvature of a target distribution curve or a target distribution surface in the performance index space, wherein the target distribution curve is a distribution curve of the plurality of reference optimization programs in the performance index space, and the target distribution surface is a distribution surface of the plurality of reference optimization programs in the performance index space; A sparse distribution characteristic, which is a distribution characteristic in which the distribution is sparse in the performance index space.

12. The method of claim 1, wherein, According to the updated first database or the updated second database, the target optimization program corresponding to the to-be-optimized program is determined, including: According to the updated first database or the updated second database, a plurality of rounds of iterative optimization processes are performed; wherein, in each round of the iterative optimization process, at least one of the first database and the second database corresponding to each round of the iterative optimization process is updated; The target optimization program is determined from the candidate optimization programs stored in the first database or the second database corresponding to the last round of the iterative optimization process.

13. The method of claim 12, wherein, The first database corresponding to the first round of the iterative optimization process is the updated first database, and the second database corresponding to the first round of the iterative optimization process is the updated second database; Each round of the iterative optimization process includes: From the first database or the second database corresponding to the current round of the iterative optimization process, a to-be-optimized program corresponding to the current round of the iterative optimization process is determined; According to the to-be-optimized program corresponding to the current round of the iterative optimization process, a candidate optimization program corresponding to the current round of the iterative optimization process is determined; The performance index of the candidate optimization program corresponding to the current round of the iterative optimization process is determined; According to the candidate optimization program corresponding to the current round of the iterative optimization process and the performance index of the candidate optimization program corresponding to the current round of the iterative optimization process, at least one of the first database and the second database corresponding to the current round of the iterative optimization process is updated; The first database corresponding to the next round of the iterative optimization process is determined, and the second database corresponding to the next round of the iterative optimization process is determined.

14. The method of claim 13, wherein, The determination of the to-be-optimized program corresponding to the current round of the iterative optimization process from the first database or the second database corresponding to the current round of the iterative optimization process includes: According to a set selection strategy, the to-be-optimized program corresponding to the current round of the iterative optimization process is determined from the first database or the second database corresponding to the current round of the iterative optimization process.

15. The method of claim 14, wherein, The set selection strategy includes at least one of: If the to-be-optimized program has been determined from the second database continuously for a first set number of rounds before the iteration optimization process of the target round, the to-be-optimized program is determined from the first database in the iteration optimization process of the target round; According to a first set probability, the to-be-optimized program is determined from the first database, and according to a second set probability, the to-be-optimized program is determined from the second database; wherein the second set probability is determined based on the first set probability; If the target set is the same continuously for a second set number of rounds before the iteration optimization process of any round, the probability of determining the to-be-optimized program from the first database is increased, otherwise the probability of determining the to-be-optimized program from the first database is decreased; wherein the target set includes the optimization program stored in the second database corresponding to any round of the iteration optimization process, and a plurality of mutually non-dominated reference optimization programs corresponding to any round of the iteration optimization process are determined according to the performance indicators of a plurality of candidate optimization programs meeting the second index condition corresponding to any round of the iteration optimization process.

16. The method of claim 13, wherein, The process of determining the to-be-optimized program from the second database includes: De-duplication is performed on a plurality of optimization programs stored in the second database to retain any one of a plurality of optimization programs that implement the same function; For the plurality of optimization programs after de-duplication, the crowding distance of any two adjacent optimization programs is determined to stratify the plurality of optimization programs after de-duplication based on the crowding distance, to obtain a plurality of stratifications and optimization programs corresponding to any stratification; A target stratification is determined from the plurality of stratifications to determine the to-be-optimized program from the optimization programs corresponding to the target stratification.

17. The method of claim 16, wherein, The process of determining the target stratification from the plurality of stratifications to determine the to-be-optimized program from the optimization programs corresponding to the target stratification includes: According to the crowding degree indicated by the plurality of stratifications, a first set number of stratifications with low crowding degree are determined as target stratifications; According to the selection frequency of at least one optimization program corresponding to the target stratification, a second set number of optimization programs based on a large model with low selection frequency are determined as to-be-optimized programs.

18. The method of claim 16, wherein, If the frequency of any optimization program being determined as a to-be-optimized program exceeds a set frequency threshold, the selection probability of the optimization program is decreased.

19. The method of any one of claims 1-18, wherein, The process of determining the candidate optimization program corresponding to the to-be-optimized program and the performance indicator of the candidate optimization program includes: A large model is used to generate a candidate optimization program corresponding to the to-be-optimized program according to a set optimization target; According to a set multi-dimensional index system, the performance indicator of the candidate optimization program is determined.

20. A large model-based optimization program determination device, the device comprising: a first determination module for determining a candidate optimization program corresponding to a to-be-optimized program and a performance indicator of the candidate optimization program; An updating module is configured to update at least one of a first database and a second database according to the candidate optimization program and the performance indicator of the candidate optimization program, wherein the first database is configured to store optimization programs that satisfy a set condition in terms of a difference degree between the optimization programs stored in the first database, and the second database is configured to store optimization programs that satisfy a target distribution characteristic in terms of the performance indicator; A second determining module is configured to determine a target optimization program corresponding to the to-be-optimized program according to the updated first database or the updated second database.

21. An intelligent entity, comprising: an input module configured to obtain a to-be-optimized program; a processing module configured to determine a target optimization program corresponding to the to-be-optimized program based on the optimization program determination method based on a large model according to any one of claims 1-19; an output module configured to output the target optimization program.

22. An electronic device, comprising: at least one processor; and a memory connected to the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1-19.

23. A non-transitory computer readable storage medium having stored thereon computer instructions, wherein, The computer instructions are used to enable the computer to perform the method according to any one of claims 1-19.

24. A computer program product comprising computer programs / instructions, wherein, The computer program / instructions, when executed by the processor, implement the method according to any one of claims 1-19.

Citation Information

Patent Citations

  • Application program optimization method, equipment and device, and storage medium

    CN110502269A

  • Code generation method, device and equipment based on multi-agent language system

    CN119065650A

  • Software package source code optimization method of cross-instruction-set architecture

    CN120371387A

  • Code generation for auto-ai

    US20220004914A1

  • Detecting artificial intelligence generated computer code

    US20240419801A1