Intelligent customer service reply generation method based on personality inheritance and decision guidance

By constructing personality vectors and strategy selection mechanisms, the problem of personality consistency in long-term dialogues of intelligent customer service systems has been solved, achieving stability of brand tone and personalized service, and improving user experience and system optimization capabilities.

CN121120075BActive Publication Date: 2026-05-15WUHAN YIQI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
WUHAN YIQI TECH CO LTD
Filing Date
2025-09-03
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

Existing intelligent customer service systems struggle to maintain brand consistency during long-duration conversations, leading to fragmented user experiences and blurred brand image perception.

Method used

By establishing a brand personality baseline vector and a role personality vector, a soft prefix is ​​generated, and personality consistency is verified during the response generation process. Combined with the Bandit algorithm and the LinUCB strategy selection mechanism, the response strategy is optimized. A delayed reward mechanism based on user feedback and incremental parameter updates are adopted to achieve cross-session consistency and personalized service.

Benefits of technology

Ensure that the intelligent customer service maintains a consistent brand tone and value stance throughout multiple rounds of dialogue, enhance user perception consistency and trust, improve response accuracy and user satisfaction, reduce compliance risks, and achieve system self-optimization and stable upgrades.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121120075B_ABST
    Figure CN121120075B_ABST
Patent Text Reader

Abstract

The application provides an intelligent customer service reply generation method based on personality inheritance and decision guidance, and relates to the technical field of natural language processing.The method first processes brand and role corpus through a multi-label classification model, constructs brand personality baseline vectors and role personality vectors, and stores the vectors in a long-term memory bank.In a conversation, relevant personality vectors are queried and loaded to generate a soft prefix.Combining the user's input intent and emotional features forms a context feature vector.A reply draft is generated accordingly, and a natural language reasoning model is used to calculate the consistency score of the reply draft with the brand personality statement text, and the output, downgrade or manual operation is determined accordingly.The construction, inheritance and consistency verification of the personality vector fundamentally ensure that the intelligent customer service always maintains a unified brand tone and value position in multiple rounds of dialogue, effectively avoids personality drift, and significantly enhances the user's cognitive consistency and trust in the brand.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of natural language processing technology, and in particular to an intelligent customer service response generation method based on personality inheritance and decision guidance. Background Technology

[0002] In the field of intelligent customer service, the application of large language models (LLM) has significantly improved the fluency and human-likeness of conversations. However, existing technologies suffer from a core flaw that has long remained unresolved: the difficulty in maintaining brand personality consistency.

[0003] The generation mechanism of LLM (Local Modem) has an inherent randomness, causing it to be unable to maintain a consistent tone, style, and value stance throughout multiple rounds of dialogue. Its responses are often strongly influenced by the user's current question, thus deviating from the brand's established official image and personality. This personality drift phenomenon makes the responses of intelligent customer service unreliable in representing the brand, resulting in a fragmented user experience, blurred brand image perception, and ultimately, a decline in user trust.

[0004] Existing technologies, such as prompt engineering or model fine-tuning, attempt to inject brand information into a single session or static context, but they all lack a mechanism to inherit and reinforce a unified brand personality across sessions, thus making it difficult to fundamentally solve the problem of brand personality consistency in long-term conversations.

[0005] Therefore, there is an urgent need in this field for an innovative approach that can ensure that intelligent customer service systems maintain a stable and consistent brand personality throughout long-term, multi-round interactions. Summary of the Invention

[0006] This invention proposes an intelligent customer service response generation method based on personality inheritance and decision guidance, which solves the problems in existing technologies such as the lack of a mechanism for large model responses to inherit and strengthen a unified brand personality across conversations and the difficulty in maintaining brand personality consistency in long-term dialogues.

[0007] The technical solution of this invention is implemented as follows:

[0008] This invention provides an intelligent customer service response generation method based on personality inheritance and decision guidance, comprising the following steps:

[0009] A personality vector is established, and the original brand corpus is encoded using a multi-label classification model to obtain the brand personality baseline vector. The exclusive corpus of multiple customer service roles is encoded using a multi-label classification model to obtain the role personality vector corresponding to each customer service role. The brand personality baseline vector and the personality vectors of each role are stored in a long-term memory.

[0010] Generate a soft prefix. Based on the current session, query the long-term memory to see if there is a role personality vector that matches the user ID. If it exists, directly concatenate the corresponding role personality vector and the brand personality baseline vector to form a soft prefix; if it does not exist, only use the brand personality baseline vector as the soft prefix.

[0011] The context feature vector is concatenated, and the user's current input is identified using a pre-trained dual-task classification model. The intent feature vector and emotion feature vector are extracted, and the intent feature vector, emotion feature vector and soft prefix are concatenated at the front end of the user input to obtain the context feature vector.

[0012] To generate a draft response, input the context feature vector into a pre-trained large language model or a preset template.

[0013] The personality consistency check involves pairing the draft response with the brand personality statement text into sentence pairs, and then inputting these sentence pairs into a natural language inference model to calculate the personality consistency score.

[0014] Output response content. If the personality consistency score is higher than the set threshold, the draft content will be output directly. If the personality consistency score is lower than the set threshold, the response will be downgraded to generating response content through a preset template or transferring to human customer service for a response.

[0015] Specifically, the process of establishing a personality vector, including generating a brand personality baseline vector, specifically includes:

[0016] The original brand corpus was processed using a natural language coding model trained with multi-label classification, and the brand personality probability vector was calculated using the following formula:

[0017] ;

[0018] in, v This represents a five-dimensional personality probability vector, with its five components representing the probabilities of openness, conscientiousness, extraversion, agreeableness, and neuroticism, respectively. s This represents the Sigmoid activation function; This represents the weight matrix of the classification layer; This represents the semantic vector corresponding to the semantic label output by the encoding model; This represents the bias vector of the classification layer;

[0019] Vectors calculated from all corpora in the original brand corpus v Calculate the average or cluster center value to obtain the unique brand personality baseline vector p_brand.

[0020] Furthermore, in the step of establishing the personality vector, generating the character personality vector specifically includes:

[0021] Using the same method as calculating the brand personality baseline vector, calculate the original role personality vector p_raw for each customer service role;

[0022] Calculate the offset between the original character personality vector and the brand personality baseline vector. d :

[0023] d = p_raw - p_brand;

[0024] Determine the offset d L2 norm Is it greater than the preset offset radius threshold? r ;

[0025] If not, then the final character personality vector p_agent is p_raw;

[0026] If so, then use the threshold. r For offset d Perform cropping to obtain the cropped offset. :

[0027] ;

[0028] Then the final character personality vector p_agent = p_brand + .

[0029] Specifically, in the soft prefix generation step, the brand personality baseline vector or character personality vector is used to generate a soft prefix through a learnable mapping network. The mapping formula is as follows:

[0030] ;

[0031] in, P This represents the generated soft prefix matrix; p The input is either the brand personality baseline vector or the role personality vector; tanh represents the hyperbolic tangent activation function; w 1. b 1 represents the weights and biases of the first layer of the mapping network, respectively; w 2. b 2 represents the weights and biases of the second layer of the mapping network, respectively.

[0032] Specifically, the steps for concatenating the context feature vectors include:

[0033] The intent feature vector is extracted using the following formula:

[0034] ;

[0035] in, is the intent feature vector, representing the semantic intent probability distribution of the output, with each dimension corresponding to the intent category of a feature; softmax represents the softmax normalization function; The weight matrix represents the intent classification layer; This represents the semantic vector corresponding to the semantic label output by the encoding model; The bias vector representing the intention classification layer;

[0036] The emotion feature vector is extracted using the following formula:

[0037] ;

[0038] in, For the emotion feature vector, it represents the semantic emotion probability distribution of the output, and each dimension corresponds to the emotion category of a feature; s This represents the Sigmoid activation function; The weight matrix represents the emotion classification layer; This represents the semantic vector corresponding to the semantic label output by the encoding model; The bias vector representing the emotion classification layer;

[0039] Intent feature vector Emotion feature vector The soft prefix is ​​concatenated with the user input to obtain the context feature vector. x .

[0040] Preferably, before generating a draft response, the Bandit algorithm is used to select the optimal response strategy from the candidate strategy set. Specific steps include:

[0041] Input a contextual feature vector and a set of candidate strategies, the candidate strategies including generating response content using a large language model and generating response content using multiple different preset templates;

[0042] Calculate the cosine similarity between the tone vector of each candidate strategy and the brand personality baseline vector, and filter out candidate strategies with similarity below a set threshold.

[0043] For the remaining candidate policies, the LinUCB algorithm is used to calculate the upper confidence bound of each candidate policy arm based on the context feature vector, and the optimal policy arm is selected. The calculation formula is as follows:

[0044] ;

[0045] in, a This indicates the optimal strategy arm selected for this session; A Represents the set of all candidate policy arms; Indicates the strategy arm aA linear parameter vector, Representation strategy a The cumulative feature matrix of the arm, Indicates the strategy arm a The cumulative reward vector; x Represents the contextual feature vector of the input; Indicates the exploration coefficient. ; T This is the transpose of the matrix.

[0046] More preferably, after outputting the response content, a strategy parameter update step is also included:

[0047] After the current session ends, calculate the delay reward based on user feedback:

[0048] ;

[0049] in, r This represents the delayed reward earned in the current session; SR This represents the resolution rate metric; if the user's problem is resolved in the current session, then... SR = 1, otherwise SR = 0; CSAT This represents the user's satisfaction rating with customer service. ; w 3 and w 4 represents the weighting coefficients for the first-time resolution rate and the satisfaction score, respectively.

[0050] Based on the delayed reward r and the selected strategy arm a and the corresponding context feature vector x The parameters of the LinUCB algorithm are incrementally updated using the following formula:

[0051] ;

[0052] Where "←" represents an assignment operation, that is, using the updated value. , Replace the original , .

[0053] Specifically, the formula for calculating the personality consistency score is as follows:

[0054] ;

[0055] in, s The score indicates the consistency between the draft response and the brand personality statement text. s This represents the Sigmoid activation function; w s and bs These represent the weights and bias vectors of the personality consistency classifier, respectively; c ; y This indicates a sentence pair consisting of a draft response and the brand personality statement text; f (·) represents a sentence encoding function used to extract the speech information and interrelationships between the draft response and the brand personality statement text.

[0056] Furthermore, if the personality consistency score is higher than a set threshold, the personality vector of the current customer service representative is updated using the following formula:

[0057] ;

[0058] in, v new This is the updated character personality vector; v old The original character personality vector extracted from the long-term memory bank. v pred This is an instantaneous role personality vector obtained by encoding the current conversation content using a multi-label classification model. β For smoothing coefficients, ;

[0059] The updated character personality vector is stored in the long-term memory to replace the original character personality vector.

[0060] Preferably, after generating the draft response, a security test is performed on the draft content, and the probability of toxicity of the draft content is calculated using the following formula:

[0061] ;

[0062] in, t The probability of toxicity of the draft content; s This represents the Sigmoid activation function; w t and b t These represent the weights and bias vectors of the security classifier, respectively. y This indicates the content of the generated draft response; g (·) represents the sentence encoding function, used to extract security-related semantic feature vectors from the draft content;

[0063] If both the personality consistency score and the toxicity probability are above the set threshold, the draft content will be output directly; otherwise, the response will be downgraded to generating a response content through a preset template or being transferred to a human customer service representative for a response.

[0064] Preferably, during the offline phase, the evaluation of the benefits of the new strategy and the retraining of the safety and consistency model are performed periodically, with the following steps:

[0065] New strategy benefit assessment:

[0066] Read historical interaction data tuples from the system log. The data tuples include context feature vectors, selected policy arms, obtained delay rewards, and the probability of selecting that policy arm.

[0067] The expected return estimate of the new strategy to be evaluated is calculated using a dual robust estimator, as shown in the following formula:

[0068] ;

[0069] in, This represents a robust estimate of the expected return of the new strategy. N This indicates the total number of samples read from the system log; II(·) is an indicator function, which has a value of 1 when the condition in parentheses is true, and 0 otherwise; a i Indicates the first i The strategy arm selected from each sample; x i Indicates the first i Context feature vectors in each sample; Indicates a new simulation strategy In the input context feature vector x i The next strategy arm to be chosen; This represents the feature vector of the original policy in a given context. x i The probability of choosing the original strategy arm; r i Indicates the first i Delayed reward obtained for each sample; This represents the reward estimation function obtained through regression learning, used to estimate the feature vector in the context. x i Lower selection strategy arm a i Expected rewards; This represents the value estimation function obtained through regression learning, used to estimate the feature vector in the context. x i Follow the new strategy Expected value;

[0070] If the returns exceed the current online strategy's estimated returns, then the new strategy will be deployed and launched.

[0071] Safety and Consistency Model Retraining:

[0072] Data generated from personality consistency detection and security detection is collected from system logs, including positive samples of directly output draft responses and negative samples of response texts that trigger downgrades;

[0073] Positive and negative samples were mixed in a 1:1 ratio and used to retrain the personality consistency detection model and the security detection model, respectively, to generate updated model weights.

[0074] Replace the model weights currently in use online with the updated model weights to complete the iterative upgrade of the safety and consistency model.

[0075] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0076] (1) This invention establishes a brand personality baseline vector and a role personality vector, injects them into the generation process in the form of a soft prefix, and performs personality consistency verification after generating the response draft. This fundamentally ensures that the intelligent customer service maintains a consistent brand tone and value stance in multiple rounds of dialogue, effectively avoids personality drift, and enhances users' cognitive consistency and trust in the brand.

[0077] (2) By introducing the Bandit algorithm and LinUCB strategy selection mechanism, the system can adaptively select the optimal solution from multiple response strategies based on real-time context features. This not only improves the accuracy and scenario adaptability of the response, but also enables intelligent decision-making under the constraint of brand personality, significantly improving the first-time resolution rate and user satisfaction.

[0078] (3) The present invention adopts a delayed reward mechanism based on user feedback and an incremental parameter update strategy, enabling the system to learn online and continuously optimize the strategy selection, realize the self-evolution of the model in actual combat, and further improve the system's response quality and user experience.

[0079] (4) Through the dynamic update mechanism of the role personality vector, the system can smoothly adjust the personality vector of each customer service role based on actual interaction data while maintaining the brand tone, so as to achieve continuous optimization of personality and cross-conversation consistency, and enhance the personalization and consistency of service.

[0080] (5) Through the dual gating mechanism of personality consistency verification and security detection, the system can filter tone deviation and harmful content in real time during the generation stage, ensuring that every reply complies with brand norms and security standards, significantly reducing compliance risks and improving the reliability of output content;

[0081] (6) This invention uses a dual robust estimator for offline policy evaluation and model retraining. The system can safely iterate new policies and detection models without online testing, achieving closed-loop self-optimization, while ensuring the stability and traceability of system upgrades. Attached Figure Description

[0082] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0083] Figure 1 This is a schematic diagram of the process framework of an intelligent customer service response generation method based on personality inheritance and decision guidance according to the present invention.

[0084] Figure 2 This is a detailed flowchart illustrating the intelligent customer service response generation method based on personality inheritance and decision guidance according to the present invention. Detailed Implementation

[0085] The technical solution of the present invention will be clearly and completely described below with reference to the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.

[0086] Reference Figure 1 , 2 This invention provides an intelligent customer service response generation method based on personality inheritance and decision guidance, comprising the following steps:

[0087] S101, Establishing Personality Vectors

[0088] The original brand corpus (including official brand statements, product manuals, historical customer service dialogue records, etc.) is encoded using a natural language encoding model trained with multi-label classification (such as RoBERTa-large) to obtain the brand personality baseline vector; the exclusive corpus of multiple customer service roles is encoded using a multi-label classification model to obtain the role personality vector corresponding to each customer service role; the brand personality baseline vector and the personality vectors of each role are stored in a long-term memory (KV storage with TTL).

[0089] The generation of the brand personality baseline vector specifically includes:

[0090] The original brand corpus was processed using a natural language coding model trained with multi-label classification, and the brand personality probability vector was calculated using the following formula:

[0091] ;

[0092] in,v This represents a five-dimensional personality probability vector, with its five components representing the probabilities of openness, conscientiousness, extraversion, agreeableness, and neuroticism, respectively. s This represents the Sigmoid activation function; This represents the weight matrix of the classification layer; This represents the semantic vector corresponding to the semantic label output by the encoding model; This represents the bias vector of the classification layer;

[0093] Vectors calculated from all corpora in the original brand corpus v Calculate the average or cluster center value to obtain the unique brand personality baseline vector p_brand.

[0094] The generation of character personality vectors specifically includes:

[0095] Using the same method as calculating the brand personality baseline vector, calculate the original role personality vector p_raw for each customer service role (process the exclusive corpus of each customer service role using the same model to obtain the original role personality vector).

[0096] Calculate the offset between the original character personality vector and the brand personality baseline vector. d :

[0097] d = p_raw - p_brand;

[0098] Determine the offset d L2 norm Is it greater than the preset offset radius threshold? r ;

[0099] If not, then the final character personality vector p_agent is p_raw;

[0100] If so, then use the threshold. r For offset d Perform cropping to obtain the cropped offset. :

[0101] ;

[0102] Then the final character personality vector p_agent = p_brand + .

[0103] S102, Generate soft prefix

[0104] At the start of the session, query the long-term memory to see if there is a role personality vector that matches the user ID. If it exists, concatenate the corresponding role personality vector and the brand personality baseline vector into a soft prefix. If it does not exist, use only the brand personality baseline vector as the soft prefix (cold start).

[0105] The brand personality baseline vector or character personality vector is used to generate a soft prefix through a learnable mapping network. The mapping formula is as follows:

[0106] ;

[0107] in, P This represents the generated soft prefix matrix; p The input is either the brand personality baseline vector or the role personality vector; tanh represents the hyperbolic tangent activation function; w 1. b 1 represents the weights and biases of the first layer of the mapping network, respectively; w 2. b 2 represents the weights and biases of the second layer of the mapping network, respectively.

[0108] S103, Concatenate context feature vectors

[0109] The pre-trained dual-task classification model (RoBERTa model) is used to identify the user's current input, extract the intent feature vector and the emotion feature vector, and concatenate the intent feature vector and the emotion feature vector with a soft prefix at the front end of the user input to obtain the context feature vector;

[0110] The intent feature vector is extracted using the following formula:

[0111] ;

[0112] in, is the intent feature vector, representing the semantic intent probability distribution of the output, with each dimension corresponding to the intent category of a feature; softmax represents the softmax normalization function; The weight matrix represents the intent classification layer; This represents the semantic vector corresponding to the semantic label output by the encoding model; The bias vector representing the intention classification layer;

[0113] The emotion feature vector is extracted using the following formula:

[0114] ;

[0115] in, For the emotion feature vector, it represents the semantic emotion probability distribution of the output, and each dimension corresponds to the emotion category of a feature; sThis represents the Sigmoid activation function; The weight matrix represents the emotion classification layer; This represents the semantic vector corresponding to the semantic label output by the encoding model; The bias vector representing the emotion classification layer;

[0116] Intent feature vector Emotion feature vector The soft prefix is ​​concatenated with the user input to obtain the context feature vector. x .

[0117] S104, Strategy Selection and Response Generation

[0118] The Bandit algorithm is used to select the optimal response strategy from the candidate strategy set. The specific steps include:

[0119] Input a contextual feature vector and a set of candidate strategies, including generating response content using a large language model (LLM), generating response content after calling RAG retrieval, or generating response content using multiple different preset templates (the p_brand variable needs to be filled in).

[0120] Calculate the cosine similarity between the tone vector of each candidate strategy and the brand personality baseline vector, and filter out candidate strategies with similarity below a set threshold.

[0121] For the remaining candidate policies, the LinUCB algorithm is used to calculate the upper confidence bound of each candidate policy arm based on the context feature vector, and the optimal policy arm is selected. The calculation formula is as follows:

[0122] ;

[0123] in, a This indicates the optimal strategy arm selected for this session; A Represents the set of all candidate policy arms; Indicates the strategy arm a A linear parameter vector, Representation Strategy a The cumulative feature matrix of the arm, Indicates the strategy arm a The cumulative reward vector; x Represents the context feature vector of the input; Indicates the exploration coefficient. ; T This is the transpose of the matrix.

[0124] Generate a draft response based on the selected optimal strategy arm.

[0125] S105, Dual Gatekeeper Verification

[0126] 1) Personality Consistency Verification

[0127] The draft response and the brand personality statement text are combined into sentence pairs, and the sentence pairs are input into a natural language inference model to calculate the personality consistency score.

[0128] The formula for calculating the personality consistency score is as follows:

[0129] ;

[0130] in, s The score indicates the consistency between the draft response and the brand personality statement text. s This represents the Sigmoid activation function; w s and b s These represent the weights and bias vectors of the personality consistency classifier, respectively; c ; y This indicates a sentence pair consisting of a draft response and the brand personality statement text; f (·) represents a sentence encoding function used to extract the speech information and interrelationships between the draft response and the brand personality statement text.

[0131] 2) Security verification

[0132] The draft content undergoes a safety test, and the probability of its toxicity is calculated using the following formula:

[0133] ;

[0134] in, t The probability of toxicity of the draft content; s This represents the Sigmoid activation function; w t and b t These represent the weights and bias vectors of the security classifier, respectively. y This indicates the content of the generated draft response; g (·) represents the sentence encoding function, used to extract security-related semantic feature vectors from the draft content;

[0135] If both the personality consistency score and the toxicity probability are above the set threshold, the draft content will be output directly; otherwise, the response will be downgraded to generating a response content through a preset template or being transferred to a human customer service representative for a response.

[0136] S106, Online Learning and Updates

[0137] 1) Strategy parameter update

[0138] After the current session ends, calculate the delay reward based on user feedback:

[0139] ;

[0140] in, r This represents the delayed reward earned in the current session; SR This represents the resolution rate metric; if the user's problem is resolved in the current session, then... SR = 1, otherwise SR = 0; CSAT This indicates the user's satisfaction rating with customer service. ; w 3 and w 4 represents the weighting coefficients for the first-time resolution rate and the satisfaction score, respectively.

[0141] Based on the delayed reward r and the selected strategy arm a and the corresponding context feature vector x The parameters of the LinUCB algorithm are incrementally updated using the following formula:

[0142] ;

[0143] Where "←" represents an assignment operation, that is, using the updated value. , Replace the original , .

[0144] 2) Character personality vector update

[0145] If the personality consistency score is higher than the set threshold, the personality vector of the current customer service representative will be updated. The update formula is as follows:

[0146] ;

[0147] in, v new This is the updated character personality vector; v old The original character personality vector extracted from the long-term memory bank. v pred This is an instantaneous role personality vector obtained by encoding the current conversation content using a multi-label classification model. β For smoothing coefficients, In this embodiment, (Specific values ​​can be adjusted flexibly according to the actual situation).

[0148] The updated character personality vector is stored in the long-term memory to replace the original character personality vector.

[0149] S107, Offline Evaluation and Retraining

[0150] During the offline phase, periodic performance evaluations of the new strategy's effectiveness and retraining of the safety and consistency model are performed, following these steps:

[0151] 1) Evaluation of the benefits of the new strategy:

[0152] Read historical interaction data tuples from the system log. The data tuples include context feature vectors, selected policy arms, obtained delay rewards, and the probability of selecting that policy arm.

[0153] The expected return estimate of the new strategy to be evaluated is calculated using a dual robust estimator, as shown in the following formula:

[0154] ;

[0155] in, This represents a robust estimate of the expected return of the new strategy. N This indicates the total number of samples read from the system log; II(·) is an indicator function, which has a value of 1 when the condition in parentheses is true, and 0 otherwise; a i Indicates the first i The strategy arm selected from each sample; x i Indicates the first i Context feature vectors in each sample; Indicates a new simulation strategy In the input context feature vector x i The next strategy arm to be chosen; This represents the feature vector of the original policy in a given context. x i The probability of choosing the original strategy arm; r i Indicates the first i Delayed reward obtained for each sample; This represents the reward estimation function obtained through regression learning, used to estimate the feature vector in the context. x i Lower selection strategy arm a i Expected rewards; This represents the value estimation function obtained through regression learning, used to estimate the feature vector in the context. x i Follow the new strategy Expected value;

[0156] If the returns exceed the current online strategy's estimated returns, then the new strategy will be deployed and launched.

[0157] 2) Retraining the safety and consistency model:

[0158] Data generated from personality consistency detection and security detection is collected from system logs, including positive samples of directly output draft responses and negative samples of response texts that trigger downgrades;

[0159] Positive and negative samples were mixed in a 1:1 ratio and used to retrain the personality consistency detection model and the security detection model, respectively, to generate updated model weights.

[0160] Replace the model weights currently in use online with the updated model weights to complete the iterative upgrade of the safety and consistency model.

[0161] This embodiment uses a certain brand X as an example to illustrate the implementation of the present invention:

[0162] Phase 1: Offline Training and Initialization

[0163] (1) Corpus: Collect official documents of Brand X (such as "Service Manual" and "Brand Tone Specifications"), excellent customer service dialogue records over the years, product knowledge base, marketing copy, etc.

[0164] (2) Personality modeling: The above corpus was processed using the RoBERTa multi-label model, and the model learned to map the text to the "Big Five personality traits" dimension;

[0165] The baseline personality vector p_brand of the brand is calculated, and its five dimensions are as follows:

[0166] The probability of having an agreeable personality is 0.92 (very high, representing friendliness and thoughtfulness);

[0167] The probability of having a conscientious personality is 0.88 (very high, representing reliability and efficiency);

[0168] The probability of having an extroverted personality is 0.65 (moderately high, representing enthusiasm but not excessiveness);

[0169] The probability of an open personality is 0.61 (moderately high, indicating sociability but not excessive).

[0170] The probability of having a neurotic personality is 0.21 (very low, indicating emotional stability and a low irritability).

[0171] For role initialization, the same method is used to generate initial role personality vectors p_agent for multiple different customer service roles, ensuring that they are within the constraint radius of p_brand (e.g., r=0.1).

[0172] Phase Two: Online Reasoning and Response Generation

[0173] Session started (User ID: 12345)

[0174] (1) Session initialization

[0175] The system identifies user ID: 12345, queries the long-term memory, and finds that this user was mainly served by a customer service role named "Xiao Hong" in the past. It then hits and loads the corresponding role personality vector p_agent and brand baseline p_brand. The two are used to generate a two-segment soft prefix through the P-Tuningv2 network, ready to be injected into the LLM.

[0176] (2) User input and context awareness

[0177] A user typed: "The shoes I bought yesterday are the wrong size, how do I exchange them? I'm in a bit of a hurry to wear them tomorrow!"

[0178] Contextual analysis: Analyze the statement using a dual-task RoBERTa model;

[0179] Intent recognition: = {Exchange: 0.95, Inquiry: 0.04, Complaint: 0.01}, with the primary intention being "exchange";

[0180] Emotion recognition: = {Anxiety: 0.85, Neutrality: 0.10, Dissatisfaction: 0.05}, Dominant emotion is "Anxiety";

[0181] Will , p_brand and p_agent are concatenated to form a high-dimensional context feature vector. x .

[0182] (3) Strategy decision-making and response generation

[0183] Strategy Filtering and Selection: The LinUCB algorithm is used to receive context feature vectors. x ;

[0184] Hard filtering: First, filter out all strategy arms that conflict with highly agreeable and conscientious personalities (e.g., an overly mechanical template arm is eliminated due to low similarity in tone vectors).

[0185] Decision: Among the remaining arms, "Arm_8: LLM generation + RAG retrieval return and exchange policy" was selected because it received excessive rewards in similar historical scenarios (anxiety + exchange), and has the highest upper confidence bound in this calculation.

[0186] Content generation:

[0187] RAG Search: Based on the policy instruction, the system calls the "Return and Exchange Policy Inquiry Tool" and retrieves the latest policy clause: "Users can exchange goods without reason within 7 days of signing for receipt, provided the goods are kept intact. Please provide the order number for backend processing."

[0188] LLM generation: The prompt is composed of soft prefixes, user query, and retrieved policy knowledge. The LLM-generated response draft is as follows:

[0189] "Dear customer, we completely understand your eagerness to wear your new shoes tomorrow (high agreeableness: empathy and reassurance). Don't worry, our return and exchange process is very simple (high conscientiousness: professional commitment). You only need to provide your order number, and we will process it for you immediately, prioritizing shipment to ensure you can use them tomorrow (moderate extroversion: positive and enthusiastic)... (Insert specific policy clauses found by RAG here)"

[0190] (4) Double gatekeeper verification

[0191] Personality Consistency Verification: The NLI model compares the draft with the personality statement ("professional, friendly, helpful") and calculates a consistency score. s = 0.96 (higher than the set threshold of 0.8), passing the personality consistency check;

[0192] Safety verification: Draft analysis of toxicity detection model, probability of toxicity. t = 0.02 (below the set threshold of 0.1), passing the security check;

[0193] The decision was made, both checks passed, the draft content was approved, and sent to the user.

[0194] (5) User feedback and online parameter updates

[0195] User response: The user provided the order number and replied, "Thank you, it's resolved!"

[0196] Feedback collection: The system records the first-time resolution rate (SR) of this session as 1 and the user satisfaction score (CSAT) as 5 (out of 5 stars, normalized to 1.0).

[0197] Strategy Update: Calculate Delayed Rewards r = 0.6 1 + 0.4 1.0 = 1.0 (assuming weight) w 3 = 0.6, w 4 = 0.4).

[0198] Subsequently, the LinUCB algorithm uses ( x , a =Arm_8, r =1.0) triples, incrementally update the parameters of arm Arm_8 ( A a _8, b a _8) reinforced the tendency to choose this strategy in this situation.

[0199] Role Personality Update: A high consistency score triggers a role personality update. A new personality vector, v_pred (with a very high agreeableness dimension), is predicted using the current conversation content. This is calculated using the formula v_new = 0.8. v_old + 0.2 v_pred smoothly updates the personality vector corresponding to customer service representative "Xiao Hong," slightly enhancing her "agreeableness" trait to better reflect successful experiences in serving this user.

[0200] Phase 3: Offline Evaluation and Iteration

[0201] Strategy Evaluation: One week later, the system offline evaluated a new strategy (e.g., a template for faster response to anxious users) using the Doubly-Robust method. The evaluation showed that its expected benefits were higher than the current strategy, so it was safely deployed online.

[0202] Model retraining: The system collected all negative samples (such as some overly casual or ambiguous responses) that were blocked by the double gatekeepers in the past week and positive samples that were allowed. After mixing them in a 1:1 ratio, the NLI consistency model and toxicity detection model were fine-tuned to make the security and consistency verification more accurate.

[0203] This invention provides an intelligent customer service response generation method based on personality inheritance and decision guidance. By constructing a complete technical closed loop of "personality construction-injection-decision-verification-evolution," it systematically solves three core pain points in the field of intelligent customer service: easy drift of brand personality, lack of adaptive strategy, and difficulty in controlling output security. Its overall beneficial effect lies in the ability to quickly build and deploy an intelligent customer service system that is highly anthropomorphic, maintains consistent brand tone across conversations, makes intelligent decisions based on context, strictly adheres to security red lines, and possesses continuous self-optimization capabilities. This significantly improves user experience, maintains brand image, and reduces operational risks and costs.

[0204] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for generating intelligent customer service responses based on personality inheritance and decision guidance, characterized in that, Includes the following steps: Establish Personality Vectors: The original brand corpus is encoded using a multi-label classification model to obtain the brand personality baseline vector; the exclusive corpus of multiple customer service roles is encoded using a multi-label classification model to obtain the role personality vector corresponding to each customer service role. Store the brand personality baseline vector and the personality vectors of each role in a long-term memory bank; Generate a soft prefix: Based on the current session, query the long-term memory to see if there is a role personality vector that matches the user ID. If it exists, directly concatenate the corresponding role personality vector and the brand personality baseline vector to form a soft prefix; if it does not exist, only use the brand personality baseline vector as the soft prefix. Concatenating context feature vectors: Using a pre-trained dual-task classification model to identify the user's current input, extracting intent feature vectors and emotion feature vectors, and concatenating the intent feature vectors, emotion feature vectors, and soft prefixes at the beginning of the user input to obtain context feature vectors; Generate a draft response: Input the context feature vector into a pre-trained large language model or a preset template to generate a draft response; Personality consistency verification: Combine the draft response with the brand personality statement text to form sentence pairs, and input the sentence pairs into a natural language inference model to calculate the personality consistency score; Output response content: If the personality consistency score is higher than the set threshold, the draft content will be output directly; if the personality consistency score is lower than the set threshold, the response content will be generated by a preset template or transferred to human customer service for a response.

2. The intelligent customer service response generation method based on personality inheritance and decision guidance as described in claim 1, characterized in that, In the process of establishing a personality vector, generating a brand personality baseline vector specifically includes: The original brand corpus was processed using a natural language coding model trained with multi-label classification, and the brand personality probability vector was calculated using the following formula: ; Where v represents a five-dimensional personality probability vector, and its five components represent the probabilities of openness, conscientiousness, extraversion, agreeableness, and neuroticism, respectively; σ represents the Sigmoid activation function; This represents the weight matrix of the classification layer; This represents the semantic vector corresponding to the semantic label output by the encoding model; This represents the bias vector of the classification layer; The average value or cluster center value of the vector v obtained from all the data in the original brand corpus is calculated to obtain the unique brand personality baseline vector p_brand.

3. The intelligent customer service response generation method based on personality inheritance and decision guidance as described in claim 2, characterized in that, The process of creating a personality vector specifically includes: Using the same method as calculating the brand personality baseline vector, calculate the original role personality vector p_raw for each customer service role; Calculate the offset δ between the original character personality vector and the brand personality baseline vector: δ = p_raw - p_brand; Determine the L2 norm of the offset δ Is it greater than the preset offset radius threshold r? If not, then the final character personality vector p_agent is p_raw; If so, then the offset δ is clipped using a threshold r to obtain the clipped offset. : ; Then the final character personality vector p_agent = p_brand + .

4. The intelligent customer service response generation method based on personality inheritance and decision guidance as described in claim 1, characterized in that, In the step of generating soft prefixes, the brand personality baseline vector or the character personality vector is used to generate soft prefixes through a learnable mapping network. The mapping formula is as follows: ; Where P represents the generated soft prefix matrix; p is the input brand personality baseline vector or role personality vector; tanh represents the hyperbolic tangent activation function; w1 and b1 represent the weights and biases of the first layer of the mapping network, respectively; and w2 and b2 represent the weights and biases of the second layer of the mapping network, respectively.

5. The intelligent customer service response generation method based on personality inheritance and decision guidance as described in claim 1, characterized in that, The steps for concatenating context feature vectors include: The intent feature vector is extracted using the following formula: ; in, is the intent feature vector, representing the semantic intent probability distribution of the output, with each dimension corresponding to the intent category of a feature; softmax represents the softmax normalization function; The weight matrix represents the intent classification layer; This represents the semantic vector corresponding to the semantic label output by the encoding model; The bias vector representing the intention classification layer; The emotion feature vector is extracted using the following formula: ; in, is the emotion feature vector, representing the semantic emotion probability distribution of the output, where each dimension corresponds to the emotion category of a feature; σ represents the Sigmoid activation function; The weight matrix represents the emotion classification layer; This represents the semantic vector corresponding to the semantic label output by the encoding model; The bias vector representing the emotion classification layer; Intent feature vector Emotion feature vector The soft prefix is ​​concatenated with the user input to obtain the context feature vector x.

6. The intelligent customer service response generation method based on personality inheritance and decision guidance as described in claim 1, characterized in that, Before generating a draft response, the Bandit algorithm is used to select the optimal response strategy from the candidate strategy set. The specific steps include: Input a contextual feature vector and a set of candidate strategies, the candidate strategies including generating response content using a large language model and generating response content using multiple different preset templates; Calculate the cosine similarity between the tone vector of each candidate strategy and the brand personality baseline vector, and filter out candidate strategies with similarity below a set threshold. For the remaining candidate policies, the LinUCB algorithm is used to calculate the upper confidence bound of each candidate policy arm based on the context feature vector, and the optimal policy arm is selected. The calculation formula is as follows: ; Where 'a' represents the optimal policy arm selected in this session; and A represents the set of all candidate policy arms. This represents the linear parameter vector of strategy arm a. This represents the cumulative characteristic matrix of strategy arm a. Let represent the cumulative reward vector of policy arm a; x represents the input context feature vector. Indicates the exploration coefficient. T is the transpose of the matrix.

7. The intelligent customer service response generation method based on personality inheritance and decision guidance as described in claim 6, characterized in that, After outputting the response content, the strategy parameter update step is also included: After the current session ends, calculate the delay reward based on user feedback: ; Where r represents the delay reward obtained in the current session; SR represents the first-time resolution rate metric, SR = 1 if the user's problem is resolved in the current session, otherwise SR = 0; CSAT represents the user's satisfaction rating with customer service. w3 and w4 are the weighting coefficients for the first-time resolution rate and satisfaction score, respectively. Based on the delayed reward r, the selected policy arm a, and the corresponding context feature vector x, the parameters of the LinUCB algorithm are incrementally updated using the following formula: ; Here, "←" represents an assignment operation, that is, using the updated value. , Replace the original , .

8. The intelligent customer service response generation method based on personality inheritance and decision guidance as described in claim 6, characterized in that, The formula for calculating the personality consistency score is as follows: ; Where s represents the personality consistency score between the draft response and the brand personality statement text; σ represents the Sigmoid activation function; w s and b s represents the weight and bias vector of the personality consistency classifier, respectively; [c; y] represents the sentence pair consisting of the draft response and the brand personality statement text; f (·) represents the sentence encoding function used to extract the semantic information and the relationship between the draft response and the brand personality statement text; If the personality consistency score is higher than the set threshold, the personality vector of the current customer service representative will be updated. The update formula is as follows: ; Among them, v new For the updated character personality vector; v old v is the original character personality vector extracted from the long-term memory bank. pred This is an instantaneous role / personality vector obtained by encoding the current conversation content using a multi-label classification model, where β is the smoothing coefficient. ; The updated character personality vector is stored in the long-term memory to replace the original character personality vector.

9. The intelligent customer service response generation method based on personality inheritance and decision guidance as described in claim 8, characterized in that, After generating the draft response, a security check is performed on the draft content, and the probability of its toxicity is calculated using the following formula: ; Where t is the toxicity probability of the draft content; σ represents the Sigmoid activation function; w t and b t represents the weights and bias vectors of the security classifier, respectively; y represents the content of the generated draft response; g (·) represents the sentence encoding function, used to extract security-related semantic feature vectors from the draft content; If both the personality consistency score and the toxicity probability are above the set threshold, the draft content will be output directly; otherwise, the response will be downgraded to generating a response content through a preset template or being transferred to a human customer service representative for a response.

10. The intelligent customer service response generation method based on personality inheritance and decision guidance as described in claim 9, characterized in that, During the offline phase, periodic performance evaluations of the new strategy's effectiveness and retraining of the safety and consistency model are performed, following these steps: New strategy benefit assessment: Read historical interaction data tuples from the system log. The data tuples include context feature vectors, selected policy arms, obtained delay rewards, and the probability of selecting that policy arm. The expected return estimate of the new strategy to be evaluated is calculated using a dual robust estimator, as shown in the following formula: ; in, This represents the double-robust estimate of the expected return of the new strategy; N represents the total number of samples read from the system log; II(·) is an indicator function, which is 1 when the condition in parentheses is true, and 0 otherwise; a i x represents the strategy arm selected in the i-th sample; i This represents the context feature vector in the i-th sample; Indicates a new simulation strategy In the input context feature vector x i The next strategy arm to be chosen; This indicates that the original policy, given the feature vector x, is in a given context. i The probability of choosing the original strategy arm; r i This represents the delayed reward obtained by the i-th sample; This represents the reward estimation function obtained through regression learning, used to estimate the reward in the context feature vector x. i Lower selection strategy arm a i Expected rewards; This represents the value estimation function obtained through regression learning, used to estimate the value of the feature vector x in the context. i Follow the new strategy Expected value; If the returns exceed the current online strategy's estimated returns, then the new strategy will be deployed and launched. Safety and Consistency Model Retraining: Data generated from personality consistency detection and security detection is collected from system logs, including positive samples of directly output draft responses and negative samples of response texts that trigger downgrades; Positive and negative samples were mixed in a 1:1 ratio and used to retrain the personality consistency detection model and the security detection model, respectively, to generate updated model weights. Replace the model weights currently in use online with the updated model weights to complete the iterative upgrade of the safety and consistency model.