Algorithm design method and device based on llm, and computing device cluster

By using an LLM-based explicit guidance and iterative evolutionary algorithm design method, the problems of high cost and low efficiency in the algorithm design process are solved. The generated algorithm can rival or even surpass manual customized design, achieving efficient and accurate algorithm generation.

CN120822584APending Publication Date: 2025-10-21HUAWEI TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410439584.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-11
Publication Date
2025-10-21

AI Technical Summary

Technical Problem

In existing technologies, the algorithm design process requires customized design, resulting in high human and time costs, and the generated algorithms are difficult to match the effects of manual customized design.

Method used

By employing an iterative evolutionary algorithm design method based on explicit guidance from a large-scale language model (LLM), candidate algorithms are generated and subjected to crossover and mutation evolution. Combined with an algorithm pool and Prompt guidance, a target algorithm that meets the requirements is generated.

Benefits of technology

It reduces the difficulty of algorithm design, enabling the generated algorithms to rival or even surpass manually customized designs, thus improving the efficiency and accuracy of algorithm generation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120822584A_ABST
    Figure CN120822584A_ABST
Patent Text Reader

Abstract

An algorithm design method based on a large-scale language model comprises the steps that algorithm design requirements are received, and the algorithm design requirements comprise problem description; generating at least one candidate algorithm based on the algorithm design requirements; the to-be-evolved algorithm is iteratively evolved through the large-scale language model to obtain a target algorithm conforming to algorithm design requirements, the to-be-evolved algorithm comprises an evolved algorithm and / or a candidate algorithm, in each iteration process, a prompt is generated based on the to-be-evolved algorithm, and the prompt is used for guiding the large-scale language model to evolve. Therefore, through an explicit guidance mode, in the process of generating the algorithm by using the large-scale language model, clear guidance can be provided for the large-scale language model, so that the large-scale language model automatically generates the algorithm with relatively high accuracy, and the finally designed algorithm can be comparable with or even surpass the algorithm of manual customization design; and the difficulty of algorithm design is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence (AI) technology, and in particular to an algorithm design method, apparatus, and computing device cluster based on LLM. Background Art

[0002] Currently, when solving algorithmic problems, people typically design and program customized algorithms for each specific problem. This approach has a high barrier to entry for algorithmic professionals and requires a long customization process, resulting in high labor and time costs. For example, in the industrial field, various optimization problems (production scheduling, logistics distribution, employee scheduling, inventory management, equipment maintenance, etc.) are often solved efficiently by academics and industry alike, customizing specialized algorithms based on the specific constraints and objectives of a problem. However, the rapid development of large-scale language models (LLMs), their demonstrated capabilities in natural language understanding, algorithmic logic, and generating optimal solutions, has sparked research on how to use LLMs to automatically implement algorithm design, eliminating the time-consuming and labor-intensive manual customization process. Summary of the Invention

[0003] The present application provides an algorithm design method, apparatus, computing device cluster, computer storage medium, and computer product based on LLM, which can reduce the difficulty of algorithm design.

[0004] In a first aspect, the present application provides an algorithm design method based on LLM, comprising: receiving algorithm design requirements, the algorithm design requirements including: a problem description; generating at least one candidate algorithm based on the algorithm design requirements; iteratively evolving the algorithm to be evolved through LLM to obtain a target algorithm that meets the algorithm design requirements, the algorithm to be evolved including: an evolved algorithm and / or a candidate algorithm, wherein, in each round of iteration, a prompt is generated based on the algorithm to be evolved, and the prompt is used to guide the LLM to evolve. In this way, through explicit guidance, clear guidance can be provided to the LLM in the process of obtaining the algorithm through the LLM, so that the LLM can automatically generate an algorithm with higher accuracy, and the final designed algorithm can be comparable to or even surpass the manually customized algorithm, thereby reducing the difficulty of algorithm design.

[0005] In some possible implementations, the algorithm design requirements include a skeleton algorithm. Generating at least one candidate algorithm based on the algorithm design requirements includes generating a candidate algorithm based on the core components of the skeleton algorithm. This provides a clear direction for generating candidate algorithms, reduces the size of the generated algorithms, and improves algorithm generation efficiency.

[0006] In some possible implementations, during any iteration, evolving the algorithm to be evolved using the LLM includes: selecting at least one algorithm from an algorithm pool to obtain the algorithm to be evolved, where the algorithm pool includes both evolved algorithms and candidate algorithms; generating a first prompt based on the algorithm to be evolved, if multiple algorithms are included; the first prompt is used to guide the LLM to perform crossover evolution on the algorithms included in the algorithm to be evolved; and / or generating a second prompt based on the algorithm to be evolved, if at least one algorithm is included; the second prompt is used to guide the LLM to perform mutation evolution on the algorithms included in the algorithm to be evolved; and inputting the first prompt and / or the second prompt into the LLM to evolve the algorithm to be evolved. This allows for explicit guidance of the LLM, providing the LLM with a clear evolutionary direction, thereby increasing the accuracy of algorithm evolution and improving the precision of the resulting algorithm.

[0007] Some possible implementations also include: if the fitness value of the algorithm evolved through LLM meets the requirements, the algorithm evolved through LLM is retained; if the fitness value of the algorithm evolved through LLM does not meet the requirements, the algorithm evolved through LLM is discarded. In this way, all algorithms evolved through LLM can meet the requirements, improving the accuracy of the subsequent target algorithm.

[0008] In some possible implementations, the first prompt instructs the LLM to perform crossover evolution on the core portion of the algorithm to be evolved, while the second prompt instructs the LLM to perform mutation evolution on the core portion of the algorithm to be evolved. The core portion of the algorithm to be evolved is determined based on the candidate algorithm and / or the skeleton algorithm included in the algorithm design requirements. This allows the algorithm evolution process to target the bottlenecks of the algorithm, accelerating convergence.

[0009] In some possible implementations, the algorithm evolved through LLM includes an algorithm description and algorithm code, where the algorithm description and algorithm code are generated simultaneously, or the algorithm description is generated before the algorithm code. Generating the algorithm description and algorithm code simultaneously during the algorithm evolution process can improve the efficiency of the algorithm evolution, while generating the algorithm description and algorithm code in a time-sharing manner can improve the effectiveness of the algorithm evolution.

[0010] Some possible implementations also include iteratively simplifying the target algorithm until the target algorithm meets the requirements or reaches a preset number of iterations or time, thereby improving the generalization of the algorithm.

[0011] In some possible implementations, the algorithm design requirements also include: the output format of the LLM, where the output format includes: the format of the algorithm description, the function name of the output function in the algorithm code, and one or more of the input and output parameters in the algorithm code.

[0012] In a second aspect, the present application provides an algorithm design device based on an LLM, comprising: a receiving module and a processing module. The receiving module is configured to receive algorithm design requirements, which include a problem description. The processing module is configured to generate at least one candidate algorithm based on the algorithm design requirements, and to iteratively evolve the algorithm to be evolved using a large-scale language model (LLM) to obtain a target algorithm that meets the algorithm design requirements. The algorithm to be evolved includes an evolved algorithm and / or a candidate algorithm. During each round of iteration, a prompt is generated based on the algorithm to be evolved, and the prompt is used to guide the LLM in evolving the algorithm.

[0013] In a possible implementation, the algorithm design requirements include a skeleton algorithm. In this case, when the processing module generates at least one candidate algorithm based on the algorithm design requirements, it is specifically configured to generate the candidate algorithm based on a core part of the skeleton algorithm.

[0014] In one possible implementation, during any round of iteration, when evolving the algorithm to be evolved through the LLM, the processing module is specifically used to: screen out at least one algorithm from an algorithm pool to obtain an algorithm to be evolved, wherein the algorithm pool includes: evolved algorithms and candidate algorithms; when the algorithm to be evolved includes multiple algorithms, generate a first prompt based on the algorithm to be evolved, the first prompt being used to guide the LLM to perform cross-evolution on the algorithms included in the algorithm to be evolved, and / or, when the algorithm to be evolved includes at least one algorithm, generate a second prompt based on the algorithm to be evolved, the second prompt being used to guide the LLM to perform mutation evolution on the algorithms included in the algorithm to be evolved; and input the first prompt and / or the second prompt into the LLM to evolve the algorithm to be evolved through the LLM.

[0015] In one possible implementation, the processing module is further used to: retain the algorithm evolved through LLM if the fitness value of the algorithm evolved through LLM meets the requirements; and discard the algorithm evolved through LLM if the fitness value of the algorithm evolved through LLM does not meet the requirements.

[0016] In one possible implementation, the first prompt is used to guide the LLM to perform cross evolution on the core part of the algorithm included in the algorithm to be evolved, and the second prompt is used to guide the LLM to perform mutation evolution on the core part of the algorithm included in the algorithm to be evolved, wherein the core part of the algorithm included in the algorithm to be evolved is determined based on the candidate algorithm and / or the skeleton algorithm included in the algorithm design requirements.

[0017] In a possible implementation, the algorithm evolved through LLM includes: an algorithm description and an algorithm code, wherein the algorithm description and the algorithm code are generated simultaneously, or the generation time of the algorithm description is earlier than the generation time of the algorithm code.

[0018] In a possible implementation, the processing module is further configured to iteratively simplify the target algorithm until the target algorithm meets the requirements or reaches a preset number of iterations or time.

[0019] In a possible implementation, the algorithm design requirements also include: the output format of the LLM, where the output format includes: the format of the algorithm description, the function name of the output function in the algorithm code, and one or more of the input and output parameters in the algorithm code.

[0020] In a third aspect, the present application provides a computing device cluster comprising at least one computing device, each computing device comprising a processor and a memory; the processor of at least one computing device is used to execute instructions stored in the memory of at least one computing device, so that the computing device cluster performs the method described in the first aspect or any possible implementation of the first aspect.

[0021] In a fourth aspect, the present application provides a computer-readable storage medium comprising computer program instructions. When the computer program instructions are executed by a computing device cluster, the computing device cluster performs the method described in the first aspect or any possible implementation of the first aspect. For example, the computing device cluster may include one or more computing devices.

[0022] In a fifth aspect, the present application provides a computer program product comprising instructions that, when executed by a computing device cluster, cause the computing device cluster to perform the method described in the first aspect or any possible implementation of the first aspect. For example, the computing device cluster may include one or more computing devices.

[0023] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1This is a schematic diagram of the architecture of an LLM-based algorithm design system provided in an embodiment of the present application;

[0025] Figure 2 yes Figure 1 The structural diagram of the algorithm evolution module shown in;

[0026] Figure 3 This is a schematic diagram of the architecture of another LLM-based algorithm design system provided in an embodiment of the present application;

[0027] Figure 4 This is a schematic diagram of the interaction between a tenant and a cloud computing platform provided in an embodiment of the present application;

[0028] Figure 5 This is a flowchart of an LLM-based algorithm design method provided in an embodiment of the present application;

[0029] Figure 6 This is a schematic diagram of a process for processing algorithm design requirements using LLM through explicit guidance provided by an embodiment of the present application;

[0030] Figure 7 Schematic diagram of the structure of an LLM-based algorithm design device provided in an embodiment of the present application;

[0031] Figure 8 is a structural diagram of a computing device provided in an embodiment of the present application;

[0032] Figure 9 This is a schematic diagram of the structure of a computing device cluster provided in an embodiment of the present application;

[0033] Figure 10 This is a schematic diagram of the structure of another computing device cluster provided in an embodiment of the present application. DETAILED DESCRIPTION

[0034] The term "and / or" as used herein describes an association between related objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A exists alone, A and B exist simultaneously, or B exists alone. The symbol " / " as used herein indicates that the related objects are in an "or" relationship, for example, A / B means either A or B.

[0035] The terms "first" and "second" in this specification and claims are used to distinguish different objects rather than to describe a specific order of objects. For example, "first response message" and "second response message" are used to distinguish different response messages rather than to describe a specific order of response messages.

[0036] In the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be interpreted as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.

[0037] In the description of the embodiments of the present application, unless otherwise specified, "multiple" means two or more, for example, multiple processing units means two or more processing units, etc.; multiple elements means two or more elements, etc.

[0038] Generally, LLMs can be used directly as optimizers, providing an end-to-end approach to solving optimization problems. Specifically, LLMs are directly applied to the problem-solving process, leveraging their capabilities to search for and determine the optimal solution (or feasible solution), eliminating the need for manual design and implementation of optimization algorithms. However, this approach directly generates the final solution using a black-box optimization approach, resulting in poor interpretability. Furthermore, due to the current limitations of LLMs, directly generating solutions can only solve simple problems and is ineffective for more complex practical problems.

[0039] In view of this, an embodiment of the present application provides an algorithm design method based on LLM, which can automatically implement iterative evolution of the algorithm based on the algorithm design requirements (such as problem description, skeleton algorithm and output format, etc.) by calling LLM through explicit guidance, and automatically output an efficient algorithm for the algorithm design requirements, so that the final designed algorithm can be comparable to or even surpass the algorithm designed by manual customization. Since the final result generated by this method is an algorithm, the solution process can be understood through the implementation process of the algorithm, which improves the interpretability. At the same time, different algorithms can also be generated for different problems, which improves the problem-solving ability. Among them, explicit guidance is a way to directly and clearly impart knowledge, skills or guidance. Through explicit guidance, the process of processing algorithm design requirements of LLM can be informed, providing clear guidance for LLM.

[0040] For example, Figure 1 FIG. 1 shows an architecture diagram of an algorithm design system based on LLM provided in an embodiment of the present application. Figure 1As shown, the LLM-based algorithm design system 100 may include: LLM 110, an initialization module 120, an algorithm pool 130, an algorithm evolution module 140, an algorithm evaluation module 150, and an algorithm screening module 160. LLM 110 is a deep learning model trained based on massive amounts of data. An LLM typically consists of billions or even trillions of parameters and is trained using a neural network architecture such as the Transformer. In this embodiment, LLM 110 can generate algorithms that meet certain requirements. For example, during the algorithm generation process, LLM 110 may stop generating algorithms when the number of algorithms generated meets certain requirements. The algorithms generated by LLM 110 include: an algorithm description and an algorithm code. The algorithm description uses natural language to describe the algorithm code, which can clearly explain the algorithm's execution steps, input and output, time complexity, correctness, and other aspects. The algorithm code converts the algorithm description into a computer-executable form, which can use a specific programming language to implement the algorithm's various steps and logic.

[0041] Initialization module 120 is primarily responsible for, upon receiving algorithm design requirements, invoking LLM 110 to generate a certain number of candidate algorithms and transmitting the candidate algorithms generated by LLM 110 to algorithm pool 130. Exemplarily, algorithm design requirements may be user input or other software or hardware input, which is not limited herein. Exemplarily, algorithm design requirements may include one or more of: a problem description, a skeleton algorithm, and an output format for LLM 110. A problem description is a statement or description of the problem, the purpose of which is to clarify the problem and the problem to be solved. A skeleton algorithm is a general algorithmic framework for solving the problem described in the problem description, describing the key steps and sample implementations for solving the problem. The output format for LLM 110 may include requiring the output algorithm description to be enclosed in parentheses (e.g., curly braces) to facilitate subsequent parsing, as well as specifying the function name, input and output parameters, etc. of the output function in the algorithm code. Exemplarily, upon receiving the algorithm design requirements, initialization module 120 may send an algorithm generation request to LLM 110, requesting LLM 110 to generate at least one candidate algorithm that meets the algorithm design requirements. Among them, when the algorithm design requirements include a skeleton algorithm, the algorithm generation request can be a request for LLM100 to generate a candidate algorithm according to the sample of the skeleton algorithm. In this way, prior knowledge can be added to the algorithm generation process, the search space can be reduced, and the algorithm generation efficiency can be improved. In some embodiments, the initialization module 120 can transfer all candidate algorithms generated by LLM110 to the algorithm pool 130 for storage. In addition, the initialization module 120 can also first calculate the information entropy of each candidate algorithm separately, and then transfer the algorithm with higher information entropy to the algorithm pool 130 for storage, and discard the algorithm with lower information entropy. Among them, the algorithm with higher information entropy can be understood as an algorithm with information entropy greater than or equal to a preset entropy threshold. In this way, the complexity of the saved algorithm can be made higher, so that more complex content can be explored from these algorithms in the future, providing a good foundation for subsequent algorithm evolution.

[0042] The algorithm pool 130 is primarily used to store, in a specific organizational structure, candidate algorithms transmitted by the initialization module 120 and new algorithms evolved by the algorithm evolution module 140. For example, the number of algorithms held by the algorithm pool 130 may have an upper limit. When the number of algorithms in the algorithm pool 130 reaches the upper limit and a new algorithm is added, the algorithm pool 130 may randomly or according to preset rules delete at least one algorithm to store the new algorithm. In this embodiment, the organizational structure of the algorithm pool 130 may include a simple structure, a coalition structure, or a hierarchical structure. A simple structure means that the relationships between algorithms are equal. A coalition structure divides algorithms into multiple categories, with different categories having different priorities for subsequent evolution, while algorithms within the same category have the same priorities. A hierarchical structure divides algorithms into leading algorithms and subordinate algorithms, with leading algorithms located in the upper layer and subordinate algorithms located in the lower layer. Algorithms in different layers have different priorities for subsequent evolution, while algorithms in the same layer have the same priorities for subsequent evolution. The coalition and hierarchical organizational structures enable targeted evolution during subsequent evolution, resulting in finer granularity and improved evolution efficiency.

[0043] The algorithm evolution module 140 is mainly used to select at least one algorithm from the algorithm pool 130, and generate a prompt (Prompt) based on the selected algorithm, and transmit the Prompt to LLM110 to evolve the algorithm through LLM110. Among them, the Prompt may include: algorithm description and algorithm code. Prompt can be used to instruct LLM100 how to evolve the algorithm. For example, Prompt can instruct LLM110 to output the algorithm description and algorithm code of the evolved new algorithm at the same time when evolving the algorithm, or it can instruct LLM110 to first output the algorithm description of the evolved new algorithm when evolving the algorithm, and then translate the algorithm description into algorithm code, and output the algorithm code. Since the algorithm description can abstract the key steps and ideas of the algorithm, outputting the algorithm description and algorithm code step by step can help simplify complex code implementation and improve the generation effect of the algorithm code. For example, if Figure 2As shown, the algorithm evolution module 140 may include: an algorithm selection operator 141 and a prompt generation operator 142. Among them, the algorithm selection operator 141 is mainly used to select an algorithm from the algorithm pool 130. The rules for selecting the algorithm by the algorithm selection operator 141 include but are not limited to: random selection, optimal selection, roulette selection, tournament selection, etc. The prompt generation operator 142 is mainly used to generate a prompt based on the algorithm selected by the algorithm selection operator 141. Exemplarily, the prompt generation operator 142 may include: a crossover operator and / or a mutation operator. The crossover operator can be used to generate a prompt that instructs LLM110 how to perform crossover evolution on the algorithm selected by the selection operator 141. For example, the Prompt generated by the crossover operator can instruct LLM110 to determine how to cross on its own, or instruct LLM110 to identify different parts in the algorithm and use the identified different parts to form a new algorithm, or instruct LLM110 to identify the same parts in the algorithm and explore new algorithms based on the identified same parts, or instruct LLM110 to perform algorithm crossover according to examples, such as dividing the algorithm crossover process into several steps and instructing LLM110 how to implement algorithm crossover step by step, etc. Among them, crossover of algorithms refers to the process of using two or more parent algorithms to identify and extract the same and different contents in the parent algorithms, and generating a new algorithm through different operations based on the identified contents. The mutation operator is mainly used to generate a Prompt that instructs LLM110 how to mutate and evolve the algorithm selected by the selection operator 141. For example, the Prompt generated by the mutation operator can instruct LLM110 to determine how to mutate on its own, or instruct LLM110 to mutate and generate a new algorithm that is different from the selected algorithm, or instruct LLM110 to mutate the hyperparameters in the algorithm without changing the main body of the algorithm, or instruct LLM110 to simplify the algorithm without reducing the effectiveness of the algorithm, or instruct LLM110 to mutate the algorithm according to the example, such as dividing the algorithm mutation process into several steps and instructing LLM110 how to implement the algorithm mutation step by step, etc. Among them, mutating the algorithm refers to the process of using one or more parent algorithms, identifying the content of the parent algorithms, and making certain modifications to the parent algorithms to obtain a new algorithm. In addition, the algorithm evolution module 140 can iteratively select algorithms from the algorithm pool 130 and call LLM110 to generate new algorithms until a preset number of iterations or a preset iteration time is reached, so that a sufficient number of new algorithms can be obtained.

[0044] The algorithm evaluation module 150 is mainly used to evaluate whether the new algorithm evolved by the algorithm evolution module 140 meets the requirements based on a preset set of problem use cases, and, if the requirements are met, transfer the new algorithm to the algorithm pool 130 for storage, and if the requirements are not met, discard the new algorithm. Wherein, each time a new algorithm is obtained through the algorithm evolution module 140, the algorithm evaluation module 150 needs to evaluate the new algorithm. Exemplarily, the algorithm evaluation module 150 can first evaluate the fitness value of the new algorithm based on the set of problem use cases; then, decide whether to store the new algorithm in the algorithm pool 130 based on the fitness value. Wherein, the fitness value of the algorithm is an indicator used to measure the quality of the solution in the optimization problem. Exemplarily, the fitness value score = ∑ i obj(x i ) / S. obj() is the objective function, x i is the solution obtained by using the new algorithm to solve the i-th problem case, and S is the number of problem cases. The objective function can be defined based on the problem. For example, when the problem is the Travel Salesman Problem (TSP), the objective function can be a distance calculation function.

[0045] The algorithm screening module 160 is primarily used to select K (K ≥ 1) algorithms from the algorithm pool 130 based on the fitness values ​​of the algorithms after the algorithm evolution module 140 completes iterative algorithm evolution, and output these K algorithms. The algorithms output by the algorithm screening module 160 are the algorithms designed by the LLM-based algorithm design system 100. For example, the algorithm screening module 160 may first evaluate the fitness values ​​of each algorithm in the algorithm pool 130 based on a set of problem use cases; then, it selects the algorithms associated with the top K fitness values, thereby screening the K algorithms. For example, the algorithms output by the algorithm screening module 160 may include: algorithm code and algorithm description. In some embodiments, before outputting the algorithm, the algorithm screening module 160 may also simplify the algorithm (essentially, evolving the algorithm) without compromising its performance, to prevent overfitting and enhance its generalization. The algorithm screening module 160 may generate a prompt. This prompt may instruct the LLM 110 to simplify the selected algorithms without compromising their performance. In this way, LLM 110 can simplify the selected algorithms. After LLM 110 completes the simplification process, algorithm screening module 160 can evaluate the simplified algorithms based on their information entropy or number of lines of code. Lower information entropy scores are associated with higher scores, and fewer lines of code also represent higher scores. Specifically, lower information entropy and / or fewer lines of code indicate simpler algorithms and greater generalizability. After evaluating an algorithm as meeting requirements, algorithm screening module 160 outputs the algorithm. Furthermore, when simplifying an algorithm, if the algorithm does not meet requirements after one simplification, it can be iteratively simplified until a preset number of iterations or a preset iteration time is reached. In some embodiments, after completing the algorithm simplification process, algorithm screening module 160 can select J algorithms from the K simplified algorithms and output these J algorithms. The evaluation scores of these J algorithms are higher than those of the remaining algorithms. In other words, after completing the algorithm simplification process, algorithm screening module 160 can further screen the algorithms and output the selected algorithms.

[0046] In this way, through the LLM-based algorithm design system 100, after obtaining the algorithm design requirements, the iterative evolution of the algorithm can be automatically realized through explicit guidance, and an efficient algorithm that meets the algorithm design requirements can be automatically output, so that the final designed algorithm can be comparable to or even surpass the manually customized designed algorithm.

[0047] exist Figure 1In the LLM-based algorithm design system 100 shown, when the algorithm evolution module 140 instructs the LLM 110 to perform algorithm evolution, it evolves the entire algorithm or the same (or different) parts of multiple algorithms, etc. This makes the evolution space larger and reduces the algorithm evolution efficiency. In view of this, the embodiment of the present application provides another LLM-based algorithm design system 200. Figure 3 As shown, the LLM-based algorithm design system 200 is Figure 1 The main difference of the LLM-based algorithm design system 100 shown is that an algorithm core identification module 170 is added to the LLM-based algorithm design system 200. The algorithm core identification module 170 is mainly used to identify the core part of the skeleton algorithm and / or the algorithm screened out by the initialization module 120 (i.e., the algorithm core, that is, the bottleneck part that affects the algorithm effect), and transmit the identified core part to the algorithm evolution module 140. In this way, the algorithm evolution module 140 can instruct LLM110 to evolve around the core part of the algorithm, while reducing or ignoring the evolution of the non-core part, thereby improving the algorithm evolution efficiency. In addition, when the algorithm design requirements input by the user include a skeleton algorithm, the algorithm core identification module 170 can also transmit the core part of the skeleton algorithm it identifies to the initialization module 120, so that the initialization module 120 can instruct LLM110 to generate candidate algorithms according to the core part of the skeleton algorithm to reduce the scale of the algorithm.

[0048] The above-mentioned LLM-based algorithm design system 100 / 200 can be configured on a cloud computing platform. For example, it can be deployed on at least one virtual machine or container instance, so that the cloud computing platform can provide algorithm design services. Of course, the LLM-based algorithm design system 100 / 200 can also be configured on nodes other than the cloud computing platform. For example, it can be deployed in at least one data center, or deployed on at least one server. The specific details can be determined according to the actual situation and are not limited here. Among them, the cloud computing platform can provide pages related to public cloud services for tenants to remotely access public cloud services. In this embodiment, tenants (also referred to as "users") can purchase the algorithm design services that can be provided by the LLM-based algorithm design system 100 / 200 on the cloud computing platform in advance. For ease of understanding, the interaction between tenants and the cloud computing platform is described below. As Figure 4As shown, the interaction between a tenant and the cloud computing platform primarily involves logging into the cloud computing platform 400 through a client webpage, selecting and purchasing cloud services related to the LLM-based algorithm design system 100 / 200 (i.e., algorithm design services) on the cloud computing platform 400. After purchase, the tenant can generate the desired algorithm on the cloud computing platform 400 based on the functionality provided by the algorithm design services. The cloud computing platform 400 primarily manages the infrastructure for running the algorithm design services. For example, the infrastructure for running the algorithm design services may include multiple data centers located in different regions, each of which includes multiple servers. Data centers may provide basic resources for the algorithm design services, such as computing resources and storage resources. Therefore, when purchasing and using the algorithm design services, tenants primarily pay for the resources used. When using the algorithm design services, tenants can enter their algorithm design requirements through the configuration interface, application program interface (API), or other tenant interaction interface provided by the cloud computing platform 400. The cloud computing platform 400 then generates an algorithm that meets the algorithm design requirements according to the algorithm design requirements entered by the tenant (or other software / hardware, etc.).

[0049] In addition, since the LLM110 in the LLM-based algorithm design system 100 / 200 has a high demand for computing resources, while other modules have a lower demand for computing resources, the LLM110 in the LLM-based algorithm design system 100 / 200 can be configured on the server, and at least some of the other modules can be configured on the client. The client can be a desktop application, a mobile application, a web application, or a web-based application, etc. After obtaining the algorithm design requirements, the client can communicate with the server to call the LLM110 on the server to complete the algorithm iterative evolution / simplification, thereby generating an algorithm that meets the algorithm design requirements. In some embodiments, the client can provide a visual interface for the user to input the algorithm design requirements.

[0050] The above is an introduction to the algorithm design system based on LLM provided by the embodiment of the present application. Next, based on the above content, an algorithm design method based on LLM provided by the embodiment of the present application is introduced.

[0051] For example, Figure 5The flowchart of an algorithm design method based on LLM provided by an embodiment of the present application is shown. It can be understood that the method can be executed by any device, equipment, platform, or device cluster with computing and processing capabilities. Exemplarily, the method can be executed by an algorithm design device based on LLM, wherein the device can be implemented by software and / or hardware, and can be configured in a computing device cluster including at least one computing device, typically, in a cloud server. Figure 5 As shown, the LLM-based algorithm design method may include the following steps:

[0052] S501. Receive algorithm design requirements, which include: problem description.

[0053] In this embodiment, the algorithm design requirements can be user input or other software or hardware input, and are not limited here. For example, the algorithm design requirements may include: a problem description. Of course, the algorithm design requirements may also include: the output format of the skeleton algorithm and / or LLM. The LLM output format includes: the format of the algorithm description, the function name of the output function in the algorithm code, and one or more of the input and output parameters in the algorithm code.

[0054] S502: Generate at least one candidate algorithm based on algorithm design requirements.

[0055] In this embodiment, after receiving the algorithm design requirements, the algorithm design requirements can be processed using the LLM to obtain one or more candidate algorithms. Exemplarily, the candidate algorithms may include an algorithm description and algorithm code. Furthermore, to reduce the size of the generated algorithms, when the algorithm design requirements include a skeleton algorithm, the core portion of the skeleton algorithm can be identified manually or through the LLM (of course, the entire skeleton algorithm can be considered the core portion). Then, using the LLM, the algorithm design requirements can be processed based on the core portion of the skeleton algorithm to generate candidate algorithms. In this way, the LLM can generate candidate algorithms centered around the core portion of the skeleton algorithm, providing a clear direction for the algorithm generation process, reducing the size of the generated algorithms and improving algorithm generation efficiency. In some embodiments, the generated candidate algorithms can also be screened to ensure that the resulting candidate algorithms all meet the requirements, thereby improving the accuracy of subsequent algorithm evolution and the precision of the resulting algorithm. For example, if the information entropy of a candidate algorithm does not meet the requirements, the candidate algorithm can be discarded; however, if the information entropy of a candidate algorithm meets the requirements, the candidate algorithm can be retained.

[0056] S503. Iteratively evolve the evolving algorithm through the LLM to obtain a target algorithm that meets the algorithm design requirements. The evolving algorithm includes the evolved algorithm and / or candidate algorithms. During each iteration, a prompt is generated based on the evolving algorithm. The prompt is used to guide the LLM in its evolution.

[0057] In this embodiment, after obtaining a candidate algorithm, the algorithm to be evolved can be iteratively evolved using the LLM. This allows the target algorithm to be obtained that meets the algorithm design requirements. The algorithm to be evolved can include: an evolved algorithm and / or a candidate algorithm. Furthermore, the algorithm to be evolved can include one or more algorithms. During the iterative process, a prompt can be generated for each iteration based on the algorithm to be evolved to guide the LLM in its evolution. For example, the algorithm to be evolved can be added to a preset prompt template to obtain the desired prompt. For example, the generated prompt can require the LLM to first identify the common (or different) parts of the algorithm to be evolved and then explore new algorithms based on the common (or different) parts. Alternatively, the LLM can be instructed to mutate only the hyperparameters of the algorithm to be evolved, and so on. In some embodiments, the algorithm evolved via the LLM can include: an algorithm description and algorithm code. To improve the efficiency of algorithm evolution, the algorithm description and algorithm code can be generated simultaneously. Since the algorithm description can abstract the key steps and concepts of the algorithm, outputting the algorithm description and algorithm code step by step can help simplify complex code implementation and improve the efficiency of algorithm code generation. Therefore, in order to improve the effect of algorithm evolution, the algorithm description and algorithm code can be generated in time-sharing manner; in this case, the generation time of the algorithm description can be earlier than the generation time of the algorithm code.

[0058] In this way, the LLM can be instructed on how to evolve the evolutionary algorithm, providing explicit guidance to the LLM during the algorithm generation process. This allows the LLM to automatically generate a highly accurate algorithm, and the resulting algorithm can rival or even surpass manually customized algorithms, reducing the difficulty of algorithm design. Furthermore, after obtaining the target algorithm, in order to enhance its generalizability, the target algorithm can be iteratively simplified until it meets the requirements or reaches a preset number of iterations or time. At this point, the LLM can also be used to iteratively simplify the target algorithm through explicit guidance. For example, the LLM can be instructed to simplify the algorithm while minimizing the effectiveness of the algorithm.

[0059] In some embodiments, for any round of iteration in S503, Figure 6 As shown, the following steps may be specifically included:

[0060] S601: Filter at least one algorithm from an algorithm pool to obtain an algorithm to be evolved. The algorithm pool includes evolved algorithms and candidate algorithms. Both the generated candidate algorithms and the evolved algorithms can be added to an algorithm pool with storage capabilities, such as a cache or memory. Then, during evolution, at least one algorithm can be selected from the algorithm pool randomly or according to a preset rule to obtain the algorithm to be evolved.

[0061] S602. When the algorithm to be evolved includes multiple algorithms, a first prompt can be generated based on the algorithm to be evolved. For example, the algorithm to be evolved can be added to a prompt template to generate the first prompt. This first prompt can be used to guide the LLM to perform crossover evolution on the algorithms included in the algorithm to be evolved. When the algorithm to be evolved includes at least one algorithm, a second prompt can be generated based on the algorithm to be evolved. For example, the algorithm to be evolved can be added to a prompt template to generate a second prompt. This second prompt can be used to guide the LLM to perform mutation evolution on the algorithms included in the algorithm to be evolved. Of course, when the algorithm to be evolved includes multiple algorithms, the first prompt and the second prompt can be generated simultaneously, or the two can be combined to form a new prompt, so as to guide the LLM to perform both crossover evolution and mutation evolution on the algorithms included in the algorithm to be evolved.

[0062] S603: Input the first prompt and / or the second prompt into the LLM to evolve the evolving algorithm. After the first prompt and / or the second prompt are input into the LLM, the LLM can evolve the evolving algorithm according to the prompt's instructions. In this way, the prompt provides display guidance to the LLM.

[0063] Furthermore, to improve evolutionary accuracy and efficiency, before evolving the algorithm through LLM, candidate algorithms can be identified to identify their core components. (Of course, if the algorithm design requirements include a skeleton algorithm, the core components of the skeleton algorithm can also be identified manually or through LLM and used as the core components of the algorithm.) Prompts can then be used to instruct the LLM to perform crossover and / or mutation evolution on the core components of the evolving algorithm. This allows the algorithm evolution process to target the bottlenecks of the algorithm, accelerating convergence. To ensure that the evolved algorithm meets the requirements, the algorithm's fitness can be evaluated using a set of problem use cases. Algorithms that meet the fitness requirements are retained, while those that do not are discarded.

[0064] It should be understood that the order of execution of the steps in the above embodiments does not necessarily imply a specific order of execution. The order of execution of each process should be determined by its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of this application. In addition, the various embodiments described above can be combined according to actual circumstances, and the combined solutions are still within the scope of protection of this application.

[0065] Based on the method in the above embodiment, the embodiment of the present application also provides an algorithm design device based on LLM.

[0066] For example, Figure 7 FIG. 1 shows a schematic diagram of a structure of an algorithm design device based on LLM provided by an embodiment of the present application. Figure 7 As shown, the LLM-based algorithm design apparatus 700 may include a receiving module 701 and a processing module 702. The receiving module 701 is configured to receive algorithm design requirements, which may include a problem description. The processing module 702 is configured to process the algorithm design requirements using the LLM through explicit guidance to obtain at least one target algorithm that meets the algorithm design requirements and output the target algorithm.

[0067] In some embodiments, when the processing module 702 uses LLM to process the algorithm design requirements through explicit guidance, it is specifically used to: use LLM to process the algorithm design requirements to obtain candidate algorithms, and store the candidate algorithms in the algorithm pool; use LLM to iteratively evolve the algorithms in the algorithm pool through explicit guidance until a preset number of iterations or time is reached, wherein the algorithms obtained by each evolution are stored in the algorithm pool; and filter out the target algorithm from the algorithm pool.

[0068] In some embodiments, when the processing module 702 iteratively evolves the algorithms in the algorithm pool using the LLM through explicit guidance, the processing module 702 is specifically configured to: select at least one algorithm from the algorithm pool during any iterative evolution process, and perform crossover and / or mutation evolution on the selected algorithm using the LLM through explicit guidance. The algorithm obtained through the LLM includes an algorithm description and an algorithm code, and the algorithm description and algorithm code of the algorithm obtained through the LLM evolution are generated simultaneously, or the algorithm description of the algorithm obtained through the LLM evolution is generated earlier than the algorithm code.

[0069] In some embodiments, before the processing module 702 uses LLM to perform crossover and / or mutation evolution on the screened algorithms through explicit guidance, it is also used to: determine the core part of the algorithm based on the candidate algorithms and / or the skeleton algorithm included in the algorithm design requirements; when the processing module 702 uses LLM to perform crossover and / or mutation evolution on the screened algorithms through explicit guidance, it is specifically used to: use LLM to perform crossover and / or mutation evolution on the core part included in the screened algorithms through explicit guidance.

[0070] In some embodiments, before storing the evolved algorithms into the algorithm pool, the processing module 702 is further configured to: determine whether the fitness values ​​of the evolved algorithms meet the requirements.

[0071] In some embodiments, the algorithm design requirements include: a skeleton algorithm, wherein the processing module 702, when using LLM to process the algorithm design requirements to obtain a candidate algorithm, is specifically used to: determine the core part of the skeleton algorithm, and, using LLM, generate a candidate algorithm according to the core part of the skeleton algorithm; or, using LLM, generate a candidate algorithm according to the skeleton algorithm.

[0072] In some embodiments, before outputting the target algorithm, the processing module 702 is further configured to iteratively simplify the target algorithm until the target algorithm meets the requirements or reaches a preset number of iterations or time.

[0073] In some embodiments, the algorithm design requirements also include: the output format of the LLM, wherein the output format includes: the format of the algorithm description, the function name of the output function in the algorithm code, and one or more of the input and output parameters in the algorithm code.

[0074] In some embodiments, Figure 7 The receiving module 701 and the processing module 702 shown in FIG can be implemented by software or hardware. For example, the implementation of the receiving module 701 is described below using the receiving module 701 as an example. Similarly, the implementation of the processing module 702 can refer to the implementation of the receiving module 701.

[0075] As an example of a software functional unit, the receiving module 701 may include code running on a computing instance. The computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Furthermore, the computing instance may be one or more. For example, the receiving module 701 may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code may be distributed in the same region or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including one data center or multiple geographically close data centers. Typically, a region may include multiple AZs.

[0076] Similarly, multiple hosts / virtual machines / containers running the code can be distributed within the same virtual private cloud (VPC) or across multiple VPCs. Typically, a VPC is set up within a region. Cross-region communication between two VPCs within the same region, or between VPCs in different regions, requires a communication gateway within each VPC to interconnect the VPCs.

[0077] As an example of a hardware functional unit, the receiving module 701 may include at least one computing device, such as a server. Alternatively, the receiving module 701 may be implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.

[0078] The multiple computing devices included in receiving module 701 can be distributed in the same region or in different regions. The multiple computing devices included in receiving module 701 can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in receiving module 701 can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of servers, ASICs, PLDs, CPLDs, FPGAs, GALs, and other computing devices.

[0079] It should be noted that, in other embodiments, the receiving module 701 can be used to execute any step in the algorithm design method based on LLM described in the above embodiment, and the processing module 702 can also be used to execute any step in the algorithm design method based on LLM described in the above embodiment. In addition, the receiving module 701 can also be combined with the processing module 702 to be responsible for executing any step in the algorithm design method based on LLM described in the above embodiment. In addition, the steps that the receiving module 701 and the processing module 702 are responsible for implementing can also be specified as needed, and different steps in the algorithm design method based on LLM described in the above embodiment can be implemented by the receiving module 701 and the processing module 702 respectively. Figure 7 The entire functionality of the LLM-based algorithm design device 700 is shown.

[0080] The present application also provides a computing device 800. Figure 8 As shown, computing device 800 includes a bus 802, a processor 804, a memory 806, and a communication interface 808. Processor 804, memory 806, and communication interface 808 communicate with each other via bus 802. Computing device 800 can be a server or a terminal device. It should be understood that this application does not limit the number of processors and memories in computing device 800.

[0081] The bus 802 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 8 The bus 804 may include a path for transmitting information between various components of the computing device 800 (eg, memory 806, processor 804, communication interface 808).

[0082] The processor 804 may include any one or more processors such as a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).

[0083] The memory 806 may include volatile memory, such as random access memory (RAM). The processor 804 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).

[0084] The memory 806 stores executable program codes, and the processor 804 executes the executable program codes to respectively implement the aforementioned Figure 7 The functions of the receiving module 701 and the processing module 702 shown in FIG are implemented to realize the algorithm design method based on LLM described in the above embodiment. That is, the memory 806 stores instructions for executing the algorithm design method based on LLM described in the above embodiment.

[0085] Alternatively, the memory 806 stores executable codes, and the processor 804 executes the executable codes to respectively implement the aforementioned Figure 7 The functions of the LLM-based algorithm design device 700 shown in FIG8 are implemented to realize the LLM-based algorithm design method described in the above embodiment. That is, the memory 806 stores instructions for executing the LLM-based algorithm design method described in the above embodiment.

[0086] The communication interface 808 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 800 and other devices or a communication network.

[0087] Embodiments of the present application also provide a computing device cluster. The computing device cluster includes at least one computing device. The computing device can be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device can also be a terminal device such as a desktop computer, a laptop computer, or a smartphone.

[0088] like Figure 9As shown, the computing device cluster includes at least one computing device 800. The memory 806 in one or more computing devices 800 in the computing device cluster may store the same instructions for executing the LLM-based algorithm design method described in the above embodiment.

[0089] In some possible implementations, the memory 806 of one or more computing devices 800 in the computing device cluster may also store some instructions for executing the LLM-based algorithm design method described in the above embodiment. In other words, the combination of one or more computing devices 800 can jointly execute the instructions for executing the LLM-based algorithm design method described in the above embodiment.

[0090] It should be noted that the memory 806 in different computing devices 800 in the computing device cluster can store different instructions, which are respectively used to execute the above Figure 7 The illustrated part of the functions of the LLM-based algorithm design apparatus 700 is shown. That is, the instructions stored in the memory 806 in different computing devices 800 can implement the functions of one or more modules in the receiving module 701 and the processing module 702.

[0091] In some possible implementations, one or more computing devices in a computing device cluster may be connected via a network, which may be a wide area network or a local area network. Figure 10 A possible implementation is shown. Figure 10 As shown, two computing devices 800A and 800B are connected via a network. Specifically, the connection to the network is achieved through a communication interface in each computing device. In this possible implementation, the memory 806 in computing device 800A stores instructions for executing the functions of receiving module 701. Simultaneously, the memory 806 in computing device 800B stores instructions for executing the functions of processing module 702.

[0092] It should be understood that Figure 10 The functionality of the computing device 800A shown in FIG. 8 may also be implemented by multiple computing devices 800. Similarly, the functionality of the computing device 800B may also be implemented by multiple computing devices 800.

[0093] The present application embodiment also provides another computing device cluster. The connection relationship between the computing devices in the computing device cluster can be similarly referred to as Figure 9 and Figure 10 The connection mode of the computing device cluster is different in that the memory 806 of one or more computing devices 800 in the computing device cluster may store the same instructions for executing the method in the above embodiment.

[0094] In some possible implementations, the memory 806 of one or more computing devices 800 in the computing device cluster may also store some instructions for executing the aforementioned LLM-based algorithm design method. In other words, the combination of one or more computing devices 800 can jointly execute the instructions for executing the aforementioned LLM-based algorithm design method.

[0095] Based on the method in the above embodiment, an embodiment of the present application provides a computer-readable storage medium, including computer program instructions. When the computer program instructions are executed by a computing device cluster comprising at least one computing device, the computing device cluster executes the method in the above embodiment. Exemplarily, the computer-readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center comprising one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive), etc.

[0096] Based on the method in the above embodiment, an embodiment of the present application provides a computer program product containing instructions. When the instructions are executed by a computing device, a computing device cluster including at least one computing device executes the method in the above embodiment.

[0097] It is understood that the processor in the embodiments of the present application may be a central processing unit (CPU), or may be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. The general-purpose processor may be a microprocessor or any conventional processor.

[0098] The method steps in the embodiments of the present application can be implemented by hardware or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, which can be stored in random access memory (RAM), flash memory, read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, mobile hard disks, CD-ROMs or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC.

[0099] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted via the computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state drive (SSD)).

[0100] It will be understood that the various numerical numbers involved in the embodiments of the present application are merely distinctions for the convenience of description and are not intended to limit the scope of the embodiments of the present application.

[0101] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the protection scope of the technical solutions of the embodiments of the present application.

Claims

1. An algorithm design method based on a large-scale language model, characterized in that: include: Receive algorithm design requirements, where the algorithm design requirements include: a problem description; Based on the algorithm design requirements, generating at least one candidate algorithm; The algorithm to be evolved is iteratively evolved using a large-scale language model (LLM) to obtain a target algorithm that meets the algorithm design requirements. The algorithm to be evolved includes: an evolved algorithm and / or the candidate algorithm. During each round of iteration, a prompt is generated based on the algorithm to be evolved, and the prompt is used to guide the evolution of the LLM.

2. The method according to claim 1, characterized in that The algorithm design requirements include: skeleton algorithm; The generating at least one candidate algorithm based on the algorithm design requirements includes: Based on the core part of the skeleton algorithm, the candidate algorithm is generated.

3. The method according to claim 1 or 2, characterized in that In any round of iteration, the evolutionary algorithm is evolved through LLM, including: Screening out at least one algorithm from an algorithm pool to obtain the algorithm to be evolved, wherein the algorithm pool includes: the evolved algorithm and the candidate algorithm; If the algorithms to be evolved include multiple algorithms, a first prompt is generated based on the algorithms to be evolved, and the first prompt is used to guide the LLM to perform crossover evolution on the algorithms included in the algorithms to be evolved; and / or, if the algorithms to be evolved include at least one algorithm, a second prompt is generated based on the algorithms to be evolved, and the second prompt is used to guide the LLM to perform mutation evolution on the algorithms included in the algorithms to be evolved; Input the first Prompt and / or the second Prompt into the LLM to evolve the algorithm to be evolved through the LLM.

4. The method according to claim 3, characterized in that Also includes: When the fitness value of the algorithm evolved through the LLM meets the requirement, retaining the algorithm evolved through the LLM; When the fitness value of the algorithm evolved through the LLM does not meet the requirement, the algorithm evolved through the LLM is discarded.

5. The method according to claim 3 or 4, characterized in that The first Prompt is used to guide the LLM to perform cross-evolution on the core part of the algorithm contained in the algorithm to be evolved, and the second Prompt is used to guide the LLM to perform mutation evolution on the core part of the algorithm contained in the algorithm to be evolved, wherein the core part of the algorithm contained in the algorithm to be evolved is determined based on the candidate algorithm and / or the skeleton algorithm contained in the algorithm design requirements.

6. The method according to any one of claims 1 to 5, characterized in that: The algorithm obtained through the LLM evolution includes: an algorithm description and an algorithm code, wherein the algorithm description and the algorithm code are generated at the same time, or the generation time of the algorithm description is earlier than the generation time of the algorithm code.

7. The method according to any one of claims 1 to 6, characterized in that: Also includes: The target algorithm is iteratively simplified until the target algorithm meets the requirements, or reaches a preset number of iterations or time.

8. The method according to any one of claims 1 to 7, characterized in that: The algorithm design requirements also include: the output format of the LLM, wherein the output format includes: the format of the algorithm description, the function name of the output function in the algorithm code, and one or more of the input and output parameters in the algorithm code.

9. An algorithm design device based on a large-scale language model, characterized in that: include: A receiving module is used to receive algorithm design requirements, wherein the algorithm design requirements include: a problem description; A processing module, configured to generate at least one candidate algorithm based on the algorithm design requirements; The processing module is further configured to iteratively evolve the algorithm to be evolved through a large-scale language model (LLM) to obtain a target algorithm that meets the algorithm design requirements. The algorithm to be evolved includes: an evolved algorithm and / or the candidate algorithm. During each round of iteration, a prompt is generated based on the algorithm to be evolved, and the prompt is used to guide the evolution of the LLM.

10. The device according to claim 9, characterized in that The algorithm design requirements include: skeleton algorithm; When the processing module generates at least one candidate algorithm based on the algorithm design requirements, it is specifically configured to: Based on the core part of the skeleton algorithm, the candidate algorithm is generated.

11. The device according to claim 9 or 10, characterized in that During any round of iteration, when the processing module is evolving the evolutionary algorithm through the LLM, it is specifically used to: Screening out at least one algorithm from an algorithm pool to obtain the algorithm to be evolved, wherein the algorithm pool includes: the evolved algorithm and the candidate algorithm; If the algorithms to be evolved include multiple algorithms, a first prompt is generated based on the algorithms to be evolved, and the first prompt is used to guide the LLM to perform crossover evolution on the algorithms included in the algorithms to be evolved; and / or, if the algorithms to be evolved include at least one algorithm, a second prompt is generated based on the algorithms to be evolved, and the second prompt is used to guide the LLM to perform mutation evolution on the algorithms included in the algorithms to be evolved; Input the first Prompt and / or the second Prompt into the LLM to evolve the algorithm to be evolved through the LLM.

12. The device according to claim 11, characterized in that The processing module is further configured to: When the fitness value of the algorithm evolved through the LLM meets the requirement, retaining the algorithm evolved through the LLM; When the fitness value of the algorithm evolved through the LLM does not meet the requirement, the algorithm evolved through the LLM is discarded.

13. The device according to claim 11 or 12, characterized in that The first Prompt is used to guide the LLM to perform cross-evolution on the core part of the algorithm contained in the algorithm to be evolved, and the second Prompt is used to guide the LLM to perform mutation evolution on the core part of the algorithm contained in the algorithm to be evolved, wherein the core part of the algorithm contained in the algorithm to be evolved is determined based on the candidate algorithm and / or the skeleton algorithm contained in the algorithm design requirements.

14. The device according to any one of claims 9 to 13, characterized in that: The algorithm obtained through the LLM evolution includes: an algorithm description and an algorithm code, wherein the algorithm description and the algorithm code are generated at the same time, or the generation time of the algorithm description is earlier than the generation time of the algorithm code.

15. The device according to any one of claims 9 to 14, characterized in that: The processing module is further configured to: The target algorithm is iteratively simplified until the target algorithm meets the requirements, or reaches a preset number of iterations or time.

16. The device according to any one of claims 9 to 15, characterized in that: The algorithm design requirements also include: the output format of the LLM, wherein the output format includes: the format of the algorithm description, the function name of the output function in the algorithm code, and one or more of the input and output parameters in the algorithm code.

17. A computing device cluster, characterized in that: comprising at least one computing device, each computing device including a processor and a memory; The processor of the at least one computing device is configured to execute instructions stored in a memory of the at least one computing device, so that the computing device cluster executes the method according to any one of claims 1 to 8.

18. A computer-readable storage medium, characterized in that The method comprises computer program instructions, which, when executed by a computing device cluster, enable the computing device cluster to perform the method according to any one of claims 1 to 8, wherein the computing device cluster comprises at least one computing device.

19. A computer program product comprising instructions, characterized in that When the instructions are executed by a computing device cluster, the computing device cluster is caused to perform the method according to any one of claims 1 to 8, wherein the computing device cluster includes at least one computing device.

Citation Information

Cited By

  • Line balance optimization algorithm automatic design method driven by large language model

    CN121435700A