Method and device for improving engineering problem modeling quality and storage medium
By constructing a tree-structured knowledge base and using an adaptive decomposition method, the problems of modeling accuracy and robustness of large language models in complex engineering optimization problems are solved, achieving more efficient modeling quality and adaptability, and improving the decision-making and scheduling capabilities for engineering problems.
Patent Information
- Application Number
- CN202511515912.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-22
- Publication Date
- 2026-01-09
AI Technical Summary
Existing large-scale language models lack generalization ability and accuracy when dealing with complex engineering optimization problems, making it difficult to adaptively identify core decision variables, resulting in low modeling quality and affecting the decision-making and scheduling effects of engineering problems.
A tree-structured knowledge base for engineering optimization problems is constructed. Adaptive problem decomposition is performed through tree search, and optimization models are generated by combining large-scale language models. The knowledge base is continuously improved through a dynamic update mechanism to enhance modeling accuracy and robustness.
It significantly improves the modeling accuracy and efficiency of large-scale language models in complex engineering optimization problems, better adapts to changing scenarios, enhances the reusability and applicability of knowledge, reduces the error rate of key variable definition, and improves the quality of model generation.
Smart Images

Figure CN121303579A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of large language models and engineering problem modeling, and particularly relates to a method for improving the modeling quality of large language models in solving complex engineering optimization problems. BACKGROUND
[0002] Combinatorial optimization problems are widely used in production scheduling, chip design, path planning and other engineering fields. Engineering optimization problems in the real world are presented in the form of natural language description, and are manually converted into mathematical optimization models by relying on domain experts, and are solved by writing solver codes such as branch and bound solvers SCIP and Gurobi. However, this modeling process is technically strong, time-consuming, and requires a large amount of human professional knowledge and domain experience. In order to accelerate and automate the engineering optimization problem modeling process, in recent years, many studies have begun to try to use large language models with strong language understanding and reasoning capabilities to directly process optimization problems described in natural language, to automatically generate mathematical models and corresponding solver codes. These methods usually decompose the modeling task into fixed order steps of generating variables, constraints and objectives, and show potential when dealing with some structured problems.
[0003] However, the automatic modeling method based on fixed step decomposition still faces major challenges in generalization ability and accuracy when dealing with complex and variable engineering optimization problems in the real world. Complex optimization problems usually contain highly interlaced and abstract mathematical structures, and the rigid decomposition process is difficult to adapt to the specific complexity of the problem, especially in correctly identifying and defining core decision variables, which is the cornerstone of subsequent modeling success or failure. In addition, the modeling knowledge in the engineering field itself has the characteristics of being scattered and highly abstract, which is distributed in various literatures, textbooks and cases, and existing retrieval enhancement methods are difficult to enable large language models to efficiently retrieve and apply these implicit and structured expert knowledge to solve novel or complex engineering optimization modeling tasks. Therefore, relying only on the internal knowledge of large language models or simple retrieval will lead to insufficient knowledge, limiting its practicality in actual industrial scenarios.
[0004] In practice, the thinking of engineering modeling experts in solving complex problems is not linear, and they are often good at decomposing a complex problem into its core and simpler classic sub-problems, and then incrementally modifying and expanding them to gradually build a complete model. This thinking mode of simplifying complex problems and dividing and conquering is the key to ensuring modeling quality, but the existing large language model modeling method generally lacks the ability to adaptively identify and utilize the sub-problem structure. The lack of this ability makes it difficult for large language models to ensure the accuracy and robustness of modeling when faced with complex constraints or variable scenarios, thereby affecting the ability to make efficient decisions and scheduling for engineering problems. Specifically, the inventors studied the task of using large language models for automatic modeling of operational optimization problems, and found that when using standard fixed-step decomposition prompts, large language models perform poorly when dealing with optimization problems with complex mathematical structures. This shows that the modeling ability of large language models is highly sensitive to the inherent complexity and structure of the problem, and fixed decomposition patterns cannot adaptively capture the hierarchical relationships and modeling techniques between different problems. When applied to automatic modeling of engineering problems, the output of large language models, especially the definition of core decision variables, will deviate seriously when encountering more complex real-world scenarios, resulting in a serious decrease in the accuracy of the generated optimization model, which cannot guarantee the quality of modeling, and thus affects the effectiveness of the subsequent decision and scheduling scheme for engineering problems.
[0005] Therefore, the present application is proposed. SUMMARY
[0006] The purpose of the present application is to provide a method, device and storage medium for improving the quality of engineering problem modeling, which can construct a tree structure knowledge base of engineering optimization problems and use tree search for adaptive problem decomposition to enhance the modeling ability of large language models for complex engineering optimization problems, solving the above technical problems existing in the prior art.
[0007] The purpose of the present application is achieved by the following technical solutions: A method for improving the quality of engineering problem modeling for improving the quality of automatic modeling of complex engineering optimization problems using large language models, comprising: Step 1: Organize a series of engineering optimization problems according to hierarchical classification and complexity, and construct a tree structure knowledge base of engineering optimization problems; Step 2: Receive the natural language description of the target engineering problem to be modeled, recursively search the tree structure knowledge base obtained in step 1, and identify the modeling sub-problems corresponding to the nodes related to the target engineering problem through a large language model until the most matching and most specific modeling sub-problems are found; Step 3: retrieve the high-level modeling idea corresponding to the modeling sub-problem obtained in step 2, and combine the high-level modeling idea with the description of the target engineering problem to generate a global modeling idea; Step 4: use a large language model to automatically generate an optimization model and a solver code for the target engineering problem according to the global modeling idea obtained in step 3; Step 5: use the optimization model and the solver code for the target engineering problem obtained in step 4 to solve, if the solving result does not match the true answer, confirm that the modeling fails, and dynamically update the tree structure knowledge base, add the target engineering problem of modeling failure as a new node to the tree structure knowledge base.
[0008] A processing device comprises: At least one memory for storing one or more programs; At least one processor capable of executing one or more programs stored in the memory, when the one or more programs are executed by the processor, the processor can implement the method described in the application.
[0009] A readable storage medium stores a computer program, when the computer program is executed by a processor, the method described in the application can be implemented.
[0010] Compared with the prior art, the method, device and storage medium for improving the modeling quality of engineering problems provided by the application have the beneficial effects of improving the modeling ability of large language models for solving complex engineering optimization problems By first constructing a tree structure knowledge base of engineering optimization problems, complex problems are decomposed into simpler, known modeling sub-problems, and verified modeling ideas are used for guidance, significantly reducing the error rate of large language models in defining key variables and constraints, thereby greatly improving the accuracy of modeling complex engineering optimization problems; the framework based on the tree structure knowledge base can systematically organize and apply scattered expert knowledge, so that the model can generalize the modeling patterns learned from known problems to novel or complex problems that have not been seen before, enhancing the robustness and applicability of the method; through the dynamic updating mechanism, the knowledge tree can continuously evolve and improve by learning new problem instances, ensuring that the method can keep pace with the times and cover more complex engineering scenarios. BRIEF DESCRIPTION OF DRAWINGS
[0011] In order to more clearly illustrate the technical solutions of the embodiments of the application, the following will briefly introduce the drawings needed to be used in the embodiment description. Obviously, the drawings in the following description are only some embodiments of the application, and for those skilled in the art, other drawings can also be obtained without creative labor.
[0012] Figure 1A flowchart of the method for improving the modeling quality of an engineering problem according to an embodiment of the present application.
[0013] Figure 2 A flowchart of the method for improving the modeling quality of an engineering problem according to an embodiment of the present application.
[0014] Figure 3 A flowchart of the method for improving the modeling quality of an engineering problem according to an embodiment of the present application. DETAILED DESCRIPTION
[0015] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the specific contents of the present application; obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments, which do not constitute a limitation to the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the protection scope of the present application.
[0016] First, the terms possibly used in the present text are explained as follows: The term "and / or" means either of the two or both, for example, X and / or Y means three cases including "X", "Y" or "X and Y".
[0017] The terms "include", "contain", "have", "possess" or other similar semantic descriptions should be interpreted as non-exclusive inclusion. For example, the inclusion of a technical feature element (such as raw materials, components, ingredients, carriers, dosage forms, materials, sizes, parts, components, mechanisms, devices, steps, processes, methods, reaction conditions, processing conditions, parameters, algorithms, signals, data, products or articles, etc.) should be interpreted as not only including the explicitly listed technical feature element, but also including other technical feature elements not explicitly listed in the art.
[0018] The term "consisting of" means excluding any technical feature element not explicitly listed. If this term is used in a claim, the term will make the claim closed, so that it does not contain technical feature elements other than the explicitly listed technical feature elements, except for conventional impurities related thereto. If the term only appears in a certain clause of the claim, it only limits the elements explicitly listed in that clause, and the elements described in other clauses are not excluded from the overall claim.
[0019] Unless otherwise defined, the terms "mounting", "connected", "connection", "fixed", and the like are to be construed in a broad sense, for example: can be fixed connection, can also be detachable connection, or integrally connected; can be mechanical connection, can also be electrical connection; can be directly connected, can also be indirectly connected through an intermediate medium, can be internal communication of two elements. For those skilled in the art, the specific meaning of the above terms in this paper can be understood according to the specific circumstances.
[0020] When the concentration, temperature, pressure, size or other parameters are expressed in the form of a numerical range, the numerical range should be understood as specifically disclosing all ranges formed by any upper limit value, lower limit value, preferred value in the numerical range, regardless of whether the range is explicitly recorded; For example, if the numerical range "2-8" is recorded, the numerical range should be interpreted as including "2-7", "2-6", "5-7", "3-4 and 6-7", "3-5 and 7", "2 and 5-7", etc. Range. Unless otherwise stated, the numerical ranges recorded in this paper include all integers and fractions within the numerical range, including the end values.
[0021] The orientation or positional relationship indicated by the terms "center", "longitudinal", "transverse", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", "clockwise", "counterclockwise", etc. The orientation or positional relationship shown in the drawings is only for the convenience of description and simplification of description, and is not explicitly or implicitly indicated that the device or element referred to must have a particular orientation, be constructed and operated in a particular orientation, and therefore cannot be understood as a limitation on this paper.
[0022] The schemes provided by the present application will be described in detail below. The contents not described in detail in the embodiments of the present application belong to the prior art known to those skilled in the art. If the specific conditions are not specified in the embodiments of the present application, they are carried out according to the conventional conditions in the art or the conditions recommended by the manufacturer. If the reagents or instruments used in the embodiments of the present application are not specified by the manufacturer, they are all conventional products that can be purchased on the market.
[0023] As Figure 1 shown, the embodiments of the present application provide a method for improving the modeling quality of engineering problems, which is used to improve the automation modeling quality of solving complex engineering optimization problems by using large language models, comprising: Step 1: Organize a series of engineering optimization problems according to hierarchical classification and complexity, and construct a tree structure knowledge base of engineering optimization problems. Among them, each parent node is a modeling sub-problem of its child node, and each node represents a modeling problem category and stores relevant advanced modeling ideas for guiding modeling.
[0024] Step 2: Receive the natural language description of the target engineering problem to be modeled, recursively search the tree-structured knowledge base obtained in Step 1, and identify the modeling sub-problems corresponding to the nodes related to the target engineering problem until the most matching and specific modeling sub-problem is found. Specifically, starting from the root node of the tree-structured knowledge base, by comparing the semantic similarity between the target engineering problem and the modeling sub-problems in each node of the tree-structured knowledge base, layer by layer comparison is performed until the most matching and largest modeling sub-problem is found.
[0025] Step 3: Retrieve the advanced modeling idea corresponding to the modeling sub-problem obtained in Step 2, and combine this advanced modeling idea with the description of the target engineering problem to generate a global modeling idea; Step 4: According to the global modeling idea obtained in Step 3, use a large language model to automatically generate an optimization model and solver code for the target engineering problem.
[0026] See Figure 2 , further, after Step 4 of the above method, it further includes: Step 5: Solve using the optimization model and solution code of the target engineering problem obtained in Step 4. If the solution result does not match the true answer, confirm that the modeling fails, and dynamically update the tree-structured knowledge base. Add the target engineering problem with modeling failure as a new node to the tree-structured knowledge base. The dynamic update method of the tree-structured knowledge base in this step is: Add the target engineering problem with modeling failure as a new node to the tree-structured knowledge base, judge the relationship between the new node and other nodes regarding the modeling sub-problems through a large language model, and insert the new node into the appropriate position in the tree-structured knowledge base according to the preset rules to maintain the structural consistency of the tree-structured knowledge base.
[0027] Preferably, in Step 1 of the above method, the advanced modeling ideas stored in each node are organized in a pattern structure, including: Problem type: A clear naming of the category of optimization problems represented by this node. For example, "Vehicle Routing Problem with Time Windows"; Statement ideas: A set of atomized, high-level statements for problem identification. These statements summarize the core features and modeling requirements of this problem type, such as "Vehicle capacity, time window, single visit, route continuity", which are used for semantic similarity comparison in Step 2.
[0028] Modeling ideas: A set of concise and step-by-step guidelines for guiding a large language model to perform modeling. Its content covers specific reasoning steps, such as: how to define decision variables, how to construct the objective function, and how to formulate various constraints such as flow conservation and load constraints, and may include code templates of solvers such as Gurobi.
[0029] Preferably, in step 2 of the above method, the tree-structured knowledge base obtained in step 1 is recursively searched in the following manner to identify the modeling sub-problems corresponding to the nodes related to the target engineering problem, until the most matching and specific modeling sub-problem is found, including: Step 21: Analyze the received natural language description of the target engineering problem using a large-scale language model, and extract and summarize the target engineering problem into a statement of ideas. ; Step 22: Starting from the root node of the tree-structured knowledge base, search at each level of the tree-structured knowledge base, applying the stated idea of the target engineering problem obtained in Step 21. The statement of ideas for all candidate child nodes at this level Perform semantic similarity comparisons one by one; Step 23: Based on the similarity score returned by the large language model, select the node with the highest score that satisfies the relationship of the modeling sub-problems as the matching modeling sub-problems, and continue to search for the next level in its child nodes starting from this node; Step 24: Repeat step 23 until no more matching modeling sub-problems can be found among the child nodes of the current node, i.e., the semantic similarity score of all child nodes is 0, then terminate the search. At this point, the last matching modeling sub-problem on the search path is the most matching and specific modeling sub-problem found.
[0030] See Figure 3 Preferably, in step 5 of the above method, the target engineering problem that failed to be modeled is added as a new node to the tree-structured knowledge base in the following manner:
[0031] Step 51: After failing to model a target engineering problem, extract and generate its own high-level modeling concept for the failed target engineering problem, including the problem type and the stated concept. and modeling ideas ;
[0032] Step 52: Take the node corresponding to the most matching and specific modeling sub-problem found in Step 2 as the parent node of the target engineering problem in the tree-structured knowledge base where the modeling failed. With the parent node This serves as the insertion point for the target engineering problem in the structural knowledge base where the modeling failed.
[0033] Step 53: To maintain the sub-problem relationships in the tree, determine the new node based on the target engineering problem that failed to be modeled. With a defined parent node The relationship between all child nodes, if a new node is a child node. If the modeling subproblem is the parent problem, then proceed to step 54; otherwise, proceed to step 55.
[0034] Step 54: Add the new node As the parent node child nodes and a certain child node The parent node is inserted into the tree structure knowledge base, and the update of the tree structure knowledge base ends.
[0035] Step 55: Add the new node As the parent node child nodes and a certain child node The sibling node is inserted into the tree structure knowledge base, and the update of the tree structure knowledge base ends.
[0036] In the field of automated modeling of engineering optimization problems, traditional structured model libraries (such as fixed template libraries, flat case libraries, vector retrieval libraries, etc.) are common technical solutions for improving modeling efficiency. However, these solutions generally suffer from drawbacks such as structural rigidity, poor knowledge reusability, and high expansion costs, making them difficult to adapt to the inherent characteristics of complex engineering problems, which involve "multiple constraints and nested sub-problems." This invention constructs engineering optimization problems as a tree-structured knowledge base. Through hierarchical organization, adaptive retrieval, and dynamic expansion design, it achieves breakthroughs in core performance dimensions. The following details the construction logic, retrieval efficiency, and node insertion extensibility.
[0037] (1) Construction logic: Based on the hierarchical relationship of "sub-problem - parent problem", the knowledge is structured and reusable is improved. Traditional structured model libraries are often built using "single-dimensional classification" or "isolated storage," failing to capture the inherent relationships within engineering optimization problems, leading to fragmented knowledge and high redundancy during modeling. The tree-structured knowledge base proposed in this application aligns with the essence of engineering problems, offering the following specific advantages: Traditional fixed template libraries store independent modeling templates according to problem type (such as "vehicle routing problem template" and "inventory optimization template"), with no connection between the templates. When modeling complex problems (such as "vehicle routing problem with time window and capacity constraints"), it is necessary to manually combine "basic routing template", "capacity constraint template" and "time window constraint template", which is not only cumbersome, but also easy to overlook the logical relationship between templates (such as the coupling relationship between time window constraints and path continuity constraints), resulting in a high modeling error rate.
[0038] The tree-structured knowledge base used in this application follows the principle of "parent node as a sub-problem of child node" (e.g., "basic vehicle routing problem" is the parent node, "vehicle routing problem with capacity constraints" is the child node, and "vehicle routing problem with time windows and capacity constraints" is the grandchild node). The "advanced modeling concepts" (including variable definitions, constraint rules, and code templates) stored in each node can be inherited by child nodes—child nodes only need to add new constraints / variables, without needing to redefine the parent node's basic modeling logic. For example, the "vehicle routing problem with time windows" node only needs to add "arrival time variable" and "time window constraint rule" to directly reuse the "path continuity constraint" and "node access variable" of the parent node "basic vehicle routing problem," significantly reducing modeling redundancy and lowering the variable definition error rate (experiments verify a reduction of over 70% in variable error rate for complex problems).
[0039] (2) Retrieval efficiency: Recursive search + semantic matching dual-drive significantly reduces the search space and improves modeling response speed. The modeling efficiency of engineering optimization problems depends on "rapidly locating and adapting to the reference model." Traditional structured model libraries often face problems such as "excessive search space" or "low matching accuracy." This application's tree-structured knowledge base achieves a breakthrough in retrieval efficiency through its retrieval design. Compared to the "full-space enumeration method" (such as Monte Carlo Tree Search MCTS): from "exponential search" to "polynomial-level pruning". Traditional full-space enumeration methods search for the optimal model by enumerating the combination space of variables and constraints (e.g., the combination space of 10 variables + 10 constraints reaches 2^20), and the search complexity increases exponentially with the dimension of the problem. In complex engineering problems (such as industrial production scheduling and multi-node logistics planning), the average retrieval time is over 100 seconds (based on existing technology test data), which is difficult to meet the real-time modeling requirements of engineering scenarios.
[0040] This invention employs a tree-structured knowledge base retrieval method that starts from the root node and matches sub-problems only within the child nodes of the current node. Each search level's search space is limited to the number of child nodes of the current node (average branching degree 2.4-2.7), avoiding full-space traversal. Combined with semantic matching based on "statement ideas" (e.g., refining the target problem into atomic statements such as "vehicle capacity, time window, single access," and comparing them with the node's statement ideas), irrelevant branches are quickly eliminated. For example, when modeling a "logistics path problem with a time window," only three levels of paths need to be retrieved: "basic path problem → path problem with capacity constraints → path problem with both time windows and capacity constraints," without traversing irrelevant branches such as "inventory optimization" and "production scheduling." Actual test data shows that complex problem retrieval takes only 4.2-11.2 seconds, improving efficiency by over 90% compared to the full-space enumeration method. Furthermore, the higher the problem complexity, the more significant the pruning effect.
[0041] (3) Subsequent node insertion: Adaptive order-preserving insertion mechanism to achieve low-cost expansion and maintain structural consistency. As technology advances, new scenarios for engineering optimization problems are constantly emerging (such as "production scheduling under carbon neutrality constraints" and "logistics path problems with real-time demand fluctuations"). The expansion of traditional structured model libraries often faces the problem of "damaging the original structure" or "requiring large-scale reconstruction." The node insertion design of the tree-structured knowledge base in this application has significant advantages: Traditional fixed-category libraries are divided into fixed categories such as "linear programming," "integer programming," and "combinatorial optimization." When a new problem is added, the classification must be determined manually. If the problem crosses categories (such as "linear programming problems with integer constraints"), a new category must be added or the original classification structure must be modified, resulting in high expansion costs (manual reconstruction usually takes several hours to several days) and easily disrupting the structural consistency of the original library.
[0042] This invention employs a tree-structured knowledge base. When inserting a node, it first locates the "maximum matching sub-problem" (i.e., the parent node in the existing tree that best matches the new problem). Then, it uses a large language model to determine the relationship between the new node and its parent's child nodes: if the new node is the "parent problem" of a child node (e.g., adding a "path problem with capacity constraints," while the existing tree has a "path problem with time windows and capacity constraints" as a child node of the parent), then the new node is inserted as a "child node of the parent node, and the parent node of the atomic node"; if the new node and an existing child node are "sibling sub-problems," then it is inserted as a sibling child node of the parent node. The entire process is fully automated, requiring no manual intervention, and maintains tree structure consistency through a "sub-problem order preservation" design (ancestor nodes are always sub-problems of descendant nodes). For example, when adding a "logistics path problem with carbon emission constraints," it automatically inserts a child node of the "path problem with time windows and capacity constraints," only adding "carbon emission variables and constraints," without modifying the original tree structure. The insertion time is only 1-2 minutes, improving expansion efficiency by more than 95% compared to a fixed classification library.
[0043] This invention also provides a processing apparatus, comprising: At least one memory for storing one or more programs; At least one processor is capable of executing one or more programs stored in the memory, such that when the processor executes one or more programs, the processor can implement the methods described above.
[0044] The present invention further provides a readable storage medium storing a computer program that, when executed by a processor, can implement the above-described method.
[0045] To more clearly demonstrate the technical solution and its effects provided by the present invention, the following detailed description of the method for improving the modeling ability of large language models to solve complex engineering optimization problems provided by the embodiments of the present invention is given by specific examples.
[0046] Example 1 like Figure 1 As shown, this invention provides a method for improving the quality of engineering problem modeling. It utilizes a tree-structured knowledge base to enhance the quality of automated modeling for solving complex engineering problems based on large-scale speech models, effectively improving the automated modeling capabilities of large language models in solving complex engineering optimization problems. This method can be used with mainstream large-scale language models and is a robust optimization framework, namely a robust modeling knowledge base, hereinafter referred to as OptiTree.
[0047] Specifically, this invention focuses on using a tree-structured knowledge base to enhance the automated modeling capability of large language models in solving complex engineering optimization problems. OptiTree consists of two components: (1) an adaptive decomposition and retrieval module based on tree search, which is responsible for analyzing the input natural language problem and adaptively decomposing it into a series of known sub-problems by searching in the tree-structured knowledge base, and finally retrieving the most relevant advanced modeling ideas. (2) a dynamic knowledge base update and expansion module, which implements the learning and growth mechanism of the knowledge base. When existing knowledge cannot successfully model the problem, this module will treat the failed cases as new knowledge, and dynamically integrate them into the tree-structured knowledge base by judging their intrinsic relationship with other problems, thereby ensuring the continuous improvement and scalability of the knowledge base.
[0048] The present invention provides a method for modeling engineering optimization problems based on a large language model with a tree-structured knowledge base, comprising the following steps: (1) The following explains how to adaptive decomposition and retrieval based on tree search.
[0049] Step 1: Organize a series of engineering optimization problems according to their hierarchical classification and complexity to construct a tree-structured knowledge base for engineering optimization problems. Each parent node is a modeling sub-problem of its child nodes, and each node represents a problem category and stores relevant high-level modeling ideas to guide modeling. Step 2: Receive the natural language description of the target engineering problem to be modeled, and recursively search the tree-structured knowledge base obtained in Step 1 to identify a series of sub-problems related to the target engineering problem. Starting from the root node, the search proceeds by comparing the semantic similarity between the target engineering problem and the problems in the knowledge tree nodes, gradually delving deeper until the most matching and specific sub-problem is found. Step 3: Construct a global modeling concept using the search results obtained in Step 2. Retrieve the advanced modeling concept corresponding to the largest subproblem and combine it with the description of the target engineering problem to comprehensively generate a global modeling concept; Step 4: Using the advanced modeling ideas obtained in Step 3, automatically generate the optimization model and solver code for the target engineering problem using a large language model;
[0050] (2) The following section explains how to perform adaptive decomposition and retrieval based on tree search.
[0051] Step 1: Perform all the steps described in (1) above.
[0052] Step 2: Solve the target engineering problem using the optimized model and solution code obtained in Step 1. If the solution result does not match the actual answer, dynamically update the tree structure knowledge base. Add the failed modeling problem as a new node to the tree. Use a large language model to determine the sub-problem relationship between the new node and other nodes, and insert it into the appropriate position in the tree according to preset rules to maintain the structural consistency of the tree structure knowledge base.
[0053] Compared with existing modeling methods that directly rely on large language models or fixed-step decomposition, this invention has at least the following advantages: (1) By constructing a tree-structured knowledge base, adaptive decomposition and expert knowledge retrieval for complex engineering optimization problems are realized, which effectively reduces the modeling difficulty, especially in the definition of core decision variables, thereby greatly improving the modeling accuracy and efficiency of large language models on complex problems and avoiding the modeling biases commonly found in traditional fixed-step decomposition methods. (2) The constructed tree-structured knowledge base systematically organizes the originally scattered and abstract knowledge in the field of operations research, transforming the knowledge retrieval space into a highly structured sub-problem space. This enables large-scale language models to efficiently and accurately retrieve and apply expert modeling ideas most relevant to the current problem, overcoming the limitations of traditional retrieval enhancement methods when facing complex structured knowledge, and enhancing the efficiency and accuracy of knowledge utilization; (3) Stronger generalization ability and robustness, it does not rely on rigid fixed decomposition steps, but rather performs adaptive decomposition and guidance based on the structure of the problem itself. This flexibility enables large language models to better adapt to the varied and complex scenarios in the real world, exhibiting stronger generalization ability and robustness, effectively dealing with different types and scales of engineering optimization problems, and adapting to different underlying large language models.
[0054] In summary, the method of this invention, when used to solve various engineering optimization problems, significantly improves the quality and accuracy of generated optimization models compared to existing modeling methods based on large language models. Among the metrics for measuring modeling performance, accuracy directly reflects the correctness and usability of the generated optimization model (a higher value indicates higher modeling quality). Specifically, in the NL4Opt benchmark test, the method of this invention, using GPT-4o as the large language model, achieved an accuracy of 96.2%, demonstrating a significant improvement over other prompt-based methods of GPT-4o (such as Standard's 70.3%, CoT's 76.4%, OptiMUS's 82.0%, and MCTS's 90.3%), indicating higher model generation quality. When using DeepSeek-V3 as the large language model, OptiTree achieved the best accuracy of 98.3%. On the MAMO EasyLP problem: OptiTree (using GPT-4o as the large language model) achieved an accuracy of 95.6%, and OptiTree (using DeepSeek-V3 as the large language model) achieved an even higher accuracy of 96.9%, both significantly outperforming other prompt-based methods and demonstrating their ability to handle relatively simple linear programming problems more accurately. On the MAMO ComplexLP problem: Facing complex linear programming problems, OptiTree (using GPT-4o as the large language model) achieved an accuracy of 81.0%, and OptiTree (using DeepSeek-V3 as the large language model) also achieved 81.5%, far exceeding other methods. This indicates that the present invention maintains excellent modeling capabilities when dealing with challenging and complex mathematical structures. On the ComplexOR problem: OptiTree (using GPT-4o and DeepSeek-V3 as large language models respectively) both achieved an accuracy of 84.2%. Compared to other methods, the present invention demonstrates strong generalization ability on general complex operations research optimization problems. On the IndustryOR problem: OptiTree (using GPT-4o as the large language model) and OptiTree (using DeepSeek-V3 as the large language model) achieved accuracy of 48.0% and 54.0% respectively. Despite the greater challenge of industrial-grade problems, this invention still provides significantly better modeling performance than other methods.
[0055] See Table 1 for details. Table 1 compares the modeling accuracy of different engineering optimization problem datasets: .
[0056] Example 2 This embodiment provides a method to improve the quality of engineering problem modeling, which is to achieve self-improvement and expansion in engineering problem modeling through the dynamic update mechanism of a tree-structured knowledge base.
[0057] Preparation phase: A set of engineering optimization problem instances to be tested is selected. These instances originate from novel problems encountered in real-world engineering projects. For each of these problems, an accurate natural language description, along with its corresponding correct mathematical optimization model and / or precise solution results, is required. This information will be used to verify the modeling effectiveness of this invention and will serve as a trigger for knowledge base updates.
[0058] Update phase: The core of this stage is to achieve... Figure 3 The tree-structured knowledge base dynamic update process is shown below. The specific steps are as follows: Step A1: Receive the natural language description of the target engineering problem to be modeled, and recursively search the existing tree-structured knowledge base to identify a series of modeling sub-problems related to the target engineering problem. Starting from the root node, by comparing the semantic similarity between the target engineering problem and the problems in the tree-structured knowledge base nodes, the search proceeds layer by layer until the most matching and specific modeling sub-problem is found. Step A2: Construct a global modeling idea using the search results obtained in Step A1. Retrieve the advanced modeling idea corresponding to the largest subproblem and combine it with the description of the target engineering problem to comprehensively generate a global modeling idea; Step A3: Using the global modeling concept obtained in Step A2, automatically generate the optimization model and solver code for the target engineering problem using a large language model; Step A4 triggers the dynamic update mechanism of the tree-structured knowledge base. The optimized model and solver code obtained in step A3 are used to solve the problem. If the solution does not match the actual answer, the dynamic update mechanism of the tree-structured knowledge base is triggered again. This indicates that the knowledge in the current tree-structured knowledge base is insufficient to correctly model the problem, and it needs to be integrated as new knowledge. Step A5 involves generating a modeling pattern for the problem that failed to be modeled, using a large language model, including the problem type, the extracted "statement idea," and the "modeling idea." These will constitute the entire content of the new node. Step A6 involves using a large language model to determine the sub-problem relationships between the new node obtained in Step 5 and other nodes in the tree-structured knowledge base. This mainly involves determining the parent node of the new node and its relationships with all existing child nodes of its parent node. Step A7: Using the sub-problem relationships with other nodes obtained in Step A6, insert the new node obtained in Step 5 into the appropriate position in the tree-structured knowledge base. This process ensures the logical consistency and structural correctness of the tree-structured knowledge base. Steps A8, A1 to A7 can be repeated. Whenever a new problem cannot be successfully modeled, a similar dynamic update is performed to continuously enhance the problem coverage and depth of the tree-structured knowledge base.
[0059] Verification phase: The dynamically updated tree-structured knowledge base was applied to new, unseen engineering problem instances involving decision-making and scheduling to evaluate its generalization ability and modeling accuracy in handling new problems. The modeling process in Example 1 was repeated, and the generated optimized model was solved and the results validated. The modeling accuracy was calculated as an indicator of the knowledge base update effectiveness. Higher accuracy indicates that the updating of the tree-structured knowledge base effectively improves the performance of the method of this invention, making it more adaptable and robust to problems of different distributions and scales.
[0060] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0061] The above description is merely a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims. The information disclosed in the background section is intended only to enhance the understanding of the overall background technology of the present invention and should not be construed as an admission or implication in any way that such information constitutes prior art known to those skilled in the art.
Claims
1. A method for improving the quality of engineering problem modeling, characterized in that, To improve the quality of automated modeling for solving complex engineering optimization problems using large language models, including: Step 1: Organize a series of engineering optimization problems according to hierarchical classification and complexity to construct a tree-structured knowledge base for engineering optimization problems; Step 2: Receive the natural language description of the target engineering problem to be modeled, perform a recursive search on the tree-structured knowledge base obtained in Step 1, identify the modeling sub-problems corresponding to the nodes related to the target engineering problem through a large language model, until the most matching and specific modeling sub-problem is found. Step 3: Retrieve the advanced modeling ideas corresponding to the modeling sub-problems obtained in Step 2, and combine these advanced modeling ideas with the description of the target engineering problem to generate a global modeling idea; Step 4: Using a large language model, based on the global modeling concept obtained in Step 3, automatically generate the optimization model and solver code for the target engineering problem.
2. The method for improving the quality of engineering problem modeling according to claim 1, characterized in that, Step 4 is followed by: Step 5: Solve the target engineering problem using the optimized model and solution code obtained in Step 4. If the solution result does not match the actual answer, the modeling is confirmed to have failed. The tree structure knowledge base is dynamically updated, and the target engineering problem that failed to be modeled is added as a new node to the tree structure knowledge base.
3. The method for improving the quality of engineering problem modeling according to claim 1, characterized in that, In step 1, the tree-structured knowledge base for engineering optimization problems is constructed in which each parent node is a modeling sub-problem of its child node, and each node represents a modeling problem category and stores relevant high-level modeling ideas for guiding modeling. The advanced modeling ideas stored in each node in step 1 are organized in a schema structure, including: Problem type: A specific name given to the category of optimization problem represented by this node; Statement of ideas: A set of atomized, high-level statements for problem identification; Modeling Approach: A concise and step-by-step guide for modeling large language models.
4. The method for improving the quality of engineering problem modeling according to claim 3, characterized in that, The modeling concept includes the following specific reasoning steps: Code templates for defining decision variables, constructing objective functions, setting various constraints, and defining solvers.
5. The method for improving the quality of engineering problem modeling according to claim 3, characterized in that, In step 2, the tree-structured knowledge base obtained in step 1 is recursively searched in the following manner to identify the modeling sub-problems corresponding to the nodes related to the target engineering problem, until the most matching and specific modeling sub-problem is found, including: Starting from the root node of the tree-structured knowledge base, the semantic similarity between the target engineering problem and the modeling sub-problems in each node of the tree-structured knowledge base is compared layer by layer until the most matching maximal modeling sub-problem is found.
6. The method for improving the quality of engineering problem modeling according to claim 5, characterized in that, In step 2, starting from the root node of the tree-structured knowledge base, the semantic similarity between the target engineering problem and the modeling sub-problems in each node of the tree-structured knowledge base is compared layer by layer until the most matching maximum modeling sub-problem is found, including: Step 21: Analyze the natural language description of the received target engineering problem using a large-scale language model, and extract and summarize it into a statement of ideas; Step 22: Start the search from the root node of the tree structure knowledge base. At each level of the tree structure knowledge base, compare the semantic similarity of the stated ideas obtained in Step 21 with the stated ideas of all candidate child nodes at that level. Step 23: Based on the similarity score returned by the large language model, select the node with the highest score that satisfies the relationship between the modeled sub-problems as the matching sub-problems, and continue to search the next level of sub-nodes of that node from the starting point. Step 24: Repeat step 23 until no more matching modeling sub-problems can be found in the child nodes of the node, that is, the semantic similarity score of all child nodes is 0. Then terminate the search and take the last matching modeling sub-problem on the search path as the most matching and most specific modeling sub-problem found.
7. The method for improving the quality of engineering problem modeling according to claim 2, characterized in that, In step 5, the target engineering problem that failed to be modeled is added as a new node to the tree-structured knowledge base in the following manner: The modeling sub-problems relationship between the new node and other nodes is determined by a large language model. Based on the relationship, the new node is inserted into the appropriate position in the tree structure knowledge base according to preset rules, so as to maintain the structural consistency of the tree structure knowledge base.
8. The method for improving the quality of engineering problem modeling according to claim 7, characterized in that, In step 5, the modeling sub-problem relationship between the new node and other nodes is determined using a large language model in the following manner. Based on the relationship, the new node is inserted into the appropriate position in the tree structure knowledge base according to preset rules, maintaining the structural consistency of the tree structure knowledge base, including: Step 51: After failing to model a target engineering problem, extract and generate its own advanced modeling ideas for the failed target engineering problem, including problem type, statement ideas and modeling ideas; Step 52: Take the node corresponding to the most matching and specific modeling sub-problem found in the search process of Step 2 as the parent node of the target engineering problem that failed to be modeled in the tree structure knowledge base, and take the parent node as the insertion position of the target engineering problem that failed to be modeled in the structure knowledge base. Step 53: Determine the relationship between the new node, which is the target engineering problem that failed to be modeled, and all the child nodes of the determined parent node. If there is a new node that is the parent problem of the modeling subproblem of a certain child node, then proceed to step 54; otherwise, proceed to step 55. Step 54: Insert the new node as a child node of the parent node and the parent node of a certain child node into the tree structure knowledge base, and end the update of the tree structure knowledge base. Step 55: Insert the new node as a child node of the parent node and a sibling node of a certain child node into the tree structure knowledge base, and end the update of the tree structure knowledge base.
9. A processing device, characterized in that, include: At least one memory for storing one or more programs; At least one processor is capable of executing one or more programs stored in the memory, such that when the one or more programs are executed by the processor, the processor can perform the method according to any one of claims 1-8.
10. A readable storage medium, characterized in that, It contains a computer program that, when executed by a processor, can implement the method described in any one of claims 1-8.