A method and system for intelligent customer service dialogue generation and optimization based on a large model
By collecting user interaction data to construct a dynamic error map and using reinforcement learning mechanisms to optimize the intelligent customer service system, the problems of slow response and weak generalization ability in existing technologies have been solved, and the accurate location and continuous optimization of dialogue errors have been achieved.
Patent Information
- Application Number
- CN202511128559.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-13
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2045-08-13
AI Technical Summary
Existing intelligent customer service systems cannot respond to immediate errors in conversations in a timely manner. The method of generating adversarial examples based on historical data and preset rules has weak generalization ability and cannot accurately locate and optimize complex and dynamic user error patterns.
User interaction behavior data is collected to construct an original dataset and generate a time-annotated corrected heatmap. By analyzing the relationship between the heatmap and the dialogue context, a dynamic error map is formed. A reinforcement learning mechanism is used to drive a large model to optimize the response module, forming a closed-loop control.
It achieves accurate location and dynamic response to errors in intelligent customer service dialogue, has continuous self-optimization capabilities, and can specifically correct high-frequency errors to improve service quality and efficiency.
Smart Images

Figure CN120632056B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of intelligent customer service dialogue technology, and in particular to a method and system for generating and optimizing intelligent customer service dialogues based on a large model. Background Technology
[0002] In practical applications of intelligent customer service, facing massive amounts of dialogue data generated by user interactions, the system needs to possess the crucial capability of autonomously identifying and locating high-frequency erroneous responses and driving model optimization. This requires the technical solution to dynamically capture error patterns directly from user behavioral feedback signals without human intervention, and to form a closed-loop mechanism to achieve continuous and rapid self-iterative optimization of the model, in order to cope with constantly changing user needs and emerging error types, thereby improving service quality and efficiency.
[0003] One existing targeted technical solution utilizes offline collected user complaints and labeled bad case data to generate adversarial examples in batches using preset rules or templates, and then periodically fine-tunes the large language model offline. This solution extracts erroneous segments identified in historical dialogues, uses automated methods to expand and generate negative training data, and readjusts model parameters within fixed training cycles in order to correct the model's erroneous tendencies on specific problems.
[0004] However, the existing solution has significant drawbacks: its optimization process lags far behind the interaction and cannot respond to errors that occur in the dialogue in a timely manner; the method of generating adversarial examples based on historical data and preset rules has weak generalization ability and is difficult to effectively capture new error patterns that are complex, dynamic or context-dependent; more importantly, it completely ignores the user's operational behavior data during the dialogue process, resulting in rough error localization and a lack of targeted optimization, and it cannot achieve truly autonomous and precise iteration. Summary of the Invention
[0005] This application provides a method and system for generating and optimizing intelligent customer service dialogues based on a large model, in order to solve the problems of serious lag in error response optimization, detachment from user feedback, and weak generalization ability in the existing technology based on offline adversarial training schemes.
[0006] Firstly, this application provides a method for generating and optimizing intelligent customer service dialogues based on a large model, including:
[0007] Collect user-repeated question data, manually rewritten data, cursor trajectory data, text deletion data, and voice interruption data, and associate them with recorded dialogue timestamps to form the original dataset;
[0008] Based on the original dataset, operation-intensive values and error frequency values are calculated to generate a corrected heatmap with time-stamped, operation-intensive, and error-frequency annotations.
[0009] The error location distribution is determined by analyzing the relationship between the corrected heatmap and the dialogue context. Node elements carrying intensity values are defined based on the operation density value of the error location distribution. At the same time, edge elements recording trigger conditions are defined based on the error frequency value of the error location distribution. The node elements and edge elements are integrated to construct a dynamic error graph for large model optimization.
[0010] The dynamic error graph is invoked, and when a new user corrects the data, the intensity value of the node element and the error frequency value of the edge element are updated. Based on the highest intensity value and the corresponding error frequency value of the edge element in the updated dynamic error graph, adversarial examples adapted to the input of the large model are generated.
[0011] The adversarial examples are used as negative rewards to input into the large model using a reinforcement learning mechanism. The response module is fine-tuned for the error type corresponding to the highest intensity value. The fine-tuned response module is driven by the current dialogue process to output the optimized dialogue content. At the same time, the dialogue content is fed back to the update process of the dynamic error graph, forming a closed-loop control of dialogue generation and optimization.
[0012] Optionally, the step of using a reinforcement learning mechanism to input the adversarial examples as negative rewards into a large model, fine-tuning the response module for the error type corresponding to the highest intensity value, and driving the fine-tuned response module to output optimized dialogue content based on the current dialogue process, while simultaneously feeding the dialogue content back into the update process of the dynamic error graph, forming a closed-loop control for dialogue generation and optimization, includes:
[0013] The adversarial examples are used as negative rewards input into the large model training environment through a reinforcement learning mechanism;
[0014] Locate the node element corresponding to the highest intensity value in the dynamic error map, extract the error type corresponding to the node element as the target error type, and modify the parameters of the response module for the target error type to reduce the probability of errors in dialogue generation;
[0015] Based on the context of the current dialogue process, the response module with adjusted driving parameters outputs optimized dialogue content;
[0016] The dialogue content is fed back as new user correction data to the dynamic error graph update process, forming a closed-loop control for dialogue generation and optimization.
[0017] Optionally, the step of feeding back the dialogue content as new user correction data to the dynamic error graph update process to form a closed-loop control for dialogue generation and optimization includes:
[0018] Convert the dialogue content into new user correction data that includes the dialogue text and corresponding timestamps;
[0019] The newly added user correction data is input into the update process of the dynamic error graph, triggering the update operation of the strength value of the node element and the error frequency value of the edge element;
[0020] Adversarial examples are regenerated using the updated dynamic error graph, and reinforcement learning is used to optimize the process, forming a continuously optimized closed-loop control.
[0021] Optionally, the step of calling the dynamic error graph, updating the intensity value of the node element and the error frequency value of the edge element when new user-corrected data is added, and generating adversarial examples adapted to the large model input based on the highest intensity value and the corresponding error frequency value of the edge element in the updated dynamic error graph includes:
[0022] When the dynamic error graph is invoked, and a new user corrects the data, the operation density value of the newly added error location is used as the strength value of the new node element, the latest operation density value of the existing error location is used as the strength value of the corresponding node element, and the latest error frequency value of the adjacent location is used as the trigger condition value of the edge element.
[0023] Traverse all node elements in the updated dynamic error graph and locate the node element corresponding to the highest intensity value as the target node.
[0024] Extract the original dialogue text corresponding to the error position of the target node, and at the same time obtain the maximum value of the error frequency value in the edge elements associated with the target node, and take the error type corresponding to the maximum value as the core error feature;
[0025] Modify the original dialogue text and inject the core error features to generate adversarial examples that contain similar errors and are adapted to the input format of large models.
[0026] Optionally, the step of determining the error location distribution by parsing the correlation between the corrected heatmap and the dialogue context, defining node elements carrying intensity values based on the operation density values of the error location distribution, and defining edge elements recording triggering conditions based on the error frequency values of the error location distribution, and integrating the node elements and edge elements to construct a dynamic error graph for large model optimization, includes:
[0027] The association between the annotations of each round in the corrected heatmap and the dialogue context is analyzed. Rounds in the dialogue process where the operation density value exceeds the density threshold or the error frequency value exceeds the frequency threshold are identified as error locations. The error locations are then integrated to form an error location distribution.
[0028] Node elements are created based on the operation density values of the error location distribution, and the operation density value of each error location is assigned as an intensity value to the corresponding node element.
[0029] Based on the error frequency value of the error location distribution, and using the error frequency value of the previous position among adjacent error locations as the trigger condition, an edge element connecting two node elements is created.
[0030] By integrating the node elements and edge elements in the order of the dialogue flow, a dynamic error graph for large model parameter optimization is constructed.
[0031] Optionally, the step of calculating operation-intensive values and error frequency values based on the original dataset to generate a corrected heatmap with time-stamped, operation-intensive, and error-frequency annotations includes:
[0032] The original dataset is divided into dialogue rounds from the start of user input to the end of intelligent customer service output.
[0033] The operation density value is calculated by counting the number of manual rewritings, text deletions, and total cursor movement distance in a single-turn dialogue. At the same time, the error frequency value is calculated by counting the number of repeated questions and voice interruptions in a single-turn dialogue.
[0034] The start and end timestamps of each round of dialogue are used as time markers, the operation-intensive value is used as an operation-intensive marker, and the error frequency value is used as an error frequency marker.
[0035] A two-dimensional grid is constructed with the time axis as the horizontal axis and the dialogue rounds as the vertical axis. The time annotations, operation density annotations, and error frequency annotations of each dialogue round are mapped to the corresponding two-dimensional grid regions to generate a corrected heatmap.
[0036] Optionally, the process of collecting user-repeated question data, manually rewritten data, cursor trajectory data, text deletion data, and voice interruption data, and associating them with recorded dialogue timestamps to form an original dataset, includes:
[0037] Monitor the dialogue interface between users and intelligent customer service, and collect data on repeated user questions, manual rewriting, cursor trajectory, text deletion, and voice interruption.
[0038] Based on the user's repeated question data, the manual rewriting data, the cursor trajectory, the text deletion data, and the voice interruption data, generate independent operation units with operation type identifiers, and merge the independent operation units in timestamp order to generate the original dataset.
[0039] Secondly, this application provides an intelligent customer service dialogue generation and optimization system based on a large model, including:
[0040] The data collection module is used to collect data on repeated user questions, manually rewritten data, cursor trajectory, text deletion data, and voice interruption data, and associate them with the recorded dialogue timestamps to form the original dataset.
[0041] The generation module is used to calculate the operation-intensive value and error frequency value based on the original dataset to generate a corrected heatmap with time labeling, operation-intensive labeling and error frequency labeling.
[0042] The construction module is used to determine the error location distribution by parsing the correlation between the correction heatmap and the dialogue context, define node elements carrying intensity values based on the operation density value of the error location distribution, define edge elements that record triggering conditions based on the error frequency value of the error location distribution, and integrate the node elements and the edge elements to construct a dynamic error graph for large model optimization.
[0043] The update module is used to call the dynamic error graph, update the intensity value of the node element and the error frequency value of the edge element when a new user corrects the data, and generate adversarial samples adapted to the input of a large model based on the highest intensity value and the corresponding error frequency value of the edge element in the updated dynamic error graph.
[0044] The feedback module is used to input the adversarial examples as negative rewards into the large model using a reinforcement learning mechanism, fine-tune the response module for the error type corresponding to the highest intensity value, and drive the fine-tuned response module to output optimized dialogue content based on the current dialogue process. At the same time, the dialogue content is fed back to the update process of the dynamic error map, forming a closed-loop control of dialogue generation and optimization.
[0045] Thirdly, this application provides a computing device, including a processing component and a storage component; the storage component stores one or more computer instructions; the one or more computer instructions are invoked and executed by the processing component to implement the intelligent customer service dialogue generation and optimization method based on a large model as described in the first aspect above.
[0046] Fourthly, this application provides a computer storage medium storing a computer program, which, when executed by a computer, implements a method for generating and optimizing intelligent customer service dialogues based on a large model as described in the first aspect.
[0047] In this application example, user-repeated question data, manually rewritten data, cursor trajectory data, text deletion data, and voice interruption data are collected and associated with dialogue timestamps to form an original dataset. Based on the original dataset, operation density values and error frequency values are calculated to generate a corrected heatmap with time stamps, operation density annotations, and error frequency annotations. The error location distribution is determined by analyzing the relationship between the corrected heatmap and the dialogue context. Based on the operation density values of the error location distribution, node elements carrying intensity values are defined, and simultaneously, based on the error frequency values of the error location distribution, edge elements recording trigger conditions are defined. The node elements and edge elements are integrated to construct a large-scale model. A dynamic error graph with optimized structure is generated. When new user data is added and corrections are made, the strength values of the node elements and the error frequency values of the edge elements are updated. Based on the highest strength value and the corresponding error frequency value of the edge element in the updated dynamic error graph, adversarial examples adapted to the input of a large model are generated. These adversarial examples are used as negative rewards input to the large model using a reinforcement learning mechanism. The response module is fine-tuned for the error type corresponding to the highest strength value, and the fine-tuned response module is driven by the current dialogue process to output optimized dialogue content. Simultaneously, the dialogue content is fed back to the update process of the dynamic error graph, forming a closed-loop control for dialogue generation and optimization.
[0048] The technical solution of this application has the following beneficial effects:
[0049] This application constructs an original dataset by collecting user interaction behavior data and associating it with timestamps. It then generates a multi-dimensional labeled correction heatmap based on operation intensity and error frequency values. A dynamic error graph is formed by analyzing the relationship between the heatmap and the dialogue context, quantifying error patterns using intensity value nodes and trigger condition edges. The graph is updated when new user correction data is added, and adversarial examples are dynamically generated based on the graph's peak features. A reinforcement learning negative feedback mechanism drives the large model to fine-tune the response module at the second level, specifically optimizing the error type corresponding to the highest intensity value. The optimization results are fed back to the graph update, ultimately forming a closed-loop self-evolving system from data collection, heatmap analysis, graph construction, sample generation, model optimization to effect verification. This achieves accurate location, dynamic response, and continuous autonomous optimization of errors in intelligent customer service dialogues.
[0050] Furthermore, by using adversarial examples as negative rewards input into the large model training environment; locating the error type corresponding to the node with the highest intensity value in the dynamic error graph; and specifically modifying the response module parameters to reduce the probability of generating this type of error; the response module outputs optimized content based on the current dialogue context; and finally, the optimization results are fed back as new correction data to the graph update, achieving closed-loop control. This scheme accurately suppresses the tendency to generate target errors through a negative reward mechanism, outputs optimized content in combination with the dialogue context, and feeds the optimization results back to the graph update, forming a self-driven loop system of error localization, parameter adjustment, effect verification, and graph evolution, achieving targeted, scenario-adaptive, and continuously evolving capabilities for intelligent customer service error correction.
[0051] These or other aspects of this application will become more apparent in the following description of the embodiments. Attached Figure Description
[0052] To more clearly illustrate the technical solutions in the embodiments of this application 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 some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0053] Figure 1 A flowchart of a method for generating and optimizing intelligent customer service dialogues based on a large model, as provided in this application, is shown.
[0054] Figure 2 The illustration shows a scenario diagram of an intelligent customer service dialogue generation and optimization method based on a large model provided in this application;
[0055] Figure 3 A schematic diagram of the structure of an intelligent customer service dialogue generation and optimization system based on a large model provided in this application is shown.
[0056] Figure 4 A schematic diagram of the structure of a computing device provided in this application is shown. Detailed Implementation
[0057] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
[0058] In some of the processes described in the specification, claims, and accompanying drawings of this application, multiple operations appearing in a specific order are included. However, it should be clearly understood that these operations may not be executed in the order they appear herein, or may be executed in parallel. The operation numbers, such as 101, 102, etc., are merely used to distinguish different operations and do not themselves represent any execution order. Furthermore, these processes may include more or fewer operations, and these operations may be executed sequentially or in parallel. It should be noted that the descriptions such as "first," "second," etc., in this document are used to distinguish different messages, devices, modules, etc., and do not represent a chronological order, nor do they limit "first" and "second" to different types.
[0059] Research indicates that current intelligent customer service systems suffer from three main problems with error correction techniques: First, they only analyze manually selected historical complaint records, ignoring actual user actions during the conversation (such as repeatedly modifying questions or abandoning the conversation midway), leading to a discrepancy between the system's understanding of errors and actual usage. Second, the system updates according to a fixed schedule (e.g., weekly), failing to quickly identify newly emerging error types, resulting in consistently delayed problem resolution. Finally, the system relies on preset rules to simulate possible error scenarios, but these simulations are too simplistic and cannot handle the ever-changing and complex error situations in real conversations. These problems trap existing systems in a vicious cycle of "error discovery - simple fix - new error generation."
[0060] To address these issues, a novel intelligent customer service optimization method has been developed: First, the system records various user actions during conversations (such as cursor movement and text deletion), and uses this behavioral data to create an "error heatmap," visually displaying which stages are most prone to problems. Then, the system automatically generates training materials based on the most frequent error types, using these materials to continuously optimize the customer service system's response capabilities. Finally, the system uses the optimized conversation results as new learning material to continuously update the error heatmap. This method effectively overcomes the shortcomings of existing technologies: accurately locating errors through real user behavior, avoiding repair delays through updates, and adapting to various complex errors through continuous learning, thereby significantly improving the accuracy and self-improvement capabilities of intelligent customer service.
[0061] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0062] Figure 1This application provides a flowchart of an intelligent customer service dialogue generation and optimization method based on a large model, as shown in the following embodiments. Figure 1 As shown, the method includes:
[0063] 101. Collect user repeated question data, manually rewritten data, cursor trajectory data, text deletion data, and voice interruption data, and associate them with the recorded dialogue timestamps to form the original dataset;
[0064] Optionally, step 101 may specifically include the following steps:
[0065] 1011. Monitor the dialogue interface between users and intelligent customer service, and collect data on repeated user questions, manual rewriting, cursor trajectory, text deletion, and voice interruption.
[0066] 1012. Based on the user's repeated question data, the manual rewriting data, the cursor trajectory, the text deletion data, and the voice interruption data, generate independent operation units with operation type identifiers, and merge the independent operation units in timestamp order to generate the original dataset.
[0067] In the above scheme, user repetitive question data refers to behavioral signals reflecting unsatisfactory answers received by users, used to identify key scenarios of insufficient responses or misunderstandings. Manual rewriting data records user activity in requesting modifications or rewriting of customer service responses (e.g., clicking "Rewrite," "Dissatisfied," or entering rewriting suggestions in the feedback box), used to locate inaccurate or incomplete paragraphs. Cursor trajectory data captures the movement path of the user's pointer over the customer service response text area, used to reveal comprehension obstacles or key information areas of interest. Text deletion data marks user behavior of deleting their own input (questions or feedback) within the input box, used to identify changes in user intent, difficulty in expression, or dissatisfaction with previous interactions. Voice interruption data records the timing of user interruptions during voice conversations, used to detect key points where responses do not match user expectations. The raw dataset is a time-series structured collection integrating the above behavioral signals, containing timestamped sequences of operational units.
[0068] In this embodiment, step 1011 performs multi-dimensional data collection through an embedded front-end monitoring module. When a user submits a text question, the system records the continuously entered content to collect data on repeated user questions. When a user triggers an interaction to rewrite a customer service response (such as clicking the "Rewrite" button or entering a modification suggestion in a specified area), the system captures the user's rewrite request or suggestion content to collect manual rewrite data. When the cursor moves in the customer service response area, the system samples the absolute screen coordinate sequence of the pointer at 100-millisecond intervals to collect cursor trajectory data. When a user performs a deletion operation in their own input box, the system monitors the browser's native input events and extracts the selection anchor point and focus offset to collect text deletion data. When a voice conversation is interrupted, the system marks the state transition time of the speech synthesis interface and the associated audio segment identifier to collect voice interruption data. All collected raw behavioral signals are associated with a high-precision time counter to generate an unprocessed signal stream. For example, when user D enters a refund-related question twice in a flight ticket customer service conversation, the system records the two text contents as repeated user questions. When user D clicks the "Dissatisfied" button on the response to the non-refundable clause, the system captures this rewrite request operation. .
[0069] Next, based on the raw signal stream acquired in step 1011, step 1012 performs structured transformation and merging through a streaming processing engine: Text similarity calculation is performed on the acquired user repetitive question data; TF-IDF vectorization and cosine similarity algorithms are used to identify valid repetitive question instances, generating structured user repetitive question data units with operation type identifiers; the acquired manual rewriting data (rewriting requests / suggestions) is parsed to extract the user-requested modifications or feedback text, generating standardized manual rewriting data units; the original coordinate sequence of the acquired cursor trajectory data is mapped to the row and column positions of the customer service reply text area, generating cursor trajectory data units with temporal path features; the original selection area offset in the acquired text deletion data is converted into start and end index values, generating precisely located deletion information units of the user's own input content; and the timestamps and voice segment identifiers in the acquired voice interruption data are associated to generate traceable voice interruption data units. Subsequently, event time window processing technology is used to dynamically sort the five types of structured data units according to their occurrence order based on high-precision timestamps, eliminating out-of-order problems caused by network transmission. Finally, the ordered data unit sequence is encoded into JSONLines format, with each record containing an ISO 8601 standard timestamp, operation type enumeration value, and feature object, generating a strictly time-series-based original dataset.
[0070] For example, the raw signal collected by user D, and the two text submissions ["Reason for Logistics Delay", "Reason for Logistics Delay"], can be converted into dataset entries:
[0071] {"timestamp":T1,"operation_type":"repeat","features":{"content":"reason for logistics delay"}}.
[0072] For the "Dissatisfied" click operation, generate a dataset entry such as: {"timestamp":T2,"operation_type":"rewrite_request","features":{"trigger":"dissatisfaction_button"}}.
[0073] In practical applications, taking the scenario of a user shopping on an e-commerce platform as an example, the complete interaction chain between the user and the intelligent customer service clearly demonstrates how multi-dimensional behavioral data can be transformed into a structured dataset:
[0074] The first stage is the interaction process and data collection phase:
[0075] 2023-05-14 10:30:15
[0076] User C's initial input: "Order number FH20230514001 shows it was shipped three days ago, can it be delivered today?" (The system records this as the initial question.)
[0077] 2023-05-14 10:30:22
[0078] Customer service AI reply:
[0079] [System Reply] Latest status of order FH20230514001:
[0080] 05-12 08:30 Shipped from East China transit warehouse
[0081] Arrived at the North China Distribution Center at 14:20 on May 13th.
[0082] Due to the holiday peak season, delivery is expected to be delayed by 1-3 days.
[0083] 2023-05-14 10:30:25
[0084] Text deletion: The user deletes the previously entered text "I want to complain about logistics!" in the input box (selected location: anchor point 0-focus 6). The system detects the input event: {inputType: "deleteContentBackward", data: null}.
[0085] 2023-05-14 10:30:28
[0086] User cursor trajectory: The mouse moves back and forth over "delay 1-3 days" (generating high-density coordinate points), and the system collects the coordinate sequence [{x:205,y:378,t:1684038628400}...{x:220,y:378,t:1684038632400}].
[0087] 2023-05-14 10:30:35
[0088] The user suddenly inputs via voice: "No! It must be delivered today!" (interrupting the AI's subsequent text delivery), and the system marks the time point when the speech synthesis was interrupted.
[0089] 2023-05-14 10:30:40
[0090] When a user makes a rewrite request, such as clicking the "Emergency Handling" button below the reply, the system captures the customized rewrite request.
[0091] 2023-05-14 10:31:05
[0092] Repeated question: The user entered: "What is the contact number for the North China Distribution Center? I want to expedite the shipment myself."
[0093] Next, the data enters the streaming engine for transformation. The streaming engine captures the corresponding data through the above interaction process and transforms it into structured data units, as shown in Table 1 below:
[0094] Table 1
[0095] Original signal Transformation Logic Structured data unit Initial question: Text content Direct storage semantics { "timestamp":"2023-05-14T10:30:15.200Z", "operation_type":"initial_question", "features":{ "content":"Order number FH20230514001 shows it was shipped three days ago, can it be delivered today?" "urgency_flag":true } } Text deletion: Delete 6 characters of content 1. Restore deleted content 2. Associate emotional intensity { "timestamp":"2023-05-14T10:30:25.800Z", "operation_type":"deletion", "features":{ "deleted_content":"I want to complain about the logistics!" "emotion_level":2 / / Anger level } } Cursor trajectory: high-density coordinate points 1. Map to line 3 of the reply. 2. Calculate the scan frequency. { "timestamp":"2023-05-14T10:30:28.400Z", "operation_type":"cursor", "features":{ "line":3, "target_text":"Delay 1-3 days", "scan_freq": 4.2Hz / / 4.2 scans per second } } Voice interruption: Interruption time point Associated with the current broadcast field { "timestamp":"2023-05-14T10:30:35.100Z", "operation_type":"voice_interrupt", "features":{ "related_text":"Expected delivery delay of 1-3 days", "interrupt_type":"demand_override" / / Demand-override type interrupt } } Rewrite request: Click the "Urgent Processing" button Analyzing button semantics { "timestamp":"2023-05-14T10:30:40.600Z", "operation_type":"rewrite_request", "features":{ "trigger":"emergency_button", "expected_action":"contact_logistics" } } Repeat question: New input content 1. Semantic analysis 2. Association of distribution center nodes { "timestamp": "2023-05-14T10:31:05.300Z", "operation_type": "repeat", "features": { "content": "What is the contact number for the North China Distribution Center? I need to expedite the shipment myself." "focus_node": "North China Distribution Center" } }
[0096] Finally, the system generates the original dataset (JSON Lines) based on the obtained structured data units, as shown in the following JSON code:
[0097] {"timestamp":"2023-05-14T10:30:15.200Z","operation_type":"initial_question","features":{"content":"Order number FH20230514001 shows it was shipped three days ago, can it be delivered today?","urgency_flag":true}}
[0098] {"timestamp":"2023-05-14T10:30:25.800Z","operation_type":"deletion","features":{"deleted_content":"I want to complain about the logistics!","emotion_level":2}}
[0099] {"timestamp":"2023-05-14T10:30:28.400Z","operation_type":"cursor","features":{"line":3,"target_text":"Delay 1-3 days","scan_freq":4.2}}
[0100] {"timestamp":"2023-05-14T10:30:35.100Z","operation_type":"voice_interrupt","features":{"related_text":"Expected delivery delay of 1-3 days","interrupt_type":"demand_override"}}
[0101] {"timestamp":"2023-05-14T10:30:40.600Z","operation_type":"rewrite_request","features":{"trigger":"emergency_button","expected_action":"contact_logistics"}}
[0102] {"timestamp":"2023-05-14T10:31:05.300Z","operation_type":"repeat","features":{"content":"What is the contact number for the North China Distribution Center? I need to expedite the shipment myself","focus_node":"North China Distribution Center"}}
[0103] The above-mentioned 101 overall solution collects multi-dimensional user interaction behaviors (with a focus on correcting it to only operate the user's own input or trigger feedback to customer service replies) and constructs a time-series raw dataset, providing comprehensive and accurate basic data support for subsequent error analysis that truly reflects user intent, significantly improving the accuracy of error localization and the reliability of data-driven optimization.
[0104] 102. Calculate the operation-intensive value and error frequency value based on the original dataset to generate a corrected heatmap with time annotation, operation-intensive annotation and error frequency annotation;
[0105] Optionally, step 102 may specifically include the following steps:
[0106] 1021. Divide the original dataset into dialogue rounds from the start of user input to the end of intelligent customer service output;
[0107] 1022. Calculate the operation density value by counting the number of times manual rewriting, text deletion, and total cursor movement distance in a single-turn dialogue. At the same time, calculate the error frequency value by counting the number of repeated questions and voice interruptions in a single-turn dialogue.
[0108] 1023. Use the start and end timestamps of each round of dialogue as time markers, the operation-intensive value as operation-intensive markers, and the error frequency value as error frequency markers.
[0109] 1024. Construct a two-dimensional grid with the time axis as the horizontal axis and the dialogue round as the vertical axis, and map the time label, operation density label and error frequency label of each dialogue round to the corresponding two-dimensional grid area to generate a correction heatmap.
[0110] In the above scheme, the operation intensity value refers to a dynamic quantitative indicator reflecting the intensity of user modifications to the intelligent customer service response. It includes comprehensive operational characteristics of manual rewriting, text deletion, and cursor movement, and can be used to locate high-risk response segments where users have comprehension difficulties or missing information. The error frequency value refers to a frequency indicator representing the degree of user dissatisfaction with the customer service response. It includes triggering characteristics of repeated questioning and voice interruption, and can be used to identify systemic defects such as inaccurate responses or delayed responses. The correction heatmap is a two-way visual data carrier that integrates the time dimension and the number of dialogue turns. It includes three-dimensional information such as time annotation, operation intensity annotation, and error frequency annotation, and can be used to reveal error distribution patterns and provide spatiotemporal basis for constructing a dynamic error map.
[0111] In this embodiment, step 1021 reads the timestamp sequence from the original dataset. The user input start event is used as the starting point of the round, and the end event is defined as 5 consecutive seconds without any new user events after the customer service representative outputs the end event. The original data is then divided into independent dialogue rounds. A session timeout detection algorithm is used during the division; if the interval between adjacent user inputs is less than 5 seconds, they are merged into the same round to avoid splitting up continuous follow-up questions. For example, if user A asks "How do I get a refund?" at 10:00:01, this is marked as the round start. The customer service representative replies at 10:00:05 to end the round. User A then asks "Is there a handling fee?" at 10:00:06. The system merges these questions into the same round until the customer service representative replies for the second time at 10:00:10, after which there is no new input for 5 seconds, ultimately generating a single-round dialogue data packet containing the two user questions.
[0112] Next, based on the segmented single-turn dialogue data packets from step 1021, the operation-intensive value and error frequency value are calculated synchronously. User actions within a single turn are analyzed. For the operation-intensive value, the number of manual rewrites is counted, and the number of text deletions with a single deletion of ≥5 characters is accumulated. The cursor movement trajectory coordinate sequence is extracted, and the total cursor movement distance is obtained by calculating and summing the Euclidean distances between adjacent coordinate points. Then, the operation-intensive value is calculated using a weighted calculation formula, as follows: Where 12 represents the standard character width in pixels. For example, if a certain round of records involves 3 deletion operations, 2 rewrite operations, and a total cursor trajectory distance of 360 pixels, then the calculated operation density value is 10.8. Synchronous analysis of the dialogue event flow is performed, and the number of repeated questions is identified through a semantic similarity model. The number of times customer service voice output is interrupted by user voice input is counted using the formula: Calculate the error frequency value. For example, if a user asks about the refund policy for the first time in a certain round, and the customer service response is interrupted once, and the user asks a similar question again, the calculated error frequency value is 3.
[0113] Then, in step 1023, the single-turn dialogue operation density value and error frequency value output in step 1022 are received. Simultaneously, the original round time information segmented in step 1021 is combined to perform three-dimensional data binding. The precise start and end timestamps are extracted from the individual round data packets. The millisecond-level timestamps are rounded to the second level and formatted as a string of "start time - end time" through time normalization. Then, the operation density value is written as an operation density label and the error frequency value is written as an error frequency label. Finally, these three types of data are merged into a structured label triplet. For example, in a flight cancellation conversation, user B's second round of interaction is divided into independent rounds within the time range of 10:00:30-10:00:40. Based on the deletion of 4 times and the cursor movement of 480 pixels in the second round of interaction, the corresponding operation density value is calculated to be 12.0. At the same time, based on the repeated questioning 2 times, the error frequency value is calculated to be 4. These three types of data are combined to generate a triple {time: "10:00:30-40", operation density value: 12.0, error frequency value: 4}. This triple will be stored in the cache queue as the basic unit for heatmap generation.
[0114] Finally, as Figure 2As shown, step 1024 constructs a corrected heatmap based on labeled triples. First, the global time range of the session is determined, and the horizontal axis is divided into 300 continuous time grids at 1-second intervals. The vertical axis generates a numbered sequence according to the dialogue rounds. Then, all triples are traversed to perform grid mapping. Taking user B's second round data as an example, its time label "10:00:30-40" corresponds to the 31st to 40th seconds on the horizontal axis and the 2nd row on the vertical axis. The system writes the operation density value of 12.0 and the error frequency value of 4 into each cell of these 10 grids. Finally, the grid matrix is rendered in dual channels by the visualization engine. The operation density value difference can be set as follows: low density (0-5): sparse thin gray lines with large-spaced dashed lines; medium density (5-10): medium-density solid line grids; high density (>10): dense thick black lines with very dense intersecting grids. The error frequency value difference can be controlled by adjusting the transparency. The higher the error frequency value, the less transparent it is, generating a spatiotemporal error distribution heatmap that can be directly identified. For example, in Figure 2 Medium, low density, low error: thin gray lines + long dashed lines, sparse grid; medium density, low error: medium gray lines + medium dashed lines, medium grid density; medium density, medium error: solid black lines, medium grid density; high density, high error: thick black lines, densest grid.
[0115] In a practical application, in a certain intelligent customer service system, user C started inquiring about flight rescheduling at 14:00:01:50, and the customer service replied at 14:00:05:20. User C then followed up at 14:00:05:80 with the question, "How to waive the handling fee?", and the customer service replied again at 14:00:10:30. Because the interval between the follow-up questions was less than 5 seconds, the two questions were combined into a single round of dialogue, with a time range of 14:00:01-14:00:10. The system analysis of this round of behavior revealed that the user deleted the original input 5 times, manually rewrote it 3 times, and the cursor trajectory coordinate sequence [(100,200),(120,210),(150,230)] moved a distance calculated using Euclidean distance. Pixels, calculation ;in This indicates taking the square root. Simultaneously, it was detected that after the user's initial question, the customer service's initial response was interrupted once by voice. The follow-up question had a 90% semantic similarity to the initial question. The system then binds the time information "14:00:01-11", generating a triple {time: "14:00:01-11", operation density value: 4.36, error frequency value: 3}. Finally, a heatmap is constructed: the horizontal axis is divided into 60 grids from 14:00:00 to 14:01:00, and the first row of the vertical axis occupies grids 2-12 on the horizontal axis. Each grid is written with (4.36, 3) corresponding to the operation density value 4.36 and the error frequency value 3, and rendered as a yellow semi-transparent block.
[0116] The overall solution described above (102) transforms user interaction behavior into a spatiotemporally labeled correction heatmap, enabling intuitive and visual localization of dialogue error patterns. Based on the quantitative calculation of operation intensity and error frequency, the system can automatically identify dialogue turns and time intervals with high modification intensity and high error frequency, providing accurate spatiotemporal data support for subsequent dynamic error map construction. This significantly improves the objectivity and localization efficiency of error detection, avoiding reliance on subjective experience.
[0117] 103. By analyzing the relationship between the corrected heatmap and the dialogue context, the error location distribution is determined. Based on the operation density value of the error location distribution, node elements carrying intensity values are defined. At the same time, based on the error frequency value of the error location distribution, edge elements recording trigger conditions are defined. The node elements and edge elements are integrated to construct a dynamic error graph for large model optimization.
[0118] Optionally, step 103 may specifically include the following steps:
[0119] 1031. Analyze the relationship between the annotations of each round in the corrected heatmap and the dialogue context, locate the rounds in the dialogue process where the operation density value exceeds the density threshold or the error frequency value exceeds the frequency threshold as error locations, and integrate the error locations to form an error location distribution;
[0120] 1032. Create node elements based on the operation density values of the error location distribution, and assign the operation density value of each error location as an intensity value to the corresponding node element;
[0121] 1033. Based on the error frequency value of the error location distribution, and using the error frequency value of the previous position among adjacent error locations as the trigger condition, create an edge element connecting two node elements.
[0122] 1034. Integrate the node elements and edge elements according to the dialogue flow sequence to construct a dynamic error graph for large model parameter optimization.
[0123] In the above scheme, the error location distribution is a set of abnormal rounds located by parsing the temporal correlation between the heatmap and the dialogue context, satisfying the judgment conditions that the operation density value exceeds a preset density threshold or the error frequency value exceeds a frequency threshold. Node elements are topological units carrying error locations; their strength values directly map the quantification result of the operation density value at that location, used to characterize the urgency of error correction. Edge elements are directed association units connecting adjacent nodes; their recorded triggering conditions originate from the statistical output of the error frequency value of the previous node, used to describe the induction probability between error types. The dynamic error map is a mesh structure constructed by integrating node elements and their associated edge elements. It can update node strength values and edge triggering conditions with new user data, providing an adaptive error relationship model for generating adversarial examples.
[0124] In this embodiment, step 1031 first extracts the operation density value and error frequency value of each round of dialogue from the corrected heatmap. Then, a dual-threshold determination mechanism is employed, comparing the heatmap annotations with the dialogue context round by round in chronological order. If the operation density value of a round exceeds a preset density threshold of 2.0 or the error frequency value exceeds a frequency threshold of 5 times, that round is marked as an error location. Finally, all marked rounds are integrated to form an error location distribution set. For example, in a medical customer service scenario, the operation density value of the 5th round of dialogue is 2.2, which is greater than the density threshold, and the error frequency value is 7, which is greater than the error threshold; the system includes it in the error location distribution set.
[0125] Next, based on the error location distribution set output in step 1031, an independent node element is created for each marked error location. The node ID is bound to the specific dialogue round and error type, and the operation density value of that location is directly converted into a node strength value, forming a topological unit that quantifies the urgency of error correction. For example, in an insurance customer service scenario, for the error in the 5th round of the claims process in the error location distribution, its operation density value of 2.0 is directly assigned a node strength value, generating a node element with the attributes {round: 5, error type: "claims process", strength: 2.0}, achieving a precise mapping between error severity and node weight.
[0126] Then, in step 1033, the node elements generated in step 1032 are scanned according to the dialogue flow sequence. Directed edge elements are created for consecutively occurring adjacent error node elements. The triggering condition of the edge is defined based on the error frequency value of the previous node element. Specifically, the error frequency value of that node element is directly converted into an edge attribute, forming association rules describing the induction patterns between error types. For example, in a government customer service scenario, when node A and node B are adjacent, the system creates a directed edge from A to B and sets the error frequency value of node A (8) as the triggering condition, generating a rule chain: "When the cumulative number of errors in household registration reaches 8, a social security transfer consultation error will be triggered," thus achieving quantitative modeling of error propagation relationships.
[0127] Finally, based on the node elements generated in step 1032 and the edge elements constructed in step 1033, all node elements are topologically sorted according to the order of dialogue rounds, and each node element with a strength value is arranged along the time axis. Then, according to the association rules defined in step 1033, adjacent nodes with causal relationships are connected by edge elements carrying trigger conditions. Finally, a dynamic error graph is formed, in which nodes represent the specific error location and its urgency, and edges describe the triggering rules for error propagation. For example, in a bank customer service scenario, the graph connects the "Annual Fee Policy Error" node with a strength of 2.1 in round 3 and the "Transfer Limit Error" node with a strength of 1.8 in round 7 with an edge whose trigger condition is "6 accumulated annual fee errors", thus constructing an updatable error evolution network model.
[0128] In a practical application scenario for e-commerce customer service, the system first analyzes and corrects the heatmap. It detects that the operation density value of the user's response regarding "shipping rules" in round 3 is 1.5, less than the density threshold of 2.0. However, this error type has appeared 7 times in nearly 200 conversations, exceeding the frequency threshold of 5. Therefore, round 3 is still marked as an error location. Subsequently, the operation density value of round 5 is 2.4, exceeding the threshold of 2.0, so round 5 is also marked, ultimately generating an error location distribution set {round 3, round 5}. Next, nodes are created for the two locations. The node strength value of round 3 directly inherits its operation density value of 1.5, and the node strength value of round 5 is 2.4. Adjacent nodes are then processed according to the conversation order. Because the error frequency value of the round 3 node is 7, a directed edge pointing to the round 5 node is created, with the trigger condition set to 7 occurrences. Finally, the node elements and edge elements are integrated to construct a dynamic error graph, forming a causal chain model where "when a user accumulates 7 instances of dissatisfaction with the explanation of shipping rules, the probability of misunderstanding when subsequently inquiring about insurance strategies will increase significantly."
[0129] The overall solution described above (103) achieves three core optimizations by transforming user interaction behavior into a structured error network: First, it establishes a visual mapping of error severity, using node strength values to intuitively identify dialogue defects that need to be prioritized; second, it reveals error chaining patterns, accurately predicting potential related errors through edge triggering conditions; and finally, it forms a dynamically evolving error relationship model, enabling the system to proactively track error propagation paths and predict risks, providing a causally interpretable decision framework for targeted optimization, and significantly improving the timeliness of error correction and continuous evolution capabilities.
[0130] 104. Call the dynamic error graph, update the strength value of the node element and the error frequency value of the edge element when a new user corrects the data, and generate adversarial samples adapted to the input of the large model based on the highest strength value and the corresponding error frequency value of the edge element in the updated dynamic error graph.
[0131] Optionally, step 104 may specifically include the following steps:
[0132] 1041. When the dynamic error graph is invoked, and a new user corrects the data, the operation density value of the newly added error position is used as the strength value of the new node element, the latest operation density value of the existing error position is used as the strength value of the corresponding node element, and the latest error frequency value of the adjacent position is used as the trigger condition value of the edge element.
[0133] 1042. Traverse all node elements in the updated dynamic error graph and locate the node element corresponding to the highest intensity value as the target node;
[0134] 1043. Extract the original dialogue text corresponding to the error position of the target node, and at the same time obtain the maximum value of the error frequency value in the edge elements associated with the target node, and take the error type corresponding to the maximum value as the core error feature;
[0135] 1044. Modify the original dialogue text and inject the core error features to generate adversarial examples that contain similar errors and are adapted to the input format of large models.
[0136] In the above scheme, core error features refer to the essential attributes of high-frequency error patterns extracted from the dynamic error graph. These include the error type corresponding to the maximum error frequency among the edge elements associated with the target node, and can be used to guide the precise injection of adversarial examples. Adversarial examples refer to specially constructed input data designed to expose the weaknesses of large models. They contain core error features intentionally implanted in the original dialogue text and can be used to trigger large models to generate specific types of error responses to drive reinforcement learning optimization.
[0137] In this embodiment, firstly, when the system detects newly added user correction data in step 1041, the specific location of the error in the dialogue text is located. If the location does not exist in the existing graph, the same operation density value calculation process as in step 102 is executed, and the calculation result is directly used as the strength value of the new node element. If a corresponding node already exists at the location, the latest operation density value is synchronized from the updated correction heatmap. At the same time, the error operations adjacent to the location are scanned, and the latest statistical error co-occurrence frequency value is obtained from the heatmap. This value is directly assigned to the associated edge element as a trigger condition value, ultimately achieving second-level dynamic updates of graph node strength and edge error frequency. For example, if a user performs continuous deletion of the word "power cord" in the customer service reply "Please disconnect the power cord first", the system determines it as a new error location, calculates the operation density value to be 1.2, and creates a new node element with a strength value of 1.2. Simultaneously, it detects that the user subsequently adds "an insulated screwdriver is required" in an adjacent location, obtains the latest co-occurrence frequency value of 85% for the "delete-add" operation from the heatmap, and updates the associated edge attributes.
[0138] Next, in step 1042, all node elements in the updated dynamic error graph are traversed: the maximum intensity value variable and the temporary target node storage pointer are initialized; each node is recursively visited starting from the root node of the graph, and the relationship between the current node's intensity value and the maximum intensity value is compared; when traversing to node B, if its intensity value of 1.2 is greater than the current maximum value of 0.8, the maximum value is updated to 1.2 and the target candidate is switched to node B; after all nodes have been visited, the node corresponding to the final recorded maximum intensity value is output as the target node, which represents the most prominent and urgently needed error location in the current user's correction behavior. For example, the updated graph contains three nodes: node X corresponds to intensity 0.6, node Y corresponds to intensity 0.9, and node Z corresponds to intensity 1.1; when traversal starts, the maximum intensity value is initially set to 0. When visiting node X, 0.6>0, the maximum value is updated to 0.6 and X is temporarily stored; when visiting node Y, 0.9>0.6, the maximum value is updated to 0.9 and Y is stored; finally, when visiting node Z, 1.1>0.9, the maximum value is updated to 1.1 and Z is locked as the target node.
[0139] Then, after identifying the target node, two key operations are performed to prepare for adversarial example generation: First, based on the location index information recorded in the target node, the original text content before the user performed the correction operation is precisely retrieved from the dialogue history database. Second, all edge elements connected to the target node are searched, and a maximum value comparison algorithm is used to filter out the edge element with the highest error frequency. The error type recorded by this edge element is then identified as the core error feature to be injected into the adversarial example. For example, if the target node is located at the position of the repeatedly deleted statement "thawing takes 30 minutes," the system retrieves the original text "thawing takes 30 minutes." Searching its associated edges reveals that the error frequency of "missing time unit" reaches 95%, higher than the 80% for "missing temperature value," thus identifying "omitted time unit" as the core error feature.
[0140] Finally, adversarial examples are constructed based on the original text of the target node and the core error features in step 1044: the original text content is completely copied; targeted semantic deletions and modifications are made according to the type of core error features; the modified text is encapsulated into the standard input format of the large model to generate the final adversarial example. For example, after the original text "Charging time requires 2 hours" is injected with the core feature "missing time unit", the word "hours" is deleted to generate the adversarial example "[QUERY]Charging time requires 2 [CONTEXT]User asks about charging time...". This example will induce the large model to expose the defect of ignoring the time unit in its answer.
[0141] In practical applications, when user C deletes the "v3.2" version number three times consecutively in response to the reply "Upgrading printer firmware requires downloading the v3.2 version installation package," the system locates the error in the first sentence of the second paragraph, classifies it as a newly added position, calculates the operation density value, and creates a new node element. Simultaneously, it detects that the user subsequently adds "USB connection to computer required" in an adjacent position, obtains the latest error frequency value from the heatmap, and updates the associated edges. Then, it traverses the updated graph, finding node A with a strength of 0.9, node B with a strength of 1.2, and node C with a strength of 0.7. Through depth-first comparison, it identifies the highest strength value as 1.2. Node B is the target node; then the original text of the node "Upgrading printer firmware requires downloading version v3.2 installation package" is retrieved, and the associated edges are searched. It is found that the error frequency of "missing version number" is as high as 90%, which is higher than the 80% of "missing connection method". The core error feature is determined to be "omitted version parameter"; finally, the original text is copied, and the version number is deleted according to the core feature, and it is changed to "Upgrading printer firmware requires downloading version installation package". The label is added to generate an adversarial example "[QUERY] Upgrading printer firmware requires downloading version installation package [CONTEXT] Historical Dialogue" to induce the large model to expose similar errors.
[0142] The above-mentioned 104 overall solution accurately captures the user's latest correction intentions by updating the dynamic error map and locks the core error source based on the highest intensity node; it generates targeted adversarial samples by extracting high-frequency error features, transforming ambiguous user operation behavior signals into executable optimization instructions; and finally, it combines reinforcement learning mechanisms to drive the large model to fine-tune it at the second level, thereby achieving targeted suppression of error response and continuous improvement of dialogue quality.
[0143] 105. Using a reinforcement learning mechanism, the adversarial examples are used as negative reward inputs to a large model. The response module is fine-tuned for the error type corresponding to the highest intensity value. Based on the current dialogue process, the fine-tuned response module is driven to output optimized dialogue content. At the same time, the dialogue content is fed back to the update process of the dynamic error graph, forming a closed-loop control of dialogue generation and optimization.
[0144] Optionally, step 105 may specifically include the following steps:
[0145] 1051. The adversarial examples are used as negative rewards input into the large model training environment through a reinforcement learning mechanism;
[0146] 1052. Locate the node element corresponding to the highest intensity value in the dynamic error map, extract the error type corresponding to the node element as the target error type, and modify the parameters of the response module for the target error type to reduce the probability of errors in the generated dialogue;
[0147] 1053. Based on the context of the current dialogue process, the response module with adjusted driving parameters outputs optimized dialogue content;
[0148] 1054. The dialogue content is fed back as new user correction data to the dynamic error graph update process, forming a closed-loop control for dialogue generation and optimization.
[0149] Specifically, step 1054 may include the following process: converting the dialogue content into new user correction data containing dialogue text and corresponding timestamps; inputting the new user correction data into the update process of the dynamic error graph to trigger the update operation of the strength value of the node element and the error frequency value of the edge element; regenerating adversarial examples through the updated dynamic error graph, performing reinforcement learning optimization process, and forming a continuously optimized closed-loop control.
[0150] In the above scheme, the target error type refers to the essential attribute of the most frequent error pattern identified from the dynamic error graph, including error classification features with the strongest node associations, such as basic error categories like semantic missing, logical contradiction, and actual deviation. This can be used to guide targeted optimization of the response module parameters. Dialogue content refers to the interactive text data stream generated by the intelligent customer service system, including context-related responses in the current dialogue process, including response text, generation timestamps, and user operation association markers. This can be used to trigger user operation behavior analysis and dynamic error graph updates. New user correction data refers to feedback signals driving system optimization, which can be used for iterative updates of node strength and edge error frequency in the dynamic error graph.
[0151] In this embodiment, adversarial examples are input into the large model training environment through a reinforcement learning mechanism. When the large model generates a response containing target errors in response to the example, the system detects the error features in the response and triggers a negative reward signal. This signal is input into the proximal policy optimization algorithm to calculate the policy gradient loss, specifically calculated using the following formula: in Indicates model parameters, The probability ratio between the old and new strategies. To reward the estimated advantage, The pruning threshold is typically set to 0.2; the loss value is used to adjust model parameters through backpropagation, thereby reducing the probability of generating similar erroneous responses subsequently. This process transforms the error signals implicit in user actions into quantifiable and computationally calculable model optimization drivers, achieving a precise mapping from error patterns to penalty mechanisms. For example, if an adversarial example intentionally deleting the version number, such as "[QUERY] Upgrading the printer requires downloading the version installation package," is input into a large model, and the model returns "Please download the installation package directly" without supplementing the version information, the system detects a "missing version parameter" error and triggers a negative reward of -1. After calculating the gradient loss, the tendency to generate such erroneous responses is reduced.
[0152] Next, step 1052, based on the aforementioned negative reward signal, locates the node element corresponding to the highest intensity value in the dynamic error map, and extracts the core error type associated with this node as the target error type; subsequently, in the parameter space of the response module, the generation path weights related to the target error type are precisely adjusted using gradient descent: the feature expression pattern of the error type is analyzed, and the corresponding neuron path is located in the softmax probability distribution of the model output layer; then, according to the formula... Execution parameter modification, among which Let L be the learning rate and L be the loss function, which is used when path p belongs to error type e. =1 otherwise 0, specifically by reducing the activation weight of erroneous paths and increasing the weight of correct paths; ultimately achieving targeted suppression of single error types and avoiding knowledge forgetting issues caused by global parameter adjustments. For example, for the "missing version parameter" error type corresponding to the highest intensity node in the graph, the system reduces the probability weight of the large model generating "Please download the installation package" without a version number, while increasing the probability of generating "Please download the v3.2 version installation package", enabling the model to accurately avoid this type of error in subsequent dialogues.
[0153] Then, the optimized response is generated by the response module after parameter adjustment based on the context information of the current dialogue process in step 1053: loading the dialogue context data stream; calling the response module after targeted fine-tuning in step 1052, and forcibly injecting error-proofing constraints when generating candidate responses through a self-attention mechanism; finally, performing rejection sampling verification. If the candidate response still contains the target error type, it is discarded and regenerated until the output dialogue content strictly meets the optimization requirements, ensuring that the result avoids specific errors and fits the needs of the current dialogue scenario. For example, in response to the user's question "Steps to restart router B", the fine-tuned module generates the candidate response "Please wait and try again". After the system detects the "missing time value" error, it is discarded, and a compliant response "Please wait 5 minutes and try again" is regenerated and output.
[0154] Finally, in step 1054, the optimized dialogue content and its generation timestamp are transformed into a new user correction data packet. This data packet is then input into the dynamic error graph update process, triggering the update mechanism in step 1041: recording the user's subsequent actions; if the user performs a new correction operation, recording the operation type, location, and timestamp, and calculating the new operation density value; finally, based on these behavioral data, updating the strength values of graph node elements and the error frequency values of edge elements. When the strength of any node exceeds the threshold, an adversarial example regeneration and reinforcement learning optimization loop is automatically triggered, forming a self-evolving closed loop from model output to user feedback and then to graph iteration.
[0155] In practical applications, when a user repeatedly deletes the "Type A" device model in response to the customer service reply "Firmware upgrade requires downloading the installation package," the system inputs the generated adversarial sample "[QUERY] Firmware upgrade requires downloading the installation package" into the large model. The model returns an error response "Please download the general installation package," triggering a negative reward signal of -1. The system locates the "device model missing" error type corresponding to the highest intensity node in the graph and reduces the weight of the generation path without model description through gradient descent. Combining the user's current question "How to upgrade device B" and historical context, the system drives the fine-tuning module to output an optimized reply "Please download the Type A dedicated installation package." When the user accepts the reply and stays at "Type A" for 6 seconds, the system synchronously updates the graph, reducing the intensity of the missing model node from 1.2 to 0.9. Subsequently, the user deletes the "5" in the new reply "Wait 5 minutes," triggering the creation of a new missing time parameter node and starting the next round of optimization loop.
[0156] The overall solution described above (105) transforms adversarial examples into optimization signals that the model can understand through a negative reward mechanism, accurately suppressing the target error types locked by the graph; it combines the dialogue context to output scenario-adapted optimization content, ensuring that the response is available immediately; and finally, it transforms user feedback into a driving force for graph iteration, forming a self-evolving closed loop of "error exposure - targeted correction - effect verification - strategy evolution", realizing the dynamic eradication and continuous prevention of intelligent customer service error responses, and breaking through the lag and blindness of traditional offline optimization.
[0157] The following is a complete example of steps 101-105. In the customer service system, user E submitted a similar question about "frequent disconnections of the C-type router" five times consecutively, with intervals of less than 90 seconds. The system fully collected the user's operation sequence: when the automatic reply was "Try restarting the device," the user deleted the word "restart" three times, each deletion taking 0.3 seconds. The cursor stayed on the "Detect network cable interface" section for a total of 42 seconds, and the user interrupted twice with the voice: "Specific diagnostic steps are needed!" All actions were associated with timestamps accurate to milliseconds. The first deletion occurred at 01:12:30.115, and the last voice message ended at 01:15:22.704, forming the multimodal raw dataset.
[0158] Based on this data, the system generates a dynamically corrected heatmap. The X-axis locates the dialogue text position, and the Y-axis marks the time sequence of operations. Operation density values are rendered using thermal color temperature. The operation density value at the "restart" position where the user intensively deletes is 3 times × 0.4 + cursor stay for 42 seconds × 0.05 / second = 1.2 + 2.1 = 3.3, appearing as a dark red block. Error frequency values are mapped to a transparency gradient. The transparency of the area associated with "must mention diagnostic steps after deletion and restart" is reduced to 20%, forming a spatiotemporal diagnostic scene with superimposed color temperature and transparency.
[0159] A dynamic error graph is constructed based on the corrected heatmap data. Dark red blocks with an operation density value of 3.3 are transformed into "Ambiguous Operation Suggestion" node elements with an intensity value of 3.3, and connected to the "Missing Technical Details" node via edge elements. When a user adds an operation at 01:22:17, the reply "Contact Operator" is deleted, followed by a request for the "Specific Fault Code," and the graph is updated. A new "Ambiguous Responsibility Attribution" node is created, and the node elements are calculated. Meanwhile, because the user accepted the optimization response, the original node's cursor stayed for 25 seconds × 0.05 / second = 1.25 positive feedback, and the strength decreased to 3.3 - 1.25 = 2.05.
[0160] At this point, the highest intensity node in the graph is still the node with an intensity of 2.05 corresponding to "fuzzy operation suggestion". The system extracts the features corresponding to the region with the lowest transparency of its associated edge and generates an adversarial sample "[QUERY] try" by deleting the action subject of the original text "try restart". After this sample is input into the large model, it induces a more ambiguous response "suggested operation", triggering a negative reward of -1 in reinforcement learning.
[0161] Based on the negative reward signal, targeted optimization is initiated, reducing the weight of vague verb generation by 35%. Combined with the user's question "D router packet loss rate troubleshooting", a precise reply is output: "Please log in to 192.168.1.1 to check QoS status". When the user deletes "100" from the new reply "latency threshold 100ms", this action is recorded in the correction data stream with a timestamp of 01:30:05, triggering the creation of a new "parameter quantization missing" node in the graph, and the system then shifts to numerical accuracy optimization.
[0162] Figure 3 This application provides a schematic diagram of the structure of an intelligent customer service dialogue generation and optimization system based on a large model, as shown in the embodiments of this application. Figure 3 As shown, the system includes:
[0163] The data collection module 31 is used to collect data on repeated user questions, manually rewritten data, cursor trajectory, text deletion data, and voice interruption data, and associate and record dialogue timestamps to form the original dataset;
[0164] The generation module 32 is used to calculate the operation-intensive value and error frequency value based on the original dataset to generate a corrected heatmap with time labeling, operation-intensive labeling and error frequency labeling;
[0165] The construction module 33 is used to determine the error location distribution by parsing the relationship between the correction heatmap and the dialogue context, define node elements carrying intensity values based on the operation density value of the error location distribution, define edge elements that record triggering conditions based on the error frequency value of the error location distribution, and integrate the node elements and the edge elements to construct a dynamic error graph for large model optimization.
[0166] The update module 34 is used to call the dynamic error graph, update the intensity value of the node element and the error frequency value of the edge element when a new user corrects the data, and generate adversarial samples adapted to the input of a large model based on the highest intensity value and the corresponding error frequency value of the edge element in the updated dynamic error graph.
[0167] Feedback module 35 is used to input the adversarial sample as a negative reward into the large model using a reinforcement learning mechanism, fine-tune the response module for the error type corresponding to the highest intensity value, and drive the fine-tuned response module to output optimized dialogue content based on the current dialogue process. At the same time, the dialogue content is fed back to the update process of the dynamic error map, forming a closed-loop control of dialogue generation and optimization.
[0168] Figure 3 The aforementioned intelligent customer service dialogue generation and optimization system based on a large model can perform... Figure 1 The implementation principle and technical effects of the intelligent customer service dialogue generation and optimization method based on a large model, as described in the illustrated embodiment, will not be repeated here. The specific methods by which each module and unit of the intelligent customer service dialogue generation and optimization system based on a large model in the above embodiments are described in detail in the embodiments related to this method, and will not be elaborated upon here.
[0169] In one possible design, Figure 3 The intelligent customer service dialogue generation and optimization system based on a large model, as shown in the embodiment, can be implemented as a computing device, such as... Figure 4 As shown, the computing device may include a storage component 41 and a processing component 42;
[0170] The storage component 41 stores one or more computer instructions, wherein the one or more computer instructions are invoked and executed by the processing component 42.
[0171] The processing component 42 is used for the above Figure 1 The embodiment describes a method for generating and optimizing intelligent customer service dialogues based on a large model.
[0172] The processing component 42 may include one or more processors to execute computer instructions to complete all or part of the steps in the above-described method. Alternatively, the processing component may be implemented as one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above-described method.
[0173] Storage component 41 is configured to store various types of data to support operations at the terminal. The storage component can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0174] Of course, computing devices may also include other components, such as input / output interfaces, display components, communication components, etc.
[0175] Input / output interfaces provide interfaces between processing components and peripheral interface modules, which can be output devices, input devices, etc.
[0176] The communication components are configured to facilitate wired or wireless communication between computing devices and other devices.
[0177] The computing device can be a physical device or an elastic computing host provided by a cloud computing platform. In this case, the computing device can refer to a cloud server, and the aforementioned processing components, storage components, etc., can be basic server resources rented or purchased from the cloud computing platform.
[0178] This application also provides a computer storage medium storing a computer program, which, when executed by a computer, can perform the above-described functions. Figure 1 The embodiment shown is a method for generating and optimizing intelligent customer service dialogues based on a large model.
[0179] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0180] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0181] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0182] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A method for generating and optimizing intelligent customer service dialogues based on a large model, characterized in that, include: Collect user-repeated question data, manually rewritten data, cursor trajectory data, text deletion data, and voice interruption data, and associate them with recorded dialogue timestamps to form the original dataset; Based on the original dataset, operation-intensive values and error frequency values are calculated to generate a corrected heatmap with time-stamped, operation-intensive, and error-frequency annotations. The error location distribution is determined by analyzing the relationship between the corrected heatmap and the dialogue context. Node elements carrying intensity values are defined based on the operation density value of the error location distribution. At the same time, edge elements recording trigger conditions are defined based on the error frequency value of the error location distribution. The node elements and edge elements are integrated to construct a dynamic error graph for large model optimization. The dynamic error graph is invoked, and when a new user corrects the data, the intensity value of the node element and the error frequency value of the edge element are updated. Based on the highest intensity value and the corresponding error frequency value of the edge element in the updated dynamic error graph, adversarial examples adapted to the input of the large model are generated. The adversarial examples are used as negative rewards to input into the large model using a reinforcement learning mechanism. The response module is fine-tuned for the error type corresponding to the highest intensity value. The fine-tuned response module is driven by the current dialogue process to output the optimized dialogue content. At the same time, the dialogue content is fed back to the update process of the dynamic error graph, forming a closed-loop control of dialogue generation and optimization.
2. The method according to claim 1, characterized in that, The method employs a reinforcement learning mechanism to input the adversarial examples as negative rewards into a large model, fine-tunes the response module for the error type corresponding to the highest intensity value, and drives the fine-tuned response module to output optimized dialogue content based on the current dialogue process. Simultaneously, the dialogue content is fed back into the update process of the dynamic error graph, forming a closed-loop control for dialogue generation and optimization, including: The adversarial examples are used as negative rewards input into the large model training environment through a reinforcement learning mechanism; Locate the node element corresponding to the highest intensity value in the dynamic error map, extract the error type corresponding to the node element as the target error type, and modify the parameters of the response module for the target error type to reduce the probability of errors in dialogue generation; Based on the context of the current dialogue process, the response module with adjusted driving parameters outputs optimized dialogue content; The dialogue content is fed back as new user correction data to the dynamic error graph update process, forming a closed-loop control for dialogue generation and optimization.
3. The method according to claim 2, characterized in that, The step of feeding back the dialogue content as new user correction data to the dynamic error graph update process to form a closed-loop control for dialogue generation and optimization includes: Convert the dialogue content into new user correction data that includes the dialogue text and corresponding timestamps; The newly added user correction data is input into the update process of the dynamic error graph, triggering the update operation of the strength value of the node element and the error frequency value of the edge element; Adversarial examples are regenerated using the updated dynamic error graph, and reinforcement learning is used to optimize the process, forming a continuously optimized closed-loop control.
4. The method according to claim 1, characterized in that, The process of calling the dynamic error graph involves updating the intensity values of the node elements and the error frequency values of the edge elements when new user data is added, and generating adversarial examples adapted to large model inputs based on the highest intensity value and the corresponding error frequency value of the edge element in the updated dynamic error graph, including: When the dynamic error graph is invoked, and a new user corrects the data, the operation density value of the newly added error location is used as the strength value of the new node element, the latest operation density value of the existing error location is used as the strength value of the corresponding node element, and the latest error frequency value of the adjacent location is used as the trigger condition value of the edge element. Traverse all node elements in the updated dynamic error graph and locate the node element corresponding to the highest intensity value as the target node. Extract the original dialogue text corresponding to the error position of the target node, and at the same time obtain the maximum value of the error frequency value in the edge elements associated with the target node, and take the error type corresponding to the maximum value as the core error feature; Modify the original dialogue text and inject the core error features to generate adversarial examples that contain similar errors and are adapted to the input format of large models.
5. The method according to claim 1, characterized in that, The process involves determining the error location distribution by analyzing the correlation between the corrected heatmap and the dialogue context, defining node elements carrying intensity values based on the operation density values of the error location distribution, and defining edge elements recording trigger conditions based on the error frequency values of the error location distribution. The process then integrates the node elements and edge elements to construct a dynamic error graph for large-scale model optimization, including: The association between the annotations of each round in the corrected heatmap and the dialogue context is analyzed. Rounds in the dialogue process where the operation density value exceeds the density threshold or the error frequency value exceeds the frequency threshold are identified as error locations. The error locations are then integrated to form an error location distribution. Node elements are created based on the operation density values of the error location distribution, and the operation density value of each error location is assigned as an intensity value to the corresponding node element. Based on the error frequency value of the error location distribution, and using the error frequency value of the previous position among adjacent error locations as the trigger condition, an edge element connecting two node elements is created. By integrating the node elements and edge elements in the order of the dialogue flow, a dynamic error graph for large model parameter optimization is constructed.
6. The method according to claim 1, characterized in that, The step of calculating operation-intensive values and error frequency values based on the original dataset to generate a corrected heatmap with time-stamped, operation-intensive, and error-frequency annotations includes: The original dataset is divided into dialogue rounds from the start of user input to the end of intelligent customer service output. The operation density value is calculated by counting the number of manual rewritings, text deletions, and total cursor movement distance in a single-turn dialogue. At the same time, the error frequency value is calculated by counting the number of repeated questions and voice interruptions in a single-turn dialogue. The start and end timestamps of each round of dialogue are used as time markers, the operation-intensive value is used as an operation-intensive marker, and the error frequency value is used as an error frequency marker. A two-dimensional grid is constructed with the time axis as the horizontal axis and the dialogue rounds as the vertical axis. The time annotations, operation density annotations, and error frequency annotations of each dialogue round are mapped to the corresponding two-dimensional grid regions to generate a corrected heatmap.
7. The method according to claim 1, characterized in that, The data collected includes user-repeated question data, manually rewritten data, cursor trajectory data, text deletion data, and voice interruption data, which are then correlated with recorded dialogue timestamps to form the original dataset, including: Monitor the dialogue interface between users and intelligent customer service, and collect data on repeated user questions, manual rewriting, cursor trajectory, text deletion, and voice interruption. Based on the user's repeated question data, the manual rewriting data, the cursor trajectory, the text deletion data, and the voice interruption data, generate independent operation units with operation type identifiers, and merge the independent operation units in timestamp order to generate the original dataset.
8. A smart customer service dialogue generation and optimization system based on a large model, characterized in that, include: The data collection module is used to collect data on repeated user questions, manually rewritten data, cursor trajectory, text deletion data, and voice interruption data, and associate them with the recorded dialogue timestamps to form the original dataset. The generation module is used to calculate the operation-intensive value and error frequency value based on the original dataset to generate a corrected heatmap with time labeling, operation-intensive labeling and error frequency labeling. The construction module is used to determine the error location distribution by parsing the correlation between the correction heatmap and the dialogue context, define node elements carrying intensity values based on the operation density value of the error location distribution, define edge elements that record triggering conditions based on the error frequency value of the error location distribution, and integrate the node elements and the edge elements to construct a dynamic error graph for large model optimization. The update module is used to call the dynamic error graph, update the intensity value of the node element and the error frequency value of the edge element when a new user corrects the data, and generate adversarial samples adapted to the input of a large model based on the highest intensity value and the corresponding error frequency value of the edge element in the updated dynamic error graph. The feedback module is used to input the adversarial examples as negative rewards into the large model using a reinforcement learning mechanism, fine-tune the response module for the error type corresponding to the highest intensity value, and drive the fine-tuned response module to output optimized dialogue content based on the current dialogue process. At the same time, the dialogue content is fed back to the update process of the dynamic error map, forming a closed-loop control of dialogue generation and optimization.
9. A computing device, characterized in that, It includes a processing component and a storage component; the storage component stores one or more computer instructions; the one or more computer instructions are invoked and executed by the processing component to implement the intelligent customer service dialogue generation and optimization method based on a large model as described in any one of claims 1 to 7.
10. A computer storage medium, characterized in that, The system contains a computer program that, when executed by a computer, implements a method for generating and optimizing intelligent customer service dialogues based on a large model, as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Knowledge graph construction and improvement system and method based on natural language
CN116737967A
Intelligent visual management method and system for enterprise big data
CN120144416A