Response generation device and method
By introducing a response verification model into the chatbot, the response of the language model is actively verified and modified, ensuring the security and accuracy of the response, solving the problem of inappropriate responses from the chatbot, and improving the user's conversational experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HTC CORP
- Filing Date
- 2025-11-07
- Publication Date
- 2026-05-08
AI Technical Summary
Existing language model-based chatbots are prone to making inappropriate responses when users input certain content. Existing preventive measures cannot ensure the accuracy of responses during operation, resulting in a poor user experience.
By introducing a response verification model into the chatbot, responses generated by the language model are actively verified based on multiple verification metrics to determine whether they pass verification. If they fail, different mechanisms are used to generate or modify the response to ensure the security and accuracy of the response.
This ensures the security and quality of the final response provided to the user, improves the user's conversational experience, and solves the problem of inappropriate responses from chatbots.
Smart Images

Figure CN121996747A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to a response generation apparatus and method. Specifically, this disclosure relates to a response generation apparatus and method capable of actively verifying whether the response generated by a language model is appropriate. Background Technology
[0002] With the rise of artificial intelligence and related applications in recent years, users can interact with chatbots to obtain various information responses.
[0003] However, modern language model-based chatbots may misunderstand the user's intent for various reasons, generating inappropriate responses that fail to meet the user's needs. In such cases, poor responses will lead to user dissatisfaction with the language model chatbot.
[0004] In existing technologies, chatbots trained based on language models can employ preventative measures during development (e.g., safe adjustments to unsafe inputs during supervised fine-tuning (SFT) and safe training using reinforcement learning from human feedback (RLHF)) to ensure the safety of the chatbot's responses.
[0005] However, these preventative measures can only ensure the reasonableness of responses during the first-layer training phase, and cannot provide a second-layer verification during operation to ensure the accuracy of the chatbot's responses. Therefore, such language model-based chatbots are still prone to making inappropriate responses when users input certain content (e.g., LLM jailbreaking).
[0006] In view of this, how to provide a response generation technology that can actively verify whether the response generated by the language model is appropriate is a goal that the industry urgently needs to strive for. Summary of the Invention
[0007] One object of this disclosure is to provide a response generation apparatus. The response generation apparatus includes a memory, a transceiver interface, and a processor electrically connected to the memory and the transceiver interface. The memory stores a language model and a response verification model. The processor generates a first response corresponding to a user dialogue based on a user dialogue and the language model. The processor determines whether the first response corresponds to a failed verification state based on the user dialogue, multiple verification indicators, and the response verification model. In response to determining that the first response corresponds to the failed verification state, the processor generates a second response corresponding to the user dialogue.
[0008] In one embodiment of this disclosure, the processor further performs the following operations: determining, through the response verification model, that the first response corresponds to a verification result of each of the plurality of verification metrics; and in response to at least one of the plurality of verification results being determined to be a failed state, determining that the first response corresponds to the failed verification state.
[0009] In one embodiment of this disclosure, the second response is generated based on the following operation: generating a second response corresponding to the user dialogue based on the user dialogue and the language model, wherein the second response is different from the first response.
[0010] In one embodiment of this disclosure, the second response is generated based on the following operations: in response to determining that the first response corresponds to the failed verification state, the response verification model generates a feedback corresponding to the first response based on the verification results of the plurality of verification indicators, wherein the feedback is used to indicate at least one of the plurality of verification indicators that were determined to be in the failed state; and the second response corresponding to the user dialogue is generated based on the user dialogue, the feedback and the language model.
[0011] In one embodiment of this disclosure, the memory further stores a response modification model, and the second response is generated based on the following operations: in response to determining that the first response corresponds to the failed verification state, the response verification model generates a feedback corresponding to the first response based on the verification results of the plurality of verification indicators, wherein the feedback is used to indicate at least one of the plurality of verification indicators that were determined to be in the failed state; and based on the first response, the feedback and the response modification model, the second response corresponding to the user dialogue is generated.
[0012] In one embodiment of this disclosure, the processor further performs the following operations: determining, based on the user dialogue, the plurality of verification metrics and the response verification model, whether the second response corresponds to the failed verification state; and in response to determining that the second response corresponds to the failed verification state, generating a third response corresponding to the user dialogue, wherein the third response is different from the second response.
[0013] In one embodiment of this disclosure, the processor further performs the following operations: determining whether the second response corresponds to the failed verification state based on the user dialogue, the plurality of verification metrics and the response verification model; and in response to determining that the second response does not correspond to the failed verification state, setting the second response as a target response corresponding to the user dialogue.
[0014] In one embodiment of this disclosure, the memory further stores a verification index comparison table, which includes the plurality of verification indices and a scoring standard corresponding to each of the plurality of verification indices. The determination of whether the first response corresponds to the failed verification state further includes the following operation: based on the user dialogue, the verification index comparison table and the response verification model, determining whether the first response corresponds to the failed verification state.
[0015] In one embodiment of this disclosure, the memory further stores a verification index comparison table, which includes the plurality of verification indices and a scoring standard corresponding to each of the plurality of verification indices. The processor further performs the following operations: generating a new verification index comparison table and a new scoring standard corresponding to each of the plurality of new verification indices based on a text description, so as to update the verification index comparison table; and determining whether the first response corresponds to the failed verification state based on the new verification index comparison table and the response verification model.
[0016] Another object of this disclosure is to provide a response generation method for an electronic device that stores a language model and a response verification model. The response generation method includes the following steps: generating a first response corresponding to a user dialogue based on a user dialogue and the language model; determining whether the first response corresponds to a failed verification state based on the user dialogue, multiple verification indicators, and the response verification model; and generating a second response corresponding to the user dialogue in response to determining that the first response corresponds to the failed verification state.
[0017] The response generation technology (including at least an apparatus and method) disclosed herein can proactively determine whether a response generated by a model passes verification based on multiple verification metrics. Then, in response to a determination that a response has failed verification, the response generation technology can either generate a new response or modify the previous response. Finally, the response generation technology can provide the response to the user only after confirming that the generated response meets the multiple verification metrics. Because the response generation technology disclosed herein proactively provides a mechanism for verifying responses and modifies responses through different response generation mechanisms, it can ensure the security of the final response provided to the user, solve the problems of existing technologies, and improve the user's dialogue experience.
[0018] The following detailed description of the technology and implementation methods of this disclosure, in conjunction with the accompanying drawings, enables those skilled in the art to understand the technical features of the claimed invention. Attached Figure Description
[0019] Figure 1 A schematic diagram of the architecture of a response generation apparatus according to certain embodiments is shown; Figure 2 A schematic diagram of the architecture of a response generation apparatus according to certain embodiments is shown; Figure 3 A schematic diagram of the architecture of a response generation apparatus according to certain embodiments is shown; Figure 4 A schematic diagram illustrating the verification operation of some implementation methods is shown; Figure 5 A schematic diagram illustrating the verification operation of some implementation methods is shown; Figure 6 A schematic diagram illustrating verification operations for some embodiments is shown; and Figure 7 A partial flowchart of the response generation method according to the second embodiment is shown.
[0020] Symbol explanation: 1: Response generating device 11: Memory 13: Send / Receive Interface 15: Processor LM: Language Model RVM: Response Validation Model RMM: Response to Modification Model VICT: Verification Metrics Comparison Table 400: Operation Diagram RE1: First Response UC: User Dialogue RE2: Second Response PI: Prompt Command TR: Target Response 500: Operation Diagram FB: Feedback 600: Operation Diagram MRE1: Modify Response 700: Response Generation Method S701, S703, S705: Steps Detailed Implementation
[0021] The following description, through embodiments, explains the response generation apparatus and method provided in this disclosure. However, these embodiments are not intended to limit the implementation of this disclosure to any environment, application, or manner described herein. Therefore, the description of the embodiments is for illustrative purposes only and is not intended to limit the scope of this disclosure. It should be understood that in the following embodiments and drawings, elements not directly related to this disclosure have been omitted and are not shown, and the dimensions of each element and the dimensional proportions between elements are merely illustrative and not intended to limit the scope of this disclosure.
[0022] Let me first briefly explain the problem that this disclosure aims to solve. In the operation of language model-based chatbots, if there is no verification system to supervise the responses, inappropriate responses may be provided to users, failing to solve their problems and resulting in a poor service experience.
[0023] For example, when a user tells a chatbot, "I'm ready to end my life…", a chatbot lacking a mechanism to verify the content of the response might directly generate an inappropriate response like, "Do you know what the meaning of life is?" In such cases, the chatbot's answer fails to provide a sympathetic response and does not solve the user's problem.
[0024] The response generation mechanism disclosed in this disclosure can proactively verify the content of the response before providing the final version to the user, and modify the response through different mechanisms to ensure that a safe and high-quality response is generated, thus solving the aforementioned problem of generating inappropriate responses.
[0025] First, let me briefly explain the application scenarios of this disclosure. This disclosure allows the response generation device and method to be set up / executed in an external system (e.g., a cloud server) or integrated into a user device (e.g., a computer or mobile phone). This disclosure can determine whether the generated response is suitable for replying to the current conversation with the user based on various verification operations.
[0026] Furthermore, in subsequent applications, the response generation apparatus / method of this disclosure can output the generated response to the user device (e.g., chatbot window) in a suitable form to respond to the conversation with the user, thereby enhancing the user's conversation experience with the chatbot.
[0027] The first embodiment of this disclosure is a response generating device 1, the schematic diagram of which is shown in [illustration]. Figure 1 In this embodiment, the response generating apparatus 1 includes a memory 11, a transceiver interface 13, and a processor 15, the processor 15 being electrically connected to the memory 11 and the transceiver interface 13. In some embodiments, the transceiver interface 13 may be communicatively connected to a user device (e.g., a user-operated computer).
[0028] It should be noted that the memory 11 may be a storage unit, a Universal Serial Bus (USB) disk, a hard disk, an optical disk, a USB flash drive, or any other storage medium or circuit known to those skilled in the art to which this disclosure pertains and having the same function. The transceiver interface 13 is an interface capable of receiving and transmitting data, or other interfaces capable of receiving and transmitting data known to those skilled in the art to which this disclosure pertains. The transceiver interface 13 can receive data from sources such as external devices, external web pages, external applications, etc. The processor 15 may be various processing units, a central processing unit (CPU), a microprocessor, or other computing devices known to those skilled in the art to which this disclosure pertains.
[0029] In this embodiment, as Figure 1 As shown, memory 11 can store the language model LM and the response verification model RVM. Specifically, the language model LM is a large language model that has been trained. The language model LM can be used to generate responses corresponding to the user's input based on the dialogue and prompts.
[0030] In addition, the Response Verification Model (RVM) can be used to determine whether the responses generated by the Language Model (LM) are appropriate for the user's dialogue based on multiple pre-defined verification metrics.
[0031] In some implementations, the Response Verification Model (RVM) can also be implemented using a large, trained language model and user prompts. For example, the RVM can be trained using labeled training data (e.g., multiple historical user conversations and responses).
[0032] In some embodiments, to avoid the response generating device 1 frequently performing verification operations, thus wasting resources, the response generating device 1 may first determine the current dialogue content with the user, and when it determines that the conditions for enabling / adjusting the verification operation are met (e.g., the content / frequency of the user's dialogue corresponds to a historical abnormal behavior, etc.), perform subsequent verification operations / adjustment operation frequencies (e.g., increase the frequency of verification responses, etc.).
[0033] In some embodiments, the response generating device 1 can operate by setting different response modification / response generation methods according to different needs of the environment and application.
[0034] For clarity, the term "user dialogue" as used below may, in some cases, refer to dialogue conducted by the user through their user device or response generation device 1 (e.g., the user inputting a response on their user device to transmit to the chatbot / response generation device 1). Furthermore, the response generation device 1 may record historical dialogues with the user (e.g., the content of previous dialogues) and, during operation, refer to the context of the dialogue content or the dialogue status with the user.
[0035] First, in this embodiment, the response generating device 1 can directly receive user dialogue (e.g., the user directly inputs dialogue on the response generating device 1) or receive user dialogue from an external user device.
[0036] In some implementations, the user dialogue includes a current dialogue corresponding to a user and multiple historical dialogues.
[0037] Next, in this embodiment, the processor 15 will generate an initial response to the user dialogue using the language model LM. Specifically, the processor 15 generates a first response corresponding to the user dialogue based on a user dialogue and the language model LM.
[0038] Next, in this embodiment, the processor 15 verifies the content of the first response using the Response Verification Model (RVM). Specifically, the processor 15 determines whether the first response corresponds to a failed verification state based on the user dialogue, multiple verification metrics, and the RVM.
[0039] In some implementations, the processor 15 may determine whether each verification metric passes or fails. If one verification metric fails the test, the processor 15 determines that the response has failed the verification. Specifically, the processor 15 uses the Response Verification Model (RVM) to determine that the first response corresponds to a verification result for each of the multiple verification metrics. Then, in response to at least one of the multiple verification results being determined to be a failed state, the processor 15 determines that the first response corresponds to that failed verification state.
[0040] It should be noted that the Response Verification Model (RVM) can better understand the context of the current response based on the history of the dialogue. For example, the RVM can be implemented using a large language model or an embedded model.
[0041] It should be noted that when evaluating responses using a large language model, the model can be trained using prompts or similar materials. For example, the input to the large language model must include the current response, and optionally, historical data. The large language model can predict each categorical item individually or simultaneously (e.g., is it repetitive? Is there a lack of empathy?). The large language model's answer is then parsed and mapped to its allowed values (defined during the scoring criteria setting).
[0042] It should be noted that when evaluating responses using an embedding model, the embedding model can be used as a classification model. For example, a fully connected layer can be appended to an existing embedding model, and the dimension of the fully connected layer must be large enough to support all possible items in the scoring criteria (e.g., rubric). Furthermore, training data (e.g., the scoring criteria) containing labeled items is provided beforehand to train the embedding model. During response evaluation, the current response is passed to the embedding model, which then makes a prediction for each item in the scoring criteria.
[0043] In some implementations, such as Figure 2 As shown, memory 11 further stores a Verification Metric Comparison Table (VICT), which includes multiple verification metrics (e.g., flag values) and a scoring criterion (Rubricant) corresponding to each of the multiple verification metrics (e.g., relevance, threshold value, etc.). Specifically, processor 15 determines whether the first response corresponds to the failed verification state based on the user dialogue, the Verification Metric Comparison Table (VICT), and the Response Verification Model (RVM).
[0044] For example, Table 1 illustrates the various validation metrics included in the validation metric comparison table VICT (e.g., the categories in Table 1 below): Table 1 In this example, the categories in the Verification Metrics Comparison Table (VICT) include four verification metrics: "Duplicate", "Contains inappropriate content", "Contains clichéd content", and "Lack of empathy".
[0045] In this example, the processor 15 determines that the content of the response lacks empathy, so it sets the "lack of empathy" judgment value to yes, and determines that the first response corresponds to the failed verification state.
[0046] In some implementations, the processor 15 can directly generate and update a new verification metric comparison table based on a textual description (e.g., a user's prompt). Specifically, the processor 15 generates a new verification metric comparison table and a new scoring standard for each of the multiple new verification metrics based on a textual description, thereby updating the verification metric comparison table VICT. Then, the processor 15 determines, based on the new verification metric comparison table and the response verification model (RVM), whether the first response corresponds to the failed verification state.
[0047] It should be noted that the scoring criteria definition can be generated automatically by processor 15 (e.g., using a large language model) or defined by professionals. Furthermore, after defining the scoring criteria, processor 15 can apply an evaluation function to the values in the scoring criteria to determine whether the answer is pass or fail.
[0048] In some implementations, the numerical values in the scoring criteria can be numbers, categories, or Bollinger values.
[0049] Specifically, processor 15 can analyze textual descriptions using a rating scale converter (e.g., a D2R converter) to generate tables corresponding to the descriptions. Furthermore, processor 15 can consider using learned evaluation functions, with the language model suggesting a function that maps the content of the rating scales to "pass" or "fail" samples based on the given description, and the definition of the evaluation function should consider all possible combinations of values for the rating scales.
[0050] For example, one possible way to implement the learning evaluation function is to use classifiers such as XGBoost or CatBoost. These learning functions utilize training data that associates a "pass" or "fail" label with each sample. Furthermore, the processor 15 can optimize over all training samples to implement an evaluation function that takes a scoring criterion as input and outputs a "pass" or "fail" classification result. Historical feedback in the training data can be generated by existing experts (e.g., psychologists) to train a response validation model (RVM) based on the training data. In some implementations, sensitive data from historical conversations can be hidden by anonymizing personal information.
[0051] In some implementations, the response generating device 1 may determine whether a response is "passed" or "failed" before verifying any response. For example, the processor 15 may define criteria such as verification metric weights, pass / fail standards (e.g., all or some verification metrics), etc.
[0052] Next, in this embodiment, the processor 15, in response to determining that the first response corresponds to the failed verification state, generates a second response corresponding to the user's dialogue.
[0053] In some implementations, once verification is successful (i.e., all verification metrics pass), the current response can be set as the target response and the user is notified. Specifically, the processor 15 determines, based on the user dialogue, the multiple verification metrics, and the Response Verification Model (RVM), whether the second response corresponds to the failed verification state. Then, in response to determining that the second response does not correspond to the failed verification state, the processor 15 sets the second response as a target response corresponding to the user dialogue.
[0054] In some embodiments, transceiver interface 13 is communicatively connected to a user device, from which the user dialogue is transmitted and from which the target response is output. Specifically, processor 15 transmits the target response corresponding to the user dialogue to the user device, so that the user device plays the target response.
[0055] In some implementations, different domain-specific Response Verification Models (RVMs) can be used for different target domains to improve verification accuracy. Specifically, the processor 15 can determine the user dialogue to select the appropriate domain-specific Response Verification Model (RVM).
[0056] It should be noted that, in this disclosure, the second response may be generated by a variety of different mechanisms, and the following paragraphs will describe in detail the specific implementation details of the different mechanisms.
[0057] In some implementations, the chatbot can again generate a response directly from the language model LM. Specifically, the processor 15 generates a second response corresponding to the user's dialogue based on the user dialogue and the language model LM, wherein the second response is different from the first response.
[0058] For example, please refer to Figure 4 The operation diagram 400 illustrates this. In this example, the Language Model (LM) transmits the first response RE1 and the user dialogue UC to the Response Verification Model (RVM). Next, after determining that the first response RE1 corresponds to the failed verification state, the RVM generates a prompt instruction PI to the Language Model (LM), causing the LM to directly regenerate the second response RE2. Finally, after determining that the second response RE2 corresponds to the successful verification state, the RVM sets the second response RE2 as the target response TR corresponding to the user dialogue UC and provides it to the user.
[0059] In some implementations, the chatbot can adjust its responses based on feedback from the Response Verification Model (RVM). Specifically, in response to determining that the first response corresponds to the failed verification state, the processor 15 generates feedback corresponding to the first response based on the verification results of the plurality of verification metrics, wherein the feedback indicates at least one of the plurality of verification metrics that was determined to be in the failed state. Then, the processor 15 generates the second response corresponding to the user dialogue based on the user dialogue, the feedback, and the Language Model (LM).
[0060] For example, please refer to Figure 5 The operation diagram 500 illustrates this. In this example, the Language Model (LM) transmits the first response RE1 and the user dialogue UC to the Response Verification Model (RVM). Next, after determining that the first response RE1 corresponds to the failed verification state, the RVM generates a feedback FB to the Language Model (LM), enabling the LM to regenerate a second response RE2 based on the feedback FB. Finally, after determining that the second response RE2 corresponds to the successful verification state, the RVM sets the second response RE2 as the target response TR corresponding to the user dialogue UC and provides it to the user.
[0061] It should be noted that feedback on Facebook can include information or hints for adjusting the answer (e.g., the reason for failure, verification criteria, etc.). The purpose of feedback on Facebook is to provide feedback information during the response revision phase. Feedback on Facebook can be achieved by simply providing the evaluation criteria and the result (i.e., pass or fail) in text form.
[0062] In some implementations, processor 15 may adapt the content using a different model rather than regenerating the response. For example... Figure 3 As shown, memory 11 further stores a Response Modification Model (RMM), and processor 15 adjusts the response using the RMM. Specifically, in response to determining that the first response corresponds to the failed verification state, processor 15 generates feedback corresponding to the first response based on the verification results of the plurality of verification metrics, wherein the feedback is used to indicate at least one of the plurality of verification metrics that was determined to be in the failed state. Then, processor 15 generates a second response corresponding to the user dialogue based on the first response, the feedback, and the RMM.
[0063] For example, please refer to Figure 6The operation diagram 600 illustrates this. In this example, the Language Model (LM) transmits the first response RE1 and the user dialogue UC to the Response Verification Model (RVM). Next, after determining that the first response RE1 corresponds to the failed verification state, the Response Verification Model (RVM) generates a feedback FB to the Response Modification Model (RMM). Then, the Response Modification Model (RMM) modifies the first response RE1 based on the feedback FB, generating a modified response MRE1 (i.e., the second response referred to in some implementations). Finally, after determining that the modified response MRE1 corresponds to the passed verification state, the Response Verification Model (RVM) sets the modified response MRE1 as the target response TR corresponding to the user dialogue UC and provides it to the user.
[0064] In some implementations, the Response Modification Model (RMM) can be generated by training another large language model based on historical training data (e.g., multiple historical user dialogues and responses).
[0065] In some implementations, the processor 15 can verify the second response, and if the second response fails verification, it can continue to generate a third response based on any of the aforementioned operations. Specifically, the processor 15 determines whether the second response corresponds to the failed verification state based on the user dialogue, the plurality of verification metrics, and the Response Verification Model (RVM). Then, in response to determining that the second response corresponds to the failed verification state, the processor 15 generates a third response corresponding to the user dialogue, wherein the third response is different from the second response.
[0066] In some implementations, the processor 15 may recursively perform the aforementioned feedback and modification operations multiple times until all indicators meet the requirements or the stopping condition is met. Alternatively, the processor 15 may modify one verification indicator at a time, repeating the process until all verification indicators meet the requirements.
[0067] For example, processor 15 can repeatedly verify the response based on the aforementioned operations until all verification metrics are met. As another example, processor 15 can also set a verification count limit to restrict the number of executions.
[0068] In some implementations, the processor 15 may employ different response generation methods depending on the application scenario to avoid response time delays. For example, in a more static scenario, the processor 15 may generate a response by regenerating it. In a more dynamic scenario, the processor 15 may improve the response rate by modifying the response method.
[0069] In some embodiments, the dialogue information between the response generating device 1 and the user can be presented to the user in real time through multiple display contents on the display interface of the response generating device 1.
[0070] As described above, the response generation device 1 provided in this disclosure can proactively determine whether the response generated by the model passes verification based on multiple verification indicators. Then, in response to the determination that the response has failed verification, the response generation device 1 performs the operation of generating a new response or modifying the previous response. Finally, the response generation device 1 can only provide the response to the user after confirming that the generated response meets the multiple verification indicators. Because the response generation device 1 provided in this disclosure proactively provides a mechanism for verifying responses and modifies responses through different response generation mechanisms, it can ensure the security of the final response provided to the user, solve the problems of the prior art, and improve the user's dialogue experience.
[0071] The second embodiment of this disclosure is a response generation method, the flowchart of which is shown in [the original text]. Figure 7 The response generation method 700 is applicable to an electronic device, such as the response generation device 1 described in the first embodiment. The electronic device stores a language model and a response verification model. The response generation method 700 verifies and generates a suitable response corresponding to the user's dialogue through steps S701 to S705.
[0072] First, in step S701, the electronic device generates a first response corresponding to the user dialogue based on a user dialogue and the language model.
[0073] Subsequently, in step S703, the electronic device determines whether the first response corresponds to a failed verification state based on the user dialogue, multiple verification indicators, and the response verification model.
[0074] Finally, in step S705, the electronic device, in response to determining that the first response corresponds to the failed verification state, generates a second response corresponding to the user's dialogue.
[0075] In some embodiments, the response generation method 700 further includes the following steps: determining, through the response verification model, that the first response corresponds to a verification result of each of the plurality of verification indicators; and in response to at least one of the plurality of verification results being determined to be a failure state, determining that the first response corresponds to the failure verification state.
[0076] In some implementations, the second response is generated based on the following steps: generating a second response corresponding to the user dialogue based on the user dialogue and the language model, wherein the second response is different from the first response.
[0077] In some implementations, the second response is generated based on the following steps: in response to determining that the first response corresponds to the failed verification state, the response verification model generates a feedback corresponding to the first response based on the verification results of the plurality of verification indicators, wherein the feedback is used to indicate at least one of the plurality of verification indicators that were determined to be in the failed state; and the second response corresponding to the user dialogue is generated based on the user dialogue, the feedback, and the language model.
[0078] In some embodiments, the electronic device further stores a response modification model, and the second response is generated based on the following steps: in response to determining that the first response corresponds to the failed verification state, the response verification model generates a feedback corresponding to the first response based on the verification results of the plurality of verification indicators, wherein the feedback is used to indicate at least one of the plurality of verification indicators that were determined to be in the failed state; and based on the first response, the feedback and the response modification model, the second response corresponding to the user dialogue is generated.
[0079] In some embodiments, the response generation method 700 further includes the following steps: determining whether the second response corresponds to the failed verification state based on the user dialogue, the plurality of verification metrics and the response verification model; and in response to determining that the second response corresponds to the failed verification state, generating a third response corresponding to the user dialogue, wherein the third response is different from the second response.
[0080] In some embodiments, the response generation method 700 further includes the following steps: determining whether the second response corresponds to the failed verification state based on the user dialogue, the plurality of verification metrics and the response verification model; and in response to determining that the second response does not correspond to the failed verification state, setting the second response as a target response corresponding to the user dialogue.
[0081] In some embodiments, wherein the electronic device is communicatively connected to a user device and the user dialogue is transmitted from the user device, the response generation method 700 further includes the step of transmitting the target response corresponding to the user dialogue to the user device, so that the user device plays the target response.
[0082] In some embodiments, the electronic device further stores a verification index comparison table, which includes the plurality of verification indicators and a scoring standard corresponding to each of the plurality of verification indicators, and determining whether the first response corresponds to the failed verification state further includes the following steps: determining whether the first response corresponds to the failed verification state based on the user dialogue, the verification index comparison table and the response verification model.
[0083] In some embodiments, the electronic device further stores a verification index comparison table, which includes the plurality of verification indices and a scoring standard corresponding to each of the plurality of verification indices, and the response generation method further includes the following steps: generating a new verification index comparison table and a new scoring standard corresponding to each of the plurality of new verification indices based on a text description, so as to update the verification index comparison table; and determining whether the first response corresponds to the failed verification state based on the new verification index comparison table and the response verification model.
[0084] In addition to the steps described above, the second embodiment can also perform all the operations and steps of the response generating device 1 described in the first embodiment, have the same function, and achieve the same technical effect. Those skilled in the art to which this disclosure pertains can directly understand how the second embodiment performs these operations and steps based on the first embodiment described above, has the same function, and achieves the same technical effect, so it will not be described in detail here.
[0085] It should be noted that in this patent specification and claims, certain terms (including "response") are preceded by "first," "second," or "third," and these multiple "first," "second," or "third" are only used to distinguish different terms. For example, "first" and "second" in "first response" and "second response" are only used to indicate different responses.
[0086] In summary, the response generation technology (including at least the apparatus and method) provided in this disclosure can proactively determine whether a response generated by the model passes verification based on multiple verification indicators. Then, in response to a determination that a response has failed verification, the response generation technology provides in this disclosure performs the operation of generating a new response or modifying the previous response. Finally, the response generation technology provides in this disclosure can only provide the response to the user after confirming that the generated response meets the multiple verification indicators. Because the response generation technology provided in this disclosure proactively provides a mechanism for verifying responses and modifies responses through different response generation mechanisms, it can ensure the security of the final response provided to the user, solve the problems of the prior art, and improve the user's dialogue experience.
[0087] The above embodiments are merely illustrative of some implementations of this disclosure and to explain its technical features, and are not intended to limit the scope and extent of protection of this disclosure. Any changes or equivalent arrangements that can be easily made by those skilled in the art to which this disclosure pertains are within the scope of this disclosure, and the scope of protection of this disclosure is determined by the claims.
Claims
1. A response generating device, characterized in that, Include: A memory that stores a language model and a response verification model; One transmit / receive interface; and A processor, electrically connected to the memory and the transceiver interface, is configured to perform the following operations: Based on a user dialogue and the language model, a first response corresponding to the user dialogue is generated. Based on the user dialogue, multiple verification metrics, and the response verification model, determine whether the first response corresponds to a failed verification state; as well as In response to determining that the first response corresponds to the failed verification state, a second response corresponding to the user's dialogue is generated.
2. The response generating apparatus as claimed in claim 1, characterized in that, The processor further performs the following operations: Using this response verification model, the verification result of the first response corresponding to each of the multiple verification metrics is determined; and In response to at least one of the multiple verification results being judged as a failed state, the first response is determined to correspond to the failed verification state.
3. The response generating apparatus as claimed in claim 1, characterized in that, This second response was generated based on the following operations: Based on the user dialogue and the language model, a second response corresponding to the user dialogue is generated, wherein the second response is different from the first response.
4. The response generating apparatus as claimed in claim 2, characterized in that, This second response was generated based on the following operations: In response to the determination that the first response corresponds to the failed verification state, the response verification model generates a feedback corresponding to the first response based on the verification results of the multiple verification indicators, wherein the feedback is used to indicate at least one of the multiple verification indicators that are determined to be in the failed state; as well as Based on the user dialogue, the feedback, and the language model, a second response corresponding to the user dialogue is generated.
5. The response generating apparatus as claimed in claim 2, characterized in that, The memory further stores a response modification model, and the second response is generated based on the following operations: In response to the determination that the first response corresponds to the failed verification state, the response verification model generates a feedback corresponding to the first response based on the verification results of the multiple verification indicators, wherein the feedback is used to indicate at least one of the multiple verification indicators that are determined to be in the failed state; as well as Based on the first response, the feedback, and the response modification model, a second response corresponding to the user's dialogue is generated.
6. The response generating apparatus as claimed in claim 1, characterized in that, The processor further performs the following operations: Based on the user dialogue, the multiple verification metrics, and the response verification model, determine whether the second response corresponds to the failed verification state; and In response to determining that the second response corresponds to the failed verification state, a third response corresponding to the user's dialogue is generated, wherein the third response is different from the second response.
7. The response generating apparatus as claimed in claim 1, characterized in that, The processor further performs the following operations: Based on the user dialogue, the multiple verification metrics, and the response verification model, determine whether the second response corresponds to the failed verification state; and In response to the determination that the second response does not correspond to the failed verification state, the second response is set as a target response to the user's dialogue.
8. The response generating apparatus as claimed in claim 1, characterized in that, The memory further stores a verification indicator comparison table, which includes multiple verification indicators and a scoring standard for each verification indicator. Determining whether the first response corresponds to the failed verification state further includes the following operations: Based on the user dialogue, the verification indicator comparison table, and the response verification model, determine whether the first response corresponds to the failed verification state.
9. The response generating apparatus as claimed in claim 1, characterized in that, The memory further stores a verification index comparison table, which includes the plurality of verification indices and a scoring criterion for each of the plurality of verification indices, and the processor further performs the following operations: Based on a textual description, a new verification indicator comparison table and a new scoring standard for each of the multiple new verification indicators are generated to update the verification indicator comparison table; and Based on the new verification indicator comparison table and the response verification model, it is determined whether the first response corresponds to the failed verification state.
10. A method for generating a response, characterized in that, For an electronic device, wherein the electronic device stores a language model and a response verification model, and the response generation method includes the following steps: Based on a user dialogue and the language model, a first response corresponding to the user dialogue is generated. Based on the user dialogue, multiple verification metrics, and the response verification model, determine whether the first response corresponds to a failed verification state; as well as In response to determining that the first response corresponds to the failed verification state, a second response corresponding to the user's dialogue is generated.