A reply content generation method based on fine-grained user demand satisfaction reasoning

By constructing a global demand prototype tree and a multi-granularity satisfaction attribution model (MSA), the large language model is optimized, solving the problem that large language models (LLMs) cannot meet users' fine-grained needs in personalized response generation, and achieving more accurate personalized response generation.

CN120104729BActive Publication Date: 2025-11-25ZHEJIANG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510063315.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-15
Publication Date
2025-11-25
Estimated Expiration
2045-01-15

AI Technical Summary

Technical Problem

Large-scale language models (LLMs) cannot accurately understand and meet the specific needs of individual users when generating personalized responses. The generated content lacks specificity and is difficult to identify and cover the fine-grained needs of users.

Method used

By acquiring historical dialogue texts between users and human customer service representatives, data preprocessing and representation learning are performed to construct a global demand prototype tree. The Multi-Granularity Satisfaction Attribution (MSA) model is used to infer fine-grained user satisfaction, and the large language model is self-supervised to generate response content that better meets user needs.

Benefits of technology

It enables the large language model to accurately identify and cover users' fine-grained needs, generating more targeted and satisfactory personalized responses, and improving the application effect in personalized service scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120104729B_ABST
    Figure CN120104729B_ABST
Patent Text Reader

Abstract

The application discloses a reply content generation method based on fine-grained user demand satisfaction reasoning. The method comprises the following steps: obtaining historical dialogue text of a user, preprocessing and representation learning, then clustering, unsupervised learning, association and matching to construct a satisfaction tree, predicting the overall satisfaction after bottom-up reasoning of the satisfaction tree, constructing a multi-granularity satisfaction attribution model through supervised learning; obtaining the fine-grained demand of the user who is not satisfied, inputting into the large language model for optimization, and performing self-supervised adaptive optimization on the model according to the overall satisfaction after optimization; inputting the to-be-answered text into the model after processing to generate reply content. The method can identify the fine-grained demand of the user based on the dialogue text, reason the multi-granularity satisfaction of the user to the reply content, and realize the prompt adaptation and self-supervised fine-tuning by combining the reasoning attribution judgment of the multi-granularity satisfaction, thereby realizing the personalized content generation of the large language model to meet the fine-grained user demand.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application relates to a reply content generation method and relates to the technical field of artificial intelligence large language models, in particular to a reply content generation method based on fine-grained user demand satisfaction reasoning. BACKGROUND

[0002] Large language models (LLMs) have gained widespread application in recent years due to their strong capabilities in natural language processing (NLP) tasks. Through training on large-scale public datasets, large language models can generate general content and common-sense knowledge, and exhibit excellent performance in various text generation, machine translation, and dialogue system tasks. The core advantage of these models lies in their ability to effectively capture language patterns and contextual information through deep learning methods, and their ability to transfer across domains. Therefore, large language models have significant advantages in generating generalized text and answering common-sense questions.

[0003] However, large language models still face many challenges when it comes to generating personalized responses. Since their training data mostly comes from public domains, large language models often cannot accurately understand and meet the specific needs of individual users. Studies have shown that large language models may exhibit hallucination when dealing with personalized tasks, i.e., the generated information may appear reasonable but is actually unrelated to the user's query or context. In addition, large language models tend to generate vague and generic content when generating personalized responses, lacking in relevance. This is particularly evident in scenarios that require user-specific needs, such as customer service, product recommendation, and personalized question answering.

[0004] When large language models are used in specific task scenarios, the limitations of the models become further apparent. For example, when large language models are used as task-oriented dialogue agents, the generated responses are often general and fail to accurately respond to the user's specific intent or question. This is particularly evident in personalized task scenarios. For example, when large language models are used to act as hotel managers responding to user online reviews, the generated responses often lack relevance and fail to effectively address the user's personalized concerns. Such responses often lack depth and fail to analyze and respond to specific issues mentioned by users in their reviews. This limitation limits the effectiveness of large language models in personalized service scenarios and fails to fully meet users' expectations for accurate and high-quality responses.

[0005] To address the above challenges, in recent years, many studies have focused on improving the personalized generation capabilities of large language models LLMs. Some methods use specific user historical data to further train large language models LLMs through personalized data fine-tuning, in order to improve the model's understanding of user preferences and response capabilities. However, such methods usually rely on a large amount of user data and require significant computing resources and time to complete model fine-tuning. In addition, although the fine-tuned model performs better in specific user scenarios, it is difficult to generalize due to the limitations of its training data set, and the historical training data is also limited by the drawbacks of template replies, making it difficult to provide good supervision for personalized generation of large language models LLMs, and it is still difficult for large language models LLMs to accurately identify and cover the user's fine-grained needs.

[0006] Although large language models LLMs have great advantages in generating general text, their limitations in personalized response generation are still evident, especially in task-oriented dialogue scenarios. Although existing methods can improve the personalization capabilities of large language models LLMs to some extent, there is still a long way to go to completely solve the problem. Future research and technological development need to further explore how to combine user fine-grained need recognition to provide more effective solutions for personalized reply generation. SUMMARY

[0007] To solve the problems in the background art, the present application provides a reply content generation method based on fine-grained user demand satisfaction reasoning. The method can solve the problem of the limitations of the existing large language models LLMs in personalized generation capabilities, and the difficulty in accurately identifying and covering the user's fine-grained needs.

[0008] The technical solution adopted by the present application is:

[0009] The reply content generation method based on fine-grained user demand satisfaction reasoning of the present application comprises:

[0010] Step 1: Obtain historical dialogue text of a plurality of users and artificial customer service and sequentially perform data preprocessing and representation learning to obtain word embedding representation of each user.

[0011] Step 2: Cluster and unsupervisedly learn each word embedding representation to obtain a prototype representation vector, and then perform hierarchical clustering to construct a global demand prototype tree; by performing prototype learning on the historical dialogue text, unsupervisedly learn the global fine-grained demand prototype representation in the dialogue scenario, and perform hierarchical clustering on demand prototypes of different granularities to construct a global user demand global demand prototype tree.

[0012] Step 3: After the global demand prototype tree and the word embedding representation of each user are associated and matched in turn, a satisfaction tree is constructed, the overall satisfaction is predicted after bottom-up reasoning of the satisfaction tree, and a multi-granularity satisfaction attribution model MSA is constructed through supervised learning according to the predicted overall satisfaction; the fine-grained satisfaction of each user to the received reply is locally reasoned, and the prediction of the overall satisfaction of the user is realized through bottom-up reasoning.

[0013] Step 4: The fine-grained demand of the current user who is not satisfied is obtained through the multi-granularity satisfaction attribution model MSA, and is input into the preset prompt template of the large language model to optimize the reply text of the current user, and the large language model is self-supervised and adapted according to the overall satisfaction of the current user after optimization, and a trained large language model is obtained; the prompt of the large language model is adapted, adjusted and optimized based on the fine-grained satisfaction of the user; the multi-granularity satisfaction attribution model MSA is used as a generated content evaluator, and the evaluation score is included in the optimization function of the large language model to fine-tune the large language model, realizing self-supervised adaptive optimization of the language model generation.

[0014] Step 5: The query text of the user to be replied is processed in the same way as in step 1 and input into the trained large language model, and the reply text of the user's query text is output after processing, completing the generation of reply content.

[0015] The step 1 is specifically as follows:

[0016] Step 1.1: Obtain historical dialogue texts T between a plurality of users and an artificial customer service, Wherein, And y1 represent the query text of the first user, the reply text of the first user's query text by the artificial customer service, and the satisfaction label of the first user to the reply text, And y2 represent the query text of the second user, the reply text of the second user's query text by the artificial customer service, and the satisfaction label of the second user to the reply text, And y n Respectively represent the query text of the nth user, the reply text of the nth user's query text by the artificial customer service, and the satisfaction label of the nth user to the reply text.

[0017] Step 1.2: Data preprocessing is performed on the historical dialogue text between each user and the artificial customer service, that is, after the historical dialogue text is segmented, stop words, mood words and punctuation marks are removed, and finally the key words reflecting the service or product are retained.

[0018] Step 1.3: Use the pre-trained BERT (Bidirectional Encoder Representations from Transformers) model to extract and vectorize features from each keyword for each user, obtaining the word embedding representation for each user. in, and The word embeddings represent the query text of the i-th user and the response text of the human customer service representative to the query text of the i-th user, respectively.

[0019] Step 2 is described in detail below:

[0020] Step 2.1: Use the K-means clustering method to cluster the word embeddings into K clusters, with the cluster set p = [p1, p2, ..., p...]. K ], p1, p2, ..., p K These represent the 1st, 2nd, ..., Kth clusters, respectively, with the center vector of each cluster serving as the K initial prototype representation vectors.

[0021] Step 2.2: Evaluate the reconstruction loss Prototype diversity loss and representative loss Unsupervised learning is performed on the K initial prototype representation vectors, and gradient descent is used to optimize the K initial prototype representation vectors to obtain the optimized K prototype representation vectors that best represent the user's attention-grabbing attributes.

[0022] Step 2.3: Use hierarchical clustering to construct a hierarchical global requirement prototype tree from each prototype representation vector to reflect the multi-attribute and multi-granularity characteristics of user requirements.

[0023] The assessment of reconstruction loss Prototype diversity loss and representative loss Specifically as follows:

[0024]

[0025]

[0026] Where λ1, λ2, and λ3 represent the evaluation reconstruction loss, respectively. Prototype diversity loss and representative loss Learnable weight parameters; This represents an estimate of the word embedding representation of the query text for the i-th user. represents the relevance degree between the word embedding representation of the query text of the i-th user and the k-th initial prototype representation vector; N represents the number of sentences in the query text of each user, and respectively represent the global representation of the word embedding representation of the query text of the i-th user and the j-th sentence therein, represents the center vector of the k-th prototype representation vector; ‖‖2 represents the two-norm; L represents the number of keywords in the query text of each user; dist() represents the distance function; represents the word embedding representation of the j-th keyword of the i-th user.

[0027] The step 3 is specifically as follows:

[0028] Step 3.1: For each tree node in the global demand prototype tree, the tree node is associated with the word embedding representation of each user query text and the word embedding representation of the reply text of each user query text by the artificial customer service through the calculation of the dot product similarity, thereby constructing the inquiry embedding tree and the reply embedding tree of each user, respectively. Each tree node in the inquiry embedding tree represents the attention degree of the user to the demand of the node, and each tree node in the reply embedding tree represents the coverage degree of the reply content to the demand of the node. After matching each tree node in the inquiry embedding tree and the reply embedding tree of each user, a satisfaction tree is constructed. Each tree node in the satisfaction tree represents the initial fine-grained satisfaction degree of the current user on the fine-grained demand of the tree node for a given reply text, i.e., the satisfaction degree of the demand of each node of different granularity.

[0029] Step 3.2: The satisfaction tree is aggregated and inferred in turn to obtain the predicted overall satisfaction degree by using a recursive calculation method from bottom to top.

[0030] Step 3.3: The root mean square error of the predicted overall satisfaction degree of each user is used as a loss for supervised learning, and the final parameter fine-grained satisfaction degree of each layer of the satisfaction tree is optimized and learned through back propagation, thereby constructing a multi-granularity satisfaction degree attribution model MSA.

[0031] In step 3.2, the final fine-grained satisfaction degree of each tree node in each layer structure in the satisfaction tree is obtained by weighting the initial fine-grained satisfaction degree of the tree node itself and the final fine-grained satisfaction degrees of several tree nodes in the previous layer connected to the tree node. The predicted overall satisfaction degree is the final fine-grained satisfaction degree of a root node in the uppermost layer of the satisfaction tree, or the fine-grained satisfaction degree obtained by inputting the final fine-grained satisfaction degrees of each tree node in the M layers adjacent to the root node into a full connection layer for weighted average.

[0032] In step 4, each node in the multi-granularity satisfaction attribution model MSA represents the optimization of the fine-grained satisfaction of the current user on the given reply text on the fine-grained requirement at the current node, the fine-grained requirement with an optimization fine-grained satisfaction lower than the satisfaction threshold δ is input into the preset prompt template of the large language model, and the large language model outputs the reply text of the optimized fine-grained requirement after processing, and the optimization is repeated until the optimization fine-grained satisfaction of each fine-grained requirement of the current user reaches the satisfaction threshold δ or reaches the preset iteration number S, and the reply text at this time is taken as the optimized reply text of the current user.

[0033] The large language model adopts an LLAMA model or a ChatGLM model, and the preset prompt template is, for example, the user is still not satisfied with the first, fourth and fifth, please strengthen the coverage of these specific requirements in the reply.

[0034] In step 4, the query text of the current user and the optimized reply text are repeatedly subjected to steps 1-3 to obtain the overall satisfaction of the current user after optimization, the optimized reply text with an overall satisfaction lower than the satisfaction threshold δ is constructed into an unsatisfied reply set, the optimized reply text with an overall satisfaction reaching the satisfaction threshold δ is constructed into a satisfied reply set, the generation loss and the contrast loss of the large language model are constructed according to the unsatisfied reply set and the satisfied reply set, the generation loss is used to improve the ability of the model to generate satisfied replies, and the contrast loss is used to expand the difference in generation probability between satisfied replies and unsatisfied replies; the large language model is subjected to self-supervised adaptive optimization, and the model parameters of the large language model are optimized through back propagation until the generation loss and the contrast loss converge to obtain a trained large language model.

[0035] The reply text enhanced by the prompt is used as training data to fine-tune the large language model, the generation loss and the contrast loss are introduced into the large model loss function, the model parameters are efficiently optimized through back propagation, the batch-level satisfied reply ability of the model is improved in a self-supervised manner, and the individualized needs of the user are better met.

[0036] The generation loss L of the large language model gen and the contrast loss L con Specifically as follows:

[0037]

[0038] Wherein, represents the number of satisfied replies obtained in the jth iteration; p() represents the generation probability; and respectively represent the generation parameters of the mth reply obtained in the jth iteration and the generation parameters of the reply with the highest satisfaction score; MSA() represents the overall satisfaction obtained by the multi-granularity satisfaction attribution model; Mj represents the number of replies obtained in the jth iteration.

[0039] The method of the present application firstly learns the global fine-grained demand prototype representation in the dialogue scene unsupervisedly through prototype learning, clusters the demand prototypes of different granularities in a hierarchical manner, and constructs a user demand prototype tree structure; secondly, the fine-grained satisfaction of the user to the reply text (i.e. the satisfaction of each tree node demand) is inferred, and the overall satisfaction of the user is predicted from bottom to top; then, the satisfaction prediction model is used as a generated content evaluator, the predicted unsatisfactory fine-grained demand is input into the prompt template, and the large language model is used to generate a reply that pays more attention to the user's fine-grained demand; at the same time, the generated content evaluation score is also included in the optimization function of the large language model, realizing the self-supervised adaptive optimization of the language model generated.

[0040] The beneficial effects of the present application are:

[0041] The method of the present application identifies the fine-grained demand of the user based on the dialogue text, infers the multi-granularity satisfaction of the user to the reply content, combines the inference attribution judgment of the multi-granularity satisfaction, realizes the prompt self-adaptation and self-supervised fine-tuning, thereby realizes the personalized content generation of the large prophecy model LLM to meet the fine-grained user demand. BRIEF DESCRIPTION OF DRAWINGS

[0042] Figure 1 is the flowchart of the method of the present application;

[0043] Figure 2 is the global demand prototype tree structure diagram of the present application;

[0044] Figure 3 is the multi-granularity satisfaction attribution model diagram of the present application. DETAILED DESCRIPTION

[0045] The present application will be further described in detail below in combination with the drawings and specific embodiments.

[0046] As shown in Figure 1 , the reply content generation method based on fine-grained user demand satisfaction inference of the present application is as follows:

[0047] Step 1: Obtain historical dialogue texts of a plurality of users and artificial customer service personnel, and obtain word embedding representations of each user after data preprocessing and representation learning in sequence, specifically as follows:

[0048] Step 1.1: Obtain historical dialogue texts T between a plurality of users and artificial customer service personnel, wherein, and yi respectively represent the query text of the i-th user, the reply text of the i-th user's query text by the artificial customer service, and the satisfaction label of the i-th user to the reply text, and y2 respectively represent the query text of the 2-nd user, the reply text of the 2-nd user's query text by the artificial customer service, and the satisfaction label of the 2-nd user to the reply text, and y n respectively represent the query text of the n-th user, the reply text of the n-th user's query text by the artificial customer service, and the satisfaction label of the n-th user to the reply text, y1, y2, …, y n ∈ [0, 5].

[0049] Step 1.2: Data preprocessing is performed on the historical dialogue text between each user and the artificial customer service, that is, after tokenization, stop words, mood words and punctuation marks are removed, and finally the keywords reflecting the service or product are retained.

[0050] Step 1.3: Using a pre-trained language representation BERT (Bidirectional Encoder Representations from Transformers) model, feature extraction vectorization processing is performed on each keyword of each user to obtain the word embedding representation of each user wherein, and respectively represent the word embedding representation of the query text of the i-th user and the reply text of the query text of the i-th user by the artificial customer service, respectively represent the word embedding representation of the 1st, 2nd, …, Lth keywords in the query text of the i-th user, respectively represent the word embedding representation of the 1st, 2nd, …, Lth keywords in the reply text of the i-th user's query text by the artificial customer service,

[0051] Step 2: After clustering and unsupervised learning of each word embedding representation, prototype representation vectors are obtained, and then hierarchical clustering is performed to construct a global demand prototype tree, as shown in Figure 2 Some parent node representation vectors are obtained by aggregating and averaging all child nodes, as follows:

[0052] Step 2.1: K-means clustering method is used to cluster and divide each word embedding representation into K clusters, and the cluster set p = [p1, p2, …, p K ], p1, p2, …, p K respectively represent the 1st, 2nd, …, Kth cluster, and the center vector of each cluster is taken as the K initial prototype representation vectors.

[0053] Step 2.2: Evaluate reconstruction loss Prototype diversity loss and representative loss Unsupervised learning is performed on K initial prototype representation vectors, and gradient descent is used to optimize the K initial prototype representation vectors to obtain optimized K prototype representation vectors that best represent the demand attributes of the user's attention.

[0054] Step 2.3: Hierarchical clustering method is used to construct each prototype representation vector into a hierarchical global demand prototype tree to reflect the multi-attribute and multi-granularity characteristics of user demand.

[0055] The global demand prototype tree is as follows:

[0056]

[0057] wherein, represents the node representation vector of the Hth row and Bth column in the global demand prototype tree.

[0058] Some parent node representation vectors are obtained by aggregating and averaging all their child nodes.

[0059] By performing prototype learning on historical dialogue text, unsupervised learning of global fine-grained demand prototype representation in dialogue scenarios is performed, and hierarchical clustering of demand prototypes of different granularities is performed to construct a global user demand global demand prototype tree.

[0060] Evaluate reconstruction loss Prototype diversity loss and representative loss Specifically:

[0061]

[0062] wherein, λ1, λ2 and λ3 represent the learnable weight parameters of the evaluation reconstruction loss Prototype diversity loss and representative loss ; represents the estimate of the word embedding representation of the query text of the ith user, represents the correlation between the word embedding representation of the query text of the ith user and the kth initial prototype representation vector; N represents the number of sentences in the query text of each user, and respectively represent the global representation of the word embedding representation of the query text of the ith user and the jth sentence therein, represents the center vector of the kth prototype representation vector; ‖‖2 represents the two-norm; L represents the number of keywords in the query text of each user; dist() represents the distance function; represents the word embedding representation of the jth keyword of the ith user.

[0063] The word embedding representation of each user is calculated by a self-attention mechanism to weight the word vectors in the text, and then the word vectors in the text are weighted and averaged to obtain a global representation of the word embedding representation of each user wherein, represents the word embedding representation of the jth keyword of the ith user. The global representation is nonlinearly transformed to calculate the weight of each initial prototype representation vector Specifically as follows:

[0064]

[0065] wherein, softmax[] represents a nonlinear transformation, σ k () represents a k-dimensional linear transformation.

[0066] The K initial prototype representation vectors are weighted and averaged to reconstruct the estimate of the text feature The reconstruction loss is calculated by calculating the gap between the reconstructed text representation and the global text feature

[0067] The diversity loss is calculated by calculating the distance between each initial prototype representation vector and other initial prototype representation vectors, thereby improving the difference between each initial prototype representation vector and other initial prototype representation vectors, to improve the diversity of the initial prototype representation vectors.

[0068] The representative loss is calculated by calculating the average distance between all word embedding vectors and their nearest initial prototype representation vectors, so that the initial prototype representation vectors have the ability to represent a series of word embedding vectors.

[0069] Step 3: After associating and matching the global demand prototype tree and the word embedding representation of each user in turn, a satisfaction tree is constructed, and after bottom-up reasoning on the satisfaction tree, the predicted overall satisfaction is obtained, and according to the predicted overall satisfaction, supervised learning is performed to construct a multi-granularity satisfaction attribution model MSA, as shown in Figure 3 for user fine-grained satisfaction reasoning and overall satisfaction prediction, specifically as follows:

[0070] Step 3.1: For each tree node in the global demand prototype tree, the tree node is associated with the word embedding representation of each user query text and the word embedding representation of the reply text of each user query text by the human customer service through computing the dot product similarity, m > K, thereby constructing the query embedding tree and the reply embedding tree for each user respectively, each tree node in the query embedding tree representing the attention degree of the user to the node, and each tree node in the reply embedding tree representing the coverage degree of the reply content to the node; constructing a satisfaction tree by matching the tree nodes in the query embedding tree and the reply embedding tree for each user, where σ is a learnable linear function, and represents the Hadamard product, for learning the matching degree between the query and the reply, represents the estimation of the word embedding representation of the reply text of the i-th user by the artificial customer service to the query text of the i-th user; each tree node in the satisfaction tree represents the initial fine-grained satisfaction degree of the current user on the fine-grained requirement of the tree node for a given reply text, i.e., the satisfaction degree of the requirement of each node of different granularities.

[0071] Step 3.2: The satisfaction tree is aggregated in a bottom-up recursive calculation manner to sequentially aggregate the final fine-grained satisfaction degrees of the nodes of each level of the tree, thereby obtaining the predicted overall satisfaction degree. The final fine-grained satisfaction degree of each tree node in each layer of the satisfaction tree is obtained by weighting the initial fine-grained satisfaction degree of the tree node and the final fine-grained satisfaction degrees of several tree nodes of the previous layer connected to the tree node, and the predicted overall satisfaction degree is the final fine-grained satisfaction degree of a root node of the uppermost layer of the satisfaction tree, or the fine-grained satisfaction degree obtained by inputting the final fine-grained satisfaction degrees of the tree nodes in the M layers adjacent to the root node into a full connection layer for weighted average.

[0072] The predicted overall satisfaction degree is as follows:

[0073]

[0074] wherein, and represent the requirement satisfaction degrees of the b-th node of the h-th and h-1-th layers of the satisfaction tree of the i-th user, respectively; represents the requirement satisfaction degree of the q-th node of the h-1-th layer of the satisfaction tree of the i-th user connected to the b-th node of the upper layer, and Q represents the total number of nodes of the lower layer connected to the b-th node, represents the original satisfaction degree of the q-th node of the h-1-th layer of the satisfaction tree of the i-th user; ξ (h-1)q represents the learnable weight parameter of the q-th node of the h-1-th layer of the satisfaction tree of the i-th user connected to the b-th node of the h-th layer; and α represents a learnable factor, which coordinates the relationship between the satisfaction degree of the tree node obtained by matching and the satisfaction degree aggregated by the child nodes of the node.

[0075] Step 3.3: Supervised learning is performed using the root mean square error of the predicted overall satisfaction of each user as the loss, with the loss function y and represent the true label satisfaction and the predicted satisfaction, respectively. λ4 represents a learnable weight parameter of the loss function of the loss function; ξ represents a learnable weight parameter of the lower-level demand node satisfaction when recursively calculating; and the final parameter granularity satisfaction of each layer of the satisfaction tree is learned by backpropagation optimization, thereby constructing a multi-granularity satisfaction attribution model MSA.

[0076] The fine-grained satisfaction of each user to the received reply is locally inferred, and the prediction of the overall satisfaction of the user is achieved by layer-by-layer top-down inference.

[0077] Step 4: Obtain the fine-grained demands that the current user is not satisfied with through the multi-granularity satisfaction attribution model MSA, input them into the preset prompt template of the large language model to optimize the reply text of the current user, and perform self-supervised adaptive optimization on the large language model according to the optimized overall satisfaction of the current user, thereby obtaining a trained large language model; adaptively adjust and optimize the prompt of the large language model based on the fine-grained satisfaction of the user; use the multi-granularity satisfaction attribution model MSA as a generated content evaluator, incorporate the evaluation score into the optimization function of the large language model to fine-tune the large language model, and realize self-supervised adaptive optimization of the language model generation.

[0078] Each node in the multi-granularity satisfaction attribution model MSA represents the optimization of the fine-grained satisfaction of the current user on the given reply text at the current node, and the fine-grained demands with an optimized fine-grained satisfaction lower than the satisfaction threshold δ are input into the preset prompt template of the large language model. The large language model processes and outputs the reply text of the optimized fine-grained demand, and the optimization is repeated until the optimized fine-grained satisfaction of each fine-grained demand of the current user reaches the satisfaction threshold δ or reaches the preset iteration number S. The reply text at this time is taken as the optimized reply text of the current user.

[0079] The large language model adopts the LLAMA model or the ChatGLM model, and the preset prompt template is, for example, the user is still not satisfied with the first, fourth, and fifth, please strengthen the coverage of these specific demands in the reply.

[0080] The query text of the current user and the optimized reply text are repeatedly processed according to steps 1-3 to obtain the overall satisfaction of the optimized current user, the optimized reply text with an overall satisfaction lower than the satisfaction threshold is constructed into an unsatisfied reply set, the optimized reply text with an overall satisfaction reaching the satisfaction threshold is constructed into a satisfied reply set, the generation loss and the contrast loss of the large language model are constructed according to the unsatisfied reply set and the satisfied reply set, the generation loss is used to improve the ability of the model to generate satisfied replies, and the contrast loss is used to expand the difference in generation probability between satisfied replies and unsatisfied replies; the large language model is subjected to self-supervised adaptive optimization, and the model parameters of the large language model are optimized through back propagation until the generation loss and the contrast loss converge, thereby obtaining the trained large language model.

[0081] The reply text enhanced by the prompt is used as training data to fine-tune the large language model, the generation loss and the contrast loss are introduced into the large model loss function, the model parameters are efficiently optimized through back propagation, the batch-level satisfied reply capability of the model is improved in a self-supervised manner, and the individualized needs of users are better met.

[0082] The generation loss L of the large language model gen and the contrast loss L con Specifically as follows:

[0083]

[0084]

[0085] wherein, represents the number of satisfied replies obtained in the jth iteration; p() represents the generation probability; and respectively represent the generation parameters of the mth reply obtained in the jth iteration and the generation parameters of the reply with the highest satisfaction score; MSA() represents the overall satisfaction obtained by the multi-granularity satisfaction attribution model; M j represents the number of replies obtained in the jth iteration.

[0086] Step 5: The query text of the user to be replied to is processed in the same way as in step 1 and input into the trained large language model, and the reply text of the user's query text is output after processing, thereby completing the generation of the reply content.

[0087] In order to provide interaction with the user, the method of the present application can be implemented on a computer having a display device (such as a liquid crystal display monitor, etc.) for showing information to the user, and a keyboard and a pointing device (such as a mouse, etc.) through which the user can provide input to the computer.

[0088] The above detailed description does not limit the scope of the disclosure. Various modifications, combinations, sub-combinations and alternatives can be made to the detailed description. Any modification, equivalent replacement and improvement etc. made within the spirit and principle of the disclosure shall be included in the scope of the disclosure.

Claims

1. A method for generating response content based on fine-grained user demand satisfaction reasoning, characterized in that, include: Step 1: Obtain historical dialogue texts between several users and human customer service representatives, and perform data preprocessing and representation learning in sequence to obtain word embedding representations for each user; Step 2: After clustering and unsupervised learning of each word embedding representation, prototype representation vectors are obtained, and then hierarchical clustering is performed to construct a global requirement prototype tree; Step 3: After sequentially associating and matching the global demand prototype tree and the word embedding representation of each user, a satisfaction tree is constructed. After bottom-up inference on the satisfaction tree, the predicted overall satisfaction is obtained. Based on the predicted overall satisfaction, supervised learning is performed to construct a multi-granularity satisfaction attribution model (MSA). Step 4: Obtain the fine-grained needs of the current user's dissatisfaction through the Multi-Granularity Satisfaction Attribution Model (MSA), and input them into the preset prompt template of the large language model to optimize the current user's response text. Then, perform self-supervised adaptive optimization on the large language model based on the optimized overall satisfaction of the current user to obtain the trained large language model. Step 5: After processing the user's query text in the same way as in Step 1, input it into the trained large language model. After processing, output the response text to the user's query text, thus completing the generation of the response content.

2. The response content generation method based on fine-grained user demand satisfaction reasoning according to claim 1, characterized in that: Step 1 is described in detail below: Step 1.1: Obtain the historical dialogue text T between several users and human customer service representatives. in, y1 and y1 represent the query text of the first user, the response text of the human customer service to the query text of the first user, and the satisfaction tag of the first user for the response text, respectively. y2 and y2 represent the query text of the second user, the response text of the human customer service representative to the second user's query text, and the satisfaction rating of the second user for the response text, respectively. and y n These represent the query text of the nth user, the response text of the human customer service representative to the query text of the nth user, and the satisfaction label of the nth user for the response text, respectively. Step 1.2: Perform data preprocessing on the historical dialogue text between each user and human customer service, that is, segment the historical dialogue text, remove stop words, modal words and punctuation marks, and finally retain keywords; Step 1.3: Use a pre-trained BERT language representation model to extract and vectorize features from each user's keywords to obtain each user's word embedding representation. in, and The word embeddings represent the query text of the i-th user and the response text of the human customer service representative to the query text of the i-th user, respectively.

3. The response content generation method based on fine-grained user demand satisfaction reasoning according to claim 1, characterized in that: Step 2 is described in detail below: Step 2.1: Use the K-means clustering method to cluster the word embeddings into K clusters, with the cluster set p = [p1, p2, ..., p...]. K ], p1, p2, ..., p K These represent the 1st, 2nd, ..., Kth clusters, respectively, with the center vector of each cluster serving as the K initial prototype representation vectors; Step 2.2: Evaluate the reconstruction loss Prototype diversity loss and representative loss Unsupervised learning is performed on the K initial prototype representation vectors, and gradient descent is used to optimize the K initial prototype representation vectors to obtain the optimized K prototype representation vectors. Step 2.3: Use hierarchical clustering to construct a hierarchical global requirement prototype tree from the prototype representation vectors.

4. The response content generation method based on fine-grained user demand satisfaction reasoning according to claim 3, characterized in that: The assessment of reconstruction loss Prototype diversity loss and representative loss Specifically as follows: Where λ1, λ2, and λ3 represent the evaluation reconstruction loss, respectively. Prototype diversity loss and representative loss Learnable weight parameters; This represents an estimate of the word embedding representation of the query text for the i-th user. The term "representation" indicates the correlation between the word embedding representation of the query text of the i-th user and the k-th initial prototype representation vector; N represents the number of sentences in the query text of each user. and Let represent the global representations of the query text of the i-th user and the word embedding representations of the j-th sentence within it, respectively. represents the center vector of the k-th prototype representation vector; |||2 represents the L2 norm; L represents the number of keywords in each user's query text; dist() represents the distance function; This represents the word embedding representation of the j-th keyword of the i-th user.

5. The response content generation method based on fine-grained user demand satisfaction reasoning according to claim 1, characterized in that: Step 3 is described in detail below: Step 3.1: For each tree node in the global demand prototype tree, associate the tree node with the word embedding representation of each user's query text and the word embedding representation of the human customer service's reply text to each user's query text by calculating the dot product similarity, thereby constructing the query embedding tree and reply embedding tree for each user respectively; After matching each tree node in the query embedding tree and response embedding tree for each user, a satisfaction tree is constructed. Each tree node in the satisfaction tree represents the initial fine-grained satisfaction of the current user on the fine-grained needs of that tree node for a given response text. Step 3.2: The satisfaction tree is calculated by recursively aggregating the final fine-grained satisfaction of each level of the tree node in the bottom-up process, thereby obtaining the predicted overall satisfaction. Step 3.3: Use the root mean square error of the overall satisfaction predicted by each user as the loss for supervised learning, and optimize the final parameters of each layer of the satisfaction tree through backpropagation to fine-grained satisfaction, thereby constructing a multi-granularity satisfaction attribution model (MSA).

6. The response content generation method based on fine-grained user demand satisfaction reasoning according to claim 5, characterized in that: In step 3.2, the final fine-grained satisfaction of each tree node in each layer of the satisfaction tree is obtained by weighting its own initial fine-grained satisfaction and the final fine-grained satisfaction of several tree nodes in the previous layer connected to it. The predicted overall satisfaction is the final fine-grained satisfaction of the root node at the top layer of the satisfaction tree, or the final fine-grained satisfaction of each tree node in the layer M adjacent to the root node is input into a fully connected layer and weighted to obtain the fine-grained satisfaction as the final fine-grained satisfaction.

7. The response content generation method based on fine-grained user demand satisfaction reasoning according to claim 5, characterized in that: In step 4, each node in the Multi-Granularity Satisfaction Attribution Model (MSA) represents the current user's optimized fine-grained satisfaction with a given response text at the current node's fine-grained needs. Fine-grained needs whose optimized fine-grained satisfaction is lower than the satisfaction threshold δ are input into the preset prompt template of the large language model. After processing, the large language model outputs the response text of the optimized fine-grained needs. The optimization is repeated until the optimized fine-grained satisfaction of each of the current user's fine-grained needs reaches the satisfaction threshold δ or reaches the preset number of iterations S. The response text at this point is taken as the current user's optimized response text.

8. The response content generation method based on fine-grained user demand satisfaction reasoning according to claim 1, characterized in that: In step 4, the current user's query text and the optimized response text are repeated in steps 1-3 to obtain the optimized overall satisfaction of the current user. The optimized response texts with an overall satisfaction level lower than the satisfaction threshold δ are constructed as a set of unsatisfactory responses, and the optimized response texts with an overall satisfaction level reaching the satisfaction threshold δ are constructed as a set of satisfactory responses. The generation loss and contrast loss of the large language model are constructed based on the set of unsatisfactory responses and the set of satisfactory responses. The large language model is then subjected to self-supervised adaptive optimization. The model parameters of the large language model are optimized through backpropagation until the generation loss and contrast loss converge to obtain the trained large language model.

9. The response content generation method based on fine-grained user demand satisfaction reasoning according to claim 8, characterized in that: The generation loss L of the large language model gen And contrast loss L con Specifically as follows: in, p represents the number of satisfactory responses obtained in the j-th iteration; p() represents the generation probability; and Let M and M represent the generation parameters of the m-th response obtained in the j-th iteration and the generation parameters of the response with the highest satisfaction score, respectively; MSA() represents the overall satisfaction obtained by the multi-granularity satisfaction attribution model; M j This represents the number of responses obtained in the j-th iteration.

Citation Information

Patent Citations

  • Satisfaction-based user simulation method and system thereof

    CN114048301A

  • Dynamic adaptation question answering system and method based on hierarchical structure and retrieval enhancement

    CN118193714A