Intelligent solution method, system, device and medium for multi-step reasoning problems

Through the knowledge fusion mechanism and correlation evaluation, multi-step reasoning problems are decomposed and evaluated, and a multi-step thinking chain is formed, which solves the problems of unreasonable and factual errors in the existing technology, and improves the ability to solve multi-step reasoning problems and The accuracy of the answer.

CN118674056BActive Publication Date: 2024-12-24UNIV OF SCI & TECH OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411151158.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-21
Publication Date
2024-12-24
Estimated Expiration
2044-08-21

AI Technical Summary

Technical Problem

The existing technology has problems such as unreasonable reasoning steps, factual errors and lack of evaluation in the automated solution of multi-step inference problems, resulting in inaccurate answers generated by the model.

Method used

The knowledge fusion mechanism is used to extract relevant texts from the external knowledge base and splice them with input problems, decompose them into sequential sub-problems, and generate multi-step thinking chains through correlation evaluation to improve the logical rationality and factual accuracy of the reasoning process.

Benefits of technology

It improves the ability to solve multi-step reasoning problems, enhances the model's reasoning ability and the accuracy of answers, and provides a more reasonable problem-solving process and personalized educational feedback.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118674056B_ABST
    Figure CN118674056B_ABST
Patent Text Reader

Abstract

The present invention discloses an intelligent solution method, system, device and medium for multi-step reasoning problems, which are one-to-one corresponding solutions. The overall solution is as follows: a multi-step reasoning problem-solving framework is designed, and explanation steps are generated in a step-by-step manner, which is used as a multi-step thinking chain to inspire model reasoning, thereby enhancing multi-step reasoning capabilities and having strong practical value in realizing strong artificial intelligence; and the present invention establishes a knowledge fusion mechanism and a relevance evaluation mechanism in the multi-step reasoning problem-solving framework, which helps to improve the logical rationality and factual accuracy of the generated reasoning process, thereby improving the accuracy of problem solving; at the same time, the external knowledge introduced by the knowledge fusion mechanism can provide additional information for many question-answering related machine learning tasks; the evaluation of the problem-solving steps by the relevance evaluation mechanism can assist the education platform in making reasonable evaluation and feedback for the solution process, and can provide more personalized online guidance services based on this.
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 solution of multi-step reasoning problems, and in particular to an intelligent solution method, system, device and medium for multi-step reasoning problems. Background Art

[0002] The automated solution of multi-step reasoning problems is an important task in achieving general artificial intelligence. Its main purpose is to enable the machine to understand the content of the natural language description that needs to be solved through a multi-step logical process, and to reason to obtain the correct answer. This process requires the machine to obtain key information from the problem, understand the problem logic, and complete the planning and implementation of the reasoning steps like a human. Therefore, the ability to automatically solve multi-step reasoning problems is regarded as a core symbol of general artificial intelligence and a very important research direction in various application fields of artificial intelligence.

[0003] At present, there are mainly the following methods for automatically solving multi-step reasoning problems:

[0004] (1) A method that directly infers the answer based on end-to-end reasoning.

[0005] The method of directly reasoning out the answer based on end-to-end reasoning mainly uses semantic parsing, memory networks, graph neural networks, etc. to convert the question text into some structured representations (such as semantic parse trees), and then use the semantic information contained in these structured representations to directly predict the correct answer.

[0006] (2) Method based on problem decomposition.

[0007] The problem decomposition-based method considers the complexity of solving the original problem directly in a single step, decomposes the original problem into multiple simple sub-problems, and solves these sub-problems separately to obtain the answer to the original problem. These problem decomposition methods mainly include rule-based decomposition methods and sequence-to-sequence generation decomposition methods. Among them, the rule-based decomposition method relies on some artificially constructed rules or patterns to map the original problem into a series of sub-problems with a certain logical structure; the sequence-to-sequence generation decomposition method usually inputs the original problem into a neural network model, allowing the model to output a sequence of decomposed sub-problems.

[0008] (3) Method based on big model thinking chain.

[0009] The method based on the big model thinking chain uses the powerful reasoning ability of the big model to directly solve the multi-step reasoning problem, and adds the thinking chain described in natural language as the intermediate process of problem reasoning to further guide the problem solving. The thinking chain can be manually constructed or automatically generated by the big model. The introduction of the thinking chain can enhance the multi-step reasoning ability of the big model, and also make the complex multi-step reasoning process more explainable.

[0010] Among the above-mentioned automated solution methods, the method based on the large model thinking chain surpasses other methods in many multi-step reasoning tasks, demonstrating strong understanding and logical reasoning capabilities. However, after research, it was found that this type of method will produce a series of problems when actually generating the reasoning process: (a) The reasoning process generated by the model often lacks reasoning steps or generates incorrect reasoning steps; (b) The reasoning process generated by the model may contain factual errors; (c) These methods lack evaluation of the generated reasoning process, so unreasonable reasoning processes often lead to the model producing wrong answers. Therefore, through experiments and observations, the methods based on the large model thinking chain are still a certain distance away from human-level artificial intelligence, because they cannot plan reasonable reasoning steps, avoid common factual errors, and evaluate the problems in the content they generate in real time.

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

[0012] The purpose of the present invention is to provide an intelligent solution method, system, device and medium for multi-step reasoning problems, which can improve the solution ability of multi-step reasoning problems and have strong practical value in realizing strong artificial intelligence.

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

[0014] An intelligent solution method for multi-step reasoning problems, comprising:

[0015] Use the knowledge fusion mechanism to extract text content related to the input question from the external knowledge base as background information, and splice it with the input question text to form a knowledge-enhanced question text;

[0016] Capturing information related to reasoning logic from the knowledge-enhanced question text, and decomposing the question into a plurality of sequential sub-questions;

[0017] The corresponding explanation content is generated in the order of sub-questions and combined with the knowledge-enhanced question text, and then evaluated. The corresponding explanation steps are obtained based on the evaluation results. All explanation steps are combined to form a multi-step thinking chain, and the correct answer corresponding to the input question is predicted.

[0018] An intelligent solution system for multi-step reasoning problems, comprising:

[0019] A knowledge fusion unit is used to extract text content related to the input question from an external knowledge base as background information using a knowledge fusion mechanism, and concatenate it with the text of the input question to form a knowledge-enhanced question text;

[0020] A step decomposition unit, used for capturing information related to reasoning logic from the knowledge-enhanced question text, and decomposing the question into a plurality of sequential sub-questions;

[0021] The explanation generation unit is used to generate corresponding explanation content in the order of sub-questions and in combination with the knowledge-enhanced question text, and then evaluate it. The corresponding explanation steps are obtained based on the evaluation results. All explanation steps are integrated to form a multi-step thinking chain, and the correct answer corresponding to the input question is predicted.

[0022] An intelligent solution device for multi-step reasoning problems, comprising: one or more processors; a memory for storing one or more programs;

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

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

[0025] It can be seen from the technical solution provided by the present invention that a multi-step reasoning problem-solving framework is designed, which generates explanation steps in a step-by-step manner, and serves as a multi-step thinking chain to inspire model reasoning, thereby enhancing multi-step reasoning capabilities and having strong practical value in realizing strong artificial intelligence; and the present invention establishes a knowledge fusion mechanism and a relevance evaluation mechanism in the multi-step reasoning problem-solving framework, which helps to improve the logical rationality and factual accuracy of the generated reasoning process, thereby improving the accuracy of problem solving; at the same time, the external knowledge introduced by the knowledge fusion mechanism can provide additional information for many question-and-answer related machine learning tasks; the evaluation of the problem-solving steps by the relevance evaluation mechanism can assist the education platform in making reasonable evaluations and feedback on the solution process, and can provide more personalized online guidance services based on this. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] 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.

[0027] Figure 1 A flowchart of an intelligent solution method for multi-step reasoning problems provided by an embodiment of the present invention;

[0028] Figure 2 A schematic diagram of an intelligent solution framework model for multi-step reasoning problems provided by an embodiment of the present invention;

[0029] Figure 3 A schematic diagram of sub-problem analysis provided by an embodiment of the present invention;

[0030] Figure 4 A schematic diagram of an intelligent solution system for multi-step reasoning problems provided by an embodiment of the present invention;

[0031] Figure 5 A schematic diagram of an intelligent solution device for multi-step reasoning problems 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 multi-step 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 multi-step reasoning problems, which is used to solve the problems of unreasonable reasoning process steps generated by the prior art, factual errors in the reasoning process, and lack of evaluation of the generated reasoning process, thereby overcoming the large gap with human-level artificial intelligence. The method is inspired by cognitive science theory, decomposes the problem-solving process into multiple sub-problems, and gradually generates explanation steps based on these sub-problems, and organically couples the reasoning process evaluation mechanism with the external knowledge fusion mechanism, so as to help generate a reasoning process with reasonable steps and higher quality, thereby improving the ability to solve multi-step reasoning problems. Figure 1 As shown, the method mainly includes the following steps:

[0039] Step 1: Question text enhancement based on knowledge fusion mechanism.

[0040] In the embodiment of the present invention, the knowledge fusion mechanism runs through the entire model reasoning process, and plays an effective guiding role in the subsequent step decomposition stage of step 2 and the explanation generation stage of step 3 to overcome the disadvantage of generating explanations containing factual errors. Specifically: for each question text, the knowledge fusion mechanism is used to extract text content related to the input question from the external knowledge base as background information, and spliced ​​with the input question text to form a knowledge-enhanced question text, which is applied to the subsequent step decomposition stage of step 2 and the explanation generation stage of step 3 to enhance the reasoning ability of the model.

[0041] Step 2: Step decomposition stage.

[0042] In the embodiment of the present invention, information related to reasoning logic is captured from the knowledge-enhanced question text, and the question is decomposed into a number of sequential sub-questions.

[0043] Step 3: Explain the generation phase.

[0044] In an embodiment of the present invention, corresponding explanation contents are generated in the order of sub-questions and in combination with the knowledge-enhanced question text and then evaluated. Corresponding explanation steps are obtained in combination with the evaluation results. All explanation steps are integrated to form a multi-step thinking chain, and the correct answer corresponding to the input question is predicted.

[0045] In the specific implementation process, a new explanation queue can be created, and an unanswered sub-question can be extracted from the sequential sub-questions in order. The explanation content can be generated using the base model. Then, the relevance evaluation mechanism is used to evaluate the explanation content and decide whether to keep it: if the relevance meets the requirements, the explanation is inserted to the end of the explanation queue, otherwise it is discarded. The above process is repeated until all the sequential sub-questions have been answered. At this time, the explanation queue formed is the multi-step thinking chain corresponding to the problem. The original problem and the multi-step thinking chain are input into the base model together, and the final answer is predicted as the solution result.

[0046] The above scheme provided by the embodiment of the present invention includes a step decomposition stage and an explanation generation stage, and a knowledge fusion mechanism is added to act on these two stages respectively. The step decomposition stage is used to plan the reasoning steps, and the original problem is decomposed into multiple sub-problems in sequence. The decomposition process can effectively extract the key information related to reasoning in the problem, which helps to achieve more reasonable step planning. The explanation generation stage uses the sub-problems that have been decomposed to generate the explanation steps corresponding to each sub-problem; the reasoning step is evaluated by the relevance evaluation mechanism, and it is determined whether to be added to the next step of reasoning as useful information; finally, the reasoning process generated in each step is combined to form a multi-step thinking chain for the model to predict the correct answer; the knowledge fusion mechanism introduces knowledge related to the original problem from the external knowledge base, and adds it to the original problem in the step decomposition stage and each step of the reasoning process in the explanation generation stage, which is used to guide the realization of the entire reasoning process. The two-stage framework of the present invention effectively models the cognitive process of multi-step reasoning, is closer to the goal of general artificial intelligence, and can be used as a general framework to enhance the multi-step reasoning ability of various basic models, which has important practical application value for realizing strong artificial intelligence. At the same time, the knowledge fusion mechanism proposed in the present invention helps to improve the logical rationality and factual accuracy of the reasoning process, thereby improving the accuracy of problem solving. The introduced external knowledge can provide additional feedback information for many question-and-answer related machine learning tasks, provide more personalized guidance services for intelligent education, and bring more extensive help and benefits.

[0047] 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.

[0048] 1. Overall overview of the plan.

[0049] In order to solve the problems in the generation of the three types of reasoning processes mentioned in the prior art, the present invention is based on the viewpoint in cognitive science theory: humans can form a clear reasoning path by solving problems in a decomposed structure. The present invention constructs a two-stage decomposition-evaluation (DecompE) framework for reasonably decomposing and planning reasoning steps, and generating and evaluating the reasoning process of each step according to these reasoning steps, and finally obtaining the correct answer. The decomposition-evaluation framework includes two stages: step decomposition (SD) stage and rationale generation (RG). Given a multi-step reasoning problem, the step decomposition stage aims to plan reasonable reasoning steps for solving the problem. This stage takes the text of the problem as input, imitates human reasoning ability, and decomposes the original problem into multiple sequential simple sub-problems by capturing some key information related to the reasoning logic; then, in the explanation generation stage, for the sub-problems that have been decomposed in the previous stage, the explanation steps of each step are generated and evaluated in the order of the sub-problems, forming a complete multi-step thinking chain to guide the model reasoning to obtain the answer. In addition, in order to overcome the factual errors that often occur in language model reasoning, the present invention proposes a knowledge injection mechanism (KIM) to guide the entire two-stage reasoning process with the introduced external knowledge. The technical solution of the two-stage reasoning process is as follows:

[0050] Step decomposition stage: The core of this stage is the sub-problem decomposer (SubGen) used to decompose the original problem into multiple sub-problems. The sub-problem decomposer consists of two parts: Reasoning Type Classifier (RTC) and Next Sub-question Generator (NSG). The next sub-problem generator adopts a sequence-to-sequence generative model architecture. Through pre-training learning problem decomposition methods, it gradually decomposes the original problem into multiple sub-problems on the new multi-step reasoning problem; the reasoning type classifier is based on the Transformer network (transformer neural network) architecture, which is used to extract key information related to the problem reasoning logic and obtain their semantic vector representations, which are added to the generation process of the next sub-problem generator as additional information to enhance the logic of the generated sub-problems.

[0051] Explanation generation stage: In this stage, based on the sub-problems obtained in the step decomposition stage, the base model is used to solve the sub-problems in sequence, and the solution process corresponding to each sub-problem is obtained in turn. At the same time, the present invention introduces a relevance evaluation (Relevance Evaluation) mechanism for each step of the solution process, and uses a pre-trained relevance evaluation model to determine whether the explanation content generated in a certain step is related to the problem content. If the explanation content is highly relevant to the problem, it is retained as part of the multi-step thinking chain and used as a context to guide the solution of the next sub-problem, otherwise the explanation content generated in this step is discarded. By reasoning and evaluating each step of the process step by step in the order of sub-problem planning, the logic and rationality of the generated thinking chain content can be effectively enhanced.

[0052] Knowledge fusion mechanism: This mechanism runs through the entire model reasoning process and plays an effective guiding role in both the step decomposition and explanation generation stages to overcome the shortcoming of the model producing explanations that contain factual errors. For each question text, the mechanism extracts the text content related to the question from the external knowledge base as background information. This background information is spliced ​​with the text of the original question and added to the step decomposition and explanation generation stages respectively to enhance the model's reasoning ability; the model described here mainly includes two stages and the related knowledge fusion mechanism, which will be further introduced later.

[0053] 2. Detailed introduction of the plan.

[0054] 1. Problem definition and formalization.

[0055] There are many forms of multi-step reasoning problems. Taking the multi-step reasoning problem in the form of multiple-choice questions as an example, the purpose of the automatic solution task of multi-step reasoning problems is to generate a reasonable reasoning process based on the text of the question and predict the correct option among the candidate answers. In the embodiment of the present invention, the question text qc is defined as a question description q consisting of multiple words and a candidate answer consisting of d options. ,Right now The task goal is to generate an ordered sequence of n explanation steps based on qc ,in, Represents an interpretation step, its subscript is a sequence number, and is based on qc and sequence From all candidate answers Choose the correct answer.

[0056] An example of a question text is provided by taking a multi-step reasoning problem in the form of a multiple-choice question as an example. The question text is described as: What do breaking glass and melting ice cubes have in common? The candidate answers are: (A) both are physical changes, (B) both are chemical changes. The purpose of the present invention is to select one of the two options A and B as the correct answer based on the above question text through multi-step reasoning.

[0057] 2. Data collection and preprocessing.

[0058] (1) Data collection.

[0059] Taking a multi-step reasoning question in the form of a multiple-choice question as an example, the question text includes a question description and candidate answers. Examples of such data include the open source dataset for scientific question answering (ScienceQA) released by UCLA and the open source dataset (ComplexWebQuestions) released by the Allen Institute for AI. In addition, the input dataset can also be obtained by collecting question-answering data from smart voice assistants in smartphones.

[0060] (2) Data preprocessing.

[0061] Before building a model, the collected data needs to be preprocessed to ensure the effectiveness of the model. Taking the multi-step reasoning problem in the form of multiple-choice questions as an example, it is necessary to ensure that the questions in the data set contain multiple options. For questions that are already in this form, no further processing is required; for questions that do not have multiple candidate answers and need to be answered directly, the question form can be made into a multiple-choice question by constructing more candidate correct and incorrect answers.

[0062] 3. Model establishment.

[0063] The model here mainly includes the step decomposition stage and the explanation generation stage and the related knowledge fusion mechanism, such as Figure 2 As shown in the figure. In the step decomposition phase, the problem reasoning steps are planned to decompose the original problem into multiple sub-problems; in the explanation generation phase, the explanation content of each sub-problem is generated and evaluated according to the steps, and finally a multi-step thinking chain is generated to infer the final answer. Based on these two stages, the knowledge fusion mechanism can enhance the factual accuracy and logical rationality of the generated reasoning process by introducing external knowledge in the two stages to guide the reasoning process of the model.

[0064] (1) Step decomposition stage.

[0065] The step decomposition stage aims to imitate the human ability to decompose complex problems into multiple simple problems according to a certain logic. The ability to logically decompose problems is acquired through experience formed on a large number of problems; at the same time, while decomposing the problem, some keywords related to the logical reasoning method will be discovered (for example, "What are the similarities?" implies the reasoning method of "comparison"), and the specific logical decomposition method is derived based on these keywords. Therefore, the step decomposition stage proposed in the present invention focuses on the modeling of these two processes for obtaining the ability to decompose problems. The core of the step decomposition stage is the sub-problem decomposer (SubGen), such as Figure 3 As shown in the figure, the sub-question decomposer consists of two parts: Reasoning Type Classifier (RTC) and Next Sub-question Generator (NSG). The step decomposition stage is completed by the Reasoning Type Classifier and the sub-question decomposer; RTC is implemented based on the transformation neural network architecture, which is used to capture the key information related to the reasoning logic of the question from the knowledge-enhanced question text (specifically, the semantic vector representation of the corresponding information), and provide it to NSG to guide the generation process of NSG to enhance the logic of the generated sub-questions; NSG adopts a sequence-to-sequence generative model architecture, and is pre-trained on some multi-step reasoning data sets to learn how to generate multiple sub-questions from the original question. NSG combines the information provided by the Reasoning Type Classifier, the knowledge-enhanced question text and all the previously generated sub-questions to generate the next sub-question.

[0066] The overall process can be described as follows: After the question text is enhanced (i.e., the knowledge-enhanced question text, which is specifically introduced in the knowledge fusion mechanism section), it is iteratively input into the sub-problem decomposer, and the sub-problem decomposer generates a sub-problem in step i , then the sub-problem It is concatenated with the knowledge-enhanced question text and the previously generated sub-questions as the input for the next step (i.e., step i+1) to generate the next sub-question When the terminator (e.g., [EOQ]) is generated in step n+1, it indicates that the step decomposition phase is terminated. Since the terminator does not belong to a subproblem, a subproblem sequence is formed from the 1st to the nth subproblem, that is, a subproblem sequence formed by n sequential subproblems is obtained. , where i=1,2,... ,n, and n is the serial number of the last subproblem.

[0067] (1.1) Inference type classifier.

[0068] In an embodiment of the present invention, the reasoning type classifier is pre-trained on a data set of multi-step reasoning. During pre-training, the reasoning type classifier includes: a text encoder and a reasoning type predictor. The text encoder generates a semantic vector representation of the question text in the data set. The reasoning type predictor predicts the reasoning type corresponding to the question text based on the semantic vector representation. After that, the reasoning type corresponding to the predicted question text and the reasoning type label in the data set are used to optimize the reasoning type classifier. After the pre-training is completed, the text encoder is retained. Information related to the reasoning logic of the question, that is, the corresponding semantic vector representation, is extracted through the text encoder and provided to the next sub-question generator.

[0069] like Figure 3 As shown, during pre-training, the text encoder Generate question text Semantic vector representation of:

[0070] ;

[0071] in, It is a semantic vector representation.

[0072] Semantic vector representation Will be input to the inference type predictor One-hot encoding of the inference type used for prediction problems , is the length of the one-hot encoding. Each question in the multi-step reasoning dataset has a corresponding logical reasoning type label, which belongs to the label set By minimizing the binary cross entropy loss expressed as :

[0073] ;

[0074] in, Represents the vector representation of the fth label. The number of labels is the number of inference types, which is equivalent to the length of the one-hot encoding. .

[0075] After training, the text encoder can be used directly without using the inference type predictor Extract the key information implicitly contained in the knowledge-enhanced question text that is most relevant to the logical reasoning method of the question, that is, the semantic vector representation.

[0076] (1.2) Subproblem decomposer.

[0077] In order to utilize the key information extracted by the inference type classifier in the problem decomposition process, the present invention integrates the key information into the training process of the next sub-problem generator (NSG). The sub-problem decomposer adopts a sequence-to-sequence generative model architecture, which includes an encoder and a decoder, such as Figure 3 As shown, an example of a sequence-to-sequence generative model based on the BART structure (a model that combines a bidirectional Transformer encoder with a unidirectional autoregressive Transformer decoder) is provided.

[0078] The present invention uses problem decomposition examples collected from a multi-step reasoning dataset as training data for the sub-problem decomposer. Each decomposition example consists of two parts: the problem text and its corresponding decomposed sub-problem When using these problem decomposition examples to train NSG, the goal to be optimized is as follows:

[0079] ;

[0080] in, is the input of the subproblem decomposer in the i-th step, which is the information obtained by concatenating the knowledge-enhanced question text and the previously generated subproblems. If the i-th step is step 1, then That is, the question text for knowledge enhancement; For a given input Under the condition of The subproblem decomposer predicts the subproblems The conditional probability of Refers to all , is the cumulative sum of all conditional probabilities.

[0081] In order to integrate the key information extracted by the reasoning type classifier into the sub-problem decomposer generation process, the present invention designs a prefix tuning method, which enables the sub-problem decomposer to perceive the key information in the original question during the sub-problem generation process. The input of the next sub-problem generator is the knowledge-enhanced question text and the previously generated sub-problem, and the prefix tuning method is used to extract the prefix vector pair from the semantic vector representation provided by the reasoning type classifier. As input, specifically: the encoder input includes the knowledge-enhanced question text and the previously generated sub-questions, as well as the prefix vector , the decoder input includes: the encoder output and the prefix vector , output the next sub-problem.

[0082] like Figure 3As shown in Figure 2, a multilayer perceptron (MLP) is used to map the semantic vector representation into a prefix vector pair. For example, , Added to each attention layer of the encoder and decoder respectively. In this way, during the prefix adjustment process, the generation of the next sub-problem is controlled by key information, so the generation process of the sub-problem can be planned in the desired direction and provide logical features for the model.

[0083] Those skilled in the art will appreciate that mapping the semantic vector representation to the prefix vector pair The specific method can be implemented by referring to the prefix-tuning method. Based on the prefix-tuning method, a prefix vector pair can be generated. , and use the key prompt information of the two to guide the next sub-problem generator to perform the generative task; considering that the specific principle of the prefix-tuning method can refer to conventional technology, the present invention will not elaborate on it.

[0084] (2) Explanation generation stage.

[0085] This stage takes the multiple sub-problems generated in the step decomposition stage as input and generates reasoning steps (explanation steps) in the order of the sub-problems. Figure 2 As shown, at step i, combined with the input information , generate the corresponding explanation content , if i>1, then the information By the corresponding sub-problem , knowledge-enhanced question text and generated explanation steps. If i=1, then the information That is, the question text for knowledge enhancement; specifically, this part uses the base model, whose input is information , output explanation content ; Afterwards, the relevance evaluation mechanism is used to evaluate the explanation content Relevance to the input question, if the relevance satisfies the requirement, then define the explanation step , otherwise, discard the explanation , define the explanation steps is an empty string; the steps will be explained later Used as context to generate the next sub-question Corresponding explanation steps ; Repeat the above process until the explanation step of the last sub-problem is generated.

[0086] Then, the multi-step thinking chain (explanation process) of the present invention is defined as the sequence obtained by splicing together the explanation steps of each sub-problem: Finally, in order to get the correct option for the question, the present invention will The input is given to the base model, and the base model outputs the prediction result. For example, for the example of the question text in the previous article, the prediction result output here is answer A.

[0087] In an embodiment of the present invention, the base model may be a variety of sequence-to-sequence generative language models, such as a BART model (Bidirectional and Auto-Regressive Transformers), a T5 model (Text to Text Transfer Transformer), a large language model AI (Large Language Model Meta AI, LLaMA), GPT-3.5 (Generative Pre-trained Transformer 3.5), etc. Transformers refers to transform neural networks.

[0088] In the embodiment of the present invention, in order to evaluate the relevance between the explanation content generated in each step and the original question, the present invention extracts the question text and the corresponding manually annotated explanation content from the multi-step reasoning data set, and pre-trains a relevance prediction model (Relevance Score Predictor, RSP). During training, the question text is defined The corresponding explanation is , the two constitute a positive sample pair , the relevance label is 1, and the definition is a negative sample pair with a correlation label of 0, where and j are both markers for the question text; a set number of samples are randomly selected from the positive and negative sample pairs as training data, and the samples in the training data are Input into the relevance prediction model to predict the corresponding relevance score; then, calculate the loss function and optimize the relevance prediction model based on the corresponding relevance label; where q represents the question text in the training data, and r represents the explanation content in the training data.

[0089] For example, the relevance prediction model may be a text classifier based on BERT (Bidirectional Encoder Representation from Transformers) and MLP, and the process of predicting the relevance score may be described as follows:

[0090] ;

[0091] in, For the relevance score, the BERT model is a pre-trained language representation model.

[0092] The training process uses the mean square error loss function (MSE loss) as the optimization target :

[0093] ;

[0094] Among them, 2k is the number of training samples, including k samples with a relevance label of 1 and k samples with a relevance label of 0.

[0095] After training, it can be applied to the explanation generation process described above, that is, to combine the knowledge-enhanced question text with the explanation content. Input into the trained relevance prediction model to predict the corresponding relevance score In the embodiment of the present invention, a correlation threshold is set in advance , if , then it is believed that The relevance to the problem is strong enough (meeting the set requirements), The information can be retained and passed to , as the context for the next step of reasoning, otherwise The contents will be discarded.

[0096] 4. Knowledge Injection Mechanism (KIM).

[0097] In some question-answering tasks, there are many methods and systems that expand the original question by introducing external knowledge related to the question, but such methods are difficult to effectively eliminate factual errors in multi-step reasoning problems. The knowledge injection mechanism (KIM) proposed in the present invention aims to organically couple the introduction of external knowledge with the two-stage system, and use the external knowledge related to the question to guide the generation process of sub-questions in the step decomposition stage and each step of reasoning in the explanation generation stage. Specifically, in the step decomposition stage, the present invention identifies the concepts in the question and links these concepts to the knowledge base of the open domain (for example, Wikidata), and retrieves the knowledge information K related to the question from the knowledge base. The knowledge information K is spliced ​​with the text of the question in the form of text to form a knowledge-enhanced question text, which is input to the sub-question decomposer. In this way, all sub-question generation processes use external knowledge information. At the same time, in each reasoning step in the explanation generation stage, the knowledge-enhanced question text will also be used as the input of the base model to assist the generation of each sub-question explanation step.

[0098] The above solution provided by the present invention mainly achieves the following beneficial effects:

[0099] (1) This invention designs a solution to multi-step reasoning problems that imitates the human cognitive framework. It generates explanation steps in a step-by-step manner, which serves as a multi-step thinking chain to inspire model reasoning, and builds an intelligent system that is closer to the goal of general artificial intelligence, making the model more interpretable. This intelligent system can be used as a general framework to enhance the multi-step reasoning capabilities of various base models, and has strong practical value in achieving strong artificial intelligence.

[0100] 2) The present invention establishes a knowledge fusion mechanism and a relevance evaluation mechanism in the multi-step reasoning problem-solving system, which helps to improve the logical rationality and factual accuracy of the generated reasoning process, thereby improving the accuracy of problem solving. At the same time, the external knowledge introduced by the knowledge fusion mechanism can provide additional information for many question-answering related machine learning tasks; the evaluation of the problem-solving steps by the relevance evaluation mechanism can assist the education platform in making reasonable evaluations and feedback for the solution process, and can provide more personalized online guidance services based on this, bringing more extensive help and benefits.

[0101] 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.

[0102] Embodiment 2

[0103] The present invention also provides an intelligent solution system for multi-step reasoning problems, which is mainly used to implement the method provided in the above embodiment, such as Figure 4 As shown, the system mainly includes:

[0104] A knowledge fusion unit is used to extract text content related to the input question from an external knowledge base as background information using a knowledge fusion mechanism, and concatenate it with the text of the input question to form a knowledge-enhanced question text;

[0105] A step decomposition unit, used for capturing information related to reasoning logic from the knowledge-enhanced question text, and decomposing the question into a plurality of sequential sub-questions;

[0106] The explanation generation unit is used to generate corresponding explanation content in the order of sub-questions and in combination with the knowledge-enhanced question text, and then evaluate it. The corresponding explanation steps are obtained based on the evaluation results. All explanation steps are integrated to form a multi-step thinking chain, and the correct answer corresponding to the input question is predicted.

[0107] Considering that the specific technical details involved in the above system have been introduced in detail in the previous embodiments, they will not be repeated here.

[0108] 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.

[0109] Embodiment 3

[0110] The present invention also provides an intelligent solution device for multi-step reasoning problems, such as Figure 5As 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 in the aforementioned embodiments.

[0111] 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.

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

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

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

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

[0116] Embodiment 4

[0117] 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.

[0118] In the embodiment of the present invention, the readable storage medium as a computer readable storage medium can be set in the aforementioned device, for example, as a memory in the aforementioned 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.

[0119] 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 multi-step reasoning problems, characterized in that: include: Use the knowledge fusion mechanism to extract text content related to the input question from the external knowledge base as background information, and splice it with the input question text to form a knowledge-enhanced question text; Capturing information related to reasoning logic from the knowledge-enhanced question text, and decomposing the question into a plurality of sequential sub-questions; Generate corresponding explanation content according to the order of sub-questions and combined with knowledge-enhanced question text, and then evaluate it. Combine the evaluation results to obtain the corresponding explanation steps. Combine all the explanation steps to form a multi-step thinking chain and predict the correct answer to the input question. The capturing of information related to the reasoning logic from the knowledge-enhanced question text and decomposing the question into a number of sequential sub-questions includes: generating a sub-question in step i , the sub-problem It is concatenated with the knowledge-enhanced question text and the previously generated sub-questions as input for the next step to generate the next sub-question. When the terminator is generated in step n+1, it indicates that the step decomposition phase is terminated, and a sub-problem sequence formed by n sequential sub-problems is obtained. , where i=1,2,...,n, n is the number of the last subproblem; The step decomposition stage is completed by the reasoning type classifier and the next sub-question generator; wherein the reasoning type classifier is implemented based on the transformation neural network architecture, and is used to capture information related to the reasoning logic of the question from the knowledge-enhanced question text, and provide it to the next sub-question generator; the next sub-question generator combines the information provided by the reasoning type classifier, the knowledge-enhanced question text and all previously generated sub-questions to generate the next sub-question; The steps of generating corresponding explanation contents according to the order of sub-questions and combining the question text with knowledge enhancement and then evaluating, and obtaining corresponding explanations in combination with the evaluation results include: In step i, combined with the input information , generate the corresponding explanation content , if i>1, then the information By the corresponding sub-problem , knowledge-enhanced question text and generated explanation steps. If i=1, then the information That is, the question text is knowledge-enhanced; the explanation content is evaluated using the relevance evaluation mechanism Relevance to the input question, if the relevance satisfies the requirement, then define the explanation step , otherwise, discard the explanation content , define the explanation steps is an empty string; the steps will be explained later Used as context to generate the next sub-question Corresponding explanation steps ; Repeat until the explanation step of the last sub-problem is generated.

2. The intelligent solution method for multi-step reasoning problems according to claim 1, characterized in that: The reasoning type classifier is pre-trained on a multi-step reasoning data set. During pre-training, the reasoning type classifier includes: a text encoder and a reasoning type predictor. The text encoder generates a semantic vector representation of the question text in the data set. The reasoning type predictor predicts the reasoning type corresponding to the question text according to the semantic vector representation. Afterwards, the reasoning type corresponding to the predicted question text and the reasoning type label in the data set optimize the reasoning type classifier. After pre-training is completed, the text encoder is retained; information related to the reasoning logic of the question, that is, the corresponding semantic vector representation, is extracted through the text encoder and provided to the next sub-question generator.

3. An intelligent solution method for multi-step reasoning problems according to claim 1 or 2, characterized in that: The input of the next sub-question generator is the knowledge-enhanced question text and the previously generated sub-question, and the prefix vector pair is extracted from the information provided by the reasoning type classifier using the prefix fine-tuning method. as input; the next sub-question generator adopts a sequence-to-sequence generative model architecture and is pre-trained on a multi-step reasoning dataset; the sequence-to-sequence generative model architecture includes an encoder and a decoder, and the input of the encoder includes the knowledge-enhanced question text and the previously generated sub-questions, as well as the prefix vector , the decoder input includes: the encoder output and the prefix vector , output the next sub-problem.

4. The intelligent solution method for multi-step reasoning problems according to claim 1, characterized in that: Also includes: Pre-train a relevance prediction model. During training, define the question text. The corresponding explanation is , the two constitute a positive sample pair , the relevance label is 1, and the definition is a negative sample pair with a correlation label of 0, where and j are both marking symbols of the question text; a set number of samples are randomly selected from the positive and negative sample pairs as training data, and the samples in the training data are input into the relevance prediction model to predict the corresponding relevance scores; then, the loss function is calculated in combination with the corresponding relevance labels and the relevance prediction model is optimized; After training, the knowledge-enhanced question text and explanation content are combined Input into the trained relevance prediction model to predict the corresponding relevance score ,like , it means that the correlation meets the requirements, among which, is the set correlation threshold.

5. An intelligent solution system for multi-step reasoning problems, characterized in that: The method for implementing any one of claims 1 to 4 comprises: A knowledge fusion unit is used to extract text content related to the input question from an external knowledge base as background information using a knowledge fusion mechanism, and concatenate it with the text of the input question to form a knowledge-enhanced question text; A step decomposition unit, used for capturing information related to reasoning logic from the knowledge-enhanced question text, and decomposing the question into a plurality of sequential sub-questions; The explanation generation unit is used to generate corresponding explanation content in the order of sub-questions and in combination with the knowledge-enhanced question text, and then evaluate it. The corresponding explanation steps are obtained based on the evaluation results. All explanation steps are integrated to form a multi-step thinking chain, and the correct answer corresponding to the input question is predicted.

6. An intelligent solution device for multi-step reasoning problems, 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 4.

7. 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 4 is implemented.