Intelligent evolution optimization method based on large language model driving

By using a large language model-driven intelligent evolutionary optimization method, the problems of low initial solution quality and easy getting trapped in local optima in traditional evolutionary optimization algorithms are solved, realizing an efficient and intelligent optimization process and improving the ability to solve complex optimization problems.

CN121144478APending Publication Date: 2025-12-16XIAN UNIV OF TECH
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511004015.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-21
Publication Date
2025-12-16

AI Technical Summary

Technical Problem

Existing evolutionary optimization algorithms (such as particle swarm optimization (PSO) and genetic algorithm (GA)) suffer from problems such as low initial solution quality, easy getting trapped in local optima, and insufficient computational efficiency when solving complex optimization problems, especially when dealing with multi-objective and multi-constraint industrial-grade optimization problems.

Method used

An intelligent evolutionary optimization method driven by a large language model (such as DeepSeek) is adopted. Through semantic understanding, natural language descriptions are transformed into structured mathematical models, generating high-quality initial solutions. The algorithm parameters are dynamically adjusted through lightweight API interaction to avoid local optima and provide interpretable decision outputs.

Benefits of technology

It significantly improves the quality of initial solutions and the convergence efficiency of the algorithm. For example, in the 0-1 knapsack problem, it only takes 5 generations to converge to the optimal solution, which is 80%-90% faster than traditional methods. In Rosenbrock function optimization, the convergence generation is reduced from 80 generations to 65 generations (PSO) and 30 generations (GA), the fitness of the initial solution is improved by 99%, and the computational cost is reduced by 85%.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121144478A_ABST
    Figure CN121144478A_ABST
Patent Text Reader

Abstract

The invention relates to the field of artificial intelligence and optimization algorithms, in particular to an intelligent evolution optimization method based on large language model driving. According to the method, semantic comprehension and reasoning capabilities of large language models such as DeepSeek and the like are deeply embedded into a core process of a traditional evolutionary optimization algorithm (PSO, GA), a'semantic cognition-dynamic decision 'double-loop mechanism is constructed, and full-process optimization from problem modeling, intelligent search to explainable output is realized. According to the method, the effectiveness of the method is verified on two typical optimization scenes of a 0-1 knapsack problem (discrete type) and Rosenbrock and Sphere function (continuous type), and through semantic-driven population initialization, dynamic parameter regulation and control and a closed loop feedback mechanism, the core problems that a traditional algorithm is low in initial solution quality, prone to local optimum, insufficient in calculation efficiency and the like are effectively solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence and optimization algorithms, and more particularly to an intelligent evolutionary optimization method that integrates the semantic understanding capabilities of a large language model (LLM), specifically an intelligent evolutionary optimization method driven by a large language model. Background Technology

[0002] Existing evolutionary optimization algorithms (Particle Swarm Optimization (PSO) and Genetic Algorithm (GA)) have fundamental flaws when solving complex optimization problems. These algorithms typically employ random initialization strategies, resulting in low-quality initial solutions. For example, in the 0-1 knapsack problem, over 90% of the initial solutions violate the weight constraint. This not only increases the overhead of ineffective computation but also significantly reduces the algorithm's convergence efficiency.

[0003] Traditional evolutionary algorithms cannot understand the semantic information of optimization problems (such as the physical meaning of constraints or the geometric properties of the objective function). For example, in Rosenbrock function optimization, the algorithm cannot perceive the terrain features of "narrow valleys," causing the particle swarm to easily get trapped in local optima. This semantic-level disconnect makes it difficult for the algorithm to dynamically adjust its search strategy according to the characteristics of the problem, severely limiting its application in complex scenarios.

[0004] Current optimization processes heavily rely on manual modeling and parameter tuning. Engineers need to transform real-world problems into precise mathematical models and manually set algorithm parameters (such as mutation probabilities and inertia weights). This is not only time-consuming and labor-intensive but also prone to introducing human bias, making it difficult for the algorithm to achieve optimal performance. This deficiency is particularly pronounced when dealing with multi-objective, multi-constraint industrial-grade optimization problems. Therefore, there is a need to propose an intelligent optimization framework that can automatically understand problem semantics, intelligently generate high-quality initial solutions, and possess dynamic adaptability to overcome these fundamental limitations of traditional evolutionary algorithms. Summary of the Invention

[0005] To address the problems of low initial solution quality, susceptibility to local optima, and insufficient computational efficiency in traditional algorithms, this invention provides an intelligent evolutionary optimization method driven by a large language model. This method deeply integrates the semantic understanding capabilities of large language models (such as DeepSeek) with evolutionary optimization algorithms (PSO, GA), achieving the following innovative functions: 1) Intelligent semantic modeling: Automatically transforming natural language descriptions into structured mathematical models, solving the problem of reliance on manual modeling in traditional methods; 2) High-quality population generation: Generating constrained initial solutions based on semantic rules, avoiding ineffective searches; 3) Dynamic optimization control: Adjusting algorithm parameters in real time through lightweight API interaction, effectively preventing local optima; 4) Interpretable decision output: Providing natural language explanations, enhancing the transparency of the optimization process. This invention overcomes the limitations of traditional evolutionary algorithms, providing an intelligent solution for complex optimization problems.

[0006] An evolutionary optimization method driven by a large language model mainly includes the following steps: S1: Use a large language model to perform semantic parsing of natural language, transform fuzzy requirements into a structured mathematical model, that is, extract the optimization objective function and set constraints; S2: Generate the initial population solution driven by LLM according to the set semantic rules; S3: Use the PSO or GA algorithm, combined with the objective function, to perform evolutionary optimization on the obtained initial solution and dynamically adjust the update rules; S4: Set the maximum number of iterations or the convergence threshold. When the maximum number of iterations or the convergence threshold is reached, output the global optimal solution and a semantic explanation report.

[0007] A computer device includes a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the above-described method.

[0008] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above method.

[0009] A computer program product includes a computer program or instructions that, when executed by a processor, implement the steps of the above-described method.

[0010] The beneficial effects of the technical solution provided by this invention are as follows: By deeply embedding the semantic understanding and reasoning capabilities of the DeepSeek large language model into the core process of traditional evolutionary optimization algorithms (PSO, GA), this invention constructs a dual-loop mechanism of "semantic cognition-dynamic decision-making," achieving full-process optimization from problem modeling and intelligent search to interpretable output. This method targets two typical optimization scenarios: the 0-1 knapsack problem (discrete) and the Rosenbrock and Sphere functions (continuous). Through semantically driven population initialization, dynamic parameter control, and closed-loop feedback mechanisms, it effectively solves the core problems of traditional algorithms, such as low initial solution quality, susceptibility to local optima, and insufficient computational efficiency. Through semantic initialization and dynamic policy adjustment, the algorithm converges to the optimal solution (value 388) in only 5 generations in the 0-1 knapsack problem, which is 80%-90% faster than the traditional PSO (22 generations) and GA (43 generations). In Rosenbrock function optimization, the number of generations for convergence is reduced from 80 generations in the traditional algorithm to 65 generations (PSO) and 30 generations (GA). Experiments show that the average fitness of the initial solution is improved by about 98% in the knapsack problem (from 110.78 to 219.16) and by 99% in the Rosenbrock function optimization (from 4.74). The standard deviation of the solution was significantly reduced (from 10⁵ to 2.71 × 10²). A lightweight strategy of "three-cycle iteration + 30% key individual optimization" was adopted, which reduced the number of API calls by 89.9% and the cost by 85%, while the performance loss was controllable (the convergence speed was reduced by only 64.7%). Through semantic parsing and dynamic intervention of LLM, the problems of PSO being prone to local extrema and GA parameter sensitivity were solved. For example, in the Rosenbrock function, it successfully guided particles to escape narrow valleys and automatically identified key search dimensions in the high-dimensional scenario of the Sphere function. Attached Figure Description

[0011] The present invention will be further described below with reference to the accompanying drawings and embodiments. In the accompanying drawings: Figure 1 This is a framework diagram of an intelligent evolutionary optimization method driven by a large language model in an embodiment of the present invention; Figure 2 This is a convergence curve of the LLM-driven PSO algorithm for solving the 0-1 knapsack problem in an embodiment of the present invention. Figure 3 This is a convergence curve of the LLM-driven GA algorithm for solving the 0-1 knapsack problem in an embodiment of the present invention; Figure 4 This is a diagram showing the dynamic adjustment parameters of the LLM-driven PSO algorithm for solving the 0-1 knapsack problem in an embodiment of the present invention. Figure 5 This is a convergence curve of the Rosenbrock function optimized by the LLM-driven PSO algorithm in this embodiment of the invention. Figure 6 This is a convergence curve of the Rosenbrock function optimized by the LLM-driven GA algorithm in this embodiment of the invention; Figure 7 This is a schematic diagram of the lightweight tuning performance report of the Rosenbrock function optimized by the LLM-driven PSO algorithm in an embodiment of the present invention. Figure 8 This is a convergence curve of the Sphere function optimized by the LLM-driven PSO algorithm in this embodiment of the invention. Figure 9 This is a convergence curve of the Sphere function optimized by the LLM-driven GA algorithm in this embodiment of the invention; Figure 10 This is a diagram showing the dynamic adjustment parameters of the Sphere function optimized by the LLM-driven PSO algorithm in this embodiment of the invention. Detailed Implementation

[0012] To provide a clearer understanding of the technical features, objectives, and effects of the present invention, specific embodiments of the present invention will now be described in detail with reference to the accompanying drawings.

[0013] Example 1 Please refer to Figure 1 , Figure 1 This is a framework diagram of an intelligent evolutionary optimization method based on a large language model driven by an embodiment of the present invention. It includes a collaborative process comprising four parts: semantic parsing and problem modeling, LLM-driven population initialization, dynamic evolutionary strategy, and interpretable output. The specific steps are as follows: Step S1: Use a large language model (such as DeepSeek) to perform semantic parsing on natural language. DeepSeek transforms the fuzzy requirements into a structured mathematical model, i.e., extracting the optimization objective function and setting constraints. The optimization objective is a verb phrase such as "maximize / minimize" + the object of action. Constraints include explicit constraints (numerical limits such as weight ≤ 300) and implicit rules (logical relationships such as "preferred selection"). For example, in this embodiment, the input natural language description is: "Select 10 items, maximizing the total value and ≤ 300 in total weight." For instance, when performing semantic parsing on the 0-1 knapsack problem, "maximizing the total value and ≤ 300 in total weight" is transformed into an objective function and constraints. Objective function: ,in .

[0014] Constraints: ,in , .

[0015] in, In the 0-1 knapsack problem, this indicates whether to select the i-th item. ,when When, it means not selecting the i-th item to put into the backpack. When, it means selecting the i-th item to put into the backpack; This represents the i-th element in matrix v. Representation matrix The i-th element in; This indicates the maximum weight capacity of the backpack, set according to the specific problem.

[0016] In continuous optimization problems, identifying function characteristics (such as the "narrow valley" structure of the Rosenbrock function) can guide subsequent search strategies.

[0017] Step S2: Generate a high-quality initial solution for the population driven by LLM according to the set semantic rules; In the knapsack problem, based on the semantic constraint that "the weight of items cannot exceed the limit", and combined with the value-weight ratio distribution of items, an initial solution set that meets the knapsack capacity constraint is generated. In this embodiment, the initial solution is generated according to the "value-weight ratio priority" rule: items with high value-weight ratios are selected first (e.g., the value-weight ratio of item 5 is 100 / 50=2), ensuring that the total weight of the initial solution is ≤300. At the same time, K-means clustering is used to ensure the diversity of solutions, so that the initial population simultaneously satisfies the constraint satisfaction of 100%, high fitness and uniform distribution, achieving the "high quality" characteristic.

[0018] In continuous problems, particle initial position matrices with different orientations are created according to terrain features (such as covering both sides of a valley in the Rosenbrock function). This ensures that the initial solution not only conforms to the semantic feature of the function's "narrow valley" but also enhances diversity through uniform distribution. The fitness and distribution rationality of the initial solution are significantly better than traditional random initialization methods.

[0019] The initial solution of the population driven by LLM is generated based on semantic rules. The K-means clustering algorithm is used to remove duplicates of valid solutions to ensure the diversity of the initial solution (i.e. the initial population) and avoid premature convergence. Finally, a high-quality initial population with constraint compliance, high fitness and reasonable distribution is formed.

[0020] Step S3: Use the PSO or GA algorithm, combined with the objective function, to perform evolutionary optimization on the obtained initial solution and dynamically adjust the update rules; Step S4: Execute the dynamic evolution strategy iteratively until the termination condition (such as the maximum number of iterations or the convergence threshold) is met; when the maximum number of iterations or the convergence threshold is reached, output the global optimal solution and a semantic interpretation report, including the optimization trajectory, constraint trade-off analysis, and decision logic. Figure 2As shown, the x-axis represents the number of iterations (1-10 generations), and the y-axis represents the fitness value (0-400). The LLM-driven PSO algorithm converges to the optimal solution 388 within the 5th generation, or terminates when the maximum number of iterations is reached, outputting the global optimal solution and a semantic interpretation report, significantly outperforming the traditional PSO. Figure 3 As shown, the LLM-driven GA algorithm converges to the optimal solution 388 within the 4th generation, outputting the gene sequence and an LLM interpretation report, such as "Because item 5 has the highest value, its gene is preferentially activated during mutation," with the optimal solution vector x=[1,1,1,1,1,1,1,0,0,0]. The dynamic regulation report is as follows... Figure 4 As shown, this illustrates the process of adjusting the inertia weights and learning factors in real-time using the LLM algorithm in the particle swarm optimization algorithm. Figure 5 The results show that the LLM-driven PSO algorithm escapes local optima and approaches the global optimum (2.13 × 10⁻⁶) within 65 generations. -7 . Figure 6 The results show that the LLM-driven GA algorithm escapes local optima and approaches the global optimum (4.44 × 10⁻⁶) within 30 generations. -3 . Figure 7 The text displays computational efficiency (number of API calls / time spent). Figure 8 The results show that the LLM-driven PSO algorithm escapes local optima and approaches the global optimum (4.78 × 10⁻⁶) within 7 generations. -8 . Figure 9 The results show that the LLM-driven GA algorithm escapes local optima and approaches the global optimum (4.80 × 10⁻⁶) within 5 generations. -6 . Figure 10 This is a graph showing the dynamic adjustment parameters of the Sphere function optimized using the LLM-driven PSO algorithm.

[0021] This invention addresses the 0-1 knapsack problem by minimizing the Rosenbrock and Sphere functions. The specific implementation steps are as follows: (A): For the 0-1 knapsack problem (discrete type), the specific steps are as follows: Step S1: Semantic parsing and problem modeling pseudocode: Input: Natural language problem description D, multimodal data M.

[0022] Output: Objective function F, set of constraints C, definition of decision variables X, range of decision variables.

[0023] Step S2: Pseudocode for population initialization driven by LLM: Input: Problem description D, population size N.

[0024] 1. Use LLMs to generate M candidate solution descriptions (M>N).

[0025] 2. Transform the description into a numerical solution and filter out invalid solutions.

[0026] 3. Perform K-means clustering on the valid solutions, and select N / K solutions for each cluster.

[0027] Output: Initial population P.

[0028] Step S3: Dynamic evolutionary optimization, the specific implementation steps are as follows: Step S3.1: Adopt a lightweight API interaction strategy ① Optimize objective selection: In the 0-1 knapsack problem (maximization), calculate the fitness value (i.e., total value) of each solution in the population. Solutions that violate weight constraints are denoted as having a fitness value of 0. After sorting the solutions in ascending order of fitness value, the top 30% of the solutions with the lowest fitness values ​​are selected for optimization. For the Rosenbrock and Sphere functions (minimization), the function values ​​are used as fitness values. After sorting the solutions in ascending order of fitness value, the bottom 30% of the solutions with the highest fitness values ​​are selected for optimization.

[0029] ② Triggering condition: The LLM (DeepSeek) API is called every 3 generations to analyze the population state.

[0030] Step S3.2: Dynamic parameter adjustment In the optimization layer of the LLM-driven PSO or GA algorithm, the state of the particle swarm or population is analyzed every three generations, such as velocity decay rate and cluster radius. The update rules are dynamically adjusted. If the particle swarm is trapped in a flat region, the inertia weight is increased; conversely, if the particles are trapped in a narrow valley region, the key particles are subjected to targeted perturbation. Specifically: (1) PSO semantic enhancement Semantic velocity field control is incorporated into particle swarm optimization. Every three iterations, an LLM (such as the DeepSeek API) is called to analyze the semantic state of the particle swarm (e.g., cluster radius, velocity decay). For example, if "the particle cluster radius keeps shrinking," dynamic adjustments are made to the bottom 30% of particles in fitness ranking to reduce computational overhead. When dynamically adjusting parameters, if the particle swarm gets stuck in a flat region, the inertia weight is increased; if it clusters in a narrow valley, directional perturbation is injected; when a local convergence trend is detected, the inertia weight is increased and directional perturbation is applied; when the particle swarm is detected to be too dispersed, the weight of the social learning term is strengthened.

[0031] Key particle identification method: By analyzing the particle swarm state through LLM, the particles that are on the edge of the valley, have significantly improved their historical fitness values ​​but have recently stagnated, or are the furthest from most particles after K-means clustering are selected as key particles. These particles play a decisive role in breaking through local optima.

[0032] (2) GA semantic enhancement Every 3 iterations, DeepSeek is invoked to analyze gene entropy (threshold 0.5). If gene entropy < 0.5 (low diversity), non-uniform mutation is performed on the last 30% of individuals: for gene loci with a value-to-weight ratio < average, they are flipped with a strength of 0.15 (e.g., the probability of changing "0" to "1" increases with iteration); LLM generates a directed mutation instruction: "If the total weight < 250 and there are high-value items that were not selected (e.g., item 5), force the flipping of the corresponding gene loci." Using uniform crossover, LLM guides the inheritance of gene loci containing items 5 and 6 from the parent generation to the offspring based on the "high-value gene fragment retention" rule.

[0033] Based on the population diversity decline, a non-uniform mutation strategy is adopted, applying high-intensity perturbations to low-entropy gene segments (such as repetitive node sequences in path optimization). Furthermore, problem semantics guide the mutation direction (e.g., swapping nodes in adjacent functional areas in the Traveling Salesman Problem). To maintain efficiency, semantic mutations are performed only on a subset of individuals, while traditional operations are retained for the remaining individuals. This significantly reduces useless mutation operations, prompting the algorithm to focus on developing potential solutions. (LLM guidance is introduced in the mutation phase, applying high-intensity non-uniform mutations to low-diversity gene segments; directional mutations are designed in conjunction with problem semantics, such as swapping nodes in adjacent functional areas in the TSP problem.) Key individual identification method: Select individuals carrying high-value gene segments (such as chromosomes containing items 5 and 6) and whose fitness values ​​are in the bottom 30%. After semantic mutation, these individuals can effectively improve population diversity and global search capabilities.

[0034] Step S4: Release the output.

[0035] The specific execution algorithm is as follows: (1) Pseudocode for the LLM-driven PSO algorithm: Input: Problem description D (natural language / multimodal), maximum number of iterations max_iter, particle swarm size N.

[0036] 1. Semantic initialization population: Pseudocode for calling population initialization in the LLM driver: P = Semantic_Initialization(D, N) initializes the particle position and velocity.

[0037] 2. Main optimization loop (iter = 1 to max_iter): a. Standard PSO operation: Calculate fitness: The fitness of the 0-1 knapsack problem is the total value of the selected items.

[0038] Update individual best (pbest) and global best (gbest): update pbest when the current fitness of a particle is better than its own historical best, and select the best solution from all pbest as gbest.

[0039] Update speed and location: based on the formula Update speed, based on Update position, where w is the inertia weight. As a learning factor, , It is a random number in the range [0,1].

[0040] b. Dynamic control (triggered every 3 iterations): Generate a status report: status = "cluster radius: " + cluster_radius + "; average velocity: " + avg_velocity.

[0041] Calling DeepSeek for analysis: action = DeepSeek_API.analyze(status), Execute instructions on the last 30% of particles: If action=="flat region": increase inertia weight by 20%. If action=="narrow valley": inject Gaussian perturbation (σ=0.3). If action=="over-dispersion": enhance social learning factor.

[0042] Output: The global optimal solution, gbest.

[0043] (2) Pseudocode for the LLM-driven GA algorithm: Input: Problem description D, maximum number of generations max_gen, population size N.

[0044] 1. Semantic initialization population: Pseudocode for calling population initialization in the LLM driver: P = Semantic_Initialization(D, N).

[0045] 2. Evolutionary cycle (gen = 1 to max_gen): a. Selection Operation: The tournament selects the parent individual.

[0046] b. Crossover operation: uniform crossover generates offspring.

[0047] c. Dynamic regulation of mutations (triggered every 3 generations): DeepSeek retrieves the strategy: strategy = DeepSeek_API.get_mutation_strategy(diversity).

[0048] Perform semantic mutation on the 30% of individuals with poor fitness: if strategy=="low diversity": apply non-uniform mutation (intensity=0.15); if strategy=="local convergence": implement directional perturbation (along the gradient direction); if strategy=="path optimization": swap isolated nodes; for the remaining individuals: standard bit flip mutation (probability=0.01).

[0049] d. Environmental selection: Elite retention strategy to update the population.

[0050] Output: The historical best solution.

[0051] (B): For the Rosenbrock function (continuous type), the specific steps include: Step S1: DeepSeek identifies the "narrow valley" structure of the function and determines that the function optimization objective is to minimize: , Among them, the search range .

[0052] Step S2: Generate initial particles according to the "distribution along the valley axis" rule to avoid gathering in the flat stagnation area near the origin and ensure that the initial solution is distributed in the valley slope area.

[0053] Step S3: Dynamic evolutionary optimization.

[0054] (1) PSO enhancement DeepSeek analysis revealed that particles clustered at the bottom of the valley, triggering a directional perturbation mechanism: resetting particles in unexplored areas and adding perturbations along the opposite direction of the gradient.

[0055] By reducing perturbations in later stages and focusing on fine-grained convergence, the optimal function value of 2.125027 × 10⁻⁶ was approximated within 65 generations. -7 .

[0056] (2) GA enhancement LLM analysis of fitness gradients: If "particles are concentrated in flat regions (gradient < 0.1)", perform the following on the bottom 30% of individuals: 1) Gaussian mutation: xThe variation strength for the dimensionality (high sensitivity) is set to 0.2. y 1) Dimension (low sensitivity) set to 0.1; 2) Gradient guidance: LLM generates the instruction "Current solution deviates from valley axis ( ,Towards "Directional adjustment of gene values".

[0057] Step S4: Release the output.

[0058] The iteration terminates when the termination condition is met: convergence to a preset accuracy threshold (e.g., Euclidean distance ≤ 0.1) or the maximum number of iterations is reached. The output content is as follows: When based on PSO, the output is: Optimal solution location: [0.999950 0.999900 0.999800 0.999600 0.999200] Optimal function value: 2.125027e-07 When based on GA, the output is: Optimal solution location: [0.992600 0.985300 0.970800 0.942400 0.888100] Optimal function value: 4.441789e-03 (C): For Sphere functions (continuous type), the specific steps include: Step S1: Utilize the analytical function characteristics of DeepSeek: "Identify the uniform convergence properties of high-dimensional hyperspheres and analyze the differences in the contribution of each dimension to the function value." Determine the function optimization objective as minimizing: , Where n represents the dimension of the vector, and xi represents the elements of the n-dimensional vector.

[0059] Step S2: Generate initial particle positions according to the principle of "uniformly covering the hypersphere" to ensure the diversity of orientation of the population in the solution space and prevent the initial distribution from being biased towards a certain local area.

[0060] Step S3: Dynamic evolutionary optimization.

[0061] (1) PSO enhancement Dimension Focus: Based on dimensional sensitivity data, the search intensity is reduced for dimensions with gradual changes, while elite particles guide the key dimensions; Spherical Convergence: When the particle swarm approaches the theoretical optimal solution, radial velocity constraints are adopted, and the velocity update is first adjusted radially along the spherical surface to reduce tangential oscillations; Resource Allocation: A sparse update mechanism is used for low-sensitivity dimensions to save computational resources for optimization of key dimensions.

[0062] (2) GA enhancement Gene selection: Crossover operations are performed only on high-sensitivity dimensions, while elite genes are directly preserved for low-sensitivity dimensions; Mutation classification: Adaptive Gaussian mutation is used for high-sensitivity dimensions, while micro-random perturbation is used for low-sensitivity dimensions; AI optimization is used for low-quality solutions.

[0063] Step S4: Release the output.

[0064] The iteration termination condition is set as follows: the 10-dimensional function converges to 4.78 × 10⁻⁶ in the 7th generation. −8 After termination, the output will be as follows: When based on PSO, the output is: Optimal solution location: [-0.000098 -0.000098 -0.000098 -0.000098 -0.000098 ] Optimal function value: 4.784608e-08 When based on GA, the output is: Optimal solution location: [-0.000979 -0.000979 -0.000979 -0.000979 -0.000979] Optimal function value: 4.796742e-06 Example 2 A computer device includes a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the above-described method.

[0065] Example 3 A computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the above method.

[0066] Example 4 A computer program product includes a computer program or instructions that, when executed by a processor, implement the steps of the above-described method.

[0067] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. An intelligent evolutionary optimization method driven by a large language model, characterized in that, The method includes the following steps: S1: Use a large language model to perform semantic parsing of natural language, transform fuzzy requirements into a structured mathematical model, that is, extract the optimization objective function and set constraints; S2: Generate the initial population solution driven by LLM according to the set semantic rules; S3: Use the PSO or GA algorithm, combined with the objective function, to perform evolutionary optimization on the obtained initial solution and dynamically adjust the update rules; S4: Set the maximum number of iterations or the convergence threshold. When the maximum number of iterations or the convergence threshold is reached, output the global optimal solution and a semantic explanation report.

2. The intelligent evolutionary optimization method based on a large language model as described in claim 1, characterized in that, In S1, semantic parsing is performed on the 0-1 knapsack problem, and the optimization objective function is constructed as follows: The constraints are: in, In the 0-1 knapsack problem, this indicates whether to select the i-th item. ,when When , it means not selecting the i-th item to put into the knapsack, i=1,2,...,n, where n represents the number of items. When, it means selecting the i-th item to put into the backpack; This represents the i-th element in matrix v. Representation matrix The i-th element in; This indicates the maximum weight capacity of the backpack, set according to the actual problem.

3. The intelligent evolutionary optimization method based on a large language model as described in claim 1, characterized in that, In S2, initial solutions for the population driven by LLM are generated based on semantic rules. K-means clustering algorithm is used to remove duplicates of initial solutions to ensure the diversity of initial solutions.

4. The intelligent evolutionary optimization method based on a large language model as described in claim 1, characterized in that, S3 specifically refers to: S3.1: Adopt a lightweight API interaction strategy ① Optimization target selection: For different problems, select and set a certain proportion of the difference solutions for optimization; ② Triggering condition: The LLM API is called every 3 generations to analyze the particle swarm or population state; S3.2: Dynamic parameter adjustment In the optimization layer of the PSO or GA algorithm, the state of the particle swarm or population is analyzed every 3 generations. The state includes the velocity decay rate and the cluster radius, and the update rules are dynamically adjusted.

5. The intelligent evolutionary optimization method based on a large language model as described in claim 4, characterized in that, In S3.1, the different problems include maximizing the 0-1 knapsack problem and minimizing the Rosenbrock and Sphere functions; for the 0-1 knapsack problem, the solution with the lowest fitness value among the first preset proportions after ascending order is selected for optimization; For the Rosenbrock and Sphere functions, the solutions with the highest second-most preset fitness values ​​after ascending order are selected for optimization.

6. The intelligent evolutionary optimization method based on a large language model as described in claim 1, characterized in that, In S4, the semantic interpretation report includes: optimization trajectory, constraint trade-off analysis, and decision logic.

7. A computer device comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes a computer program to implement the steps of the intelligent evolutionary optimization method based on a large language model as described in any one of claims 1-6.

8. A computer-readable storage medium, characterized in that, The device contains a computer program that, when executed by a processor, implements the steps of the intelligent evolutionary optimization method based on a large language model as described in any one of claims 1-6.

9. A computer program product, characterized in that, It includes a computer program or instructions that, when executed by a processor, implement the steps of the intelligent evolutionary optimization method based on a large language model as described in any one of claims 1-6.

Citation Information

Cited By

  • Large model coding agent system of hybrid genetic algorithm and implementation method

    CN121918811A