Large language model reasoning error correction method and device, equipment and medium
By constructing and detecting inference chains, accurately locate and correcting the erroneous steps of large language models in the mathematical inference process, the error recognition problem caused by ignoring intermediate steps in the existing technology is solved, and the accuracy and reliability of mathematical inference are improved.
Patent Information
- Application Number
- CN202510324530.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-19
- Publication Date
- 2025-06-24
AI Technical Summary
The existing mathematical reasoning system mainly focuses on the correctness of the final answer when evaluating mathematical solutions, and ignores the intermediate steps in the reasoning process, making it difficult to identify and deal with errors in the reasoning process. Especially in multi-step reasoning, the accumulation of errors or hidden errors may lead to deviations in the final result.
By constructing a reasoning chain, the error steps of large language models in the mathematical reasoning process are accurately positioned and corrected. Specific methods include: obtaining pending problems, performing syntax analysis and format conversion, building initial and target inference chains, and detecting and correcting error steps in the inference chain.
It realizes accurate positioning and correction of error steps in the inference process of large language model, improves the accuracy and reliability of mathematical reasoning, and ensures the reliability of the calculation results output by the model.
Smart Images

Figure CN120197703A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and particularly to a method, device, equipment and medium for correcting reasoning errors of large language models. Background Art
[0002] With the continuous development of artificial intelligence technology, especially the excellent performance of LLM (Large Language Model) in NLP (Natural Language Processing) tasks, LLM has also demonstrated powerful capabilities in processing complex mathematical reasoning tasks (algebra, geometry, calculus, etc.). However, when evaluating mathematical solutions, existing mathematical reasoning systems mainly focus on the correctness of the final answer, while ignoring the intermediate steps in the reasoning process. This evaluation method makes it difficult to effectively identify errors in the reasoning process. Especially in the case of multi-step reasoning, the accumulation of errors or latent errors may lead to deviations in the final result, and it is very difficult to discover them through traditional error checking methods.
[0003] In order to make up for the deficiencies of the existing technology, many current studies have tried to combine symbolic reasoning with large-scale language models, so that the system can better handle mathematical reasoning problems. However, these methods cannot classify and process the reasoning errors generated by the model during the reasoning process in complex multi-step reasoning, resulting in a significant reduction in the reliability of the reasoning results. Therefore, how to accurately identify and correct errors during the reasoning process has become a key issue in improving the accuracy and reliability of mathematical reasoning. Summary of the Invention
[0004] In view of this, the purpose of the present invention is to provide a method, device, equipment and medium for correcting reasoning errors of large language models, which can construct a reasoning chain, accurately locate the steps with errors in the model reasoning process, so as to correct the wrong reasoning steps, and ensure the reliability of the calculation results output by the model. The specific solutions are as follows:
[0005] In a first aspect, the present application provides a method for correcting reasoning errors of large language models, including:
[0006] Obtain a problem to be processed input to the target reasoning system; the target reasoning system is a mathematical reasoning system created based on a large language model, and the problem to be processed is a mathematical problem that needs to be solved by the mathematical reasoning system;
[0007] Use natural language processing technology to perform syntactic analysis on the problem text content corresponding to the problem to be processed, so as to obtain the text feature information corresponding to the problem text content, and perform format conversion on the problem to be processed to obtain the corresponding target problem;
[0008] Construct an initial inference chain corresponding to the target problem based on the text feature information and the target problem, identify the first preconditions corresponding to each initial inference step in the initial inference chain, and construct a target inference chain corresponding to the target problem according to each of the first preconditions; wherein, the first precondition of any initial inference step is the inference result of the previous initial inference step corresponding to the any initial inference step in the initial inference chain, the target inference chain is an inference chain constructed based on a directed acyclic graph, the nodes in the directed acyclic graph are the inference steps in the target inference chain, and the edges in the directed acyclic graph are the dependency relationships between the inference steps;
[0009] Detect each inference step in the target inference chain to obtain inference errors in the target inference chain, determine the target inference step corresponding to the inference error from the target inference chain, and adjust the target inference step to correct the inference error of the preset large language model.
[0010] Optionally, after constructing the target inference chain corresponding to the target problem according to each of the first preconditions, it further includes:
[0011] Quantify the complexity of each inference step in the target inference chain. If the complexity of any inference step in the target inference chain is not less than a preset complexity threshold, determine the inference step with a complexity not less than the preset complexity threshold as a complex inference step;
[0012] Retrieve the target mathematical knowledge corresponding to the complex inference step from a preset knowledge base, and add the target mathematical knowledge to the second precondition corresponding to the complex inference step, so as to use the target mathematical knowledge to perform inference on the complex inference step.
[0013] Optionally, the error types corresponding to the inference errors include mathematical errors, logical errors, and cumulative errors. The mathematical error is a calculation error, formula application error, and numerical approximation error generated when the preset large language model performs inference. The logical error is an error generated when the preset large language model performs inference due to using an incorrect inference pattern or incorrect assumption conditions. The cumulative error is an error in a subsequent step caused by an error that already exists in the historical inference steps before the current inference step when the preset large language model performs inference.
[0014] Optionally, the detecting each inference step in the target inference chain to obtain inference errors in the target inference chain includes:
[0015] Match the mathematical formulas in each of the reasoning steps using a preset mathematical model, verify the arithmetic operations in each of the reasoning steps using a preset calculation tool, and analyze the numerical precision of each value in each of the reasoning steps to obtain the mathematical errors in the target reasoning chain;
[0016] Detect the third preconditions relied on by each of the reasoning steps, verify the assumed conditions corresponding to each of the reasoning steps, and detect the reasoning logic between each of the reasoning steps to obtain the logical errors in the target reasoning chain;
[0017] Traverse each of the reasoning steps in reverse according to the dependency relationships between each of the reasoning steps to obtain the cumulative errors in the target reasoning chain.
[0018] Optionally, the large language model reasoning error correction method further includes:
[0019] Determine whether the number of reasoning errors in the current target reasoning chain is less than a preset number threshold. If the number of reasoning errors in the current target reasoning chain is not less than the preset number threshold, delete the current target reasoning chain and jump to the step of performing syntactic analysis on the problem text content corresponding to the problem to be processed using natural language processing technology to construct a new target reasoning chain corresponding to the problem to be processed.
[0020] Optionally, after adjusting the target reasoning step, it further includes:
[0021] Preliminarily verify the mathematical rules in the adjusted reasoning step. If the mathematical rules in the adjusted reasoning step do not pass the preliminary verification, readjust the adjusted reasoning step;
[0022] If the mathematical rules in the adjusted reasoning step pass the preliminary verification, traverse the initial adjusted reasoning chain corresponding to the adjusted reasoning step in reverse to globally verify the reasoning logic between all the reasoning steps in the initial adjusted reasoning chain;
[0023] If the initial adjusted reasoning chain passes the global verification, determine the initial adjusted reasoning chain as the target adjusted reasoning chain.
[0024] Optionally, after adjusting the target reasoning step, it further includes:
[0025] Send the target adjusted reasoning chain to the target user to obtain feedback information from the target user on the target adjusted reasoning chain;
[0026] If the feedback information indicates that the target adjusted inference chain is unreasonable, the target adjusted inference chain is re-adjusted according to the adjustment opinions in the feedback information.
[0027] In a second aspect, the present application provides a large language model inference error correction device, including:
[0028] A problem acquisition module, configured to acquire a problem to be processed input to a target inference system; the target inference system is a mathematical inference system created based on a large language model, and the problem to be processed is a mathematical problem that needs to be solved by the mathematical inference system;
[0029] A problem analysis module, configured to perform syntactic analysis on the problem text content corresponding to the problem to be processed by using natural language processing technology to obtain text feature information corresponding to the problem text content, and perform format conversion on the problem to be processed to obtain a corresponding target problem;
[0030] An inference chain construction module, configured to construct an initial inference chain corresponding to the target problem based on the text feature information and the target problem, identify first preconditions corresponding to each initial inference step in the initial inference chain, and construct a target inference chain corresponding to the target problem according to each of the first preconditions; wherein, the first precondition of any initial inference step is the inference result of the previous initial inference step corresponding to the any initial inference step in the initial inference chain, the target inference chain is an inference chain constructed based on a directed acyclic graph, nodes in the directed acyclic graph are each inference step in the target inference chain, and edges in the directed acyclic graph are dependency relationships between each inference step;
[0031] An inference step adjustment module, configured to detect each inference step in the target inference chain to obtain an inference error in the target inference chain, determine a target inference step corresponding to the inference error from the target inference chain, and adjust the target inference step to correct the inference error of the preset large language model.
[0032] In a third aspect, the present application provides an electronic device, including:
[0033] A memory, configured to store a computer program;
[0034] A processor, configured to execute the computer program to implement the foregoing large language model inference error correction method.
[0035] In a fourth aspect, the present application provides a computer-readable storage medium, configured to store a computer program, and when the computer program is executed by a processor, the foregoing large language model inference error correction method is implemented.
[0036] In this application, first, the problem to be processed input to the target inference system is obtained; the target inference system is a mathematical inference system created based on a large language model, and the problem to be processed is a mathematical problem that needs to be solved by the mathematical inference system. Then, natural language processing technology is used to perform syntactic analysis on the problem text content corresponding to the problem to be processed to obtain the text feature information corresponding to the problem text content, and the format of the problem to be processed is converted to obtain the corresponding target problem. After that, an initial inference chain corresponding to the target problem is constructed based on the text feature information and the target problem, the first preconditions corresponding to each initial inference step in the initial inference chain are identified, and a target inference chain corresponding to the target problem is constructed according to each of the first preconditions; wherein, the first precondition of any initial inference step is the inference result of the previous initial inference step corresponding to the any initial inference step in the initial inference chain, the target inference chain is an inference chain constructed based on a directed acyclic graph, the nodes in the directed acyclic graph are the inference steps in the target inference chain, and the edges in the directed acyclic graph are the dependency relationships between the inference steps. Finally, each inference step in the target inference chain is detected to obtain the inference errors in the target inference chain, the target inference step corresponding to the inference error is determined from the target inference chain, and the target inference step is adjusted to correct the inference error of the preset large language model. It can be seen that this application can accurately master each inference step of the large language model in the data calculation process by analyzing the mathematical problem to be calculated and constructing an inference chain corresponding to the mathematical problem to be calculated; by detecting each inference step in the inference chain, the inference steps with errors in the inference process can be obtained; by accurately positioning the inference steps with inference errors, the wrong steps can be adjusted in time, ensuring the correctness of the model inference process and thus ensuring the reliability of the answer calculated by the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present invention, and those of ordinary skill in the art can also obtain other drawings according to the provided drawings without creative efforts.
[0038] Figure 1 It is a flowchart of a method for correcting errors in a large language model disclosed in this application;
[0039] Figure 2 It is a schematic diagram of the process of a specific method for correcting errors in a large language model disclosed in this application;
[0040] Figure 3 Flowchart of a method for constructing an inference chain disclosed in this application;
[0041] Figure 4 Schematic diagram of the structure of an inference chain disclosed in this application;
[0042] Figure 5 Schematic diagram of the structure of a large language model error correction device disclosed in this application;
[0043] Figure 6 Schematic diagram of the structure of an electronic device disclosed in this application. Detailed implementation manners
[0044] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0045] Currently, in the process of a large language model's reasoning about mathematical problems, the prior art cannot classify and process the reasoning errors generated by the model during the process of complex multi-step reasoning, resulting in a significant reduction in the reliability of the reasoning results. For this reason, this application provides a method for correcting reasoning errors in a large language model. By constructing an inference chain, the steps with errors in the model's reasoning process can be accurately located, so as to correct the incorrect reasoning steps and ensure the reliability of the calculation results output by the model.
[0046] See Figure 1 As shown, the embodiments of the present invention disclose a method for correcting reasoning errors in a large language model, including:
[0047] Step S11: Obtain the problem to be processed input to the target reasoning system; the target reasoning system is a mathematical reasoning system created based on a large language model, and the problem to be processed is a mathematical problem that needs to be solved by the mathematical reasoning system.
[0048] The overall process of the method for correcting reasoning errors in a large language model in this embodiment is as shown in Figure 2As shown in the figure, first, it is necessary to analyze the problem to be processed and standardize the mathematical expression corresponding to the problem to be processed. Then, an enhanced inference chain is constructed to identify and classify errors. Finally, the errors are corrected and the results are output. It should be noted that the problem to be processed in this embodiment is a mathematical problem that needs to be solved based on a mathematical reasoning system constructed by a large language model; and the form of the above problem to be processed is not limited to the text form, and it may also include picture information. For example, if the above problem to be processed is a geometric problem, the problem will include the corresponding geometric image.
[0049] Step S12: Use natural language processing technology to perform syntactic analysis on the problem text content corresponding to the problem to be processed, so as to obtain the text feature information corresponding to the problem text content, and perform format conversion on the problem to be processed to obtain the corresponding target problem.
[0050] In this embodiment, first, it is necessary to analyze the problem to be processed, that is, the mathematical problem, and convert it into structured data that is easy to process for subsequent reasoning and error identification. The steps are as follows:
[0051] 1. Problem analysis: Use natural language processing technology to perform syntactic analysis on the input mathematical problem to identify the mathematical expressions, variables, operators, and known conditions therein. For example, in the problem "Solve the equation 2x + 3 = 7", the system will identify the variable x, the operator +, and the numbers 2, 3, and 7, and confirm that this is a linear equation problem. The above mathematical expressions, variables, operators, and known conditions are the aforementioned text feature information.
[0052] 2. Standardization of mathematical expressions: The system standardizes the symbols, operators, and numbers in the mathematical problem to ensure a unified format for subsequent reasoning operations. For example: Example problem: "Solve the equation 2X + 3 = 7"; Convert it to the standard form: 2x + 3 = 7; The uppercase and lowercase of the letter are unified as the lowercase x; The standardized expression is: 2x + 3 = 7, which ensures the consistency of the system when processing multiple problems.
[0053] The above mathematical expressions, variables, operators, and known conditions are the aforementioned text feature information; the problem to be processed after being converted into the standard form is the aforementioned target problem. By performing syntactic analysis on the problem to be processed and converting it into an expression in the standard form, the system's understanding of the problem can be deepened, and the deviation in the system's understanding of the problem caused by the inconsistent uppercase and lowercase of the variables in the problem can be avoided.
[0054] Step S13: Based on the text feature information and the target problem, construct an initial inference chain corresponding to the target problem, identify the first preconditions corresponding to each initial inference step in the initial inference chain, and construct a target inference chain corresponding to the target problem according to each of the first preconditions; wherein, the first precondition of any initial inference step is the inference result of the previous initial inference step corresponding to the any initial inference step in the initial inference chain, the target inference chain is an inference chain constructed based on a directed acyclic graph, the nodes in the directed acyclic graph are the inference steps in the target inference chain, and the edges in the directed acyclic graph are the dependency relationships between the inference steps.
[0055] In this embodiment, the system first needs to construct an initial inference chain corresponding to the target problem. In the initialization stage of the inference chain, the system constructs a preliminary inference chain framework (i.e., the initial inference chain) based on the parsing result of the problem and the standardized expression. For example, for the equation 2x + 3 = 7, the construction of the inference chain is as follows:
[0056] 1. Preliminary inference chain: Extract the mathematical formula and known conditions to form the inference chain.
[0057] For example, given: 2x + 3 = 7; problem: Solve the equation for x.
[0058] 2. Inference steps: First step: Transpose to get 2x = 7 - 3; second step: Simplify to get 2x = 4; third step: Divide by 2 to get x = 2.
[0059] It should be noted that at this time, the system does not perform actual inference operations, but only constructs a framework, listing the possible inference steps and mathematical expressions.
[0060] In addition, to enhance the accuracy of the inference chain, the system will integrate multi-modal data for supplementation, including formulas in mathematics textbooks, code execution logs, vectorized data of geometric figures, etc. For example: If the problem involves geometric operations, the problem can be transformed into a geometric figure using pattern recognition technology, and computer vision technology can be used to assist in verifying the steps. For example, the area formula of a triangle: Area = 1 / 2 × base × height.
[0061] By identifying the preconditions (i.e., the first preconditions) of each inference step in the preliminary inference chain, an enhanced inference chain is constructed. Each step not only depends on the result of the previous inference step but also requires external mathematical theorems or known conditions as support. The specific operations are as follows:
[0062] 1. Extract the prerequisite conditions for the reasoning steps: For each reasoning step, the system identifies the prerequisite conditions it depends on through the LLM. The prerequisite conditions can be the results of previous reasoning, known mathematical formulas, or the initial conditions given in the problem. For example, when solving an equation, step 1 may depend on the initial conditions (such as the equation form) and mathematical formulas (such as the solution method for linear equations).
[0063] Example: Solve the equation 2x + 3 = 7;
[0064] Step 1: Transpose the terms to simplify the equation to 2x = 7 - 3;
[0065] Prerequisite conditions:
[0066] Known condition: Equation form 2x + 3 = 7;
[0067] Mathematical formula: Transposition method for linear equations;
[0068] Mathematical common sense: Transposing an operation means moving a constant to the other side of the equation;
[0069] Step 2: Simplify the equation 2x = 4;
[0070] Prerequisite conditions:
[0071] Known condition: 2x = 4 obtained in the previous step;
[0072] Mathematical formula: Numerical operation rules;
[0073] Mathematical common sense: Subtracting the same number from both sides of an equation, the equation still holds;
[0074] Step 3: Divide by 2 to get x = 2;
[0075] Prerequisite conditions:
[0076] Known condition: 2x = 4 obtained in the previous step;
[0077] Mathematical formula: Division rule;
[0078] Mathematical common sense: Dividing both sides of an equation by the same number, the equation still holds;
[0079] In this process, the system extracts the relevant prerequisite conditions from each step of the reasoning chain, and each prerequisite condition corresponds to a specific mathematical formula, known fact, or the result of a previous step.
[0080] 2. Construction of the prerequisite-enhanced reasoning chain (i.e., the target reasoning chain);
[0081] , the construction process of the prerequisite-enhanced reasoning chain in this embodiment is as Figure 3As shown, when constructing an inference chain, each inference step is associated with the prerequisite conditions it depends on, and the dependency relationship of the inference process is represented by a DAG (Directed Acyclic Graph). Each node represents an inference step, and each edge represents the causal relationship between an inference step and its prerequisite conditions.
[0082] For example, for solving the equation 2x + 3 = 7, the system can construct the following inference chain (DAG) as Figure 4 shown:
[0083] 1. Node 1 (initial equation): 2x + 3 = 7;
[0084] Prerequisite conditions: equation form;
[0085] 2. Node 2 (transposition): 2x = 7 - 3;
[0086] Prerequisite conditions: Node 1 (initial equation), transposition rule;
[0087] 3. Node 3 (simplification): 2x = 4;
[0088] Prerequisite conditions: Node 2, numerical operation rules;
[0089] 4. Node 4 (division): x = 2;
[0090] Prerequisite conditions: Node 3, division rule;
[0091] The dependency relationship between each node and its prerequisite conditions is represented by a directed edge, and the direction of the edge is from the prerequisite condition to the inference step. Through this structure, the system can clearly trace the source and dependency of each step of reasoning and ensure the structural consistency and coherence of the inference chain.
[0092] 3. Enhancement of the extension of the inference chain: In addition to the known conditions in the problem, the system will also combine an external mathematical knowledge base (such as mathematical theorems, formulas, theorem proofs, etc.) to extend the inference chain. For example, for some complex inference steps, known mathematical theorems (such as the Pythagorean theorem, quadratic equation solving formula, etc.) may need to be applied. The system can automatically retrieve them from the knowledge base and add them as prerequisite conditions to the inference chain; correspondingly, after constructing the target inference chain corresponding to the target problem according to each first prerequisite condition, it further includes: quantifying the complexity of each inference step in the target inference chain. If the complexity of any inference step in the target inference chain is not less than the preset complexity threshold, the inference step with a complexity not less than the preset complexity threshold is determined as a complex inference step; retrieving the target mathematical knowledge corresponding to the complex inference step from the preset knowledge base and adding the target mathematical knowledge to the second prerequisite condition corresponding to the complex inference step, so as to use the target mathematical knowledge to reason about the complex inference step.
[0093] Specifically, for example, for such a more complex equation, the system may need to use the quadratic formula to solve it. By retrieving the quadratic formula from an external mathematical knowledge base:
[0094] ;
[0095] Add this formula as a prerequisite to the reasoning chain and further verify it through a symbolic calculation tool (such as the SymPy library in Python). By using an external verification tool, the accuracy of the reasoning process can be ensured, and potential errors in manual reasoning can be avoided.
[0096] In some more complex mathematical reasoning tasks, the system can introduce more advanced theorems (such as Lagrange's theorem, Pythagorean theorem, integral rules, etc.) from external libraries to supplement and expand the reasoning chain. For geometric problems, the system may introduce relevant geometric formulas or theorems (such as the Pythagorean theorem, inscribed angle theorem, etc.). By introducing an external mathematical knowledge base, the reasoning chain of the system can not only solve problems but also provide theoretical support for the problem-solving process, ensuring the accuracy and reliability of the reasoning.
[0097] Step S14: Detect each reasoning step in the target reasoning chain to obtain the reasoning errors in the target reasoning chain, determine the target reasoning step corresponding to the reasoning error from the target reasoning chain, and adjust the target reasoning step to correct the reasoning error of the preset large language model.
[0098] In this embodiment, the error types corresponding to the above reasoning errors include mathematical errors, logical errors, and cumulative errors. A mathematical error is a calculation error, formula application error, and numerical approximation error generated when the preset large language model performs reasoning. A logical error is an error generated when the preset large language model performs reasoning due to using an incorrect reasoning mode or incorrect assumption conditions. A cumulative error is an error in a subsequent step caused by an error that already exists in the historical reasoning steps before the current reasoning step. That is, the goal of this step is to ensure that each step of the reasoning chain can be accurately identified and classified as a correct or incorrect reasoning, and to perform detailed detection and analysis on different types of errors (mathematical errors, logical inconsistencies, and cumulative errors). To improve the accuracy and efficiency of recognition, this step is divided into three parts: error type definition, error recognition method, and error classification, and combines local verification and global traceability mechanisms to ensure the accuracy and coherence of the reasoning.
[0099] 1. Error type definition: First, define three error types, including mathematical errors, logical inconsistencies, and cumulative errors. Each error type is further refined as follows:
[0100] Mathematical errors: including calculation errors, formula application errors, and numerical errors. Among them, calculation errors refer to basic calculation errors in addition, subtraction, multiplication, or division that may occur during arithmetic or algebraic operations; formula application errors refer to incorrect application of mathematical formulas in the reasoning steps or inappropriate selection of the formula itself, which may lead to incorrect results; numerical errors refer to numerical errors (such as rounding errors in floating-point operations) that may cause reasoning errors when dealing with floating numerical values or calculations with high precision requirements.
[0101] Logical errors: including reasoning contradictions, invalid assumptions, and reasoning pattern errors. Among them, reasoning contradictions mean that the reasoning steps are contradictory to each other or violate logical rules. For example, known conditions are ignored or unreasonable assumptions are made in the reasoning steps; invalid assumptions mean that in some reasoning steps, the system may assume irrelevant or unestablished preconditions, resulting in incorrect conclusions; reasoning pattern errors mean that certain conclusions should not be directly drawn from a specific type of equation, but other logical paths should be adopted.
[0102] Cumulative errors: including dependency errors and misinformation propagation. Among them, dependency errors refer to analyzing a directed acyclic graph (DAG) to check whether the preconditions of an error affect subsequent reasoning steps. The error may have occurred in the previous few steps, but is misjudged as correct in subsequent steps and continues to affect the reasoning; misinformation propagation means that when an incorrect reasoning step is regarded as correct and passed on to subsequent steps, this error will continuously "spread", resulting in a series of incorrect reasonings.
[0103] 2. Error identification method: The core task of error identification is to carefully analyze each step of reasoning and use two methods, local verification and global traceability, to detect different types of errors.
[0104] The identification methods for mathematical errors include formula matching and verification, calculation verification, i.e., numerical error detection. The specific process is as follows:
[0105] Formula matching and verification: Use a mathematical model to verify whether the current reasoning step conforms to known mathematical formulas or calculation rules. For each reasoning step, the system will perform matching and verification according to the known mathematical formulas to ensure that there are no formula application errors; calculation verification: For each arithmetic operation, the system will apply external tools (such as SymPy) during the reasoning process for real-time calculation to automatically detect potential calculation errors; numerical error detection: For steps involving floating-point operations, the system will calculate and analyze the numerical precision and use a reasonable error tolerance to determine whether a numerical error has occurred;
[0106] Example: If in a certain step, the system identifies that 2x + 3 = 7 is wrongly solved as 2x = 8, it will be marked as a mathematical calculation error.
[0107] The methods for identifying logical errors include premise verification, inference path checking, and assumption consistency detection. The specific processes are as follows:
[0108] Premise verification: Check whether each inference step depends on correct premise conditions. If the premise conditions in an inference step are incorrect themselves, it will lead to incorrect inferences for the entire step; Inference path checking: By simulating the inference path, check whether the results of each step of inference conform to mathematical logic and whether there are derivation processes that do not conform to the known conditions; Assumption consistency detection: Verify each assumption to ensure its validity and prevent the use of invalid or incorrect assumptions during the inference process;
[0109] Example: In a certain inference step, assume that a certain variable is zero, but according to the context conditions, this assumption does not hold. At this time, the system will mark this assumption as incorrect and trace back to verify its impact on subsequent steps.
[0110] The methods for identifying cumulative errors include DAG dependency relationship identification, and premise verification and backtracking. The specific processes are as follows:
[0111] DAG dependency relationship analysis: Use the DAG structure to trace the dependency relationships between various steps in the inference chain. Traverse backward from the conclusion node. If the premise condition of a step is marked as incorrect, then this step and its subsequent steps will be automatically marked as cumulative errors; Premise verification and backtracking: When an error is found, the system will trace back and check the source where the error occurred. If it is found that a certain premise condition is incorrect, the system will identify and mark all subsequent steps that depend on this condition as cumulative errors.
[0112] Example: When solving an equation, if an incorrect derivation (such as incorrect transposition) is found in a certain intermediate step, the system will mark the subsequent calculations (for example, the derivation of the final solution) that depend on this incorrect step as cumulative errors.
[0113] The above processes for error identification are also: Use a preset mathematical model to match the mathematical formulas in each inference step, use a pre-set calculation tool to verify the arithmetic operations in each inference step, and analyze the numerical precision of each numerical value in each inference step to obtain the mathematical errors in the target inference chain; Detect the third premise conditions on which each inference step depends, verify the assumed conditions corresponding to each inference step, and detect the inference logic between each inference step to obtain the logical errors in the target inference chain; Traverse each inference step backward according to the dependency relationships between each inference step to obtain the cumulative errors in the target inference chain.
[0114] 3. Error classification: The process of error classification is divided into local verification and global traceability.
[0115] Local verification: For each step, the system verifies based on its direct preconditions to determine whether there are mathematical or logical errors in that step. The local error detection method for each step independently checks its preconditions and reasoning process to ensure compliance with logical and mathematical principles.
[0116] Example: For the equation 2x + 3 = 7, when the system detects a calculation error in a step (such as mistakenly transposing 2x + 3 to 2x = 8), that step will be marked as a mathematical error.
[0117] Global tracing: Traverse the DAG backward from the conclusion node, gradually checking each node and its preconditions. If the precondition of a node is marked as an error, all subsequent steps that depend on it will be marked as cumulative errors; use the verification mechanisms of common large language models on the market to assist in identifying and verifying the consistency of the annotations to ensure the accuracy of the annotation process.
[0118] Example: If the final solution is wrongly marked as x = 5, global tracing will trace back from this node to the source of the reasoning chain, identify that an arithmetic error in a certain preliminary step led to the error in the entire reasoning chain, and classify this error as a cumulative error.
[0119] In this embodiment, the goal of the system is not only to identify errors but also to provide effective feedback and adopt appropriate correction strategies to correct the errors in the reasoning chain. Error correction is a key step in ensuring the correctness of the reasoning chain and improving the reliability of the system. The correction strategy can be implemented in different ways, from local correction to global correction, from automatic correction of simple errors to reasoning adjustment of complex errors. It should be noted that the feedback mechanism in this embodiment is divided into local feedback, global feedback, and scenario feedback, and its specific process is as follows:
[0120] Local feedback: When an error is found in a single reasoning step, the system will provide local feedback, directly pointing out the step where the error occurs and briefly describing why the step is incorrect (such as calculation error, logical contradiction, etc.). The system can provide corresponding improvement suggestions according to the error type to help the user identify the problem.
[0121] Example: If, when solving the equation, the system finds that 2x + 3 = 7 is wrongly transposed to 2x = 8, the system will provide the following feedback: "Error: Incorrect transposition operation. The constant term 3 should be moved to the right side of the equation, i.e., 2x = 7 - 3, to obtain the correct result."
[0122] Global feedback: When a dependency error or cumulative error is found, the system will provide global feedback, tracing backward and marking all affected steps. The system will indicate which precondition or reasoning step's error led to the failure of the entire reasoning chain and provide a comprehensive correction plan.
[0123] Example: If an error in an intermediate step is found during the process of solving an equation and it affects the final solution, the system will provide the following feedback: "Error: The transposition operation in Step 2 is incorrect, which affects the subsequent calculations. Please check the reasoning chain of the previous steps, correct Step 2, and then recalculate."
[0124] Situational feedback: The system provides contextual feedback based on the complexity of the reasoning problem. For more complex reasoning tasks, the system will provide detailed explanations for each reasoning step, including the logical basis of the reasoning, the mathematical formulas applied, the calculation steps, etc., to help users understand the background of each step and the possible sources of errors. For complex problems involving compound formulas or multi-step reasoning, the system can gradually prompt the sources of errors and provide users with more detailed background knowledge or reasoning logic.
[0125] After providing error feedback, it is also necessary to repair the errors in the reasoning chain. After the entire reasoning chain is repaired, it still conforms to the rules of mathematics and logic and returns the correct conclusion. The correction methods are divided into the following ways:
[0126] 1. Local correction: When a single reasoning step error is identified, the system can directly correct that step. For example, for a mathematical calculation error, the system will recalculate that step, using the correct mathematical formula, rule, or method for correction.
[0127] Example: If the system identifies that 2x + 3 = 7 has been incorrectly transposed to 2x = 8 in a step, the system will reapply the correct transposition operation, calculate 2x = 4, and then continue with the subsequent steps.
[0128] 2. Automatic reasoning adjustment: In some cases, the system will automatically adjust the subsequent steps based on the previous reasoning chain to correct the calculations that depend on the incorrect premise. For example, if it is found that an incorrect premise leads to errors in some reasoning steps, the system will re-derive the subsequent results based on the correct premise.
[0129] Example: If an error occurs in Step 2, resulting in an incorrect calculation of 2x = 4, the system will backtrack and recalculate based on the correct 2x = 7 - 3 and adjust the subsequent reasoning steps.
[0130] 3. Inference Chain Reconstruction: When a series of errors are identified (such as a broken inference chain caused by incorrect preconditions), the system may need to reconstruct the entire inference chain. This means that the framework of the inference chain needs to be rebuilt, the inference path needs to be fundamentally adjusted, and in some cases, the problem definition or input conditions may even need to be reexamined. The above process is to determine whether the number of inference errors in the current target inference chain is less than the preset number threshold. If the number of inference errors in the current target inference chain is not less than the preset number threshold, the current target inference chain is deleted, and the system jumps to the step of performing syntactic analysis on the problem text content corresponding to the problem to be processed using natural language processing technology to construct a new target inference chain corresponding to the problem to be processed.
[0131] Example: If an equation 2x + 3 = 7 is misinterpreted as a quadratic equation, the system will adjust the equation type by backtracking, reconstruct the inference chain from a linear equation, and re-perform the solution method after correction.
[0132] 4. Supplementary Mathematics Theorems and External Verification: The system introduces external mathematical theorems or automated calculation tools to assist in correction. For example, in complex inference processes, the system automatically invokes theorems in the mathematical knowledge base or calculation engines to verify and correct the inference process.
[0133] Example: If an incorrect formula is used in the inference process, the system can introduce the correct formula or theorem in the external knowledge base and automatically apply this knowledge for correction. For example, when solving a quadratic equation, the system can automatically quote the quadratic equation solution formula \(x=\frac{-b\pm\sqrt{b^{2}-4ac}}{2a}\) and verify whether the inference conforms to this formula.
[0134] 5. User Intervention Guidance: For particularly complex or ambiguous errors, the system can prompt the user to intervene, providing error information and possible correction directions. The user can manually correct the error according to the prompts provided by the system or further interact with the system to correct the inference chain.
[0135] Example: If the inference process involves uncertain mathematical operations or user input errors, the system can prompt the user: "There may be a problem with the calculation in step 3. You can choose to re-enter or specify the operation method."
[0136] In this embodiment, after adjusting the target reasoning step, the following steps are further included: preliminarily verifying the mathematical rules in the adjusted reasoning step. If the mathematical rules in the adjusted reasoning step fail the preliminary verification, the adjusted reasoning step is adjusted again; if the mathematical rules in the adjusted reasoning step pass the preliminary verification, the initial adjusted reasoning chain corresponding to the adjusted reasoning step is traversed in reverse to globally verify the reasoning logic between all reasoning steps in the initial adjusted reasoning chain; if the initial adjusted reasoning chain passes the global verification, the initial adjusted reasoning chain is determined as the target adjusted reasoning chain. Specifically, after each correction, the system will re-verify the corrected steps to ensure that the correction does not introduce new errors. The system will gradually check whether each step conforms to the mathematical rules and whether the logical reasoning is rigorous according to the corrected reasoning steps. Example: If a transposition error is corrected, the system will recalculate the results of each step to ensure that the final solution is accurate. The global verification is performed on the reasoning chain after the preliminary verification (i.e., the initial adjusted reasoning chain). The system verifies whether each step from the conclusion to the initial problem has been correctly reasoned and calculated through reverse tracing to ensure that the corrected reasoning chain (i.e., the target adjusted reasoning chain) is complete and accurate. Example: The system will verify the entire process of solving the equation to ensure that the final solution is consistent with the initial conditions.
[0137] In this embodiment, after adjusting the target reasoning step, the following steps are further included: sending the target adjusted reasoning chain to the target user to obtain the feedback information of the target user on the target adjusted reasoning chain; if the feedback information indicates that the target adjusted reasoning chain is unreasonable, the target adjusted reasoning chain is adjusted again according to the adjustment opinion in the feedback information. That is, during the correction and verification process, the system can provide the corrected reasoning chain and conclusion to the user and invite the user to verify and provide feedback. The user can confirm whether the correction is reasonable or provide additional information to further optimize the reasoning process. Example: The corrected solution of the equation can be displayed to the user, and the user can choose to accept it or adjust it manually.
[0138] It can be seen that by analyzing the mathematical problem to be calculated and constructing the reasoning chain corresponding to the mathematical problem to be calculated, this application can accurately grasp each reasoning step in the data calculation process of the large language model; by detecting each reasoning step in the reasoning chain, the reasoning steps with errors in the reasoning process can be obtained; by accurately positioning the reasoning steps with reasoning errors, the wrong steps can be adjusted in time, ensuring the correctness of the model reasoning process and thus ensuring the reliability of the answer calculated by the model.
[0139] See Figure 5 As shown in the figure, an apparatus for correcting reasoning errors of a large language model according to an embodiment of the present invention includes:
[0140] A problem acquisition module 11, configured to acquire a problem to be processed input to a target inference system; the target inference system is a mathematical inference system created based on a large language model, and the problem to be processed is a mathematical problem that needs to be solved by the mathematical inference system.
[0141] A problem analysis module 12, configured to perform syntactic analysis on the problem text content corresponding to the problem to be processed by using natural language processing technology to obtain text feature information corresponding to the problem text content, and perform format conversion on the problem to be processed to obtain a corresponding target problem.
[0142] An inference chain construction module 13, configured to construct an initial inference chain corresponding to the target problem based on the text feature information and the target problem, identify first preconditions corresponding to each initial inference step in the initial inference chain, and construct a target inference chain corresponding to the target problem according to each of the first preconditions; wherein, the first precondition of any initial inference step is the inference result of the previous initial inference step corresponding to the any initial inference step in the initial inference chain, the target inference chain is an inference chain constructed based on a directed acyclic graph, the nodes in the directed acyclic graph are each inference step in the target inference chain, and the edges in the directed acyclic graph are the dependency relationships between the inference steps.
[0143] An inference step adjustment module 14, configured to detect each inference step in the target inference chain to obtain an inference error in the target inference chain, determine a target inference step corresponding to the inference error from the target inference chain, and adjust the target inference step to correct the inference error of the preset large language model.
[0144] It can be seen that, by analyzing the mathematical problem to be calculated and constructing an inference chain corresponding to the mathematical problem to be calculated, this application can accurately master each inference step of the large language model in the data calculation process; by detecting each inference step in the inference chain, an inference step with an error in the inference process can be obtained; by accurately positioning the inference step with an inference error, the wrong step can be adjusted in time, ensuring the correctness of the model inference process, and thus ensuring the reliability of the answer calculated by the model.
[0145] In some specific embodiments, the inference chain construction module 13 may further include:
[0146] A complexity quantification unit, configured to perform quantification processing on the complexity of each inference step in the target inference chain, and if the complexity of any inference step in the target inference chain is not less than a preset complexity threshold, determine the inference step with a complexity not less than the preset complexity threshold as a complex inference step.
[0147] A knowledge retrieval unit, configured to retrieve the target mathematical knowledge corresponding to the complex reasoning step from a preset knowledge base, and add the target mathematical knowledge to the second precondition corresponding to the complex reasoning step, so as to perform reasoning on the complex reasoning step by using the target mathematical knowledge.
[0148] In some specific embodiments, the reasoning step adjustment module 14 may specifically include:
[0149] A first error acquisition unit, configured to match the mathematical formulas in each of the reasoning steps by using a preset mathematical model, verify the arithmetic operations in each of the reasoning steps by using a preset calculation tool, and analyze the numerical accuracy of each numerical value in each of the reasoning steps, so as to acquire the mathematical errors in the target reasoning chain;
[0150] A second error acquisition unit, configured to detect the third preconditions relied on by each of the reasoning steps, verify the assumed conditions corresponding to each of the reasoning steps, and detect the reasoning logic between each of the reasoning steps, so as to acquire the logical errors in the target reasoning chain;
[0151] A third error acquisition unit, configured to perform reverse traversal on each of the reasoning steps according to the dependency relationship between each of the reasoning steps, so as to acquire the cumulative errors in the target reasoning chain.
[0152] In some specific embodiments, the large language model reasoning error correction device further includes:
[0153] A step jump module, configured to determine whether the number of reasoning errors in the current target reasoning chain is less than a preset number threshold. If the number of reasoning errors in the current target reasoning chain is not less than the preset number threshold, delete the current target reasoning chain, and jump to the step of performing syntactic analysis on the problem text content corresponding to the problem to be processed by using natural language processing technology, so as to construct a new target reasoning chain corresponding to the problem to be processed.
[0154] In some specific embodiments, the reasoning step adjustment module 14 further includes:
[0155] A mathematical rule verification unit, configured to perform preliminary verification on the mathematical rules in the adjusted reasoning steps. If the mathematical rules in the adjusted reasoning steps do not pass the preliminary verification, readjust the adjusted reasoning steps.
[0156] An inference logic verification unit, configured to, if the mathematical rules in the adjusted inference steps pass the preliminary verification, traverse the initial adjusted inference chain corresponding to the adjusted inference steps in reverse to globally verify the inference logic between all inference steps in the initial adjusted inference chain;
[0157] An inference chain determination unit, configured to, if the initial adjusted inference chain passes the global verification, determine the initial adjusted inference chain as the target adjusted inference chain.
[0158] In some specific embodiments, the inference step adjustment module 14 further includes:
[0159] An inference chain sending unit, configured to send the target adjusted inference chain to a target user to obtain feedback information of the target user on the target adjusted inference chain;
[0160] An inference chain adjustment unit, configured to, if the feedback information indicates that the target adjusted inference chain is unreasonable, re-adjust the target adjusted inference chain according to the adjustment opinion in the feedback information.
[0161] Furthermore, an electronic device is also disclosed in an embodiment of the present application. Figure 6 It is a structural diagram of an electronic device 20 shown according to an exemplary embodiment, and the content in the figure cannot be considered as any limitation on the scope of use of the present application.
[0162] Figure 6 It is a schematic structural diagram of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. Among them, the memory 22 is used to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps in the large language model inference error correction method disclosed in any of the foregoing embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0163] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows is any communication protocol applicable to the technical solution of the present application, and no specific limitation is imposed on it here; the input / output interface 25 is used to obtain external input data or output data to the outside, and its specific interface type can be selected according to specific application needs, and no specific limitation is made here.
[0164] In addition, as a carrier for storing resources, the memory 22 can be a read-only memory, a random access memory, a magnetic disk, an optical disc, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be transient storage or permanent storage.
[0165] Among them, the operating system 221 is used to manage and control each hardware device and the computer program 222 on the electronic device 20, and it can be Windows Server, Netware, Unix, Linux, etc. In addition to the computer program that can be used to complete the large language model inference error correction method executed by the electronic device 20 disclosed in any of the foregoing embodiments, the computer program 222 can further include computer programs that can be used to complete other specific tasks.
[0166] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the large language model inference error correction method disclosed above. For the specific steps of this method, reference can be made to the corresponding content disclosed in the foregoing embodiments, and details will not be repeated here.
[0167] In this specification, each embodiment is described in a progressive manner. The key point of each embodiment is to illustrate the differences from other embodiments. The same or similar parts among the embodiments can be referred to each other. For the device disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method part.
[0168] Those skilled in the art can further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed in this article can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.
[0169] The steps of the method or algorithm described in combination with the embodiments disclosed in this article can be directly implemented by hardware, a software module executed by a processor, or a combination of the two. The software module can be placed in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium well-known in the technical field.
[0170] Finally, it should also be noted that in this text, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or device comprising said element.
[0171] The technical solutions provided in this application have been introduced in detail above. Specific examples are used in this text to elaborate on the principles and implementation manners of this application. The description of the above embodiments is only used to help understand the method and its core idea of this application; at the same time, for those of ordinary skill in the art, according to the idea of this application, there will be changes in the specific implementation manners and application scopes. In summary, the content of this specification should not be construed as a limitation to this application.
Claims
1. A method for correcting errors in reasoning of a large language model, characterized in that: include: Obtaining a problem to be processed as input to a target reasoning system; The target reasoning system is a mathematical reasoning system created based on a large language model, and the problem to be processed is a mathematical problem that needs to be solved by the mathematical reasoning system; Using natural language processing technology to perform syntactic analysis on the question text content corresponding to the question to be processed to obtain text feature information corresponding to the question text content, and performing format conversion on the question to be processed to obtain the corresponding target question; An initial reasoning chain corresponding to the target problem is constructed based on the text feature information and the target problem, a first premise condition corresponding to each initial reasoning step in the initial reasoning chain is identified, and a target reasoning chain corresponding to the target problem is constructed according to each of the first premise conditions; wherein the first premise condition of any initial reasoning step is the reasoning result of the previous initial reasoning step corresponding to any initial reasoning step in the initial reasoning chain, the target reasoning chain is a reasoning chain constructed based on a directed acyclic graph, the nodes in the directed acyclic graph are the reasoning steps in the target reasoning chain, and the edges in the directed acyclic graph are the dependency relationships between the reasoning steps; Each of the reasoning steps in the target reasoning chain is detected to obtain a reasoning error in the target reasoning chain, a target reasoning step corresponding to the reasoning error is determined from the target reasoning chain, and the target reasoning step is adjusted to correct the reasoning error of the preset large language model.
2. The large language model inference error correction method according to claim 1, characterized in that: After constructing the target reasoning chain corresponding to the target problem according to each of the first prerequisites, the method further includes: Quantifying the complexity of each reasoning step in the target reasoning chain, if the complexity of any reasoning step in the target reasoning chain is not less than a preset complexity threshold, determining the reasoning step with a complexity not less than the preset complexity threshold as a complex reasoning step; The target mathematical knowledge corresponding to the complex reasoning step is retrieved from a preset knowledge base, and the target mathematical knowledge is added to the second premise corresponding to the complex reasoning step, so as to use the target mathematical knowledge to reason the complex reasoning step.
3. The large language model inference error correction method according to claim 1, characterized in that: The error types corresponding to the reasoning errors include mathematical errors, logical errors and cumulative errors. The mathematical errors are calculation errors, formula application errors and numerical approximation errors generated when the preset large language model is used for reasoning. The logical errors are errors caused by using an incorrect reasoning mode or incorrect assumptions when the preset large language model is used for reasoning. The cumulative errors are subsequent errors caused by errors that existed in the historical reasoning steps before the current reasoning step when the preset large language model is used for reasoning.
4. The large language model inference error correction method according to claim 3, characterized in that: The detecting each of the reasoning steps in the target reasoning chain to obtain a reasoning error in the target reasoning chain includes: Matching the mathematical formulas in each of the reasoning steps using a preset mathematical model, verifying the arithmetic operations in each of the reasoning steps using a preset calculation tool, and analyzing the numerical accuracy of each numerical value in each of the reasoning steps to obtain the mathematical errors in the target reasoning chain; Testing the third premise condition that each of the reasoning steps depends on, verifying the assumption condition corresponding to each of the reasoning steps, and testing the reasoning logic between each of the reasoning steps to obtain the logic error in the target reasoning chain; Each of the reasoning steps is traversed in reverse according to the dependency relationship between the reasoning steps to obtain the accumulated error in the target reasoning chain.
5. The large language model inference error correction method according to claim 1, characterized in that: Also includes: Determine whether the number of reasoning errors in the current target reasoning chain is less than a preset number threshold. If the number of reasoning errors in the current target reasoning chain is not less than the preset number threshold, delete the current target reasoning chain and jump to the step of using natural language processing technology to perform syntactic analysis on the question text content corresponding to the problem to be processed, so as to construct a new target reasoning chain corresponding to the problem to be processed.
6. The large language model inference error correction method according to any one of claims 1 to 5, characterized in that: After the target reasoning step is adjusted, the method further includes: Performing a preliminary verification on the mathematical rules in the adjusted reasoning steps, and re-adjusting the adjusted reasoning steps if the mathematical rules in the adjusted reasoning steps fail the preliminary verification; If the mathematical rules in the adjusted reasoning step pass the preliminary verification, the initial adjusted reasoning chain corresponding to the adjusted reasoning step is traversed in reverse order to globally verify the reasoning logic between all the reasoning steps in the initial adjusted reasoning chain; If the initial adjusted reasoning chain passes the global verification, the initial adjusted reasoning chain is determined as the target adjusted reasoning chain.
7. The large language model inference error correction method according to claim 6, characterized in that: After the target reasoning step is adjusted, the method further includes: Sending the target adjusted reasoning chain to a target user to obtain feedback information of the target user on the target adjusted reasoning chain; If the feedback information indicates that the reasoning chain after the target adjustment is unreasonable, the reasoning chain after the target adjustment is readjusted according to the adjustment advice in the feedback information.
8. A large language model reasoning error correction device, characterized in that: include: A question acquisition module, used to acquire the pending questions input to the target reasoning system; The target reasoning system is a mathematical reasoning system created based on a large language model, and the problem to be processed is a mathematical problem that needs to be solved by the mathematical reasoning system; A question analysis module is used to perform syntactic analysis on the question text content corresponding to the question to be processed using natural language processing technology to obtain text feature information corresponding to the question text content, and to perform format conversion on the question to be processed to obtain the corresponding target question; An inference chain construction module, used to construct an initial inference chain corresponding to the target problem based on the text feature information and the target problem, identify the first premise corresponding to each initial inference step in the initial inference chain, and construct a target inference chain corresponding to the target problem according to each first premise; wherein the first premise of any initial inference step is the inference result of the previous initial inference step corresponding to any initial inference step in the initial inference chain, the target inference chain is an inference chain constructed based on a directed acyclic graph, the nodes in the directed acyclic graph are the inference steps in the target inference chain, and the edges in the directed acyclic graph are the dependencies between the inference steps; An inference step adjustment module is used to detect each of the inference steps in the target inference chain to obtain the inference error in the target inference chain, determine the target inference step corresponding to the inference error from the target inference chain, and adjust the target inference step to correct the inference error of the preset large language model.
9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the large language model reasoning error correction method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: Used to store a computer program, which, when executed by a processor, implements the large language model reasoning error correction method as described in any one of claims 1 to 7.
Citation Information
Cited By
Mathematical formula processing method and device, computer equipment and readable storage medium
CN120449867A
Error-driven self-adaptive research process correction method and system
CN122363988A
An error-driven adaptive research process rectification method and system
CN122363988B