A Method and System for Enhancing the Inference Ability of Large Models Based on Semantic Execution

By converting the problem descriptions entered by the user into computable content, and using large language models and computational containers to decompose and verify the problem steps, the problem of language models lacking executable verification in the semantic inference stage is solved, improving the efficiency and accuracy of problem solving.

CN119204226BActive Publication Date: 2025-07-01SOUTH CHINA NORMAL UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411642570.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-18
Publication Date
2025-07-01
Estimated Expiration
2044-11-18

AI Technical Summary

Technical Problem

In the prior art language models, when using prompt words to reason for problem reasoning, they stay in the semantic reasoning stage, lack the process of converting semantics into executable files and verifying the inference results through facts, resulting in the inaccurate results of semantic reasoning.

Method used

By obtaining the problem description information of the target problem, obtaining the calculation guide part of the information, and inputting it into a large language model, generating the initial prompt word, decomposing the target problem into a sub-problem, building a calculation container, executing each problem step, verifying and integrating the correct execution steps, and generating an inference process.

Benefits of technology

Improve the efficiency and accuracy of problem solving, convert the user-entered problem description into computable content, break it down into multiple steps to solve, and verify the feasibility of each solution through middleware, and calculate the correct execution steps for problem solving using semantic models and calculation containers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119204226B_ABST
    Figure CN119204226B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and system for enhancing the inference ability of large models based on semantic execution. The method includes: obtaining problem description information and adding computable guiding partial information, and then inputting it into a large language model to output a prompt word; the large language model analyzes according to the prompt word and outputs problem-solving steps; transmitting the problem-solving steps to a computing container to output correct execution steps; integrating all correct execution steps to generate an inference result. By converting the problem description input by the user into computable content, the present invention improves the efficiency of problem-solving, decomposes the computable content into multiple steps for solution, and verifies the feasibility of each solution method through middleware, and uses a semantic model and a computing container to calculate the correct execution steps for problem-solving, thereby improving the accuracy of problem-solving.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of problem reasoning, and in particular to a method, system, interactive computing middleware and computer-readable storage medium for enhancing the reasoning ability of large models based on semantic execution. Background Art

[0002] Language models are good at identifying general patterns and relationships in data and can quickly predict potentially useful structures.

[0003] However, the output results of language models lack a strictly described reasoning process or interpretability, resulting in a lack of credibility in dealing with related special problems. On the other hand, symbolic reasoning engines draw conclusions based on formal logic and use explicit rules, and compilation executors describe problems based on code and use calculations to obtain credible results. Both of these results are rational and interpretable, but neither can directly handle problems described in natural language and cannot autonomously handle complex problems.

[0004] Moreover, when current language models use prompt words for problem reasoning, they stay in the semantic reasoning stage and lack the process of converting semantics into executable files and verifying the reasoning results through factual execution, resulting in inaccurate and ambiguous semantic reasoning results.

[0005] Therefore, the prior art still needs to be improved and developed. Summary of the Invention

[0006] The main purpose of the present invention is to provide a method, system, interactive computing middleware and computer-readable storage medium for enhancing the reasoning ability of large models based on semantic execution, aiming to solve the problem that when language models in the prior art use prompt words for problem reasoning, they stay in the semantic reasoning stage and lack the process of converting semantics into executable files and verifying the reasoning results through factual execution, resulting in inaccurate semantic reasoning results.

[0007] To achieve the above object, the present invention provides a method for enhancing the reasoning ability of large models based on semantic execution, and the method for enhancing the reasoning ability of large models based on semantic execution includes the following steps:

[0008] Obtain the problem description information of the target problem, obtain the computable guiding part information according to the problem description information, and input the computable guiding part information into a large language model;

[0009] Obtain the initial prompt word of the target problem, and input the initial prompt word into the large language model, and output a plurality of problem steps, where the problem steps are generated by the large language model decomposing the target problem according to the computable guiding part information and the initial prompt word, and represent the sub-problems generated after the large language model decomposes the target problem;

[0010] Construct an initial computing container, set up a computing environment in the initial computing container to obtain a computing container, input multiple problem steps into the computing container in sequence, and obtain multiple correctly executed steps output by the computing container, where the correctly executed steps represent the solutions of the computing container to the sub-problems;

[0011] Integrate all the correctly executed steps to generate an inference process, where the inference process represents the process of solving the target problem.

[0012] Optionally, for the method for enhancing the inference ability of a large model based on semantic execution, where obtaining the problem description information of the target problem, obtaining computable guiding part information according to the problem description information, and inputting the computable guiding part information into a large language model specifically includes:

[0013] Obtain the problem description information of the target problem input by the user, and use the graph retrieval enhancement algorithm to extract multiple structured information in the corresponding computable database and subject database according to the problem description information;

[0014] Construct computable guiding part information according to all the structured information, where the computable guiding part information represents a reference case for the large language module to process the target problem, and input the computable guiding part information into the large language model.

[0015] Optionally, for the method for enhancing the inference ability of a large model based on semantic execution, where obtaining the initial prompt word of the target problem and inputting the initial prompt word into the large language model to output multiple problem steps specifically includes:

[0016] Input the problem description information into the large language model to obtain an initial prompt word;

[0017] The large language model generates a formal expression and a numerical expression according to the computable guiding part information in the target problem;

[0018] The large language model updates the initial prompt word according to the computable guiding part information, the formal expression and the numerical expression to generate a prompt word;

[0019] Analyze the prompt word in the large language model to obtain a problem-solving idea, decompose the problem-solving idea to obtain multiple language description information and multiple symbolic expressions, where the language description information represents the intermediate process described in natural language;

[0020] Generate corresponding execution code in the large language model according to multiple pieces of the language description information and multiple symbol expressions, and construct problem steps based on each piece of the execution code, language description information, and symbol expression, and output all the problem steps.

[0021] Optionally, in the method for enhancing the inference ability of the large model based on semantic execution, wherein generating corresponding execution code in the large language model according to multiple pieces of the language description information and multiple symbol expressions, and constructing problem steps based on each piece of the execution code, language description information, and symbol expression, and outputting all the problem steps, further includes:

[0022] Input each piece of the language description information, symbol expression, and corresponding execution code into the constructed large language iterative model respectively, output corresponding first solution evaluation information, and receive corresponding second solution evaluation information input by the user;

[0023] Wherein, the second solution evaluation information is generated according to each symbol expression;

[0024] If there is first solution evaluation information indicating that the current step is incorrect, input the corresponding first solution evaluation information into the large language iterative model, and output corresponding first modification opinions;

[0025] If there is second solution evaluation information indicating that the current step is incorrect, obtain corresponding second modification opinions input by the user;

[0026] Input the first modification opinions or the second modification opinions into the large language model, and output updated problem steps;

[0027] If there are second modification opinions for the current problem step, only input the second modification opinions into the large language model.

[0028] Optionally, in the method for enhancing the inference ability of the large model based on semantic execution, wherein constructing an initial computing container, and setting up a computing environment in the initial computing container to obtain a computing container, inputting multiple problem steps into the computing container in sequence, and obtaining multiple correctly executed steps output by the computing container, specifically includes:

[0029] Construct an initial computing container, and obtain the actual execution requirements according to each execution code;

[0030] Construct a computing environment file according to each actual execution requirement, and import the computing environment file into the initial computing container to obtain the computing container;

[0031] Transfer multiple of the above problem steps to the computing container, execute each piece of the execution code, and output the execution results of the corresponding problem steps;

[0032] Input each of the execution results into the large language model for analysis and output an evaluation result;

[0033] If there is a correct evaluation result, determine the corresponding execution result as a correctly executed step.

[0034] Optionally, in the method for enhancing the inference ability of the large model based on semantic execution, where inputting each of the execution results into the large language model for analysis and outputting an evaluation result is followed by:

[0035] If there is an incorrect evaluation result, obtain feedback information generated by the large language model, where the feedback information is generated by the large language model based on the corresponding execution result;

[0036] Input the corresponding feedback information into the large language model, update the symbolic expressions and execution codes corresponding to the incorrect execution results, and output the updated problem steps until the execution result output after transferring the newly output problem steps to the computing container is a correctly executed step.

[0037] Optionally, in the method for enhancing the inference ability of the large model based on semantic execution, the inference process includes: a semantic description process and a final solution process;

[0038] Integrating all the correctly executed steps to generate an inference process specifically includes:

[0039] Integrate all the correctly executed steps and the symbolic expressions corresponding to each correctly executed step;

[0040] Generate the semantic description process based on all the symbolic expressions and generate the final solution process based on all the target correctly executed steps;

[0041] Among them, the semantic description process represents a literal inference process for solving the target problem, and the final solution process represents a digital inference result for solving the target problem.

[0042] In addition, to achieve the above object, the present invention also provides a system for enhancing the inference ability of a large model based on semantic execution, where the system for enhancing the inference ability of a large model based on semantic execution includes:

[0043] A formal rewriting module for obtaining the problem description information of the target problem, obtaining the computable guiding part information according to the problem description information, and inputting the computable guiding part information into the large language model;

[0044] A problem decomposition module, configured to obtain an initial prompt word of the target problem, input the initial prompt word into the large language model, and output multiple problem steps, where the problem steps are generated by the large language model according to the computable guiding partial information and the initial prompt word to decompose the target problem, and represent sub-problems generated after the large language model decomposes the target problem;

[0045] A problem solving module, configured to construct an initial computing container, build a computing environment in the initial computing container to obtain a computing container, sequentially input multiple problem steps into the computing container, and obtain multiple correct execution steps output by the computing container, where the correct execution steps represent solutions for the computing container to solve the sub-problems;

[0046] An output summarization module, configured to integrate all the correct execution steps to generate an inference process, where the inference process represents the process of solving the target problem.

[0047] In addition, to achieve the above object, the present invention further provides an interactive computing middleware, where the interactive computing middleware includes: a memory, a processor, and a large model inference ability enhancement program based on semantic execution stored on the memory and executable on the processor. When the large model inference ability enhancement program based on semantic execution is executed by the processor, the steps of the above-mentioned method for enhancing the large model inference ability based on semantic execution are implemented.

[0048] In addition, to achieve the above object, the present invention further provides a computer-readable storage medium, where the computer-readable storage medium stores a large model inference ability enhancement program based on semantic execution. When the large model inference ability enhancement program based on semantic execution is executed by a processor, the steps of the above-mentioned method for enhancing the large model inference ability based on semantic execution are implemented.

[0049] In the present invention, problem description information of a target problem is obtained, computable guiding part information is obtained according to the problem description information, and the computable guiding part information is input into a large language model; an initial prompt word of the target problem is obtained and input into the large language model to output a plurality of problem steps, where the problem steps represent sub-problems generated after the large language model decomposes the target problem; an initial computing container is constructed, and a computing environment is built in the initial computing container to obtain a computing container. The plurality of problem steps are sequentially input into the computing container, and a plurality of correct execution steps output by the computing container are obtained, where the correct execution steps represent solutions to the sub-problems by the computing container; all the correct execution steps are integrated to generate an inference process, where the inference process represents the process of solving the target problem. By converting the problem description input by the user into computable content, the present invention improves the efficiency of problem solving. The computable content is decomposed into multiple steps for solution, and at the same time, the execution code corresponding to each step is generated, and the feasibility of each solution method is verified through a middleware. The semantic model and the computing container are used to calculate the correct execution steps for problem solving, improving the accuracy of problem solving. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 is a flowchart of a preferred embodiment of the method for enhancing the inference ability of a large model based on semantic execution of the present invention;

[0051] Figure 2 is a schematic framework diagram of a preferred embodiment of the method for enhancing the inference ability of a large model based on semantic execution of the present invention;

[0052] Figure 3 is a flowchart of a formal rewriting of a preferred embodiment of the method for enhancing the inference ability of a large model based on semantic execution of the present invention;

[0053] Figure 4 is a flowchart of problem decomposition of a preferred embodiment of the method for enhancing the inference ability of a large model based on semantic execution of the present invention;

[0054] Figure 5 is a flowchart of problem solving of a preferred embodiment of the method for enhancing the inference ability of a large model based on semantic execution of the present invention;

[0055] Figure 6 is a structural diagram of a preferred embodiment of the system for enhancing the inference ability of a large model based on semantic execution of the present invention;

[0056] Figure 7 is a schematic diagram of the operating environment of a preferred embodiment of the interactive computing middleware of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0057] To make the objectives, technical solutions and advantages of the present invention clearer and more definite, the following further describes the present invention in detail with reference to the accompanying drawings and by way of examples. It should be understood that the specific examples described herein are only for explaining the present invention and are not intended to limit the present invention.

[0058] Currently, the mainstream method of using prompts to improve the problem-solving ability of LLM (Large Language Model) only stays in the semantic reasoning stage, lacking the process of converting semantics into executable files and verifying the reasoning results through actual execution, resulting in ambiguity in semantic reasoning.

[0059] The method for enhancing the reasoning ability of a large model based on semantic execution according to a preferred embodiment of the present invention is as Figure 1 shown. The method for enhancing the reasoning ability of a large model based on semantic execution includes the following steps:

[0060] Step S10: Obtain the problem description information of the target problem, obtain the computable guidance part information according to the problem description information, and input the computable guidance part information into the large language model.

[0061] Among them, as Figure 2 shown, the user provides requirement description or problem description information on the system interaction interface, and the system automatically identifies whether the current problem can be solved by using computable tools. If it can be solved by computable tools, based on the computable database and the subject knowledge base, and using the graph retrieval enhancement technology, computable guidance part information is added to the problem for guidance and submitted to the large language model. Subsequently, the large language model formalizes and rewrites the part of the problem that can be represented by calculation to obtain a structured description of the prompt.

[0062] Specifically, obtain the problem description information of the target problem input by the user, extract multiple structured information from the corresponding computable database and subject database according to the problem description information by using the graph retrieval enhancement algorithm; construct the computable guidance part information according to all the structured information, where the computable guidance part information represents a reference case for the large language module to process the target problem, and input the computable guidance part information into the large language model.

[0063] Among them, as Figure 3As shown, after obtaining the problem description information, through graph retrieval enhancement technology, structured information on the solution steps related to the target problem is extracted and added to the prompt as computable guiding partial information and necessary background information. Among them, the structured information is mainly composed of information such as typical cases for solving such problems, common solutions, computational representations of common methods, and usage instructions for computational tools, and its structure is represented as: [$tip][$content][$math][$code], where [$tip] represents the prompt, [$content] represents the computable guiding partial information, [$math] represents the subsequent digital representation, and [$code] represents the execution code.

[0064] Among them, by utilizing the semantic understanding ability and formal language ability of the large language model (i.e., the ability to rewrite natural language into formal language), the natural language in the problem description information is transformed into a formal language representation (such as expressing natural language through symbols), realizing content rewriting with consistent semantics and improving the accuracy of reasoning. At the same time, the logical relationships described in natural language are transformed into structured descriptions in the form of hierarchies, categories, or relationship networks, etc., completing the rewriting of logical semantics (for example, decoupling the relationship between the problem and the numerical value, and generalizing the problem by symbolizing the numerical value), which makes it more convenient for subsequent problem solving and also makes the reasoning process clearer, improving the efficiency of the user's subsequent review.

[0065] Step S20: Obtain the initial prompt for the target problem and input the initial prompt into the large language model to output multiple problem steps. Among them, the problem steps are generated by the large language model decomposing the target problem according to the computable guiding partial information and the initial prompt, representing the sub-problems generated after the large language model decomposes the target problem.

[0066] Before performing the decomposition step of the target problem, it is necessary to first input the problem description information into the large language model for preliminary analysis to obtain the initial prompt, and conduct a preliminary screening of the target problem, so as to improve the efficiency of subsequent decomposition of the target problem. Then, a prompt is jointly generated through the initial prompt and the computable guiding partial information to decompose the target problem.

[0067] Among them, when the large language model obtains a structured problem (i.e., the prompt), it uses its self-evaluation function and external guidance from relevant experts to iteratively evaluate and make targeted modifications to the solution steps of the target problem until the decomposition of the entire target problem passes the double evaluation of the large language model and relevant experts, improving the accuracy of solving the target problem.

[0068] Specifically, input the problem description information into the large language model to obtain an initial prompt; the large language model generates a formal expression and a numerical expression based on the computable guiding part information in the target problem; the large language model updates the initial prompt based on the computable guiding part information, the formal expression, and the numerical expression to generate a prompt; analyze the prompt in the large language model to obtain a problem-solving idea, decompose the problem-solving idea to obtain multiple language description information and multiple symbolic expressions, where the language description information represents an intermediate process described in natural language; generate corresponding execution code based on the multiple language description information and multiple symbolic expressions in the large language model, and construct problem steps according to each execution code, language description information, and symbolic expression, and output all the problem steps; where the problem steps represent sub-problems generated after the large language model decomposes the target problem.

[0069] Among them, use the large language model to design an overall problem-solving idea for the rewritten target problem, and then decompose the problem-solving idea into multiple small steps, that is, decompose the target problem into multiple sub-problems, and explain the solution process of each sub-problem with symbols and executable code to represent the problem-solving; by decomposing the target problem, the complexity of solving the target problem is reduced, the accuracy of solving each sub-problem is improved, and thus the accuracy of solving the target problem is improved.

[0070] Further, input each of the language description information, symbolic expression, and corresponding execution code into the constructed large language iteration model, output corresponding first solution evaluation information, and receive the corresponding second solution evaluation information input by the user; where the second solution evaluation information is generated based on each symbolic expression; if there is first solution evaluation information indicating an error in the current step, input the corresponding first solution evaluation information into the large language iteration model to output the corresponding first modification opinion, if there is second solution evaluation information indicating an error in the current step, obtain the corresponding second modification opinion input by the user; input the first modification opinion or the second modification opinion into the large language model to output updated problem steps; if there is a second modification opinion for the current problem step, only input the second modification opinion into the large language model.

[0071] Among them, such as Figure 4As shown in the figure, each sub - problem and its symbolic expression are sent to the cloud display screen for relevant experts to check. At the same time, the large - language model evaluates the symbolic expression and execution code of each sub - problem. For example, the large - language model iteratively detects formal errors such as symbolic errors and code errors. Human experts evaluate whether the reasoning process in the evaluation step is reasonable. If it is not reasonable, human experts will give modification suggestions, and guide the large - language model to modify the reasoning process (i.e., the decomposition of the target problem) through the modification suggestions. By the evaluation of both parties on the overall solution, solution idea, symbols, and execution code of the target problem, it is judged whether the decomposition of the target problem is appropriate. Through double - evaluation, it can effectively avoid the occurrence of inappropriate decomposition of the target problem, provide the most appropriate decomposition plan, and effectively improve the efficiency of solving the target problem.

[0072] Step S30: Construct an initial computing container, and build a computing environment in the initial computing container to obtain a computing container. Input multiple problem steps into the computing container in sequence, and obtain multiple correctly executed steps output by the computing container, where the correctly executed steps represent the solutions of the computing container to the sub - problems.

[0073] Among them, call the computable module according to the decomposed content to build the corresponding computing environment, construct a computing container, use the computing container to solve each sub - problem, and submit the solved results to the large - language model for interaction, iteratively adjusting the executed content until each sub - problem can obtain the correct solution steps to ensure the reasoning accuracy of the target problem.

[0074] Specifically, construct an initial computing container, and obtain the actual execution requirements according to each execution code; construct a computing environment file according to each actual execution requirement, and import the computing environment file into the initial computing container to obtain the computing container; transfer multiple problem steps to the computing container, execute each execution code, and output the execution results of the corresponding problem steps; input each execution result into the large - language model for analysis and output an evaluation result; if the evaluation result is correct, determine the corresponding execution result as a correctly executed step.

[0075] Among them, as Figure 5 shown, construct a docker (an open - source application container engine) or WASM (WebAssembly, a portable, compact, and fast - loading binary format) container, and load the required computing environment in the container. According to the actual needs of the computable content, the computing environment usually includes common code compilers or professional computing engines, etc.; factually execute the computable content represented by the planned code in the constructed computing environment, and interactively iterate with the large - language model for execution until each step in the plan is correctly executed.

[0076] Further, if there is an error in the evaluation result, obtain the corresponding feedback information generated by the large language model, where the feedback information is generated by the large language model according to the corresponding execution result; input the corresponding feedback information into the large language model, update the symbolic expression and execution code corresponding to the incorrect execution result, and output the updated problem steps until the newly output problem steps are transmitted to the computing container and the output execution result is the correct execution step.

[0077] Among them, after the computing container calculates the execution result, it is handed over to the large language model for detection and evaluation. If the evaluation result indicates that the execution result is incorrect, the large language model will adjust the sub-problem corresponding to this execution result, that is, modify the computable guidance part information related to this sub-problem in the target problem, and in the process of adjustment, the method of multiple sampling and selection of the best will be adopted, which can not only improve the accuracy of solving the target problem, but also improve the efficiency of the reasoning process.

[0078] Among them, sampling and selection of the best requires positioning the adjusted places, generating multiple candidate codes for the sub-problem, clustering the candidate codes, so as to divide the candidate codes into several function-inequivalent sets, and it is necessary to select the clustering set whose implemented function is closest to the requirement description as the final generated result.

[0079] For example, when an error occurs in the compiler executor during the execution of the code in a certain step, the interactive computing middleware will obtain the current error message and the current execution code and submit them to the large language model. The large language model will evaluate the sub-problem and modify the execution code. The system generates multiple segments of code with the same function according to the feedback information, clusters them first, then selects the code that best conforms to the semantics from them, and hands it over to the interactive computing middleware for execution. If the execution is correct, proceed to the reasoning execution of the next step; if it continues to report an error, repeat the above process of collection, evaluation, modification, and execution until the execution is correct.

[0080] Step S40: Integrate all the correct execution steps to generate an inference process, where the inference process represents the process of solving the target problem.

[0081] Among them, the inference process includes: a semantic description process and a final solution process.

[0082] Specifically, integrate all the correct execution steps and the symbolic expressions corresponding to each correct execution step; generate the semantic description process according to all the symbolic expressions, and generate the final solution process according to all the target correct execution steps; where the semantic description process represents the literal inference process of solving the target problem, and the final solution process represents the digital inference result of solving the target problem.

[0083] After ensuring the correctness of the solutions to each sub - problem, integrate the correct execution steps of each sub - problem to obtain two reasoning processes, namely the literal reasoning process for solving the target problem and the digital reasoning result for solving the target problem, which helps users more accurately grasp the reasoning process of the target problem and improves the user experience.

[0084] For example, the user submits problem description information: "Please factorize the following expression and give the detailed solution process steps"; the system will retrieve the structured information related to the problem according to the computable database and using the graph retrieval enhancement technology, including meta - problems, basic backgrounds or solution strategies, etc. At the same time, use the large - language model to rewrite the part of the problem that can be represented by calculation into a mathematical formal language to obtain the structured prompt words:

[0085] Meta - problems include: factorization - solving problems (mathematical concepts and basic knowledge, polynomial structure, definition of factors, prime factors and composite numbers); basic backgrounds include: factorization steps, final result (give the fully factorized expression) and clear format (use mathematical symbols and appropriate format to make the steps easy to understand); solution strategies include: "('monomial'; 'expand', 'extract the greatest common factor')", "('four or more terms', 'try to group first and then combine like - terms for factorization')", "('two or three terms', 'identify patterns: difference of squares, perfect - square trinomial, sum and difference of cubes, general quadratic polynomials, etc.)" and "('long division or synthetic division')", and these words represent the extracted prompt words.

[0086] After determining the structured information of the target problem, the digital representation $[math_expression]$ of the target problem can be obtained:

[0087] math_expression = ;

[0088] The process of obtaining the prompt words for the problem description after adding structured information and formal - language rewriting to the problem submitted by the user is as follows:

[0089] Step 1: Please factorize the following expression $[math_expression]$ and give the detailed solution process steps.

[0090] math_expression = ;

[0091] Step 2: This problem belongs to the large - category problem of factorization in mathematical solutions. In the process of trying to factorize the integral expression, please use the following step - by - step strategies:

[0093] ('Monomial', 'Expansion', 'Factoring out the greatest common factor'), ('Four or more terms', 'Try factoring by grouping and then combining like terms'), ('Two or three terms', 'Identify patterns: difference of squares, perfect square trinomial, sum and difference of cubes, general quadratic polynomials, etc.'), ('Long division or synthetic division')

[0095] Common methods include:

[0097] a. Mathematica (a scientific computing software)

[0098] Method: Use the Factor function to factor the expression.

[0099] Example code: Factor[a*b*(x^2 - y^2)+x*y*(a^2 - b^2)]

[0100] b. Maple (a mathematics software)

[0101] Method: Use the factor function to factor.

[0102] Example code: factor(a*b*(x^2 - y^2)+x*y*(a^2 - b^2));

[0103] c. SageMath (a mathematics software system)

[0104] Method: Define variables and use the factor function to factor.

[0105] Example code:

[0106] var('abxy');

[0107] expr = a*b*(x^2 - y^2)+x*y*(a^2 - b^2);

[0108] factored_expr = expr.factor();

[0109] print(factored_expr);

[0110] d. Maxima.

[0111] Method: Use the factor function to factor.

[0112] Example code:

[0113] ​​​factor(a*b*(x^2 - y^2)+x*y*(a^2 - b^2));

[0115] Please factorize the integral expression in Step 1 using the above strategy.

[0116] It is required that the answer given includes:

[0117] Steps of factorization: Expand the factorization process of each step, and the selected strategy and the applied mathematical formula need to be explained.

[0118] Final result: Give the fully factorized expression.

[0119] Clear format: Use mathematical symbols and appropriate formats to make the steps easy to understand.

[0120] Furthermore, the large language model gives a global description of the solution to the target problem and a detailed step plan according to the above prompt words. At the same time, the evaluation information or modification opinions of the large language model and relevant experts are introduced to realize the dual - subject evaluation of "human in the loop", and finally a feasible solution to the target problem is obtained:

[0121] (1) Overall plan: Factorize the expression ; The goal is to show the factorization process in detail through mathematical derivation and code implementation; Expand and recombine using formulas; And try to recombine terms; Finally, verify the target factorization.

[0122] Among them, the solution process represented by Python code generally includes: variable definition, expression definition, expression expansion, factorization operation (applying factorization methods, using the factor function) and result analysis, etc. Finally, the result is verified by SageMath.

[0123] (2) Decompose the target problem:

[0124] Step 1: Identify the difference of squares and expand using the difference - of - squares formula:

[0125] Identify that and in the expression are differences of squares and can be written as: = (Difference - of - squares formula) = .

[0126] Code representation:

[0127] Use the SymPy library for symbolic operations from sympy import symbols, factor.​

[0128] Define symbolic variables

[0129] a, b, x, y = symbols(' bxy'')。

[0130] Define expressions

[0131] expr1 = x ** 2 - y ** 2;

[0132] expr2 = a ** 2 - b ** 2;

[0133] Factorize

[0134] factored_expr1 = factor(expr1);

[0135] factored_expr2 = factor(expr2)。

[0136] Output result:

[0137] print('Factoredexpr1:', factored_expr1);

[0138] print('Factoredexpr2:', factored_expr2)。

[0139] Execution result:

[0140] Factoredexpr1: (x - y)*(x + y)Factoredexpr2: (a - b)*(a + b)。

[0141] Step 2: Write the original expression in the form of a product

[0142] Substitute the difference of squares formula into the original expression:

[0143] = + ;

[0144] Code representation:

[0145] Original expression

[0146] expr = a * b * (x + y)*(x - y)+x * y * (a + b)*(a - b);

[0147] print('Expression after applying difference of squares:', expr)。

[0148] Execution result:

[0149] Expression after applying difference of squares: a*b*(x - y)*(x + y)+x*y*(a - b)*(a + b).

[0150] Step 3: Expand each term for grouping

[0151] Expand each term for convenient grouping.

[0152] Code representation:

[0153] from sympy import expand

[0154] Expand the first term

[0155] first_term = expand(a*b*(x - y)*(x + y)) print('First term expanded:', first_term).

[0156] Expand the second term

[0157] second_term = expand(x*y*(a - b)*(a + b)) print('Second term expanded:', second_term).

[0158] Execution result:

[0159] First term expanded: a*b*x^2 - a*b*y^2;

[0160] Second term expanded: a^2*x*y - b^2*x*y.

[0161] Step 4: Combine the expanded terms into one expression

[0162] Code representation:

[0163] Combine the expanded terms

[0164] expanded_expr = first_term + second_term print('Expanded expression:', expanded_expr);

[0165] Execution result:

[0166] Expanded expression: a*b*x^2 - a*b*y^2 + a^2*x*y - b^2*x*y。

[0167] Step 5: Rearrange and group

[0168] Rearrange the expression to facilitate factoring out the common factors:

[0169] The first group: , the second group: , code representation:

[0170] Grouping

[0171] group1 = a*b*x^2 + a^2*x*y;

[0172] group2 = -a*b*y^2 - b^2*x*y;

[0173] print('Group1:', group1) print('Group2:', group2).

[0174] Execution result:

[0175] Group1: a*b*x^2 + a^2*x*y;

[0176] Group2: -a*b*y^2 - b^2*x*y.

[0177] Step 6: Factor out the common factors from each group

[0178] Factor out from the first group as the common factor:

[0179] = ;

[0180] Code representation:

[0181] Factor out the common factor of the first group

[0182] group1_factored = factor(group1);

[0183] print('Group1factored:', group1_factored);

[0184] Execution result:

[0185] Group1factored: a*x*(a*y + b*x);

[0186] Factor out from the second group as the common factor:

[0187] ;

[0188] Code representation:

[0189] Extract the common factor of the second group

[0190] group2_factored = factor(group2);

[0191] print('Group2 factored:', group2_factored).

[0192] Execution result:

[0193] Group2 factored: -b*y*(a*y + b*x).

[0194] Step 7: Extract the overall common factor

[0195] Now, the expression becomes:

[0196] - = ;

[0197] Code representation:

[0198] Extract the common common factor

[0199] common_factor = a*y + b*x;

[0200] factored_expr = common_factor*(a*x - b*y);

[0201] print('Factored expression:', factored_expr).

[0202] Execution result:

[0203] Factored expression: (a*y + b*x)*(a*x - b*y).

[0204] Step 8: Verify the correctness of the factorization through sagemath

[0205] Code representation:

[0206] Define variables

[0207] var('a b x y');

[0208] Original expression

[0209] expr_original = a * b * (x ** 2 - y ** 2) + x * y * (a ** 2 - b ** 2);

[0210] The factored expression

[0211] expr_factored = (a * x - b * y) * (a * y + b * x).

[0212] Method 1: Simplify the difference between the two and check if it is zero

[0213] difference = expr_original - expr_factored;

[0214] simplified_difference = simplify(difference);

[0215] print("The simplified difference:", simplified_difference).

[0216] Method 2: Check if the two are equal

[0217] are_equal = expr_original == expr_factored;

[0218] print("Is the original expression equal to the factored expression?", are_equal).

[0219] Method 3: Use the factor function to factor the original expression

[0220] factored_expr = factor(expr_original);

[0221] print("The expression factored using SageMath:", factored_expr); ...

[0222] Output result.

[0223] If running the above code to verify that "is_equivalent" returns "True", it means a correct factorization has been found.

[0224] After completing the decomposition of the target problem, construct a computing container, set up the computing environment, use the computing container to execute the code for each sub - problem, solve each sub - problem, and feedback the corresponding results:

[0225] Python code:

[0226] from sympy import symbols, factor, expand;

[0227] Define symbolic variables

[0228] a, b, x, y = symbols('a b x y');

[0229] Original expression

[0230] expr = a * b * (x ** 2 - y ** 2) + x * y * (a ** 2 - b ** 2).

[0231] Step 1: Identify the difference of squares and factorize

[0232] expr1 = x ** 2 - y ** 2;

[0233] expr2 = a ** 2 - b ** 2;

[0234] factored_expr1 = factor(expr1);

[0235] factored_expr2 = factor(expr2);

[0236] print('Factored expr1:', factored_expr1);

[0237] print('Factored expr2:', factored_expr2).

[0238] Step 2: Apply the difference of squares formula

[0239] expr_after_diff_of_squares = a * b * factored_expr1 + x * y * factored_expr2;

[0240] print('Expression after applying difference of squares:', expr_after_diff_of_squares).

[0241] Step 3: Expand the terms

[0242] first_term = expand(a * b * (x - y) * (x + y));

[0243] second_term = expand(x * y * (a - b) * (a + b));

[0244] print('First term expanded:', first_term);

[0245] print('Second term expanded:', second_term).

[0246] Step 4: Combine the expanded terms

[0247] expanded_expr = first_term + second_term;

[0248] print('Expanded expression:', expanded_expr).

[0249] Step 5: Grouping

[0250] group1 = a * b * x^2 + a^2 * x * y;

[0251] group2 = -a * b * y^2 - b^2 * x * y;

[0252] print('Group1:', group1);

[0253] print('Group2:', group2).

[0254] Step 6: Factor out the common factors in each group

[0255] group1_factored = factor(group1);

[0256] group2_factored = factor(group2);

[0257] print('Group1 factored:', group1_factored);

[0258] print('Group2 factored:', group2_factored).

[0259] Step 7: Factor out the overall common factor

[0260] common_factor = a * y + b * x;

[0261] factored_expr = common_factor * (a * x - b * y);

[0262] print('Factored expression:', factored_expr)。

[0263] Step 8: Verify the result

[0264] original_expr = expand(expr);

[0265] factored_expr_expanded = expand(factored_expr);

[0266] print('Original expression expanded:', original_expr);

[0267] print('Factored expression expanded:', factored_expr_expanded);

[0268] print('Expressions are equal:', original_expr == factored_expr_expanded)。

[0269] The sagemath execution code is as follows:

[0270] Define variables

[0271] var('a b x y');

[0272] Original expression

[0273] expr_original = a * b * (x^2 - y^2) + x * y * (a^2 - b^2);

[0274] Factored expression

[0275] expr_factored = (a * x - b * y) * (a * y + b * x)。

[0276] Method 1: Simplify the difference between the two and see if it is zero

[0277] difference = expr_original - expr_factored;

[0278] simplified_difference = simplify(difference);

[0279] print("Simplified difference:", simplified_difference)。

[0280] Method 2: Check if the two are equal

[0281] are_equal = expr_original == expr_factored;

[0282] print("Is the original expression equal to the factored expression?", are_equal).

[0283] Method 3: Factor the original expression using the factor function

[0284] factored_expr = factor(expr_original);

[0285] print("The expression factored using SageMath:", factored_expr).

[0286] Furthermore, integrate the results of the inference execution steps and integrate them to form the inference results of semantic description and semantic execution feedback:

[0287] The results are as follows:

[0288] Factor the following expression and give the detailed solution process steps: .

[0289] To factor, the following step strategy will be followed:

[0290] For polynomials with four or more terms: Try to group first and then combine like terms for factoring.

[0291] Identify special patterns: Such as the difference of squares formula, perfect square formula, etc., and use these formulas for factoring.

[0292] Extract the common factor: Observe whether there is a common factor that can be extracted in each group to simplify the expression.

[0293] Factoring steps:

[0294] Step 1: Expand using the difference of squares formula

[0295] First, recognize that in the expression and are both differences of squares and can be written as:

[0296] = ;

[0297] = 。

[0298] Step 2: Write the original expression in expanded form

[0299] Substitute the original expression into the expanded difference of squares formula:

[0300] 。

[0301] Step 3: Expand each term

[0302] However, to better group and factor out the common factor, first expand the original expression:

[0303] Expand the first term:

[0304] = - ;

[0305] Expand the second term:

[0306] = - ;

[0307] Thus, the original expression becomes:

[0308] 。

[0309] Step 4: Arrange like terms adjacent to each other

[0310] Rearrange the terms so that terms with similar variables are adjacent:

[0311] + - - 。

[0312] Step 5: Group and factor out the common factor

[0313] First group: Factor out as the common factor:

[0314] + = 。

[0315] However, it is found that the content inside the parentheses after factoring is not easy to continue factoring, so try other grouping methods.

[0316] Regroup:

[0317] Group the first term and the fourth term together, and the second term and the third term together:

[0318] First group:

[0319] = 。

[0320] Extract as the common factor.

[0321] Group 2:

[0322] - = 。

[0323] Extract as the common factor.

[0324] Step 6: Extract the common factor

[0325] Now, the original expression becomes:

[0326] - = ;

[0327] Notice that the common factor is included in both groups.

[0328] Step 7: Extract as the common factor

[0329] After extracting the expression becomes:

[0330] 。

[0331] Step 8: Rearrange the final result

[0332] Therefore, the complete factorization of the original expression is:

[0333] + 。

[0334] Or written as:

[0335] 。

[0336] Summary:

[0337] By identifying the difference of squares formula, expanding and regrouping, and extracting the common factor, the original expression is successfully factorized into the product of two binomials.

[0338] Complete factorization result: 。

[0339] Explain the selected strategy and the applied mathematical formula:

[0340] Difference of squares formula: = , it is recognized that and is in the form of the difference of squares, and use this formula to expand.

[0341] Grouping decomposition method: When the polynomial has four terms, try to group it so that each group can extract a common factor, thereby simplifying the expression.

[0342] Extracting the common factor: By extracting the common factor, the expression is transformed into a product form, which is convenient for further factorization. The present invention improves the efficiency of problem-solving by converting the problem description input by the user into computable content, decomposes the computable content into multiple steps to solve, and simultaneously generates the execution code corresponding to each step, and verifies the feasibility of each solution method through middleware, and uses the semantic model and the computing container to calculate the correct execution steps for problem-solving, thereby improving the accuracy of problem-solving.

[0343] Furthermore, as Figure 6 shown, based on the above method for enhancing the inference ability of the large model based on semantic execution, the present invention also correspondingly provides a system for enhancing the inference ability of the large model based on semantic execution, wherein, the system for enhancing the inference ability of the large model based on semantic execution includes:

[0344] A formal rewriting module 51, configured to obtain the problem description information of the target problem, obtain the computable guidance part information according to the problem description information, and input the computable guidance part information into the large language model;

[0345] A problem decomposition module 52, configured to obtain the initial prompt word of the target problem, input the initial prompt word into the large language model, and output multiple problem steps, wherein the problem steps are generated by the large language model decomposing the target problem according to the computable guidance part information and the initial prompt word, and represent the sub-problems generated after the large language model decomposes the target problem;

[0346] A problem solving module 53, configured to construct an initial computing container, build a computing environment in the initial computing container to obtain a computing container, input multiple problem steps into the computing container in sequence, and obtain multiple correct execution steps output by the computing container, wherein the correct execution steps represent the solutions of the computing container to the sub-problems;

[0347] An output summary module 54, configured to integrate all the correct execution steps to generate an inference process, wherein the inference process represents the process of solving the target problem.

[0348] Furthermore, as Figure 7As shown, based on the above method and system for enhancing the inference ability of large models based on semantic execution, the present invention also correspondingly provides an interactive computing middleware, which includes a processor 10, a memory 20, and a display 30. Figure 7 Only some components of the interactive computing middleware are shown, but it should be understood that it is not required to implement all the shown components, and more or fewer components can be alternatively implemented.

[0349] In some embodiments, the memory 20 may be an internal storage unit of the interactive computing middleware, such as the hard disk or memory of the interactive computing middleware. In some other embodiments, the memory 20 may also be an external storage device of the interactive computing middleware, such as a plug-in hard disk equipped on the interactive computing middleware, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. Further, the memory 20 may also include both the internal storage unit and the external storage device of the interactive computing middleware. The memory 20 is used to store application software installed on the interactive computing middleware and various types of data, such as the program code for installing the interactive computing middleware. The memory 20 may also be used to temporarily store data that has been output or will be output. In one embodiment, a program 40 for enhancing the inference ability of large models based on semantic execution is stored on the memory 20, and this program 40 for enhancing the inference ability of large models based on semantic execution can be executed by the processor 10, thereby implementing the method for enhancing the inference ability of large models based on semantic execution in this application.

[0350] In some embodiments, the processor 10 may be a central processing unit (CPU), a microprocessor, or other data processing chips, and is used to run the program code stored in the memory 20 or process data, such as executing the method for enhancing the inference ability of large models based on semantic execution, etc.

[0351] In some embodiments, the display 30 may be an LED display, a liquid crystal display, a touch liquid crystal display, and an OLED (Organic Light-Emitting Diode) toucher, etc. The display 30 is used to display information in the interactive computing middleware and to display a visual user interface. The components 10 - 30 of the interactive computing middleware communicate with each other through a system bus.

[0352] In one embodiment, when the processor 10 executes the program 40 for enhancing the inference ability of large models based on semantic execution stored in the memory 20, the following steps are implemented:

[0353] Obtain the problem description information of the target problem, obtain the computable guiding part information according to the problem description information, and input the computable guiding part information into the large language model;

[0354] Obtain the initial prompt word of the target problem, and input the initial prompt word into the large language model, and output multiple problem steps, where the problem steps are generated by the large language model decomposing the target problem according to the computable guiding part information and the initial prompt word, and represent the sub-problems generated after the large language model decomposes the target problem;

[0355] Construct an initial computing container, build a computing environment in the initial computing container to obtain a computing container, input multiple problem steps into the computing container in sequence, and obtain multiple correct execution steps output by the computing container, where the correct execution steps represent the solutions of the computing container to the sub-problems;

[0356] Integrate all the correct execution steps to generate an inference process, where the inference process represents the process of solving the target problem.

[0357] Among them, the obtaining the problem description information of the target problem, obtaining the computable guiding part information according to the problem description information, and inputting the computable guiding part information into the large language model specifically includes:

[0358] Obtain the problem description information of the target problem input by the user, and extract multiple structured information in the corresponding computable database and subject database according to the problem description information by using the graph retrieval enhancement algorithm;

[0359] Construct computable guiding part information according to all the structured information, where the computable guiding part information represents a reference case for the large language module to process the target problem, and input the computable guiding part information into the large language model.

[0360] Among them, the obtaining the initial prompt word of the target problem, and inputting the initial prompt word into the large language model, and outputting multiple problem steps specifically includes:

[0361] Input the problem description information into the large language model to obtain the initial prompt word;

[0362] The large language model generates a formal expression and a numerical expression according to the computable guiding part information in the target problem;

[0363] The large language model updates the initial prompt word according to the computable guiding part information, the formal expression and the numerical expression, and generates a prompt word;

[0364] Analyze the prompt in the large language model to obtain a problem-solving idea, decompose the problem-solving idea to obtain multiple pieces of language description information and multiple symbolic expressions, where the language description information represents an intermediate process described in natural language.

[0365] Generate corresponding execution codes in the large language model according to the multiple pieces of language description information and the multiple symbolic expressions, and construct problem steps based on each execution code, language description information, and symbolic expression, and output all the problem steps.

[0366] Among them, after generating corresponding execution codes in the large language model according to the multiple pieces of language description information and the multiple symbolic expressions, and constructing problem steps based on each execution code, language description information, and symbolic expression, and outputting all the problem steps, it further includes:

[0367] Input each piece of language description information, symbolic expression, and the corresponding execution code into the constructed large language iteration model respectively, output corresponding first scheme evaluation information, and receive corresponding second scheme evaluation information input by the user;

[0368] Among them, the second scheme evaluation information is generated according to each symbolic expression;

[0369] If there is first scheme evaluation information indicating that the current step is incorrect, input the corresponding first scheme evaluation information into the large language iteration model and output the corresponding first modification opinion;

[0370] If there is second scheme evaluation information indicating that the current step is incorrect, obtain the corresponding second modification opinion input by the user;

[0371] Input the first modification opinion or the second modification opinion into the large language model and output the updated problem steps;

[0372] If there is a second modification opinion for the current problem step, only input the second modification opinion into the large language model.

[0373] Among them, constructing an initial computing container, setting up a computing environment in the initial computing container to obtain a computing container, inputting multiple problem steps into the computing container in sequence, and obtaining multiple correct execution steps output by the computing container specifically includes:

[0374] Construct an initial computing container and obtain the actual execution requirements according to each execution code;

[0375] Construct a computing environment file according to each actual execution requirement and import the computing environment file into the initial computing container to obtain the computing container;

[0376] Transfer multiple of the problem steps to the computing container, execute each piece of the execution code, and output the execution result of the corresponding problem step;

[0377] Input each of the execution results into the large language model for analysis and output an evaluation result;

[0378] If there is a correct evaluation result, determine the corresponding execution result as a correctly executed step.

[0379] Among them, after inputting each of the execution results into the large language model for analysis and outputting an evaluation result, it further includes:

[0380] If there is an incorrect evaluation result, obtain the feedback information generated by the large language model, where the feedback information is generated by the large language model according to the corresponding execution result;

[0381] Input the corresponding feedback information into the large language model, update the symbolic expression and execution code corresponding to the incorrect execution result, and output the updated problem step until, after transferring the newly output problem step to the computing container, the output execution result is a correctly executed step.

[0382] Among them, the reasoning process includes: a semantic description process and a final solution process;

[0383] Integrating all the correctly executed steps to generate a reasoning process specifically includes:

[0384] Integrate all the correctly executed steps and the symbolic expression corresponding to each correctly executed step;

[0385] Generate the semantic description process according to all the symbolic expressions and generate the final solution process according to all the target correctly executed steps;

[0386] Among them, the semantic description process represents a literal reasoning process for solving the target problem, and the final solution process represents a digital reasoning result for solving the target problem.

[0387] The present invention also provides a computer-readable storage medium, where the computer-readable storage medium stores a large model reasoning ability enhancement program based on semantic execution. When the large model reasoning ability enhancement program based on semantic execution is executed by a processor, it implements the steps of the above-mentioned large model reasoning ability enhancement method based on semantic execution.

[0388] In summary, the present invention provides a method and related devices for enhancing the inference ability of a large model based on semantic execution. The method includes: obtaining the problem description information of a target problem, obtaining computable guidance partial information according to the problem description information, and inputting the computable guidance partial information into a large language model; obtaining the initial prompt word of the target problem, and inputting the initial prompt word into the large language model to output multiple problem steps, where the problem steps are generated by the large language model decomposing the target problem according to the computable guidance partial information and the initial prompt word, and represent the sub-problems generated after the large language model decomposes the target problem; constructing an initial computing container, and setting up a computing environment in the initial computing container to obtain a computing container, inputting multiple problem steps into the computing container in sequence, and obtaining multiple correct execution steps output by the computing container, where the correct execution steps represent the solutions of the computing container to the sub-problems; integrating all the correct execution steps to generate an inference process, where the inference process represents the process of solving the target problem. By converting the problem description input by the user into computable content, the present invention improves the efficiency of problem solving, decomposes the computable content into multiple steps for solution, generates the corresponding execution code for each step at the same time, and verifies the feasibility of each solution method through middleware, and uses the semantic model and the computing container to calculate the correct execution steps for problem solving, improving the accuracy of problem solving.

[0389] It should be noted that in this article, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or interactive computing middleware including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or interactive computing middleware. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article or interactive computing middleware including that element.

[0390] Certainly, those of ordinary skill in the art can understand that all or part of the processes of implementing the above method embodiments can be completed by instructing related hardware (such as a processor, a controller, etc.) through a computer program. The program can be stored in a computer-readable storage medium readable by a computer, and when the program is executed, it can include the processes of the above method embodiments. The computer-readable storage medium can be a memory, a magnetic disk, an optical disk, etc.

[0391] It should be understood that the application of the present invention is not limited to the above examples. For those of ordinary skill in the art, improvements or transformations can be made according to the above description, and all such improvements and transformations should fall within the protection scope of the appended claims of the present invention.

Claims

1. A method for enhancing the reasoning capability of a large model based on semantic execution, characterized in that: The method for enhancing the large model reasoning capability based on semantic execution includes: Obtaining problem description information of a target problem, obtaining computable guidance part information according to the problem description information, and inputting the computable guidance part information into a large language model; Obtaining problem description information of a target problem, obtaining computable guide part information according to the problem description information, and inputting the computable guide part information into a large language model, specifically including: Obtaining problem description information of a target problem input by a user, and extracting a plurality of structured information from a corresponding computable database and a subject database using a graph retrieval enhancement algorithm according to the problem description information; Constructing computable guided part information according to all the structured information, wherein the computable guided part information represents a reference case of the large language module processing the target problem, and inputting the computable guided part information into the large language model; The large language model is used to transform the natural language in the problem description information into a formal language representation, and the large language model is used to transform the logical relationship described in the natural language into a structured description expressed in a hierarchy, category or relationship network, thereby completing the rewriting of logical semantics; Obtaining an initial prompt word of the target question, and inputting the initial prompt word into the large language model, and outputting a plurality of question steps, wherein the question steps are generated by the large language model decomposing the target question according to the computable guide part information and the initial prompt word, and represent sub-questions generated after the large language model decomposes the target question; The step of obtaining an initial prompt word of the target question, inputting the initial prompt word into the large language model, and outputting multiple question steps specifically includes: Inputting the problem description information into the large language model to obtain an initial prompt word; The large language model generates a formal expression and a numerical expression according to the computable guided part information in the target problem; The large language model updates the initial prompt word and generates a prompt word according to the computable guide part information, the formal expression and the numerical expression; Analyzing the prompt words in the large language model to obtain a problem-solving idea, decomposing the problem-solving idea to obtain a plurality of language description information and a plurality of symbolic expressions, wherein the language description information represents an intermediate process described in natural language; Generate corresponding execution codes in the large language model according to the plurality of language description information and the plurality of symbolic expressions, construct problem steps according to each of the execution codes, language description information and symbolic expressions, and output all the problem steps; Construct an initial computing container, and build a computing environment in the initial computing container to obtain a computing container, input multiple problem steps into the computing container in sequence, and obtain multiple correct execution steps output by the computing container, wherein the correct execution steps represent the solution of the computing container to solve the sub-problem; The step of constructing an initial computing container, setting up a computing environment in the initial computing container, obtaining a computing container, sequentially inputting a plurality of the problem steps into the computing container, and obtaining a plurality of correct execution steps output by the computing container specifically includes: Building an initial computing container and obtaining actual execution requirements according to each of the execution codes; Building a computing environment file according to each of the actual execution requirements, and importing the computing environment file into the initial computing container to obtain the computing container; Transmitting the plurality of problem steps to the computing container, executing each of the execution codes, and outputting the execution result of the corresponding problem step; Input each of the execution results into the large language model for analysis, and output an evaluation result; If there is a correct evaluation result, the corresponding execution result is determined as a correct execution step; The computable content represented by the code in the plan is executed in real time in the constructed computing environment, and it is executed interactively and iteratively with the large language model until every step in the plan is executed correctly. All the correctly executed steps are integrated to generate a reasoning process, wherein the reasoning process represents a process of solving the target problem.

2. The method for enhancing the reasoning capability of a large model based on semantic execution according to claim 1 is characterized in that: The method further comprises: generating corresponding execution codes according to the plurality of language description information and the plurality of symbolic expressions in the large language model, constructing a problem step according to each of the execution codes, the language description information and the symbolic expression, and outputting all the problem steps, and then further comprising: Input each of the language description information, symbolic expression and the corresponding execution code into the constructed large language iteration model, output corresponding first solution evaluation information, and receive corresponding second solution evaluation information input by the user; wherein the second scheme evaluation information is generated according to each of the symbolic expressions; If there is first solution evaluation information indicating that the current step is wrong, the corresponding first solution evaluation information is input into the large language iteration model, and the corresponding first modification suggestion is output; If the second solution evaluation information exists, indicating that the current step is wrong, obtaining the corresponding second modification suggestion input by the user; Inputting the first modification suggestion or the second modification suggestion into the large language model, and outputting an updated question step; If there is a second modification suggestion for the current problem step, only the second modification suggestion is input into the large language model.

3. The method for enhancing the reasoning capability of a large model based on semantic execution according to claim 1 is characterized in that: The step of inputting each of the execution results into the large language model for analysis and outputting an evaluation result further includes: If the evaluation result is wrong, obtaining corresponding feedback information generated by the large language model, wherein the feedback information is generated by the large language model according to the corresponding execution result; The corresponding feedback information is input into the large language model, the symbolic expression and execution code corresponding to the erroneous execution result are updated, and the updated problem steps are output, until the newly output problem steps are transmitted to the computing container, and the output execution results are the correct execution steps.

4. The method for enhancing the reasoning capability of a large model based on semantic execution according to claim 3 is characterized in that: The reasoning process includes: semantic description process and final solution process; The step of integrating all the correct execution steps to generate a reasoning process specifically includes: Integrate all the correct execution steps and the symbolic expression corresponding to each of the correct execution steps; Generate the semantic description process according to all the symbolic expressions, and generate the final solution process according to all the target correct execution steps; The semantic description process represents the textual reasoning process for solving the target problem, and the final solution process represents the digital reasoning result for solving the target problem.

5. A large model reasoning capability enhancement system based on semantic execution, characterized in that: The semantic execution-based large model reasoning capability enhancement system includes: A formalized rewriting module is used to obtain problem description information of a target problem, obtain computable guide part information according to the problem description information, and input the computable guide part information into a large language model; Obtaining problem description information of a target problem, obtaining computable guide part information according to the problem description information, and inputting the computable guide part information into a large language model, specifically including: Obtaining problem description information of a target problem input by a user, and extracting a plurality of structured information from a corresponding computable database and a subject database using a graph retrieval enhancement algorithm according to the problem description information; Constructing computable guided part information according to all the structured information, wherein the computable guided part information represents a reference case of the large language module processing the target problem, and inputting the computable guided part information into the large language model; The large language model is used to transform the natural language in the problem description information into a formal language representation, and the large language model is used to transform the logical relationship described in the natural language into a structured description expressed in a hierarchy, category or relationship network, thereby completing the rewriting of logical semantics; a question decomposition module, configured to obtain an initial prompt word of the target question, input the initial prompt word into the large language model, and output a plurality of question steps, wherein the question steps are generated by the large language model decomposing the target question according to the computable guide part information and the initial prompt word, and represent sub-questions generated after the large language model decomposes the target question; The step of obtaining an initial prompt word of the target question, inputting the initial prompt word into the large language model, and outputting multiple question steps specifically includes: Inputting the problem description information into the large language model to obtain an initial prompt word; The large language model generates a formal expression and a numerical expression according to the computable guided part information in the target problem; The large language model updates the initial prompt word and generates a prompt word according to the computable guide part information, the formal expression and the numerical expression; Analyzing the prompt words in the large language model to obtain a problem-solving idea, decomposing the problem-solving idea to obtain a plurality of language description information and a plurality of symbolic expressions, wherein the language description information represents an intermediate process described in natural language; Generate corresponding execution codes in the large language model according to the plurality of language description information and the plurality of symbolic expressions, construct problem steps according to each of the execution codes, language description information and symbolic expressions, and output all the problem steps; A problem solving module is used to construct an initial computing container, and to build a computing environment in the initial computing container to obtain a computing container, to sequentially input a plurality of the problem steps into the computing container, and to obtain a plurality of correct execution steps output by the computing container, wherein the correct execution steps represent a solution of the computing container to solve the sub-problem; The step of constructing an initial computing container, setting up a computing environment in the initial computing container, obtaining a computing container, sequentially inputting a plurality of the problem steps into the computing container, and obtaining a plurality of correct execution steps output by the computing container specifically includes: Building an initial computing container and obtaining actual execution requirements according to each of the execution codes; Building a computing environment file according to each of the actual execution requirements, and importing the computing environment file into the initial computing container to obtain the computing container; Transmitting the plurality of problem steps to the computing container, executing each of the execution codes, and outputting the execution result of the corresponding problem step; Input each of the execution results into the large language model for analysis, and output an evaluation result; If there is a correct evaluation result, the corresponding execution result is determined as a correct execution step; The computable content represented by the code in the plan is executed in real time in the constructed computing environment, and it is executed interactively and iteratively with the large language model until every step in the plan is executed correctly. The output summary module is used to integrate all the correct execution steps to generate a reasoning process, wherein the reasoning process represents a process of solving the target problem.

6. An interactive computing middleware, characterized in that: The interactive computing middleware includes: a memory, a processor, and a large model reasoning capability enhancement program based on semantic execution stored in the memory and executable on the processor. When the large model reasoning capability enhancement program based on semantic execution is executed by the processor, the steps of the large model reasoning capability enhancement method based on semantic execution as described in any one of claims 1 to 4 are implemented.

7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a large model reasoning capability enhancement program based on semantic execution, and when the large model reasoning capability enhancement program based on semantic execution is executed by a processor, the steps of the large model reasoning capability enhancement method based on semantic execution as described in any one of claims 1-4 are implemented.

Citation Information

Patent Citations

  • Question processing method and device, equipment and storage medium

    CN117743544A

  • Data analysis method and device, computer equipment and computer readable storage medium

    CN117951271A