Multi-round dialogue information feature updating method based on optimal matching mechanism
Through the multi-round dialogue information feature update method with the optimal matching mechanism, the problems of information redundancy and context interference in the multi-round human-computer dialogue system are solved, and the screening and integration of key information is realized, information understanding ability and efficiency are improved. It is suitable for multi-round question-and-answer dialogue, human-computer dialogue, intelligent customer service and other scenarios.
Patent Information
- Application Number
- CN202510855556.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-25
- Publication Date
- 2025-08-01
AI Technical Summary
The existing multi-wheel human-computer dialogue system has information redundancy and context interference when facing long historical content, resulting in a decline in information understanding ability, a surge in model resource consumption, and inferred inference efficiency. The existing context compression and screening mechanism lacks adaptability and cannot finely model historical information weights and realize information fusion.
Multi-round dialogue information feature update method based on the optimal matching mechanism is adopted, and through multiple rounds of self-attention, information correlation score and cross-attention fusion, the compressed coding of historical information and context information are achieved, including the self-attention mechanism processing current and historical dialogue characteristics, key historical information is screened based on correlation scores, and deep fusion is carried out through cross-attention mechanism.
It significantly improves the ability of multi-round dialogue systems to understand current information, reduces redundant interference, improves the accuracy and efficiency of information understanding, adapts to different context structures, and reduces computing costs.
Smart Images

Figure CN120407747A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of large model theory and system research, and particularly to a method for updating multi-round dialogue information features based on an optimal matching mechanism. Background Art
[0002] Currently, in a multi-round human-computer dialogue system, the model needs to continuously receive and understand the interaction history between the user and the system to correctly interpret the current dialogue information. However, the historical dialogue content often contains a large amount of redundant or invalid information, and may even interfere with subsequent conversations due to problems such as information drift and ambiguous expressions.
[0003] Most traditional multi-round dialogue methods adopt a full-scale splicing method. For example, the historical text is directly spliced to the current input and then uniformly encoded. However, when facing long historical content, this method has significant information redundancy and context interference problems, resulting in a decline in information understanding ability, a sharp increase in model resource consumption, and low inference efficiency.
[0004] Therefore, the industry has gradually begun to explore more efficient context compression and screening mechanisms. In existing research, some methods attempt to prune historical conversations through rule-based summaries, window interception, or pruning strategies based on attention weights. Summary of the Invention
[0005] The inventors found that most of the existing context compression and screening mechanisms have the following limitations: The pruning strategy is rough and lacks adaptability: Rule-based or window-based pruning cannot adapt to the information characteristics of each round of dialogue, and it is easy to mistakenly delete key information or retain invalid content, affecting the accuracy of information understanding; Ignoring the internal structure and weight differences of historical rounds: The importance of each round in multi-round dialogue is not the same. Some statements carry key information, while other statements may be redundant supplements. The existing mechanisms fail to distinguish their importance levels; The fusion of historical information and current information is not deep enough: Most existing solutions use simple splicing or shallow attention mechanisms for information fusion, and fail to achieve deep interaction between historical information and current information, resulting in limited cross-round understanding ability.
[0006] Therefore, there is an urgent need for a new mechanism that can finely model the weights of historical information and achieve information compression and fusion to solve the information burden and information drift problems caused by long historical inputs.
[0007] The present invention proposes a method for updating multi-round dialogue information features based on an optimal matching mechanism. Through stages such as multi-round self-attention, information correlation scoring, optimal feature screening, and cross-attention fusion, it realizes the compression encoding of historical information and the efficient integration of context information, significantly improving the dialogue system's ability to understand current information.
[0008] According to the first aspect of the present application, there is provided a method for updating multi-round dialogue information features based on an optimal matching mechanism, characterized by including: (a) respectively determining an updated feature of the current round of dialogue and an updated feature of the historical dialogue according to the information feature of the current round of dialogue and the information feature of the current historical dialogue; (b) determining a corresponding query vector matrix of the current round of dialogue according to the updated feature of the current round of dialogue; (c) determining a corresponding key matrix of the historical dialogue and a value matrix of the historical dialogue according to the updated feature of the historical dialogue; (d) using the optimal matching mechanism according to the query vector matrix of the current round of dialogue and the key matrix of the historical dialogue, and obtaining a filtered key matrix of the historical dialogue and a filtered value matrix of the historical dialogue whose correlation with the information feature of the current round of dialogue meets a preset condition from the key matrix of the historical dialogue and the value matrix of the historical dialogue; and (e) obtaining updated dialogue information features according to the query vector matrix of the current round of dialogue, the filtered key matrix of the historical dialogue, and the filtered value matrix of the historical dialogue.
[0009] According to the second aspect of the present application, there is provided a device for updating multi-round dialogue information features based on an optimal matching mechanism, characterized by including: A first determination module, configured to respectively determine an updated feature of the current round of dialogue and an updated feature of the historical dialogue according to the information feature of the current round of dialogue and the information feature of the current historical dialogue; A second determination module, configured to determine a corresponding query vector matrix of the current round of dialogue according to the updated feature of the current round of dialogue; A third determination module, configured to determine a corresponding key matrix of the historical dialogue and a value matrix of the historical dialogue according to the updated feature of the historical dialogue; A first acquisition module, configured to use the optimal matching mechanism according to the query vector matrix of the current round of dialogue and the key matrix of the historical dialogue, and obtain a filtered key matrix of the historical dialogue and a filtered value matrix of the historical dialogue whose correlation with the information feature of the current round of dialogue meets a preset condition from the key matrix of the historical dialogue and the value matrix of the historical dialogue; and A second acquisition module, configured to obtain updated dialogue information features according to the query vector matrix of the current round of dialogue, the filtered key matrix of the historical dialogue, and the filtered value matrix of the historical dialogue.
[0010] According to the third aspect of the present application, there is provided an electronic device, including: A processor; and A memory storing computer instructions, which, when executed by the processor, cause the processor to execute the method described in the first aspect.
[0011] According to the fourth aspect of the present application, a non-transitory computer storage medium is provided, storing a computer program, which, when executed by a plurality of processors, causes the processors to execute the method described in the first aspect.
[0012] The multi-round dialogue information feature updating method and device based on the optimal matching mechanism provided by the present application realize the screening and fusion of key information content through the gradual processing of dialogue rounds and historical information, thereby solving the problems of redundant historical information and difficult extraction of key information in multi-round human-computer dialogue, and enhancing the system's understanding ability of current information. Description of the Drawings
[0013] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings without exceeding the scope of protection required by the present application.
[0014] Figure 1 is a schematic block diagram of a multi-round dialogue information feature updating system based on the optimal matching mechanism according to an embodiment of the present application.
[0015] Figure 2 is a flowchart of a multi-round dialogue information feature updating method based on the optimal matching mechanism according to an embodiment of the present application.
[0016] Figure 3 is a flowchart of a multi-round dialogue information feature updating method based on the optimal matching mechanism according to another embodiment of the present application.
[0017] Figure 4 is a schematic diagram of a multi-round dialogue information feature updating device based on the optimal matching mechanism according to an embodiment of the present application.
[0018] Figure 5 is a schematic diagram of a multi-round dialogue information feature updating device based on the optimal matching mechanism according to another embodiment of the present application.
[0019] Figure 6 is a schematic structural diagram of an electronic device provided by the present application. Detailed Embodiments
[0020] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative efforts belong to the scope of protection of the present application.
[0021] The multi-round dialogue information feature update solution based on the optimal matching mechanism proposed in the present application can be applied to interactive scenarios such as multi-round question and answer, human-computer dialogue, intelligent customer service, and task planning. Through the gradual processing of dialogue rounds and historical information, the screening and fusion of key information content are realized, thereby enhancing the system's understanding ability of the current information.
[0022] Figure 1 It is a schematic block diagram of a multi-round dialogue information feature update system based on the optimal matching mechanism according to an embodiment of the present application. As Figure 1 described, the system can mainly include three stages: the round dialogue and historical dialogue feature preparation stage, the optimal matching stage, and the historical information update stage.
[0023] In order to improve the information compression and fusion ability of the multi-round dialogue system when facing long context information, the present application first performs feature enhancement processing on the input text of the current round and the dialogue content of the previous historical rounds. In the round dialogue and historical dialogue feature preparation stage, when the system or model receives the information input in the current round (for example, it can include text information, image information, audio information, etc.), it determines the information features of the current round of dialogue corresponding to the dialogue content of the current round and the information features of the historical dialogue corresponding to the current round (abbreviated as "the information features of the current historical dialogue"), and respectively determines the update features of the current round of dialogue and the update features of the historical dialogue according to the information features of the current round of dialogue and the information features of the current historical dialogue.
[0024] In one embodiment, the information features of the current round of dialogue can be processed according to the self-attention mechanism to determine the update features of the current round of dialogue.
[0025] The self-attention mechanism module is responsible for encoding the information features of the current round of dialogue. By constructing the self-attention structure within the sentence, it captures the interdependent relationships between various information in the current input statement. For example, the dependencies between statements, between images, or between voices, thereby improving the accuracy of the current information representation. After processing, the current round representation with the ability to understand context information is obtained to determine the update features of the current round of dialogue.
[0026] In one embodiment, the information features of the current historical dialogue can be processed according to the self-attention mechanism to determine the update features of the historical dialogue.
[0027] The self-attention mechanism module acts on the information features of the current historical conversation. It uses the self-attention mechanism to mine the important information structure within the historical conversation, extracts and strengthens the segments that may provide information support for the current turn, enabling them to participate in subsequent screening and fusion.
[0028] After determining the updated features of the current turn of the conversation and the updated features of the historical conversation, a fully connected layer can be used to determine the corresponding query vector matrix for the current turn of the conversation based on the updated features of the current turn, and to determine the corresponding key matrix and value matrix for the historical conversation based on the updated features of the historical conversation.
[0029] The self-attention mechanism belongs to a method for dynamically screening the conversation content of historical rounds in a multi-round conversation scenario. It can compress redundant historical content during the information understanding process, only retaining the key information that is most contributive to the current conversation turn, thereby enhancing the system's fine-grained modeling ability for the context, and is particularly suitable for scenarios with dense or redundant information in long contexts.
[0030] Through the processing of the above self-attention mechanism module, two enhanced information representations can be obtained: a vector feature for expressing the information of the current turn, and a set of information features containing the context information of historical rounds.
[0031] Next, in order to avoid the interference of redundant content in historical information on the current information modeling and make full use of potential valuable information, the present invention designs an optimal matching mechanism based on information relevance. The main process of this mechanism can include: Information relevance evaluation: The system first pairwise matches the information representation of the current turn with each unit in the historical information set and calculates the information relevance score between them. This score is used to measure the contribution degree of each piece of information in the history to the current information.
[0032] High-correlation screening: Based on the aforementioned relevance scores, the information features of the historical conversation are sorted, and a preset number of historical segments with the highest scores are selected. These segments are considered the historical information most relied on by the current information.
[0033] Constructing an effective key-value pair set: The selected historical information is further organized into a "key-value pair" structure for the context memory input of the subsequent information fusion module, thereby constructing a highly targeted information context subset.
[0034] This stage realizes the effective compression of historical content, avoiding the redundancy and misdirection brought by inputting the entire conversation history into the model without discrimination.
[0035] After screening the key historical information, the system needs to fuse it with the information features of the current round of conversation to generate a new round of conversation information representation for downstream task invocation or for information continuation in the next round of conversation. To this end, a cross-attention mechanism is adopted in this stage to achieve deep fusion between historical and current information. The fusion process mainly includes the following steps: Take the information features of the current round of conversation as the query information input; Take the filtered historical information key-value pairs as the context information input; Through the cross-attention mechanism, the information features of the current round of conversation are weighted and updated so that it can extract valuable supplementary information from the historical context.
[0036] The finally generated new information representation fuses both the current round of input and the key points of the previous information. It is a representation result after context compression, with both information integrity and representation conciseness. This fused feature can be used as the information feature input in subsequent tasks, such as text prompts in multimodal models, dialogue state tracking, or response generation modules, etc.
[0037] In summary, this application constructs a complete multi-round conversation context compression encoding process through three key steps: dialogue feature preparation, optimal matching, and historical information update. This process can not only improve the efficiency and accuracy of multi-round information modeling, but also has good adaptability and scalability, and is applicable to multiple natural language processing scenarios such as question-and-answer systems, dialogue understanding, virtual assistants, and vision-language understanding.
[0038] In Figure 1 Based on the system shown, according to one aspect of this application, a method for updating multi-round conversation information features based on an optimal matching mechanism is provided. As Figure 2 shown, this method includes the following steps: Step S201, respectively determine the updated features of the current round of conversation and the updated features of the historical conversation according to the information features of the current round of conversation and the information features of the current historical conversation.
[0039] In one embodiment, in order to ensure that the method for updating multi-round conversation information features based on the optimal matching mechanism can selectively select information from historical data and fuse it into the current round of conversation, it is first necessary to preprocess the information features of the current round of conversation and the information features of the historical conversation. In some embodiments, the preprocessing process mainly uses a self-attention mechanism to process the information features of the current round of conversation and the information features of the historical conversation to respectively determine the updated features of the current round of conversation and the updated features of the historical conversation.
[0040] In one embodiment, the information features may include features such as text features, image features, and / or voice features, etc.
[0041] In a specific embodiment, for the information features of each round of conversation, the self-attention mechanism can be used to calculate its own importance, as shown in Equation (1): (1) Wherein, 、 and respectively represent the query matrix, key matrix and value matrix of the information features of this round of conversation, is the scaling factor of the feature dimension, represents the updated feature of this round of conversation, represents the normalization exponential function, and T represents matrix transpose.
[0042] In a specific embodiment, for the information features of the current historical conversation, the self-attention mechanism can be used to calculate its own importance, as shown in Equation (2): (2) Wherein, 、 and respectively represent the query matrix, key matrix and value matrix of the information features of the current historical conversation, is the scaling factor of the feature dimension, represents the updated feature of the historical conversation, represents the normalization exponential function, and T represents matrix transpose.
[0043] In an alternative embodiment, step S201 may include: Processing the information features of this round of conversation according to the self-attention mechanism to determine the updated feature of this round of conversation; and Processing the information features of the current historical conversation according to the self-attention mechanism to determine the updated feature of the historical conversation.
[0044] Step S202, determining the corresponding query vector matrix of this round of conversation according to the updated feature of this round of conversation; Step S203, determining the corresponding key matrix and value matrix of the historical conversation according to the updated feature of the historical conversation.
[0045] In an embodiment, as Figure 1 shown, after determining the updated feature of this round of conversation and the updated feature of the historical conversation, a fully connected layer can be adopted to determine the corresponding query vector matrix of this round of conversation according to the updated feature of this round of conversation, and determine the corresponding key matrix and value matrix of the historical conversation according to the updated feature of the historical conversation.
[0046] Step S204: Query the vector matrix and the historical dialogue key matrix according to the current round of dialogue. Adopt the optimal matching mechanism to obtain the filtered historical dialogue key matrix and the filtered historical dialogue value matrix from the historical dialogue key matrix and the historical dialogue value matrix, where the correlation between the information features of the current round of dialogue meets the preset conditions.
[0047] To efficiently fuse the information features of the current round of dialogue with the information features of the current historical dialogue , an optimal matching mechanism is introduced to obtain the historical dialogue key vectors and historical dialogue value vectors whose correlation with the information features of the current round of dialogue meets the preset conditions from the historical dialogue key matrix and the historical dialogue value matrix, so as to screen and strengthen the key historical features.
[0048] In one embodiment, calculate the correlation scores between each vector in the historical dialogue key matrix and the query vector matrix of the current round of dialogue, and filter out a preset number of historical dialogue features with the most information value according to this score. A preset number of historical dialogue key vectors with the highest correlation scores can be determined from the historical dialogue key matrix. Subsequently, extract the key-value pairs corresponding to these high-weight historical features, specifically, a preset number of historical dialogue value vectors can be determined according to the preset number of historical dialogue key vectors. The key-value pairs corresponding to the high-weight historical features can be introduced into the subsequent processing steps to ensure that the model focuses on the context information with the most information contribution, thereby enhancing the dialogue understanding ability.
[0049] In a specific embodiment, in order to effectively fuse the information features of the current historical dialogue, a cross-round feature correlation evaluation method can be adopted, as shown in Equation (3): (3) Where and represent the query vector matrix of the current round of dialogue and the historical dialogue key matrix generated by the updated features of the current round of dialogue and the updated features of the historical dialogue respectively. represents the normalized exponential function, T represents matrix transpose, and S represents the correlation score matrix.
[0050] The historical dialogue key matrix usually contains multiple historical dialogue key vectors. Correspondingly, the correlation score matrix S contains multiple scores. According to the correlation score matrix S, a preset number of historical dialogue key vectors with the highest correlation scores are determined from the historical dialogue key matrix. When determining the preset number of historical dialogue key vectors, according to the correspondence between the historical dialogue key vectors and the historical dialogue value vectors, the corresponding preset number of historical dialogue value vectors are determined, so as to form a historical key-value pair matrix, which can be respectively marked as and , where represents the filtered historical dialogue key matrix represents the filtered historical dialogue value matrix.
[0051] In an alternative embodiment, step S204 may include: Determine the correlation scores corresponding to each vector in the historical dialogue key matrix according to the current round of dialogue query vector matrix and the historical dialogue key matrix; Determine a preset number of historical dialogue key vectors with the highest correlation scores from the historical dialogue key matrix to generate the filtered historical dialogue key matrix; and Determine the corresponding preset number of historical dialogue value vectors according to the preset number of historical dialogue key vectors to generate the filtered historical dialogue value matrix.
[0052] This application introduces an optimal matching mechanism to achieve dynamic screening and compression encoding of multi-round historical information, significantly improving the information understanding accuracy and efficiency of the multi-round dialogue system in long historical scenarios. Compared with traditional splicing input or compression strategies based on window truncation, this application excludes redundant interference content through correlation scoring and screening, and only retains key information, thus having a high-robustness information compression ability.
[0053] Step S205, obtain the updated dialogue information features according to the current round of dialogue query vector matrix, the filtered historical dialogue key matrix, and the filtered historical dialogue value matrix.
[0054] In an embodiment, after obtaining the historical key-value pair matrix, the updated dialogue information features can be obtained according to the current round of dialogue query vector matrix, the filtered historical dialogue key matrix, and the filtered historical dialogue value matrix.
[0055] In a specific embodiment, a cross-attention mechanism can be used to update the information features of the current round of dialogue, as shown in equation (4): (4) Where represents the updated features of the current round of dialogue generates the current round of dialogue query vector matrix, represents the filtered historical dialogue key matrix, represents the filtered historical dialogue value matrix, is the scaling factor of the feature dimension, represents the normalization exponential function, T represents matrix transpose, Represents the updated dialogue information feature, which integrates the information features of historical conversations and the information features of the current round of conversation, and can be used for subsequent information feature expressions such as visual models.
[0056] In an alternative embodiment, step S205 may include: Based on the query vector matrix of the current round of conversation, the filtered historical conversation key matrix, and the filtered historical conversation value matrix, using a cross-round cross-attention mechanism to determine the updated dialogue information feature.
[0057] This application realizes the deep alignment of the current round and historical information through cross-attention, improving the context consistency modeling ability.
[0058] Figure 3 is a flowchart of a multi-round dialogue information feature update method based on an optimal matching mechanism according to another embodiment of the present application. Compared with Figure 2 Compared, Figure 3 Steps S301 to S305 of the method shown are the same as steps S201 to S305 of Figure 2 , the difference is that Figure 3 The method shown also includes: Step S306, in response to receiving the input information, determining the information feature of the current round of conversation; and Step S307, determining the updated dialogue information feature as the information feature of the current historical conversation, and returning to step S301.
[0059] In an embodiment, when or after the system or model receives the information input in the current round (for example, including text information, image information, or voice information), it can determine the information feature of the current round of conversation corresponding to the current round of conversation through feature extraction processing, and determine the updated dialogue information feature determined in step S305 as the information feature of the current historical conversation, and return to step S301 for processing.
[0060] In this application, the updated dialogue information feature determined in the current round is used as the information feature of the current historical conversation in the next round of conversation, avoiding repeated modeling of all historical information, significantly reducing the calculation cost, and being suitable for large-scale deployment and multi-task sharing.
[0061] According to another aspect of the present application, there is provided a multi-round dialogue information feature update device based on an optimal matching mechanism. As Figure 4As shown, the device includes a first determination module 401, a second determination module 402, a third determination module 403, a first acquisition module 404, and a second acquisition module 405. Among them, the first determination module 401 is used to determine the current round of dialogue update features and historical dialogue update features respectively according to the information features of the current round of dialogue and the information features of the current historical dialogue; the second determination module 402 is used to determine the corresponding current round of dialogue query vector matrix according to the current round of dialogue update features; the third determination module 403 is used to determine the corresponding historical dialogue key matrix and historical dialogue value matrix according to the historical dialogue update features; the first acquisition module 404 is used to adopt an optimal matching mechanism according to the current round of dialogue query vector matrix and the historical dialogue key matrix, and obtain a filtered historical dialogue key matrix and a filtered historical dialogue value matrix whose relevance to the information features of the current round of dialogue meets the preset conditions from the historical dialogue key matrix and the historical dialogue value matrix; the second acquisition module 405 is used to obtain updated dialogue information features according to the current round of dialogue query vector matrix, the filtered historical dialogue key matrix, and the filtered historical dialogue value matrix.
[0062] In an alternative embodiment, the first determination module 401 may be used to: Process the information features of the current round of dialogue according to the self-attention mechanism to determine the current round of dialogue update features; and Process the information features of the current historical dialogue according to the self-attention mechanism to determine the historical dialogue update features.
[0063] In an alternative embodiment, the first acquisition module 404 may be used to: Determine the correlation scores corresponding to each vector in the historical dialogue key matrix according to the current round of dialogue query vector matrix and the historical dialogue key matrix; Determine a preset number of historical dialogue key vectors with the highest correlation scores from the historical dialogue key matrix according to the correlation scores, and generate the filtered historical dialogue key matrix; and Determine the corresponding preset number of historical dialogue value vectors according to the preset number of historical dialogue key vectors, and generate the filtered historical dialogue value matrix.
[0064] In an alternative embodiment, the second acquisition module 405 may be used to: Determine updated dialogue information features according to the current round of dialogue query vector matrix, the filtered historical dialogue key matrix, and the filtered historical dialogue value matrix by using a cross-round cross-attention mechanism.
[0065] Figure 5It is a schematic diagram of a multi-round dialogue information feature update device based on an optimal matching mechanism according to another embodiment of the present application. Compared with Figure 4 compared with Figure 5 the modules 501 to 505 of the device shown are the same as Figure 4 the modules 401 to 405 of Figure 5 The difference is that a fourth determination module 506, configured to determine the information feature of the current round of dialogue in response to receiving the input information; and a fifth determination module 507, configured to determine the updated dialogue information feature as the information feature of the current historical dialogue.
[0066] According to the multi-round dialogue information feature update method and device based on the optimal matching mechanism provided by the present application, through the step-by-step processing of the dialogue round and historical information, the screening and fusion of key information content are realized, so as to solve the problems of redundant historical information and difficult extraction of key information in multi-round human-computer dialogue, and enhance the system's understanding ability of the current information. The present application introduces an optimal matching mechanism to realize the dynamic screening and compression coding of multi-round historical information, significantly improving the information understanding accuracy and efficiency of the multi-round dialogue system in long historical scenarios. Compared with the traditional splicing input or compression strategy based on window truncation, the present application excludes redundant interference content through correlation scoring and screening, and only retains key information, thus having a high-robustness information compression ability; the present application realizes the deep alignment of the current round and historical information through cross-attention, improving the context consistency modeling ability; the present application can avoid repeated modeling of all historical information, significantly reducing the calculation cost, and is suitable for large-scale deployment and multi-task sharing; in addition, the present application has the ability of information adaptive feature update, and can adapt to different context structures and complex language representations.
[0067] In the above embodiments, the descriptions of the various embodiments have their own emphases. For the parts not detailed in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.
[0068] It should be noted that, for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the present application is not limited by the described action sequence, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily essential to the present application.
[0069] In several embodiments provided in this application, it should be understood that the disclosed device can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units as described above is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection to each other can be through some interfaces. The indirect coupling or communication connection of the device or unit can be an electrical connection or other forms.
[0070] Refer to Figure 6 , Figure 6 An electronic device is provided, including a processor and a memory. The memory stores computer instructions or one or more programs. When the computer instructions or one or more programs are executed by the processor, the processor executes the computer instructions to implement the methods and refinement solutions as shown in Figure 2 and Figure 3 shown.
[0071] It should be understood that the above device embodiments are merely illustrative. The devices disclosed in the present invention can also be implemented in other ways. For example, the division of the units / modules in the above embodiments is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units, modules or components can be combined, or integrated into another system, or some features can be ignored or not executed.
[0072] In addition, without special instructions, in each embodiment of the present invention, each functional unit / module can be integrated in one unit / module, or each unit / module can exist physically alone, or two or more units / modules can be integrated together. The above integrated unit / module can be implemented in the form of hardware or in the form of a software program module.
[0073] When the integrated unit / module is implemented in the form of hardware, the hardware can be a digital circuit, an analog circuit, etc. The physical implementation of the hardware structure includes but is not limited to transistors, memristors, etc. Unless otherwise specified, the processor or chip can be any suitable hardware processor, such as a CPU, GPU, FPGA, DSP, and ASIC, etc. Unless otherwise specified, the on-chip cache, off-chip memory, and memory can be any suitable magnetic storage medium or magneto-optical storage medium, such as resistive random access memory (RRAM), dynamic random access memory (DRAM), static random access memory (SRAM), enhanced dynamic random access memory (EDRAM), high-bandwidth memory (HBM), hybrid memory cube (HMC), etc.
[0074] When the integrated unit / module is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions for causing a computer electronic device (which can be a personal computer, a server, or a network electronic device, etc.) to execute all or part of the steps of the methods described in various embodiments of this disclosure. And the aforementioned memory includes: USB flash drives, read-only memory (ROM), random access memory (RAM), external hard drives, magnetic disks, or optical discs and other various media that can store program codes.
[0075] The embodiments of this application also provide a computer-readable storage medium storing one or more computer programs. When the one or more computer programs are executed by multiple processors, the processors are caused to execute as Figure 2 and Figure 3 the methods and refinement solutions shown.
[0076] The embodiments of this application also provide a computer program product containing a computer program. When the computer program runs on a computer, the computer is caused to execute the methods of any of the above embodiments.
[0077] References in this specification to features, advantages, or similar language do not imply that all features and advantages that can be realized by the solution should be included in or included in any single implementation thereof. On the contrary, language referring to features and advantages is understood to mean that a particular feature, advantage, or characteristic described in connection with an embodiment is included in at least one embodiment of the solution. Thus, the discussion of features, advantages, and similar language throughout this specification may, but does not necessarily, refer to the same embodiment.
[0078] In addition, the features, advantages, and characteristics of the solution may be combined in any suitable manner in one or more embodiments. Based on the description herein, those of ordinary skill in the relevant art will recognize that the solution can be implemented without one or more specific features or advantages of a particular embodiment. In other cases, additional features and advantages can be realized in a particular embodiment that is not presented in all embodiments of the solution.
[0079] The embodiments of the present application have been introduced in detail above. Specific examples are used herein to elaborate on the principles and implementation manners of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application. At the same time, any changes or deformations made by those skilled in the art based on the idea of the present application, within the specific implementation manners and application scope of the present application, fall within the scope of protection of the present application. In summary, the content of this specification should not be construed as a limitation on the present application.
Claims
1. A method for updating multi-round dialogue information features based on an optimal matching mechanism, characterized in that Including: (a) determining an update feature of the current round of conversation and an update feature of the historical conversation respectively according to the information feature of the current round of conversation and the information feature of the current historical conversation; (b) determining a corresponding query vector matrix of the current round of conversation according to the update feature of the current round of conversation; (c) determining a corresponding historical conversation key matrix and a historical conversation value matrix according to the update feature of the historical conversation; (d) according to the query vector matrix of the current round of conversation and the historical conversation key matrix, adopting an optimal matching mechanism to obtain a filtered historical conversation key matrix and a filtered historical conversation value matrix whose relevance to the information feature of the current round of conversation meets a preset condition from the historical conversation key matrix and the historical conversation value matrix; and (e) obtaining an updated conversation information feature according to the query vector matrix of the current round of conversation, the filtered historical conversation key matrix, and the filtered historical conversation value matrix.
2. The method according to claim 1, characterized in that, Step (a) includes: processing the information feature of the current round of conversation according to the self-attention mechanism to determine the update feature of the current round of conversation; and processing the information feature of the current historical conversation according to the self-attention mechanism to determine the update feature of the historical conversation.
3. The method according to claim 1, wherein Step (d) includes: determining a relevance score corresponding to each vector in the historical conversation key matrix according to the query vector matrix of the current round of conversation and the historical conversation key matrix; determining a preset number of historical conversation key vectors with the highest relevance scores from the historical conversation key matrix according to the relevance scores to generate the filtered historical conversation key matrix; and determining corresponding preset number of historical conversation value vectors according to the preset number of historical conversation key vectors to generate the filtered historical conversation value matrix.
4. The method according to any one of claims 1 to 3, characterized in that Step (e) includes: determining an updated conversation information feature according to the query vector matrix of the current round of conversation, the filtered historical conversation key matrix, and the filtered historical conversation value matrix by adopting a cross-round cross-attention mechanism.
5. The method according to any one of claims 1 to 3, characterized in that, After step (e), the method further includes: (g) determining the information feature of the current round of conversation in response to receiving the input information; and (h) determining the updated conversation information feature as the information feature of the current historical conversation, and returning to step (a).
6. The method according to claim 2, characterized in that, The processing the information feature of the current round of conversation according to the self-attention mechanism to determine the update feature of the current round of conversation includes: determining the update feature of the current round of conversation according to the query matrix, key matrix, and value matrix of the information feature of the current round of conversation.
7. The method according to claim 2, characterized in that, The processing the information feature of the current historical conversation according to the self-attention mechanism to determine the update feature of the historical conversation includes: determining the update feature of the historical conversation according to the query matrix, key matrix, and value matrix of the information feature of the current historical conversation.
8. A multi-round dialogue information feature update device based on an optimal matching mechanism, characterized in that Including: a first determination module for determining an update feature of the current round of conversation and an update feature of the historical conversation respectively according to the information feature of the current round of conversation and the information feature of the current historical conversation; a second determination module for determining a corresponding query vector matrix of the current round of conversation according to the update feature of the current round of conversation; A third determination module, configured to determine a corresponding historical dialogue key matrix and a historical dialogue value matrix according to the updated features of the historical dialogue; A first acquisition module, configured to query a vector matrix and the historical dialogue key matrix according to the current round of dialogue, and adopt an optimal matching mechanism to obtain a filtered historical dialogue key matrix and a filtered historical dialogue value matrix whose information features of the current round of dialogue are relevant and meet a preset condition from the historical dialogue key matrix and the historical dialogue value matrix; And A second acquisition module, configured to obtain updated dialogue information features according to the current round of dialogue query vector matrix, the filtered historical dialogue key matrix, and the filtered historical dialogue value matrix.
9. An electronic device, characterized in that, Comprising a memory and a processor, wherein a computer program is stored on the memory, and the processor implements the method according to any one of claims 1 to 7 when executing the computer program on the memory.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, and the computer program implements the method according to any one of claims 1 to 7 when executed by a processor.
Citation Information
Patent Citations
Emotion-guided dialogue content generation method based on crowd intelligence strategy
CN117668208A
Intelligent question and answer method and device and electronic equipment
CN117828017A
Multi-round natural language understanding algorithm based on historical dialogues and external knowledge
CN119025634A
Context-based big language model dialogue processing method and apparatus, and electronic device
CN119831045A
Differential attention for neural networks
US20240362420A1
Cited By
Task processing method and data generation method
CN120710944A