Visual Thinking Operating System for Mathematical Reasoning and Mathematical Reasoning Method

Through a visual thinking operating system for mathematical reasoning, combined with large language model and knowledge base search technology, the problem of opacity and insufficient verification of intermediate steps in the inference process of complex mathematical problems in the existing technology is solved, and a more accurate and transparent mathematical reasoning process is achieved.

CN119808967BActive Publication Date: 2025-05-30BEI JING BDA NETWORK &INFORMATION CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510301119.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-14
Publication Date
2025-05-30
Estimated Expiration
2045-03-14

AI Technical Summary

Technical Problem

The existing technology is difficult to demonstrate intermediate reasoning logic when solving complex mathematical problems, resulting in students being unable to observe and understand the reasoning process, and lacking real-time verification of intermediate steps, which is prone to error transmission and logic crashes.

Method used

It provides a visual thinking operating system for mathematical reasoning. It receives the mathematical problem description text input by the user through the human-computer interaction interface, performs keyword extraction and knowledge base search, combines large language models to generate multiple reasoning chains, determines overlapping steps and candidate key steps, performs verification, and finally outputs the optimal reasoning chain and answers.

Benefits of technology

It improves the accuracy of reasoning in mathematical problems, provides complete inference logic and real-time verification of intermediate steps, helping students better understand and master the mathematical reasoning process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119808967B_ABST
    Figure CN119808967B_ABST
Patent Text Reader

Abstract

The present invention provides a visual thinking operation system and a mathematical reasoning method for mathematical reasoning. By inputting the text description of a mathematical problem and its matching knowledge text into a large language model, multiple reasoning chains output by the model are obtained. Then, based on the multiple reasoning chains, overlapping steps that are consistent with the reasoning steps in other reasoning chains in each reasoning chain are determined. Candidate key steps are determined based on the overlapping steps, and the candidate key steps are verified. The candidate key steps that pass the verification are determined as key steps. Subsequently, knowledge texts matching the key steps are retrieved from a mathematical knowledge base based on the keywords in the key steps. The text description of the mathematical problem, the key steps, and their matching knowledge texts are input into the large language model to obtain the optimal reasoning chain output by the model. Finally, the final answer given in the optimal reasoning chain is verified, and after the verification passes, the optimal reasoning chain and the final answer are output, improving the reasoning accuracy of complex mathematical problems.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of automated reasoning, and particularly to a visual thinking operation system for mathematical reasoning and a mathematical reasoning method. Background Art

[0002] As a core means of educational assistance and scientific research analysis, the development of mathematical problem-solving tools has evolved from basic calculators to symbolic calculation systems. However, existing technologies (such as calculators, symbolic calculation software, and online problem-solving platforms) still have some drawbacks when implementing automated reasoning. For example, mainstream symbolic calculation tools and some AI problem-solving models can quickly output answers, but only show the final result or brief steps. Students cannot observe the intermediate reasoning logic (such as discriminant calculation, basis for theorem selection), resulting in "knowing the result but not knowing the reason", and it is difficult to meet the need of "step-by-step guiding thinking" in teaching scenarios. Students overly rely on tools and weaken their independent reasoning ability. In addition, existing systems usually only verify the final result, lack real-time monitoring of intermediate steps (such as not checking the risk of "dividing by zero"), and cannot automatically roll back the wrong path according to mathematical common sense (such as the sum of interior angles of a triangle is 180°). The error is passed to subsequent steps, leading to invalid calculations or even logical crashes. More importantly, for complex mathematical problems, existing problem-solving models (even large language models that are good at reasoning) will get stuck at a certain intermediate step and cannot continue reasoning, thus making it difficult to finally find the answer. Summary of the Invention

[0003] The present invention provides a visual thinking operation system for mathematical reasoning and a mathematical reasoning method to solve the defects in the prior art that it is difficult to solve complex mathematical problems and lacks intermediate reasoning logic and intermediate verification.

[0004] The present invention provides a visual thinking operation system for mathematical reasoning, including:

[0005] A human-computer interaction interface for receiving a text description of a mathematical problem input by a user;

[0006] A text processing module for extracting keywords from the text description of the mathematical problem to obtain the keywords therein, and retrieving a mathematical knowledge base based on the keywords to obtain a knowledge text matching the text description of the mathematical problem;

[0007] A first mathematical reasoning module for inputting the text description of the mathematical problem and its matching knowledge text into a large language model to obtain multiple reasoning chains output by the large language model; any one of the reasoning chains includes multiple reasoning steps for the text description of the mathematical problem;

[0008] A key step extraction module, which is used to determine, based on the multiple inference chains, the overlapping steps in each inference chain that are consistent with the inference steps in other inference chains, determine candidate key steps based on the overlapping steps, and verify the candidate key steps to determine that the candidate key steps that pass the verification are key steps;

[0009] A second mathematical reasoning module, which is used to retrieve a mathematical knowledge base based on the keywords in the key steps to obtain knowledge texts matching the key steps, and input the mathematical problem description text, the key steps, and their matching knowledge texts into a large language model to obtain the optimal inference chain output by the large language model;

[0010] An inference result output module, which is used to verify based on the final answer given in the optimal inference chain, and output the optimal inference chain and the final answer after the verification passes.

[0011] According to a visual thinking operation system for mathematical reasoning provided by the present invention, determining a number of overlapping steps based on the multiple inference chains, and determining candidate key steps based on the number of overlapping steps, includes:

[0012] For each token in any inference step of any inference chain, and construct a semantic vector of the any inference step based on the TF-IDF value of each token in the any inference step;

[0013] If the similarity between the semantic vectors of multiple inference steps from different inference chains is greater than a preset threshold, then mark the multiple inference steps from different inference chains as overlapping steps, and combine the multiple inference steps from different inference chains into an overlapping step set; there is one or more overlapping step sets;

[0014] Screen candidate key steps based on the overlapping step set; there are 0 or 1 candidate key steps in the same overlapping step set.

[0015] According to a visual thinking operation system for mathematical reasoning provided by the present invention, screening candidate key steps based on the overlapping step set includes:

[0016] Obtain the inference steps with the deepest depth that are marked as overlapping steps in each inference chain, construct a set of steps to be processed, and construct an empty set of steps to be deleted;

[0017] Execute an inference step screening method for each inference step in the set of steps to be processed to obtain an updated set of steps to be deleted, and determine candidate key steps based on the difference set between the set of steps to be processed and the updated set of steps to be deleted;

[0018] Among them, the inference step screening method performed for any inference step in the set of steps to be processed includes:

[0019] Discrimination step: Determine whether the current inference step is in the set of steps to be deleted; if the current inference step is in the set of steps to be deleted, then jump to the iteration step; if any inference step is in the set of steps to be deleted, then end the current inference step screening method; if neither the current inference step nor any inference step is in the set of steps to be deleted, then determine the steps to be deleted based on the current inference step and any inference step, and add the steps to be deleted to the set of steps to be deleted when the steps to be deleted are not empty; initially, the current inference step is the next inference step of any inference step in the set of steps to be processed.

[0020] Iteration step: Determine the next inference step of the current inference step in the set of steps to be processed as the new current inference step, and jump to the discrimination step.

[0021] According to a visual thinking operation system for mathematical reasoning provided by the present invention, determining the steps to be deleted based on the current inference step and any inference step includes:

[0022] If the current inference step and any inference step are in the same inference chain, then determine the inference step with a shallower depth as the steps to be deleted.

[0023] Otherwise, determine that the steps to be deleted are empty.

[0024] According to a visual thinking operation system for mathematical reasoning provided by the present invention, verifying the candidate key steps includes:

[0025] Verifying the candidate key steps based on a large language model.

[0026] The present invention also provides a mathematical reasoning method based on the visual thinking operation system as described in any one of the above, including:

[0027] Receiving a mathematical problem description text input by a user.

[0028] Extracting keywords from the mathematical problem description text to obtain the keywords therein, and retrieving a mathematical knowledge base based on the keywords to obtain a knowledge text matching the mathematical problem description text.

[0029] Inputting the mathematical problem description text and its matching knowledge text into a large language model to obtain multiple inference chains output by the large language model; any inference chain includes multiple inference steps for the mathematical problem description text.

[0030] Based on the multiple inference chains, determine the overlapping steps in each inference chain that are consistent with the inference steps in other inference chains. Based on the overlapping steps, determine the candidate key steps, and verify the candidate key steps to determine that the candidate key steps that pass the verification are the key steps;

[0031] Retrieve the mathematical knowledge base based on the keywords in the key steps to obtain the knowledge text matched by the key steps, and input the mathematical problem description text, the key steps, and their matched knowledge text into the large language model to obtain the optimal inference chain output by the large language model;

[0032] Verify based on the final answer given in the optimal inference chain, and output the optimal inference chain and the final answer after the verification passes.

[0033] According to a mathematical reasoning method provided by the present invention, the determining a plurality of overlapping steps based on the multiple inference chains and determining candidate key steps based on the plurality of overlapping steps includes:

[0034] For each token in any inference step of any inference chain, and construct a semantic vector of the any inference step based on the TF-IDF value of each token in the any inference step;

[0035] If the similarity between the semantic vectors of multiple inference steps from different inference chains is greater than a preset threshold, mark the multiple inference steps from different inference chains as overlapping steps, and combine the multiple inference steps from different inference chains into an overlapping step set; there is one or more overlapping step sets;

[0036] Screen candidate key steps based on the overlapping step sets; there are 0 or 1 candidate key steps in the same overlapping step set.

[0037] According to a mathematical reasoning method provided by the present invention, the screening candidate key steps based on the overlapping step sets includes:

[0038] Obtain the inference steps that are marked as overlapping steps and have the deepest depth in each inference chain, construct a set of steps to be processed, and construct an empty set of steps to be deleted;

[0039] Execute an inference step screening method for each inference step in the set of steps to be processed to obtain an updated set of steps to be deleted, and determine candidate key steps based on the difference set between the set of steps to be processed and the updated set of steps to be deleted;

[0040] Among them, the inference step screening method executed for any inference step in the set of steps to be processed includes:

[0041] Discrimination step: Determine whether the current inference step is in the set of steps to be deleted; if the current inference step is in the set of steps to be deleted, jump to the iteration step; if any of the inference steps is in the set of steps to be deleted, end the current inference step screening method; if neither the current inference step nor any of the inference steps is in the set of steps to be deleted, determine the steps to be deleted based on the current inference step and any of the inference steps, and add the steps to be deleted to the set of steps to be deleted when the steps to be deleted are not empty; initially, the current inference step is the next inference step of any of the inference steps in the set of steps to be processed.

[0042] Iteration step: Determine the next inference step of the current inference step in the set of steps to be processed as the new current inference step.

[0043] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the program, it implements the mathematical inference method as described in any one of the above.

[0044] The present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the mathematical inference method as described in any one of the above.

[0045] The present invention also provides a computer program product, including a computer program, and when the computer program is executed by a processor, it implements the mathematical inference method as described in any one of the above.

[0046] The visual thinking operation system and mathematical reasoning method for mathematical reasoning provided by the present invention receive the text description of the mathematical problem input by the user through the human-computer interaction interface, extract keywords from the text description of the mathematical problem through the text processing module to obtain the keywords therein, and retrieve the mathematical knowledge base based on the keywords to obtain the knowledge text matching the text description of the mathematical problem. Then, the first mathematical reasoning module inputs the text description of the mathematical problem and its matching knowledge text into the large language model to obtain multiple inference chains output by the large language model. Furthermore, the key step extraction module determines the overlapping steps in each inference chain that are consistent with the inference steps in other inference chains based on the multiple inference chains, determines the candidate key steps based on the overlapping steps, and verifies the candidate key steps to determine that the candidate key steps passing the verification are the key steps. Subsequently, the second mathematical reasoning module retrieves the mathematical knowledge base based on the keywords in the key steps to obtain the knowledge text matching the key steps, and inputs the text description of the mathematical problem, the key steps, and their matching knowledge text into the large language model to obtain the optimal inference chain output by the large language model. Finally, the inference result output module verifies based on the final answer given in the optimal inference chain and outputs the optimal inference chain and the final answer after the verification passes, improving the inference accuracy of mathematical problems, especially complex mathematical problems, and providing a complete inference logic and verification for the intermediate inference steps and the final result. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the technical solutions in 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 some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0048] Figure 1 It is a schematic structural diagram of the visual thinking operation system for mathematical reasoning provided by the present invention;

[0049] Figure 2 It is a schematic flowchart of the method for determining candidate key steps provided by the present invention;

[0050] Figure 3 It is a schematic flowchart of the mathematical reasoning method provided by the present invention;

[0051] Figure 4 It is a schematic structural diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0052] To make the objectives, technical solutions, and advantages of the present invention clearer, the following will clearly and completely describe the technical solutions in the present invention in conjunction with the accompanying drawings in the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present invention without creative efforts belong to the scope of protection of the present invention.

[0053] Figure 1 is a schematic structural diagram of a visual thinking operation system for mathematical reasoning provided by the present invention, as Figure 1 shown, the system includes:

[0054] A human-computer interaction interface 110 for receiving a text description of a mathematical problem input by a user;

[0055] A text processing module 120 for extracting keywords from the text description of the mathematical problem to obtain the keywords therein, and retrieving a mathematical knowledge base based on the keywords to obtain a knowledge text matching the text description of the mathematical problem;

[0056] A first mathematical reasoning module 130 for inputting the text description of the mathematical problem and its matching knowledge text into a large language model to obtain multiple reasoning chains output by the large language model; any one of the reasoning chains includes multiple reasoning steps for the text description of the mathematical problem;

[0057] A key step extraction module 140 for determining, based on the multiple reasoning chains, overlapping steps in each reasoning chain that are consistent with the reasoning steps in other reasoning chains, determining candidate key steps based on the overlapping steps, and verifying the candidate key steps to determine that the candidate key steps that pass the verification are key steps;

[0058] A second mathematical reasoning module 150 for retrieving a mathematical knowledge base based on the keywords in the key steps to obtain a knowledge text matching the key steps, and inputting the text description of the mathematical problem, the key steps, and their matching knowledge text into a large language model to obtain an optimal reasoning chain output by the large language model;

[0059] A reasoning result output module 160 for verifying the final answer given in the optimal reasoning chain, and outputting the optimal reasoning chain and the final answer after the verification passes.

[0060] Here, by setting up a human-computer interaction interface, the text description of the mathematical problem input by the user can be received from this interface. Subsequently, the text processing module will extract keywords from the text description of the mathematical problem input by the user to obtain several keywords in this text, and thus retrieve the pre-constructed mathematical knowledge base based on these keywords. The retrieved result can be used as the knowledge text that matches the text description of the mathematical problem.

[0061] In some embodiments, the mathematical knowledge base contains two types of nodes: concept nodes and theorem nodes. Among them, the concept nodes correspond to basic mathematical concepts, such as the basic elements in trigonometry, such as sin 3 x and cos x. The theorem nodes represent mathematical propositions or axioms, such as cosπ / 2 = 0. The edges between the nodes represent the directional or dependency relationships between the concept nodes or theorem nodes. That is, the mathematical knowledge base can be regarded as a directed graph. The connection edges in the mathematical knowledge base have four types: (1) Dependency connection, indicating that one node depends on another node. For example, the connection from the sin x node to tanx = sin x / cos x represents the dependence of the latter on sin x; (2) Derivation connection, representing the derivation relationship from one node to another node (derivation). For example, the connection from sin x to sin 3x = 3sin x − 4sin 3 x indicates that the latter is derived from the former; (3) Application connection, which is used when a certain node is used to infer a specific instance. For example, the connection from cos x to cos (π / 2 ) = 0 represents the application of cos x in a specific scenario; (4) Identity transformation connection, indicating how one node is transformed into another node that is essentially the same, such as tan x to tan x = sin x / cos x. When retrieving the mathematical knowledge base based on several keywords, the concept nodes matching the keywords can be retrieved first, and according to the connection edges of the above four relationships contained in the mathematical knowledge base, other concept nodes and theorem nodes connected to the above concept nodes can be retrieved, and the node contents of the other concept nodes and theorem nodes connected to the above concept nodes can be obtained to construct the corresponding retrieval results.

[0062] The first mathematical reasoning module combines the mathematical problem description text and its matching knowledge text into a prompt and inputs it into the large language model. The prompt contains requirements for the output data of the large language model, such as "output step by step", so as to obtain multiple reasoning chains output by the large language model. Among them, any one reasoning chain contains multiple reasoning steps for the mathematical problem description text, and each reasoning chain is relatively independent, that is, each reasoning chain corresponds to an independent problem-solving idea. It can be seen that there is a sequential order among the multiple reasoning steps in the same reasoning chain. Subsequently, the sequence number of the reasoning step will be used as the depth of the corresponding reasoning step.

[0063] Subsequently, the key step extraction module determines the overlapping steps in each reasoning chain that are consistent with the reasoning steps in other reasoning chains based on the multiple reasoning chains. Here, considering that for the same math problem, no matter what problem-solving idea is adopted, in order to accurately solve the problem, different problem-solving ideas will converge on some key intermediate reasoning steps, that is, the key links among them may be the same. Therefore, using these key intermediate reasoning steps can guide the reasoning process of the large language model, so as to obtain the correct problem-solving idea and overcome the problem that the reasoning process of the existing large language model or other problem-solving models is prone to interruption or deviation when facing complex math problems. It should be noted that there may be multiple different sets of overlapping steps in the multiple reasoning chains, and each set of overlapping steps contains reasoning steps with consistent reasoning content from different reasoning chains. For this situation, if the reasoning steps from different sets of overlapping steps are directly input as prompts into the large language model, since there may still be a derivation relationship among the reasoning steps from different sets of overlapping steps, it may lead to information redundancy and instead reduce the reasoning efficiency of the large language model. Therefore, candidate key steps can be determined based on the overlapping steps obtained above, and the candidate key steps can be verified, and then the candidate key steps that pass the verification are determined as the key steps. This method can not only select more critical intermediate reasoning steps for a specific math problem from the above different sets of overlapping steps, but also insert a verification process in the intermediate link of the entire reasoning chain to ensure the correctness of the key steps, thereby improving the accuracy rate of the entire reasoning process, which is particularly important for complex math problems.

[0064] In some embodiments, when verifying the candidate key steps, the candidate key steps and the mathematical problem description text can be input into the large language model together, and the large language model is allowed to verify the candidate key steps.

[0065] In some embodiments, as Figure 2 shown, based on the multiple reasoning chains, determining several overlapping steps, and determining candidate key steps based on the several overlapping steps, includes the following steps:

[0066] Step 210: For each term in any inference step of any inference chain, calculate the TF-IDF value of each term, and construct a semantic vector of the any inference step based on the TF-IDF values of each term in the any inference step.

[0067] Step 220: If the similarity between the semantic vectors of multiple inference steps from different inference chains is greater than a preset threshold, then mark the multiple inference steps from different inference chains as overlapping steps, and combine the multiple inference steps from different inference chains into an overlapping step set; there is one or more overlapping step sets.

[0068] Step 230: Screen candidate key steps based on the overlapping step set; there are 0 or 1 candidate key steps in the same overlapping step set.

[0069] Here, for any inference step in any inference chain, obtain the TF-IDF value of each term in this inference step, and then splice and combine the TF-IDF values of each term in this inference step to obtain the semantic vector of this inference step. Repeating the above process, the semantic vectors of each inference step in each inference chain can be obtained. Subsequently, calculate the similarity between the semantic vectors of the inference steps from different inference chains. If the similarity between the semantic vectors of multiple inference steps from different inference chains is greater than a preset threshold, then mark the multiple inference steps from different inference chains as overlapping steps, and then combine these multiple inference steps from different inference chains into an overlapping step set. As shown above, there may be one or more overlapping step sets, and the inference contents of the inference steps in the same overlapping step set are the same. Then, screen candidate key steps based on the above overlapping step set. Among them, there may be only 1 candidate key step or no candidate key step in the same overlapping step set.

[0070] In some other embodiments, in order to screen out key steps from the overlapping step set, it is possible to obtain the inference step with the deepest depth that is marked as an overlapping step in each inference chain, construct a set of steps to be processed, and construct an empty set of steps to be deleted. That is, for any inference chain, first obtain all the inference steps that are marked as overlapping steps in this inference chain, and then select the inference step with the deepest depth and place it in the set of steps to be processed. Then, repeat the above process for all inference chains to obtain the final set of steps to be processed. Perform an inference step screening method for each inference step in the set of steps to be processed to obtain an updated set of steps to be deleted, and based on the difference set between the set of steps to be processed and the updated set of steps to be deleted, determine the inference steps in this difference set as candidate key steps.

[0071] Among them, the inference step screening method performed for any inference step i in the set of steps to be processed includes:

[0072] Discrimination step: Determine whether the current inference step j is in the set of steps to be deleted; if the current inference step j is in the set of steps to be deleted, then jump to the iteration step; if the inference step i is in the set of steps to be deleted, then end the current inference step screening method; if neither the current inference step j nor the inference step i is in the set of steps to be deleted, then determine the steps to be deleted based on the current inference step j and the inference step i, and add the steps to be deleted to the set of steps to be deleted when the steps to be deleted are not empty; in some embodiments, if the current inference step j and the inference step i are in the same inference chain, then determine the inference step with a shallower depth as the step to be deleted; otherwise, determine that the steps to be deleted are empty; it should be noted that initially, the current inference step j is the next inference step of the inference step i in the set of steps to be processed.

[0073] Iteration step: Determine the next inference step of the current inference step j in the set of steps to be processed as the new current inference step j, and jump to the discrimination step.

[0074] After the key step extraction model obtains the key steps, the second mathematical reasoning module retrieves the mathematical knowledge base based on the keywords in the key steps, obtains the knowledge text matched by the key steps, and inputs the mathematical problem description text, key steps, and the knowledge text matched by the key steps into the large language model to obtain the optimal inference chain output by the large language model. It should be noted that there may be multiple optimal inference chains here, or the large language model can be controlled by prompt to output only one optimal inference chain, and the embodiments of the present invention do not make specific limitations on this.

[0075] Subsequently, the inference result output module can verify based on the final answer given in the optimal inference chain, and output the optimal inference chain and the above-mentioned final answer after the verification passes.

[0076] In summary, the system provided by the embodiments of the present invention receives the text description of the mathematical problem input by the user through the human-computer interaction interface, extracts keywords from the text description of the mathematical problem through the text processing module to obtain the keywords therein, and retrieves the mathematical knowledge base based on the keywords to obtain the knowledge text matching the text description of the mathematical problem. Then, through the first mathematical reasoning module, the text description of the mathematical problem and its matching knowledge text are input into the large language model to obtain multiple inference chains output by the large language model. Furthermore, through the key step extraction module, based on the multiple inference chains, the overlapping steps that are consistent with the inference steps in other inference chains in each inference chain are determined, the candidate key steps are determined based on the overlapping steps, and the candidate key steps are verified to determine that the candidate key steps that pass the verification are the key steps. Then, the second mathematical reasoning module is used to retrieve the mathematical knowledge base based on the keywords in the key steps to obtain the knowledge text matching the key steps, and the text description of the mathematical problem, the key steps, and their matching knowledge text are input into the large language model to obtain the optimal inference chain output by the large language model. Finally, the inference result output module verifies based on the final answer given in the optimal inference chain and outputs the optimal inference chain and the final answer after the verification passes, improving the inference accuracy of mathematical problems, especially complex mathematical problems, and providing a complete inference logic and verification for the intermediate inference steps and the final result.

[0077] The mathematical reasoning method provided by the present invention will be described below. The mathematical reasoning method described below can be mutually corresponding and referred to with the visual thinking operation system for mathematical reasoning described above.

[0078] Based on any of the above embodiments, Figure 3 is a schematic flowchart of the mathematical reasoning method provided by the present invention. As Figure 3 shown, the method includes:

[0079] Step 310, receiving the text description of the mathematical problem input by the user;

[0080] Step 320, extracting keywords from the text description of the mathematical problem to obtain the keywords therein, and retrieving the mathematical knowledge base based on the keywords to obtain the knowledge text matching the text description of the mathematical problem;

[0081] Step 330, inputting the text description of the mathematical problem and its matching knowledge text into the large language model to obtain multiple inference chains output by the large language model; any inference chain includes multiple inference steps for the text description of the mathematical problem;

[0082] Step 340: Based on the multiple inference chains, determine the overlapping steps in each inference chain that are consistent with the inference steps in other inference chains. Based on the overlapping steps, determine candidate key steps, and verify the candidate key steps to determine that the candidate key steps that pass the verification are the key steps;

[0083] Step 350: Retrieve the mathematical knowledge base based on the keywords in the key steps to obtain the knowledge text matching the key steps, and input the mathematical problem description text, the key steps, and their matching knowledge text into the large language model to obtain the optimal inference chain output by the large language model;

[0084] Step 360: Verify based on the final answer given in the optimal inference chain, and output the optimal inference chain and the final answer after the verification passes.

[0085] The method provided by the embodiment of the present invention receives the mathematical problem description text input by the user through the human-computer interaction interface, extracts the keywords from the mathematical problem description text through the text processing module to obtain the keywords therein, and retrieves the mathematical knowledge base based on the keywords to obtain the knowledge text matching the mathematical problem description text. Then, the first mathematical inference module inputs the mathematical problem description text and its matching knowledge text into the large language model to obtain multiple inference chains output by the large language model. Furthermore, the key step extraction module determines the overlapping steps in each inference chain that are consistent with the inference steps in other inference chains based on the multiple inference chains, determines candidate key steps based on the overlapping steps, and verifies the candidate key steps to determine that the candidate key steps that pass the verification are the key steps. Subsequently, the second mathematical inference module retrieves the mathematical knowledge base based on the keywords in the key steps to obtain the knowledge text matching the key steps, and inputs the mathematical problem description text, the key steps, and their matching knowledge text into the large language model to obtain the optimal inference chain output by the large language model. Finally, the inference result output module verifies based on the final answer given in the optimal inference chain, and outputs the optimal inference chain and the final answer after the verification passes, improving the inference accuracy of mathematical problems, especially complex mathematical problems, and providing a complete inference logic and verification for the intermediate inference steps and the final result.

[0086] Based on any of the above embodiments, the determining a plurality of overlapping steps based on the multiple inference chains and determining candidate key steps based on the plurality of overlapping steps includes:

[0087] For each token in any inference step of any inference chain, and construct a semantic vector of the any inference step based on the TF-IDF value of each token in the any inference step;

[0088] If the similarity between the semantic vectors of multiple reasoning steps from different reasoning chains is greater than a preset threshold, then mark the multiple reasoning steps from different reasoning chains as overlapping steps, and combine the multiple reasoning steps from different reasoning chains into an overlapping step set; there is one or more overlapping step sets;

[0089] Screen candidate key steps based on the overlapping step set; there are 0 or 1 candidate key steps in the same overlapping step set.

[0090] Based on any of the above embodiments, the screening of candidate key steps based on the overlapping step set includes:

[0091] Obtain the reasoning step with the deepest depth that is marked as an overlapping step in each reasoning chain, construct a set of steps to be processed, and construct an empty set of steps to be deleted;

[0092] Execute a reasoning step screening method for each reasoning step in the set of steps to be processed, obtain an updated set of steps to be deleted, and determine candidate key steps based on the difference set between the set of steps to be processed and the updated set of steps to be deleted;

[0093] Among them, the reasoning step screening method executed for any reasoning step in the set of steps to be processed includes:

[0094] Discrimination step: Determine whether the current reasoning step is in the set of steps to be deleted; if the current reasoning step is in the set of steps to be deleted, then jump to the iteration step; if any of the reasoning steps is in the set of steps to be deleted, then end the current reasoning step screening method; if neither the current reasoning step nor any of the reasoning steps is in the set of steps to be deleted, then determine the steps to be deleted based on the current reasoning step and any of the reasoning steps, and add the steps to be deleted to the set of steps to be deleted when the steps to be deleted are not empty; initially, the current reasoning step is the next reasoning step of any of the reasoning steps in the set of steps to be processed;

[0095] Iteration step: Determine the next reasoning step of the current reasoning step in the set of steps to be processed as the new current reasoning step, and jump to the discrimination step.

[0096] Based on any of the above embodiments, the determination of the steps to be deleted based on the current reasoning step and any of the reasoning steps includes:

[0097] If the current reasoning step and any of the reasoning steps are in the same reasoning chain, then determine the reasoning step with a shallower depth as the steps to be deleted;

[0098] Otherwise, determine that the steps to be deleted are empty.

[0099] Based on any of the above embodiments, the verification of the candidate key steps includes:

[0100] Verifying the candidate key steps based on a large language model.

[0101] Figure 4 is a schematic structural diagram of an electronic device provided by the present invention. As Figure 4 shown, the electronic device may include: a processor 410, a memory 420, a communication interface 430, and a communication bus 440. Among them, the processor 410, the memory 420, and the communication interface 430 communicate with each other through the communication bus 440. The processor 410 can call the logical instructions in the memory 420 to execute a mathematical reasoning method, which includes: receiving a text description of a mathematical problem input by a user; extracting keywords from the text description of the mathematical problem to obtain the keywords therein, and retrieving a mathematical knowledge base based on the keywords to obtain a knowledge text matching the text description of the mathematical problem; inputting the text description of the mathematical problem and its matching knowledge text into a large language model to obtain multiple inference chains output by the large language model; any inference chain includes multiple inference steps for the text description of the mathematical problem; based on the multiple inference chains, determining overlapping steps in each inference chain that are consistent with the inference steps in other inference chains, determining candidate key steps based on the overlapping steps, and verifying the candidate key steps to determine the candidate key steps that pass the verification as key steps; retrieving a mathematical knowledge base based on the keywords in the key steps to obtain a knowledge text matching the key steps, and inputting the text description of the mathematical problem, the key steps, and their matching knowledge text into the large language model to obtain the optimal inference chain output by the large language model; verifying based on the final answer given in the optimal inference chain, and outputting the optimal inference chain and the final answer after the verification passes.

[0102] In addition, when the logical instructions in the above-mentioned memory 420 are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs.

[0103] On the other hand, the present invention also provides a computer program product. The computer program product includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the mathematical reasoning method provided by the above-mentioned various methods. The method includes: receiving a text description of a mathematical problem input by a user; extracting keywords from the text description of the mathematical problem to obtain the keywords therein, and retrieving a mathematical knowledge base based on the keywords to obtain a knowledge text matching the text description of the mathematical problem; inputting the text description of the mathematical problem and its matching knowledge text into a large language model to obtain multiple inference chains output by the large language model; any one of the inference chains includes multiple inference steps for the text description of the mathematical problem; based on the multiple inference chains, determining overlapping steps that are consistent with the inference steps in other inference chains in each inference chain, determining candidate key steps based on the overlapping steps, and verifying the candidate key steps to determine the candidate key steps that pass the verification as key steps; retrieving a mathematical knowledge base based on the keywords in the key steps to obtain a knowledge text matching the key steps, and inputting the text description of the mathematical problem, the key steps, and their matching knowledge text into the large language model to obtain the optimal inference chain output by the large language model; verifying based on the final answer given in the optimal inference chain, and outputting the optimal inference chain and the final answer after the verification passes.

[0104] In another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the mathematical reasoning method provided above. The method includes: receiving a text description of a mathematical problem input by a user; extracting keywords from the text description of the mathematical problem to obtain the keywords therein, and retrieving a mathematical knowledge base based on the keywords to obtain a knowledge text matching the text description of the mathematical problem; inputting the text description of the mathematical problem and its matching knowledge text into a large language model to obtain multiple inference chains output by the large language model; any one of the inference chains includes multiple inference steps for the text description of the mathematical problem; based on the multiple inference chains, determining overlapping steps in each inference chain that are consistent with the inference steps in other inference chains, determining candidate key steps based on the overlapping steps, and verifying the candidate key steps to determine the candidate key steps that pass the verification as key steps; retrieving a mathematical knowledge base based on the keywords in the key steps to obtain a knowledge text matching the key steps, and inputting the text description of the mathematical problem, the key steps, and their matching knowledge text into the large language model to obtain the optimal inference chain output by the large language model; verifying the final answer given in the optimal inference chain, and outputting the optimal inference chain and the final answer after the verification passes.

[0105] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. A person of ordinary skill in the art can understand and implement it without creative effort.

[0106] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution, in essence, or the part that contributes to the prior art can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0107] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A visual thinking operating system for mathematical reasoning, characterized in that: include: A human-computer interaction interface for receiving a mathematical problem description text input by a user; A text processing module is used to extract keywords from the mathematical problem description text to obtain keywords therein, and search a mathematical knowledge base based on the keywords to obtain knowledge text matching the mathematical problem description text; A first mathematical reasoning module is used to input the mathematical problem description text and its matching knowledge text into a large language model to obtain multiple reasoning chains output by the large language model; any reasoning chain includes multiple reasoning steps for the mathematical problem description text; A key step extraction module is used to determine, based on the multiple reasoning chains, overlapping steps in each reasoning chain that are consistent with reasoning steps in other reasoning chains, determine candidate key steps based on the overlapping steps, and verify the candidate key steps to determine the verified candidate key steps as key steps; A second mathematical reasoning module is used to search a mathematical knowledge base based on the keywords in the key steps to obtain the knowledge text matching the key steps, and input the mathematical problem description text, the key steps and the knowledge text matching them into a large language model to obtain an optimal reasoning chain output by the large language model; The reasoning result output module is used to verify the final answer given in the optimal reasoning chain, and output the optimal reasoning chain and the final answer after the verification is passed.

2. The visual thinking operating system for mathematical reasoning according to claim 1 is characterized in that: The determining of a plurality of overlapping steps based on the plurality of reasoning chains, and determining candidate key steps based on the plurality of overlapping steps, comprises: For each word segment in any reasoning step of any reasoning chain, a TF-IDF value is calculated, and a semantic vector of any reasoning step is constructed based on the TF-IDF value of each word segment in any reasoning step; If the similarity between the semantic vectors of multiple reasoning steps from different reasoning chains is greater than a preset threshold, the multiple reasoning steps from different reasoning chains are marked as overlapping steps, and the multiple reasoning steps from different reasoning chains are combined into an overlapping step set; the overlapping step set has one or more; The candidate key steps are screened based on the overlapping step set; there are 0 or 1 candidate key steps in the same overlapping step set.

3. The visual thinking operating system for mathematical reasoning according to claim 2 is characterized in that: The screening of candidate key steps based on the overlapping step set comprises: Obtain the reasoning steps marked as overlapping steps and having the deepest depth in each reasoning chain, construct a set of steps to be processed, and construct an empty set of steps to be deleted; Execute the reasoning step screening method for each reasoning step in the set of steps to be processed to obtain an updated set of steps to be deleted, and determine the candidate key steps based on the difference between the set of steps to be processed and the updated set of steps to be deleted; The method for selecting a reasoning step executed for any reasoning step in the set of steps to be processed includes: Discrimination step: determine whether the current reasoning step is in the set of steps to be deleted; if the current reasoning step is in the set of steps to be deleted, jump to the iteration step; if any of the reasoning steps is in the set of steps to be deleted, end the current reasoning step screening method; if neither the current reasoning step nor any of the reasoning steps is in the set of steps to be deleted, determine the step to be deleted based on the current reasoning step and any of the reasoning steps, and add the step to be deleted to the set of steps to be deleted when the step to be deleted is not empty; initially, the current reasoning step is the next reasoning step of any of the reasoning steps in the set of steps to be processed; Iteration step: determine the next reasoning step of the current reasoning step in the set of steps to be processed as the new current reasoning step, and jump to the determination step.

4. The visual thinking operating system for mathematical reasoning according to claim 3 is characterized in that: The step of determining the step to be deleted based on the current reasoning step and any of the reasoning steps comprises: If the current reasoning step and any of the reasoning steps are in the same reasoning chain, determining the reasoning step with a shallower depth as the step to be deleted; Otherwise, it is determined that the step to be deleted is empty.

5. The visual thinking operating system for mathematical reasoning according to claim 1 is characterized in that: The verifying of the candidate key steps includes: The candidate key steps are verified based on a large language model.

6. A mathematical reasoning method based on the visual thinking operating system according to any one of claims 1 to 5, characterized in that: include: Receive the mathematical problem description text input by the user; Perform keyword extraction on the mathematical problem description text to obtain keywords therein, and search a mathematical knowledge base based on the keywords to obtain knowledge text matching the mathematical problem description text; Inputting the mathematical problem description text and the matching knowledge text into a large language model to obtain multiple reasoning chains output by the large language model; any reasoning chain includes multiple reasoning steps for the mathematical problem description text; Based on the multiple reasoning chains, determining overlapping steps in each reasoning chain that are consistent with reasoning steps in other reasoning chains, determining candidate key steps based on the overlapping steps, and verifying the candidate key steps to determine the verified candidate key steps as key steps; Based on the keywords in the key steps, a mathematical knowledge base is searched to obtain knowledge texts matching the key steps, and the mathematical problem description text, the key steps and the knowledge texts matching the key steps are input into a large language model to obtain an optimal reasoning chain output by the large language model; Verification is performed based on the final answer given in the optimal reasoning chain, and the optimal reasoning chain and the final answer are output after the verification passes.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the mathematical reasoning method as claimed in claim 6 is implemented.

8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the mathematical reasoning method according to claim 6 is implemented.

Citation Information

Patent Citations

  • Generation method and device of thinking chain expansion data based on large language model

    CN117217202A

  • Document question and answer method based on multi-granularity mixed retrieval and verification editing reasoning framework

    CN117435713A