Automatic heuristic algorithm planning method based on large language model
By combining the rapid and complex reflection mechanisms of large language models with Monte Carlo tree search, the heuristic strategy is dynamically optimized, solving the problem of insufficient strategy summarization and evolutionary feedback in existing technologies. This achieves improvements in the efficiency, diversity, and robustness of heuristic algorithms.
Patent Information
- Application Number
- CN202511332411.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-18
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2045-09-18
AI Technical Summary
Existing technologies, in the heuristic algorithm design that combines large language models with Monte Carlo tree search, have failed to systematically utilize the reasoning advantages of large language models in policy summarization and evolutionary feedback, resulting in limited improvement in algorithm performance.
We employ an automatic heuristic algorithm planning method based on a large language model, combined with Monte Carlo tree search. Through rapid reflection and complex reflection mechanisms, we dynamically optimize the heuristic strategy and leverage the abstract reasoning and generative capabilities of the large language model to improve the efficiency and generalization ability of the search process.
It significantly improves the diversity and adaptability of heuristic algorithms, and enhances the performance and robustness of algorithms in combinatorial optimization problems such as complex path planning.
Smart Images

Figure CN120832937A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the field of path planning, and particularly relates to an automatic heuristic algorithm planning method based on Monte Carlo tree search and large language model fast reflection and complex reflection. BACKGROUND
[0002] Combination optimization problems have important theoretical and practical values in many fields such as national defense, transportation, industry and communication, so efficient solution of these problems has become a common research focus of the academic and industrial circles. Heuristic methods, as an effective means to solve combination optimization problems, have shown excellent performance after extensive research. Typical heuristic methods include guided local search algorithms, genetic algorithms and ant colony algorithms. However, manual parameter adjustment for specific problems is usually required by experts in the field to obtain satisfactory solutions using these methods. Although the artificially designed heuristic method performs excellently in many scenarios, this method requires experts to invest a lot of time in design, implementation and verification. Therefore, automatic heuristic algorithm design has gradually become a promising alternative solution.
[0003] The traditional heuristic design process highly depends on expert knowledge and a large number of trial and error costs. Although there have been attempts in recent years to combine the powerful semantic modeling capabilities of large language models (LLMs) with the efficient search mechanism of Monte Carlo tree search (MCTS) to achieve automatic design of heuristic algorithms, there is still significant room for improvement in their performance in practical applications. One of the key shortcomings is that existing methods fail to systematically utilize the reasoning advantages of large language models in strategy summarization and evolutionary feedback. SUMMARY
[0004] The application proposes an intelligent heuristic algorithm planning method that combines large language models and Monte Carlo tree search. This method utilizes the efficient search capabilities of MCTS and the abstract reasoning and generation advantages of LLMs to achieve dynamic optimization and automatic evolution of heuristic strategies.
[0005] To achieve the above technical purposes, the technical solution adopted by the application is as follows: an automatic heuristic algorithm planning method based on a large language model, which comprises the following steps: Step 1, initialization and problem modeling, by guiding large language models to start from a basic heuristic, combining multiple cognitive perspectives to generate a set of candidate algorithms, providing diverse starting points for the search space; to control the computational cost of heuristic algorithm generation and evaluation, the system presets the maximum number of evaluations to limit the overall search budget. Subsequently, relying on the understanding ability of large language models to task context, a set of heuristic candidate solutions is initialized, and the initial solution space of Monte Carlo tree search is constructed. In the subsequent "selection- reflection-expansion-simulation-backpropagation" iterative framework, the system gradually explores potential high-performance algorithms. To enhance the efficiency and generalization ability of the search process, a double-level reflection mechanism based on large language models is introduced: first, rapid reflection compares and analyzes the performance differences between current candidate solutions, extracts effective features and typical defects in heuristic design, and forms efficient feedback; second, complex reflection generates structured deep analysis based on rapid reflection, covering key feature extraction, improvement suggestions, bad strategy avoidance, and theoretical explanation, thereby providing more targeted and adaptive guidance for the next round of heuristic generation. The language model-assisted dynamic reflection mechanism not only improves the diversity and adaptability of heuristic algorithms, but also promotes the discovery of better structures in the solution space. By combining the global search ability of MCTS with the semantic understanding and cognitive reflection ability of LLM, the system effectively guides the heuristic algorithm generation process, thereby significantly improving algorithm performance and robustness in complex path planning and other combinatorial optimization problems.
[0006] Step 2, configure the core parameters of Monte Carlo tree search; in this step, prompt engineering needs to be designed for large language models to generate new heuristic algorithms in subsequent state transitions. The input content for rapid reflection and complex reflection includes the selected reflection heuristic algorithm code, the generation instructions and context information that the model needs to execute, and the output covers the strategy features and update suggestions summarized by the model; the input content for expanding nodes to generate new heuristic algorithms includes the selected existing heuristic algorithm code, the improvement suggestions obtained from rapid reflection and complex reflection, and related background information. The output results include a brief textual description of the new heuristic algorithm, heuristic algorithm code, etc.
[0007] Step 3, in each iteration process, a Monte Carlo tree search is used to start planning in the heuristic space, which consists of five core stages: selection, reflection, expansion, simulation, and backpropagation; in this step, the Monte Carlo tree search method is started for path planning. The algorithm iteratively performs the "selection-reflection-expansion-simulation-backpropagation" five stages. The selection stage starts from the root node (initial heuristic algorithm) and selects the best child node (optimized heuristic algorithm) according to the upper confidence bound (UCT) formula for subsequent operation. The reflection stage uses the inductive ability of the language model to refine the existing solution pattern and summarize the structure, improving the system's control and adaptation ability to heuristic evolution, and effectively promoting the continuous exploration and optimization of the solution space. The expansion stage traverses the defined actions to generate new heuristic methods. This stage realizes state transition, which needs to input the previous heuristic method and the experience summary obtained by reflection into the large language model, and generates new heuristic nodes according to the prompt engineering.
[0008] Step 4, after all iterations are completed, return the path with the highest average reward and its corresponding best heuristic algorithm to ensure the global optimality of the final solution; in this step, the simulation and backpropagation processes in the Monte Carlo tree search are executed. In the simulation stage, each legal heuristic node obtained is executed to obtain the reward value by the evaluation function. After simulation, enter the backpropagation stage, starting from the leaf node or terminal node, return the cumulative reward on the path to the root node, and update the cumulative reward list of each node along the way. Finally, select the heuristic algorithm with the highest reward value as the final output, which is the optimized heuristic search algorithm for the current problem.
[0009] The beneficial effects of the present application relative to the prior art are:
[0010] (1) Unlike the previous method of embedding a large model into the search process, the present application introduces a language-driven feedback mechanism that can extract general experience from historical strategies and generate new algorithm structures with greater potential, thereby continuously optimizing the search path. The mechanism can automatically extract effective experience from the heuristic strategies generated in history, realize real-time feedback adjustment and strategy induction optimization of heuristic structures, and significantly enhance the knowledge transfer and generalization ability in the search process.
[0011] (2) Instead of providing fixed rules, the framework builds a heuristic optimization system that can evolve itself and has universality. Experimental verification shows that this method performs better in terms of adaptability, convergence speed, and solution diversity in multiple types of combinatorial optimization tasks, demonstrating the great potential of large models in automatic algorithm design. BRIEF DESCRIPTION OF DRAWINGS
[0012] Figure 1An optional flowchart of the method of the automatic heuristic algorithm based on large language model of the present application; Figure 2 A system diagram for internal execution of the algorithm of the present application; Figure 3 Prompt words of predefined actions in the extension process of the present application; Figure 4 Examples of quick reflection and complex reflection of the present application; Figure 5 Pseudo-code diagram of the automatic heuristic algorithm of the present application. DETAILED DESCRIPTION
[0013] In order to make the purpose, technical scheme and advantages of the present application more clear, the present application is further described in detail below in combination with the drawings and examples. It should be understood that the specific examples described herein are only used to explain the present application and do not limit the present application.
[0014] The steps in the present application are arranged with labels, but are not used to limit the order of the steps. Unless the order of the steps is explicitly stated or the execution of a certain step needs other steps as a basis, the relative order of the steps can be adjusted. It can be understood that the term "and / or" used herein relates to and covers any and all possible combinations of one or more of the associated listed items.
[0015] The automatic heuristic planning method of quick reflection and complex reflection based on Monte Carlo tree search and large language model can significantly optimize the performance of the initial search method, while greatly reducing the artificial dependence on domain expertise. Specifically, Figure 1 An optional flowchart of the method is shown.
[0016] As Figures 1-5 shown, the automatic heuristic algorithm planning method based on large language model includes the following steps: Step 1: The system first sets the maximum evaluation of the heuristic algorithm. On this basis, the large language model is guided to generate a set of candidate solutions with diversity and potential effectiveness based on the initial heuristic as the starting point. This stage aims to provide a wide coverage and representative starting distribution for subsequent search, thereby enhancing the efficiency of the exploration process and the generalization ability of the solution. Subsequently, the system sequentially performs key stages such as "selection-reflection-extension-simulation-backpropagation", gradually advancing the evolution optimization of the heuristic algorithm. This process improves the guidance efficiency and adaptability of the algorithm in path planning tasks through continuous feedback and strategy adjustment; initialization includes setting the maximum number of evaluations, specifying the task environment, and configuring the basic parameters of the search algorithm; the task environment at least includes the initial state, the target state, and the constraint conditions.
[0017] Step 2: Configure the core parameters of Monte Carlo tree search, including at least the maximum number of evaluations, selection strategy, number of initial nodes, and early stopping mechanism. In the selection phase, the maximum number of evaluations is Max_fe=1000; the UCT (Upper Confidence Bound applied to Trees) function is used as the node selection strategy, where the formula of UCT is , represents the reward value of the current node, q max and q min represent the upper and lower bounds of the reward value that has appeared in the MCTS process, is the visit count of the parent node, is the visit count of the current node. The UCT formula dynamically balances "digging known high return actions" and "exploring potential better actions" through mathematical means, which is the key to the efficiency of MCTS. In order to achieve more comprehensive search in the early iterations of MCTS and ensure convergence in the later period, the exploration weight in this invention adopts an exploration decay method, with the formula , where T represents the total search steps and t is the current step number, to balance the relationship between exploration and exploitation. At the same time, the initial population size and evaluation time limit are set, and when the heuristic algorithm evaluation time exceeds the limit time, unnecessary calculation overhead is abandoned. In addition, the reward function of state transition (R=0 st ) is designed, where 0 st represents the target value obtained by the heuristic algorithm generated by the large language model through the evaluation function on the test set; this design ensures accurate evaluation of the optimization effect of each node. By reasonably setting these parameters, an efficient search framework is provided for Monte Carlo tree search, thereby improving the performance and stability of the overall optimization process.
[0018] Step 3: In each iteration process, Monte Carlo tree search is used to start planning within the heuristic space, which consists of five core stages: selection, reflection, expansion, simulation, and backpropagation. The input content for the large language model design prompt engineering includes the selected reflection heuristic algorithm code, the generation instruction to be executed by the model, and its context information. The output includes the strategy features and update suggestions summarized by the model; the input content for expanding nodes to generate new heuristic algorithms includes the selected existing heuristic algorithm code, the improvement suggestions obtained from quick reflection and complex reflection, and related background information. The output results include a brief textual description of the new heuristic algorithm, the heuristic algorithm code, etc. The specific steps are as follows: Step 31: In the selection phase, the root node is taken as a virtual node, the heuristic algorithm is initialized as the child node of the root node, and the UCT value of the optimized heuristic algorithm of each sub-node is used to dynamically select the optimal node for expansion; Step 32: Select the expansion population and perform fast reflection of LLMs. Based on the response returned by LLMs, perform complex reflection of LLMs again to obtain guidance and experience for deep-level strategy optimization; Step 33: In the expansion phase, based on the guidance and experience of complex reflection and the selected expansion population node algorithm, input the large language model to perform cross and mutation actions to generate new optimized heuristic algorithms; Step 34: In the simulation phase, the newly obtained heuristic algorithm is evaluated to obtain the reward value, and the simulation process ends; Step 35: In the backpropagation phase, the cumulative reward of the leaf node is traced back to the root node, and the cumulative reward list, node access times, current global maximum reward value and current global minimum reward value of each node on the path are updated.
[0019] Step 4: Start the Monte Carlo tree search method to find better heuristic algorithms. MCTS iteratively performs the "selection-reflection-expansion-simulation-backpropagation" five stages to gradually optimize the search process. In the selection phase, starting from the root node, the UCT value of each sub-node (optimized heuristic algorithm) is calculated according to the upper confidence bound (UCT) formula, and the sub-node with the highest UCT value is selected as the path for subsequent search, thereby guiding the search process to advance towards better heuristic algorithms.
[0020] Step 32: Introduce large models for fast reflection and complex reflection processes; Fast reflection: Based on the performance of the current candidate solution group, the model is guided to summarize and compare from multiple angles, extract potential optimization clues, and provide lightweight references for subsequent strategy evolution; Complex reflection: Based on existing feedback, introduce more extensive historical information and performance differences to promote the model to comprehensively analyze multiple heuristic clues and generate optimization suggestions with strategic guidance value. In the reflection phase, fast reflection sorts the current candidate heuristic according to the target value, inputs its description, performance and code into the large language model, and guides it to compare and analyze two by two, extract differential performance and general optimization experience. This process generates concise analysis results and heuristic suggestions to provide preliminary guidance for subsequent expansion. Complex reflection introduces historical optimal solution experience and negative strategy examples based on fast reflection, constructs multi-source input, and guides the large language model to perform comprehensive analysis. The model output includes keywords, suggestions, risk prompts and explanations, providing deeper strategy optimization direction and supporting high-quality search evolution.
[0021] Step 33: In the expansion phase, the system traverses the preset four expansion actions (e1, e2, m1, m2) to evolve and generate heuristic algorithms for the selected nodes. The expanded nodes include those selected by the UCT strategy and high-quality nodes sampled from the elite function set. Each expansion operation inputs the following into the large language model: the structure and performance of the candidate algorithm, the relevant implementation code, and the experience information summarized in the reflection phase. Figure 2 is the prompt word for the large model to implement each action, based on which the model analyzes and generates new heuristic methods, including: e1: input the node pair and its ranking, combined with the experience information obtained in the reflection, to guide the model to generate an improved algorithm; e2: input the current global optimal algorithm and long-term experience, to guide the model to generate an algorithm with structural innovation, and evaluate its contribution to update the experience library; m1: based on the current algorithm, generate a new algorithm with different structure but continued strategy, and introduce new mechanisms; m2: identify key parameters and equation relationships, and generate an algorithm version with changes in parameter settings and logical structure. Each execution of the preset action generates a specified number of new heuristic nodes, enriching the search space and providing more possibilities for subsequent simulation and optimization.
[0022] Step 34: In the simulation phase, the system executes each candidate heuristic algorithm generated in the expansion phase one by one, and evaluates its solving ability on specific combinatorial optimization problems by applying these algorithms on standard test sets. Specifically, the system calls predefined evaluation functions to quantify the performance of each heuristic algorithm on multiple instances, and calculates the objective function value. Based on the evaluation results, a unified reward value (Reward) is further converted as the performance feedback of the heuristic node, which is used to support subsequent backtracking updates and search strategy adjustments.
[0023] Step 35: In the backpropagation phase, the cumulative reward obtained from the simulation phase is backtracked along the search path to the root node, updating the statistical information of each node on the path, including the number of visits and cumulative reward value. This process helps the algorithm more accurately evaluate the potential performance of each node by passing the reward value of the leaf node layer by layer. By continuously updating the Q value of the nodes, the backpropagation process ensures that the search strategy can be dynamically adjusted, thereby improving the overall optimization efficiency and effectiveness.
[0024] Step 5: After execution, multiple paths from the root node to the leaf node are generated. Finally, the heuristic algorithm with the highest reward value is selected as the final output. This output is the heuristic search algorithm optimized for the current problem.
[0025] Step 6: The framework iteratively executes the "selection-reflection-expansion-simulation-backpropagation" five stages to systematically explore the heuristic space. The invention evaluates the state obtained in each simulation until the simulation ends, generating a state s tThe quality of a heuristic is evaluated by a reward function: r t = r(s t , a t ) where a t denotes the action at time t, and the reward function is defined as the solution of the instance. This process is repeated iteratively, converging to better heuristics step by step. When a predefined number of evaluations is reached or a convergence condition is satisfied, the algorithm terminates, and the best trajectory and its corresponding node are selected from the search tree for the final evaluation. Through this mechanism, the framework is able to find high-performance solutions in the complex heuristic space.
[0026] Table 1 Performance of the framework under different scales based on the step-by-step construction strategy
[0027] Table 1 shows the performance of the proposed framework in the Knapsack Problem (KP) example under different scales based on the step-by-step construction strategy. The step-by-step construction framework, also known as the constructive heuristic framework, is a simple and flexible task solving method that incrementally forms the solution to a problem by constructing nodes in the feasible Combinatorial Optimization (CO) solution. This framework is not only a general paradigm for Automatic Heuristic Design (AHD) methods based on Large Language Models (LLM), but also one of the most widely used solving frameworks in the field of Neural Combinatorial Optimization (NCO).
[0028] KP is a typical combinatorial optimization problem, which aims to select a number of items in a knapsack with a given capacity W to maximize the total value of the selected items, and each item can only be selected once. The solution s of KP is represented as a subset of {1,2,…,N}, indicating the index set of the selected items. Following the approach of Kool et al., synthetic datasets are generated for KP. Each problem instance contains N items, each represented by a two-dimensional vector (vi,wi), where vi represents the value of the item and wi represents the weight of the item, both independently sampled from a uniform distribution in the interval [0,1). For each problem scale (e.g. N=50,100,200), multiple groups of instances are generated, and the data is stored in the form of a three-dimensional array (instance number, N, 2) for training, validation and testing. The capacity of the knapsack W is proportional to the problem scale: in instances containing 100 and 200 items, the capacity is set to W=25, and in instances containing 50 items, the capacity is set to W=12.5.
[0029] The experimental results, shown in Table 1, systematically compare the performance of different methods using two metrics: objective function value (Obj.↑) and optimality gap (Gap). The results demonstrate that the proposed framework demonstrates superior solving capabilities across all KP instance sizes. For the small problem with N = 50, the proposed method achieved an objective function value of 19.996, with an optimality gap of 0.21%, on par with the current state-of-the-art large-scale method, MCTS-AHD, and outperformed Funsearch (0.24%) and the traditional constructive greedy heuristic, Construct (2.12%). For the medium-sized problem with N = 100, the proposed framework further reduced the optimality gap to 0.09%, significantly outperforming MCTS-AHD (0.10%), Funsearch (0.11%), and traditional greedy methods (Greedy: 0.12%, Construct: 1.48%). In the large-scale problem with N=200, the proposed method achieved an optimal objective value of 57.405, with an optimality gap of only 0.07%. It not only surpassed all baseline methods (MCTS-AHD: 0.12%, Funsearch: 0.09%), but also significantly outperformed the hand-designed heuristic algorithms Greedy (0.09%) and Construct (0.31%).
[0030] Overall, the framework consistently generates near-optimal solutions for KP instances of varying sizes and demonstrates enhanced robustness and generalization capabilities for larger and more complex problems, significantly outperforming traditional heuristic methods and existing automated heuristic design methods based on large language models. This result fully demonstrates the superior performance and application potential of the proposed method in combinatorial optimization tasks.
[0031] Table 2 shows the performance of the framework based on the ant colony algorithm strategy at different scales.
[0032] Table 2 shows the performance of the proposed framework at different scales on the Multiple Knapsack Problem (MKP) example using the Ant Colony Algorithm (ACO) strategy. ACO is an optimization algorithm inspired by the foraging behavior of ants. Its core consists of a heuristic matrix and a path selection mechanism, which simulates the pheromone transfer process between ants to solve combinatorial optimization problems. The AHD method based on the Large Language Model (LLM) can design the generating function of the heuristic matrix, thus transforming ACO into a general framework that can be applied to a variety of tasks.
[0033] Following the setting way of ReEvo on the multiple knapsack problem (MKP) instances, the value of each item vi is uniformly sampled from the interval Uniform(0, 1), and for each knapsack i∈{1,…,m} and each item j∈{1,…,n}, its corresponding weight is also uniformly sampled from the interval Uniform(0, 1). The capacity of each knapsack i∈{1,…,m} is also uniformly sampled from the interval For each problem size (e.g., N=100, 200), multiple groups of instances are generated for training, validation, and testing. The number of ants is set to 10, and the number of iterations is 50 when running on the evaluation dataset D and 100 when running on the test set.
[0034] The experimental results are shown in Table 2, which systematically compares the solving performance of different methods on MKP, with evaluation indicators including objective function value (Obj.↑) and optimality gap (Gap). In the medium-sized N=100, m=5 instances, the method of achieves an optimal objective value of 23.294 with an optimality gap of 0.00%, which not only significantly outperforms the traditional ACO method (objective value of 22.738, Gap of 2.39%) and its deep learning extension DeepACO (Gap of 0.86%), but also surpasses all existing AHD methods based on large language models, including EOH (Gap of 0.67%), ReEvo (0.21%), and MCTS-AHD (0.11%). In the more challenging N=200, m=5 large-scale test set, the framework further demonstrates excellent solving ability, reaching a highest objective function value of 42.542 and maintaining an optimality gap of 0.00%, which is superior to all comparison methods, with MCTS-AHD having a Gap of 0.11%, ReEvo having a Gap of 0.30%, and the traditional ACO method having a Gap of even 4.40%.
[0035] In summary, the experimental results fully demonstrate that the proposed framework not only achieves optimal performance on medium-sized MKP problems, but also consistently outputs high-quality solutions when faced with larger-scale and more complex instances, exhibiting good generalization ability and robustness. The outstanding performance of this method on the multiple knapsack problem further verifies its effectiveness in combining large language models and meta-heuristic frameworks, providing new ideas and strong technical support for solving a wider range of combinatorial optimization problems.
[0036] Figure 4The input and output examples of the "quick reflection operation" and "complex reflection operation" performed for the KP (Knapsack Problem) task are shown in the figures. The first figure illustrates the overall process of the "quick reflection operation". The process collects code information from multiple heuristic algorithms (such as the first, second, third, and fourth heuristics), goes through the quick reflection link, and outputs the current self-reflection content. Self-reflection emphasizes significantly improving the performance of heuristic algorithms by incorporating multi-aspect evaluation criteria and adaptability into the selection process, obtaining lower target values, and dynamically adjusting to adapt to changes in the problem environment. The second figure shows the specific implementation content of the "complex reflection operation". Complex reflection is based on the results of quick reflection, and is refined into structured text containing four elements: keywords, suggestions, avoidance, and explanation. The keywords extract core content such as "multi-aspect evaluation, adaptability, dynamic adjustment, problem environment"; the suggestions emphasize adjusting a variety of performance indicators and providing real-time feedback adjustments; the avoidance points out the disadvantages of rigid strategies; and the explanation explains that by enhancing the flexibility of the algorithm and the extensive evaluation criteria, the optimization environment can be better adapted to changes, achieving lower target values. Overall, the self-reflection process of heuristic algorithms is systematized from quick overall cognition to in-depth structured analysis, providing theoretical and practical guidance for designing better heuristic algorithms.
[0037] It will be obvious to a person skilled in the art that the application is not limited to the details of the above-described exemplary embodiments and can be implemented in other concrete forms without departing from the spirit or essential characteristics of the application. The embodiments should therefore be considered in all respects as illustrative and not restrictive, the scope of the application being defined by the appended claims rather than that of the above description, and it is therefore intended that all changes and modifications that come within the meaning and range of equivalency of the claims are to be embraced by the application. Any reference signs in the claims should not be construed as limiting the claims to the figures in which the reference signs are used.
[0038] Furthermore, it should be understood that, although the present specification is described in terms of embodiments, not every implementation can contain all of the features that are described in this implementation, this mode of describing the specification is merely for the sake of clarity, and those skilled in the art should consider the specification as a whole, and the technical solutions in each embodiment can be properly combined to form other embodiments that those skilled in the art can understand.
Claims
1. A large language model-based automatic heuristic algorithm planning method, characterized in that, The method comprises the following steps: Step 1, initialization and problem modeling, by guiding the large language model from a basic heuristic, combining multiple cognitive perspectives to generate a candidate algorithm set, providing a diversified starting point for the search space; Step 2, configure the core parameters of Monte Carlo tree search; Step 3, in each iteration process, use Monte Carlo tree search to start planning in the heuristic space, which consists of five core stages: selection, reflection, expansion, simulation and backpropagation; Step 4, after all iterations are completed, return the path with the highest average reward and the corresponding best heuristic algorithm to ensure the global optimality of the final solution.
2. The automatic heuristic algorithm planning method based on a large language model according to claim 1, characterized in that, Initialization includes setting the maximum number of evaluations, specifying the task environment, and configuring the basic parameters of the search algorithm; Specifying the task environment at least includes the initial state, the target state and the constraint conditions.
3. The automatic heuristic algorithm planning method based on a large language model according to claim 2, characterized in that, The core parameters in step 2 at least include the maximum number of evaluations, the selection strategy, the number of initial nodes and the early stopping mechanism; The maximum number of evaluations is Max_fe=1000; The selection strategy uses the UCT function: ; ; In the above formula, T represents the total number of search steps, t is the current step, To explore the weight, initialized to 0.1; represents the reward value of the current node, q max and q min respectively represent the upper and lower bounds of the reward value that has appeared in the Monte Carlo tree search process, is the number of visits to the parent node, is the number of visits to the current node.
4. The automatic heuristic algorithm planning method based on large language model according to claim 3, characterized in that, The specific steps in step 3 are as follows: Step 31: In the selection stage, the root node is taken as a virtual node, and the heuristic algorithm is initialized as the child node of the root node. According to the UCT value of the optimized heuristic algorithm of each child node, the optimal node is dynamically selected for expansion; Step 32: Select the expansion population, perform fast reflection of the large language model, and perform complex reflection of the large language model again according to the reaction returned by the large language model to obtain guidance and experience for deep strategy optimization; Step 33: In the expansion stage, based on the guidance and experience of complex reflection and the selected expansion population node algorithm, input the large language model to perform cross and mutation actions to generate new optimized heuristic algorithms; Step 34: In the simulation stage, the newly obtained heuristic algorithm is evaluated to obtain the reward value, and the simulation process is completed; Step 35: In the backpropagation stage, the cumulative reward of the leaf node is traced back to the root node, and the cumulative reward list, node access times, current global maximum reward value and current global minimum reward value of each node on the path are updated.
5. The automatic heuristic algorithm planning method based on a large language model according to claim 4, characterized in that, In step 32, the process of fast reflection and complex reflection is introduced by introducing the large model; Fast reflection: based on the performance of the current candidate solution group, the model is guided to induce and compare it from multiple angles, extract potential optimization clues, and provide lightweight reference for subsequent strategy evolution; Complex reflection: based on the existing feedback, introduce more extensive historical information and performance differences to promote the model to comprehensively analyze multiple heuristic clues and generate optimization suggestions with strategic guidance value.
6. The automatic heuristic algorithm planning method based on a large language model according to claim 4, characterized in that, In step 33, the process of defining expansion actions to generate new heuristic algorithms is defined; Four actions are defined: e1: input two candidate algorithms with significant performance differences into the large language model, and attach the analysis obtained by fast reflection and the experience obtained by complex reflection to guide it to generate a fusion new algorithm; e2: Use the current optimal algorithm and complex reflection experience to let the large language model output new heuristic algorithms with innovative mechanisms; m1: Based on the current algorithm, generate new algorithms with different structures but continued strategies, and introduce new mechanisms; m2: Identify key parameters and equation relationships to generate algorithm versions with changes in parameter settings and logical structures.
7. The automatic heuristic algorithm planning method based on a large language model according to claim 4, characterized in that, In step 35, during the backpropagation phase, the cumulative reward obtained from the simulation phase is traced back along the search path to the root node, and the statistical information of each node on the path is updated, including the number of visits and the cumulative reward value.
8. The automatic heuristic algorithm planning method based on a large language model according to any one of claims 3-7, characterized in that, The Monte Carlo tree search in step 2 is specifically configured as follows: after selecting a node according to the UCT equation, select an expansion population, perform fast reflection and complex reflection, and then the UCT selected node can traverse the defined expansion actions: e1, e2, m1, m2, and the selection of the expansion population nodes: select the node with the highest UCT value and sample in a dynamically maintained elite heuristic function set.
9. The automatic heuristic algorithm planning method based on a large language model according to claim 8, characterized in that, Each Monte Carlo tree search iteration can produce dozens of nodes; After the algorithm iteration is completed, the heuristic method with the highest reward is selected as the final output.
10. The automatic heuristic algorithm planning method based on a large language model according to claim 9, characterized in that, The generated state s t The quality of the action a t is evaluated by the reward function: r t = r(s t , a t ) at time t, where the reward function is defined as the solution of the instance.
Citation Information
Patent Citations
Complex problem reasoning method based on dynamic collaboration of large language model and domain knowledge base
CN118798368A
Plug-and-play security enhancement method and system based on large model self-reflection mechanism
CN120105431A
Large model self-reflection safety knowledge condensation method and system
CN120217358A
Construction progress plan intelligent generation method based on Monte Carlo tree search algorithm
CN120562765A
Method for Automatic Calculating the Quantity of Material for Reinforced Concrete Construction And Thereof System
KR102439031B1
Cited By
Feature generation method based on symbolic language numerical perspective fusion
CN121145158A
A feature generation method based on symbol language numerical perspective fusion
CN121145158B
Intelligent task planning method and system based on large language model and Monte Carlo tree search
CN121478500A
Automatic feature engineering method based on Monte Carlo tree search and large language model
CN121561385A
Automatic feature engineering method based on monte carlo tree search and large language model
CN121561385B
