Multi-hop question and answer method and device, equipment and medium

By generating a sample set for the student model and training the decomposition and response models, the problem of insufficient background knowledge and large data requirements in multi-hop question and answer is solved, and more efficient knowledge-intensive multi-hop question and answer performance is achieved.

CN118709776APending Publication Date: 2024-09-27INST OF AUTOMATION CHINESE ACAD OF SCI +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410611393.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-16
Publication Date
2024-09-27

AI Technical Summary

Technical Problem

In the existing technology, multi-hop question answering models cannot obtain sufficient relevant background knowledge and require a large amount of labeled data, resulting in poor question answering performance.

Method used

By generating the first sample set and the second sample set for student model distillation training, the decomposition model and the response model are trained respectively. The decomposition model decides to continue to raise sub-questions or output the answer to the original question based on the interactive record information, and the response model communicates with the external The knowledge base interactively retrieves background knowledge and answers sub-questions.

Benefits of technology

It significantly reduces the amount of distilled data, enhances the ability of small models to solve knowledge-intensive multi-hop question and answer tasks, obtains more sufficient background knowledge, and improves the accuracy and efficiency of multi-hop question and answer.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118709776A
    Figure CN118709776A
Patent Text Reader

Abstract

The invention provides a multi-hop question and answer method, device and equipment and a medium, and relates to the technical field of computers, the method comprises the following steps: inputting current interaction record information of a target question and the target question into a decomposition model to obtain current interaction decision information; under the condition that the current interaction decision information comprises a current interaction sub-question in the target question, determining target input information according to the current interaction sub-question and knowledge information of the current interaction sub-question, and inputting the target input information to a response model to obtain answer prediction information of the current interaction sub-question output by the response model; and adding the answer prediction information of the current interaction sub-question into the current interaction record information to obtain next interaction record information, and continuing to input the next interaction record information and the target question into the decomposition model until the next interaction decision information output by the decomposition model comprises the answer prediction information of the target question. According to the invention, the accuracy and efficiency of multi-hop questions and answers are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a multi-hop question-answering method, device, equipment and medium. Background Art

[0002] Multi-hop question answering is widely used in various scenarios, such as accurately answering users' multi-hop questions in search engines. Therefore, how to efficiently and accurately implement multi-hop question answering is one of the technical problems that need to be solved urgently.

[0003] In the related art, a large-scale language model is used to generate a chain of thoughts to train a student model to achieve multi-hop question answering; however, this method causes the trained student model to be unable to obtain sufficient relevant background knowledge, and also requires a large amount of labeled data to train the student model, resulting in poor question answering performance. Summary of the invention

[0004] The present invention provides a multi-hop question answering method, device, equipment and medium to solve the defects in the prior art that sufficient relevant background knowledge cannot be obtained and a large amount of label data is required, resulting in poor question answering performance, so as to improve the question answering performance.

[0005] The present invention provides a multi-hop question-answering method, comprising:

[0006] Acquire current interaction record information of the target question; the current interaction record information includes answer prediction information of historical interaction sub-questions of the target question acquired in all historical interaction processes before the current interaction;

[0007] Inputting the current interaction record information and the target question into a decomposition model to obtain current interaction decision information output by the decomposition model;

[0008] In the case where the current interactive decision information includes the current interactive sub-problem in the target problem, target input information is determined according to the current interactive sub-problem and the knowledge information of the current interactive sub-problem, and the target input information is input into the response model to obtain the answer prediction information of the current interactive sub-problem output by the response model;

[0009] Adding the answer prediction information of the current interaction sub-question to the current interaction record information to obtain next interaction record information, and continuing to input the next interaction record information and the target question into the decomposition model until the next interaction decision information output by the decomposition model includes the answer prediction information of the target question;

[0010] The decomposition model is obtained by distillation training based on the first sample set, and the response model is obtained by distillation training based on the second sample set; the first sample set includes sample questions and sample interaction record information of the sample questions, and sample interaction decision information output by the large language model, and the sample interaction decision information includes sample interaction sub-questions or answer prediction information of the sample questions; the second sample set includes each of the sample interaction sub-questions, knowledge information of each of the sample interaction sub-questions, and answer prediction information of each of the sample interaction sub-questions output by the large language model.

[0011] According to a multi-hop question-answering method provided by the present invention, the first sample set and the second sample set are obtained based on the following steps:

[0012] For each historical interaction, the following steps are performed:

[0013] The sample question and the sample interaction record information of the current historical interaction of the sample question are input into the large language model, and the large language model outputs the sample interaction decision information of the current historical interaction according to the sample question and the sample interaction record information of the current historical interaction of the sample question, and in the case where the sample interaction decision information of the current historical interaction includes the sample interaction sub-problem of the current historical interaction, based on the sample interaction sub-problem of the current historical interaction and the knowledge information of the sample interaction sub-problem of the current historical interaction, predict the answer prediction information of the sample interaction sub-problem of the current historical interaction, and add the answer prediction information of the sample interaction sub-problem of the current historical interaction to the sample interaction record information of the current historical interaction to obtain the sample interaction record information of the next historical interaction, and output the sample interaction decision information of the next historical interaction according to the sample question and the sample interaction record information of the next historical interaction of the sample question, until the sample interaction decision information of the next historical interaction includes the answer prediction information of the sample question;

[0014] Constructing the first sample set according to the sample question, sample interaction record information of each historical interaction, and sample interaction decision information of each historical interaction;

[0015] The second sample set is constructed according to the sample interaction sub-problems of each historical interaction, the knowledge information of the sample interaction sub-problems of each historical interaction, and the answer prediction information of the sample interaction sub-problems of each historical interaction.

[0016] According to a multi-hop question answering method provided by the present invention, the decomposition model is trained based on the following steps:

[0017] Taking the sample question and sample interaction record information of each historical interaction as samples, and taking the sample interaction decision information of each historical interaction as labels, performing distillation training on the first small language model to obtain the decomposition model;

[0018] The model parameter scale of the first small language model is smaller than the model parameter scale of the large language model.

[0019] According to a multi-hop question answering method provided by the present invention, the response model is trained based on the following steps:

[0020] The second small language model is distilled and trained using the sample interaction sub-problems of each historical interaction and the knowledge information of the sample interaction sub-problems of each historical interaction as samples, and the answer prediction information of the sample interaction sub-problems of each historical interaction as labels to obtain the response model;

[0021] The model parameter scale of the second small language model is smaller than the model parameter scale of the large language model.

[0022] According to a multi-hop question answering method provided by the present invention, determining target input information according to the current interactive sub-problem and the knowledge information of the current interactive sub-problem includes:

[0023] Acquire knowledge information of the current interactive sub-problem in a knowledge base;

[0024] The current interaction sub-problem and the knowledge information of the current interaction sub-problem are concatenated to obtain the target input information.

[0025] According to a multi-hop question answering method provided by the present invention, the method further includes:

[0026] In a case where the current interactive decision information includes the answer prediction information of the target question, the answer prediction information of the target question is sent to an initiator of the target question.

[0027] The present invention also provides a multi-hop question-answering device, comprising:

[0028] An acquisition unit, configured to acquire current interaction record information of a target question; the current interaction record information includes answer prediction information of historical interaction sub-questions of the target question acquired in all historical interactions before the current interaction;

[0029] A decomposition unit, used for inputting the current interaction record information and the target question into a decomposition model to obtain current interaction decision information output by the decomposition model;

[0030] A response unit, configured to determine target input information according to the current interactive sub-problem and knowledge information of the current interactive sub-problem, and input the target input information into a response model to obtain answer prediction information of the current interactive sub-problem output by the response model, when the current interactive decision information includes the current interactive sub-problem in the target problem;

[0031] a processing unit, configured to add the answer prediction information of the current interaction sub-question to the current interaction record information to obtain next interaction record information, and continue to input the next interaction record information and the target question into the decomposition model until the next interaction decision information output by the decomposition model includes the answer prediction information of the target question;

[0032] The decomposition model is obtained by distillation training based on the first sample set, and the response model is obtained by distillation training based on the second sample set; the first sample set includes sample questions and sample interaction record information of the sample questions, and sample interaction decision information output by the large language model, and the sample interaction decision information includes sample interaction sub-questions or answer prediction information of the sample questions; the second sample set includes each of the sample interaction sub-questions, knowledge information of each of the sample interaction sub-questions, and answer prediction information of each of the sample interaction sub-questions output by the large language model.

[0033] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the multi-hop question-answering method as described above is implemented.

[0034] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the multi-hop question-answering method as described above is implemented.

[0035] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the multi-hop question-answering method as described above is implemented.

[0036] The multi-hop question-answering method, apparatus, device and medium provided by the present invention interact with the teacher model of the large language model to generate a first sample set and a second sample set for distillation training of the student model, so as to perform distillation training on the student model based on the first sample set, and obtain a decomposition model of decision information that can decide to continue to ask sub-questions or output the final answer to the original question according to the current interaction record information, and to perform distillation training on the student model based on the second sample set, and obtain a response model that can interact with the external knowledge base, retrieve relevant knowledge information and answer sub-questions. It not only realizes the distillation of the interactive decision-making ability and question-answering ability of the large language model to the two student models respectively, significantly reducing the complexity of the task, thereby significantly reducing the amount of data required for distillation, and significantly enhancing the ability of the small model to solve knowledge-intensive multi-hop question-answering tasks, but also, compared with the retrieval of the original question, by further decomposing and refining the retrieval of the sub-questions, more sufficient background knowledge required to answer the multi-hop questions can be obtained, further enhancing the ability of the small model to solve the knowledge-intensive multi-hop question-answering tasks, thereby effectively solving the problems of insufficient background knowledge and the need for a large amount of training data in the prior art, and improving the accuracy and efficiency of knowledge-intensive multi-hop question-answering. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0038] Figure 1 This is one of the flow charts of the multi-hop question-answering method provided by the present invention;

[0039] Figure 2 This is the second flow chart of the multi-hop question-answering method provided by the present invention;

[0040] Figure 3 This is one of the performance simulation diagrams of the multi-hop question-answering method provided by the present invention;

[0041] Figure 4 This is the second performance simulation diagram of the multi-hop question-answering method provided by the present invention;

[0042] Figure 5 This is the third performance simulation diagram of the multi-hop question-answering method provided by the present invention;

[0043] Figure 6 It is a structural schematic diagram of the multi-hop question-answering device provided by the present invention;

[0044] Figure 7 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0045] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are 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 scope of protection of the present invention.

[0046] The multi-hop question-answering method provided in this embodiment can be applied to a variety of multi-hop question-answering scenarios, such as knowledge-intensive multi-hop question-answering, etc. This embodiment takes the knowledge-intensive multi-hop question-answering scenario as an example to describe the multi-hop question-answering method provided in this embodiment.

[0047] Knowledge-intensive multi-hop question answering is closer to real application scenarios. For example, it is used in search engines to accurately answer users' multi-hop questions. It is a typical question-answering task. This task is extremely challenging because it requires not only relevant background knowledge, but also multi-hop reasoning capabilities.

[0048] The emergence of large-scale language models (or large language models) has greatly promoted the development of such tasks due to the massive knowledge carried by the huge parameters of large-scale language models and their powerful reasoning capabilities. However, large-scale language models consume huge computational resources, so it is crucial to distill the capabilities of large models into small models.

[0049] In existing technologies, large models are generally used to generate thought chains to train small models to achieve multi-hop question answering; however, this type of algorithm cannot obtain sufficient relevant background knowledge. In addition, this algorithm requires a large amount of data to train the student model, resulting in poor question answering performance.

[0050] Therefore, how to better utilize large model distillation to improve the knowledge-intensive multi-hop question answering capabilities of small models is a technical problem that needs to be urgently solved by technicians in related fields.

[0051] In response to the above problems, this embodiment provides a multi-hop question and answer method, which is a knowledge-intensive multi-hop question and answer method based on large model distillation. Distilled data is generated by a teacher model based on a large language model; two student models are trained separately using the distilled data, namely a decomposition model and a response model; wherein the decomposition model decides to continue to ask sub-questions or output the final answer to the original question based on the current interaction record information; the response model interacts with an external knowledge base, retrieves relevant background knowledge and answers sub-questions; in the question and answer task processing process, the decomposition model and the response model interact with each other multiple times to better obtain relevant background knowledge and reduce distilled data, thereby achieving effective processing of knowledge-intensive multi-hop question and answer tasks, solving the problems of insufficient background knowledge and the need for a large amount of training data in the prior art, and further improving the performance of knowledge-intensive multi-hop question and answering.

[0052] Figure 1 This is one of the flowcharts of the multi-hop question-answering method provided in this embodiment; Figure 1 As shown, the method comprises the following steps:

[0053] Step 110, obtaining current interaction record information of the target question; the current interaction record information includes answer prediction information of historical interaction sub-questions of the target question obtained in all historical interaction processes before the current interaction;

[0054] It should be noted that the language types of the questions and answers mentioned below correspond to each other; they can be set according to actual needs, such as English, Chinese, etc.

[0055] The so-called target question includes multiple sub-questions, which are common sense questions that need to be answered. They can be directly input by the user, or they can be obtained by capturing images through image acquisition devices such as scanners, mobile phones, cameras, and performing OCR (Optical Character Recognition) on the images. The embodiments of the present invention do not make specific limitations on this.

[0056] The so-called interaction record information is determined by the answer prediction information of historical interaction sub-problems in the target problem obtained from all historical interactions with the decomposition model and the response model before the current interaction, with the target question and answer as the processing task; the so-called historical interaction sub-problems are sub-problems in the target problem that have undergone question and answer interactions through the decomposition model and the response model.

[0057] For example, the target question includes three sub-questions, among which the first two sub-questions are sub-questions that have undergone question-answering interactions through the decomposition model and the response model. Then the record information composed of the answer prediction information of the first two sub-questions is the current interaction record information of the target question.

[0058] Step 120: input the current interaction record information and the target question into a decomposition model to obtain current interaction decision information output by the decomposition model; wherein the decomposition model is obtained by distillation training based on a first sample set, the first sample set includes sample questions and each sample interaction record information of the sample questions, and each sample interaction decision information output by a large language model, the sample interaction decision information includes sample interaction sub-questions, or answer prediction information of the sample questions;

[0059] Optionally, after obtaining the current interaction record information, the current interaction record information and the target question can be input into the decomposition model so that the decomposition model makes a decision on whether to continue to ask sub-questions in the current interaction or output the final answer prediction result of the target question based on the previous interaction record information and the target question, thereby obtaining the current interaction decision information. The so-called current interaction decision information includes the current interaction sub-question in the target question or the answer prediction result of the target question. The so-called current interaction sub-question is the sub-question in the target question that needs to be asked in the current interaction.

[0060] For example, the target question includes three sub-questions, among which the first two sub-questions are sub-questions that have undergone question-answering interactions through the decomposition model and the response model, and the third sub-question is the current interactive sub-question.

[0061] The decomposition model here is obtained by distilling the decomposition decision-making ability of the large language model to decide whether to continue to ask sub-questions or output the final answer to the original question according to the interaction record information and the original question. It can be obtained by distilling training based on sample questions and the sample interaction record information of each sample question, and the sample interaction decision information output by the large language model. The specific training steps include: collecting a large number of sample questions; then, interacting with the large language model through the sample questions to obtain the sample interaction record information of each sample question, and the sample interaction decision information; then, based on the sample questions and the sample interaction record information of each sample question, and the sample interaction decision information output by the large language model, the student model is distilled and trained to obtain a decomposition model, thereby migrating the decomposition decision-making ability in the large language model to the decomposition model, so that the decomposition decision performance of the decomposition model is close to that of the large language model, while having better generalization performance and smaller model size, thereby enhancing the ability of the small model to solve knowledge-intensive multi-hop question answering tasks.

[0062] Step 130, when the current interactive decision information includes the current interactive subproblem in the target problem, determine the target input information according to the current interactive subproblem and the knowledge information of the current interactive subproblem, and input the target input information into the response model to obtain the answer prediction information of the current interactive subproblem output by the response model; wherein the response model is obtained by distillation training based on the second sample set; the second sample set includes each of the sample interactive subproblems, the knowledge information of each of the sample interactive subproblems, and the answer prediction information of each of the sample interactive subproblems output by the large language model;

[0063] Optionally, after determining that the current interactive decision information includes the current interactive sub-problem in the target question, it is necessary to continue the sub-problem question-answering task. At this time, the knowledge information of the current interactive sub-problem can be obtained, and the current interactive sub-problem and the knowledge information can be fused so that the target input information input into the response model includes the sub-problem information and the corresponding knowledge information, so that the response model can output the correct answer more accurately and efficiently; the so-called fusion can be splicing or encoding, etc., which is not specifically limited in this embodiment. The so-called knowledge information can be at least one of the knowledge related to the answer, reasoning details, and background knowledge.

[0064] After the target input information is obtained, the target input information including the sub-question information and the knowledge information may be input into the response model so that the response model can answer and output the answer prediction information of the current interactive sub-question.

[0065] The response model here is obtained by distilling the question-answering ability of the large language model to answer sub-questions based on sub-questions and the knowledge of sub-questions retrieved from an external knowledge base. It can be obtained by distilling training based on sample interaction sub-questions, knowledge information of each sample interaction sub-questions, and answer prediction information of each sample interaction sub-questions output by the large language model. The specific training steps include: collecting sample interaction sub-questions of a large number of sample questions; then, interacting with the large language model through the sample interaction sub-questions to obtain answer prediction information of the sample interaction sub-questions; then, based on the sample interaction sub-questions, knowledge information of each sample interaction sub-questions, and answer prediction information of each sample interaction sub-questions output by the large language model, distilling training the student model to obtain a response model, thereby migrating the question-answering ability in the large language model to the response model, so that the question-answering performance of the response model is close to that of the large language model, while having better generalization performance and smaller model size, thereby enhancing the ability of the small model to solve knowledge-intensive multi-hop question-answering tasks.

[0066] Step 140, adding the answer prediction information of the current interaction sub-question to the current interaction record information to obtain the next interaction record information, and continuing to input the next interaction record information and the target question into the decomposition model until the next interaction decision information output by the decomposition model includes the answer prediction information of the target question;

[0067] Optionally, after obtaining the answer prediction information of the current interactive sub-problem, the answer prediction information of the current interactive sub-problem can be added to the current interaction record information to obtain the interaction record information corresponding to the next interaction, that is, the next interaction record information, and continue to iteratively execute the above steps 110-140 based on the next interaction record information until it is determined that the interactive decision information output by the decomposition model contains the answer prediction information of the target question, which indicates that the final answer to the target question has been obtained. At this time, the question-answering task of the target question can be stopped, and the final answer is fed back to the questioner; thereby, through the interactive process of asking / solving sub-problems of the two models, the decomposition model and the response model, the knowledge-intensive multi-hop question is jointly answered: the decomposition model and the response model solve the knowledge-intensive multi-hop question-answering task in an iterative manner, continuously asking sub-questions / answering sub-questions until the final answer to the target question is output.

[0068] In summary, the above steps 110 to 140 significantly enhance the ability of the small model to solve knowledge-intensive multi-hop question answering tasks by distilling the problem decomposition decision-making and question answering capabilities of the large language model to two student models respectively. Compared with the existing technical methods, this method obtains more sufficient background knowledge required to answer multi-hop questions by retrieving based on sub-questions instead of the original multi-hop questions, and decomposes a complex task that requires multiple capabilities such as problem decomposition and knowledge reasoning into two easier to learn tasks, significantly reducing the complexity of the task, and therefore significantly reducing the amount of data required for distillation. Therefore, this method is significantly superior to the existing method of using large-scale language models to generate thought chains to train student models and achieve multi-hop question answering in terms of both performance and efficiency.

[0069] The following is a specific example to describe the multi-hop question-answering interactive process.

[0070] Figure 2 The second flowchart of the multi-hop question-answering method provided by the present invention; Figure 2As shown in the figure, the sample question is “What is the evaluation range for the eastern sector of the Colorado orogenyextends into?”; the first sub-question output by the decomposition model in the first interaction is “What does the eastern sector of Colorado extends into?”, and the response model predicts the answer to the first sub-question through external knowledge base retrieval and outputs the predicted answer information as “The High Plains”; the second sub-question output by the decomposition model in the second interaction is “What is the evaluation range for the High Plains?”, and the response model predicts the answer to the second sub-question through external knowledge base retrieval and outputs the predicted answer information as “1800to 7000ft.”, and the answer prediction information output by the decomposition model in the third interaction is “So the final answer is:1800to7000f.”.

[0071] The method provided in this embodiment generates a first sample set and a second sample set for distillation training of a student model by interacting with a teacher model of a large language model, and performs distillation training on the student model based on the first sample set to obtain a decomposition model of decision information that can decide to continue to ask sub-questions or output the final answer to the original question based on the current interaction record information, and performs distillation training on the student model based on the second sample set to obtain a response model that can interact with an external knowledge base, retrieve relevant knowledge information and answer sub-questions. This not only realizes the distillation of the interactive decision-making ability and question-answering ability of the large language model to the two student models, which significantly reduces the complexity of the task and significantly reduces the amount of data required for distillation, but also significantly enhances the ability of the small model to solve knowledge-intensive multi-hop question-answering tasks. Moreover, compared with the retrieval of the original question, more sufficient background knowledge required to answer the multi-hop question can be obtained by further decomposing and refining the retrieval of the sub-questions, further enhancing the ability of the small model to solve the knowledge-intensive multi-hop question-answering tasks, thereby effectively solving the problems of insufficient background knowledge and the need for a large amount of training data in the prior art, and improving the accuracy and efficiency of knowledge-intensive multi-hop question-answering.

[0072] In some embodiments, the first sample set and the second sample set are obtained based on the following steps:

[0073] For each historical interaction, the following steps are performed:

[0074] The sample question and the sample interaction record information of the current historical interaction of the sample question are input into the large language model, and the large language model outputs the sample interaction decision information of the current historical interaction according to the sample question and the sample interaction record information of the current historical interaction of the sample question, and in the case where the sample interaction decision information of the current historical interaction includes the sample interaction sub-problem of the current historical interaction, based on the sample interaction sub-problem of the current historical interaction and the knowledge information of the sample interaction sub-problem of the current historical interaction, predict the answer prediction information of the sample interaction sub-problem of the current historical interaction, and add the answer prediction information of the sample interaction sub-problem of the current historical interaction to the sample interaction record information of the current historical interaction to obtain the sample interaction record information of the next historical interaction, and output the sample interaction decision information of the next historical interaction according to the sample question and the sample interaction record information of the next historical interaction of the sample question, until the sample interaction decision information of the next historical interaction includes the answer prediction information of the sample question;

[0075] Constructing the first sample set according to the sample question, sample interaction record information of each historical interaction, and sample interaction decision information of each historical interaction;

[0076] The second sample set is constructed according to the sample interaction sub-problems of each historical interaction, the knowledge information of the sample interaction sub-problems of each historical interaction, and the answer prediction information of the sample interaction sub-problems of each historical interaction.

[0077] The large language model here is a pre-trained language model with large-scale parameters. It has the problem decomposition decision-making ability to choose to continue to ask sub-questions or output the final answer based on the interaction history, and the question answering ability to retrieve corresponding knowledge information from the external knowledge base to answer sub-questions. These two capabilities can solve knowledge-intensive multi-hop problems in steps. Each step includes asking sub-questions and retrieving knowledge information from the external knowledge base to answer sub-questions, until no sub-questions are asked but the final answer is output, then the processing of this round of question and answer tasks is stopped.

[0078] Optionally, the step of acquiring the first sample set and the second sample set by interacting with the large language model specifically includes:

[0079] For each historical interaction, perform the following steps:

[0080] The sample question and the sample interaction record information of the current historical interaction of the sample question are input into the large language model, and the large language model uses the problem decomposition decision-making ability to decide to output the sample interaction sub-question that needs to continue the sub-question and answering task or the final answer to the sample question based on the sample question and the sample interaction record information of the current historical interaction of the sample question. When the decision is made to output the final answer to the sample question, the sample generation of the sample question is completed, and the sample generation task of the sample question is stopped; when the decision is made to output the sample interaction sub-question of the current historical interaction, it is necessary to continue the sample generation of the sample question. At this time, the question answering ability is used to determine the sample interaction sub-question of the current historical interaction. The sample interaction sub-problem and the knowledge information of the sample interaction sub-problem of the current historical interaction are used to predict the answer prediction information of the sample interaction sub-problem of the current historical interaction, and the answer prediction information of the sample interaction sub-problem of the current historical interaction is added to the sample interaction record information of the current historical interaction to obtain the sample interaction record information of the next historical interaction, so as to iteratively execute the next interaction process based on the sample interaction record information of the next historical interaction, until the sample interaction decision information of the next historical interaction output by the large language model includes the answer prediction information of the sample question, then the sample generation of the sample question is completed, and the sample generation task of the sample question is stopped.

[0081] Subsequently, the sample questions, the sample interaction record information of each historical interaction, and the sample interaction decision information of each historical interaction are summarized to construct a first sample set;

[0082] The sample interaction sub-problems of each historical interaction, the knowledge information of the sample interaction sub-problems of each historical interaction, and the answer prediction information of the sample interaction sub-problems of each historical interaction are summarized to construct a second sample set.

[0083] The following describes in detail the process of generating a sample set for a large language model's self-questioning and self-answering prompt task using a specific example.

[0084] like Figure 2As shown, the sample question is “What is the evaluation range for the eastern sector of the Colorado orogeny extends into?”; the first sub-question output by the large language model using the decomposition decision-making ability is “What does the eastern sector of Colorado extend into?” The large language model uses the question answering ability to predict the answer to the first sub-question after searching the external knowledge base, and the output answer prediction information is “The High Plains”; the second sub-question output by the large language model using the decomposition decision-making ability is “What is the evaluation range for the High Plains?” The large language model uses the question answering ability to predict the answer to the second sub-question after searching the external knowledge base, and the output answer prediction information is “1800to7000ft.” The answer prediction information of the sample question output by the large language model is “1800to 7000ft.” Therefore, the first sample set and the second sample set can be constructed based on the following information as follows:

[0085] The first sub-question is “What does the eastern sector of Colorado extend into?”;

[0086] The answer prediction information for the first sub-question is "The High Plains";

[0087] The second sub-question is “What is the evaluation range for the High Plains?”;

[0088] The predicted answer information for the second sub-question is "1800 to 7000 ft.";

[0089] The answer prediction information for the sample question is "1800 to 7000 ft.".

[0090] The method provided in this embodiment can generate a first sample set and a second sample set containing diverse samples each time by interacting with the large language model through a single question, so as to effectively reduce the number of interactions with the large language model and the number of times distillation training data is obtained. This can not only improve the model training efficiency, but also ensure that the decomposition model and response model trained by distillation have good performance.

[0091] In some embodiments, the decomposition model is trained based on the following steps:

[0092] Taking the sample question and sample interaction record information of each historical interaction as samples, and taking the sample interaction decision information of each historical interaction as labels, performing distillation training on the first small language model to obtain the decomposition model;

[0093] The model parameter scale of the first small language model is smaller than the model parameter scale of the large language model.

[0094] The first small language model can be distilled and trained using sample questions and sample interaction record information of each historical interaction as samples, sample interaction decision information of each historical interaction as labels, and minimizing the loss function as the optimization goal, so that the trained decomposition model can decide to continue to ask sub-questions or output the final answer based on the interaction record information, thereby realizing the migration of the decomposition decision-making ability in the large language model to the decomposition model, making the decomposition decision performance of the decomposition model close to that of the large language model while having better generalization performance and smaller model size, thereby enhancing the ability of the small model to solve knowledge-intensive multi-hop question-answering tasks.

[0095] Among them, the loss function of the decomposition model is as follows:

[0096]

[0097] in, is the sample interaction decision information of the i-th sample question of the j-th historical interaction output by the decomposition model, H is the interaction record information; N is the number of sample questions; k is the number of historical interactions.

[0098] In some embodiments, the response model is trained based on the following steps:

[0099] The second small language model is distilled and trained using the sample interaction sub-problems of each historical interaction and the knowledge information of the sample interaction sub-problems of each historical interaction as samples, and the answer prediction information of the sample interaction sub-problems of each historical interaction as labels to obtain the response model;

[0100] The model parameter scale of the second small language model is smaller than the model parameter scale of the large language model.

[0101] Optionally, the sample interaction sub-problems of each historical interaction and the knowledge information of the sample interaction sub-problems of each historical interaction can be used as samples, and the answer prediction information of the sample interaction sub-problems of each historical interaction can be used as labels. The second small language model can be distilled and trained with minimizing the loss function as the optimization goal, so that the trained response model can retrieve relevant background knowledge from an external knowledge base and answer sub-questions, thereby realizing the transfer of the answering ability in the large language model to the response model, so that the answering performance of the response model is close to that of the large language model, while having better generalization performance and smaller model size, thereby enhancing the ability of the small model to solve knowledge-intensive multi-hop question and answer tasks.

[0102] The first small language model and the second small language model here are both pre-trained language models with a small parameter scale. The model structures and parameter quantities between the two can be the same or different, and this embodiment does not specifically limit this.

[0103] Among them, the loss function of the response model is as follows:

[0104]

[0105] in, The answer prediction information of the sample sub-question of the jth historical interaction of the i-th sample question output by the response model; is the sample sub-problem of the jth historical interaction of the i-th sample problem, P i j is the knowledge information of the sample sub-problem of the jth historical interaction of the i-th sample problem retrieved from the external knowledge base, and is the top K most relevant knowledge information retrieved from the knowledge base D:

[0106]

[0107] Among them, R is a retrieval algorithm, p represents a piece of knowledge information in the knowledge base D, and the return value of the R algorithm represents the difference between the knowledge information p and the sub-problem degree of relevance; is the sample sub-problem of the jth historical interaction of the i-th sample problem, P i j is the knowledge information of the sample sub-problem of the jth historical interaction of the ith sample problem retrieved from the external knowledge base.

[0108] In some embodiments, determining target input information according to the current interaction sub-problem and the knowledge information of the current interaction sub-problem includes:

[0109] Acquire knowledge information of the current interactive sub-problem in a knowledge base;

[0110] The current interaction sub-problem and the knowledge information of the current interaction sub-problem are concatenated to obtain the target input information.

[0111] Optionally, knowledge information that is most relevant to the current interactive sub-problem is obtained from the knowledge base as the knowledge information of the current interactive sub-problem.

[0112] The knowledge information of the current interactive sub-problem is concatenated with the current interactive sub-problem, so that the target input information input into the response model includes not only the sub-problem information but also the corresponding knowledge information, so that the response model can output the correct answer more accurately and efficiently.

[0113] In some embodiments, the method further comprises:

[0114] In a case where the current interactive decision information includes the answer prediction information of the target question, the answer prediction information of the target question is sent to an initiator of the target question.

[0115] Optionally, when the current interactive decision information includes the answer prediction information of the target question, it indicates that the question and answer task is completed. At this time, the question and answer task processing for the target question can be stopped, and the answer prediction information of the target question is sent to the initiator of the target question so that the user can obtain the answer prediction information of the target question in a timely manner.

[0116] The following is an experimental simulation of the multi-hop question-answering method provided in this embodiment to verify the effectiveness of the multi-hop question-answering method provided in this embodiment.

[0117] Figure 3 This is one of the performance simulation diagrams of the multi-hop question-answering method provided by the present invention; Figure 4 This is the second performance simulation diagram of the multi-hop question-answering method provided by the present invention; Figure 5 FIG. 3 is a third performance simulation diagram of the multi-hop question answering method provided by the present invention; Figure 3 and Figure 4Based on the HotpotQA dataset and the 2WikiMultiHopQA dataset, the method (Ours) provided in this embodiment is compared with the prior art in terms of the training performance of models of different sizes. The prior art includes: a question-answering method that directly fine-tunes the student model without the help of a teacher model, inputs questions and outputs answers, also known as Fine-Tuning, a question-answering method that fine-tunes the student model with the help of thought chain annotations generated by the teacher model, inputs questions, and outputs the thought chain reasoning process and answers at the same time, also known as CoTD (Chain-of-thought Distillation, thought chain distillation), RA-CoTD, and a question-answering method that directly outputs the thought chain reasoning process and answers by guiding the FLAN-T5-XXL model with a parameter amount of 11B directly by using the thought chain prompt method without a training process, also known as FLAN-T5-XXL (11B); wherein the ordinate is the performance evaluation index: the question-answering score F1 (Answer F1), and the abscissa is the model size (Model Size); Figure 5 As shown in the figure, the method (Ours) provided in this embodiment is compared with the prior art, such as Fine-Tuning and RA-CoTD, on the model training performance of different training data amounts; wherein the ordinate is the performance evaluation index: the question-answering score F1 (Answer F1), and the abscissa is the amount of training data (Ratio of Training Data);

[0118] Through comparative analysis, it can be seen that when only 1 / 10 of the training data of the existing method is used, the method provided in this embodiment significantly surpasses the existing technical method. In addition, as the amount of data is further reduced, using only 2.5% of the training data, the performance of the method provided in this embodiment is still better than the existing method.

[0119] The multi-hop question-answering device provided by the present invention is described below. The multi-hop question-answering device described below and the multi-hop question-answering method described above can be referred to each other.

[0120] Figure 6 is a schematic diagram of the structure of the multi-hop question-answering device provided by the present invention; Figure 6 As shown, the device comprises:

[0121] The acquisition unit 610 is used to acquire current interaction record information of the target question; the current interaction record information includes answer prediction information of historical interaction sub-questions in the target question acquired in all historical interactions before the current interaction;

[0122] The decomposition unit 620 is used to input the current interaction record information and the target question into the decomposition model to obtain the current interaction decision information output by the decomposition model;

[0123] The response unit 630 is used to determine target input information according to the current interactive sub-problem and the knowledge information of the current interactive sub-problem when the current interactive decision information includes the current interactive sub-problem in the target problem, and input the target input information into the response model to obtain the answer prediction information of the current interactive sub-problem output by the response model;

[0124] The processing unit 640 is used to add the answer prediction information of the current interaction sub-question to the current interaction record information to obtain the next interaction record information, and continue to input the next interaction record information and the target question into the decomposition model until the next interaction decision information output by the decomposition model includes the answer prediction information of the target question;

[0125] The decomposition model is obtained by distillation training based on the first sample set, and the response model is obtained by distillation training based on the second sample set; the first sample set includes sample questions and sample interaction record information of the sample questions, and sample interaction decision information output by the large language model, and the sample interaction decision information includes sample interaction sub-questions or answer prediction information of the sample questions; the second sample set includes each of the sample interaction sub-questions, knowledge information of each of the sample interaction sub-questions, and answer prediction information of each of the sample interaction sub-questions output by the large language model.

[0126] The device provided in this embodiment generates a first sample set and a second sample set for performing distillation training of a student model by interacting with a teacher model of a large language model, so as to perform distillation training on the student model based on the first sample set to obtain a decomposition model of decision information that can decide to continue to raise sub-questions or output the final answer to the original question based on the current interaction record information, and to perform distillation training on the student model based on the second sample set to obtain a response model that can interact with an external knowledge base, retrieve relevant knowledge information and answer sub-questions. This not only realizes the distillation of the interactive decision-making ability and question-answering ability of the large language model to the two student models, which significantly reduces the complexity of the task and significantly reduces the amount of data required for distillation, but also significantly enhances the ability of the small model to solve knowledge-intensive multi-hop question-answering tasks. Moreover, compared with the retrieval of the original question, more sufficient background knowledge required to answer the multi-hop question can be obtained by further decomposing and refining the retrieval of the sub-questions, which further enhances the ability of the small model to solve the knowledge-intensive multi-hop question-answering tasks, thereby effectively solving the problems of insufficient background knowledge and the need for a large amount of training data in the prior art, and improving the accuracy and efficiency of knowledge-intensive multi-hop question-answering.

[0127] The device provided by the present invention is used to execute the above-mentioned method embodiments. Please refer to the above-mentioned embodiments for the specific processes and detailed contents, which will not be repeated here.

[0128] Figure 7 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 7 As shown, the electronic device may include: a processor 710, a communication interface 720, a memory 730 and a communication bus 740, wherein the processor 710, the communication interface 720 and the memory 730 communicate with each other through the communication bus 740. The processor 710 may call the logic instructions in the memory 730 to execute the multi-hop question-answering method, which includes: obtaining the current interaction record information of the target question; the current interaction record information includes the answer prediction information of the historical interaction sub-questions in the target question obtained in all historical interactions before the current interaction; inputting the current interaction record information and the target question into the decomposition model to obtain the current interaction decision information output by the decomposition model; in the case where the current interaction decision information includes the current interaction sub-question in the target question, determining the target input information according to the current interaction sub-question and the knowledge information of the current interaction sub-question, and inputting the target input information into the response model to obtain the answer prediction information of the current interaction sub-question output by the response model; adding the answer prediction information of the current interaction sub-question to the target question. The next interaction record information is obtained from the current interaction record information, and the next interaction record information and the target question are continuously input into the decomposition model until the next interaction decision information output by the decomposition model includes the answer prediction information of the target question; wherein the decomposition model is obtained by distillation training based on the first sample set, and the response model is obtained by distillation training based on the second sample set; the first sample set includes sample questions and each sample interaction record information of the sample questions, and each sample interaction decision information output by the large language model, and the sample interaction decision information includes sample interaction sub-questions, or answer prediction information of the sample questions; the second sample set includes each of the sample interaction sub-questions, the knowledge information of each of the sample interaction sub-questions, and the answer prediction information of each of the sample interaction sub-questions output by the large language model.

[0129] In addition, the logic instructions in the above-mentioned memory 730 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0130] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the multi-hop question-answering method provided by the above methods, which includes: obtaining current interaction record information of the target question; the current interaction record information includes answer prediction information of historical interaction sub-problems in the target question obtained in all historical interactions before the current interaction; inputting the current interaction record information and the target question into a decomposition model to obtain current interaction decision information output by the decomposition model; when the current interaction decision information includes the current interaction sub-problem in the target question, determining the target input information according to the current interaction sub-problem and the knowledge information of the current interaction sub-problem, and inputting the target input information into a response model to obtain the current interaction sub-problem output by the response model. The method comprises the steps of: generating a decomposition model and a response model, wherein the decomposition model is obtained by distillation training based on a first sample set, and the response model is obtained by distillation training based on a second sample set; the first sample set includes sample questions and sample interaction record information of the sample questions, and sample interaction decision information output by a large language model, wherein the sample interaction decision information includes sample interaction sub-questions or answer prediction information of the sample questions; the second sample set includes each of the sample interaction sub-questions, knowledge information of each of the sample interaction sub-questions, and answer prediction information of each of the sample interaction sub-questions output by the large language model.

[0131] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the multi-hop question-answering method provided by the above-mentioned methods, the method comprising: obtaining current interaction record information of a target question; the current interaction record information includes answer prediction information of historical interaction sub-problems in the target question obtained during all historical interactions before the current interaction; inputting the current interaction record information and the target question into a decomposition model to obtain current interaction decision information output by the decomposition model; in a case where the current interaction decision information includes the current interaction sub-problem in the target question, determining target input information based on the current interaction sub-problem and the knowledge information of the current interaction sub-problem, and inputting the target input information into a response model to obtain answer prediction information of the current interaction sub-problem output by the response model; The answer prediction information of the current interaction sub-problem is added to the current interaction record information to obtain the next interaction record information, and the next interaction record information and the target question are continuously input into the decomposition model until the next interaction decision information output by the decomposition model includes the answer prediction information of the target question; wherein the decomposition model is obtained by distillation training based on the first sample set, and the response model is obtained by distillation training based on the second sample set; the first sample set includes sample questions and each sample interaction record information of the sample questions, and each sample interaction decision information output by the large language model, and the sample interaction decision information includes sample interaction sub-problems, or answer prediction information of the sample questions; the second sample set includes each of the sample interaction sub-problems, the knowledge information of each of the sample interaction sub-problems, and the answer prediction information of each of the sample interaction sub-problems output by the large language model.

[0132] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

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

[0134] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A multi-hop question answering method, It is characterized in that include: Acquire current interaction record information of the target question; the current interaction record information includes answer prediction information of historical interaction sub-questions of the target question acquired in all historical interactions before the current interaction; Inputting the current interaction record information and the target question into a decomposition model to obtain current interaction decision information output by the decomposition model; In the case where the current interactive decision information includes the current interactive sub-problem in the target problem, target input information is determined according to the current interactive sub-problem and the knowledge information of the current interactive sub-problem, and the target input information is input into the response model to obtain the answer prediction information of the current interactive sub-problem output by the response model; Adding the answer prediction information of the current interaction sub-question to the current interaction record information to obtain next interaction record information, and continuing to input the next interaction record information and the target question into the decomposition model until the next interaction decision information output by the decomposition model includes the answer prediction information of the target question; The decomposition model is obtained by distillation training based on the first sample set, and the response model is obtained by distillation training based on the second sample set; the first sample set includes sample questions and sample interaction record information of the sample questions, and sample interaction decision information output by the large language model, and the sample interaction decision information includes sample interaction sub-questions or answer prediction information of the sample questions; the second sample set includes each of the sample interaction sub-questions, knowledge information of each of the sample interaction sub-questions, and answer prediction information of each of the sample interaction sub-questions output by the large language model.

2. The multi-hop question answering method according to claim 1, It is characterized in that The first sample set and the second sample set are obtained based on the following steps: For each historical interaction, the following steps are performed: The sample question and the sample interaction record information of the current historical interaction of the sample question are input into the large language model, and the large language model outputs the sample interaction decision information of the current historical interaction according to the sample question and the sample interaction record information of the current historical interaction of the sample question, and in the case where the sample interaction decision information of the current historical interaction includes the sample interaction sub-problem of the current historical interaction, based on the sample interaction sub-problem of the current historical interaction and the knowledge information of the sample interaction sub-problem of the current historical interaction, predict the answer prediction information of the sample interaction sub-problem of the current historical interaction, and add the answer prediction information of the sample interaction sub-problem of the current historical interaction to the sample interaction record information of the current historical interaction to obtain the sample interaction record information of the next historical interaction, and output the sample interaction decision information of the next historical interaction according to the sample question and the sample interaction record information of the next historical interaction of the sample question, until the sample interaction decision information of the next historical interaction includes the answer prediction information of the sample question; Constructing the first sample set according to the sample question, sample interaction record information of each historical interaction, and sample interaction decision information of each historical interaction; The second sample set is constructed according to the sample interaction sub-problems of each historical interaction, the knowledge information of the sample interaction sub-problems of each historical interaction, and the answer prediction information of the sample interaction sub-problems of each historical interaction.

3. The multi-hop question answering method according to claim 2, It is characterized in that The decomposition model is trained based on the following steps: Taking the sample question and sample interaction record information of each historical interaction as samples, and taking the sample interaction decision information of each historical interaction as labels, performing distillation training on the first small language model to obtain the decomposition model; The model parameter scale of the first small language model is smaller than the model parameter scale of the large language model.

4. The multi-hop question answering method according to claim 2, It is characterized in that The response model is trained based on the following steps: The second small language model is distilled and trained using the sample interaction sub-problems of each historical interaction and the knowledge information of the sample interaction sub-problems of each historical interaction as samples, and the answer prediction information of the sample interaction sub-problems of each historical interaction as labels to obtain the response model; The model parameter scale of the second small language model is smaller than the model parameter scale of the large language model.

5. The multi-hop question answering method according to any one of claims 1 to 4, It is characterized in that The determining target input information according to the current interaction sub-problem and the knowledge information of the current interaction sub-problem includes: Acquire knowledge information of the current interactive sub-problem in a knowledge base; The current interaction sub-problem and the knowledge information of the current interaction sub-problem are concatenated to obtain the target input information.

6. The multi-hop question answering method according to any one of claims 1 to 4, It is characterized in that The method further comprises: In a case where the current interactive decision information includes the answer prediction information of the target question, the answer prediction information of the target question is sent to an initiator of the target question.

7. A multi-hop question-answering device, It is characterized in that include: An acquisition unit, configured to acquire current interaction record information of a target question; the current interaction record information includes answer prediction information of historical interaction sub-questions of the target question acquired in all historical interactions before the current interaction; A decomposition unit, used for inputting the current interaction record information and the target question into a decomposition model to obtain current interaction decision information output by the decomposition model; A response unit, configured to determine target input information according to the current interactive sub-problem and knowledge information of the current interactive sub-problem, and input the target input information into a response model to obtain answer prediction information of the current interactive sub-problem output by the response model, when the current interactive decision information includes the current interactive sub-problem in the target problem; a processing unit, configured to add the answer prediction information of the current interaction sub-question to the current interaction record information to obtain next interaction record information, and continue to input the next interaction record information and the target question into the decomposition model until the next interaction decision information output by the decomposition model includes the answer prediction information of the target question; The decomposition model is obtained by distillation training based on the first sample set, and the response model is obtained by distillation training based on the second sample set; the first sample set includes sample questions and sample interaction record information of the sample questions, and sample interaction decision information output by the large language model, and the sample interaction decision information includes sample interaction sub-questions or answer prediction information of the sample questions; the second sample set includes each of the sample interaction sub-questions, knowledge information of each of the sample interaction sub-questions, and answer prediction information of each of the sample interaction sub-questions output by the large language model.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the program, the multi-hop question-answering method according to any one of claims 1 to 6 is implemented.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the multi-hop question-answering method according to any one of claims 1 to 6 is implemented.

10. A computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, the multi-hop question-answering method according to any one of claims 1 to 6 is implemented.