US-20260127389-A1 - RESPONSE GENERATION DEVICE AND METHOD
Abstract
A response generation device and method are provided. The device stores a language model and a response verification model. Based on a user conversation and the language model, the device generates a first response corresponding to the user conversation. The device determines whether the first response corresponds to a verification failed state based on the user conversation, verification indicators, and the response verification model. In response to determining that the first response corresponds to the verification failed state, the device generates a second response corresponding to the user conversation.
Inventors
- Chen-Han Tsai
- Yu-Shao PENG
Assignees
- HTC CORPORATION
Dates
- Publication Date
- 20260507
- Application Date
- 20251107
Claims (20)
- 1 . A response generation device, comprising: a storage, storing a language model and a response verification model; a transceiver interface; and a processor, being electrically connected to the storage and the transceiver interface, and being configured to perform operations comprising: generating, based on a user conversation and the language model, a first response corresponding to the user conversation; determining whether the first response corresponds to a verification failed state based on the user conversation, a plurality of verification indicators, and the response verification model; and in response to determining that the first response corresponds to the verification failed state, generating a second response corresponding to the user conversation.
- 2 . The response generation device of claim 1 , wherein the processor further performs the following operations: determining, through the response verification model, a verification result of each of the plurality of verification indicators corresponding to the first response; and in response to at least one of the verification results being determined to be a failed state, determining that the first response corresponds to the verification failed state.
- 3 . The response generation device of claim 1 , wherein the second response is generated based on the following operations: generating the second response corresponding to the user conversation based on the user conversation and the language model, wherein the second response is different from the first response.
- 4 . The response generation device of claim 2 , wherein the second response is generated based on the following operations: in response to determining that the first response corresponds to the verification failed state, generating a feedback corresponding to the first response by the response verification model based on the verification result of each of the verification indicators, wherein the feedback is used to indicate at least one of the verification indicators that is determined to be in the failed state; and generating the second response corresponding to the user conversation based on the user conversation, the feedback, and the language model.
- 5 . The response generation device of claim 2 , wherein the storage 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 verification failed state, generating a feedback corresponding to the first response based on the verification result of each of the verification indicators by the response verification model, wherein the feedback is used to indicate at least one of the verification indicators that is determined to be in the failed state; and generating the second response corresponding to the user conversation based on the first response, the feedback, and the response modification model.
- 6 . The response generation device of claim 1 , wherein the processor further performs the following operations: determining whether the second response corresponds to the verification failed state based on the user conversation, the verification indicators, and the response verification model; and in response to determining that the second response corresponds to the verification failed state, generating a third response corresponding to the user conversation, wherein the third response is different from the second response.
- 7 . The response generation device of claim 1 , wherein the processor further performs the following operations: determining whether the second response corresponds to the verification failed state based on the user conversation, the verification indicators, and the response verification model; and in response to determining that the second response does not correspond to the verification failed state, setting the second response as a target response corresponding to the user conversation.
- 8 . The response generation device of claim 7 , wherein the transceiver interface is communicatively connected to a user device, and the user conversation is transmitted from the user device, and the processor further performs the following operations: transmitting the target response corresponding to the user conversation to the user device to make the user device play the target response.
- 9 . The response generation device of claim 1 , wherein the storage further stores a verification indicator comparison table, the verification indicator comparison table comprises the verification indicators and a rubric corresponding to each of the verification indicators, and the operation of determining whether the first response corresponds to the verification failed state further comprises the following operations: determining whether the first response corresponds to the verification failed state based on the user conversation, the verification indicator comparison table, and the response verification model.
- 10 . The response generation device of claim 1 , wherein the storage further stores a verification indicator comparison table, the verification indicator comparison table comprises the verification indicators and a rubric corresponding to each of the verification indicators, and the processor further performs the following operations: generating, based on a text description, a new verification indicator comparison table and a new rubric corresponding to each of a plurality of new verification indicators to update the verification indicator comparison table; and determining whether the first response corresponds to the verification failed state based on the new verification indicator comparison table and the response verification model.
- 11 . A response generation method, being adapted for use in an electronic device, wherein the electronic device stores a language model and a response verification model, and the response generation method comprises the following steps: generating, based on a user conversation and the language model, a first response corresponding to the user conversation; determining whether the first response corresponds to a verification failed state based on the user conversation, a plurality of verification indicators, and the response verification model; and in response to determining that the first response corresponds to the verification failed state, generating a second response corresponding to the user conversation.
- 12 . The response generation method of claim 11 , wherein the response generation method further comprises the following steps: determining, through the response verification model, a verification result of each of the plurality of verification indicators corresponding to the first response; and in response to at least one of the verification results being determined to be a failed state, determining that the first response corresponds to the verification failed state.
- 13 . The response generation method of claim 11 , wherein the second response is generated based on the following steps: generating the second response corresponding to the user conversation based on the user conversation and the language model, wherein the second response is different from the first response.
- 14 . The response generation method of claim 12 , wherein the second response is generated based on the following steps: in response to determining that the first response corresponds to the verification failed state, generating a feedback corresponding to the first response by the response verification model based on the verification result of each of the verification indicators, wherein the feedback is used to indicate at least one of the verification indicators that is determined to be in the failed state; and generating a second response corresponding to the user conversation based on the user conversation, the feedback, and the language model.
- 15 . The response generation method of claim 12 , wherein 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 verification failed state, generating a feedback corresponding to the first response based on the verification result of each of the verification indicators by the response verification model, wherein the feedback is used to indicate at least one of the verification indicators that is determined to be in the failed state; and generating the second response corresponding to the user conversation based on the first response, the feedback, and the response modification model.
- 16 . The response generation method of claim 11 , wherein the response generation method further comprises the following steps: determining whether the second response corresponds to the verification failed state based on the user conversation, the verification indicators, and the response verification model; and in response to determining that the second response corresponds to the verification failed state, generating a third response corresponding to the user conversation, wherein the third response is different from the second response.
- 17 . The response generation method of claim 11 , wherein the response generation method further comprises the following steps: determining whether the second response corresponds to the verification failed state based on the user conversation, the verification indicators, and the response verification model; and in response to determining that the second response does not correspond to the verification failed state, setting the second response as a target response corresponding to the user conversation.
- 18 . The response generation method of claim 17 , wherein the electronic device is communicatively connected to a user device, and the user conversation is transmitted from the user device, and the response generation method further comprises the following steps: transmitting the target response corresponding to the user conversation to the user device to make the user device play the target response.
- 19 . The response generation method of claim 11 , wherein the electronic device further stores a verification indicator comparison table, the verification indicator comparison table comprises the verification indicators and a rubric corresponding to each of the verification indicators, and the step of determining whether the first response corresponds to the verification failed state further comprises the following steps: determining whether the first response corresponds to the verification failed state based on the user conversation, the verification indicator comparison table, and the response verification model.
- 20 . The response generation method of claim 11 , wherein the electronic device further stores a verification indicator comparison table, the verification indicator comparison table comprises the verification indicators and a rubric corresponding to each of the verification indicators, and the response generation method further comprises the following steps: generating, based on a text description, a new verification indicator comparison table and a new rubric corresponding to each of a plurality of new verification indicators to update the verification indicator comparison table; and determining whether the first response corresponds to the verification failed state based on the new verification indicator comparison table and the response verification model.
Description
CROSS-REFERENCE TO RELATED APPLICATION This application claims priority to U.S. Provisional Application Ser. No. 63/717,825, filed Nov. 7, 2024, which is herein incorporated by reference in its entirety. BACKGROUND Field of Invention The present disclosure relates to a response generation device and method. More particularly, the present disclosure relates to a response generation device and method that can actively verify whether the response generated by a language model is appropriate. Description of Related Art With the recent rise of artificial intelligence and its related applications, users can interact with chatbots and obtain a variety of information responses from them. However, modern language model-based chatbots may misunderstand the user's intentions for various reasons, mistakenly generating inappropriate responses that fail to meet the user's needs. In such cases, poor responses can lead to user dissatisfaction with the language model chatbot. In the existing technology, chatbots trained based on language models can take preventive measures during development (for example, safely adjusting unsafe inputs during supervised fine-tuning (SFT) and using reinforcement learning from human feedback (RLHF) for safe training) to ensure the safety of the chatbot's responses. However, these preventative measures only ensure the rationality of responses during the first-level training phase, but fail to provide the second-level verification during operation to ensure that the chatbot's responses are accurate. Therefore, such language model-based chatbots are still prone to making inappropriate responses to user input (e.g., Large Language Model jailbreaking). Accordingly, there is an urgent need for a response generation technology that can actively verify whether the response generated by the language model is appropriate. SUMMARY An objective of the present disclosure is to provide a response generation device. The response generation device comprises a storage, a transceiver interface, and a processor. The processor is electrically connected to the storage and the transceiver interface. The storage stores a language model and a response verification model. The processor generates, based on a user conversation and the language model, a first response corresponding to the user conversation. The processor determines whether the first response corresponds to a verification failed state based on the user conversation, a plurality of verification indicators, and the response verification model. In response to determining that the first response corresponds to the verification failed state, the processor generates a second response corresponding to the user conversation. Another objective of the present disclosure is to provide a response generation method, which is adapted for use in an electronic device. The electronic device stores a language model and a response verification model. The response generation method comprises the following steps: generating, based on a user conversation and the language model, a first response corresponding to the user conversation; determining whether the first response corresponds to a verification failed state based on the user conversation, a plurality of verification indicators, and the response verification model; and in response to determining that the first response corresponds to the verification failed state, generating a second response corresponding to the user conversation. According to the above descriptions, the response generation technology provided by the present disclosure (at least including the device and the method) can actively determine whether the response generated by the model has passed verification based on a plurality of verification indicators. Then, in response to determining that the response has not passed verification, the response generation technology provided by the present disclosure generates a new response or modifies the previous response. Finally, the response generation technology provided by the present disclosure can provide the response to the user only after confirming that the generated response meets the verification indicators. Since the response generation technology provided by the present disclosure actively provides a mechanism for verifying the response and modifies the response through different response generation mechanisms, it can ensure the security of the response ultimately provided to the user, solve the problems of the existing technology, and enhance the user's conversation experience. The detailed technology and preferred embodiments implemented for the subject invention are described in the following paragraphs accompanying the appended drawings for people skilled in this field to well appreciate the features of the claimed invention. BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a schematic view depicting a response generation device of some embodiments; FIG. 2 is a schematic view depicting a response generat