Method for generating answer to question, electronic device and computer program product
By designing multiple replies rules in the auxiliary knowledge Q&A model and simulating different thinking processes, selecting the optimal thinking process to generate answers, the existing auxiliary knowledge Q&A model has solved the problem of low intelligence level and low answer accuracy, and achieving higher intelligence level and answer accuracy.
Patent Information
- Application Number
- CN202510247222.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-04
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2045-03-04
AI Technical Summary
The existing auxiliary knowledge Q&A model has a low level of intelligence, which cannot effectively improve the accuracy of answers, and can only improve the model performance by increasing the amount of training data.
By designing multiple replies that represent the thinking process in the auxiliary learning scenario, and sorting these rules differently, we simulate different thinking processes, and finally selecting the reply content generated under the optimal thinking process as the answer to the question.
It improves the intelligence level of the reply process, brings it closer to the human thinking process, and improves the accuracy of the answer without increasing the amount of training data.
Smart Images

Figure CN119808962A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a method for generating answers to questions, an electronic device, and a computer program product. Background Art
[0002] In the long history of educational development, personalized education has gradually become an important direction for current educational reform and development. The traditional compulsory education model focuses on the unified imparting of knowledge, which is usually difficult to fully tap the potential of each student. In the current social environment, personalized education has gradually become an inevitable choice for cultivating talents that adapt to future social development. At this stage, online learning platforms and intelligent learning assistance are emerging in an endless stream. The learning assistance question-and-answer model can automatically answer questions raised by learners. It can not only help learners make progress in learning, but also collect and analyze learners' learning data. Educators can use these learning data to understand students' learning status, accurately customize learning plans for each learner, and achieve personalized education.
[0003] At present, large models can provide a solid technical foundation for intelligent learning assistance with their powerful language processing capabilities and intelligent algorithms. Therefore, learning assistance question-answering models are usually large models. In addition, by training large models with a large amount of high-quality annotated data, we can obtain learning assistance question-answering models that can automatically answer questions.
[0004] However, the current learning-assisted question-answering model has a low intelligence level and can usually only generate answers directly based on the model parameters, resulting in low model accuracy. The accuracy of the model can only be improved by increasing the amount of training data. Summary of the invention
[0005] Based on the above technical status, the present application proposes a method for generating answers to questions, an electronic device and a computer program product.
[0006] According to a first aspect of an embodiment of the present application, a method for generating an answer to a question is provided, the method for generating an answer to a question comprising: In response to the input questions to be answered, multiple answer rules representing the thinking process in the auxiliary learning scenario are determined; the answer rules are the rules that need to be followed when answering the questions; Perform different sorting on multiple response rules, simulate different thinking processes based on the different sorting results, and select the response content generated under the optimal thinking process as the answer to the question to be answered; wherein the response content generated under the thinking process is generated based on the response content corresponding to each response rule contained in the thinking process.
[0007] Optionally, in response to the input question to be answered, multiple answer rules representing the thinking process in the auxiliary learning scenario are determined; the multiple answer rules are sorted differently, different thinking processes are simulated based on different sorting results, and the answer content generated under the optimal thinking process is selected as the answer to the question to be answered, including: The question to be answered is input into a pre-trained auxiliary learning question and answer model, so that the auxiliary learning question and answer model responds to the input question to be answered and determines multiple answer rules that characterize the thinking process in the auxiliary learning scenario; the multiple answer rules are sorted differently, different thinking processes are simulated based on different sorting results, and the answer content generated under the optimal thinking process is selected as the answer to the question to be answered.
[0008] Optionally, the multiple answer rules characterizing the thinking process in the auxiliary learning scenario include: A response rule for responding to questions in a supplementary learning scenario and a response rule for evaluating and / or re-responding to answers to questions in a supplementary learning scenario.
[0009] Optionally, the answering rule for answering questions in the auxiliary learning scenario includes at least one of the following: Present one step of reasoning at a time; Give the answer directly after simple reasoning at one time; Break down the original question into multiple sub-questions and answer the sub-questions; Restate the question; Emphasize the original question.
[0010] Optionally, a plurality of answer rules are sorted differently, different thinking processes are simulated based on the different sorting results, and the answer content generated under the optimal thinking process is selected as the answer to the question to be answered, including: Generate multiple reply content paths; wherein the multiple reply content paths correspond to reply rule paths representing different thinking processes in auxiliary learning scenarios, and different reply rule paths are composed of the multiple reply rules in different arrangement orders; Determining the optimal reply content path based on the reward score of each reply content path; wherein the reward score is positively correlated with the reply quality; The last reply content in the optimal reply content path is determined as the answer to the question to be answered.
[0011] Optionally, the reward score includes: the sum of the result reward score and the process reward score; Among them, the result reward score includes: a reward score that is positively correlated with the reply quality of the last reply content in the reply content path, and the process reward score includes: a reward score that is positively correlated with the reply quality of the reply content path.
[0012] Optionally, the multiple reply content paths are search paths constructed based on a Monte Carlo tree search algorithm, and each reply content in the reply content path corresponds to a node in the search path; Determining an optimal reply content path based on the reward score of each reply content path includes: For each of the search paths, the sum of the upper confidence interval values of each node is calculated; The target search path is determined as the optimal reply content path, wherein the target search path is the search path with the largest sum of upper confidence interval values.
[0013] Optionally, the training process of the auxiliary learning question-answering model includes: Acquire training data; wherein each piece of the training data includes: a question and a response content generated based on a plurality of response rules representing a thinking process in a learning assistance scenario; The auxiliary learning question and answer model is trained based on the training data; wherein, during the training process, the auxiliary learning question and answer model will generate answers to the questions in the training data based on the multiple response rules that characterize the thinking process in the auxiliary learning scenario.
[0014] Optionally, the auxiliary learning question-answering model includes: a reward score module and a question-answering module, wherein the reward score module is used to generate a reward score for each answer content path; the question-answering module is used to generate multiple answer content paths, and determine the answer to the question in the training data based on the reward score of each answer content path; Among them, the reward score is positively correlated with the quality of the answer, the multiple answer content paths correspond to answer rule paths that represent different thinking processes in the auxiliary learning scenario, and different answer rule paths are composed of the multiple answer rules in different arrangement orders.
[0015] Optionally, the training process of the auxiliary learning question-answering model further includes: The proportion of correct answers generated by the auxiliary learning question-answering model in the target situation is used as the real reward score; and / or the average of the reward scores of the auxiliary learning question-answering model in the target situation is used as the real reward score; wherein the target situation includes the situation where answers to the same question are generated multiple times in a row; The reward score module is trained according to the real reward score.
[0016] According to a second aspect of an embodiment of the present application, a device for generating an answer to a question is provided, and the device for generating an answer to a question includes: A reply rule module is used to respond to the input questions to be answered and determine multiple reply rules that characterize the thinking process in the auxiliary learning scenario; the reply rules are the rules that need to be followed when answering the questions; The answer generation module is used to sort multiple answer rules differently, simulate different thinking processes based on different sorting results, and select the answer content generated under the optimal thinking process as the answer to the question to be answered; wherein the answer content generated under the thinking process is generated based on the answer content corresponding to each answer rule contained in the thinking process.
[0017] According to a third aspect of an embodiment of the present application, an electronic device is provided, comprising a memory and a processor; the memory is connected to the processor and is used to store programs; the processor is used to implement the method for generating answers to questions as described in the first aspect by running the programs in the memory.
[0018] According to a fourth aspect of an embodiment of the present application, a storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method for generating answers to questions as described in the first aspect is implemented.
[0019] According to a fifth aspect of an embodiment of the present application, a computer program product is provided, comprising: a computer program, which, when executed by a processor, implements the method for generating answers to questions as described in the first aspect.
[0020] In the embodiment of the present application, multiple answer rules are designed to characterize the thinking process in the auxiliary learning scenario, so that in the process of answering the input questions to be answered, the multiple answer rules are sorted differently to simulate different thinking processes, and the answer content generated under the optimal thinking process is selected as the answer to the question to be answered. The answer process is closer to the human thinking process. Compared with directly generating answers according to model parameters, the level of intelligence is improved. In addition, the accuracy of the answer can also be improved without increasing the amount of training data. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0022] Figure 1 A flowchart of a method for generating answers to questions provided in an embodiment of the present application.
[0023] Figure 2A schematic diagram of a search tree provided for an embodiment of the present application.
[0024] Figure 3 A schematic diagram of the structure of a device for generating answers to questions provided in an embodiment of the present application.
[0025] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0026] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0027] Overview As described in the background technology, the auxiliary learning question-answering model is usually a large model. The existing large model training paradigms are mainly the following: 1. Retraining: Use a mixture of general data and domain data to train a large model from scratch. 2. Secondary pre-training: Continue pre-training (secondary pre-training) based on a general model. 3. Basic large model fine-tuning: Perform instruction tuning (instruction fine-tuning) based on a general model. 4. General large model + vector knowledge base: For questions that the general large model has seen less knowledge about, find relevant content in the vector knowledge base based on the question, and then use the powerful capabilities of the general large model to generate responses.
[0028] However, the existing large model training paradigm has the following challenges: First, it is highly dependent on training data: performance improvements usually require increasing the amount of training data rather than improving the learning algorithm itself. Second, the generalization ability is limited: in scenarios outside the distribution of training data, performance may drop sharply. Finally, there is a lack of trial and error, reflection, and self-correction capabilities. Due to the above challenges, the current level of intelligence of the auxiliary learning question-and-answer model is low, and the model accuracy is not high. And the accuracy of the model can only be improved by increasing the amount of training data.
[0029] In view of the above-mentioned technical status, an embodiment of the present application proposes a method for generating answers to questions. Design multiple reply rules that characterize the thinking process in the auxiliary learning scenario, so that in the process of answering the input questions to be answered, the multiple reply rules are sorted differently to simulate different thinking processes, and the reply content generated under the optimal thinking process is selected as the answer to the question to be answered. The reply process is made closer to the human thinking process. Compared with directly generating answers according to model parameters, the level of intelligence is improved. Moreover, the accuracy of the answer can also be improved without increasing the amount of training data.
[0030] Exemplary Methods See also Figure 1 In an exemplary embodiment, a method for generating an answer to a question is provided, which can be applied to any electronic device, including but not limited to a computer, a server, a smart phone, etc. The method for generating an answer to a question may include: S101: In response to an input question to be answered, a plurality of answer rules representing a thinking process in a supplementary learning scenario are determined.
[0031] It should be noted that the question to be answered can be any question input by the user. In some embodiments, in the auxiliary learning scenario, the question to be answered can be the content related to the learning content proposed by the user during the learning process. The learning process includes at least one of the six learning processes: analysis, video, structured analysis, interactive analysis, interactive video, and Socrates' blackboard explanation based on the cause of error. Among them, analysis can be understood as a detailed explanation and description of the learning content to help learners understand the knowledge points. Video can be understood as watching relevant teaching videos so that learners can understand the knowledge points more intuitively and improve the learning effect. Structured analysis can be understood as systematically arranging and summarizing knowledge points to form a structured knowledge system for learners to remember and master. Interactive analysis can be understood as adding interactive links on the basis of the aforementioned analysis, allowing learners to participate in the problem-solving process and improve the initiative and enthusiasm of learning. Interactive video can be understood as combining video teaching, setting interactive links, allowing learners to participate in interaction while watching videos, and enhancing the fun and practicality of learning. The Socratic blackboard explanation based on the cause of error can be understood as using the Socratic questioning method to guide students to discover, analyze and solve problems by themselves, aiming at common errors that occur in the learning process, thereby improving students' learning and thinking abilities. In some embodiments, the user can input voice data, and then use voice recognition technology to convert the voice data into text data to obtain questions to be answered.
[0032] It can be understood that the auxiliary learning scenarios in this application specification include: any scenarios that assist learners in learning, for example, the scenarios of the above six learning processes.
[0033] The answer rule is the rule that needs to be followed when answering questions. For example, the answer rule can be to give an answer directly after a simple reasoning at one time. When answering the question of what 1+1 equals according to this answer rule, the answer content of 1+1 equals 2 can be output. In this embodiment, the multiple answer rules are determined based on the thinking process of answering questions in the auxiliary learning scenario, so that the process of answering questions according to the multiple answer rules can simulate humans answering the answer. Among them, the aforementioned thinking process includes but is not limited to: trial and error, reflection, backtracking and other thinking.
[0034] In some embodiments, multiple answering rules that humans need to follow in sequence when answering questions can be summarized based on the above six learning processes.
[0035] S102: sorting multiple answer rules in different ways, simulating different thinking processes based on the different sorting results, and selecting the answer content generated under the optimal thinking process as the answer to the question to be answered.
[0036] It should be noted that when humans think about the answer to a question, the logic or train of thought they follow is usually not unique. For example, most people will try different thinking processes or trains of thought to find the best answer. In this step, after sorting or combining multiple answer rules in different orders, each sorting result will correspond to a train of thought or thinking process. After determining the optimal thinking process, the answer content obtained under the corresponding sorting result can be used as the answer to the question to be answered.
[0037] It is worth noting that when generating a reply content for any reply rule, it is necessary to consider the reply content corresponding to all reply rules before the reply rule in the same thinking process. Therefore, the reply content generated for the same reply rule in different thinking processes is not the same. In this embodiment, the reply content generated under the thinking process is generated based on the reply content corresponding to each reply rule included in the thinking process.
[0038] In the embodiment of the present application, multiple answer rules are designed to characterize the thinking process in the auxiliary learning scenario, so that in the process of answering the input questions to be answered, the multiple answer rules are sorted differently to simulate different thinking processes, and the answer content generated under the optimal thinking process is selected as the answer to the question to be answered. The answer process is closer to the human thinking process. Compared with directly generating answers according to model parameters, the level of intelligence is improved. In addition, the accuracy of the answer can also be improved without increasing the amount of training data.
[0039] In some embodiments of the present application, in response to an input question to be answered, multiple answer rules representing the thinking process in the auxiliary learning scenario are determined; the multiple answer rules are sorted differently, different thinking processes are simulated based on different sorting results, and the answer content generated under the optimal thinking process is selected as the answer to the question to be answered, including: The questions to be answered are input into a pre-trained auxiliary learning question and answer model, so that the auxiliary learning question and answer model responds to the input questions to be answered and determines multiple answer rules that characterize the thinking process in the auxiliary learning scenario; the multiple answer rules are sorted differently, different thinking processes are simulated based on different sorting results, and the answer content generated under the optimal thinking process is selected as the answer to the question to be answered.
[0040] It should be noted that the above S101-S102 can be implemented with the aid of an auxiliary learning question-answering model. The auxiliary learning question-answering model is pre-trained and can simulate the human thinking process when answering questions, thereby generating answers to the questions to be answered. In some embodiments, the auxiliary learning question-answering model can be a large model, but is not limited thereto.
[0041] In the embodiment of the present application, with the help of a pre-trained auxiliary learning question-answering model, when answering questions, the human thinking process is simulated to generate answers to the questions to be answered.
[0042] In some embodiments of the present application, a plurality of answer rules characterizing the thinking process in the auxiliary learning scenario include: A response rule for responding to questions in a supplementary learning scenario and a response rule for evaluating and / or re-responding to answers to questions in a supplementary learning scenario.
[0043] It should be noted that the answering rules for answering questions in the auxiliary learning scenario include: in the auxiliary learning scenario, when simulating humans to answer learners' questions about learning content, the answering rules that need to be followed. In some embodiments, the answering rules for answering questions in the auxiliary learning scenario include at least one of the following: Present one step of reasoning at a time; Give the answer directly after simple reasoning at one time; Break down the original question into multiple sub-questions and answer the sub-questions; Restate the question; Emphasize the original question.
[0044] The answering rules for evaluating and / or re-answering answers to questions in the learning assistance scenario include: in the learning assistance scenario, simulating the answering rules that humans need to follow when evaluating or re-answering answers to questions. In some embodiments, the answering rules for evaluating and / or re-answering answers to questions in the learning assistance scenario include: rethinking the answer; evaluating the quality of the answer.
[0045] In some embodiments, the multiple reply rules set include: A1: propose a reasoning step each time; A2: give the answer directly after simple reasoning at one time; A3: break the original question into multiple sub-questions and answer the sub-questions; A4: rethink the answer again; A5: repeat the question; A6: emphasize the original question. Among them, repeating the question includes describing the original question again in a different way from the original question. Taking the interactive mathematics video scene (students can ask questions about the doubts in the video, or ask an independent question) as an example, the meanings of A1-A7 are introduced respectively, among which A4 and A7 depend on the answers or reply content that have been output, so they need to be cascaded behind A1, A2, and A3. For example, if the question to be answered is: What is 1+1 equal to? Then, the reply content of A1 can be 1+1 equals 2. The reply content of A2 can be 1+1 equals 2. The reply content of A3 can be in what scenario is this question asked? In the primary school mathematics scene. The reply content of A6 can be that we need to solve the original question 1+1 equals to what? If you select A3 first and then A4, the answer can be that it is indeed in the context of elementary school mathematics. If you select A1 first and then A7, the answer can be that the answer is too simple and not comprehensive enough, for example, in binary operations on computers, 1+1 is not equal to 2.
[0046] In the embodiment of the present application, the reply rules include not only the rules for replying to questions, but also the rules for evaluating the answers to questions and re-replying questions, so as to fully reflect the thinking process.
[0047] In some embodiments of the present application, multiple answer rules are sorted differently, different thinking processes are simulated based on the different sorting results, and the answer content generated under the optimal thinking process is selected as the answer to the question to be answered, including: Generate multiple reply content paths; wherein the multiple reply content paths correspond to reply rule paths representing different thinking processes in the auxiliary learning scenario, and different reply rule paths are composed of multiple reply rules in different arrangement orders; Based on the reward score of each reply content path, determine the optimal reply content path; wherein the reward score is positively correlated with the reply quality; The last reply content in the optimal reply content path is determined as the answer to the question to be answered.
[0048] It should be noted that after arranging multiple reply rules in different arrangements / sorting methods, different reply rule paths can be generated, which can also represent different thinking processes. The reply content path corresponding to each thinking process or each reply rule path includes: a path composed of reply contents generated by replying in the order of each reply rule in the reply rule path. For example, a certain reply rule path includes: A1, A2, A3, and A4 provided in the above embodiment. Assume that the question to be answered is: 1+1 equals to how many. Then the reply content path corresponding to the reply rule path includes: A1: 1+1 equals to 2. A2: 1+1 equals to 2. A3: In what scenario is this question asked? In the scenario of elementary school mathematics. A4: Indeed in the scenario of elementary school mathematics. It is worth noting that the number of reply rules in each reply rule path is not the same. In some embodiments, a random sorting method can be used to combine and sort multiple reply rules to generate multiple reply rule paths. In other embodiments, the combination sorting methods of multiple reply rules can be exhaustively enumerated to generate reply rule paths for each combination sorting method.
[0049] It is understandable that when answering questions according to different thinking processes, the quality of the answer is closely related to the rationality of the thinking process. The more reasonable the thinking process, the higher the quality of the answer. Conversely, the more unreasonable the thinking process, the worse the quality of the answer. Here, a reward score is used to measure the answer quality of the thinking process or the answer rule path or the answer content path. Therefore, when selecting the optimal answer content path from multiple answer content paths, the selection is based on the reward score. In some embodiments, the answer content path with the highest reward score can be selected as the optimal answer content path. In other embodiments, the reward score can also be used as the initial value, and brought into a pre-designed calculation formula to obtain a calculation result that can more accurately measure the answer quality. Then the answer content path with the largest calculation result is selected as the optimal answer content path.
[0050] In some embodiments, when the answer to the question to be answered is generated by the auxiliary learning question-answering model, a reward score module for outputting a reward score can be set in the auxiliary learning question-answering model. During the model training process, the reward score module is trained so that it can generate a reward score for each answer content path.
[0051] In some embodiments, the last reply rule of the reply rule path can be set as a reply rule for defining the final conclusion. In this way, after determining the optimal reply content path, the last reply content can be output as the final answer. For example, in the case where multiple reply rules include A1 to A7 in the above embodiment, the last reply rule in each reply rule path is A2 or A3.
[0052] In the embodiment of the present application, different thinking processes of human beings can be simulated to generate multiple reply content paths, and then the answer to the question to be answered is generated based on the optimal reply content path, which can further improve the accuracy of the answer.
[0053] In some embodiments of the present application, the bonus score includes: the sum of the result bonus score and the process bonus score; Among them, the result reward score includes: the reward score that is positively correlated with the reply quality of the last reply content in the reply content path, and the process reward score includes: the reward score that is positively correlated with the reply quality of the reply content path.
[0054] It should be noted that the result reward score can be regarded as a reward score generated when focusing on the final result (the final answer). Since the last reply content in the reply content path will be used as the answer when determining the final result, the result reward score is positively correlated with the reply quality of the last reply content in the reply content path. In some embodiments, when the reply content path includes multiple nodes and each node represents a reply content, the result reward score can be the reward score of the last node.
[0055] The process reward score can be regarded as a reward score generated by focusing on the thinking process. This is related to each reply content in the reply content path. Therefore, the process reward score is positively correlated with the reply quality of the reply content path. Among them, the reply quality of the reply content path can be the reply quality of each reply content in the reply content path or the reply quality of the remaining reply content except the last reply content. In some embodiments, when the reply content path includes multiple nodes and each node represents a reply content, the process reward score is the sum of the reward scores of all non-leaf nodes. For the reward score, for example, reward score = m*leaf node reward score + (1-m)*non-leaf node reward score, the leaf node is the last node.
[0056] In the embodiment of the present application, a process reward score is added to the reward score, and the feature of the thinking process is added to the reward, making the reward score more reasonable and accurate.
[0057] In some embodiments of the present application, the plurality of reply content paths are search paths constructed based on a Monte Carlo tree search algorithm, and each reply content in the reply content path corresponds to a node in the search path; Based on the reward score of each reply content path, the optimal reply content path is determined, including: For each search path, the sum of the upper confidence interval values of each node is calculated; The target search path is determined as the optimal reply content path, wherein the target search path is the search path with the largest sum of upper confidence interval values.
[0058] It should be noted that the upper confidence interval value is the UCT (Upper Confidence Bound Apply to Tree) value. The UCT value of each point can be calculated according to Formula 1: ; Among them, UCT represents the UCT value; Q represents the cumulative reward of the node up to this round; N represents the cumulative number of visits to the node up to this round; Indicates the cumulative number of visits to the parent node of the node up to this round; C represents the exploration weight, and the larger the C value, the more emphasis is placed on exploration rather than on utilization. In some embodiments, for early rounds, a larger C is used to focus on exploration, and for later rounds, a smaller C is used.
[0059] It can be understood that the Monte Carlo Tree Search algorithm (MCTS) is an algorithm used to find the best decision in the decision-making process. It usually includes four main steps: selection, expansion, simulation, and backpropagation. Among them, selection: Starting from the root node, the selection strategy guides the algorithm to move down the tree to the leaf node. This process repeatedly applies the UCT formula and continuously compares the statistics of each node until it reaches a node that has not been fully expanded. The main goal is to find a balance point that ensures that the nodes with high UCT values are repeatedly visited while ensuring that the nodes that have not been fully explored are explored. Expansion: Once the selection process reaches a node that has not been fully expanded, the algorithm will select one or more unexplored actions to expand the search tree. This step mainly increases the width of the search tree and allows the algorithm to explore new strategies. Simulation: After the expansion phase, the algorithm simulates the game randomly starting from the current node. The simulation process continues to reach a predetermined termination condition, such as the end of the game or reaching a certain depth limit. Backtracking: After the simulation is finished, the algorithm traces the simulation results from the current node all the way back to the root node and updates the statistical information of all nodes on this path. This step ensures the learning process of the algorithm, so that the subsequent selection steps can make better decisions.
[0060] For ease of understanding, the following example illustrates the process of using the Monte Carlo tree algorithm to determine the best path (optimal answer content path). In this example, the multiple answer rules that characterize the thinking process in the auxiliary learning scenario include the contents of A1 to A7 in the above embodiment, which will not be repeated here. In this example, the process of determining the best path can be divided into three stages.
[0061] Phase 1: Construct the search tree.
[0062] 1.1. The root node of the search tree is the original problem. Starting from the root node, the process of constructing the search tree in the first round is as follows: Execute the selection step and select the root node. In the case where the original question is how many 1+1 equals, the root node 201 is Figure 2 shown.
[0063] Execute the expansion step, and create all possible child nodes for the selected node (here, the root node 201) according to the content of A1 to A7 and the dependency rules of the quality inspection. Among them, the dependency rules of the quality inspection include: A4 and A7 depend on the output answers or reply content, so they need to be cascaded behind A1, A2, and A3. The child nodes of the root node 201 are as follows: Figure 2 As shown, it can be regarded as the first-level child node 202. Here, Figure 2 Only a portion of the search tree is shown.
[0064] The simulation step is executed, a child node (the first-level child node 202) is randomly selected, and the expansion step is repeatedly executed until a leaf node (A2, A3) is encountered or the set maximum search depth is reached.
[0065] Execute the backtracking step to calculate the reward of the leaf node, and at the same time add all the non-leaf node rewards on the current search path += m*leaf node reward + (1-m)*non-leaf node reward, and the number of node visits += 1. For leaf nodes, use the result-based reward model to output rewards (equivalent to the result reward score in the above embodiment). For non-leaf nodes, use the process-based reward model to output rewards (equivalent to the process reward score in the above embodiment).
[0066] 1.2. Execute the second round of search tree construction. The process of the second round of search tree construction is as follows: Execute the selection step. The second round will start from the search tree constructed by the backtracking step in the first round. Also start from the root node and select downwards, go to the first layer first. If it is found that there is a child node that has not been explored, a child node will be randomly selected, and this child node will be used to execute the expansion step. This execution of the selection step follows the following two principles: 1) Start from the root node each time and explore downward layer by layer until an unexplored node is found. 2) If starting from the root node, it is found that all nodes in a certain layer (such as the first layer) have been explored. Then select the node with the largest UCT value and continue searching in the next layer, and so on.
[0067] Executing the expansion step, executing the simulation step, and executing the backtracking step are the same as the same steps in the first round of constructing the search tree, and will not be repeated here.
[0068] 1.3. Repeat the process several times to construct the search tree. It is worth noting that Figure 2 Except for the root node, each node corresponds to a reply content. Figure 2 The reply content and reply rules corresponding to the nodes are shown in . It can be understood that for the same reply rules in different paths, the reply content may be the same or different. For example, the path composed of "A1: 1+1 equals 2", "A7: The answer is too simple and not comprehensive enough. For example, in binary operations of computers, 1+1 is not equal to 2", "A2: In elementary school mathematics operations, 1+1 equals 2" is the first path, and the path composed of "A3: In what scenario is this question asked? In the elementary school mathematics scenario", "A1: In elementary school mathematics operations, 1+1 equals 2", "A7: The answer is direct and error-free", "A2: In elementary school mathematics operations, 1+1 equals 2" is the second path. The reply content for A7 in the two paths is different, and the reply content for A2 is the same.
[0069] Phase 2: Based on the search tree finally constructed in Phase 1, the UCT value of each node is calculated. The process of calculating the UCT value is shown in Formula 1 above and will not be repeated here.
[0070] Phase 3: Select the path with the highest node cascade score as the best path.
[0071] In the embodiment of the present application, the best search path can be determined with the help of the Monte Carlo tree search algorithm, so that the optimal reply content path can be quickly determined.
[0072] In some embodiments of the present application, the training process of the auxiliary learning question answering model includes: Acquire training data; wherein each piece of training data includes: a question and a response content generated based on multiple response rules representing a thinking process in a learning assistance scenario; The auxiliary learning question and answer model is trained based on the training data; during the training process, the auxiliary learning question and answer model will generate answers to the questions in the training data based on multiple response rules that characterize the thinking process in the auxiliary learning scenario.
[0073] It should be noted that the questions in the training data can be questions raised by learners in the pre-collected learning scenarios. The answer content can be understood as the result of the annotation of the training data. Therefore, by using the questions and the annotated answer content as training data for model training, a learning-aiding question-answering model can be obtained that has the ability to simulate the human thinking process to generate answers to questions when answering questions.
[0074] In some embodiments, during the training of the auxiliary learning question-answering model, the auxiliary learning question-answering model will generate multiple answer content paths; wherein, the multiple answer content paths correspond to answer rule paths that characterize different thinking processes in the auxiliary learning scenario, and different answer rule paths are composed of multiple answer rules in different arrangement orders; based on the reward score of each answer content path, the optimal answer content path is determined; wherein the reward score is positively correlated with the answer quality; the last answer content in the optimal answer content path is determined as the answer to the question to be answered. Wherein, this process can refer to the description of the similar content part in the above embodiment, which will not be repeated here. Further, during the training of the auxiliary learning question-answering model, the multiple answer content paths are search paths constructed based on the Monte Carlo tree search algorithm, and each answer content in the answer content path corresponds to a node in the search path; based on the reward score of each answer content path, the optimal answer content path is determined, including: for each search path, the sum of the upper confidence interval values of each node is calculated; the target search path is determined as the optimal answer content path, wherein the target search path is the search path with the largest sum of the upper confidence interval values. Among them, this process can refer to the description of similar content in the above embodiment, and will not be repeated here.
[0075] In some embodiments, the pre-trained auxiliary learning question-answering model may be a large model with general question-answering capabilities. Training the auxiliary learning question-answering model based on the training data includes: fine-tuning the auxiliary learning question-answering model based on the training data.
[0076] In the embodiment of the present application, the questions and the annotated answers are used as training data for model training, and a learning-aiding question-answering model can be obtained that has the ability to simulate the human thinking process to generate answers when answering questions. Therefore, a learning-aiding question-answering model with high accuracy can be generated without relying too much on the amount of training data.
[0077] In some embodiments of the present application, the learning-assisted question-answering model includes: a reward score module and a question-answering module, the reward score module is used to generate a reward score for each answer content path; the question-answering module is used to generate multiple answer content paths, and determine the answer to the question in the training data based on the reward score of each answer content path; Among them, the reward score is positively correlated with the quality of the answer. Multiple answer content paths correspond to answer rule paths that represent different thinking processes in auxiliary learning scenarios, and different answer rule paths are composed of multiple answer rules in different arrangement orders.
[0078] It should be noted that the learning-assisted question-answering model uses a reinforcement learning scheme to design a reward score module and a question-answering module, and performs reinforcement learning through the cooperation of the two parts to complete the model training process. It is worth noting that for the description of the reward score and the quality of the answer, please refer to the description of the same features in the above embodiment, which will not be repeated here.
[0079] In the embodiment of the present application, a reward score module and a question-and-answer module are designed with the help of a reinforcement learning scheme, so that the auxiliary learning question-and-answer model can integrate the advantages of reinforcement learning during the training process.
[0080] In order to improve the rationality and accuracy of the reward score, in some embodiments of the present application, the reward score module is trained, including: Filter the first type of data and / or the second type of data through the auxiliary learning question-answering model; Training the reward score module based on the filtered first type of data and / or second type of data; Among them, the first type of data includes: training data whose total reward score is higher than the first score threshold but the answer to the question is incorrect; the second type of data includes: training data whose total reward score is higher than the second score threshold, but the result reward score is lower than the third score threshold; the total reward score includes: the sum of the result reward score and the process reward score; the result reward score includes: the reward score that is positively correlated with the reply quality of the last reply content in the reply content path, and the process reward score includes: the reward score that is positively correlated with the reply quality of the reply content path.
[0081] It should be noted that by training the bonus score module, the bonus score output by it can be more reasonable and accurate. In this embodiment, considering different auxiliary learning scenarios, the training data should focus on different aspects. Therefore, by screening, the data that meets the requirements is screened as the data for training the bonus score module. For example, in the analysis, video, and structured analysis scenarios, the overall score (total bonus score) is very high, but the final answer is wrong. In the interactive analysis, interactive video, and Socrates' blackboard explanation based on the cause of error, the data with a high overall score (total bonus score) but a low result bonus score is screened. Among them, the relevant descriptions of the contents of analysis, video, structured analysis, interactive analysis, interactive video, Socrates' blackboard explanation based on the cause of error, and the result bonus score in this embodiment can be found in the description of the same content in the above embodiment, which will not be repeated here.
[0082] In some embodiments, in the process of training the reward score module using the first type of data and the second type of data, the manual scoring can be used as the real reward score of the model. The trained reward score module is finally generated through iterative training.
[0083] In the embodiment of the present application, the reward score module is trained with the help of the screened first type data and second type data, so that the training process is more targeted. The reward score output by the trained reward score module is more reasonable and accurate.
[0084] In order to improve the rationality and accuracy of the reward score, in some embodiments of the present application, the training process of the auxiliary learning question answering model also includes: The proportion of correct answers generated by the auxiliary learning question-answering model in the target situation is taken as the real reward score; and / or the average of the reward scores of the auxiliary learning question-answering model in the target situation is taken as the real reward score; wherein the target situation includes the situation where answers to the same question are generated multiple times in a row; The reward score module is trained based on the true reward scores.
[0085] It should be noted that by training the bonus score module, the bonus score output by it can be more reasonable and accurate. In this embodiment, considering that the calculation rules of the bonus score are different in different auxiliary learning scenarios. Therefore, different algorithms are designed for different auxiliary learning scenarios to calculate the real bonus score. For example, in the scenarios of analysis, video, and structured analysis, N answers are generated for the same question, and then the proportion of correct answers is calculated, and this proportion is used as the real bonus score; 2) In the scenarios of interactive analysis, interactive video, and Socrates' blackboard explanation based on the cause of error, M final results are generated for the same question, and then the average score of the bonus scores of the M final results is calculated, and this average score is used as the real bonus score. Among them, the relevant descriptions of analysis, video, structured analysis, interactive analysis, interactive video, and Socrates' blackboard explanation based on the cause of error can be found in the description of the same content in the above embodiment, which will not be repeated here. M and N are both integers greater than 2.
[0086] In the embodiment of the present application, different algorithms are designed for different auxiliary learning scenarios to calculate the actual reward score, so that the reward score output by the trained reward score module is more reasonable and accurate.
[0087] In some embodiments, when training the reward score module, a manual scoring method may be used to generate a real reward score, and then the reward score module is trained based on the real reward score.
[0088] The learning-assisted question-answering model provided in the embodiment of the present application can continuously improve through learning, reflection, backtracking and adaptation, just like humans, thereby demonstrating a higher level of intelligence. In the training phase, a general thinking process is first defined; then the model is fine-tuned based on the thinking process; and finally, a reward model based on the thinking process is trained. In the reasoning phase, the Monte Carlo tree search algorithm is used to find the optimal response result.
[0089] Exemplary Devices Accordingly, the present application also provides a device for generating answers to questions, see Figure 3 As shown, the device for generating the answer to the question includes: The answer rule module 301 is used to determine a plurality of answer rules representing the thinking process in the auxiliary learning scenario in response to the input question to be answered; the answer rules are the rules that need to be followed when answering the questions; The answer generation module 302 is used to sort multiple response rules differently, simulate different thinking processes based on different sorting results, and select the response content generated under the optimal thinking process as the answer to the question to be answered; wherein the response content generated under the thinking process is generated based on the response content corresponding to each response rule contained in the thinking process.
[0090] In some embodiments, in response to an input question to be answered, multiple answer rules representing a thinking process in a learning assistance scenario are determined; the multiple answer rules are sorted differently, different thinking processes are simulated based on different sorting results, and the answer content generated under the optimal thinking process is selected as the answer to the question to be answered, including: The questions to be answered are input into a pre-trained auxiliary learning question and answer model, so that the auxiliary learning question and answer model responds to the input questions to be answered and determines multiple answer rules that characterize the thinking process in the auxiliary learning scenario; the multiple answer rules are sorted differently, different thinking processes are simulated based on different sorting results, and the answer content generated under the optimal thinking process is selected as the answer to the question to be answered.
[0091] In some embodiments, the multiple answer rules that characterize the thinking process in the auxiliary learning scenario include: A response rule for responding to questions in a supplementary learning scenario and a response rule for evaluating and / or re-responding to answers to questions in a supplementary learning scenario.
[0092] In some embodiments, the answering rules for answering questions in the auxiliary learning scenario include at least one of the following: Present one step of reasoning at a time; Give the answer directly after simple reasoning at one time; Break down the original question into multiple sub-questions and answer the sub-questions; Restate the question; Emphasize the original question.
[0093] In some embodiments, the answer generation module 302 includes: A reply content unit, used to generate multiple reply content paths; wherein the multiple reply content paths correspond to reply rule paths representing different thinking processes in the auxiliary learning scenario, and different reply rule paths are composed of multiple reply rules in different arrangement orders; A selection unit, configured to determine an optimal reply content path based on a reward score of each reply content path; wherein the reward score is positively correlated with the reply quality; The determination unit is used to determine the last reply content in the optimal reply content path as the answer to the question to be answered.
[0094] In some embodiments, the reward score includes: the sum of the result reward score and the process reward score; wherein, the result reward score includes: a reward score that is positively correlated with the reply quality of the last reply content in the reply content path, and the process reward score includes: a reward score that is positively correlated with the reply quality of the reply content path.
[0095] In some embodiments, the plurality of reply content paths are search paths constructed based on a Monte Carlo tree search algorithm, and each reply content in the reply content path corresponds to a node in the search path; The selection unit is specifically used to calculate the sum of the upper confidence interval values of each node for each search path; determine the target search path as the optimal reply content path, wherein the target search path is the search path with the largest sum of the upper confidence interval values.
[0096] In some embodiments, the device further comprises: A training data module, used to obtain training data; wherein each piece of training data includes: a question and a response content generated based on multiple response rules representing the thinking process in the auxiliary learning scenario; The training module is used to train the auxiliary learning question and answer model based on the training data; during the training process, the auxiliary learning question and answer model will generate answers to the questions in the training data based on multiple response rules that characterize the thinking process in the auxiliary learning scenario.
[0097] In some embodiments, the learning-assisted question-answering model includes: a reward score module and a question-answering module, the reward score module is used to generate a reward score for each answer content path; the question-answering module is used to generate multiple answer content paths, and determine the answer to the question in the training data based on the reward score of each answer content path; Among them, the reward score is positively correlated with the quality of the answer. Multiple answer content paths correspond to answer rule paths that represent different thinking processes in auxiliary learning scenarios, and different answer rule paths are composed of multiple answer rules in different arrangement orders.
[0098] In some embodiments, the device further comprises: A reward training module is used to take the proportion of correct answers generated by the auxiliary learning question and answer model under the target situation as the real reward score; and / or, to take the average of the reward scores of the auxiliary learning question and answer model under the target situation as the real reward score; wherein the target situation includes the situation where answers to the same question are generated multiple times in a row; and to train the reward score module according to the real reward score.
[0099] In some embodiments, the training module is specifically used to filter the first type of data and / or the second type of data through the auxiliary learning question-answering model; train the reward score module based on the filtered first type of data and / or the second type of data; Among them, the first type of data includes: training data whose total reward score is higher than the first score threshold but the answer to the question is incorrect; the second type of data includes: training data whose total reward score is higher than the second score threshold, but the result reward score is lower than the third score threshold; the total reward score includes: the sum of the result reward score and the process reward score; the result reward score includes: the reward score that is positively correlated with the reply quality of the last reply content in the reply content path, and the process reward score includes: the reward score that is positively correlated with the reply quality of the reply content path.
[0100] The device for generating answers to questions provided in this embodiment belongs to the same application concept as the method for generating answers to questions provided in the above embodiments of this application, and can execute the method for generating answers to questions provided in any of the above embodiments of this application, and has the corresponding functional modules and beneficial effects of the execution method. For technical details not fully described in this embodiment, please refer to the specific processing content of the method for generating answers to questions provided in the above embodiments of this application, and will not be repeated here.
[0101] It should be understood that the modules in the above devices can be implemented in the form of a processor calling software. For example, the device includes a processor, the processor is connected to a memory, and instructions are stored in the memory. The processor calls the instructions stored in the memory to implement any of the above methods or realize the functions of each unit of the device, wherein the processor can be a general-purpose processor, such as a CPU or a microprocessor, etc., and the memory can be a memory in the device or a memory outside the device. Alternatively, the unit in the device can be implemented in the form of a hardware circuit, and the functions of some or all units can be realized by designing the hardware circuit. The hardware circuit can be understood as one or more processors; for example, in one implementation, the hardware circuit is an ASIC, and the functions of some or all of the above units are realized by designing the logical relationship of the components in the circuit; for another example, in another implementation, the hardware circuit can be implemented by PLD, taking FPGA as an example, which can include a large number of logic gate circuits, and the connection relationship between the logic gate circuits is configured by a configuration file, so as to realize the functions of some or all of the above units. All units of the above devices can be implemented in the form of a processor calling software, or in the form of a hardware circuit, or in part by a processor calling software, and the remaining part is implemented in the form of a hardware circuit.
[0102] In an embodiment of the present application, a processor is a circuit with the ability to process signals. In one implementation, the processor may be a circuit with the ability to read and run instructions, such as a CPU, a microprocessor, a GPU, or a DSP; in another implementation, the processor may implement certain functions through the logical relationship of a hardware circuit, and the logical relationship of the hardware circuit is fixed or reconfigurable, such as a hardware circuit implemented by an ASIC or PLD, such as an FPGA. In a reconfigurable hardware circuit, the process of the processor loading a configuration document to implement the hardware circuit configuration can be understood as the process of the processor loading instructions to implement the functions of some or all of the above units. In addition, it can also be a hardware circuit designed for artificial intelligence, which can be understood as an ASIC, such as an NPU, TPU, DPU, etc.
[0103] It can be seen that each unit in the above device can be one or more processors (or processing circuits) configured to implement the above method, such as: CPU, GPU, NPU, TPU, DPU, microprocessor, DSP, ASIC, FPGA, or a combination of at least two of these processor forms.
[0104] In addition, all or part of the units in the above device can be integrated together, or can be implemented independently. In one implementation, these units are integrated together and implemented in the form of a SOC. The SOC may include at least one processor for implementing any of the above methods or implementing the functions of each unit of the device. The type of the at least one processor may be different, for example, including a CPU and an FPGA, a CPU and an artificial intelligence processor, a CPU and a GPU, etc.
[0105] Exemplary Electronic Devices The present application embodiment provides an electronic device, see Figure 4 As shown, the device includes: Memory 400 and processor 410; The memory 400 is connected to the processor 410 and is used to store programs; The processor 410 is used to implement the method for generating answers to questions disclosed in any of the above embodiments by running the program stored in the memory 400.
[0106] Specifically, the electronic device may further include: a bus, a communication interface 420 , an input device 430 and an output device 440 .
[0107] The processor 410, the memory 400, the communication interface 420, the input device 430 and the output device 440 are connected to each other via a bus. A bus may include a pathway that transfers information between components of a computer system.
[0108] The processor 410 may be a general-purpose processor, such as a general-purpose central processing unit (CPU), a microprocessor, etc., or an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the scheme of the present invention. It may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0109] The processor 410 may include a main processor, and may also include a baseband chip, a modem, and the like.
[0110] The memory 400 stores a program for executing the technical solution of the present invention, and may also store an operating system and other key services. Specifically, the program may include a program code, and the program code includes a computer operation instruction. More specifically, the memory 400 may include a read-only memory (ROM), other types of static storage devices that can store static information and instructions, a random access memory (RAM), other types of dynamic storage devices that can store information and instructions, a disk storage, a flash, and the like.
[0111] The input device 430 may include a device for receiving data and information input by a user, such as a keyboard, a mouse, a camera, a scanner, a light pen, a voice input device, a touch screen, a pedometer, or a gravity sensor.
[0112] Output device 440 may include a device that allows information to be output to a user, such as a display screen, a printer, a speaker, etc.
[0113] The communication interface 420 may include any transceiver or the like to communicate with other devices or communication networks, such as Ethernet, a radio access network (RAN), a wireless local area network (WLAN), etc.
[0114] The processor 410 executes the program stored in the memory 400 and calls other devices, which can be used to implement the various steps of any method for generating an answer to a question provided in the above embodiments of the present application.
[0115] An embodiment of the present application also proposes a chip, which includes a processor and a data interface. The processor reads and runs a program stored in a memory through the data interface to execute the method for generating answers to questions introduced in any of the above embodiments. The specific processing process and its beneficial effects can be found in the above-mentioned embodiment introduction of the method for generating answers to questions.
[0116] Exemplary computer program products and storage media In addition to the above-mentioned methods and devices, an embodiment of the present application may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps of the method for generating answers to questions according to various embodiments of the present application described in any of the above embodiments of this specification.
[0117] The computer program product may be written in any combination of one or more programming languages to write program codes for performing the operations of the embodiments of the present application, including object-oriented programming languages, such as Java, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as an independent software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0118] In addition, an embodiment of the present application may also be a storage medium on which a computer program is stored, and the computer program is executed by a processor to execute the steps of the method for generating answers to questions according to various embodiments of the present application described in any of the above embodiments of this specification.
[0119] For the aforementioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the order of the actions described, because according to the present application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0120] It should be noted that each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0121] The steps in the methods of each embodiment of the present application can be adjusted in order, combined and deleted according to actual needs, and the technical features recorded in each embodiment can be replaced or combined.
[0122] The modules and sub-modules in the devices and terminals of the various embodiments of the present application can be combined, divided and deleted according to actual needs.
[0123] In the several embodiments provided in the present application, it should be understood that the disclosed terminals, devices and methods can be implemented in other ways. For example, the terminal embodiments described above are only schematic, for example, the division of modules or submodules is only a logical function division, and there may be other division methods in actual implementation, for example, multiple submodules or modules can be combined or integrated into another module, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.
[0124] The modules or submodules described as separate components may or may not be physically separated, and the components of the modules or submodules may or may not be physical modules or submodules, that is, they may be located in one place, or they may be distributed on multiple network modules or submodules. Some or all of the modules or submodules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0125] In addition, each functional module or submodule in each embodiment of the present application may be integrated into one processing module, or each module or submodule may exist physically separately, or two or more modules or submodules may be integrated into one module. The above-mentioned integrated modules or submodules may be implemented in the form of hardware or in the form of software functional modules or submodules.
[0126] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0127] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly by hardware, software units executed by a processor, or a combination of the two. The software units may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0128] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0129] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for generating an answer to a question, characterized in that: The method comprises: In response to the input questions to be answered, a plurality of answer rules representing the thinking process in the auxiliary learning scenario are determined; Perform different sorting on multiple response rules, simulate different thinking processes based on the different sorting results, and select the response content generated under the optimal thinking process as the answer to the question to be answered; wherein the response content generated under the thinking process is generated based on the response content corresponding to each response rule contained in the thinking process.
2. The method according to claim 1, characterized in that In response to the input question to be answered, multiple answer rules representing the thinking process in the auxiliary learning scenario are determined; the multiple answer rules are sorted differently, different thinking processes are simulated based on different sorting results, and the answer content generated under the optimal thinking process is selected as the answer to the question to be answered, including: The question to be answered is input into a pre-trained auxiliary learning question and answer model, so that the auxiliary learning question and answer model responds to the input question to be answered and determines multiple answer rules that characterize the thinking process in the auxiliary learning scenario; the multiple answer rules are sorted differently, different thinking processes are simulated based on different sorting results, and the answer content generated under the optimal thinking process is selected as the answer to the question to be answered.
3. The method according to any one of claims 1 or 2, characterized in that: The multiple response rules that characterize the thinking process in the auxiliary learning scenario include: A response rule for responding to questions in a supplementary learning scenario and a response rule for evaluating and / or re-responding to answers to questions in a supplementary learning scenario.
4. The method according to claim 3, characterized in that The answering rules for answering questions in the auxiliary learning scenario include at least one of the following: Present one step of reasoning at a time; Give the answer directly after simple reasoning at one time; Break down the original question into multiple sub-questions and answer the sub-questions; Restate the question; Emphasize the original question.
5. The method according to claim 1 or 2, characterized in that: Sorting multiple answer rules in different ways, simulating different thinking processes based on different sorting results, and selecting the answer content generated under the optimal thinking process as the answer to the question to be answered, including: Generate multiple reply content paths; wherein the multiple reply content paths correspond to reply rule paths representing different thinking processes in auxiliary learning scenarios, and different reply rule paths are composed of the multiple reply rules in different arrangement orders; Determining the optimal reply content path based on the reward score of each reply content path; wherein the reward score is positively correlated with the reply quality; The last reply content in the optimal reply content path is determined as the answer to the question to be answered.
6. The method according to claim 5, characterized in that The reward score includes: the sum of the result reward score and the process reward score; Among them, the result reward score includes: a reward score that is positively correlated with the reply quality of the last reply content in the reply content path, and the process reward score includes: a reward score that is positively correlated with the reply quality of the reply content path.
7. The method according to claim 5, characterized in that The multiple reply content paths are search paths constructed based on a Monte Carlo tree search algorithm, and each reply content in the reply content path corresponds to a node in the search path; Determining an optimal reply content path based on the reward score of each reply content path includes: For each of the search paths, the sum of the upper confidence interval values of each node is calculated; The target search path is determined as the optimal reply content path, wherein the target search path is the search path with the largest sum of upper confidence interval values.
8. The method according to claim 2, characterized in that: The training process of the auxiliary learning question answering model includes: Acquire training data; wherein each piece of the training data includes: a question and a response content generated based on a plurality of response rules representing a thinking process in a learning assistance scenario; The auxiliary learning question and answer model is trained based on the training data; wherein, during the training process, the auxiliary learning question and answer model will generate answers to the questions in the training data based on the multiple response rules that characterize the thinking process in the auxiliary learning scenario.
9. The method according to claim 8, characterized in that The auxiliary learning question-answering model includes: a reward score module and a question-answering module, wherein the reward score module is used to generate a reward score for each answer content path; the question-answering module is used to generate multiple answer content paths, and determine the answer to the question in the training data based on the reward score of each answer content path; Among them, the reward score is positively correlated with the quality of the answer, the multiple answer content paths correspond to answer rule paths that represent different thinking processes in the auxiliary learning scenario, and different answer rule paths are composed of the multiple answer rules in different arrangement orders.
10. The method according to claim 9, characterized in that The training process of the auxiliary learning question answering model also includes: The proportion of correct answers generated by the auxiliary learning question-answering model in the target situation is used as the real reward score; and / or the average of the reward scores of the auxiliary learning question-answering model in the target situation is used as the real reward score; wherein the target situation includes the situation where answers to the same question are generated multiple times in a row; The reward score module is trained according to the real reward score.
11. An electronic device, characterized in that: including memory and processor; The memory is connected to the processor and is used to store programs; The processor is used to implement the method for generating an answer to a question as described in any one of claims 1 to 10 by running the program in the memory.
12. A computer program product, characterized in that include: A computer program, wherein when the computer program is executed by a processor, the method for generating an answer to a question according to any one of claims 1 to 10 is implemented.
Citation Information
Patent Citations
Campus spoofing prevention and control management method, device, system and equipment and storage medium
CN118964561A
Automatically Generating Diverse Text
US20210295172A1
Question answering information completion using machine reading comprehension-based process
US20230095180A1
Augmenting machine learning language models using search engine results
US20230244934A1
Self-teaching large language models
US20240362416A1