A method for operational optimization modeling enhancement
By constructing structured problem representations and generating positive and negative problem pairs, the problems of insufficient dependency relationships and logical consistency between constraints in existing technologies are solved, thereby improving the logical rigor and credibility of the model and providing a quantitative reliability assessment.
Patent Information
- Application Number
- CN202511191362.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-25
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2045-08-25
AI Technical Summary
Existing technologies struggle to effectively capture deep dependencies and logical consistency among constraints when automatically transforming complex business problems described in natural language into mathematical programming models, resulting in insufficient logical rigor and credibility of the generated models.
By constructing a structured problem representation that includes the dependencies between constraints and the original semantic information, positive and negative problem pairs are generated, and logical consistency deduction and multi-dimensional verification are performed to identify potential modeling defects, generate a structured counterexample test set, and finally evaluate the credibility of the model.
It improves the logical rigor and credibility of automatically generated models, provides quantitative reliability assessment, and ensures the reliability and accuracy of model output.
Smart Images

Figure CN120724158B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the field of optimization modeling, in particular to an enhanced method for operational optimization modeling. BACKGROUND
[0002] By mathematically modeling complex real-world problems and solving the optimal solution, operational efficiency can be improved, costs can be reduced, and profits can be maximized. However, it is a highly knowledge- and experience-dependent intellectual-intensive work to convert a complex business problem described in natural language into a precise and complete mathematical programming model, which is usually time-consuming and costly. Therefore, the research on how to use artificial intelligence technology, especially natural language processing and machine learning technology, to realize the automatic construction from problem text to mathematical model, i.e. operational optimization automatic modeling, is not only a frontier topic of AI for Science, but also has great practical application value and broad market prospects, and is one of the key technologies to promote the intelligent decision-making upgrade of various industries.
[0003] Currently, with the rapid development of large language models (LLM), new research paradigms have emerged in the field of operational optimization automatic modeling. Existing technologies mainly use the powerful text understanding and generation capabilities of pre-trained language models to fine-tune the model on a specific domain problem description-mathematical model pairing dataset to train the model to directly translate natural language descriptions into formal mathematical programming models. For example, a typical application is to input a text describing a vehicle routing problem into a fine-tuned large language model, and the model outputs a Python code or a standard mathematical programming paradigm (such as linear programming, mixed integer programming) that can be executed by an optimization solver (such as Gurobi, CPLEX). In order to improve the generalization ability of the model, some methods also use basic data augmentation techniques, such as paraphrasing the problem description, synonym replacement, or making minor changes to the generated code at the syntax level, to expand the size and diversity of the training dataset, so that the model can better handle different styles of natural language input. These methods have shown some potential in handling some relatively simple structured and well-formulated problems.
[0004] However, existing technologies still face deep technical challenges in improving the internal logical rigor and credibility of the modeling results, mainly in the lack of perception of deep dependency relationships between constraints and the superficialization of verification and evaluation mechanisms. SUMMARY
[0005] The present application provides an enhanced method for operational optimization modeling to solve the above problems existing in the prior art.
[0006] Technical scheme, an enhanced method for operational optimization modeling, comprising:
[0007] constructing a structured problem representation containing inter-constraint dependency and original semantic information based on the text file of the operational optimization problem;
[0008] performing logical consistency deduction by constructing and solving forward and backward problem pairs according to the structured problem representation, to generate forward modeling results and backward verification set;
[0009] performing multi-dimensional verification on the forward modeling results to identify potential modeling defects, and generating a structured counterexample test set for the potential modeling defects;
[0010] comprehensively evaluating the credibility of the forward modeling results by combining the test performance of the backward verification set and the structured counterexample test set, to generate a final optimization model and a credibility evaluation report.
[0011] Beneficial effects, the present application can improve the logical rigor and credibility of automatically generated models, and provide quantitative reliability evaluation for the models. BRIEF DESCRIPTION OF DRAWINGS
[0012] Figure 1 A step flowchart of an operational optimization modeling enhancement method provided by an embodiment of the present application.
[0013] Figure 2 A step flowchart of identifying potential modeling defects provided by an embodiment of the present application.
[0014] Figure 3 A step flowchart of generating a structured counterexample test set provided by an embodiment of the present application.
[0015] Figure 4 A step flowchart of determining a target constraint to be covered provided by an embodiment of the present application. DETAILED DESCRIPTION
[0016] In order to make the personnel in the art better understand the present application scheme, the technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should belong to the scope of protection of the present application.
[0017] It should be noted that the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device containing a series of steps or units need not be limited to only those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0018] In the research, it is found that the existing methods generally treat the problem text as a flat word or sentence sequence for processing, which makes them good at capturing local semantic associations, but difficult to understand the global, structural constraint dependency network throughout the entire problem. For example, in a complex production problem, a raw material supply constraint located at the beginning of the problem description may have a decisive, non-local logical impact on a finished product inventory constraint that appears at the end of the text. The existing methods lack an effective mechanism to explicitly represent and quantify such long-distance dependency relationships, resulting in models generated by them that may be correct in the expression of individual constraints, but when these constraints are combined, there may be logical conflicts or incompleteness, failing to truly understand the problem as an organic system of mutual association and mutual constraint.
[0019] In addition, the validation and evaluation of existing technologies for generating models mostly stay on the surface. Their validation methods are usually external, such as checking whether the generated code can run without syntax errors, or whether the solution is reasonable on one or a few fixed test instances. This validation method cannot go deep into the internal logic level of the model, and therefore cannot find more hidden but fatal defects. For example, a model may mistakenly add a variable representing product quantity (dimension in pieces) and a variable representing transportation cost (dimension in yuan) directly, generating a physically meaningless equation. This dimensional inconsistency error cannot be caught by simple code execution testing. Similarly, due to the lack of logical self-consistency checking mechanism, the model cannot reflect and deduce like a human expert, for example, it cannot verify whether the original conditions can be deduced in reverse if the model's conclusions are taken as premises. This inconsistency in forward and reverse reasoning is often a direct manifestation of deep logical errors. The lack of such internal verification mechanisms makes the automatic modeling process like a black box, and the reliability and credibility of the output results cannot be effectively guaranteed and quantitatively evaluated.
[0020] As shown in Figure 1 , an enhanced method for operational optimization modeling is proposed, including the following steps:
[0021] Based on the operational optimization problem text file, a structured problem representation containing constraint dependency relationships and original semantic information is constructed.
[0022] In this embodiment, the operations optimization problem text file is an electronic file containing the natural language description of the problem to be solved, such as a TXT, DOC or PDF file, whose content usually includes the problem background, the optimization goal (such as maximizing profit or minimizing cost) and a series of constraint conditions. The structured problem representation is not the original text string, but mainly consists of two parts: an enhanced constraint dependency graph and a set of semantic anchor points associated with it. Among them, the nodes in the enhanced constraint dependency graph represent the constraints in the problem, the edges represent the dependency relationship between the constraints, and the weight of the edge quantifies the strength of this dependency. The semantic anchor point is a data unit associated with the key node in the graph, which encapsulates the original text of the constraint, the abstract representation of the variable and its physical dimension. By constructing a structured problem representation, an unstructured natural language problem is converted into a mathematical object containing rich structure and semantic information, laying the foundation for subsequent logical reasoning and verification.
[0023] According to the structured problem representation, the logical consistency deduction is performed by constructing and solving the forward and reverse problem pairs to generate the forward modeling result and the reverse verification set.
[0024] In this embodiment, the forward and reverse problem pairs are paired problems constructed for verifying the logical self-consistency of the model. The forward problem is the traditional modeling task: according to the complete description of the problem, a mathematical programming model (i.e. the forward modeling result) is generated. The reverse problem is a reasoning task: according to the structured problem representation, the coverability score is calculated to select one or more constraint conditions to be hidden; the optimal solution or objective function value of the forward problem is added to the problem with part of the constraints hidden to form a new problem that requires the hidden constraints to be inferred. The logical consistency deduction is the process of solving the forward and reverse problem pairs. By comparing whether the constraints inferred by the reverse problem are consistent with the original hidden constraints, the depth of the model's understanding of the internal logic of the problem is tested. If they are highly matched in value, structure and semantics, it indicates that the model has good logical consistency. The solution results and matching conditions of all reverse problems are collected to form the reverse verification set.
[0025] The forward modeling result is verified in multiple dimensions to identify potential modeling defects, and a structured counterexample test set is generated for the potential modeling defects.
[0026] In this embodiment, multi-dimension verification is a deep check on the forward modeling result beyond simple function test. At least two dimensions are included: dimension consistency verification: based on the anchored dimension information in the structured problem representation, construct dimension propagation network, check whether the physical dimensions on both sides of all equations in the model match. For example, an equation representing cost, the final dimensions on both sides of the equation should be currency units (such as yuan), if there is a mismatch, there is a modeling defect. Counterexample robustness test: the counterexample here is not a randomly generated test case. The structured counterexample test set is to construct test cases for the weak links of the model identified in the verification process. Specifically, by making minimal and targeted modifications (measured by edit distance) to the elements of the original problem (such as coefficients, constraint symbols), instances that can trigger a specific type of error are generated. For example, if it is found that the model does not handle the proportional relationship of the output of two products properly, a counterexample that is exactly on the boundary of the proportion can be constructed to test its performance.
[0027] The test performance of the reverse verification set and the structured counterexample test set is combined to evaluate the credibility of the forward modeling result, and a final optimization model and a credibility evaluation report are generated.
[0028] In this embodiment, this step is the final quantitative evaluation of the model quality. The evaluation process integrates the results of the above-mentioned multiple links: the logical consistency score, derived from the matching degree of the reverse verification set; the dimension correctness score, derived from the passing rate of the dimension consistency verification; the counterexample robustness score, derived from the performance of the model on the structured counterexample test set. After normalizing the scores of the three dimensions, the comprehensive credibility score is calculated by a weighted fusion algorithm (the weights can be obtained by regression learning on historical data sets). The system outputs the model with the highest score as the final optimization model. At the same time, an accompanying credibility evaluation report is generated, which not only contains the final credibility score and its confidence interval, but also records the specific performance in each verification link, the potential defects found and the corresponding counterexamples, providing sufficient basis for users to fully understand and trust the model.
[0029] This embodiment improves the reliability and credibility of the final generated model by introducing a multi-stage, multi-dimension verification and evaluation mechanism. The operational optimization modeling enhancement method can be executed by a computer device including a processor and a memory, the memory storing a computer program, the computer program being executed by the processor to implement the steps of the method described in this embodiment.
[0030] According to an aspect of the present application, a structured problem representation is constructed, including:
[0031] Based on the operational optimization problem text file, an enhanced constraint dependency graph is constructed.
[0032] In this embodiment, the text file of the operational research problem Qi is read and its content is fed into a dependency parser. Preferably, the Stanford CoreNLP tool can be used because it outputs in the Universal Dependencies format, which is convenient for subsequent processing. The parser processes each sentence in the text and outputs dependency triples of the form (governor, relation, dependent). For example, for the sentence "The quantity of product A is not more than 50 pieces", the parser can output triples of the form (not more than, nsubj, quantity), (quantity, det, product A), (not more than, dobj, 50 pieces). Here, governor is the core word (the word that governs), dependent is the modifier word (the word that depends on the core word), and relation is the type of grammatical relationship between them (e.g. nsubj for nominal subject, dobj for direct object). Finally, a set of dependency parse trees D is generated for the entire problem text Qi tree i The set of dependency parse trees D is traversed tree i and pre-defined mapping rules are applied to convert the syntactic relationships at the linguistic level into mathematical elements at the operational research modeling level. For this purpose, the system constructs and uses a syntactic-constraint variable mapping table Msyn2vari. Exemplary mapping rules can include that a nominal subject (nsubj) or a direct object (dobj) is usually mapped to a decision variable or its attribute. For example, nsubj(production, apple) -> variable production_apple, where -> is a symbol representing the mapping relationship. A number modifier (nummod) or a number in a noun phrase is usually mapped to a constant or parameter of the model. For example, nummod(apple, 100) -> constant 100. A verb predicate, especially a verb that represents comparison, limitation or equality, is usually mapped to a mathematical operator. For example, not more than, less than, equal to -> ≤; equal to -> =. A coordinate relationship (conj) such as A and B indicates that multiple variables have similar constraint structures. Possessive relationship (e.g. A's B) or prepositional phrase (prep) is usually used to define the dependent or limiting relationship between variables. The system can preliminarily extract the basic elements of the model such as variable names, coefficient values and operation relationships from unstructured text to form an initial constraint list.
[0033] As simple syntactic mapping can miss the logical dependencies that exist in the text but are not directly expressed in the language structure, it is necessary to mine these implicit dependencies. Specifically, based on the preliminary extracted constraint elements, a dependency reasoning rule base is applied to discover new dependencies. The rule base includes at least: a transitive dependency rule: if the system identifies that profit depends on the selling price of product A and the selling price of product A is affected by market fluctuation, it can infer that market fluctuation affects the profit indirectly. An aggregation dependency rule: when the text describes the relationship between a total and its components, such as total cost is composed of production cost, transportation cost and storage cost, the system automatically establishes the aggregation dependency of TotalCost = ProdCost + TransCost + StorCost. A proportional dependency rule: by identifying keywords such as "account for", "is X percent of", etc., a proportional relationship between variables is established. For example, the production of product B accounts for at least 30% of the total production -> x B ≥ 0.3 * (x A + x B +...). This can enrich the dependency information between constraints, forming a more complete and accurate enhanced constraint dependency graph than that obtained by direct syntactic analysis alone, where x A is the production of product A. Optionally, a quality control step is introduced to check the consistency of the enhanced constraint dependency graph. It is checked whether there is a circular dependency in the graph, for example, A depends on B and B depends on A. If so, it needs to be determined whether the cycle is reasonable according to the business logic (such as some dynamic balancing system), or marked as a potential recognition error. It is checked whether there is an isolated constraint node that has no dependency on any other constraint, which usually means a recognition error or an incomplete problem description. The identified dependencies are compared with the qualifiers in the text (such as mainly depends on, slightly affects), to preliminarily verify the reasonableness of the dependency strength. Through the above verification, the system can correct the wrong dependency relationships, and output a more reliable set of constraint dependency relationships that have been verified, laying a solid foundation for subsequent accurate calculation of dependency strength.
[0034] And at the key constraint nodes of the enhanced constraint dependency graph, semantic anchors are implanted to form a structured problem representation; where each semantic anchor is a data triple, and the data triple encapsulates the original text fragment related to the corresponding key constraint node, the abstract variable mapping relationship, and the physical dimension information inferred according to the context.
[0035] In this embodiment, not every constraint node in the graph is implanted with a semantic anchor, but first the key constraint nodes that have a major impact on the overall problem structure are identified. This can improve efficiency and focus on the most important semantic information. Specifically, the system will use the calculated and converged constraint dependency weight matrix W stablei For each constraint node c i , compute its weighted total degree S c (i) = ∑ c W j (i, j) + ∑ stable W k (k, i); where S stable (i) represents the score of node c c , which integrates the total influence (weighted out-degree) of this constraint on other constraints and the total influence (weighted in-degree) of other constraints on this constraint; W i (i, j) is the final dependency strength from constraint c stable to c i . After computing the scores of all nodes, set a threshold θ j to filter the key nodes. Preferably, the threshold can be dynamic, for example, set to the sum of the mean and one standard deviation of all node scores, i.e., θ c = mean(S c ) + σ(S c ). All nodes c c with score S c (i) > θ c are identified as key constraint nodes, forming the key constraint set C i key i .
[0036] For each key constraint node, extract the original semantic fragment and perform patternized abstraction, that is, from the original problem text, accurately extract the corresponding, semantically complete text description for each key constraint and convert it into a semi-structured abstract expression. Specifically, for each constraint c key i in the key constraint set C k , the system will backtrack to the dependency syntax tree D tree i . By locating the most relevant verb or core word for the constraint, the system can extract a complete clause containing the subject, predicate, object, and necessary modifier components along the boundary of the syntax tree. For example, for the constraint x A ≥ 2 * x B , the system extracts not just individual words, but complete sentences "The production quantity of Product A must be at least twice that of Product B". After extracting the original text snippet, the system applies a set of abstraction rules to convert it into an intermediate representation. For example: the production quantity of Product A -> abstracted as a variable var[name: product_A_quantity]; must be at least -> abstracted as an operator op[type: ≥]; Product B -> abstracted as another variable var[name: product_B_quantity]; twice -> abstracted as a coefficient coeff[value: 2]. The patterned abstract representation A pattern i is generated, which records the mapping between the original expression and the abstract symbols.
[0037] The physical dimension information is inferred from the context, and the physical dimension of each variable and coefficient in the key constraint is labeled. The system scans the extracted text snippet and its context, and applies a context-based dimension inference algorithm. The rule base of this algorithm can include: explicit unit extraction: directly find and map standard units from the text, such as dollars, etc. to the currency dimension [M], pieces, individuals, tons, etc. to the quantity or mass dimension [Count] or [Mass], hours, days, etc. to the time dimension [T]. Verb implied inference: infer the dimension from the core verb. For example, the verbs buy, spend, cost strongly imply that the dimension of their object is currency [M]; the verbs produce, manufacture imply that the dimension of their object is quantity [Count]; transportation may imply the weight [Mass] or volume [L 3 ] dimension. Numerical range inference: for some coefficients without explicit units, their value range can provide clues. For example, a coefficient value in the range [0, 1] is likely to be a ratio or efficiency, with a dimensionless [1] dimension. Through the above rules, the system labels each variable and parameter in the variable mapping table with the inferred physical dimension information.
[0038] The three pieces of information obtained in the preceding steps are encapsulated to build a data triple, i.e. a semantic anchor anchor k : anchor k = (original text snippet, patterned abstract representation, dimension information); where the original text snippet is the extracted complete natural language description; the patterned abstract representation is the generated semi-structured representation containing variable mapping relationships; the dimension information is the dimension labeled for each variable and coefficient. Each semantic anchor anchor k generated is attached as a data attribute to the corresponding key constraint node c k in the augmented constraint dependency graph. The construction of the structured problem representation containing the inter-constraint dependency relationship and the original semantic information is completed.
[0039] According to one aspect of this application, constructing an enhanced constraint dependency graph includes calculating a dependency strength value for each pair of constraint nodes in the graph;
[0040] The calculation of the intensity value considers at least the following three dimensions:
[0041] Structural influence degree, which characterizes the degree of overlap between variables;
[0042] The numerical influence of the correlation between corresponding coefficients of shared variables;
[0043] And the logical influence of characterizing the path length of symbolic derivation between constraints.
[0044] In this embodiment, the structural influence degree (w) characterizing the degree of variable overlap is... struct This measures the structural correlation between two constraints. If two constraints share multiple identical decision variables, they are considered structurally highly correlated. The calculation method is: w struct (i, j) = J(c i c j )=∣V i ∪V j |V i ∩V j |; where w struct (i, j) represents constraint c i With c j The degree of structural influence between them; c i and c j V represents the i-th and j-th constraints in the problem, respectively; i and V j These are constraints c. i and c j The set of decision variables included in J(c) i c j This calculates the Jaccard similarity between two sets, with a value range of [0, 1]. A larger value indicates a stronger structural association. The numerical influence (w) characterizes the correlation between corresponding coefficients of shared variables. num This measures the degree of correlation between the coefficient values of the same variable in two constraints. For example, in a total cost constraint and a budget constraint for the production line of product A, the unit cost coefficient of the output of product A should be the same or highly correlated. The calculation method is: w num (i, j) = f(r) ij d ij )=exp(-∣log(r ij )∣)×exp(-∣d ij | / d max ); where w num (i, j) represents constraint ci The numerical influence degree between c j is the ratio of the coefficients of the shared variable in the two constraints; d ij is the difference of the coefficients of the shared variable in the two constraints; d ij is the difference of the coefficients of the shared variable in the two constraints; d max is a normalization factor, for example, the maximum value of the differences of all coefficients in the problem. This formula makes the numerical influence degree approach to 1 when the ratio of the two coefficients is close to 1 and the difference is close to 0. The logical influence degree (w logic ) measures whether there is a logical derivation relationship between two constraints. This relationship can not be direct, but derived through a series of intermediate constraints. The shorter the derivation path, the more direct and stronger the logical influence. It is calculated as follows: w logic (i, j) = 1 / (1 + path length (i, j)); where w logic (i, j) represents the logical influence degree from constraint c i to c j ; path length (i, j) is the shortest path length from node c i to c j in the logical derivation graph. If there is no path, the length is infinite, and the logical influence degree is 0.
[0045] According to one aspect of the present application, the calculation process of the dependency strength value further comprises:
[0046] After obtaining the influence degrees of the three dimensions, the directional propagation model is applied to calculate the initial dependency strength.
[0047] Specifically, after obtaining the influence degrees of the three dimensions, the system applies the directional propagation model and performs weighted fusion to obtain the initial directional dependency strength: W dir (i, j) = dir(i, j) x (a w struct (i, j) + β w num (i, j) + γ w logic (i, j)); where W dir (i, j) is the initial directional dependency strength from constraint c i to c j ; dir(i, j) is the directional factor. Preferably, if the variable set of constraint c i is a subset of the variable set of c j (typically meaning that c i is a more basic or local constraint), then c i has a stronger influence on c jThe influence is amplified, and dir(i, j) can be set to a value greater than 1, such as 1.2; conversely, it can be set to a value less than 1, such as 0.8. α, β, and γ are the weight coefficients of the three dimensions, which sum to 1. For example, they can be set empirically to α=0.4, β=0.3, and γ=0.3. These weights can also be obtained by learning and optimizing on historical datasets. This not only quantifies the strength of the dependency but also preliminarily determines the direction of the influence, laying the foundation for subsequent iterative propagation.
[0048] The initial dependency strength is iteratively updated until convergence, yielding the final dependency strength value. Each iteration aims to add the indirect effects propagated through intermediate nodes to the direct dependency strength of the node pair. This ensures that the final dependency strength value reflects the cumulative effect of multi-step propagation.
[0049] In this embodiment, the purpose of iterative updates is to ensure that the dependency strength between any two nodes in the graph reflects not only their direct connections but also all indirect connections passed through other nodes. The iterative formula is as follows: W t+1 (i, j) = W t (i,j)+η∑ k (W t (i, k)×W t (k, j)); where W t (i, j) represents the condition at iteration t, where the constraint c i to c j The dependency strength, W0 is the initial directed dependency strength matrix W. dir ;∑ k (W t (i, k)×W t (k, j) calculates all the connections through intermediate node c k From c i Pass to c j The sum of indirect effects; η is the learning rate or propagation decay factor, a decimal between 0 and 1 (e.g., 0.1), used to control the update step size in each iteration to prevent instability caused by excessively fast updates. The termination condition for the iteration is when the change in the weight matrix obtained from two consecutive iterations is sufficiently small, i.e., the Frobenius norm difference of the matrix is less than a preset threshold ε (e.g., 10). -5 ), that is, ||W t+1 - W t || F < ε.
[0050] Optionally, to ensure that the iterative process is mathematically convergent, rather than divergent or oscillatory, an analysis based on Banach fixed point theorem is introduced. Specifically, the convergence of the iterative process depends on the learning rate η and the properties of the initial matrix W0. A sufficient condition for convergence is that the spectral radius of the linear operator associated with the iterative formula is less than 1. For the iterative formula, this translates to a constraint on η. Calculate the spectral radius ρ(W0) of the initial weight matrix W0 (i.e. the largest absolute value of its eigenvalues). In theory, to guarantee convergence, η must satisfy η < 1 / ρ(W0 2 ). In practice, to leave a safety margin, the upper limit of η can be set as η max =σ / (λ max 2 ), where λ max is the largest eigenvalue of W0 and σ is a safety factor less than 1 (e.g. 0.8). Calculating this upper limit before the iteration begins can avoid choosing a learning rate that leads to divergence.
[0051] In some embodiments, to improve the convergence speed while guaranteeing convergence, an adaptive η adjustment mechanism can be employed. After each iteration, calculate the convergence rate r t =∣∣W t+1 -W t ∣∣ F / ∣∣W t -W t-1 ∣∣ F . If r t continuously approaches 1 (e.g. greater than 0.95), it indicates that the convergence is too slow, and the system can moderately increase the learning rate: η t+1 =min(1.2×η t , η max ), where η t is the learning rate at time t and η max is the maximum learning rate; if rt fluctuates greatly, it indicates that there is a risk of oscillation, and the system can reduce the learning rate: η t+1 =0.8×η t . This makes the iterative process more efficient and intelligent.
[0052] Further, in some extreme cases, even if it should theoretically converge, due to numerical precision or special graph structure, the iteration may still not reach the convergence threshold within the preset maximum number of iterations T max (e.g. 1000 times). At this time, the system will start the non-convergence processing strategy: check whether there is a specific strongly connected component in the graph that causes the weight to grow indefinitely, and isolate or specially process it; use a smoother update method, for example, W t+1 =(1-δ)W t +δW new , where Wnew is the new matrix calculated by the original formula, and δ is a damping factor (e.g. 0.5) that can effectively suppress oscillation; if still ineffective, the average of the weight matrix of the last k rounds (e.g. 10 rounds) of iteration is taken as the final convergence result. In order to ensure that the final dependent weight matrix obtained is robust, rather than highly sensitive to the initial value or calculation error, the system will perform stability verification. Preferably, the perturbation analysis method can be used: a small random perturbation (e.g. ±5% for each element) is applied to the initial matrix W0, and then the entire iteration process is re-run. If the final convergence matrix compared with the original unperturbed convergence matrix, its relative error is within an acceptable range (e.g. less than 10%), it is proved that the convergence result is stable. The final dependent weight matrix output can accurately reflect the multi-step cumulative effect, and has high robustness and stability.
[0053] As shown in Figure 4 , according to one aspect of the present application, before constructing the forward and backward problem pair, further comprising determining the to-be-covered target constraint, specifically:
[0054] Calculate the coverability score for each candidate constraint, aiming to balance two attributes of the constraint: the information redundancy of the constraint, determined by the number of variables and the coefficient distribution of the Shannon entropy inside the constraint; and the structural key degree of the constraint in enhancing the constraint dependency graph, represented by the dependency out-degree of the constraint.
[0055] Specifically, the design of the coverability score Score(c i ) is based on the ideal covered constraint, which should contain more information (high information redundancy) itself, but has relatively small impact on the overall problem structure (low structural key degree). The score function can be designed as: Score(c i )=α·H rd (c i )-β·C st (c i );wherein Score(c i ) is the coverability score of constraint c i ; H rd (c i ) is the information redundancy of constraint c i ; C st (c i ) is the constraint c iThe structural criticality; α and β are weighting coefficients used to balance these two attributes. Preferably, α and β are both positive numbers and their sum is 1, for example, α=0.7, β=0.3. These weights can be optimized by cross-validation on a historical problem set to achieve the best reverse validation effect. Information redundancy is determined by the number of variables within the constraint and the Shannon entropy of the coefficient distribution. The more variables a constraint contains and the more uneven the coefficient distribution (i.e., some coefficients carry unexpected information), the higher its information redundancy. In this embodiment, H rd (c i The calculation method for H is as follows: rd (ci)=log(n v )+H shannon (p c )+log(n op ); where n v It is constraint c i The number of variables included; n op It is constraint c i The number of operator types in H (e.g., a constraint containing + and - would have 2); shannon (p c ) is constraint c i The Shannon entropy of the coefficient value distribution. Its calculation process is as follows: Extract all coefficient vectors from the constraints, a = [a1, a2, ..., a...]. n ], normalize it to a probability distribution vector p c =[p1, p2, ..., p n ], where p j =∣a j ∣ / ∑ k |a k |. Calculate the Shannon entropy: H shannon (p c )=-∑ j=1 n p j log2(p j Structural criticality is characterized by the out-degree of a constraint in the augmented constraint dependency graph. A larger out-degree of a constraint means it influences more other constraints, and removing it will cause greater disruption to the reasoning chain of the entire problem. In this embodiment, C st (c i Using weighted out-degree to measure: C st (c i ) = ∑ j W stable (i, j); where W stable (i, j) are from constraint c i To any other constraint c jthe final dependency strength. Optionally, more sophisticated dependency measures such as PageRank values or node scores S c (i) can be used to more comprehensively characterize their structural criticality.
[0056] The constraint with the highest coverability score is selected as the target constraint to be covered.
[0057] Specifically, after computing the coverability scores for all constraints, all scores are sorted in descending order. The top k constraints (e.g., k can be set to a fixed value such as 3, or 1 / 4 of the total number of constraints of the problem, whichever is smaller) are selected as candidate target constraints to be covered. Before final determination, a verification step is included: each candidate constraint is temporarily removed from the problem, and a quick degree-of-freedom analysis is performed to make sure that the problem model after removing the constraint is still theoretically solvable (i.e., not underdetermined). The top constraint that passes this verification is finally selected as the target constraint to be covered, for generating the inverse problem.
[0058] Further, after determining the target constraint to be covered, a pair of forward and inverse problems is constructed, including: for a given operational optimization problem Qi, it is itself the forward problem. Its modeling result is the forward modeling result. For the target constraint ω j to be covered, a residual problem text T partial j is constructed. Specifically, using the semantic anchor implanted for the target constraint ω j to be covered, the original text segment of ω partial in the original problem text Qi is precisely located. This text segment is deleted from the full text of Qi. This deletion process is programmed and will make basic grammatical adjustments to ensure that the deleted text is still linguistically smooth. After obtaining the residual problem text T j , inverse conditions are added to it, and the question sentence is reconstructed, thereby generating the final inverse problem text T reverse j . The inverse conditions are usually related information of the optimal solution of the original problem Qi. For example, if the goal of the original problem is to maximize profit, and it is known after solving that the maximum profit is 15000 yuan. The system will add the inverse condition "the maximum profit is 15000 yuan" to T partial jat the beginning or end of the text, using a pre-defined template, inserting a new condition, such as: "As a supplement, it is known that the maximum total profit that can be achieved when produced according to the optimal strategy is 15000 yuan". Modify or replace the original question sentence. The original question sentence may be "How should production be arranged to maximize profit", which is restructured to "Please infer what constraint condition is omitted in the original problem according to the above information". Because the deleted constraint text fragment may contain the definition or explanation of some variables, direct deletion may cause some variables in the reverse problem to lose context and become semantically incomplete. Specifically, the system performs the following inspection and repair process: the system has a set of inspection rules, for example: rule one: every decision variable appearing in the problem must have a clear natural language definition (for example, x A represents the production quantity of product A, unit: pieces); rule two: the physical dimension of each variable must be labeled; rule three: the type of variable (such as integer, continuous, binary) must be clear. Traverse all variables involved in the reconstructed reverse problem text T reverse j i reverse j If it is found in the verification process that the definition or dimension information of a variable (for example, product_C_cost) is lost due to constraint deletion, the system will start automatic repair. Find the complete definition and dimension information of the variable from the semantic anchor point set A i , and insert it into T reverse in a natural way (for example, near the first appearance of the variable, in the form of parentheses annotation or supplementary explanation). After a series of construction, verification and repair steps, the system finally obtains the semantic complete and unambiguous reverse problem text T j complete j . Pair the original problem Qi (as a forward problem) with T complete j (as a reverse problem) to form a forward and reverse problem pair (Qi, T complete j ), which is sent to the subsequent solving and reasoning module.
[0059] According to an aspect of the present application, the reverse verification set is generated, comprising:
[0060] Formalize the task of restoring the covered constraint as a constraint satisfaction problem with the coefficients and symbols of the covered constraint as unknown variables.
[0061] In this embodiment, the semantic complete reverse problem text Tcomplete j into a formalized constraint satisfaction problem (CSP). A CSP is composed of a set of variables, the domain of values for each variable, and a set of constraints. Specifically, for this inverse CSP: Variables: are the unknown components to be solved for, which are covered by the constraint ω j . This includes the coefficient values of all variables in the constraint and the logical operator of the constraint. For example, if the covered constraint is a * x + b * y ≤ c, then the variables of this CSP are a, b, c, and the operator ≤. Domains: are the possible value ranges for each unknown variable. For example, the domains of coefficients a and b can be set as a reasonable integer or floating-point interval, such as [-100, 100]; the domain of the operator is {≤, ≥, =}. Constraints: are conditions that must be met during the solving process. This includes all the uncovered constraints in the original problem, as well as the added inverse conditions (i.e., the optimal solution or objective function value of the original problem). For example, the optimal solution (x', y') of the original problem must satisfy the restored constraint a * x' + b * y' ≤ c. A natural language reasoning task is converted into a mathematical problem with a clear solving goal.
[0062] For the constraint satisfaction problem, a three-stage hybrid solving strategy is applied: in the first stage, symbolic reasoning is used to determine the logical operator of the constraint; in the second stage, interval arithmetic propagation is implemented to narrow the search range of unknown coefficients; in the third stage, numerical optimization is performed within the narrowed range to find the precise coefficient values.
[0063] Specifically, to efficiently and accurately solve the CSP, a three-stage hybrid solving strategy is adopted, which combines the advantages of symbolic reasoning, interval propagation, and numerical optimization. First stage: symbolic reasoning is used to determine the logical operator of the constraint. This stage aims to determine the type of constraint (less than or equal, greater than or equal, or equal). The system will use known optimal solution information for symbolic reasoning. For example, if the optimal solution x' is known to make another constraint (such as a resource upper limit constraint) in the original problem take the equality (i.e., the resource is used up), and increasing the value of x' will cause the objective function value to decrease, then the system can infer that the covered constraint is likely to be a less than or equal (≤) type inequality, because it limits the upper limit of x'. The search space of the operator can be reduced.
[0064] Second stage: Interval arithmetic propagation is implemented to shrink the search range of unknown coefficients. After the operator type is determined (or its range is narrowed down), this stage utilizes interval arithmetic techniques to shrink the domain of unknown coefficient values. The system represents each variable in the problem (including the known optimal solution and unknown coefficients) as an interval [min, max]. These intervals are propagated through all known constraints in the problem. For example, if a constraint is x + y = 10 and the interval of x is [2, 4], then the interval of y can be deduced to be [6, 8]. By repeatedly performing such propagation throughout the constraint network, it is possible to effectively eliminate impossible coefficient values, thereby shrinking the search range of unknown coefficients from a large interval (e.g., [-100, 100]) to a small interval (e.g., [1.8, 2.2]).
[0065] Third stage: Numerical optimization is performed within the shrunk range to find the precise coefficient values. After pruning by the previous two stages, this stage performs precise solving within the remaining, small search space. It can be constructed as a numerical optimization problem, e.g., finding a set of coefficient values such that when the known optimal solution is substituted into the recovered constraints, it has the smallest relaxation or violation. Gradient descent, particle swarm optimization, or simulated annealing algorithms can be used to find the optimal coefficient values. Since the search space is already small, these numerical optimization algorithms can quickly converge to a high-quality solution.
[0066] The recovered constraints are obtained, constituting the reverse verification set.
[0067] In this embodiment, in some cases, the reverse problem can have multiple mathematically feasible solutions. To select the solution that best fits reality, the system applies a screening strategy: prefer solutions where coefficients are integers or simple fractions (e.g., 1 / 2, 3 / 4); prefer solutions where the orders of magnitude of coefficients are consistent with other constraints in the problem; select the solution that best balances or rationalizes the feasible region structure of the original problem. Through screening, a unique, most credible recovered constraint ω j is output as the result of reverse reasoning. After obtaining the recovered constraint ω j , the system compares it with the original obscured constraint ω j (which is known in the verification stage) and calculates a comprehensive matching score. This score is the core of the reverse verification set and is used for final credibility assessment. The matching score is calculated from three dimensions: numerical matching: calculate the cosine similarity or normalized difference of the two constraint coefficient vectors; structural matching: compare whether the operators of the two constraints are exactly the same, 1 if yes, 0 if no; semantic matching: use semantic anchors to check whether the variables involved in the two constraints refer to the same physical entity. The scores of these three dimensions are weighted and averaged to form the final matching score of this reverse verification.
[0068] As Figure 2 illustrated, according to one aspect of the present application, identifying potential modeling defects includes:
[0069] From the structured problem representation, an augmented constraint dependency graph and initial dimension information of each variable are extracted; based on the topology of the augmented constraint dependency graph and according to pre-set dimension operation rules, a dimension flow network is constructed, wherein a node stores the dimension state of a variable and an edge represents the propagation and conversion of dimensions between constraints.
[0070] In the present embodiment, all variable nodes in the augmented constraint dependency graph are traversed. For each variable, a semantic anchor point is queried to extract its physical dimension information. Each physical dimension is represented as a dimension vector. For example, based on a set of basic dimensions (length L, time T, currency M, and quantity Count), the dimension of production rate can be represented as [L:0, T:-1, M:0, Count:1] (i.e., Count / T), and the dimension of cost can be represented as [L:0, T:0, M:1, Count:0]. The system has a set of strict dimension operation rules built-in for propagating dimensions in equations. These rules are implemented in the form of vector operations: multiplication rule: dim(A x B) = dim(A) + dim(B) (add corresponding components of the dimension vector); division rule: dim(A / B) = dim(A) - dim(B) (subtract corresponding components of the dimension vector); addition / subtraction rule: dim(A + B) = dim(A) = dim(B) (the dimension of the result is unchanged); power operation rule: dim(A n ) = n x dim(A) (each component of the dimension vector is multiplied by n); dimensionless quantity: such as ratio, pure count, etc., whose dimension vector is a zero vector [0, 0, 0, 0]. The topology of the dimension flow network is completely isomorphic to the augmented constraint dependency graph. Each node in the network is used to store the dimension vector state of its corresponding variable or parameter, and each edge stores the dimension conversion relationship resulting from the constraint relationship.
[0071] Using the dimension flow network, it is verified whether the dimensions on both sides of each equation in the forward modeling result are consistent, and potential modeling defects of dimension mismatch are located.
[0072] Specifically, after the network is constructed, the system will verify each mathematical equation (including the objective function and all constraints) in the forward modeling result M i one by one. For each equation, the system will calculate the final dimension of the left-hand side (LHS) expression and the right-hand side (RHS) expression, respectively. For example, for the equation cost A * quantity A = total cost_A, the system will get the dimension of cost A (e.g. [M:1, Count:-1], i.e. per unit, per item); get the dimension of quantity A (e.g. [Count:1], i.e. item); calculate the dimension of LHS according to multiplication rule: dim(LHS) = dim(cost A ) + dim(quantity A ) = [M:1, Count:0]; get the dimension of total cost_A (e.g. [M:1]); compare dim(LHS) and dim(RHS). In this case, they are equal, and the verification is passed. If they are not equal, e.g. [M:1] = [M:1, L:1], the system will flag a potential modeling deficiency of dimension mismatch. Where cost A is the cost of a single item of product A, quantity A is the number of items of product A, and total cost_A is the total cost of product A.
[0073] Further, the process of constructing the dimension flow network includes:
[0074] running an algorithm on the augmented constraint dependency graph to detect strongly connected components, and identify dimension circular dependency conflicts among the constraints.
[0075] In particular, as part of the process of constructing the dimension flow network, the present embodiment also specifically handles the case of circular dependency. A graph algorithm, such as Tarjan's algorithm, is run on the augmented constraint dependency graph to detect all strongly connected components (i.e. loops in the augmented constraint dependency graph). For each loop found, the system sets up a system of dimension consistency equations. The equations require that, starting from the dimension of any point in the loop, propagating around the loop, the dimension must return to its original value (i.e. the cumulative dimension transformation matrix of the entire loop must be the identity matrix). If this system of equations has no solution, it means that there is a dimension circular dependency conflict, which is flagged as a special kind of modeling deficiency.
[0076] In the process of using the dimension flow network to verify dimension consistency, when a dimension mismatch is detected, a conflict resolution strategy is initiated, the dimension propagation path is traced back to locate the source of the conflict, and an implicit conversion factor is introduced to bridge the dimension difference.
[0077] Specifically, along the dimensional flow network, starting from the conflicting equation, the system traces back upstream to locate the specific variable or calculation step that causes the dimensional mismatch. After locating the source of the conflict, the system checks its semantic anchor. It attempts to judge whether there is an implicit conversion factor missing in the model that is consistent with the business logic. For example, if the equation "output = input time" leads to the conflict "[Count] = [T]", the system, after tracing back, finds that the context of the variable input time mentions production efficiency, it can infer that the coefficient of production efficiency (dimension [Count / T]) is missing in the model, and suggests to revise it to "output = production efficiency * input time", thus bridging the dimensional gap.
[0078] As shown in Figure 3 According to one aspect of the present application, generating a structured counterexample test set comprises:
[0079] Analyzing the potential modeling defects identified by multi-dimensional validation, and inducing the characteristic patterns of weak validation links.
[0080] In this embodiment, the system collects all the labeled potential defects and performs cluster analysis to induce the characteristic patterns of weak validation links. Common characteristic patterns include: dimensional mismatch type: a specific equation structure always leads to dimensional conflict; constraint conflict type: the model handles the constraint relationship between two or more interdependent constraints poorly, and is prone to produce no solution under certain conditions; numerical singularity type: the model contains division operations, and the denominator may be zero or close to zero under certain inputs, leading to numerical instability; improper handling of boundary conditions type: the model behaves unexpectedly when handling boundary conditions where the variable value is equal to its upper or lower limit.
[0081] For each characteristic pattern, a minimal counterexample instance that can trigger the corresponding defect is constructed by incrementally modifying the elements of the operations research problem text file; wherein the minimality of the counterexample instance is measured by its edit distance from the operations research problem text file.
[0082] To ensure the pertinence and conciseness of the counterexamples, this embodiment adopts the method of constructing minimal counterexample instances. Specifically, the minimality of the counterexample needs to be formally defined. It is measured by the edit distance. The edit distance D edit (Qi, Ej) is defined as the weighted sum of the modification operations required in the conversion process. Exemplary operations and weights can be: modifying the value of a coefficient in a constraint: weight 1; changing the logical operator of a constraint (such as changing ≤ to =): weight 2; adding or deleting a complete constraint: weight 3. A counterexample is called minimal if its edit distance is the smallest among all counterexamples that can trigger the same defect.
[0083] Optionally, the minimal counterexample instance is constructed by performing an incremental search algorithm, specifically: starting from the original problem text file, explore problem variants with increasing edit distance layer by layer using a breadth-first strategy: check problem variants resulting from all single modification operations; if none of them can trigger the corresponding defect, continue to check problem variants resulting from more modification operations; the first problem variant that can successfully trigger the corresponding defect is determined as the minimal counterexample instance.
[0084] Specifically, the execution flow of the incremental search algorithm is as follows: put the original problem Qi into the 0th layer of the search queue; explore layer by layer: first step (edit distance 1): apply all possible single modification operations (i.e., modify a single coefficient) with weight 1 to the original problem to generate a batch of new problem variants. Run the modeling and verification process for each variant to check if it can trigger the target defect. If found, the search ends, and the variant is the minimal counterexample. Second step (edit distance 2): if the first step does not find, continue to explore. This includes applying all single operations with weight 2 (change the operator) and all two-by-two combinations of operations with weight 1. Again, check all newly generated variants. In this way, increase the edit distance layer by layer, and check problem variants resulting from more or higher weight modification operation combinations. The first problem variant that can successfully trigger the corresponding defect is determined as the minimal counterexample instance. Since the breadth-first search is performed layer by layer according to the edit distance, the first found solution must be one of the solutions with the smallest edit distance.
[0085] Collect all verified valid minimal counterexample instances to form a structured counterexample test set.
[0086] In this embodiment, the minimal counterexample instance found by the search is input into the complete modeling system again for final verification to confirm that it can stably and reproducibly trigger the expected defect. All verified valid minimal counterexample instances are finally collected to form a structured counterexample test set Ei, which is used for final stress testing and robustness evaluation of the model. Optionally, the numerical values of the counterexample can be optimized to improve its readability while maintaining minimality, for example, preferentially selecting integer coefficients instead of floating-point numbers.
[0087] Optionally, after the structured counterexample test set Ei is generated, an automated testing module is initiated. This module iterates through each counterexample in Ei, inputs it as a new problem, and calls the forward modeling module for processing. For each counterexample, its detailed test performance is recorded, including: output result: whether the model successfully generated a mathematical model, or a crash or timeout occurred; result correctness: if a model is successfully generated, whether its solution is reasonable, and whether it triggers the expected logical error; dimensional correctness: whether the generated model can pass the dimensional consistency verification. These records are quantified as failure severity, and used to calculate the counterexample robustness score S robust .
[0088] According to an aspect of the present application, the process of evaluating the reliability of the forward modeling result includes:
[0089] From the results of logical consistency deduction, the results of multi-dimensional verification, and the test performance of the structured counterexample test set respectively, the forward and reverse consistency score, the dimensional correctness score, and the counterexample robustness score are extracted and normalized.
[0090] In the present embodiment, from the outputs of the aforementioned multiple verification links, the original scores of the three core dimensions are extracted and normalized to the uniform [0, 1] interval. Including: the forward and reverse consistency score S match , which is the weighted average of the matching degree of the restored constraints and the original constraints in the numerical, structural and semantic three dimensions. Since the matching degree itself is a value between 0 and 1, this score usually does not need additional normalization; the dimensional correctness score S dim , which is calculated by dividing the number of equations that pass the dimensional consistency check by the total number of equations: S dim = the number of equations that pass the dimensional consistency check / total equations, which naturally falls within the [0, 1] interval; the counterexample robustness score S robust , which comes from the test results of the counterexample test set. The simple pass rate cannot reflect the severity of failure. Therefore, preferably, each type of failure (such as: giving a wrong answer, model crash, timeout no response) is assigned an increasing failure severity score (for example, 1, 5, 10). The robustness score is calculated by the following formula: S robust =1 / (1+average failure severity), which can map the non-negative severity score to the (0, 1] interval. The more severe the failure, the closer the score is to 0.
[0091] By constructing a regression model on the historical verification data set, the weights for fusing the three scores are learned.
[0092] To make the fusion of different dimension scores more objective and scientific, rather than relying on subjective setting, the embodiment adopts a data-driven way to learn the fusion weights. Specifically, a historical validation dataset is utilized. The dataset contains a large number of past operational optimization problems, and their corresponding three-dimensional validation scores (S match , S dim , S robust ) and the final model quality gold standard score Q expert annotated by domain experts (a value between 0 and 1). Based on this dataset, a linear regression model is constructed: Q expert =w1·S match +w2·S dim +w3·S robust ; and constraints w1+w2+w3=1 and w i ≥0 are imposed. By solving this regression problem with optimization algorithms such as least squares, the optimal weight vector W learn =[w1, w2, w3] can be obtained. For example, the solution may be [0.4, 0.35, 0.25], indicating that the positive and negative consistency contributes the most to the final model quality from the historical data.
[0093] The learned weights are applied to the weighted fusion of the three normalized scores to calculate the comprehensive credibility score.
[0094] After obtaining the learned weights, the comprehensive credibility score Score trust of the current problem is calculated: Score trust =w1*·S match +w2*·S dim +w3*·S robust ; where w1*, w2* and w3* are different weight coefficients. In some optional implementations, nonlinear fusion alternatives can also be selected according to the characteristics of the problem: geometric mean fusion: Score geo =(S match w1* ·S dim w2* ·S robust w3* ), which is more sensitive to low scores in any dimension, suitable for scenarios with obvious short board effect. Min-dominant fusion: Score min =min(S match , S dim , S robust ), suitable for scenarios requiring high reliability where any dimension validation failure is unacceptable.
[0095] The bootstrap resampling technique is applied to estimate the confidence interval of the composite reliability score, based on the distribution of the three scores, to quantify the uncertainty of the evaluation result.
[0096] To evaluate the stability of the composite score itself, the bootstrap resampling technique is further adopted to estimate its confidence interval. The detailed procedure is as follows: for each dimension score, go back to its original data (e.g., S match is the average of the matching degrees of multiple reverse verifications). The system resamples with replacement from these original data to generate a new data set of the same size as the original data set. Repeat this resampling process N times (e.g., N = 1000) to get 1000 bootstrap sample sets. For each bootstrap sample set, recalculate its S match , S dim , S robust , and further calculate a composite reliability score Score trust (i), where i = 1,..., 1000. Get the empirical distribution of the 1000 composite reliability scores. Sort this distribution and take its 2.5% and 97.5% quantiles to form the 95% confidence interval [Score low , Score high ] of the score. The confidence interval provides important information about the uncertainty of the evaluation result. For example, the result of 0.85 [0.82, 0.88] is much more stable and reliable than the result of 0.85 [0.70, 0.95]. Finally, the evaluation result output by the system is Score trust ± (Score high - Score low ) / 2.
[0097] Further, according to the composite reliability score, the candidate models in the forward modeling result are sorted, the highest scoring model is selected as the benchmark, the business semantic interpretation of the model is recovered in combination with the constrained semantic anchor set, and the final optimized model of the problem is generated. Based on the final optimized model and the test results, a complete report including the model structure, verification process, reliability analysis and improvement suggestions is generated, and the reliability evaluation report of the model is output.
[0098] In some complex modeling scenarios, the system may generate multiple candidate mathematical optimization models for the same problem. For example, for a nonlinear problem, the system may generate a linear approximation model and a second-order cone programming model at the same time. In this case, the composite reliability score Score trust is calculated for each candidate model configuration. Finally, the system selects the candidate model with the highest reliability score as the final optimal model configuration M optiTo enable users to fully understand and trust the final output model, an accompanying, detailed explainability report is also generated. This report presents the following in a human-readable format: the final optimized model M finali : shows the final selected mathematical model and links each variable and constraint in the model back to its natural language description in the original problem text via semantic anchors, enhancing the model's explainability; a comprehensive trustworthiness assessment: clearly shows the final comprehensive trustworthiness score and its 95% confidence interval, and lists the specific scores in the three dimensions of positive-negative consistency, dimension correctness, and counterexample robustness; a validation process summary: highlights key findings in each validation step. For example, lists all detected dimension mismatches and their repair suggestions, shows the recovery process of a successful negative validation case, and lists one or two key counterexamples that the model failed to pass; improvement suggestions: based on identified weak validation links, the report can provide specific improvement suggestions for model developers or users.
[0099] In a specific embodiment, assume a simple production planning problem with three constraints: c1 (resource A constraint): 1*x + 1*y <= 100; c2 (resource B constraint): 2*x + 3*y <= 240; c3 (minimum production constraint): 1*x >= 10; where x and y are the production quantities of two products. Calculate the initial dependency strength between each pair of constraints, and for simplicity, only consider the structural influence degree w struct and the numerical influence degree w num , and set the weights α = 0.5, β = 0.5. For (c1, c2): variable set: V1 = x, y, V2 = x, y; w struct (1, 2) = J(V1, V2) = |x, y| / |x, y| = 1.0; the coefficient ratio of shared variable x is 2 / 1 = 2, and the difference is 1; the coefficient ratio of shared variable y is 3 / 1 = 3, and the difference is 2. Assume d max = 5; w num (1, 2) can take the average of the two shared variable influence degrees, which is assumed to be 0.4 for simplicity; the initial strength W0(1, 2) = 0.5*1.0 + 0.5*0.4 = 0.7; similarly, W0(2, 1) = 0.7. For (c1, c3): variable set: V1 = x, y, V3 = x; w struct (1, 3) = J(V1, V3) = |x| / |x, y| = 1 / 2 = 0.5; the coefficient ratio of shared variable x is 1 / 1 = 1, and the difference is 0; w num(1,3) is close to 1.0; initial strength W0(1,3) = 0.5*0.5 + 0.5*1.0 = 0.75; similarly, W0(3,1) = 0.75. For (c2,c3): variable set: V2 = x, y, V3 = x; w struct (2,3) = J(V2,V3) = 1 / 2 = 0.5; coefficient ratio of shared variable x is 1 / 2 = 0.5, difference is 1; w num (2,3) is assumed to be 0.6; initial strength W0(2,3) = 0.5*0.5 + 0.5*0.6 = 0.55; similarly, W0(3,2) = 0.55. Initial symmetric dependence matrix W0 is: {[0.0, 0.7, 0.75]; [0.7, 0.0, 0.55]; [0.75, 0.55, 0.0]}. Perform one round of iteration on W0, let learning rate η = 0.1. W1 = W0 + 0.1 · (W0 · W0); where the calculation of W0 · W0 (only (1,1) and (1,2) elements are shown): (W0 · W0) 11 = W0(1,2)*W0(2,1) + W0(1,3)*W0(3,1) = 0.7*0.7 + 0.75*0.75 = 1.0525; (W0 · W0) 12 = W0(1,3)*W0(3,2) = 0.75*0.55 = 0.4125;... (calculate the entire matrix product)...; assume that the calculated W1 is the final converged matrix W stable . Let weights α = 0.7, β = 0.3. Calculate Score = 0.7 · H rd - 0.3 · C st for each constraint; calculate structure criticality C st : C st is the row sum of W stable . Here, approximate with the row sum of W0: C st (c1) = 0.7 + 0.75 = 1.45; C st (c2) = 0.7 + 0.55 = 1.25; C st (c3) = 0.75 + 0.55 = 1.30. Calculate information redundancy H rd : H rd is mainly determined by Shannon entropy. c1: coefficient [1,1]. After normalization, [0.5, 0.5]. H shannon (c1) = -(0.5log20.5 + 0.5log20.5) = 1.0. c2: coefficient [2,3]. After normalization, [0.4, 0.6]. H shannon(c2) = -(0.4log20.4 + 0.6log20.6) ~ 0.97. c3: Coefficients [1]. Normalized [1]. H shannon (c3) = -(1log21) = 0. For simplicity, ignore log(n v ) etc. terms. Calculate final scores: Score(c1) = 0.7 * 1.0 - 0.3 * 1.45 = 0.7 -0.435 = 0.265; Score(c2) = 0.7 * 0.97 - 0.3 * 1.25 = 0.679 - 0.375 = 0.304; Score(c3) = 0.7 * 0 - 0.3 * 1.30 = -0.39. Compare scores of three constraints, c2 has the highest score (0.304), c1 second (0.265), and c3 the lowest (-0.39). Thus, the system will choose constraint c2 (2*x + 3*y <= 240) as the optimal target constraint to be covered, for generating the reverse problem to perform logical consistency deduction.
[0100] According to another aspect of the present application, constructing the structured problem representation can further include reading an operational optimization problem text file (containing problem description, constraint conditions, objective function natural language expressions), and loading a historical problem-modeling correspondence database (containing verified problem text and corresponding mathematical model mapping relationship), extracting the text word sequence, syntax structure and numerical information, and generating a structured text representation of the problem. Performing semantic parsing on the structured text representation of the problem, identifying constraint type marker words, extracting numerical coefficients, variable names and operation relationships, determining the language association between constraints through dependency syntax analysis, and outputting the semantic feature matrix of the constraint text and the initial constraint list of the problem. Based on the initial constraint list of the problem, calculating the variable overlap degree, coefficient correlation and logical deduction relationship between each pair of constraints, and using a constraint propagation operator (defined as CPO: (c i , c j ) → w ij , where w ij represents the influence strength of constraint c i on c j ) to iteratively propagate constraint influence, forming a constraint dependency weight matrix of the problem. At the key nodes (constraints with dependency degree greater than threshold θ) of the constraint dependency weight matrix of the problem, extracting the original text segment, abstract variable mapping and dimension information of the constraint, constructing a triple anchor point, generating a semantic anchor point set of the constraint and an enhanced constraint dependency graph of the problem, and forming a structured problem representation.
[0101] In a preferred embodiment, the system maintains and utilizes a historical problem-modeling contrast database. This database stores a large number of validated pairs of problem text-mathematical model data. The uses of this database include: when the system identifies constraints and variables from the text, it can retrieve similar problem descriptions from the database to draw on their successful parsing methods to improve the accuracy of parsing; the historical validation data required to learn the fusion weights, as well as the cross-validation data sets required to optimize the hyperparameters, are all derived from this database; if some steps of modeling (such as the initial generation of text to model) use large language models, this database can provide high-quality few-shot examples to guide the model to generate more standardized outputs.
[0102] The preferred embodiments of the present application are described in detail above, but the present application is not limited to the specific details of the above-described embodiments. Within the technical concept of the present application, various equivalent transformations of the technical solutions of the present application can be made, and these equivalent transformations all belong to the protection scope of the present application.
Claims
1. An enhanced method for operations research optimization modeling, characterized in that, include: Based on the text file of the operations research optimization problem, a structured problem representation containing the dependencies between constraints and the original semantic information is constructed; Based on the structured problem representation, by constructing and solving positive and negative problem pairs, performing logical consistency deduction, and generating positive modeling results and negative verification sets; Multi-dimensional verification of positive modeling results is performed to identify potential modeling defects, and a structured counterexample test set is generated for potential modeling defects. By combining the test performance of the reverse validation set and the structured counterexample test set, the credibility of the positive modeling results is evaluated, and the final optimized model and credibility evaluation report are generated. Identifying potential modeling defects includes: Extract the enhanced constraint dependency graph and the initial dimensional information of each variable from the structured problem representation; Based on the topology of the enhanced constraint dependency graph and according to the preset dimensional operation rules, a dimensional flow network is constructed, in which nodes store the dimensional state of variables and edges represent the propagation and transformation of dimensions between constraints. By using dimensional flow networks, we can check whether the dimensions on both sides of each equation in the forward modeling results are consistent, and locate potential modeling defects caused by dimensional mismatch.
2. The method according to claim 1, characterized in that, The process of constructing a dimensional flow network further includes: The algorithm is run on the enhanced constraint dependency graph to detect strongly connected components and identify dimensional circular dependency conflicts between constraints. In the process of verifying dimensional consistency using dimensional flow networks, when a dimensional mismatch is detected, a conflict resolution strategy is initiated. The dimensional propagation path is traced back to locate the source of the conflict, and an implicit conversion coefficient is introduced to bridge the dimensional differences.
3. The method according to claim 1, characterized in that, Generate a structured set of counterexample test cases, including: The potential modeling defects identified by multi-dimensional verification were analyzed, and the characteristic patterns of weak links in verification were summarized. For each feature pattern, a minimal counterexample instance that can trigger the corresponding defect is constructed by incrementally modifying the elements of the operations research optimization problem text file; wherein, the minimality of the counterexample instance is measured by its edit distance from the operations research optimization problem text file; All verified and valid minimal counterexamples are compiled to form a structured counterexample test set.
4. The method according to claim 1, characterized in that, Constructing a structured problem representation includes: Based on the text file of the operations research optimization problem, an enhanced constraint dependency graph is constructed, and semantic anchors are implanted at its key constraint nodes to form a structured problem representation. Each semantic anchor is a data triple that encapsulates the original text fragment related to the corresponding key constraint node, the abstract variable mapping relationship, and the physical dimension information inferred from the context.
5. The method according to claim 4, characterized in that, Construct an enhanced constraint dependency graph, including calculating the dependency strength value for each pair of constraint nodes in the graph; The calculation of the intensity value considers at least the following three dimensions: Structural influence degree, which characterizes the degree of overlap between variables; The numerical influence of the correlation between corresponding coefficients of shared variables; And the logical influence of characterizing the path length of symbolic derivation between constraints.
6. The method according to claim 4, characterized in that, Before constructing the forward and reverse problem pairs, it is also necessary to determine the constraints of the target to be occluded, specifically: For each candidate constraint, a coverability score is calculated, aiming to balance the two properties of the constraint: The information redundancy of a constraint is determined by the number of variables within the constraint and the Shannon entropy of the coefficient distribution. And the structural criticality of the constraint in the augmented constraint dependency graph, characterized by the out-degree of the constraint's dependency; Choose the constraint with the highest occlusion score as the constraint for the target to be occluded.
7. The method according to claim 1, characterized in that, Generate a reverse validation set, including: The inverse problem, namely the task of recovering the hidden constraints, is formalized as a constraint satisfaction problem with the coefficients and signs of the hidden constraints as unknown variables. For constraint satisfaction problems, a three-stage hybrid solution strategy is applied: The first stage involves using symbolic reasoning to determine the logical operators of the constraints; In the second stage, interval arithmetic propagation is implemented to narrow the search range of unknown coefficients; The third stage involves performing numerical optimization within the shrunken range to find accurate coefficient values. The restored constraints are used to form a reverse validation set.
8. The method according to claim 3, characterized in that, Constructing the minimum counterexample instance is achieved by executing an incremental search algorithm, specifically: A breadth-first strategy is adopted, starting with the operational optimization of the problem text file, and exploring the problem variants with increasing edit distance layer by layer: examining the problem variants generated by all single modification operations; if the corresponding defect is not triggered, the problem variants generated by more modification operations are further examined. The first variant of the problem that successfully triggers the corresponding defect is identified as the smallest counterexample instance.
9. The method according to claim 5, characterized in that, The calculation process for the dependency strength value further includes: After obtaining the influence in three dimensions, the directional propagation model is applied to calculate the initial dependency strength. Perform iterative updates on the initial dependency strength until convergence, and obtain the final dependency strength value; Each iteration aims to add the indirect effects transmitted through intermediate nodes to the direct dependency strength of the node pairs.
Citation Information
Patent Citations
Logic question and answer data generation method based on operation planning optimization method and large language model
CN118708681A
Large model enhanced code security detection method
CN120372627A
