Prompt generating device and method

TWI937965BActive Publication Date: 2026-09-01HON HAI PRECISION INDUSTRY CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
TW114128339
Authority / Receiving Office
TW · TW
Patent Type
Patents
Current Assignee / Owner
Priority Date
2024-09-13
Filing Date
2025-07-25
Publication Date
2026-09-01
Estimated Expiration
2045-07-24

AI Technical Summary

Technical Problem

Existing technologies require manual design and evaluation of prompts for large language models, which is time-consuming and ineffective in inducing personalized responses.

Method used

A prompt generation device and method that automatically generates optimal prompts using a processor, transceiver interface, and trained prompt generator based on reinforcement learning, to guide large language models to produce personalized responses.

Benefits of technology

Reduces time costs and effectively generates personalized responses by automatically designing prompts through a trained prompt generator, enhancing the consistency of large language model outputs with target personality categories.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure TWG2TB001908953_001
    Figure TWG2TB001908953_001
  • Figure TWG2TB001908953_002
    Figure TWG2TB001908953_002
  • Figure TWG2TB001908953_003
    Figure TWG2TB001908953_003
Patent Text Reader

Abstract

A prompt generation apparatus and method are disclosed. The prompt generation apparatus receives a situational question. The apparatus transmits a target personality category from a plurality of personality categories and the situational question to a prompt generator to generate a plurality of candidate prompts corresponding to the target personality category and a plurality of reward signals corresponding to the candidate prompts. The prompt generator is trained based on a large language model and a feedback model corresponding to the corresponding personality category. Based on the reward signals corresponding to the candidate prompts, the prompt generation apparatus determines an optimal prompt from the candidate prompts.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] This disclosure relates to a prompt generation device and control method. Specifically, this disclosure relates to a prompt generation device and control method capable of automatically generating optimal prompts to guide a large language model to generate personalized responses. [Previous Technology]

[0002] In recent years, the demand for dialogue with users based on large language models has been increasing in various industrial fields (e.g., autonomous driving). Among them, the technology of inducing large language models to generate personalized responses through design prompts has been proposed one after another.

[0003] In the prior art, the prompts input to a large language model are generated through manual design, and the personalized responses induced by the prompts are also evaluated manually. However, in this case, the process of manually designing prompts and manually evaluating responses is quite time-consuming and cannot effectively induce personalized responses from the large language model.

[0004] In view of this, how to provide a prompt generation technology that can automatically design prompts to reduce the time cost of prompt design and guide large language models to effectively generate personalized responses is a goal that the industry urgently needs to strive for. [Summary of the Invention]

[0005] One object of this disclosure is to provide a prompt generation apparatus, which includes a transceiver interface and a processor. The transceiver interface is used to receive a contextual question, and the processor is electrically connected to the transceiver interface. The processor transmits a target personality category from a plurality of personality categories and the contextual question to the prompt generator to generate a plurality of candidate prompts corresponding to the target personality category, wherein the prompt generator is trained based on a large language model and a feedback model corresponding to the corresponding personality category. The processor determines an optimal prompt from the candidate prompts based on a plurality of reward signals corresponding to the candidate prompts.

[0006] Another object of this disclosure is to provide a prompt generation method for use in an electronic device. The prompt generation method includes the following steps: transmitting a target personality category from a plurality of personality categories and a situational question to a prompt generator to generate a plurality of candidate prompts corresponding to the target personality category, wherein the prompt generator is trained based on a large language model and a feedback model corresponding to the corresponding personality category; and determining an optimal prompt from the candidate prompts based on a plurality of reward signals corresponding to the candidate prompts.

[0007] The prompt generation technology (including at least an apparatus and method) disclosed herein converts a situational question into a plurality of candidate prompts through a prompt generator, and determines the optimal prompt from among these candidate prompts. Next, the prompt generator is trained using reinforcement learning based on a large language model and a feedback model. Furthermore, the optimal prompt is transmitted to a large language model to generate a response message corresponding to one of the target personality categories. Since the prompt generation technology disclosed herein can automatically generate prompts through a prompt generator trained based on reinforcement learning, it reduces the time cost of designing prompts and guides a large language model to effectively generate personalized responses.

[0008] The following detailed technical and implementation methods of this disclosure are illustrated in conjunction with the figures, so that those skilled in the art to which this disclosure pertains can understand the technical features of the claimed invention.

Implementation Method

[0010] The following description of embodiments will explain the prompt generation apparatus provided in this disclosure. However, these embodiments are not intended to limit the implementation of this disclosure to any environment, application, or manner described in these embodiments. 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 ratio between elements are merely illustrative and are not intended to limit the scope of this disclosure.

[0011] The prompt generation device of the first embodiment disclosed herein is shown in Figure 1. As shown in Figure 1, the prompt generation device 1 includes a processor 11, a storage 12 and a transceiver interface 13, and the processor 11 is electrically connected to the storage 12 and the transceiver interface 13.

[0012] The prompt generation device 1 disclosed herein can be used in any environment where a user can interact with a large language model. For example, the prompt generation device 1 can be installed inside a vehicle and interacted with by a user (e.g., a driver or passenger).

[0013] In this embodiment, as shown in Figure 2, the storage unit 12 is used to store a prompt generator PG, a large language model LLM, and a feedback model RM. The prompt generator PG is a language model that can convert input prompts into advanced prompts (e.g., converting input prompts into prompts with different tones or more complex grammar). The large language model LLM is a large language model that can understand input prompts and generate responses corresponding to those prompts. The feedback model RM is a regression model that can generate feedback on input information (e.g., a score indicating the degree of conformity of the input text to a specific personality).

[0014] In this embodiment, the transceiver interface 13 is used to receive a situational question. For example, the prompt generating device 1 further includes a sensor (e.g., a microphone). The situational question received by the transceiver interface 13 is the situational question in text form that is translated by the processor 11 from the voice signal sensed by the sensor when the user speaks.

[0015] In some embodiments, the prompt generating device 1 further includes a human-machine interface (HMI). The contextual question received by the transceiver interface 13 is a contextual question input by the user through the HMI. For example, the user can operate a touchscreen interface to input the contextual question in text form. It should be noted that the HMI is an interface that can be controlled by the user to generate input signals and report system status to the user.

[0016] It should be noted that the processor 11 may be any processing unit, central processing unit (CPU), microprocessor, or other computing device known to those skilled in the art to which this application pertains. The storage device 12 may be memory, a universal serial bus (USB) disk, hard disk, optical disk, flash drive, or any other storage medium or circuit known to those skilled in the art to which this application 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 application pertains. The transceiver interface 13 may receive data from sources such as external devices, external web pages, external applications, etc.

[0017] In this disclosure, the main approach is to transmit a target personality category and a situational question to the prompt generator PG to generate an optimal prompt, and based on the optimal prompt, guide the large language model LLM to generate a response message corresponding to the target personality category. The following paragraphs will describe in detail the implementation details related to this disclosure.

[0018] In the first embodiment, for ease of explanation, please refer to the schematic diagram 300 of the prompt generation process in Figure 3. Specifically, the processor 11 transmits one of the plurality of personality category PCs, a target personality category TPC, and the situational question SQ to the prompt generator PG to generate a plurality of candidate prompts CP corresponding to the target personality category TPC and a plurality of reward signals RS corresponding to the candidate prompts CP.

[0019] First, the storage device 12 stores a plurality of personality category PCs, which can be determined based on a personalized text dataset used in this disclosure. For example, the personalized text dataset can be the Big Five Personality Dataset, and the personality category PCs are the five personality traits described in the Big Five Personality Dataset: Openness, Conscientiousness, Extraversion, Agreeableness, and Neuroticism.

[0020] It should be noted that the personalized text dataset used in this disclosure is not limited to the Big Five Personality Dataset mentioned above, but may also be any dataset containing texts corresponding to different personality traits.

[0021] Next, the target personality category TPC is one of the personality category PCs, and the target personality category TPC can be determined by the user. For example, the processor 11 controls the human-machine interface to display a plurality of option buttons corresponding to the corresponding personality category PC, and the user operates the human-machine interface to select one of the option buttons to determine the target personality category TPC.

[0022] In this embodiment, the prompt generator PG is a language model that can convert input prompts into more advanced prompts. The processor 11 transmits the target personality category (TPC) and the contextual question (SQ) to the prompt generator PG to generate a plurality of candidate prompts (CP) corresponding to the target personality category (TPC). In some embodiments, the target personality category (TPC) and the contextual question (SQ) can be input to the prompt generator PG in text form.

[0023] It should be noted that since these candidate prompts CP are generated by the prompt generator PG based on the target personality category TPC and the situational question SQ, the content described by these candidate prompts CP and the situational question SQ is similar, but the way they are described is different.

[0024] For example, the target personality category TPC is "Openness," the situational question SQ is "Hello, how's the weather today?", and the prompt generator PG generates candidate prompts CP, including a first candidate prompt and a second candidate prompt. The first candidate prompt is "Hi! What do you think of the weather today?", and the second candidate prompt is "Hello, I really want to know the weather today!". From the situational question SQ and the candidate prompts CP, the content of the situational question SQ and the candidate prompts CP are both "asking about today's weather," but the way the candidate prompts CP are described (e.g., tone, interjections, punctuation, etc.) are different.

[0025] Furthermore, the prompt generator PG can also generate a plurality of reward signals RS corresponding to the corresponding candidate prompts CP, wherein each of the reward signals RS is presented as a numerical value, and the reward signals RS are used to indicate the degree of conformity of each candidate prompt CP to the corresponding target personality category TPC. In some embodiments, the reward signals RS are used to indicate the degree of conformity of each candidate prompt CP to the corresponding personality category PC.

[0026] It should be noted that the initial model of the prompt generator PG is a pre-trained language model. The prompt generator PG needs to be fine-tuned and trained to improve its ability to generate prompts. Specifically, the prompt generator PG is trained based on the large language model LLM and the feedback model RM corresponding to the same personality category PC.

[0027] In a first embodiment, specifically, the processor 11 determines an optimal prompt BP from among the candidate prompts CP based on the reward signals RS corresponding to the candidate prompts CP.

[0028] It should be noted that these candidate cues CP are a plurality of different discrete cues explored by the cue generator PG in a multi-dimensional vocabulary space, and the cue generator PG tests these candidate cues CP to select the best performing one as the best cue BP. For example, the processor 11 selects the one with the highest corresponding reward signal RS from these candidate cues CP as the best cue BP.

[0029] It should be noted that the Best Hints (BP) are used to instruct the Large Language Model (LLM) to generate a response message corresponding to one of the target personality categories (TPCs). In other words, the Best Hints (BP) will be used to enhance the personality characteristics of the Large Language Model (LLM) in generating response messages, making the content of the response messages more consistent with the target personality category (TPC).

[0030] In some embodiments, the cue generator PG is trained using reinforcement learning. For clarity, please refer to the cue generator training flowchart 400 in Figure 4. First, the processor 11 transmits a plurality of catalytic cues (CTPs) to the large language model LLM to generate a plurality of evoked responses (ERs) corresponding to the corresponding catalytic cues (CTPs). In other words, these evoked responses (ERs) are personalized responses generated by the large language model LLM after receiving the catalytic cues (CTPs).

[0031] It should be noted that these catalytic prompt CTPs are generated based on the prompt generator PG. The prompt generator PG is a language model, therefore, this disclosure allows the prompt generator PG to generate these catalytic prompt CTPs by giving it simple instructions. For example, if the prompt generator PG is given the instruction "Please generate a plurality of prompts related to weather conditions", the prompt generator PG can generate a plurality of catalytic prompt CTPs corresponding to the instruction in text form.

[0032] Next, the processor 11 transmits the evoked responses ER to the feedback model RM to generate a plurality of personalized feedback information PRI corresponding to the evoked responses ER, wherein each of the personalized feedback information PRI contains a plurality of personalized feedback scores corresponding to the corresponding personalized category PC.

[0033] For example, taking the five personality traits in the Big Five Personality Dataset as examples of these personality categories PC, each of these personality feedback information PRI includes feedback scores corresponding to the five personality categories of openness, cognitive, extraversion, harmony and neuroticism.

[0034] It should be noted that each of these feedback scores can be a value within a range (e.g., a maximum value of 1 and a minimum value of 0), wherein the value is used to indicate the degree of conformity of the personality category PC. For example, in a plurality of personality feedback information PRI of an evoked response ER, the personality feedback score corresponding to openness is 0.9, indicating that the evoked response ER has a higher degree of conformity to openness; the personality feedback score corresponding to harmony is 0.1, indicating that the evoked response ER has a lower degree of conformity to harmony.

[0035] Finally, the processor 11 trains the cue generator PG using reinforcement learning based on the catalytic cues (CTPs) and the personality feedback information (PRIs). In other words, the feedback model (RM) is used to evaluate the evoked responses (ERs) generated by the large language model (LLM) according to different personality categories (PCs), thereby training the cue generator PG to enhance its understanding of "which personality category PC evoked by the large language model (LLM) can be evoked by the catalytic cues (CTPs) generated by the cue generator PG itself". Furthermore, the training process of the cue generator PG can be repeated to further enhance its capabilities.

[0036] In some embodiments, for ease of explanation, please refer to the feedback model training flowchart 500 in Figure 5. Specifically, the processor 11 trains the feedback model RM based on a plurality of training data TDs corresponding to the same personality category PC. It should be noted that the training data TDs contain a plurality of training texts, and each training text corresponds to one of the plurality of personality category PCs. The training data TDs can be generated in various ways. For example, the training data TDs can be provided by an open-source personalized text dataset (e.g., Big Five Personality Dataset, PANDORA). As another example, the training data TDs can also be generated by manually inputting text and manually labeling the corresponding personality category PC.

[0037] In some embodiments, this disclosure further increases the amount and diversity of training data TD by performing data augmentation on the training data TD. Specifically, processor 11 transmits the training data TD corresponding to the corresponding personality category PC to an augmented large language model ALLM to generate a plurality of augmented training data ATD corresponding to the corresponding personality category PC. Then, processor 11 trains the feedback model RM based on the augmented training data ATD corresponding to the corresponding personality category PC.

[0038] It should be noted that the augmented large language model ALLM can be any large language model that can convert input text into advanced text (e.g., convert input text into text with more complex grammar).

[0039] In some embodiments, an amplification instruction can be manually input into the large language model ALLM for amplification, wherein the amplification instruction is used to indicate one amplification form of the amplified training data ATD generated by the large language model ALLM for amplification. For example, the amplification instruction can be "use a more complex grammar to amplify the input text" or "use a different narrative order to amplify the input text", wherein "more complex grammar" and "different narrative order" are both amplification forms indicated by the amplification instruction.

[0040] In some embodiments, specifically, the processor 11 transmits the best suggestion BP to the large language model LLM to generate the response message corresponding to the target personality category TPC.

[0041] It should be noted that if the processor 11 transmits the contextual question SQ to the large language model LLM, the large language model LLM will generate a basic response message. Since the basic response message is generated based on the contextual question SQ, the response message is generated based on the best prompt BP, and the best prompt BP is generated by the prompt generator PG based on the contextual question SQ, the content described by the basic response message and the response message has a certain degree of similarity.

[0042] Next, since the best suggestion (BP) is used to enhance the personality characteristics of the large language model (LLM) in generating response messages, the response message is more consistent with the target personality category (TPC) than the basic response message.

[0043] For example, the target personality category TPC is "Openness," and the situational question SQ is "You are attending a concert or live performance. How much do you enjoy the atmosphere of the crowd and the energy of the event?" The basic response message induced by this situational question SQ is "I enjoy the atmosphere of the event, but I don't enjoy the crowd." The prompt generating device 1 generates the optimal prompt BP based on the situational question SQ, and the response message generated based on the optimal prompt BP is "I enjoy the atmosphere of the crowd and the energy of the event." Obviously, the response message induced by the optimal prompt BP is more consistent with the target personality category TPC of "Openness" than the basic response message induced by the situational question SQ.

[0044] In some embodiments, the prompt generating device 1 can display the response message through the human-machine interface during the interaction with the user, and ask the user questions through the human-machine interface. The user can operate the human-machine interface to generate a confirmation signal, and further train and update the prompt generator PG based on the feedback.

[0045] For example, the processor 11 controls a touchscreen interface to display the response message and controls the touchscreen interface to display a question message (e.g., which personality category do you think this response fits?). Then, the processor 11 controls the touchscreen interface to display a plurality of feedback buttons corresponding to the corresponding personality category PC (e.g., a button for "openness," a button for "recognition," etc.). Assuming the user believes the response message fits "openness," the user can operate the touchscreen interface to select the "openness" feedback button to generate the confirmation signal, which instructs the user to select the feedback button corresponding to which personality category PC, as feedback to the prompt generator PG.

[0046] Accordingly, the processor 11 can train and update the cue generator PG based on the feedback to enhance the cue generator PG so that the optimal cue BP generated by the cue generator PG can better induce the large language model LLM to generate response messages that conform to the personality category PC.

[0047] Specifically, the processor 11 controls the human-machine interface to display the response message. Then, the processor 11 receives a confirmation signal from the human-machine interface and updates the prompt generator PG based on the confirmation signal.

[0048] In addition, in some embodiments, the user can operate the human-machine interface to input a feedback suggestion in the form of a message to generate the confirmation signal, wherein the confirmation signal includes the feedback suggestion input by the user.

[0049] In some embodiments, in order to enable the large language model LLM to understand more complex input instructions, the prompt generation device 1 further enhances a plurality of training instructions based on an initial enhancement method, evaluates the initial enhancement method to generate an evolutionary enhancement method, generates a plurality of enhanced instructions through the evolutionary enhancement method, and trains the large language model LLM based on these enhanced instructions. Accordingly, the large language model LLM can understand more complex input instructions.

[0050] It should be noted that the prompt generating device 1 can be communicatively connected to a cloud database, and the cloud database stores a command training dataset. The command training dataset includes a plurality of training commands, a plurality of training tags corresponding to the corresponding training commands, a plurality of test commands, and a plurality of test tags corresponding to the corresponding test commands. The training commands or the test commands can be any command, the training tags are responses to the corresponding training commands, and the test tags are responses to the corresponding training commands, wherein the commands and responses are all in text form. For example, a training command is "How is the weather today?", and one of the training tags corresponding to the training command is "The weather is very good today".

[0051] It should be noted that the instruction training dataset can be an open-source dataset from the Internet (e.g., Alpaca Dataset, OASST1 instruction training datasets), or it can be generated manually.

[0052] First, in order to enhance these training instructions, the prompt generation device 1 uses an initial enhancement method to generate a plurality of enhanced training instructions. For clarity, please refer to the schematic diagram 601 of the enhanced training instruction generation process in Figure 6. Specifically, the processor 11 transmits the training instructions TRI and an initial enhancement method IEM to the large language model LLM to generate a plurality of enhanced training instructions ETRI.

[0053] It should be noted that the initial augmentation method IEM can be manually defined text, and the initial augmentation method IEM is used to indicate one augmentation type corresponding to the equivalent training instruction TRI. For example, the initial augmentation method IEM is "Please augment the input instruction with a more complex grammar", where "more complex grammar" is the augmentation type corresponding to the equivalent training instruction TRI. Accordingly, the large language model LLM will generate augmentation training instructions ETRI that conform to "more complex grammar".

[0054] Next, please refer to the schematic diagram 603 of the augmented training response generation process in Figure 6. Specifically, the processor 11 transmits the augmented training instructions ETRI to the large language model LLM to generate a plurality of augmented training responses ETRR corresponding to the augmented training instructions ETRI.

[0055] In some embodiments, in order to measure the quality of the augmented training instructions ETRI and the augmented training responses ETRR, specifically, the processor 11 analyzes the augmented training instructions ETRI based on the large language model LLM and compares the augmented training responses ETRR and the training labels corresponding to the training instructions TRI to generate augmented feedback information EFI.

[0056] It should be noted that in this embodiment, a feedback role prompt can be given to the large language model LLM by human intervention. The feedback role prompt is used to instruct the large language model LLM to measure the quality of the reinforcement training instructions ETRI and the reinforcement training responses ETRR in a specific role, task, style, scoring method, etc.

[0057] For example, the feedback role prompt could be: "Your role is a professional article reviewer, responsible for evaluating the quality of the rewritten article. Your scores must be objective and consistent each time. Your task is to analyze all the instructions I provide and compare the responses and corresponding tags for each instruction. Your style should be professional and easy to understand, with a clear and organized structure. Your scoring method is to analyze each instruction according to the following evaluation criteria, assigning a score from 0 to 10, and explaining the reasons in detail. These evaluation criteria include clarity, retention of original meaning, depth, diversity of viewpoints, and vocabulary diversity."

[0058] Next, please refer to the evolutionary enhancement method generation process diagram 605 in Figure 6. Specifically, the processor 11 transmits an enhancement prompt EP and a plurality of enhancement feedback information EFI to the large language model LLM to generate an evolutionary enhancement method EEM based on the initial enhancement method IEM.

[0059] It should be noted that the enhancement prompt EP is used to guide the large language model LLM to perform the task of enhancing the initial enhancement method IEM. For example, the enhancement prompt EP is "Please further optimize the initial enhancement method according to the enhancement feedback information" to instruct the large language model LLM to optimize the initial enhancement method IEM to produce the evolutionary enhancement method EEM.

[0060] In some embodiments, for ease of explanation, please refer to the schematic diagram 700 of the enhancement instruction generation process in Figure 7. Specifically, the processor 11 transmits a plurality of test instructions TEI and the evolutionary enhancement method EEM to the large language model LLM to generate the enhancement instructions EI, wherein the evolutionary enhancement method EEM is generated based on the initial enhancement method IEM.

[0061] It should be noted that the Evolutionary Enhancement Method (EEM) is used to indicate one of the enhancement types corresponding to the equivalent test instruction (TEI). Since the Evolutionary Enhancement Method (EEM) is generated based on the optimization of the initial enhancement method (IEM) (e.g., based on the initial enhancement method (IEM), the narrative structure of the text is changed, the grammatical difficulty is increased, etc.), the Evolutionary Enhancement Method (EEM) has a stronger "enhancement instruction capability" compared to the initial enhancement method (IEM).

[0062] Next, the processor 11 trains the large language model LLM based on these enhanced instructions EI. Accordingly, the large language model LLM can understand more complex input instructions.

[0063] As described above, the prompt generation device 1 provided by this disclosure converts a situational question into a plurality of candidate prompts through a prompt generator, and determines the best prompt from among these candidate prompts. Then, this disclosure trains the prompt generator using reinforcement learning based on a large language model and a feedback model. Furthermore, this disclosure transmits the best prompt to a large language model to generate a response message corresponding to one of the target personality categories. Since this disclosure can automatically generate prompts through a prompt generator trained based on reinforcement learning, the prompt generation device 1 provided by this disclosure reduces the time cost of designing prompts and guides the large language model to effectively generate personalized responses.

[0064] The second embodiment of this disclosure is a prompt generation method, the flowchart of which is depicted in Figure 8. The prompt generation method 800 is applicable to an electronic device, such as the prompt generation device 1 described in the first embodiment. The prompt generation method 800 generates a prompt through steps S801 to S803.

[0065] First, in step S801, the electronic device transmits one of the multiple personality categories, a target personality category, and a situational question to a prompt generator to generate multiple candidate prompts corresponding to the target personality category and multiple reward signals corresponding to the candidate prompts, wherein the prompt generator is trained based on a large language model and a feedback model corresponding to one of the personality categories.

[0066] Next, in step S803, the electronic device determines an optimal prompt from the candidate prompts based on the reward signals corresponding to the candidate prompts.

[0067] In some embodiments, the cue generator is trained based on the following steps: transmitting a plurality of catalytic cues to the large language model to generate a plurality of elicited responses corresponding to the catalytic cues, wherein the catalytic cues are generated based on the cue generator; transmitting the elicited responses to the feedback model to generate a plurality of personalized feedback information corresponding to the elicited responses, wherein each of the personalized feedback information includes a plurality of personalized feedback scores corresponding to the corresponding personalized category; and training the cue generator based on the catalytic cues and the personalized feedback information.

[0068] In some embodiments, the feedback model is trained based on the following steps: training the feedback model based on a plurality of training data corresponding to the same personality category.

[0069] In some embodiments, the prompt generation method 800 further includes the following steps: transmitting the training data corresponding to the equal personality category to an augmentation large language model to generate a plurality of augmentation training data corresponding to the equal personality category; and training the feedback model based on the augmentation training data corresponding to the equal personality category.

[0070] In some embodiments, the prompt generation method 800 further includes the following steps: transmitting the best prompt to the large language model to generate a response message corresponding to one of the target personality categories.

[0071] In some embodiments, the prompt generation method 800 further includes the following steps: controlling a human-machine interface to display the response message; and receiving a confirmation signal from the human-machine interface and updating the prompt generator based on the confirmation signal.

[0072] In some embodiments, the large language model is trained based on the following steps: training the large language model based on a plurality of augmentation instructions and a plurality of test labels corresponding to the augmentation instructions.

[0073] In some embodiments, the enhancement instructions are generated based on the following steps: transmitting a plurality of test instructions and an evolutionary enhancement method to the large language model to generate the enhancement instructions, wherein the evolutionary enhancement method is generated based on an initial enhancement method.

[0074] In some embodiments, the evolutionary enhancement method is generated based on the following steps: transmitting a plurality of training instructions and the initial enhancement method to the large language model to generate a plurality of enhancement training instructions, wherein the initial enhancement method is used to indicate one enhancement type corresponding to the equivalent training instructions; transmitting the enhancement training instructions to the large language model to generate a plurality of enhancement training responses; and transmitting an enhancement prompt and a plurality of enhancement feedback information to the large language model to generate the evolutionary enhancement method based on the initial enhancement method.

[0075] In some embodiments, the augmented feedback information is generated based on the following steps: analyzing the augmented training instructions based on the large language model, and comparing the augmented training responses with a plurality of training labels corresponding to the training instructions to generate the augmented feedback information.

[0076] In addition to the above steps, the second embodiment can also perform all the operations and steps of the prompt generation 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.

[0077] In summary, the prompt generation technology (including at least an apparatus and method) disclosed herein converts a situational question into a plurality of candidate prompts through a prompt generator, and determines the optimal prompt from among these candidate prompts. Next, this disclosure trains the prompt generator using reinforcement learning based on a large language model and a feedback model. Furthermore, this disclosure transmits the optimal prompt to a large language model to generate a response message corresponding to one of the target personality categories. Since this disclosure can automatically generate prompts through a prompt generator trained based on reinforcement learning, the prompt generation technology provided by this disclosure reduces the time cost of designing prompts and guides a large language model to effectively generate personalized responses.

[0078] The above embodiments are only used to illustrate some implementations of this disclosure and to explain the technical features of this disclosure, and are not intended to limit the scope and range 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 scope of the patent application. [Simplified Explanation of the Diagram]

[0009] Figure 1 is a schematic diagram depicting the architecture of the prompt generation device of the first embodiment; Figure 2 is a schematic diagram depicting the storage of the first embodiment; Figure 3 is a schematic diagram depicting the prompt generation process of the first embodiment; Figure 4 is a schematic diagram depicting the prompt generator training process of some embodiments; Figure 5 is a schematic diagram depicting the feedback model training process of some embodiments; Figure 6 is a schematic diagram depicting the generation process of enhancement training instructions, enhancement training responses and evolutionary enhancement methods of some embodiments; Figure 7 is a schematic diagram depicting the enhancement instruction generation process of some embodiments; and Figure 8 is a flowchart depicting the prompt generation method of the second embodiment. [Biomaterial Storage]

[0080] Domestic storage information (please note in order of storage institution, date, and number): None. International storage information (please note in order of storage country, institution, date, and number): None.

Claims

1. A prompt generation apparatus comprising: a transceiver interface for receiving a contextual question; a storage device for storing a prompt generator, a large language model, and a feedback model; and a processor electrically connected to the transceiver interface and the storage device, and performing the following operations: transmitting a target personality category from a plurality of personality categories and the contextual question to the prompt generator to generate a plurality of candidate prompts corresponding to the target personality category and a plurality of reward signals corresponding to the candidate prompts, wherein the prompt generator is trained based on the large language model and the feedback model corresponding to the corresponding personality category; and determining an optimal prompt from the candidate prompts based on the reward signals corresponding to the candidate prompts.

2. The cue generation apparatus as claimed in claim 1, wherein the cue generator is trained based on the following operation: transmitting a plurality of catalytic cues to the large language model to generate a plurality of elicited responses corresponding to the catalytic cues, wherein the catalytic cues are generated based on the cue generator; transmitting the elicited responses to the feedback model to generate a plurality of personalized feedback information corresponding to the elicited responses, wherein each of the personalized feedback information includes a plurality of personalized feedback scores corresponding to the corresponding personalized category; and training the cue generator based on the catalytic cues and the personalized feedback information.

3. The prompt generation device as described in claim 2, wherein the feedback model is trained based on the following operation: the feedback model is trained based on a plurality of training data corresponding to the same personality category.

4. The prompt generation apparatus as described in claim 3, wherein the processor further performs the following operations: transmitting the training data corresponding to the equal personality category to an augmentation large language model to generate a plurality of augmentation training data corresponding to the equal personality category; and training the feedback model based on the augmentation training data corresponding to the equal personality category.

5. The prompt generation apparatus as described in claim 1, wherein the processor is further configured to perform the following operations: transmit the optimal prompt to the large language model to generate a response message corresponding to one of the target personality categories.

6. The prompt generating device as described in claim 5, wherein the processor further performs the following operations: controlling a human-machine interface to display the response message; and receiving an acknowledgment signal from the human-machine interface and updating the prompt generator based on the acknowledgment signal.

7. The prompt generation apparatus as described in claim 1, wherein the large language model is trained based on the following operation: the large language model is trained based on a plurality of augmentation instructions and a plurality of test labels corresponding to the augmentation instructions.

8. The prompt generation apparatus as described in claim 7, wherein the enhancement instructions are generated based on the following operation: transmitting a plurality of test instructions and an evolutionary enhancement method to the large language model to generate the enhancement instructions, wherein the evolutionary enhancement method is generated based on an initial enhancement method.

9. The prompt generation apparatus as described in claim 8, wherein the evolutionary enhancement method is generated based on the following operations: transmitting a plurality of training instructions and the initial enhancement method to the large language model to generate a plurality of enhancement training instructions, wherein the initial enhancement method is used to indicate one enhancement type corresponding to the equivalent training instructions; transmitting the enhancement training instructions to the large language model to generate a plurality of enhancement training responses; and transmitting an enhancement prompt and a plurality of enhancement feedback information to the large language model to generate the evolutionary enhancement method based on the initial enhancement method.

10. The prompt generation apparatus as described in claim 9, wherein the augmented feedback information is generated based on the following operation: analyzing the augmented training instructions based on the large language model, and comparing the augmented training responses with a plurality of training labels corresponding to the such training instructions to generate the augmented feedback information.

11. A prompt generation method for an electronic device, wherein the electronic device receives a situational question, the electronic device stores a prompt generator, a large language model, and a feedback model, wherein the prompt generation method comprises the steps of: transmitting a target personality category from a plurality of personality categories and the situational question to the prompt generator to generate a plurality of candidate prompts corresponding to the target personality category and a plurality of reward signals corresponding to the candidate prompts, wherein the prompt generator is trained based on the large language model and the feedback model corresponding to the corresponding personality category; and determining an optimal prompt from the candidate prompts based on the reward signals corresponding to the candidate prompts.

12. The prompt generation method as described in claim 11, wherein the prompt generator is trained based on the following steps: transmitting a plurality of catalytic prompts to the large language model to generate a plurality of elicited responses corresponding to the catalytic prompts, wherein the catalytic prompts are generated based on the prompt generator; transmitting the elicited responses to the feedback model to generate a plurality of personalized feedback information corresponding to the elicited responses, wherein each of the personalized feedback information includes a plurality of personalized feedback scores corresponding to the corresponding personalized category; and training the prompt generator based on the catalytic prompts and the personalized feedback information.

13. The prompt generation method as described in Request 12, wherein the feedback model is trained based on the following steps: training the feedback model based on a plurality of training data corresponding to the same personality category.

14. The prompt generation method as described in claim 13 further comprises the following steps: transmitting the training data corresponding to the equal personality category to an augmented large language model to generate a plurality of augmented training data corresponding to the equal personality category; and training the feedback model based on the augmented training data corresponding to the equal personality category.

15. The prompt generation method as described in Request 11 further includes the following steps: transmitting the optimal prompt to the large language model to generate a response message corresponding to one of the target personality categories.

16. The prompt generation method as described in claim 15 further includes the following steps: controlling a human-machine interface to display the response message; and receiving an acknowledgment signal from the human-machine interface and updating the prompt generator based on the acknowledgment signal.

17. The prompt generation method as described in Request 11, wherein the large language model is trained based on the following steps: training the large language model based on a plurality of augmentation instructions and a plurality of test labels corresponding to the augmentation instructions.

18. The prompt generation method as described in claim 17, wherein the enhancement instructions are generated based on the following steps: transmitting a plurality of test instructions and an evolutionary enhancement method to the large language model to generate the enhancement instructions, wherein the evolutionary enhancement method is generated based on an initial enhancement method.

19. The prompt generation method as described in claim 18, wherein the evolutionary enhancement method is generated based on the following steps: transmitting a plurality of training instructions and the initial enhancement method to the large language model to generate a plurality of enhancement training instructions, wherein the initial enhancement method is used to indicate one enhancement type corresponding to the equivalent training instructions; transmitting the enhancement training instructions to the large language model to generate a plurality of enhancement training responses; and transmitting an enhancement prompt and a plurality of enhancement feedback information to the large language model to generate the evolutionary enhancement method based on the initial enhancement method.

20. The method for generating prompts as described in claim 19, wherein the augmented feedback information is generated based on the following steps: analyzing the augmented training instructions based on the large language model, and comparing the augmented training responses with a plurality of training labels corresponding to the such training instructions to generate the augmented feedback information.

Citation Information

Patent Citations

  • Conversation generation method, conversation generation device and storage medium

    CN116226344A

  • Language model-based data processing method and device, equipment and medium

    CN118093854A

  • Personalized cue word optimization method and device, electronic equipment and storage medium

    CN118350378A

  • Conversation processing method and conversation processing model training method

    CN118396094A

  • Question-and-anser system and operating method thereof

    TW202424919A