Training method and device of dialogue query generation model based on retrieval enhancement model

CN117764140BActive Publication Date: 2026-10-30XIAMEN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311537070.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-17
Publication Date
2026-10-30
Estimated Expiration
2043-11-17

AI Technical Summary

Technical Problem

但是,由于对话内容及知识文档中往往含有大量噪声,字符串匹配方式无法考虑到深度语义信息,导致获取的弱监督训练信号不够准确,限制了对话查询生成模型的性能

Benefits of technology

[0019]根据本申请实施例的计算机可读存储介质,通过存储基于检索增强模型的对话查询生成模型的训练程序,以使得处理器在执行该基于检索增强模型的对话查询生成模型的训练程序时,实现如上述的基于检索增强模型的对话查询生成模型的训练方法,由此,通过使用训练获得的检索增强对话回复生成模型获取训练对话查询生成模型的弱监督训练信号,能够充分考虑对话上下文及知识文档的深度语义信息,从而能减轻数据中大量噪声的干扰,并且使用数据过滤及知识蒸馏技术,使对话查询生成模型更好收敛,提高最终对话查询生成模型的性能。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117764140B_ABST
    Figure CN117764140B_ABST
Patent Text Reader

Abstract

The application discloses a training method and device of a dialogue query generation model based on a retrieval enhancement model, which comprises the following steps: obtaining a candidate query set, and inputting each candidate query into a search engine in sequence to obtain a knowledge document corresponding to each candidate query; constructing a retrieval enhancement dialogue reply generation model, and training the constructed retrieval enhancement dialogue reply generation model according to a dialogue context and the knowledge document corresponding to each candidate query; scoring the knowledge document corresponding to each candidate query by using a retriever in the trained retrieval enhancement dialogue reply generation model to obtain a score value corresponding to each candidate query; constructing a dialogue query generation model, and training the dialogue query generation model according to the dialogue context, each candidate query and the score value corresponding to each candidate query to obtain a trained dialogue query generation model; and thus, deep semantic information can be considered, noise influence can be reduced, and the model performance can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of human-computer dialogue technology, and in particular to a training method for a dialogue query generation model based on a retrieval enhancement model, a computer-readable storage medium, a computer device, and a training apparatus for a dialogue query generation model based on a retrieval enhancement model. Background Technology

[0002] In related technologies, dialogue query generation is a crucial step in search engine knowledge-assisted dialogue systems. The dialogue queries predicted by the dialogue query generation model are used to retrieve relevant external knowledge from the search engine, thereby assisting in the generation of subsequent dialogue responses. Existing research, to avoid the overhead of manually annotating dialogue queries, employs a weakly supervised training method for the dialogue query generation model, using the string matching similarity between retrieved knowledge and dialogue responses as the training signal. However, since dialogue content and knowledge documents often contain a large amount of noise, the string matching method cannot take into account deep semantic information, resulting in inaccurate weakly supervised training signals and limiting the performance of the dialogue query generation model. Summary of the Invention

[0003] This application aims to at least partially address one of the technical problems in the aforementioned technologies. To this end, one objective of this application is to propose a training method for a dialogue query generation model based on a retrieval enhancement model. This method utilizes a retrieval enhancement dialogue response generation model to obtain weakly supervised training signals, which are then fed back to the dialogue query generation model. This allows the retrieval enhancement dialogue response generation model to consider deep semantic information and better resist a large amount of noise in the data. Furthermore, data filtering and knowledge distillation techniques are used to further enhance the model's training stability.

[0004] The second objective of this application is to provide a computer-readable storage medium.

[0005] The third objective of this application is to propose a computer device.

[0006] The fourth objective of this application is to propose a training device for a dialogue query generation model based on a retrieval enhancement model.

[0007] To achieve the above objectives, the first aspect of this application proposes a training method for a dialogue query generation model based on a retrieval enhancement model, comprising the following steps: obtaining a dialogue context and obtaining a corresponding candidate query set based on the dialogue context; sequentially inputting each candidate query in the candidate query set into a search engine to obtain a knowledge document corresponding to each candidate query; constructing a retrieval enhancement dialogue response generation model and training the constructed retrieval enhancement dialogue response generation model based on the dialogue context and the knowledge document corresponding to each candidate query, wherein the retrieval enhancement dialogue response generation model includes a retrieval unit and a generator; using the retrieval unit in the trained retrieval enhancement dialogue response generation model to score the knowledge document corresponding to each candidate query to obtain a score value corresponding to each candidate query; constructing a dialogue query generation model and training the dialogue query generation model based on the dialogue context, each candidate query, and the score value corresponding to each candidate query, and optimizing the model during the training process using data filtering and knowledge distillation to obtain a trained dialogue query generation model.

[0008] According to the training method of the dialogue query generation model based on the retrieval enhancement model in this application embodiment, firstly, the dialogue context is obtained, and a corresponding candidate query set is obtained based on the dialogue context; then, each candidate query in the candidate query set is sequentially input into the search engine to obtain the knowledge document corresponding to each candidate query; next, a retrieval enhancement dialogue response generation model is constructed, and the constructed retrieval enhancement dialogue response generation model is trained based on the dialogue context and the knowledge document corresponding to each candidate query, wherein the retrieval enhancement dialogue response generation model includes a retrieval unit and a generator; then, the retrieval unit in the trained retrieval enhancement dialogue response generation model is used to score the knowledge document corresponding to each candidate query to obtain... The system assigns a score to each candidate query. Finally, it constructs a dialogue query generation model and trains it based on the dialogue context, each candidate query, and its corresponding score. During training, data filtering and knowledge distillation are used to optimize the model, resulting in a well-trained dialogue query generation model. Thus, by using the trained retrieval-enhanced dialogue response generation model to obtain the weakly supervised training signal for the training model, the system can fully consider the deep semantic information of the dialogue context and knowledge documents, thereby reducing the interference of a large amount of noise in the data. Furthermore, the use of data filtering and knowledge distillation techniques allows the dialogue query generation model to converge better, improving the performance of the final model.

[0009] In addition, the training method for the dialogue query generation model based on the retrieval enhancement model proposed in the above embodiments of this application may also have the following additional technical features: Optionally, the retrieval unit and generator in the retrieval-enhanced dialogue response generation model share encoder parameters and are trained using the training loss corresponding to the RAG-token.

[0010] Optionally, the score for each candidate query can be obtained using the following formula:

[0011] in, Indicates the first Candidate queries The corresponding score, This represents a function that takes the maximum value in a set. Indicates the context of the dialogue. Indicates the first Candidate queries The corresponding M knowledge documents were retrieved.

[0012] Optionally, the dialogue query generation model can be trained according to the following formula:

[0013]

[0014] Among them, the Candidate queries It is a model generated based on dialogue queries. Obtained by sampling on the probability distribution of the candidate query set. Indicates the first The standardized reward value corresponding to each candidate query. This represents the average reward value for all candidate queries. express and The difference is used to stabilize the variance of the reward. This represents the maximum score among all candidate queries. This represents the minimum score among all candidate queries.

[0015] Optionally, data filtering for model optimization during training includes: obtaining a first threshold and a second threshold; obtaining the maximum and minimum scores among all candidate queries in a sample; if the maximum score among all candidate queries in a sample is less than the first threshold, or the difference between the maximum and minimum scores among all candidate queries in a sample is less than the second threshold, then all candidate queries and their corresponding dialogue contexts and scores in the sample are deleted.

[0016] Optionally, obtaining a corresponding candidate query set based on the dialogue context includes generating multiple predictive queries using a constructed dialogue query generation model to be enhanced, or extracting multiple keywords as the candidate query set using a publicly available keyword extraction model.

[0017] Optionally, the model optimization using knowledge distillation during training includes obtaining a knowledge distillation loss term and using the knowledge distillation loss term to filter the dialogue queries generated by the dialogue query generation model to be enhanced on unlabeled data, so as to obtain a small portion of high-quality data as training constraints.

[0018] To achieve the above objectives, a second aspect of this application provides a computer-readable storage medium storing a training program for a dialogue query generation model based on a retrieval enhancement model. When executed by a processor, the training program for the dialogue query generation model based on a retrieval enhancement model implements the training method for the dialogue query generation model based on a retrieval enhancement model as described above.

[0019] According to embodiments of this application, a computer-readable storage medium stores a training program for a dialogue query generation model based on a retrieval enhancement model. This allows a processor, when executing the training program, to implement the training method described above for the dialogue query generation model based on a retrieval enhancement model. By using the trained retrieval-enhanced dialogue response generation model to obtain the weakly supervised training signal for the training dialogue query generation model, the deep semantic information of the dialogue context and knowledge documents can be fully considered, thereby reducing interference from a large amount of noise in the data. Furthermore, by using data filtering and knowledge distillation techniques, the dialogue query generation model converges better, improving the performance of the final dialogue query generation model.

[0020] To achieve the above objectives, a third aspect of this application provides a computer device including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the training method for a dialogue query generation model based on a retrieval enhancement model as described above.

[0021] According to the computer device of the present application embodiment, a training program for a dialogue query generation model based on a retrieval enhancement model is stored in a memory, so that when the processor executes the training program for the dialogue query generation model based on the retrieval enhancement model, the training method for the dialogue query generation model based on the retrieval enhancement model as described above is implemented. Thus, by using the retrieval enhancement dialogue response generation model obtained through training to obtain the weakly supervised training signal for training the dialogue query generation model, the deep semantic information of the dialogue context and knowledge document can be fully considered, thereby reducing the interference of a large amount of noise in the data. Furthermore, by using data filtering and knowledge distillation techniques, the dialogue query generation model can converge better, thereby improving the performance of the final dialogue query generation model.

[0022] To achieve the above objectives, a fourth aspect of this application proposes a training apparatus for a dialogue query generation model based on a retrieval enhancement model, comprising: an acquisition module for acquiring a dialogue context and acquiring a corresponding candidate query set based on the dialogue context; a search module for sequentially inputting each candidate query in the candidate query set into a search engine to obtain a knowledge document corresponding to each candidate query; a first training module for constructing a retrieval enhancement dialogue response generation model and training the constructed retrieval enhancement dialogue response generation model based on the dialogue context and the knowledge document corresponding to each candidate query, wherein the retrieval enhancement dialogue response generation model includes a retrieval unit and a generator; a scoring module for scoring the knowledge document corresponding to each candidate query using the retrieval unit in the trained retrieval enhancement dialogue response generation model to obtain a score value corresponding to each candidate query; and a second training module for training the dialogue query generation model based on the dialogue context, each candidate query, and the score value corresponding to each candidate query, and optimizing the model during the training process using data filtering and knowledge distillation to obtain a trained dialogue query generation model.

[0023] According to the embodiments of this application, the training device for the dialogue query generation model based on the retrieval enhancement model obtains the weakly supervised training signal of the training dialogue query generation model by using the retrieval enhancement dialogue response generation model obtained through training. It can fully consider the deep semantic information of the dialogue context and knowledge documents, thereby reducing the interference of a large amount of noise in the data. Furthermore, by using data filtering and knowledge distillation techniques, the dialogue query generation model can converge better, thereby improving the performance of the final dialogue query generation model. Attached Figure Description

[0024] Figure 1 This is a flowchart illustrating the training method of a dialogue query generation model based on a retrieval enhancement model according to an embodiment of this application; Figure 2 This is a schematic diagram of the overall network structure according to an embodiment of this application; Figure 3 This is a block diagram of a training apparatus for a dialogue query generation model based on a retrieval enhancement model according to an embodiment of this application. Detailed Implementation

[0025] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.

[0026] To better understand the above technical solutions, exemplary embodiments of this application will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of this application are shown in the drawings, it should be understood that this application can be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of this application and to fully convey the scope of this application to those skilled in the art.

[0027] To better understand the above technical solutions, the following will provide a detailed explanation of the technical solutions in conjunction with the accompanying drawings and specific implementation methods.

[0028] Figure 1 This is a flowchart illustrating the training method of a dialogue query generation model based on a retrieval enhancement model according to an embodiment of this application. Figure 1 As shown, the training method for this dialogue query generation model based on the retrieval enhancement model includes the following steps: S101, obtain the dialogue context, and obtain the corresponding candidate query set based on the dialogue context.

[0029] In other words, the dialogue context is obtained from the unlabeled dialogue corpus, and the corresponding candidate query set is obtained based on the dialogue context.

[0030] As an example, obtaining the corresponding candidate query set based on the dialogue context includes generating multiple predictive queries using a constructed dialogue query generation model to be enhanced, or extracting multiple keywords as candidate query sets using a publicly available keyword extraction model.

[0031] In other words, there are multiple ways to obtain the candidate query set corresponding to the dialogue context. One way is to predict it through the dialogue query generation model to be enhanced, and another way is to extract it from the dialogue context through a keyword extraction tool.

[0032] It should be noted that the enhanced dialogue query generation model was trained on a small amount of existing publicly available labeled dialogue query data, denoted as . Keyword extraction tools can include publicly available and popular options such as TagMe or Yake!.

[0033] S102, input each candidate query in the candidate query set into the search engine in sequence so as to obtain the knowledge document corresponding to each candidate query.

[0034] It should be noted that the search engine can use common commercial search engines on the market, such as Baidu and Sogou, and the webpage summary information obtained from the candidate query search can be used as its corresponding knowledge document.

[0035] As a specific example, for the dialogue context of a sample in an unlabeled dialogue corpus Using the dialogue query generation model to be enhanced Decoding based on BeamSearch technology to obtain Candidate queries Enter each candidate query into the search engine for retrieval. For each candidate query, such as... Take the previous one Each webpage summary is used as a corresponding knowledge document, denoted as... .

[0036] S103, Construct a retrieval-enhanced dialogue response generation model, and train the retrieval-enhanced dialogue response generation model based on the dialogue context and the knowledge document corresponding to each candidate query. The retrieval-enhanced dialogue response generation model includes a retrieval unit and a generator.

[0037] As an example, the retrieval and generator in the retrieval-enhanced dialogue response generation model share encoder parameters and are trained using the RAG-token corresponding training loss.

[0038] As a specific implementation, the Retrieval Enhanced Dialogue Response Generation (RAG) model is initialized using publicly available pre-trained language models (such as T5 and BART) and modeled using a RAG variant—RAG-token. The Retrieval Enhanced Dialogue Response Generation model includes a retrieval unit and a generator. For the retrieval unit… The encoder uses a pre-trained language model combined with a multilayer perceptron (MLP), while the generator... It consists of an Encoder and a Decoder from a pre-trained language model, with the retrieval and generator sharing the Encoder's parameters; the model takes the dialogue context as input. and the corresponding set of knowledge documents obtained from all candidate searches. Predicting dialogue responses using autoregressive generation :

[0039]

[0040]

[0041]

[0042] in, Represents the collection of all related documents. This means retrieving the k documents with the highest scores. This represents the softmax function. The special characters representing the input will be used as input to the MLP layer to obtain the corresponding scores for the document in the model output.

[0043] S104, the retrieval machine in the trained retrieval-enhanced dialogue response generation model is used to score the knowledge document corresponding to each candidate query to obtain the score value corresponding to each candidate query.

[0044] As an example, the score for each candidate query is obtained according to the following formula:

[0045] in, Indicates the first Candidate queries The corresponding score, This represents a function that takes the maximum value in a set. Indicates the context of the dialogue. Indicates the first Candidate queries The corresponding M knowledge documents were retrieved.

[0046] In other words, after the retrieval-enhanced dialogue response generation model is trained, its retrieval module (Retriever) scores the candidate queries for each sample, and the scoring data uses the maximum score of the document corresponding to the candidate query.

[0047] S105. Construct a dialogue query generation model and train it based on the dialogue context, each candidate query, and the corresponding score of each candidate query. During the training process, data filtering and knowledge distillation are used to optimize the model in order to obtain a well-trained dialogue query generation model.

[0048] It should be noted that the dialogue query generation model uses the dialogue query generation model to be enhanced. Initialize the dialogue context for a given training example. Candidate queries are and its corresponding score value .

[0049] As an example, the dialogue query generation model is trained according to the following formula:

[0050]

[0051] Among them, the Candidate queries It is a model generated based on dialogue queries. Obtained by sampling on the probability distribution of the candidate query set. Indicates the first The standardized reward value corresponding to each candidate query. This represents the average reward value for all candidate queries. express and The difference is used to stabilize the variance of the reward. This represents the maximum score among all candidate queries. This represents the minimum score among all candidate queries.

[0052] As an example, data filtering for model optimization during training includes: obtaining a first threshold and a second threshold; obtaining the maximum and minimum scores among all candidate queries in a sample; if the maximum score among all candidate queries in a sample is less than the first threshold, or the difference between the maximum and minimum scores among all candidate queries in a sample is less than the second threshold, then all candidate queries and their corresponding dialogue contexts and scores in the sample are deleted.

[0053] As a specific implementation, during training, samples are filtered based on the scores of candidate queries. For a given sample, They are respectively The maximum and minimum values ​​in, if or ( , (These are set hyperparameters), indicating that the retrieved knowledge documents are generally irrelevant or the quality of knowledge is difficult to distinguish, thus they are likely noise samples.

[0054] As an example, using knowledge distillation for model optimization during training includes obtaining a knowledge distillation loss term and using the knowledge distillation loss term to filter dialogue queries generated by the dialogue query generation model on unlabeled data in order to obtain a small portion of high-quality data as training constraints.

[0055] As a specific implementation, during training, an additional knowledge distillation loss is introduced as a constraint term because the dialogue query generation model to be enhanced... The model is trained on a small number of high-quality, manually labeled datasets, while the reinforcement learning phase is trained on unlabeled, potentially noisy data. Therefore, to avoid the adverse effects of noisy data on model training, a knowledge distillation constraint is used to limit model parameter updates. Specifically, for a given sample, the dialogue context... and Predictive query The score is obtained according to the above method. ,like ( If the hyperparameters are not specified, the constructed sample is retained; during training, the constructed sample is used for training simultaneously.

[0056] Therefore, the trained dialogue query generation model can be used for model testing or subsequent deployment in practical applications.

[0057] In summary, by using the training methods described above, the dialogue query generation model can obtain more accurate and robust training signal feedback during the training process, enabling the dialogue query generation model to converge more smoothly and improving the performance of the final dialogue query generation model.

[0058] To implement the above embodiments, this application proposes a computer-readable storage medium storing a training program for a dialogue query generation model based on a retrieval enhancement model. When the training program for the dialogue query generation model based on the retrieval enhancement model is executed by a processor, it implements the training method for the dialogue query generation model based on the retrieval enhancement model as described above.

[0059] According to embodiments of this application, a computer-readable storage medium stores a training program for a dialogue query generation model based on a retrieval enhancement model. This allows a processor, when executing the training program, to implement the training method described above for the dialogue query generation model based on a retrieval enhancement model. By using the trained retrieval-enhanced dialogue response generation model to obtain the weakly supervised training signal for the training dialogue query generation model, the deep semantic information of the dialogue context and knowledge documents can be fully considered, thereby reducing interference from a large amount of noise in the data. Furthermore, by using data filtering and knowledge distillation techniques, the dialogue query generation model converges better, improving the performance of the final dialogue query generation model.

[0060] To implement the above embodiments, this application proposes a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the training method for the dialogue query generation model based on the retrieval enhancement model as described above.

[0061] According to the computer device of the present application embodiment, a training program for a dialogue query generation model based on a retrieval enhancement model is stored in a memory, so that when the processor executes the training program for the dialogue query generation model based on the retrieval enhancement model, the training method for the dialogue query generation model based on the retrieval enhancement model as described above is implemented. Thus, by using the retrieval enhancement dialogue response generation model obtained through training to obtain the weakly supervised training signal for training the dialogue query generation model, the deep semantic information of the dialogue context and knowledge document can be fully considered, thereby reducing the interference of a large amount of noise in the data. Furthermore, by using data filtering and knowledge distillation techniques, the dialogue query generation model can converge better, thereby improving the performance of the final dialogue query generation model.

[0062] To implement the above embodiments, this application also proposes a training device for a dialogue query generation model based on a retrieval enhancement model, such as... Figure 3 As shown, the training device for the dialogue query generation model based on the retrieval enhancement model includes: an acquisition module 10, a search module 20, a first training module 30, a scoring module 40, and a second training module 50.

[0063] The system comprises the following modules: an acquisition module 10, which acquires the dialogue context and obtains the corresponding candidate query set; a search module 20, which sequentially inputs each candidate query from the candidate query set into the search engine to obtain the knowledge document corresponding to each candidate query; a first training module 30, which constructs a retrieval-enhanced dialogue response generation model and trains it based on the dialogue context and the knowledge document corresponding to each candidate query, wherein the retrieval-enhanced dialogue response generation model includes a retrieval unit and a generator; a scoring module 40, which uses the retrieval unit in the trained retrieval-enhanced dialogue response generation model to score the knowledge document corresponding to each candidate query to obtain a score value for each candidate query; and a second training module 50, which trains the dialogue query generation model based on the dialogue context, each candidate query, and the score value corresponding to each candidate query, and optimizes the model during the training process using data filtering and knowledge distillation to obtain a trained dialogue query generation model.

[0064] It should be noted that the above regarding Figure 1 The example of the training method for the dialogue query generation model based on the retrieval enhancement model is also applicable to the training device for the dialogue query generation model based on the retrieval enhancement model, and will not be elaborated here.

[0065] In summary, the training apparatus for the dialogue query generation model based on the retrieval enhancement model according to the embodiments of this application obtains the weakly supervised training signal for training the dialogue query generation model by using the retrieval enhancement dialogue response generation model obtained through training. It can fully consider the deep semantic information of the dialogue context and knowledge documents, thereby reducing the interference of a large amount of noise in the data. Furthermore, by using data filtering and knowledge distillation techniques, the dialogue query generation model can converge better, thus improving the performance of the final dialogue query generation model.

[0066] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0067] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0068] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0069] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1The steps of the function specified in one or more boxes.

[0070] It should be noted that any reference signs placed between parentheses in the claims should not be construed as limiting the claims. The word "comprising" does not exclude the presence of components or steps not listed in the claims. The word "a" or "an" preceding a component does not exclude the presence of a plurality of such components. This application can be implemented by means of hardware comprising several different components and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names.

[0071] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.

[0072] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

[0073] In the description of this application, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.

[0074] In this application, unless otherwise expressly specified and limited, the terms "installation," "connection," "linking," and "fixing," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances.

[0075] In this application, unless otherwise expressly specified and limited, "above" or "below" the second feature can mean that the first feature is in direct contact with the second feature, or that the first feature is in indirect contact with the second feature through an intermediate medium. Furthermore, "above," "on top of," and "over" the second feature can mean that the first feature is directly above or diagonally above the second feature, or simply that the first feature is at a higher horizontal level than the second feature. "Below," "below," and "under" the second feature can mean that the first feature is directly below or diagonally below the second feature, or simply that the first feature is at a lower horizontal level than the second feature.

[0076] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. The illustrative expressions of the above terms in this specification should not be construed as necessarily referring to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0077] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of this application.

Claims

1. A training method for a dialogue query generation model based on a retrieval enhancement model, characterized in that, Includes the following steps: Obtain the dialogue context, and obtain the corresponding candidate query set based on the dialogue context; Each candidate query in the candidate query set is sequentially input into the search engine in order to obtain the knowledge document corresponding to each candidate query; A retrieval-enhanced dialogue response generation model is constructed, and the retrieval-enhanced dialogue response generation model is trained based on the dialogue context and the knowledge document corresponding to each candidate query. The retrieval-enhanced dialogue response generation model includes a retrieval unit and a generator. The retrieval system in the trained retrieval-enhanced dialogue response generation model is used to score the knowledge documents corresponding to each candidate query in order to obtain a score value for each candidate query. A dialogue query generation model is constructed, and the model is trained based on the dialogue context, each candidate query, and the score corresponding to each candidate query. During the training process, data filtering and knowledge distillation are used to optimize the model in order to obtain a well-trained dialogue query generation model. The dialogue query generation model is trained according to the following formula: Among them, the Candidate queries It is a model generated based on dialogue queries. Obtained by sampling on the probability distribution of the candidate query set. Indicates the first The standardized reward value corresponding to each candidate query. This represents the average reward value for all candidate queries. express and The difference is used to stabilize the variance of the reward. This represents the maximum score among all candidate queries. express The minimum score among the candidate queries. Indicates the context of the dialogue; Among these, data filtering for model optimization during training includes: Obtain the first threshold and the second threshold; Get the maximum and minimum scores among all candidate queries in a given sample; If the maximum value among all candidate queries in a certain sample is less than a first threshold, or the difference between the maximum and minimum values ​​among all candidate queries in a certain sample is less than a second threshold, then all candidate queries in the certain sample, along with their corresponding dialogue contexts and scores, will be deleted.

2. The training method for the dialogue query generation model based on the retrieval enhancement model as described in claim 1, characterized in that, The retriever and generator in the retrieval-enhanced dialogue response generation model share encoder parameters and are trained using the training loss corresponding to the RAG-token.

3. The training method for the dialogue query generation model based on the retrieval enhancement model as described in claim 2, characterized in that, The score for each candidate query is obtained using the following formula: in, Indicates the first Candidate queries The corresponding score, This represents a function that takes the maximum value in a set. Indicates the context of the dialogue. Indicates the first Candidate queries The corresponding M knowledge documents were retrieved.

4. The training method for the dialogue query generation model based on the retrieval enhancement model as described in claim 1, characterized in that, Based on the dialogue context, the corresponding candidate query set is obtained, including: Multiple predictive queries can be generated using a constructed dialogue query generation model, or multiple keywords can be extracted as the candidate query set using a publicly available keyword extraction model.

5. The training method for the dialogue query generation model based on the retrieval enhancement model as described in claim 1, characterized in that, The model optimization during training involves using knowledge distillation, which includes obtaining a knowledge distillation loss term and using the knowledge distillation loss term to filter the dialogue queries generated by the dialogue query generation model on unlabeled data, so as to obtain a small portion of high-quality data as training constraints.

6. A computer-readable storage medium, characterized in that, It stores a training program for a dialogue query generation model based on a retrieval enhancement model, which, when executed by a processor, implements the training method for a dialogue query generation model based on a retrieval enhancement model as described in any one of claims 1-5.

7. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the training method for the dialogue query generation model based on the retrieval enhancement model as described in any one of claims 1-5.

8. A training device for a dialogue query generation model based on a retrieval enhancement model, characterized in that, include: The acquisition module is used to acquire the dialogue context and obtain the corresponding candidate query set based on the dialogue context; The search module is used to input each candidate query in the candidate query set into the search engine in sequence so as to obtain the knowledge document corresponding to each candidate query. The first training module is used to construct a retrieval-enhanced dialogue response generation model and train the retrieval-enhanced dialogue response generation model based on the dialogue context and the knowledge document corresponding to each candidate query. The retrieval-enhanced dialogue response generation model includes a retrieval unit and a generator. The scoring module is used to score the knowledge document corresponding to each candidate query using the retrieval machine in the trained retrieval-enhanced dialogue response generation model, so as to obtain the score value corresponding to each candidate query. The second training module is used to construct a dialogue query generation model, and to train the dialogue query generation model based on the dialogue context, each candidate query and the score corresponding to each candidate query. During the training process, data filtering and knowledge distillation are used to optimize the model in order to obtain a trained dialogue query generation model. The dialogue query generation model is trained according to the following formula: Among them, the Candidate queries It is a model generated based on dialogue queries. Obtained by sampling on the probability distribution of the candidate query set. Indicates the first The standardized reward value corresponding to each candidate query. This represents the average reward value for all candidate queries. express and The difference is used to stabilize the variance of the reward. This represents the maximum score among all candidate queries. This represents the minimum score among all candidate queries. Indicates the context of the dialogue; Among these, data filtering for model optimization during training includes: Obtain the first threshold and the second threshold; Get the maximum and minimum scores among all candidate queries in a given sample; If the maximum value among all candidate queries in a certain sample is less than a first threshold, or the difference between the maximum and minimum values ​​among all candidate queries in a certain sample is less than a second threshold, then all candidate queries in the certain sample, along with their corresponding dialogue contexts and scores, will be deleted.

Citation Information

Patent Citations

  • Dialogue model training method and device

    CN116501842A

  • Differential perception reply generation method and system based on remote supervision and knowledge distillation

    CN116775840A