Intelligent solution method, system, device and medium for complex reasoning problems

By introducing a coarse-grained-fine-grained large-language model inference paradigm in the answers to complex inference problems, combined with the circular process of decomposition, analysis and reflection, the problem of insufficient flexibility and logic in the answers to complex inference problems is solved, and a more efficient and interpretable inference process is achieved.

CN119067223BActive Publication Date: 2025-03-04UNIV OF SCI & TECH OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411564396.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-05
Publication Date
2025-03-04
Estimated Expiration
2044-11-05

AI Technical Summary

Technical Problem

The existing complex inference methods based on big model hints are insufficient in flexibility and logic, and it is difficult to effectively complete the task of answering complex inference problems.

Method used

A coarse-grained-fine-grained large-language model inference paradigm is proposed, including the circular process of the decomposition stage, the analysis stage and the reflection stage, and efficiently and accurately model the inference process of complex problems by constructing the final inference tree.

Benefits of technology

It improves the accuracy and efficiency of inference question-and-answer tasks, enhances interpretability, provides highly interpretable logical ideas for personalized online guidance, and has high educational and practical value.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119067223B_ABST
    Figure CN119067223B_ABST
Patent Text Reader

Abstract

The present invention discloses an intelligent solution method, system, device and medium for complex reasoning problems, which are one-to-one corresponding solutions. In the solution: a coarse-grained-fine-grained reasoning paradigm is proposed, and the final reasoning tree is constructed through a three-stage cycle: a decomposition stage, in which a complex problem is decomposed into multiple simple sub-problems, which helps to understand and deal with each sub-problem; an analysis stage, in which each sub-problem is deeply analyzed, a complete reasoning process is established, and their correctness and logic are evaluated and checked; a reflection stage, in which the entire problem-solving process is reviewed, possible errors or deficiencies in the problem-solving process are analyzed, and targeted corrections are provided. Through this cyclic process, the present invention can not only efficiently and accurately model the reasoning process of complex problems, but also improve the accuracy and efficiency in tasks related to reasoning question and answer, and can provide highly explainable problem-solving logic ideas for personalized online guidance, with high educational and practical value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of intelligent solutions to complex reasoning problems, and in particular to a method, system, device and medium for intelligent solutions to complex reasoning problems. Background Art

[0002] Complex reasoning problems, including commonsense reasoning, knowledge reasoning, mathematical reasoning, etc., are an important step towards achieving general artificial intelligence. This task is very challenging, mainly because it requires machines to have the ability to solve complex problems like humans, such as semantic understanding, abstract thinking, and logical reasoning. Therefore, the automated solution of complex reasoning problems is regarded as one of the core signs of achieving general artificial intelligence and an important direction for studying the application field of artificial intelligence.

[0003] At present, with the development of large language models (LLM), research on complex reasoning-related issues has achieved remarkable results. Some large language models (such as ChatGPT, LLaMA, ChatGLM, etc.) have performed close to or even surpassed humans in many natural language-based reasoning tasks. Among them, ChatGPT (Chat Generative Pre-trained Transformer) is a chat generative pre-trained transformer neural network model, LLaMA (Large Language Model Meta AI) is a large language model developed by Meta AI, and ChatGLM (Chat General Language Model) is a chat generative language model. Based on these large models, some prompting-based methods further enhance the complex reasoning capabilities of large models and become the optimal prompting strategy for current complex reasoning tasks. The main methods include:

[0004] (1) Prompt method based on Chain-of-Thoughts (CoT). Different from the traditional simple prompt method, this method adds a chain of thoughts described in natural language as an intermediate process of problem reasoning to further guide problem solving. The chain of thoughts can be manually constructed or automatically generated by a large model. The introduction of the chain of thoughts can enhance the multi-step reasoning ability of the large model and make the complex multi-step reasoning process more explainable.

[0005] (2) Prompt method based on the Tree-of-Thoughts (ToT). The Tree-of-Thoughts organizes and explores multiple reasoning paths in a tree structure, rather than generating a single reasoning path like a thought chain. This method can effectively expand the capabilities of the language model, thereby achieving more reasonable reasoning path planning. It incorporates various search algorithms such as BFS (Breadth First Search) and DFS (Depth-First Search), allowing the model to make decisions based on more diverse content during the decision-making process. This method helps to produce more refined and rational output steps.

[0006] (3) Graph-of-Thoughts (GoT)-based prompting method. The graph-of-thoughts (GoT) borrows the search-based prompting technology introduced in the mind tree, further pushing the boundaries of the prompting capabilities of large language models. Unlike the mind tree, the graph represents the information generated by the large model as a graph structure, introducing a more flexible and comprehensive representation. In addition, the graph also incorporates an extended set of thought transformation operations, making the modeling of the internal thought process of the language model richer and more diverse.

[0007] Among the above-mentioned methods based on large model prompts, mind trees and mind maps are far superior to mind chain-based methods and other prompt methods in many reasoning tasks, showing strong understanding and logical reasoning abilities. However, studies have found that mind trees and mind maps are essentially still a search-based reasoning paradigm, which is still a certain distance away from the actual human reasoning process, and to a certain extent hinders the ability of language models to solve problems. Specifically, it is mainly reflected in: on the one hand, this reasoning paradigm based on tree or graph structure search usually requires setting a fixed number of branches (the number of branches here refers to the number of branches of nodes on the tree or graph), which limits the flexibility of the tree or graph reasoning structure and is inconsistent with the human cognitive process; on the other hand, this reasoning paradigm generates reasoning paths sequentially, lacks evaluation and correction of previously generated content, and easily leads to the propagation of errors. The above reasons make the existing solutions unable to effectively complete the task of solving complex reasoning problems.

[0008] In view of this, the present invention is proposed. Summary of the invention

[0009] The purpose of the present invention is to provide an intelligent solution method, system, device and medium for complex reasoning problems, which can not only improve the accuracy and efficiency of reasoning question-answering related tasks, but also provide highly explainable problem-solving logic ideas for personalized online guidance, and have high educational and practical value.

[0010] The objective of the present invention is achieved through the following technical solutions:

[0011] An intelligent solution method for complex reasoning problems, including:

[0012] Initialize the root node of the reasoning tree using the target question, which contains the target question, the initialized reasoning process and the logic score;

[0013] The final reasoning tree is obtained through the following process: in the decomposition stage, the nodes in the reasoning tree are traversed. For the selected current node, if it is a root node, it is directly decomposed. If it is not a root node, the logical score is used to determine whether to decompose. If so, the problem contained in the current node is decomposed using the pre-built logical heuristic sample, and the sub-problems obtained by the decomposition are used to generate nodes and serve as the child nodes of the current node; in the analysis stage, the sub-problems are analyzed, the reasoning process is generated and checked, and the logical score is generated using the reasoning process after the check; in the reflection stage, the reasoning process of the problem in the previous node is updated using the reasoning process after the sub-problem is checked; the above three stages are repeated until no sub-problems can be decomposed and the final reasoning tree is obtained;

[0014] The final inference tree is used to generate an answer to the target question.

[0015] An intelligent solution system for complex reasoning problems, including:

[0016] An initialization unit, used to initialize the root node of the reasoning tree using the target question, the root node including the target question, and the initialized reasoning process and logic score;

[0017] The three-stage loop processing unit includes a decomposition unit, an analysis unit and a reflection unit, and is used to obtain the final reasoning tree through the following process: the decomposition unit is applied to the decomposition stage. In the decomposition stage, the nodes in the reasoning tree are traversed. For the selected current node, when it is a root node, it is directly decomposed. When it is not a root node, the logical score is used to determine whether to decompose. If so, the problem contained in the current node is decomposed using a pre-built logical heuristic example, and a node is generated using the sub-problem obtained by the decomposition and used as the child node of the current node; the analysis unit is applied to the analysis unit. In the analysis stage, the sub-problem is analyzed, the reasoning process is generated and checked, and the logical score is generated using the reasoning process after the check; the reflection unit is applied to the reflection stage. In the reflection stage, the reasoning process of the problem in the previous node is updated using the reasoning process after the sub-problem is checked; the above three stages are repeated until no sub-problems can be decomposed, and the final reasoning tree is obtained; wherein the current node includes the root node and the node generated in the decomposition stage;

[0018] The answer generation unit generates an answer to the target question using the final inference tree.

[0019] A processing device, comprising: one or more processors; a memory for storing one or more programs;

[0020] When the one or more programs are executed by the one or more processors, the one or more processors implement the aforementioned method.

[0021] A readable storage medium stores a computer program, which implements the above method when the computer program is executed by a processor.

[0022] It can be seen from the technical solution provided by the present invention that a new coarse-to-fine large language model reasoning paradigm is proposed, including a three-stage cycle: decomposition stage, analysis stage and reflection stage. The final reasoning tree is constructed through a three-stage cycle, which can efficiently and accurately model the complete process of complex problem reasoning and enhance interpretability; specifically: in the decomposition stage, complex problems are decomposed into multiple simple sub-problems, which helps to understand and deal with each sub-problem; in the analysis stage, each sub-problem is deeply analyzed to establish a complete problem-solving idea (i.e., reasoning process), and evaluate and check their correctness and logic; in the reflection stage, the entire problem-solving process is reviewed, the possible errors or deficiencies in the problem-solving process are analyzed, and targeted corrections are provided. Through this cycle, the present invention can not only improve the accuracy and efficiency of reasoning question-answering related tasks, but also provide highly interpretable problem-solving logic ideas for personalized online guidance, which has high educational and practical value. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.

[0024] Figure 1 A flowchart of an intelligent solution method for complex reasoning problems provided by an embodiment of the present invention;

[0025] Figure 2 A schematic diagram of an intelligent solution method for complex reasoning problems provided by an embodiment of the present invention;

[0026] Figure 3 A schematic diagram of a final inference tree example provided by an embodiment of the present invention;

[0027] Figure 4 An exemplary schematic diagram of the decomposition stage provided for an embodiment of the present invention;

[0028] Figure 5 An exemplary schematic diagram of the analysis phase provided for an embodiment of the present invention;

[0029] Figure 6 An exemplary schematic diagram of a reflection phase provided for an embodiment of the present invention;

[0030] Figure 7 A schematic diagram of an intelligent solution system for complex reasoning problems provided by an embodiment of the present invention;

[0031] Figure 8 A schematic diagram of a processing device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0032] The following is a clear and complete description of the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the protection scope of the present invention.

[0033] First, the terms that may be used in this article are explained as follows:

[0034] The terms "include", "comprises", "contains", "has" or other descriptions with similar semantics should be interpreted as non-exclusive inclusion. For example, including certain technical feature elements (such as raw materials, components, ingredients, carriers, dosage forms, materials, dimensions, parts, components, mechanisms, devices, steps, procedures, methods, reaction conditions, processing conditions, parameters, algorithms, signals, data, products or products, etc.) should be interpreted as including not only certain technical feature elements explicitly listed, but also other technical feature elements known in the art that are not explicitly listed.

[0035] The term "consisting of..." means excluding any technical feature elements not explicitly listed. If this term is used in a claim, it will make the claim closed, so that it does not contain technical feature elements other than the technical feature elements explicitly listed, except for the conventional impurities related to them. If this term only appears in a clause of a claim, it only limits the elements explicitly listed in the clause, and the elements recorded in other clauses are not excluded from the overall claim.

[0036] The following is a detailed description of an intelligent solution method, system, device and medium for complex reasoning problems provided by the present invention. The contents not described in detail in the embodiments of the present invention belong to the prior art known to professional and technical personnel in the field. If no specific conditions are specified in the embodiments of the present invention, the conventional conditions in the field or the conditions recommended by the manufacturer shall be followed.

[0037] Embodiment 1

[0038] The embodiment of the present invention provides an intelligent solution method for complex reasoning problems, such as Figure 1 As shown, it mainly includes the following steps:

[0039] Step 1: Initialize the inference tree.

[0040] In the embodiment of the present invention, the target question is used to initialize the root node of the reasoning tree, and the root node includes the target question, and the initialized reasoning process (for example, set to a null value) and the logical score (for example, set to zero).

[0041] Step 2: Obtain the final inference tree through a three-stage cyclic process.

[0042] (1) Decomposition stage: traverse the nodes in the reasoning tree. For the selected current node, if it is a root node, decomposition is performed directly. If it is not a root node, the logical score is used to determine whether to decompose. If so, the problem contained in the current node is decomposed using the pre-built logical heuristic example. The sub-problems obtained by the decomposition are used to generate nodes and serve as child nodes of the current node.

[0043] (2) Analysis phase: Analyze the sub-problems, generate and check the reasoning process, and use the checked reasoning process to generate a logical score.

[0044] (3) In the reflection phase, the reasoning process of the problem in the previous node is updated using the reasoning process of the sub-problem after inspection.

[0045] The above three stages are repeated until no sub-problems can be decomposed, and the final reasoning tree is obtained.

[0046] Step 3: Generate an answer to the target question using the final inference tree.

[0047] In the embodiment of the present invention, the reasoning process included in the root node of the final reasoning tree is the reasoning process of the target question, and the answer extracted therefrom is the answer to the target question.

[0048] The specific information contained in the target questions and sub-questions described in various locations of the present invention refers to the corresponding question texts.

[0049] The above scheme of the embodiment of the present invention proposes a new coarse-to-fine large language model reasoning paradigm. The paradigm includes a three-stage cycle: decomposition stage, analysis stage and reflection stage. A final reasoning tree is constructed through a three-stage cycle, which can efficiently and accurately model the complete process of complex problem reasoning and enhance interpretability. The decomposition stage is used to plan the reasoning steps, decompose the original problem (i.e., the target problem) into multiple sub-problems, and the decomposition process can achieve more reasonable step planning based on the constructed logical heuristic example. The analysis stage solves the sub-problems that have been decomposed, generates the reasoning process corresponding to each sub-problem, and then the reasoning process is self-checked by the model to see if there are errors, correct them in time, and obtain a logical score. The reflection stage will use the newly generated reasoning process and its score as the basis to determine whether the previously generated reasoning process needs to be updated or revised. If it needs to be revised, it will be changed to a more reasonable content. The present invention constructs the above three stages into a cyclic process, and finally constructs the solution process of complex reasoning problems into a final reasoning tree. The three-stage loop framework of the present invention effectively models the cognitive process of humans performing complex reasoning, which is closer to the goal of general artificial intelligence. It can also be used as a general framework to enhance the multi-step reasoning capabilities of a variety of basic models. It has important practical application value for realizing strong artificial intelligence. It can not only improve the accuracy and efficiency of reasoning question-answering related tasks, but also provide highly explainable problem-solving logic ideas for personalized online guidance, and has high educational and practical value.

[0050] In order to more clearly demonstrate the technical solution and technical effects provided by the present invention, the method provided by the embodiment of the present invention is described in detail with reference to specific embodiments below.

[0051] 1. Overall introduction of the plan.

[0052] The present invention can solve the problems of poor flexibility and logic of step planning in solving problems, as well as lack of reasonable evaluation and correction in the existing most advanced engineering technology based on large model prompts, thereby overcoming the shortcomings of the large gap with human-level artificial intelligence, and providing an intelligent solution method for complex reasoning problems. Inspired by cognitive science theory, when encountering complex reasoning problems, it is more inclined to decompose coarse-grained problems into more fine-grained sub-problems. This method can simplify the complexity of the problem and solve the problem more effectively. Therefore, a new coarse-grained-fine-grained large language model reasoning paradigm is proposed, and the three-stage cycle process of decomposition-analysis-reflection (Decompose-Analyze-Rethink) is organically coupled. A final reasoning tree is gradually constructed in a top-down manner to represent the problem-solving process, which helps to generate a reasoning process that is more in line with cognitive logic. At the same time, the generated content can be corrected in time to avoid error propagation, thereby improving the ability to solve complex reasoning problems.

[0053] Specifically: In order to solve the two gaps between the large language model and humans in solving complex reasoning problems mentioned above, based on the reasoning simplification theory in cognitive science theory, it tends to decompose coarse-grained complex problems into multiple fine-grained sub-problems to simplify reasoning, and proposes a coarse-grained-fine large language model reasoning paradigm for rationally planning the reasoning process and ultimately forming a reasoning tree that is more in line with the logical reasoning process. At the same time, the present invention combines the characteristics of solving specific problems at a deeper level to construct a three-stage cycle framework of decomposition-analysis-reflection (Decompose-Analyze-Rethink), which is organically coupled with the above-mentioned reasoning paradigm to enhance the accuracy and interpretability of the answer. The three-stage cycle of "decomposition-analysis-reflection" is generally: a) The decomposition stage aims to decompose an existing node in the reasoning tree into more "fine-grained" sub-problems and store them as child nodes. b) The analysis stage is mainly responsible for reasoning and evaluating the newly generated sub-problems, generating the solution process (Rationales) of the sub-problems and evaluating and checking their correctness and logic, and making timely corrections when necessary. c) The Rethink stage mainly uses the reasoning process contained in the newly generated child node to update the reasoning process of the previous node, so that the fine-grained steps can fully act on the coarse-grained steps and enhance the accuracy of the results.

[0054] Decompose: This stage is inspired by the analogical reasoning process and constructs logic heuristic examples (LogicHeuristics), which contain problem decomposition examples of various logical types to inspire the decomposition of a specific problem. After obtaining the logic heuristic examples using similarity clustering, these examples are constructed into specific natural language prompts and input to the base model so that it can refer to the problem decomposition methods in these examples to decompose the new problem. After decomposition, the more fine-grained sub-problems are stored in the child nodes of the new problem.

[0055] Analysis: In this stage, based on the sub-problems obtained in the decomposition stage, the base model is used to solve the sub-problems and obtain their specific solution processes (Rationales). At the same time, the present invention introduces a self-check and logic evaluation mechanism for each solution process, using the logic ability of the large language model itself to determine whether a generated explanation has factual, logical and other errors. If there are factual errors, the base model will make timely self-corrections to the errors. At the same time, the base model will also evaluate and score the logic of the solution process. The score is stored as part of the sub-problem node information and used for subsequent sub-problem decomposition and updating of the corresponding solution process of the sub-problem.

[0056] Rethink: This stage is the most important step in the present invention in imitating the cognitive process of human problem solving. Existing works often focus on solving problems in sequence, and the previous solution process only affects the subsequent steps. This is particularly evident in works such as mind trees or mind maps, but these works often ignore the fact that the subsequently generated content may also affect the previously generated content. In the actual cognitive reasoning process, it is often necessary to reflect on whether there are unreasonable parts in the generated parts based on the content of the subsequent solution, and then update the original content based on the newly generated content. In the present invention, this is specifically reflected in the reflection stage, that is, the solution process of the coarse-grained sub-problems is updated according to the solution process of the fine-grained sub-problems. Since fine-grained sub-problems are easier to solve and the solutions obtained are more accurate, the above method can effectively avoid error propagation and further improve the accuracy of reasoning.

[0057] Based on the above introduction, the complete process can be described as:

[0058] (1) Store the original question in the root node of the “inference tree” and set the solution process of the root node to an empty value.

[0059] (2) Entering the decomposition stage, if the node is a root node, it is directly decomposed. If it is not a root node, the nodes that have generated logical scores are traversed in a breadth-first manner to determine whether the score is greater than a certain threshold. If it is greater than the threshold, it is considered to be decomposed into new sub-problems and generate corresponding nodes. Otherwise, the decomposition is stopped.

[0060] (3) Entering the analysis phase, for sub-problems that have not yet generated a reasoning process, the specific solution process (i.e., the reasoning process) is analyzed, and self-checking and logical scoring are performed. The reasoning process and logical scores obtained after the check are stored in the node.

[0061] (4) Enter the reflection phase and determine whether the logic score of the newly generated child node is greater than a certain threshold. If so, use the reasoning process in the node to update the reasoning process in the previous node (ancestor node).

[0062] (5) Repeat the process from (2) to (4) until the problem cannot be decomposed any further and the final reasoning tree is obtained.

[0063] Those skilled in the art will understand that the base model is a general technical term in this field, which refers to a model that is pre-trained using large-scale data in natural language processing tasks, for example, the various large language models introduced in the aforementioned background technology.

[0064] In the embodiment of the present invention, there is no limitation on the specific type of the base model. In actual application, the user can select a specific base model according to actual conditions.

[0065] 2. Detailed introduction of the plan.

[0066] 1. Problem definition and formalization.

[0067] The present invention focuses on complex reasoning problems. The purpose of the automatic solution task of complex reasoning problems is to generate a reasonable reasoning process based on the text of the problem and obtain the correct answer from it. In an embodiment of the present invention, the problem text Q is defined as a text containing only natural language, and the goal is to generate a reasoning process R containing multiple words based on Q, and the answer A obtained based on the reasoning process R.

[0068] 2. Data collection.

[0069] The patent of this invention uses complex reasoning problem datasets as input, such data samples include: the open source scientific question answering dataset (ScienceQA) released by UCLA, the open source dataset (StrategyQA) released by the Allen Institute for AI, and the open source mathematical word problem dataset (GSM8K) released by OpenAI.

[0070] 3. Method and process.

[0071] like Figure 2 As shown, the intelligent solution method for complex reasoning problems of the present invention is a three-stage cyclic process, namely the decomposition stage, the analysis stage and the reflection stage. The decomposition stage will construct logical heuristic examples based on the original problem, and prompt the model to decompose a problem plan into sub-problems based on these examples; the analysis stage will first solve the newly generated sub-problems to obtain the reasoning process of the sub-problems, and then evaluate the reasoning process, including self-checking whether there are errors in the generated content and scoring the logic of the reasoning process; the reflection stage will use the newly generated reasoning process as a basis to determine whether the previously generated reasoning process needs to be updated or revised. If it needs to be revised, it will be changed to more reasonable content. The present invention constructs the above three stages into a cyclic process, and finally constructs the solution process of complex reasoning problems into a final reasoning tree.

[0072] Formal definition of three loops: In the embodiment of the present invention, each loop starts by selecting an existing node . Where t represents the node The number of layers in the inference tree, It contains three parts: , and , respectively representing the question, reasoning process and logic score stored in the node, formally expressed as First, in the decomposition stage, determine whether the node Problems in Decompose into more fine-grained sub-problems , if possible, then in Layer generates new nodes , and the subproblem Stored on the node Then, in the analysis phase, the newly generated subproblems Perform reasoning and solving, generate reasoning processes for them, check their correctness and evaluate them to get a logical score ; Then, in the reflection phase, the reasoning process after the inspection is used to update the reasoning process in the generated node; then, the method of the present invention will select another node and restart the decomposition phase. This cycle continues until no new sub-problems can be decomposed.

[0073] It should be noted that Figure 2 The final inference tree structure shown is only an example, and its specific levels and node data of each level can be determined by the actual target problem, and the present invention does not impose any limitation.

[0074] For a more intuitive understanding, the following is an example of a specific target problem. In this example, the target problem text is in English, and the content is: Janet's ducks lay 16 eggs per day. She eats three for breakfast every morning and bakes muffins for her friends every day with four. She sells the remainder at the farmers' market daily for $2 per fresh duck egg. How much in dollars does she make every day at the farmers' market? The Chinese translation is as follows: Janet's ducks lay 16 eggs every day. She eats three for breakfast every morning and bakes muffins for her friends every day. She sells the remainder at the farmers' market at $2 per fresh duck egg. How much in dollars does she make every day at the farmers' market? Based on the above target problem, a three-stage cyclic process is used to generate the following Figure 3 The inference tree shown, Figure 3 In It is the reasoning process of the root node, that is, the reasoning process R of the target problem, from which the answer A can be extracted. , It is the first node in layer 1 Similarly, the other q and r symbols have similar meanings, that is, the superscript value corresponds to the sequence number of the subproblem (or node), and the subscript value corresponds to the number of layers, for example, , It is the second node in the second layer Sub-problems and reasoning process.

[0075] Figure 3In Chinese: What is the selling price of one egg is translated as What is the selling price of one egg; Each egg is sold for $2 is translated as Each egg is sold for $2; How many eggs does Janet have per day is translated as How many eggs does Janet have per day; She has 16-(3+4)= 9 eggs per day is translated as She has 16-(3+4)= 9 eggs per day; The ducks lay 16 eggs per is translated as The ducks lay 16 eggs per day; She eats 3 eggs for breakfast is translated as She eats 3 eggs for breakfast; She uses 4 eggs to bake muffins is translated as She uses 4 eggs to bake muffins.

[0076] It should be noted that the solution provided in the embodiments of the present invention can be applied to multiple languages. In actual applications, users can select the problem text in the corresponding language according to their own needs.

[0077] (1) Decomposition stage.

[0078] (1.1) Construct logical heuristic examples.

[0079] The decomposition stage aims to imitate the ability of humans to decompose complex problems into multiple simplified sub-problems according to a certain logic. According to the theory of analogical reasoning, when reasoning, the logical process of a new problem is often analogized to the logical process of a similar problem. Therefore, first find some problems similar to the target problem and construct their decomposition examples.

[0080] Specifically, select M candidate problems similar to the target problem, use the encoder to convert the target problem and each candidate problem into vector representations respectively, calculate the cosine similarity between the vector representation of the target problem and the vector representation of each candidate problem, and select the top K candidate problems with the highest cosine similarity, which is expressed as:

[0081] ;

[0082] Among them, is the vector representation of the s-th candidate problem is the norm symbol, T is the transpose symbol, represents selecting the top K candidate problems with the highest cosine similarity, is the index set of the top K candidate problems with the highest cosine similarity selected.

[0083] ​Connect each selected candidate question with the marked sub-question to form K decomposition examples of candidate questions as logical heuristic examples; decomposition example of the kth candidate question It is expressed as:

[0084] ;

[0085] in, is the kth candidate question selected The set of sub-problems of , each item in the brackets represents a subproblem, and n is the number of subproblems in the subproblem set.

[0086] All K examples of candidate questions together constitute the logical heuristic sample :

[0087] .

[0088] (1.2) Problem decomposition.

[0089] The node As the current node selected , after obtaining Then, use them to change the current node Problems in Decomposed into multiple more fine-grained levels Specifically, for the problem , if the logic score Above the first threshold , the base model is asked whether it can be decomposed. If it can be decomposed, the large model is required to autonomously decompose it into multiple sub-problems Here we mainly consider the case of t>0, that is, the case where the current node is not the root node. For the root node, there is no need to perform this part of logical judgment, but directly perform the subsequent decomposition process.

[0090] In this process, a heuristic enhancement prompt was designed, which includes the prompt header and logical heuristic examples , prompt header Describe the problem decomposition task in natural language and solve the problem through the base model Decompose and generate sub-problems, expressed as:

[0091] ;

[0092] in, Represents the decomposition process, Indicates the parameters of the base model, prompt header Used to describe problem decomposition tasks, Represents the decomposition result j A sub-question, J is the number of subproblems obtained by decomposition, and the symbol Represents the output result, that is, the processing process on the right obtains the output result shown on the left.

[0093] For the sub-problem , generate the corresponding node , which is located at Layer, Node As the current node child node of the current node, and add a To Node Directed edge , expressed as .

[0094] If the base model determines the problem If it cannot be decomposed, a leaf node is generated. As The child node of .

[0095] In the embodiment of the present invention, there are two cases where the problem cannot be further decomposed. One is that the logic score corresponding to the node is less than the first threshold, and the other is that the base model outputs a prompt that the decomposition cannot be continued when the logic score is higher than the first threshold. Both of the above cases will generate leaf nodes. For leaf nodes, the subsequent process directly skips their decomposition, analysis and update.

[0096] by Figure 3 Based on the example shown, Figure 4 Examples of decomposition stages shown; Figure 4 Chinese: She makes9*3=$27 per day, which means she makes 9*3=27 dollars a day. Similarly, the specific language involved in this part can be set by the user and will not be repeated in the following text.

[0097] (2) Analysis phase:

[0098] Obtaining subproblems during the decomposition phase Finally, we reason about each sub-problem separately. The following is an introduction taking a single sub-problem as an example.

[0099] For the sub-problem , combined with the prompt head through the base model Solve and generate reasoning process , expressed as:

[0100] ;

[0101] in, j Corresponding to the number of the subproblem, Corresponding to the number of layers of the inference tree, Indicates the solution process, prompt header is used to describe the sub-problem solving task, Represents the parameters of the base model.

[0102] After obtaining the reasoning process of the sub-problem, it is further evaluated and corrected. This is a very important step because the base model often has hallucinations in problem solving. If the directly generated reasoning process is continued for subsequent reasoning, it may lead to error propagation and incorrect results. To this end, a self-check method is first designed to check the reasoning process. Conduct checks to promptly correct errors in the reasons and obtain the reasoning process after the check , and then prompt the base model to provide a logical score for each node. Specifically, the base model is prompted to The reasoning process Check (prompt header is ), this is to identify any potential errors. If the base model determines the reasoning process If there is no error, then the reasoning process This is the reasoning process after inspection If there is an error, it will be corrected, and the corrected reasoning process is the reasoning process after inspection. , expressed as:

[0103] ;

[0104] in, A method of self-examination. is the hint head, which is used to describe the inspection task of the reasoning process.

[0105] Afterwards, the reasoning process and sub-questions after checking are evaluated through the base model The logical consistency is expressed as:

[0106] ;

[0107] in, For the logical consistency assessment process, is a hint header, used to describe the evaluation task of logical consistency. Score for logic.

[0108] After completing the above processing, the reasoning process and logic score after the check can be stored in the corresponding node In the form: , This will be used in the subsequent reflection phase and the next round of decomposition phase.

[0109] by Figure 3 Based on the example shown, Figure 5 An example of the stages of decomposition shown; where Each egg is sold for $3, which translates to $3 per egg.

[0110] (3) Reflection stage.

[0111] This stage aims to mimic the reflective process during reasoning. First, determine which generated reasoning processes may need to be modified. This process is flexible. The present invention automates this process by using the base model to identify the relationship between ancestor nodes (i.e., existing nodes) and newly generated nodes, and using the reasoning process of the new nodes to update the ancestor nodes. Specifically, the goal of this stage is to use information from deeper level (fine-grained, simple) nodes to reflect on the information of shallower level (coarse-grained, difficult) nodes, which is more in line with the simplified cognitive process when solving problems.

[0112] To achieve this goal, based on the analysis phase, the generated nodes , determine whether its logic score is higher than the second threshold If so, check the node through the base model The corresponding sub-problem The problem with all nodes less than or equal to level t The correlation of , select the part of nodes with the strongest correlation, expressed as:

[0113] ;

[0114] Among them, Extract is the process of selecting a part of nodes with the strongest correlation; L represents the node set consisting of all nodes less than or equal to level t, , To define symbols, For the The nodes of the layer, For Node The problem, is the prompt header, describing the relevance checking task, A node set consisting of a portion of nodes with the strongest correlation.

[0115] Through the base model, using sub-questions The reasoning process after the inspection , update the node set The reasoning process of each node in the problem is expressed as:

[0116] ;

[0117] in, represents the reasoning process of the update problem, is the prompt head, which is used to describe the reasoning process of the update problem. middle, For a node collection A node in For Node Questions, reasoning and logic scores, The reasoning process for the problem obtained for updating.

[0118] Reuse Replace Node The reasoning process in , expressed as:

[0119] .

[0120] by Figure 3 Based on the example shown, Figure 6 An example of the decomposition stages shown; where She makes 9*2=$18 per day, translated as she makes 9*2=18 dollars per day.

[0121] The specific values ​​of the various thresholds involved in the embodiments of the present invention can be set according to actual conditions or experience, and the present invention does not limit the specific values. For example, when solving the questions in the test set of the open source scientific question-answering dataset ScienceQA, the experiment attempts to set the first threshold and the second threshold to values ​​in {0, 0.1, 0.2, …, 0.9, 1}. After experiments and attempts, setting both to 0.4 can achieve the best effect.

[0122] The various prompt headers involved in the embodiments of the present invention are mainly used to prompt the base model to perform corresponding tasks, and are generally in the form of natural language. The specific prompt header format can be set by the user according to actual conditions or experience.

[0123] The above solution provided by the embodiment of the present invention has the following technical advantages over the prior art:

[0124] (1) The present invention designs a new complex reasoning problem-solving system, which simplifies the reasoning process by decomposing coarse-grained problems into fine-grained sub-problems, forms a reasoning tree to solve the problem, and constructs an intelligent solution that is closer to the cognitive reasoning process, with higher flexibility and interpretability. The present invention can also be used as a general framework to enhance the multi-step reasoning capabilities of various base models, and has strong practical value in realizing strong artificial intelligence.

[0125] (2) The present invention establishes a three-stage cycle of decomposition-analysis-reflection in the complex reasoning problem-solving system, which helps to improve the logic and interpretability of the model when solving complex reasoning problems. Through this cycle, the present invention can not only improve the accuracy and efficiency of reasoning question-answering related tasks, but also provide highly interpretable problem-solving logic ideas for personalized online guidance, which has high educational and practical value.

[0126] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above embodiments can be implemented by software, or by means of software plus necessary general hardware platforms. Based on such understanding, the technical solutions of the above embodiments can be embodied in the form of software products, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), including several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0127] Embodiment 2

[0128] The present invention also provides an intelligent solution system for complex reasoning problems, which is mainly used to implement the method provided in the above embodiments, such as Figure 7 As shown, the system mainly includes:

[0129] An initialization unit, used to initialize the root node of the reasoning tree using the target question, the root node including the target question, and the initialized reasoning process and logic score;

[0130] The three-stage loop processing unit includes a decomposition unit, an analysis unit and a reflection unit, and is used to obtain the final reasoning tree through the following process: the decomposition unit is applied to the decomposition stage. In the decomposition stage, the nodes in the reasoning tree are traversed. For the selected current node, when it is a root node, it is directly decomposed. When it is not a root node, the logical score is used to determine whether to decompose. If so, the problem contained in the current node is decomposed using a pre-built logical heuristic example, and a node is generated using the sub-problem obtained by the decomposition and used as the child node of the current node; the analysis unit is applied to the analysis unit. In the analysis stage, the sub-problem is analyzed, the reasoning process is generated and checked, and the logical score is generated using the reasoning process after the check; the reflection unit is applied to the reflection stage. In the reflection stage, the reasoning process of the problem in the previous node is updated using the reasoning process after the sub-problem is checked; the above three stages are repeated until no sub-problems can be decomposed, and the final reasoning tree is obtained; wherein the current node includes the root node and the node generated in the decomposition stage;

[0131] The answer generation unit generates an answer to the target question using the final inference tree.

[0132] Technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the system can be divided into different functional modules to complete all or part of the functions described above.

[0133] Embodiment 3

[0134] The present invention also provides a processing device, such as Figure 8 As shown, it mainly includes: one or more processors; a memory for storing one or more programs; wherein, when the one or more programs are executed by the one or more processors, the one or more processors implement the methods provided by the aforementioned embodiments.

[0135] Furthermore, the processing device also includes at least one input device and at least one output device; in the processing device, the processor, memory, input device, and output device are connected via a bus.

[0136] In the embodiment of the present invention, the specific types of the memory, input device and output device are not limited; for example:

[0137] The input device may be a touch screen, an image acquisition device, a physical button or a mouse, etc.;

[0138] The output device may be a display terminal;

[0139] The memory may be a random access memory (RAM) or a non-volatile memory such as a disk memory.

[0140] Embodiment 4

[0141] The present invention also provides a readable storage medium storing a computer program, which implements the method provided in the above embodiment when the computer program is executed by a processor.

[0142] In the embodiment of the present invention, the readable storage medium as a computer-readable storage medium can be set in the aforementioned processing device, for example, as a memory in the processing device. In addition, the readable storage medium can also be a U disk, a mobile hard disk, a read-only memory (ROM), a disk or an optical disk, etc., which can store program codes.

[0143] The above is only a preferred specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. An intelligent solution method for complex reasoning problems, characterized in that: include: Initialize the root node of the reasoning tree using the target question, which contains the target question, the initialized reasoning process and the logic score; The final reasoning tree is obtained through the following process: in the decomposition stage, the nodes in the reasoning tree are traversed. For the selected current node, if it is a root node, it is directly decomposed. If it is not a root node, the logical score is used to determine whether to decompose. If so, the problem contained in the current node is decomposed using the pre-built logical heuristic sample, and the sub-problems obtained by the decomposition are used to generate nodes and serve as the child nodes of the current node; in the analysis stage, the sub-problems are analyzed, the reasoning process is generated and checked, and the logical score is generated using the reasoning process after the check; in the reflection stage, the reasoning process of the problem in the previous node is updated using the reasoning process after the sub-problem is checked; the above three stages are repeated until no sub-problems can be decomposed and the final reasoning tree is obtained; Generate an answer to the target question using the final inference tree; The steps of constructing a logical heuristic example include: Select M candidate questions, use the encoder to convert the target question and each candidate question into vector representations, and calculate the vector representation of the target question respectively. The cosine similarity between the vector representation of each candidate question and the top K candidate questions with the highest cosine similarity are selected, which is expressed as: ; in, is the sth candidate question The vector representation of is the norm symbol, T is the transpose symbol, Indicates selecting the top K candidate questions with the highest cosine similarity. is the index set of the top K candidate questions with the highest cosine similarity; Connect each selected candidate question with the marked sub-question to form K decomposition examples of candidate questions as logical heuristic examples; decomposition example of the kth candidate question It is expressed as: ; in, is the kth candidate question selected A set of sub-problems; All K examples of candidate questions together form the logical heuristic sample: ; in, This is an example of a logical heuristic.

2. The intelligent solution method for complex reasoning problems according to claim 1, characterized in that: When it is not a root node, the logic score is used to determine whether to decompose. If so, the problem contained in the current node is decomposed using a pre-built logic heuristic example, and nodes are generated using the sub-problems obtained by the decomposition, and the child nodes of the current node include: For the current node selected , which consists of three parts: , and , where t represents the current node The number of layers in the inference tree, , and In turn, it represents the current node questions, reasoning and logic; If the logic score Above the first threshold , then use the prompt header Example with logical heuristics , through the base model to solve the problem Decompose and generate sub-problems, expressed as: ; in, Represents the decomposition process, Indicates the parameters of the base model, prompt header Used to describe problem decomposition tasks, represents the jth subproblem obtained by decomposition, J is the number of subproblems obtained by decomposition, and the symbol Indicates the output result; For the sub-problem , generate the corresponding node , which is located at Layer, Node As the current node child node of the current node, and add a To Node Directed edge , expressed as .

3. An intelligent solution method for complex reasoning problems according to claim 1 or 2, characterized in that: The analyzing of the sub-questions, generating and checking the reasoning process, and generating a logic score using the checked reasoning process include: For the sub-problem , combined with the prompt head through the base model Solve and generate reasoning process , expressed as: ; Among them, j corresponds to the sequence number of the subproblem, Corresponding to the number of layers of the inference tree, Indicates the solution process, prompt header is used to describe the sub-problem solving task, Represents the parameters of the base model, symbol Indicates the output result; Reasoning Process Conduct inspection and obtain the reasoning process after inspection ; Reasoning and sub-questions after checking through the base model evaluation The logical consistency is expressed as: ; in, For the logical consistency assessment process, is a hint header, used to describe the evaluation task of logical consistency. Score for logic.

4. The intelligent solution method for complex reasoning problems according to claim 3 is characterized in that: The reasoning process Conduct inspection and obtain the reasoning process after inspection include: Use a self-checking method to check the reasoning process through the base model Check, if there is no error, then the reasoning process This is the reasoning process after inspection If there is an error, it will be corrected, and the corrected reasoning process is the reasoning process after inspection. , expressed as: ; in, A method of self-examination. It is a prompt header used to describe the reasoning process Inspection tasks, symbols Indicates the output result.

5. The intelligent solution method for complex reasoning problems according to claim 1 or 2, characterized in that: The updating of the reasoning process of the problem in the previous node by using the reasoning process after checking the sub-problem includes: For the generated nodes , where j corresponds to the number of the subproblem, Corresponding to the number of layers of the inference tree, determine whether its logic score is higher than the second threshold If so, check the node through the base model The corresponding sub-problem The correlation with the questions contained in all nodes less than or equal to level t, select a part of the nodes with the strongest correlation, expressed as: ; Among them, Extract is the process of selecting a part of nodes with the strongest correlation; represents a node set consisting of all nodes less than or equal to level t, represents the parameters of the base model, is the prompt header, describing the relevance checking task, is a node set consisting of a portion of nodes with the strongest correlation, symbol Indicates the output result; Through the base model, using sub-questions The reasoning process after the inspection , update the node set The reasoning process of each node in the problem is expressed as: ; in, represents the reasoning process of the update problem, is the hint head, which is used to describe the task of reasoning about the update problem. middle, For a node collection A node in For Node Questions, reasoning and logic scores, The reasoning process for updating the obtained problem; Reuse Replace Node The reasoning process in , expressed as: 。 6. The intelligent solution method for complex reasoning problems according to claim 1, characterized in that: The method of using the final inference tree to generate an answer to the target question includes: The reasoning process contained in the root node of the final reasoning tree is the reasoning process of the target question, and the answer extracted therefrom is the answer to the target question.

7. An intelligent solution system for complex reasoning problems, characterized in that: include: An initialization unit, used to initialize the root node of the reasoning tree using the target question, the root node including the target question, and the initialized reasoning process and logic score; The three-stage loop processing unit includes a decomposition unit, an analysis unit and a reflection unit, and is used to obtain the final reasoning tree through the following process: the decomposition unit is applied to the decomposition stage. In the decomposition stage, the nodes in the reasoning tree are traversed. For the selected current node, when it is a root node, it is directly decomposed. When it is not a root node, the logical score is used to determine whether to decompose. If so, the problem contained in the current node is decomposed using a pre-built logical heuristic example, and a node is generated using the sub-problem obtained by the decomposition and used as the child node of the current node; The analysis unit is applied to the analysis unit. In the analysis stage, the sub-problems are analyzed, the reasoning process is generated and checked, and the logic score is generated using the checked reasoning process; The reflection unit is used in the reflection phase. In the reflection phase, the reasoning process of the problem in the previous node is updated using the reasoning process after the sub-problem is checked. The above three phases are repeated until no sub-problems can be decomposed, and the final reasoning tree is obtained. Among them, the current node includes the root node and the nodes generated in the decomposition phase. An answer generation unit generates an answer to a target question using the final inference tree; The steps of constructing a logical heuristic example include: Select M candidate questions, use the encoder to convert the target question and each candidate question into vector representations, and calculate the vector representation of the target question respectively. The cosine similarity between the vector representation of each candidate question and the top K candidate questions with the highest cosine similarity are selected, which is expressed as: ; in, is the sth candidate question The vector representation of is the norm symbol, T is the transpose symbol, Indicates selecting the top K candidate questions with the highest cosine similarity. is the index set of the top K candidate questions with the highest cosine similarity; Connect each selected candidate question with the marked sub-question to form K decomposition examples of candidate questions as logical heuristic examples; decomposition example of the kth candidate question It is expressed as: ; in, is the kth candidate question selected A set of sub-problems; All K examples of candidate questions together form the logical heuristic sample: ; in, This is an example of a logical heuristic.

8. A processing device, characterized in that: include: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.

9. A readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Mathematical application question knowledge construction and answering method, system and device and storage medium

    CN115829033A

  • Security case automatic construction and verification method based on large language model

    CN118606178A