Question and answer interaction model training method and device based on imagination enhancement and question and answer interaction method and device based on imagination enhancement

By performing compressed text fine-tuning and adapter enhancement based on retrieval text for large language models, combined with long context distillation training, the knowledge acquisition limitations and illusion generation problems of language models in knowledge-intensive tasks are solved, and efficient and accurate question answering capabilities are achieved. .

CN118551009APending Publication Date: 2024-08-27INST OF AUTOMATION CHINESE ACAD OF SCI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410626490.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-20
Publication Date
2024-08-27

AI Technical Summary

Technical Problem

Large language models face knowledge acquisition limitations, insufficient knowledge activation, and generation illusion problems when processing knowledge-intensive tasks, especially when processing long texts and complex problems, the computational cost and time consumption increase significantly.

Method used

Fine-tune the large language model by compressing text based on the retrieved text, generate dummy text and add adapters to the attention layer of the student model, conduct distillation training to obtain a question and answer interaction model, reduce dependence on external resources, and enhance the capture of key information capabilities, and improve answer accuracy and efficiency through long context distillation.

Benefits of technology

Without direct access to external knowledge, it improves the accuracy and efficiency of question answering, reduces computational overhead, and significantly improves model performance on multiple QA data sets, especially showing good generalization in the zero-shot setting. ability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118551009A
    Figure CN118551009A
Patent Text Reader

Abstract

The invention provides a question and answer interaction model training and question and answer interaction method and device based on imagination enhancement, and the method comprises the steps: carrying out the fine tuning of a large language model based on a compressed text of a retrieval text, and generating a virtual text corresponding to a question text based on the fine-tuned large language model, the retrieval text being an enhanced text of the question text; inputting the question text and the virtual text into a student model to obtain a student answer text of the question text output by the student model, an adapter being added in an attention layer of the student model, the weight of the adapter being determined after inputting the question text into a meta-learning network; based on the difference between the student answer text and the teacher answer text, performing distillation training on the student model to obtain a question-answer interaction model; the teacher text is generated after the question text is input into a teacher model corresponding to the student model. The question and answer interaction model obtained by training can efficiently and accurately perform question and answer interaction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of knowledge question answering, and in particular to a question answering interaction model training based on imagination enhancement, a question answering interaction method and a device. Background Art

[0002] In the current field of Natural Language Processing (NLP), Large Language Models (LLMs) have become a powerful tool for solving various language understanding tasks. These models have accumulated rich language knowledge and world knowledge by pre-training on large-scale datasets. However, although LLMs perform well on many tasks, they still face some challenges when dealing with knowledge-intensive tasks such as open-domain question answering (QA). These challenges mainly include:

[0003] Knowledge acquisition limitations: LLMs usually need to access external knowledge bases (such as Wikipedia) to obtain the information needed to answer questions. This approach relies on the performance of the retrieval system, and the computational cost and time consumption increase significantly when processing long texts and complex questions.

[0004] Insufficient knowledge activation: Although LLMs contain a lot of knowledge, in practical applications, directly asking the model to output answers often leads to poor performance because the model may not be able to fully utilize its inherent knowledge.

[0005] Generation hallucination problem: In some cases, LLMs may generate inaccurate or non-existent information, a phenomenon known as “generation hallucination”. This is particularly evident in knowledge-intensive tasks, as the model may produce incorrect answers without sufficient context. Summary of the invention

[0006] The present invention provides a question-answering interaction model training based on imagination enhancement, a question-answering interaction method and a device, so as to solve the defects existing in the prior art.

[0007] The present invention provides a question-answering interactive model training method based on imagination enhancement, comprising:

[0008] Based on the compressed text of the search text, fine-tuning the large language model, and generating virtual text corresponding to the question text based on the fine-tuned large language model, wherein the search text is an enhanced text of the question text;

[0009] Input the question text and the dummy text into the student model, and obtain the student answer text of the question text output by the student model, wherein an adapter is added to the attention layer of the student model, and the weight of the adapter is determined after the question text is input into the meta-learning network;

[0010] Based on the difference between the student answer text and the teacher answer text, the student model is distilled and trained to obtain a question-answer interaction model; the teacher text is generated after the question text is input into the teacher model corresponding to the student model.

[0011] According to a method for training a question-answer interaction model based on imagination enhancement provided by the present invention, the large language model is fine-tuned based on the compressed text of the retrieved text, including:

[0012] Based on the compressed text, construct a prompt text;

[0013] The compressed text and the prompt text are input into the large language model to fine-tune the large language model.

[0014] According to a method for training a question-answer interaction model based on imagination enhancement provided by the present invention, the large language model is fine-tuned based on the compressed text of the retrieved text, and the method also includes:

[0015] Based on the question text, obtaining the search text;

[0016] Key information is extracted from the search text, and the compressed text is generated based on the key information.

[0017] According to the imagination-enhanced question-answer interaction model training method provided by the present invention, the adapter is arranged between the feedforward neural network layer and the normalization layer in the attention layer.

[0018] The present invention also provides a question-answering interactive method, comprising:

[0019] Determine the target question text;

[0020] Inputting the target question text into a fine-tuned large language model to obtain a target virtual text corresponding to the target question text output by the fine-tuned large language model; the large language model is fine-tuned based on a compressed text of the search text;

[0021] The target question text and the target virtual text are input into a question-and-answer interaction model to obtain a target answer text corresponding to the target question text output by the question-and-answer interaction model, wherein the question-and-answer interaction model is trained based on the imagination-enhanced question-and-answer interaction model training method as described in any of the above items.

[0022] The present invention also provides a question-answering interactive model training device based on imagination enhancement, comprising:

[0023] A fine-tuning unit, configured to fine-tune the large language model based on the compressed text of the search text, and generate a virtual answer text corresponding to the question text based on the fine-tuned large language model, wherein the search text is an enhanced text of the question text;

[0024] An input unit, used for inputting the question text and the virtual text into the student model, and obtaining the student answer text of the question text output by the student model, wherein an adapter is added to the attention layer of the student model, and the weight of the adapter is determined after the question text is input into the meta-learning network;

[0025] A training unit is used to train the student model based on the difference between the student answer text and the teacher answer text to obtain a question-answer interaction model; the teacher text is generated after the question text is input into the teacher model corresponding to the student model.

[0026] The present invention also provides a question-answering interactive device, comprising:

[0027] A determination unit, used to determine the target question text;

[0028] A generating unit, configured to input the target question text into a fine-tuned large language model, and obtain a target virtual text corresponding to the target question text output by the fine-tuned large language model; the large language model is fine-tuned based on a compressed text of a search text;

[0029] An interaction unit is used to input the target question text and the target virtual text into a question-and-answer interaction model to obtain a target answer text corresponding to the target question text output by the question-and-answer interaction model, wherein the question-and-answer interaction model is trained based on the imagination-enhanced question-and-answer interaction model training method as described in any of the above items.

[0030] 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 computer program, it implements any one of the above-mentioned imagination-enhanced question-and-answer interaction model training methods or question-and-answer interaction methods.

[0031] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the computer program implements any of the above-described imagination-enhanced question-answering interaction model training methods or question-answering interaction methods.

[0032] The present invention also provides a computer program product, including a computer program, which, when executed by a processor, implements any of the above-mentioned imagination-enhanced question-answering interaction model training methods or question-answering interaction methods.

[0033] The imagination-enhanced question-answering interaction model training, question-answering interaction method and device provided by the present invention input the question text into the fine-tuned large language model to obtain the corresponding virtual text, which simulates the long context, but is shorter in length and does not rely on external resources, reducing the computational overhead. In addition, the present invention adds an adapter to the attention layer of the student model, which can enhance the student model's ability to capture key information, that is, the question-answering interaction model finally trained can activate and apply its intrinsic knowledge through the adapter without directly accessing external knowledge, thereby improving the accuracy of the question and answer. Furthermore, through long-context distillation, the student model of the present invention can imitate the knowledge processing ability of the teacher model from the longer teacher answer text, ultimately improving the accuracy and efficiency of the question-answering interaction model in generating the answer text. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0035] Figure 1 It is a flow chart of the imagination-enhanced question-answering interactive model training method provided by the present invention;

[0036] Figure 2 It is a schematic diagram of the structure of the MetaNetwork and attention layer provided by the present invention;

[0037] Figure 3 It is a flow chart of another method for training a question-answer interaction model based on imagination enhancement provided by the present invention;

[0038] Figure 4 It is one of the zero-sample performance schematic diagrams provided by the present invention;

[0039] Figure 5 This is the second zero-sample performance diagram provided by the present invention

[0040] Figure 6 is a schematic diagram of an ablation experiment of explicit imagination and implicit imagination provided by the present invention;

[0041] Figure 7 It is a flowchart of the question-answering interactive method provided by the present invention;

[0042] Figure 8 It is a structural schematic diagram of a question-answering interactive model training device based on imagination enhancement provided by the present invention;

[0043] Fig. 9 It is a schematic diagram of the flow of the question-answering interactive device provided by the present invention;

[0044] Fig.10 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] LLMs still suffer from limited knowledge acquisition, insufficient knowledge activation, and generation hallucination when dealing with knowledge-intensive tasks such as open-domain question answering (QA). To address these problems, related technologies have proposed a variety of knowledge augmentation methods, such as Retrieval-Augmented Generation (RAG) and Generation-Augmented Generation (GAG). These methods enhance the knowledge of the model by combining retrieved documents or generated contexts. However, these methods still have problems such as dependence on external resources, high computational cost, and generation hallucination.

[0047] To this end, the present invention provides a question-answering interaction model training method based on imagination enhancement. Figure 1 is a flow chart of the imagination-enhanced question-answering interactive model training method provided by the present invention, such as Figure 1 As shown, the method comprises the following steps:

[0048] Step 110: fine-tune the large language model based on the compressed text of the search text, and generate a virtual answer text corresponding to the question text based on the fine-tuned large language model (LLMs), where the search text is an enhanced text of the question text.

[0049] Here, the question text refers to the text content of the question or query raised by the user. In the question-answering system, the user usually inputs a question or a text to be answered. This input is the question text. The question-answering interactive system will find the corresponding answer or information based on this question text and return it to the user. The search text can be understood as an enhanced text of the question text. For example, the search text can be additional information related to the topic of the question text, relevant context, relevant examples, or other content that helps to better understand and answer the question. The search text can be obtained by web crawlers or open data sets, and the embodiments of the present invention do not specifically limit this.

[0050] Compressed text can be understood as text that retains the semantic information of the search text and is shorter than the search text. Optionally, the search text can be compressed into a short compressed text containing key information through long context compression technology (such as LongLLMLingua).

[0051] After obtaining the compressed text, the large language model is fine-tuned based on the compressed text, so that the fine-tuned large language model can learn the knowledge involved in the retrieval text, that is, without relying on external resources, the fine-tuned large language model can learn more knowledge. In addition, since the compressed text is shorter and contains key information in the retrieval text, the computational overhead can be reduced.

[0052] After obtaining the fine-tuned large language model, the question text is input into the fine-tuned large language model to obtain the corresponding virtual text, which simulates the long context but is shorter and does not rely on external resources, reducing the computational overhead. In other words, the virtual text can be understood as an enhanced text of the question text, which is used to help further accurately extract key information from the question text.

[0053] Step 120: input the question text and the virtual text into the student model to obtain the student answer text of the question text output by the student model. An adapter is added to the attention layer of the student model, and the weight of the adapter is determined after the question text is input into the meta-learning network.

[0054] Specifically, since the virtual text is used to enhance the question text and help to further accurately extract key information from the question text, after the question text and the virtual text are input into the student model, the student model can accurately output the corresponding student answer text. Here, the student model can be understood as a simple model with a smaller scale, which can be a T5 (Text-To-Text Transfer Transformer) model.

[0055] In addition, an adapter is added to the attention layer of the student model, and the weight of the adapter is determined after the question text is input into the meta-learning network (MetaNetwork). Optionally, the MetaNetwork can be trained. During the training process, MetaNetwork receives the question text as input and outputs the corresponding adapter weight (LoRA weight). After adding the adapter to the attention layer of the student model, the student model's ability to capture key information can be enhanced, that is, the student model can activate and apply its internal knowledge through the adapter without directly accessing external knowledge, thereby improving the accuracy of question and answer.

[0056] Step 130: Based on the difference between the student answer text and the teacher answer text, the student model is distilled and trained to obtain a question-answer interaction model; the teacher text is generated after the question text is input into the teacher model corresponding to the student model.

[0057] Specifically, the teacher model can be understood as a large-scale complex model. The teacher model can be a FiD (Fréchet Inception Distance) model, which can be trained based on the question text and the retrieval text. Since the retrieval text is a long text, the teacher model can provide richer knowledge representation through the long text, and the student model learns how to extract useful information from the knowledge representation of the teacher model. In other words, through long-context distillation, the student model not only learns how to generate answer text, but also learns how to activate and utilize the intrinsic knowledge of LLMs, including the alignment of hidden states and attention matrices, to ensure that the student model can imitate the knowledge processing capabilities of the teacher model.

[0058] As an optional embodiment, a loss value is determined based on the difference between the student's answer text and the teacher's answer text, and the student model is distilled and trained based on the loss value to obtain a question-answering interaction model.

[0059] The imagination-enhanced question-answering interaction model training method provided by the present invention inputs the question text into the fine-tuned large language model to obtain the corresponding virtual text, which simulates the long context, but is shorter in length and does not rely on external resources, thereby reducing the computational overhead. In addition, the embodiment of the present invention adds an adapter to the attention layer of the student model, which can enhance the student model's ability to capture key information, that is, the question-answering interaction model finally trained can activate and apply its internal knowledge through the adapter without directly accessing external knowledge, thereby improving the accuracy of the question and answer. Furthermore, through long-context distillation, the embodiment of the present invention can enable the student model to imitate the knowledge processing capabilities of the teacher model from the longer teacher answer text, ultimately improving the accuracy and efficiency of the question-answering interaction model in generating the answer text.

[0060] Based on the above embodiment, the large language model is fine-tuned based on the compressed text of the search text, including:

[0061] Construct prompt text based on compressed text;

[0062] The compressed text and the prompt text are input into the large language model to fine-tune the large language model.

[0063] Specifically, the prompt text is used to prompt the large language model to imagine useful context information based on the existing context information of the compressed text, so as to assist the large language model in acquiring more knowledge. The prompt text may be a prompt text.

[0064] After the prompt text is constructed, the compressed text and the prompt text are input into the large language model, and the large language model is fine-tuned according to the compressed text and the prompt text to better adapt to the characteristics of the input text, thereby improving the performance and generalization ability of the model. The large language model here can be pre-trained on a smaller data set.

[0065] Based on any of the above embodiments, the large language model is fine-tuned based on the compressed text of the search text, and the following steps are also included:

[0066] Based on the question text, obtain the search text;

[0067] Extract key information from the retrieved text and generate compressed text based on the key information.

[0068] As an optional embodiment, the question text can be understood and analyzed to determine the subject, keywords and related information of the question. A search is performed based on keywords or natural language understanding, and the search is performed from a text database or the Internet to obtain a search text. Key information is extracted from the search text, and a short compressed text is generated based on the extracted key information.

[0069] Based on any of the above embodiments, the adapter is arranged between the feedforward neural network layer and the normalization layer in the attention layer.

[0070] Figure 2 It is a schematic diagram of the structure of the MetaNetwork and attention layer provided by the present invention, such as Figure 2 As shown, during the training of MetaNetwork, MetaNetwork receives context text (Context) and question text (Question) as input, outputs the corresponding adapter weight value (LoRA Weights), and adds the adapter (Imagine Adapter) between the feedforward neural network layer (LNN) and the normalization layer (Add+Norm) in the attention layer.

[0071] Based on any of the above embodiments, Figure 3 is a flow chart of another method for training a question-answer interaction model based on imagination enhancement provided by the present invention, such as Figure 3 As shown in the figure, the Image Model generates short virtual text (ImageInput) through explicit imagination to enhance the input; implicit imagination generates specific adapters for the question-answering interaction model (QAModel) based on the question, making more effective use of its inherent knowledge, thereby achieving better performance in knowledge-intensive tasks, including:

[0072] Step 1, explicit imagination, first use long context compression technology (such as LongLLMLingua) to compress a large amount of retrieval text (Docs) into a short compressed text containing key information; then, combine the compressed text with the prompt text (prompt) to fine-tune LLMs. Finally, LLMs generates a short dummy text (DummyDoc) based on the question text (Question). This document simulates the long context, but is shorter in length and does not rely on external resources, reducing computational overhead. Through explicit imagination, the question-answering interaction model is guided to imagine and utilize information related to the question in its internal knowledge, thereby helping to generate more accurate answers.

[0073] Step 2: Implicit imagination: During the training process, MetaNetwork receives the question text as input and outputs the weight value of the corresponding adapter. The adapter is constructed based on the weight value and added to the attention layer of the question-answering interaction model to enhance the question-answering interaction model's ability to capture key information. Through implicit imagination, the question-answering interaction model can activate and apply its internal knowledge through the weights generated by MetaNetwork without directly accessing external knowledge, thereby improving the accuracy of question-answering.

[0074] Step 3, training and optimization, long context distillation: During the training process, a teacher model Teacher (such as FiD) with rich context information is used to guide the student model Student (such as T5). The teacher model provides richer knowledge representations through long context, while the student model learns how to extract useful information from these representations. Through long context distillation, the student model not only learns how to generate answers, but also learns how to activate and utilize the intrinsic knowledge of LLMs.

[0075] To illustrate the effectiveness of the present invention, it is verified on multiple public QA datasets, including NaturalQuestions (NQ), TriviaQA (TQA) and WebQuestions (WQ). In order to evaluate the performance of the question-answering interaction model, the Exact Match (EM) score is used, that is, the proportion of predicted answers that completely match the reference answers. The experimental results show that the present invention significantly improves the performance of the model by activating internal knowledge through imagination without using retrieval. In addition, the present invention also shows good performance in the zero-shot setting, indicating its generalization ability in in-distribution and out-of-distribution tasks.

[0076] Table 1 is a general performance list. Table 1 shows the results of the question-answering experiment. The first part (closed-book setting) shows that no displayed documents are used, and the last three parts (open question-answering setting) use explicit enhanced documents. From Table 1, it can be found that the performance of the present invention (Ours) is significantly better than the baseline method, and it can achieve a balance between performance and cost.

[0077] Table 1

[0078]

[0079] Among them, the advantage of explicit imagination in the present invention is that in a closed-book setting, that is, without using any external documents, the virtual documents generated by explicit imagination in the present invention can significantly improve the EM score of the model, indicating that the present invention can effectively use the intrinsic knowledge of LLMs to answer questions.

[0080] Contribution of implicit imagination: Implicit imagination further enhances the performance of the model through the LoRA adapter weights generated by MetaNetwork. In the presence of retrieved documents, the performance of the present invention exceeds that of the model using only explicit imagination, showing the important role of implicit imagination in activating and applying knowledge. The present invention is more efficient in using imagination to activate knowledge while reducing the dependence on external resources.

[0081] Table 2 is a list of OOD tests. As shown in Table 2, the present invention also shows good generalization ability in the OOD (Out-of-Distribution) generalization test, which shows that it is not only effective on the training data set, but also can maintain high performance on unseen data. At the same time, when 10 retrieved texts are provided, the most excellent performance is shown in OOD. This advantage can be traced back to the key role played by MetaNetwork. This enables the question-answering interaction model to have the ability to call and access context-based internal knowledge, rather than being limited to solving specific problems.

[0082] Table 2

[0083]

[0084] Figure 4 is one of the zero-sample performance diagrams provided by the present invention, Figure 5 This is the second zero-sample performance schematic diagram provided by the present invention, wherein: Figure 4 The zero-shot performance of Llama2-7B is shown. Figure 5 The zero-shot performance of Llama2-13B is shown. Figure 4 and Figure 5 As shown, under the zero-shot setting, the performance of the present invention on LLMs (such as Llama2-7B and Llama2-13B) also shows its effectiveness, and it is still able to improve the question-answering ability of the model through internal knowledge activation.

[0085] Figure 6 is a schematic diagram of the ablation experiment of explicit imagination and implicit imagination provided by the present invention, such as Figure 6 As shown, both explicit and implicit imagery are important for knowledge enhancement, and ignoring either of them leads to a significant drop in performance, with performance dropping by more than 10% when explicit imagery is omitted. This is consistent with the initial observation that performance improvements become more pronounced when relevant text is available, thus emphasizing the superiority of explicit imagery.

[0086] In addition, MetaNetwork is responsible for generating LoRA adapter weights, which are used to adjust the attention mechanism of the question-answering interaction model. This approach allows the model to be fine-tuned without fully updating all parameters, thereby reducing the computational requirements during training. This parameter-efficient fine-tuning strategy (such as LoRA) enables the model to achieve performance improvements while maintaining a small computational overhead. The documents used at the same time are shorter and more critical, which enables the model to generate answers faster in the reasoning stage. Table 3 is a list of training time and reasoning overhead. As shown in Table 3, in the experiment, the present invention achieves a faster reasoning speed than traditional knowledge enhancement methods while maintaining performance.

[0087] Table 3

[0088]

[0089] Based on any of the above embodiments, Figure 7 It is a flow chart of the question-answering interactive method provided by the present invention. Figure 7 As shown, the method includes:

[0090] Step 710: determine the target question text;

[0091] Step 720: input the target question text into the fine-tuned large language model to obtain a target virtual text corresponding to the target question text output by the fine-tuned large language model; the large language model is fine-tuned based on the compressed text of the search text;

[0092] Step 730: input the target question text and the target virtual text into the question-answering interaction model to obtain the target answer text corresponding to the target question text output by the question-answering interaction model, and the question-answering interaction model is trained based on the imagination-enhanced question-answering interaction model training method described in any of the above embodiments.

[0093] Specifically, the target question text is the question text that needs to be question-answered. The fine-tuned large language model can be understood as the large language model fine-tuned based on the compressed text in step 110.

[0094] Since the question-answering interaction model trained in the above embodiment effectively utilizes the intrinsic knowledge of the question-answering interaction model by combining explicit imagination and implicit imagination, it reduces dependence on external resources and improves the efficiency and accuracy of the question-answering task. That is to say, when using the question-answering interaction model for question-answering interaction, not only can the target answer text be obtained quickly, but also the accuracy of the target answer text can be guaranteed.

[0095] Based on any of the above embodiments, Figure 8 is a structural schematic diagram of the imagination-enhanced question-answering interactive model training device provided by the present invention, such as Figure 8 As shown, the device comprises:

[0096] A fine-tuning unit 810, configured to fine-tune the large language model based on the compressed text of the search text, and generate a virtual answer text corresponding to the question text based on the fine-tuned large language model;

[0097] An input unit 820 is used to input the question text and the dummy text into the student model, and obtain the student answer text of the question text output by the student model. An adapter is added to the attention layer of the student model, and the weight of the adapter is determined after the question text is input into the meta-learning network;

[0098] The training unit 830 is used to train the student model based on the difference between the student answer text and the teacher answer text to obtain a question-answer interaction model; the teacher text is generated after the question text is input into the teacher model corresponding to the student model.

[0099] Based on any of the above embodiments, Fig. 9 Schematic diagram of the structure of the question-answering interactive device provided by the present invention. Fig. 9 As shown, the device comprises:

[0100] A determination unit 910, used to determine a target question text;

[0101] A generating unit 920 is used to input the target question text into the fine-tuned large language model to obtain a target virtual text corresponding to the target question text output by the fine-tuned large language model; the large language model is fine-tuned based on the compressed text of the search text;

[0102] The interaction unit 930 is used to input the target question text and the target virtual text into the question-answering interaction model to obtain the target answer text corresponding to the target question text output by the question-answering interaction model. The question-answering interaction model is trained based on the imagination-enhanced question-answering interaction model training method described in any of the above embodiments.

[0103] Fig.10 is a schematic diagram of the structure of the electronic device provided by the present invention, such as Fig.10 As shown, the electronic device may include: a processor 1010, a memory 1020, a communication interface 1030 and a communication bus 1040, wherein the processor 1010, the memory 1020 and the communication interface 1030 communicate with each other through the communication bus 1040. The processor 1010 may call the logic instructions in the memory 1020 to execute the imagination-enhanced question-answering interaction model training method or the question-answering interaction method.

[0104] In addition, the logic instructions in the above-mentioned memory 1020 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when 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 several 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.

[0105] On the other hand, the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the imagination-enhanced question-answering interaction model training method or question-answering interaction method provided by the above-mentioned methods.

[0106] 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 above-mentioned imagination-enhanced question-answering interaction model training method, or question-answering interaction method.

[0107] 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. Those of ordinary skill in the art may understand and implement it without creative work.

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

[0109] 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 question-answering interactive model training method based on imagination enhancement, characterized in that: include: Based on the compressed text of the search text, fine-tuning the large language model, and generating virtual text corresponding to the question text based on the fine-tuned large language model, wherein the search text is an enhanced text of the question text; Input the question text and the dummy text into the student model, and obtain the student answer text of the question text output by the student model, wherein an adapter is added to the attention layer of the student model, and the weight of the adapter is determined after the question text is input into the meta-learning network; Based on the difference between the student answer text and the teacher answer text, the student model is distilled and trained to obtain a question-answer interaction model; the teacher text is generated after the question text is input into the teacher model corresponding to the student model.

2. The imagination-enhanced question-answering interactive model training method according to claim 1, characterized in that: The method of fine-tuning the large language model based on the compressed text of the retrieved text includes: Based on the compressed text, construct a prompt text; The compressed text and the prompt text are input into the large language model to fine-tune the large language model.

3. The method for training a question-answer interaction model based on imagination enhancement according to claim 1, characterized in that: The compressed text based on the retrieved text fine-tunes the large language model, and previously also includes: Based on the question text, obtaining the search text; Key information is extracted from the search text, and the compressed text is generated based on the key information.

4. The method for training a question-answer interaction model based on imagination enhancement according to claim 1, characterized in that: The adapter is arranged between the feedforward neural network layer and the normalization layer in the attention layer.

5. A question-answering interactive method, characterized in that: include: Determine the target question text; Inputting the target question text into the fine-tuned large language model to obtain a target virtual text corresponding to the target question text output by the fine-tuned large language model; The large language model is fine-tuned based on the compressed text of the retrieved text; The target question text and the target virtual text are input into a question-and-answer interaction model to obtain a target answer text corresponding to the target question text output by the question-and-answer interaction model, wherein the question-and-answer interaction model is trained based on the imagination-enhanced question-and-answer interaction model training method as described in any one of claims 1 to 4.

6. A question-answering interactive model training device based on imagination enhancement, characterized in that: include: A fine-tuning unit, configured to fine-tune the large language model based on the compressed text of the search text, and generate a virtual answer text corresponding to the question text based on the fine-tuned large language model, wherein the search text is an enhanced text of the question text; An input unit, used for inputting the question text and the virtual text into the student model, and obtaining the student answer text of the question text output by the student model, wherein an adapter is added to the attention layer of the student model, and the weight of the adapter is determined after the question text is input into the meta-learning network; A training unit is used to train the student model based on the difference between the student answer text and the teacher answer text to obtain a question-answer interaction model; the teacher text is generated after the question text is input into the teacher model corresponding to the student model.

7. A question-answering interactive device, characterized in that: include: A determination unit, used to determine the target question text; A generating unit, configured to input the target question text into the fine-tuned large language model, and obtain a target virtual text corresponding to the target question text output by the fine-tuned large language model; The large language model is fine-tuned based on the compressed text of the retrieved text; An interaction unit is used to input the target question text and the target virtual text into a question-and-answer interaction model to obtain a target answer text corresponding to the target question text output by the question-and-answer interaction model, wherein the question-and-answer interaction model is trained based on the imagination-enhanced question-and-answer interaction model training method as described in any one of claims 1 to 4.

8. 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 computer program, the imagination-enhanced question-answering interaction model training method as described in any one of claims 1 to 4 is implemented, or the question-answering interaction method as described in claim 5 is implemented.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements the imagination-enhanced question-answering interaction model training method as described in any one of claims 1 to 4, or implements the question-answering interaction method as described in claim 5.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, it implements the imagination-enhanced question-answering interaction model training method as described in any one of claims 1 to 4, or implements the question-answering interaction method as described in claim 5.

Citation Information

Patent Citations

  • Cross-language question answering system construction method and device based on generative multi-language model

    CN115795009A

  • Schematic diagram question and answer method and system

    CN116431777A