Interaction method and device based on large model, storage medium and program product

By determining redundancy and correcting probability scores based on the similarity of candidate word sequences during the decoding process, the problem of lack of diversity in response information of large models is solved, thereby improving the diversity of human-computer interaction and the coherence of dialogue.

CN121658635APending Publication Date: 2026-03-13IFLYTEK CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-02-04
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

In existing human-computer interaction systems, the response information generated by large models lacks diversity, resulting in repetitive and stereotypical user experiences.

Method used

By determining redundancy based on the similarity of candidate word sequences during the decoding process, and correcting the probability scores of candidate word sequences based on redundancy, the word sequence with the highest target score is selected as the response information, and multi-round interactions are optimized by combining an external memory network.

Benefits of technology

It improves the diversity of generated response information from large models and the naturalness of user interaction, enhancing the contextual understanding and coherence of dialogue.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121658635A_ABST
    Figure CN121658635A_ABST
Patent Text Reader

Abstract

The invention discloses an interaction method and device based on a large model, a storage medium and a program product, and relates to the technical field of artificial intelligence, and the method comprises the steps: in a process of calling the large model to carry out decoding based on user input information, determining a target word sequence of each decoding moment not directly based on a probability score of a candidate word sequence, instead, the redundancy of each candidate word sequence is determined according to the similarity between the candidate word sequences, and the probability score of the candidate word sequence is corrected based on the redundancy of each candidate word sequence to obtain the target score of each candidate word sequence; and the k candidate word sequences with the highest target scores are determined as the target word sequences at the current decoding moment, so that the diversity of reply information generated by the large model is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to an interaction method, device, storage medium, and program product based on a large model. Background Technology

[0002] Current human-computer interaction systems generate responses by decoding large models when responding to user input. However, the generated responses lack diversity, giving users a repetitive and monotonous experience. Summary of the Invention

[0003] In view of the above problems, this application provides an interaction method, device, storage medium, and program product based on a large model to improve the diversity of response information generated by the large model. The specific solution is as follows:

[0004] The first aspect of this application provides an interaction method based on a large model, comprising:

[0005] Obtain user input information;

[0006] The large model is invoked to decode the user input information and generate a response; the decoding process includes:

[0007] At each decoding time, based on the target score of each incomplete target word sequence obtained in the previous decoding time and the probability score of each candidate word corresponding to each incomplete target word sequence at the current decoding time, the probability score of each candidate word sequence at the current decoding time is obtained; each candidate word sequence consists of an incomplete target word sequence and a candidate word.

[0008] The redundancy of each candidate word sequence is determined based on its similarity to other candidate word sequences.

[0009] The probability scores of each candidate word sequence are corrected based on the redundancy of each candidate word sequence to obtain the target score; the k candidate word sequences with the highest target scores are determined as the target word sequences at the current decoding time; the target score of each candidate word sequence is negatively correlated with the redundancy of that candidate word sequence;

[0010] When the decoding termination condition is met, the completed target word sequence with the highest target score among all the completed target word sequences obtained is used as the response information.

[0011] In one possible implementation, the redundancy of each candidate word sequence is determined based on its similarity to other candidate word sequences, including:

[0012] For any candidate word sequence, at least one of the first redundancy and the second redundancy is determined based on the similarity between the candidate word sequence and each other candidate word sequence.

[0013] The first redundancy is: the number of other candidate word sequences s whose similarity to any candidate word sequence is greater than or equal to a first preset threshold;

[0014] The second redundancy is: the comprehensive similarity between any candidate word sequence and other extended word sequences obtained by fusing the similarity of any candidate word sequence with the similarity of each other candidate word sequence.

[0015] In one possible implementation, the probability score of any candidate word sequence is corrected based on the redundancy of any candidate word sequence, including:

[0016] If the redundancy of any candidate word sequence is the first redundancy, and if s is greater than zero, the probability score of any candidate word sequence is negatively adjusted s times; if s is equal to zero, the probability score of any candidate word sequence is positively adjusted once.

[0017] When the redundancy of any candidate word sequence is the second redundancy, a penalty coefficient is determined based on the comprehensive similarity corresponding to any candidate word sequence, and the penalty coefficient is negatively correlated with the comprehensive similarity; the probability score of any candidate word sequence is multiplied by the corresponding penalty coefficient.

[0018] If the redundancy of any candidate word sequence includes the first redundancy and the second redundancy, the probability score of any candidate word sequence is first corrected based on one of the first redundancy and the second redundancy; the score of any candidate word sequence after the first correction is then corrected based on the other of the first redundancy and the second redundancy.

[0019] In one possible implementation, the interaction method is a multi-turn interaction method, in which, upon obtaining user input information in each turn, a large model is invoked to decode the user input information, including:

[0020] Search for target historical interaction information related to the user input information in the current round in an external memory network; the external memory network is used to record historical interaction information of at least some rounds, and the historical interaction information of any round includes: the rewritten user historical input information of the any round, key entities extracted from the rewritten user historical input information, and a summary of response information; the response information includes user intent and the response information output by the large model;

[0021] Based on the target historical interaction information, the user input information of the current round is subjected to intent recognition and rewriting to obtain the user intent of the current round and the rewritten user input information;

[0022] The target historical interaction information, the user intent of the current round, and the rewritten user input information are input into the large model to obtain the response information of the current round generated by the large model.

[0023] In one possible implementation, the target historical interaction information related to the user input information in the current round is searched in the external memory network, including:

[0024] The large model searches the external memory network for historical interaction information of the target round that is related to the user input information of the current round.

[0025] One possible implementation also includes:

[0026] Determine the user response information for the current round based on the rewritten user input information and user intent for the current round; and / or evaluate the correlation between the historical interaction information of each round in the external memory network and the interaction of the current round to obtain the evaluation results of the historical interaction information of each round.

[0027] The weights of the historical interaction information in each round in the external memory network are adjusted based on the evaluation results of the user response information and / or the historical interaction information in each round; the weight of the historical interaction information in each round represents the importance of the historical interaction information.

[0028] Delete historical interaction information in the external memory network whose weight is lower than the second preset threshold.

[0029] One possible implementation also includes:

[0030] The rewritten user input information of the current round, the key entities extracted from the rewritten user input information of the current round, and the summary of the response information of the current round are added to the external memory network.

[0031] A second aspect of this application provides a computer program product including computer-readable instructions that, when executed on an electronic device, cause the electronic device to implement the large-model-based interaction method of the first aspect or any implementation thereof.

[0032] A third aspect of this application provides an electronic device, comprising at least one processor and a memory connected to the processor, wherein:

[0033] The memory is used to store computer programs;

[0034] The processor is used to execute the computer program to enable the electronic device to implement the large-model-based interaction method of the first aspect or any implementation thereof.

[0035] A fourth aspect of this application provides a computer storage medium carrying one or more computer programs that, when executed by an electronic device, enable the electronic device to implement the large-model-based interaction method described in the first aspect or any implementation thereof.

[0036] Using the above technical solution, the interaction method, device, storage medium, and program product based on a large model provided in this application, during the process of calling the large model to decode based on user input information, at each decoding moment, obtains the probability score of each candidate word sequence at the current decoding moment based on the target score of each incomplete target word sequence obtained in the previous decoding moment and the probability score of each candidate word corresponding to each incomplete target word sequence at the current decoding moment; determines the redundancy of each candidate word sequence based on the similarity of each candidate word sequence with other candidate word sequences; corrects the probability score of each candidate word sequence based on the redundancy of each candidate word sequence to obtain the target score; determines the k candidate word sequences with the highest target scores as the target word sequences at the current decoding moment; the target score of each candidate word sequence is negatively correlated with the redundancy of the candidate word sequence; when the decoding termination condition is met, the completed target word sequence with the highest target score among all obtained completed target word sequences is used as the response information. In the decoding process, this application does not directly determine the target word sequence at each decoding time based on the probability score of the candidate word sequence. Instead, it first determines the redundancy of each candidate word sequence based on the similarity between the candidate word sequences, and then corrects the probability score of each candidate word sequence based on the redundancy of each candidate word sequence to obtain the target score of each candidate word sequence. The k candidate word sequences with the highest target scores are determined as the target word sequences at the current decoding time, thereby improving the diversity of the response information generated by the large model. Attached Figure Description

[0037] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.

[0038] Figure 1a A flowchart illustrating an implementation of the human-computer interaction method based on a large model provided in this application;

[0039] Figure 1b This is a flowchart illustrating one implementation of the decoding process provided in an embodiment of this application.

[0040] Figure 2 A flowchart illustrating an implementation method for correcting the probability score of any candidate word sequence based on the redundancy of that candidate word sequence, as provided in this application.

[0041] Figure 3 Another implementation flowchart for correcting the probability score of any candidate word sequence based on the redundancy of any candidate word sequence provided in this application;

[0042] Figure 4 A flowchart illustrating an implementation of the large-scale calling model provided in this application, which decodes user input information.

[0043] Figure 5 A schematic diagram of the structure of the electronic device provided in this application. Detailed Implementation

[0044] The embodiments of this application are described below with reference to the accompanying drawings. The terminology used in the implementation section of this application is for explaining specific embodiments only and is not intended to limit the scope of this application.

[0045] The embodiments of this application will now be described with reference to the accompanying drawings. Those skilled in the art will recognize that, with technological advancements and the emergence of new scenarios, the technical solutions provided in the embodiments of this application are equally applicable to similar technical problems.

[0046] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms are interchangeable where appropriate; this is merely a way of distinguishing objects with the same attributes in the embodiments of this application. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, so that a process, method, system, product, or apparatus that comprises a series of elements is not necessarily limited to those elements, but may include other elements not explicitly listed or inherent to those processes, methods, products, or apparatuses.

[0047] To improve the diversity of response information generated by large models in interactive systems based on large models, this application proposes a solution.

[0048] like Figure 1a The diagram shown is a flowchart of an implementation of a human-computer interaction method based on a large model provided in this application, which may include:

[0049] Step S101: Obtain user input information.

[0050] User input information may include, but is not limited to, at least one of the following: natural language content entered by the user, documents, images, etc.

[0051] Step S102: Call the large model to decode the user input information and generate response information.

[0052] Prompt words can be constructed based on user input information. These prompt words are then input into a large model, where the encoding module encodes the prompt words to obtain encoded features. Finally, the decoding module of the large model decodes these encoded features to obtain the response information.

[0053] The decoding process can employ an improved beam search algorithm. Assuming the beam width of the beam search algorithm is k (k is an integer greater than 1), at each decoding moment, k most likely candidate word sequences are determined as k target word sequences according to the improved beam search algorithm of this application (these k target word sequences may all be incomplete target word sequences, or they may all be completed target word sequences, or they may contain some incomplete target word sequences and some completed target word sequences), until the decoding termination condition is met. Then, the optimal completed target word sequence is selected as the response information from all the obtained completed target word sequences.

[0054] A completed target word sequence is a target word sequence that has reached the preset length, or a target word sequence whose last word is a terminator. An incomplete target word sequence is a target word sequence whose length has not reached the preset length and whose last word is not a terminator.

[0055] In other words, if the last word of a target word sequence is an end marker, then the target word sequence is a completed target word sequence; if the last word of a target word sequence is not an end marker, but the length of the target word sequence reaches the preset length, it can also be determined that the target word sequence is a completed target word sequence.

[0056] If the last word of a target word sequence is not an end marker, and the length of the target word sequence has not reached the preset length, the target word sequence is determined to be an incomplete target word sequence.

[0057] A flowchart of one implementation of the decoding process described in step S102 is as follows: Figure 1b As shown, it may include:

[0058] Step S1021: At each decoding time, based on the target score of each incomplete target word sequence obtained in the previous decoding time and the probability score of each candidate word at the current decoding time corresponding to each incomplete target word sequence, obtain the probability score of each candidate word sequence at the current decoding time. Each candidate word sequence consists of an incomplete target word sequence and a candidate word.

[0059] At each decoding time, for the j-th (j=1, 2, 3, ..., J) incomplete target word sequence determined in the previous decoding time (J ≤ J ≤ k), the large model predicts the probabilities of each possible word at the current decoding time corresponding to the j-th incomplete target word sequence. The probability of the q-th (q=1, 2, 3, ..., Q; Q is the number of words in the modeling vocabulary of the large model; the modeling vocabulary contains all possible words) possible word represents the probability that the decoded token at the current decoding time belongs to the q-th possible word. In other words, the large model predicts the probability that the next word in the j-th incomplete target word sequence belongs to each possible word based on the j-th incomplete target word sequence.

[0060] For the j-th incomplete target word sequence, select the first p possible words (p is an integer greater than 1, and p can be equal to k or not equal to k) as p candidate words in descending order of probability.

[0061] Take the logarithm of the probability of the i-th (i=1,2,3,...,p) candidate word to obtain the probability score of the i-th candidate word.

[0062] Since there are J incomplete target word sequences, and for each incomplete target word sequence, the probability of the next word belonging to each possible word is predicted and p candidate words are selected, therefore, for each incomplete target word sequence, p candidate word sequences are obtained; for J incomplete target word sequences, a total of J×p candidate word sequences are obtained.

[0063] Unlike existing technologies that sum the probability scores of each word in the m-th candidate word sequence to obtain the probability score of the m-th candidate word sequence, this application can sum the target score of the target word sequence contained in the m-th candidate word sequence and the probability scores of the candidate words contained in the m-th candidate word sequence to obtain the probability score of the m-th candidate word sequence.

[0064] Step S1022: Determine the redundancy of each candidate word sequence based on the similarity between each candidate word sequence and other candidate word sequences.

[0065] For each candidate word sequence, calculate the similarity between that candidate word sequence and each of the other J×p-1 candidate word sequences. The similarity between candidate word sequences can be semantic similarity.

[0066] Each candidate word sequence can be encoded to obtain the feature vector of each candidate word sequence. For the m-th candidate word sequence and the n-th (n≠m) candidate word sequence, the cosine similarity between the feature vector of the m-th candidate word sequence and the feature vector of the n-th candidate word sequence can be calculated as the semantic similarity between the m-th candidate word sequence and the n-th candidate word sequence.

[0067] The redundancy of the m-th candidate word sequence characterizes the magnitude of its contribution to diversity. A higher redundancy indicates a smaller contribution to diversity, while a lower redundancy indicates a greater contribution.

[0068] Step S1023: Correct the probability score of each candidate word sequence based on the redundancy of each candidate word sequence to obtain the target score; determine the k candidate word sequences with the highest target scores as the target word sequences at the current decoding time.

[0069] The target score for each candidate word sequence is negatively correlated with the redundancy of that candidate word sequence. In other words, the lower the redundancy of the m-th candidate word sequence, the higher the target score obtained after correcting the probability score of the m-th candidate word sequence.

[0070] Step S1024: When the decoding end condition is met, the completed target word sequence with the highest target score among all the completed target word sequences obtained is used as the response information.

[0071] Optionally, after determining the k target word sequences at the current decoding time, if each of the k target word sequences is a completed target word sequence, the decoding termination condition is satisfied.

[0072] If there is an incomplete target word sequence among the k target word sequences, it is determined that the decoding termination condition has not been met, and the process proceeds to the next decoding moment to perform decoding at the next decoding moment.

[0073] All completed target word sequences include those obtained at the current decoding time and those obtained at historical decoding times.

[0074] The interaction method based on a large model provided in this application does not directly determine the target word sequence at each decoding moment based on the probability score of the candidate word sequence during the decoding process. Instead, it first determines the redundancy of each candidate word sequence based on the similarity between the candidate word sequences, and then corrects the probability score of each candidate word sequence based on the redundancy of each candidate word sequence to obtain the target score of each candidate word sequence. The k candidate word sequences with the highest target scores are then determined as the target word sequences at the current decoding moment, thereby improving the diversity of the response information generated by the large model.

[0075] In an optional embodiment, one way to implement the determination of the redundancy of each candidate word sequence based on the similarity between each candidate word sequence and other candidate word sequences is as follows:

[0076] For any candidate word sequence, at least one of the first redundancy and the second redundancy is determined based on the similarity between the candidate word sequence and each other candidate word sequence.

[0077] The first redundancy is: the number of other candidate word sequences s whose similarity to any candidate word sequence is greater than or equal to the first preset threshold.

[0078] For the m-th candidate word sequence, the larger the s value, the higher the redundancy of the m-th candidate word sequence, indicating that the m-th candidate word sequence contributes less to diversity; the smaller the s value, the lower the redundancy of the m-th candidate word sequence, indicating that the m-th candidate word sequence contributes more to diversity.

[0079] The second redundancy is the combined similarity between any candidate word sequence and other candidate word sequences, obtained by fusing the similarity of any candidate word sequence with the similarity of each other candidate word sequence.

[0080] For the m-th candidate word sequence, the similarity between the m-th candidate word sequence and each of the other J×p-1 candidate word sequences can be summed to obtain the comprehensive similarity between the m-th candidate word sequence and the other J×p-1 candidate word sequences.

[0081] Alternatively, the average similarity between the m-th candidate word sequence and each of the other J×p-1 candidate word sequences can be calculated to obtain the comprehensive similarity between the m-th candidate word sequence and the other J×p-1 candidate word sequences.

[0082] For the m-th candidate word sequence, the greater the overall similarity, the higher the redundancy of the m-th candidate word sequence, indicating that the m-th candidate word sequence contributes less to diversity; conversely, the smaller the overall similarity, the lower the redundancy of the m-th candidate word sequence, indicating that the m-th candidate word sequence contributes more to diversity.

[0083] In an optional embodiment, when the redundancy of any candidate word sequence is a first redundancy, one way to correct the probability score of any candidate word sequence based on its redundancy is as follows:

[0084] If s is greater than zero, the probability score of any candidate word sequence is negatively adjusted s times to obtain the target score of that candidate word sequence. That is, for the m-th candidate word sequence, if the similarity between the m-th candidate word sequence and other candidate word sequences is greater than or equal to a first preset threshold, the probability score of the m-th candidate word sequence is negatively adjusted a certain number of times. Each negative adjustment reduces the probability score of the m-th candidate word sequence by a first preset step size.

[0085] If s equals zero, the score of any candidate word sequence is positively adjusted once to obtain the target score for that candidate word sequence. That is, for the m-th candidate word sequence, it is positively adjusted only if the similarity between the m-th candidate word sequence and all other candidate word sequences is greater than a first preset threshold. Positive adjustment means increasing the probability score of the m-th candidate word sequence by a second preset step size. The second preset step size and the first preset step size can be equal or unequal.

[0086] In an optional embodiment, when the redundancy of any candidate word sequence is a second redundancy, a flowchart is shown below to illustrate how to correct the probability score of any candidate word sequence based on its redundancy. Figure 2 As shown, it may include:

[0087] Step S201: Determine the penalty coefficient based on the comprehensive similarity corresponding to any candidate word sequence.

[0088] The penalty coefficient is negatively correlated with the overall similarity. That is, for the m-th candidate word sequence, the greater the overall similarity between the m-th candidate word sequence and other candidate word sequences, the smaller its corresponding penalty coefficient, thus imposing a larger penalty on the probability score of the m-th candidate word sequence to make its score as low as possible.

[0089] Step S202: Multiply the probability score of any candidate word sequence by the corresponding penalty coefficient to obtain the target score of any candidate word sequence.

[0090] In an optional embodiment, when the redundancy of any candidate word sequence includes a first redundancy and a second redundancy, another implementation flowchart for correcting the probability score of any candidate word sequence based on the redundancy of that candidate word sequence is shown below. Figure 3 As shown, it may include:

[0091] Step S301: Based on one of the redundancy levels, the probability score of any candidate word sequence is corrected for the first time to obtain the score after the first correction.

[0092] For the process of correcting the probability score of the m-th candidate word sequence based on the first redundancy and the process of correcting the probability score of the m-th candidate word sequence based on the second redundancy, please refer to the aforementioned embodiments, and will not be repeated here.

[0093] Step S302: Perform a second correction on the score of any candidate word sequence after the first correction, based on the other redundancy in the first and second redundancy.

[0094] For the m-th candidate word sequence, if step S301 corrects the probability score of the m-th candidate word sequence based on the first redundancy, then step S302 corrects the score of the m-th candidate word sequence after the first correction based on the second redundancy. The second modification process can refer to the aforementioned process of correcting the probability score of the m-th candidate word sequence based on the second redundancy, which will not be repeated here.

[0095] If step S301 corrects the probability score of the m-th candidate word sequence based on the second redundancy, then step S302 corrects the score of the m-th candidate word sequence after the first correction based on the first redundancy. The second modification process can refer to the aforementioned process of correcting the probability score of the m-th candidate word sequence based on the first redundancy, which will not be repeated here.

[0096] In an optional embodiment, the interaction method based on a large model in this application is a multi-turn interaction method based on a large model. When user input information is obtained in each turn, the large model is invoked to decode the user input information. A flowchart of one such implementation is shown below. Figure 4 As shown, it may include:

[0097] Step S401: Search the external memory network for target historical interaction information related to the user input information in the current round.

[0098] The external memory network is used to record historical interaction information for at least some rounds. The historical interaction information for any round includes: the rewritten user history input information for that round, key entities extracted from the rewritten user history input information, and a summary of the response information; the response information includes user intent and the response information output by the large model.

[0099] In other words, when storing historical interaction information, this application no longer stores all historical interaction information for each round in the external memory network, but instead stores the rewritten user historical input information, key entities extracted from the rewritten user historical input information, and a summary of response information.

[0100] Step S402: Based on the target historical interaction information, perform intent recognition and rewriting on the user input information of the current round to obtain the user intent of the current round and the rewritten user input information.

[0101] Optionally, intent recognition can be performed on the user input information of the current round based on the target historical interaction information to obtain the user intent of the current round; the user input information can be rewritten based on the user intent of the current round to obtain the rewritten user input information of the current round.

[0102] Rewriting user input information includes semantic completion, which makes the semantics of the rewritten user input information clearly represent the user's intent. In other words, by rewriting the user input information in the current round, the semantics of the user input information are completed, so that the large model can understand the user's intent more accurately, making the interaction more accurate and natural.

[0103] Step S403: Input the target historical interaction information, the user intent of the current round, and the rewritten user input information into the large model to obtain the response information of the current round generated by the large model decoding.

[0104] Optionally, prompt words (referred to as reply prompt words for ease of description and distinction) can be constructed based at least on the target's historical interaction information, the user's intent in the current round, and the rewritten user input information. The reply prompt words are then input into the large model, where the encoding module encodes the reply prompt words to obtain encoded features, and the decoding module decodes the encoded features to obtain the reply information.

[0105] The response prompt word template can be filled with at least the target's historical interaction information, the user's intent in the current round, and the rewritten user input information to obtain the response prompt word.

[0106] Optionally, when constructing response prompts, target profile information associated with the rewritten user input information can be searched from pre-stored user profile information, and / or target knowledge associated with the rewritten user input information can be searched from a knowledge base. Response prompts are constructed based on at least one of the target profile information and target knowledge, target historical interaction information, the user intent of the current round, and the rewritten user input information. Based on this, at least one of the target profile information and target knowledge, target historical interaction information, the user intent of the current round, and the rewritten user input information can be added to the response prompt template to obtain the response prompts.

[0107] When recording historical interaction information, this application no longer stores all historical interaction information for that round, but instead stores rewritten user historical input information, key entities extracted from the rewritten user historical input information, and a summary of response information. This reduces the amount of historical interaction information, allowing for the storage of more historical interaction information, expanding the search scope of historical dialogues, enabling more comprehensive contextual understanding, and improving the contextual integrity, intent understanding accuracy, and dialogue coherence of multi-turn dialogues.

[0108] In an alternative embodiment, the above-described large model can be used to search for historical interaction information of the target round in the external memory network that is related to the user input information of the current round.

[0109] Optionally, the historical interaction information of each round recorded in the external memory network and the user input information of the current round can be added to the search suggestion term template to obtain search suggestion terms. The search suggestion terms are then input into the large model to obtain the historical interaction information of the target round related to the user input information of the current round.

[0110] In an optional embodiment, to optimize the response performance of multi-turn dialogues, a feedback mechanism can be used to update the weights of historical interaction information recorded in the external memory network for each turn. This allows important historical interaction information to be highlighted and preserved, while less important historical interaction information is gradually faded out, thereby optimizing the quality of the memory information. Based on this, the interaction method of this application may further include:

[0111] Determine the user response information for the current round based on the rewritten user input information and user intent; and / or evaluate the correlation between the historical interaction information of each round in the external memory network and the interaction of the current round to obtain the evaluation results of the historical interaction information of each round.

[0112] User response information may include, but is not limited to, at least one of the following: satisfaction rating, degree of negative sentiment change, and degree of intention change. User response information can be obtained by analyzing the rewritten user input information and user intentions of the current round, as well as historical interaction information from the previous round, using a user response analysis model. The user response analysis model can be the aforementioned general model, or it can be a different model specifically designed for analyzing user responses.

[0113] If a user's emotions undergo a positive change, the greater the degree of positive change, the smaller the degree of negative change.

[0114] The evaluation result of historical interaction information in any round may include, but is not limited to, at least one of the following three: the semantic similarity between the historical interaction information of that round and the rewritten user input information of the current round, the frequency of use of the historical interaction information of that round, and the number of times the historical interaction information of that round successfully assisted in generating a response in recent multi-round dialogues. Successfully assisting in response generation means that the large model used the historical interaction information of that round when responding to user input information and output effective response information (e.g., content that accurately understands the user's intent and provides valuable feedback). Unsuccessfully assisting in response generation means that the large model used the historical interaction information of that round when responding to user input information but output invalid response information (e.g., content that does not solve the user's problem or does not advance the dialogue). Whether the response information output by the large model in each round is effective can be determined by the large model in conjunction with the improved user input information and user intent of the next round.

[0115] The weights of historical interaction information in each round in the external memory network are adjusted based on the evaluation results of user response information and / or historical interaction information in each round; the weight of historical interaction information in each round represents the importance of that historical interaction information.

[0116] Optionally, one implementation method for adjusting the weights of historical interaction information in each round of the external memory network based on user response information can be:

[0117] Using predefined weighting rules, the weights of historical interaction information from each round in the external memory network are adjusted based on user response information. The weights of historical interaction information from each round are then adjusted based on these adjusted weights. The weight adjustments are positively correlated with satisfaction scores, negatively correlated with the degree of negative change in emotion, and negatively correlated with the degree of change in intention. Weight adjustments can be positive (indicating a positive adjustment) or negative (indicating a negative adjustment). The adjusted weights of historical interaction information from each round are obtained by adding the weight of that round's historical interaction information to its adjusted weight.

[0118] Optionally, one way to adjust the weights of historical interaction information in each round of the external memory network based on the evaluation results of historical interaction information in each round is as follows:

[0119] Based on semantic similarity, the frequency of use of historical interaction information in each round, and the number of times historical interaction information in each round has successfully assisted in generating responses in recent multi-round dialogues, the adaptive decay coefficient of historical interaction information in each round in the external memory network is determined; the weight of historical interaction information in each round is adjusted based on the adaptive decay coefficient of historical interaction information in each round.

[0120] The adaptive decay coefficient of historical interaction information in any round is positively correlated with the semantic similarity between the historical interaction information of that round and the rewritten user input information of the current round (i.e., the higher the semantic similarity, the larger the adaptive decay coefficient, and the smaller the decay of the historical interaction information of that round), positively correlated with the usage frequency of the historical interaction information of that round (i.e., the higher the usage frequency, the larger the adaptive decay coefficient, and the smaller the decay of the historical interaction information of that round), and positively correlated with the number of times the historical interaction information of that round successfully assisted in generating a response in recent multi-round dialogues (i.e., the more times it successfully assisted in generating a response, the larger the adaptive decay coefficient, and the smaller the decay of the historical interaction information of that round). The adjusted weight of the historical interaction information of that round is obtained by multiplying the weight of the historical interaction information of that round (this weight can be adjusted based on user response information or not) by the corresponding adaptive decay coefficient.

[0121] Historical interaction information with a weight lower than the second preset threshold in the external memory network is deleted. Historical interaction information with a weight greater than or equal to the second pre-screening threshold in the external memory network is retained.

[0122] By dynamically adjusting the weights of various historical interaction information in the external memory network, the dynamic response capability of the multi-turn dialogue system is improved.

[0123] Furthermore, after the current round of interaction ends, a summary of the rewritten user input information from the current round, key entities extracted from the rewritten user input information from the current round, and the response information from the current round (including the user intent and the response information of the larger model) can be added to the external memory network. The weights of the interaction information from the current round can be initialized to a maximum value of 1.

[0124] Corresponding to the method embodiments, this application also provides an electronic device. (See reference...) Figure 5 The diagram illustrates a structural schematic of an electronic device suitable for implementing embodiments of this application. The electronic device in these embodiments can be a terminal device (e.g., an in-vehicle infotainment system, a large-screen device, a mobile phone, a tablet computer, a laptop computer, a desktop computer, etc.) or a server (which can be a single server, a server cluster, or a cloud server, etc.). Figure 5The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.

[0125] like Figure 5 As shown, the electronic device may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. When the electronic device is powered on, the RAM 503 also stores various programs and data required for the operation of the electronic device. The processing unit 501, ROM 502, and RAM 503 are interconnected via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0126] Typically, the following devices can be connected to I / O interface 505: input devices 506 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 507 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 508 including, for example, memory cards, hard drives, etc.; and communication devices 509. Communication device 509 allows electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 5 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have alternatively.

[0127] This application also provides a computer program product including computer-readable instructions, which, when executed on an electronic device, cause the electronic device to implement any of the large-model-based interaction methods provided in this application.

[0128] This application also provides a computer-readable storage medium that carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any of the large-model-based interaction methods provided in this application.

[0129] It should be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. In addition, in the device embodiment drawings provided in this application, the connection relationship between modules indicates that they have a communication connection, which can be implemented as one or more communication buses or signal lines.

[0130] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware, or it can be implemented by special-purpose hardware including application-specific integrated circuits, special-purpose CPUs, special-purpose memory, special-purpose components, etc. Generally, any function performed by a computer program can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be diverse, such as analog circuits, digital circuits, or special-purpose circuits. However, for this application, software program implementation is more often a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a computer floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk, or optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, training equipment, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0131] In the above embodiments, the functionality can be implemented entirely or partially through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented entirely or partially as a computer program product. Those skilled in the art can use different methods to implement the described functions for each specific solution, but such implementation should not be considered beyond the scope of this application.

[0132] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, training device, or data center to another website, computer, training device, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).

[0133] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0134] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. An interaction method based on a large model, characterized in that, include: Obtain user input information; The large model is invoked to decode the user input information and generate a response; the decoding process includes: At each decoding time, based on the target score of each incomplete target word sequence obtained in the previous decoding time and the probability score of each candidate word corresponding to each incomplete target word sequence at the current decoding time, the probability score of each candidate word sequence at the current decoding time is obtained; each candidate word sequence consists of an incomplete target word sequence and a candidate word. The redundancy of each candidate word sequence is determined based on its similarity to other candidate word sequences. The probability scores of each candidate word sequence are corrected based on the redundancy of each candidate word sequence to obtain the target score; the k candidate word sequences with the highest target scores are determined as the target word sequences at the current decoding time; the target score of each candidate word sequence is negatively correlated with the redundancy of that candidate word sequence; When the decoding termination condition is met, the completed target word sequence with the highest target score among all the completed target word sequences obtained is used as the response information.

2. The method according to claim 1, characterized in that, Based on the similarity between each candidate word sequence and other candidate word sequences, the redundancy of each candidate word sequence is determined, including: For any candidate word sequence, at least one of the first redundancy and the second redundancy is determined based on the similarity between the candidate word sequence and each other candidate word sequence; The first redundancy is: the number of other candidate word sequences s whose similarity to any candidate word sequence is greater than or equal to a first preset threshold; The second redundancy is: the comprehensive similarity between any candidate word sequence and other extended word sequences obtained by fusing the similarity of any candidate word sequence with the similarity of each other candidate word sequence.

3. The method according to claim 2, characterized in that, The probability score of any candidate word sequence is corrected based on the redundancy of any candidate word sequence, including: If the redundancy of any candidate word sequence is the first redundancy, and if s is greater than zero, the probability score of any candidate word sequence is negatively adjusted s times; if s is equal to zero, the probability score of any candidate word sequence is positively adjusted once. When the redundancy of any candidate word sequence is the second redundancy, a penalty coefficient is determined based on the comprehensive similarity corresponding to any candidate word sequence, and the penalty coefficient is negatively correlated with the comprehensive similarity; the probability score of any candidate word sequence is multiplied by the corresponding penalty coefficient. If the redundancy of any candidate word sequence includes the first redundancy and the second redundancy, the probability score of any candidate word sequence is first corrected based on one of the first redundancy and the second redundancy; the score of any candidate word sequence after the first correction is then corrected based on the other of the first redundancy and the second redundancy.

4. The method according to claim 1, characterized in that, The interaction method is a multi-round interaction method. Upon obtaining user input information in each round, a large model is invoked to decode the user input information, including: Search for target historical interaction information related to the user input information in the current round in an external memory network; the external memory network is used to record historical interaction information of at least some rounds, and the historical interaction information of any round includes: the rewritten user historical input information of the any round, key entities extracted from the rewritten user historical input information, and a summary of response information; the response information includes user intent and the response information output by the large model; Based on the target historical interaction information, the user input information of the current round is subjected to intent recognition and rewriting to obtain the user intent of the current round and the rewritten user input information; The target historical interaction information, the user intent of the current round, and the rewritten user input information are input into the large model to obtain the response information of the current round generated by the large model.

5. The method according to claim 4, characterized in that, Search the external memory network for target historical interaction information related to the user input information in the current round, including: The large model searches the external memory network for historical interaction information of the target round that is related to the user input information of the current round.

6. The method according to claim 4, characterized in that, Also includes: Determine the user response information for the current round based on the rewritten user input information and user intent for the current round; and / or evaluate the correlation between the historical interaction information of each round in the external memory network and the interaction of the current round to obtain the evaluation results of the historical interaction information of each round. The weights of the historical interaction information in each round in the external memory network are adjusted based on the evaluation results of the user response information and / or the historical interaction information in each round; the weight of the historical interaction information in each round represents the importance of the historical interaction information. Delete historical interaction information in the external memory network whose weight is lower than the second preset threshold.

7. The method according to claim 4, characterized in that, Also includes: The rewritten user input information of the current round, the key entities extracted from the rewritten user input information of the current round, and the summary of the response information of the current round are added to the external memory network.

8. An electronic device, characterized in that, The electronic device includes at least one processor and a memory connected to the processor; wherein: The memory is used to store computer programs; The processor is used to execute the computer program to enable the electronic device to implement the large-model-based interaction method as described in any one of claims 1 to 7.

9. A computer program product, characterized in that, It includes computer-readable instructions that, when executed on an electronic device, cause the electronic device to implement the large-model-based interaction method as described in any one of claims 1 to 7.

10. A computer storage medium, characterized in that, The storage medium carries one or more computer programs that, when executed by an electronic device, enable the electronic device to implement the large-model-based interaction method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Title generation method and device, electronic device and storage medium

    CN110717327A

  • Text abstract generation method and device, computer equipment and readable storage medium

    CN111666402A

  • Common service system cross-domain security interaction method and system based on general large model

    CN118761852A

  • Intelligent question and answer method and device, equipment, storage medium and program product

    CN119691106A

  • Data processing method and device, intelligent agent, equipment, medium and product

    CN121168657A