Tip optimization methods, equipment, media and products

By analyzing and optimizing the prompts of online dialogue agents using offline agents, the problem of low optimization efficiency of dialogue agents in specific dialogue scenarios is solved, and more efficient and accurate response processing is achieved.

CN122087033APending Publication Date: 2026-05-26ALIBABA CLOUD COMPUTING CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ALIBABA CLOUD COMPUTING CO LTD
Filing Date
2024-11-25
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

In certain dialogue scenarios, because users' questions may contain technical terms or industry/enterprise-related knowledge, existing technologies require a lot of time and resources for annotation and optimization, resulting in low optimization efficiency of dialogue agents.

Method used

By acquiring the dialogue records of online dialogue agents, error analysis and optimization are performed using offline evaluation and optimization agents. Optimized input data is generated and added to the optimization experience database to optimize the prompts of the dialogue agents.

Benefits of technology

It improves the optimization efficiency of dialogue agents, reduces the time and resource consumption during online optimization, lowers optimization costs, and improves the accuracy of response information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122087033A_ABST
    Figure CN122087033A_ABST
Patent Text Reader

Abstract

This invention provides a method, device, medium, and product for optimizing prompt words. The method includes: inputting a first dialogue record generated by an online dialogue agent into an offline evaluation agent to obtain first evaluation information output by a large language model corresponding to the evaluation agent. Then, determining an offline optimization agent corresponding to this first evaluation information. Next, inputting generated optimization input data into the optimization agent to obtain optimized output data output by the large language model corresponding to the optimization agent, the optimized output data being used to optimize prompt words. Finally, adding this optimized output data to an optimization experience database for use by the dialogue agent. It is evident that because the optimized prompt words can more accurately guide the large language model corresponding to the dialogue agent to generate expected response information, errors occurring during the response information generation process can be reduced, thereby improving the optimization efficiency of the dialogue agent.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence technology, and in particular to a method, device, medium, and product for optimizing prompt words. Background Technology

[0002] Currently, with the continuous advancement of artificial intelligence technology, the application scenarios of intelligent agents are becoming increasingly widespread, such as text generation and intelligent dialogue scenarios. In intelligent dialogue scenarios, the dialogue agent can understand the user's real-time questions through its corresponding Large Language Model (LLM) and generate appropriate responses that correspond to those questions.

[0003] However, in certain dialogue scenarios, user questions may contain technical terms or industry / enterprise-related knowledge, leading to potentially inaccurate responses. Therefore, improving dialogue accuracy often requires significant time and effort to annotate these technical terms or industry-related knowledge, followed by optimizing the dialogue agent based on the annotated data. This data annotation process obviously increases technical costs and reduces the optimization efficiency of the dialogue agent. Therefore, improving the optimization efficiency of dialogue agents in specific dialogue scenarios is a pressing technical problem that needs to be solved in this field. Summary of the Invention

[0004] In view of this, embodiments of the present invention provide a prompt word optimization method, device, medium, and product to improve the optimization efficiency of a dialogue agent by optimizing prompt words.

[0005] In a first aspect, embodiments of the present invention provide a method for optimizing prompt words, including:

[0006] Acquire a first dialogue record generated by an online dialogue agent, the first dialogue record including a first question and a first response as a question-and-answer pair;

[0007] The first dialogue record is input into an offline evaluation agent to obtain the first evaluation information output by the large language model corresponding to the evaluation agent. The first evaluation information is used to provide feedback on the error description information corresponding to the first response information.

[0008] Identify the offline optimized agent corresponding to the first evaluation information;

[0009] Optimized input data is generated and input into the optimization agent to obtain optimized output data of the large language model corresponding to the optimization agent. The optimized input data includes the first evaluation information and at least some information in the first dialogue record. The optimized output data is used to optimize the prompt words of the large language model corresponding to the dialogue agent.

[0010] The optimized output data is added to the optimization experience database for use by the dialogue agent.

[0011] Secondly, embodiments of the present invention provide a prompt word optimization device, comprising:

[0012] The acquisition module is used to acquire a first dialogue record generated by an online dialogue agent, wherein the first dialogue record includes a first question and a first response as a question-and-answer pair.

[0013] An evaluation module is used to input the first dialogue record into an offline evaluation agent to obtain first evaluation information output by the large language model corresponding to the evaluation agent. The first evaluation information is used to provide feedback on the error description information corresponding to the first response information.

[0014] A determination module is used to determine the offline optimized agent corresponding to the first evaluation information;

[0015] An optimization module is used to generate optimized input data and input the optimized input data into the optimization agent to obtain optimized output data output by the large language model corresponding to the optimization agent. The optimized input data includes the first evaluation information and at least some information in the first dialogue record. The optimized output data is used to optimize the prompt words of the large language model corresponding to the dialogue agent.

[0016] An add module is used to add the optimized output data to the optimization experience database for use by the dialogue agent.

[0017] Thirdly, embodiments of the present invention provide an electronic device, including a processor and a memory, wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions, when executed by the processor, implement the prompt word optimization method described in the first aspect above. The electronic device may also include a communication interface for communicating with other devices or communication systems.

[0018] Fourthly, embodiments of the present invention provide a non-transitory machine-readable storage medium storing executable code, which, when executed by a processor of an electronic device, enables the processor to at least implement the prompt word optimization method as described in the first aspect above.

[0019] Fifthly, embodiments of the present invention provide a computer program product, the computer program product including a computer program or instructions, which, when executed by a processor, cause the processor to implement the prompt word optimization method as described in the first aspect above.

[0020] In the prompt word optimization method provided by this invention, a first dialogue record generated by an online dialogue agent is obtained, and this first dialogue record is input into an offline evaluation agent to obtain first evaluation information output by the large language model corresponding to the evaluation agent. The first dialogue record includes first question information and first response information as a question-answer pair, and the first evaluation information is used to provide feedback on the error description information corresponding to the first response information. Then, an offline optimization agent corresponding to the first evaluation information is determined. Next, optimization input data is generated and input into the optimization agent to obtain optimized output data output by the large language model corresponding to the optimization agent. The optimization input data includes the first evaluation information and at least a portion of the information in the first dialogue record, and the optimized output data is used to optimize the prompt words of the large language model corresponding to the input dialogue agent. Finally, the optimized output data is added to an optimization experience database for use by the dialogue agent.

[0021] As can be seen, in the above-mentioned prompt word optimization process, by utilizing offline evaluation agents and different offline optimization agents, optimized output data can be obtained to correct errors in the first response information. Furthermore, this optimized output data can be used to better optimize the prompt words of the large language model corresponding to the input dialogue agent. Since the optimized prompt words can more accurately guide the large language model corresponding to the online dialogue agent to understand the first question information and generate the expected first response information, errors occurring in the process of generating the first response information can be reduced, thereby improving the optimization efficiency of the dialogue agent. Moreover, since offline agents can efficiently optimize the dialogue records generated by the online dialogue agent, avoiding the large amount of trial and error and computational resource consumption in the online optimization process, the method of optimizing the online dialogue agent using offline agents can reduce the time and resource consumption in the optimization process, thereby reducing optimization costs. Attached Figure Description

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

[0023] Figure 1 A flowchart illustrating a prompt word optimization method provided in an embodiment of the present invention;

[0024] Figure 2 This is a schematic diagram of the structure of an intelligent agent system provided in an embodiment of the present invention;

[0025] Figure 3 A flowchart illustrating a method for generating an optimized experience database, as provided in an embodiment of the present invention;

[0026] Figure 4 A schematic diagram illustrating the working process of a dialogue agent provided in an embodiment of the present invention;

[0027] Figure 5 A schematic diagram of an optimization strategy provided in an embodiment of the present invention;

[0028] Figure 6 This is a schematic diagram of a data filtering structure provided in an embodiment of the present invention;

[0029] Figure 7 This is a schematic diagram of a knowledge enhancement structure provided in an embodiment of the present invention;

[0030] Figure 8 This is a schematic diagram of a prompt word optimization device provided in an embodiment of the present invention;

[0031] Figure 9 To and Figure 8 The illustrated embodiment provides a schematic diagram of the electronic device corresponding to the prompt word optimization device. Detailed Implementation

[0032] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0033] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this invention are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.

[0034] Before providing a detailed description of the various embodiments provided by the present invention, the concepts involved in the present invention can also be explained:

[0035] An agent is a system or software program capable of perceiving its environment (e.g., receiving input data) and making decisions or taking actions based on that input data to accomplish a specific task. As mentioned in the background section, in a dialogue scenario, the agent can be a conversational agent. Furthermore, since dialogue scenarios typically require real-time processing, this conversational agent can be understood as an online conversational agent capable of real-time question-and-answer interaction. This online conversational agent can understand the user's real-time input questions using its own large language model and provide corresponding responses.

[0036] However, in specific dialogue scenarios, such as enterprise dialogues, which typically involve industry / enterprise-related knowledge in a specific field, the dialogue agent may lack this knowledge. This can lead to inaccurate prompts from the large language model corresponding to the dialogue agent, resulting in incorrect responses from the large language model. In such cases, the dialogue agent often needs to spend more time and resources to obtain the correct response, which obviously reduces its optimization efficiency.

[0037] In order to improve the optimization efficiency of the dialogue agent, the methods provided in the following embodiments of the present invention can be used.

[0038] Based on the above description, some embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Where there is no conflict between the embodiments, the following embodiments and the features and steps within them can be combined with each other. Furthermore, the timing of the steps in the following method embodiments is merely an example and not a strict limitation.

[0039] Figure 1 This is a flowchart illustrating a prompt word optimization method provided in an embodiment of the present invention. This prompt word optimization method provided in this embodiment of the present invention can be executed by an intelligent agent system. In summary, as... Figure 2 As shown, the intelligent agent system includes online dialogue agents and multiple offline agents. The multiple offline agents may include evaluation agents and various optimization agents, such as... Figure 2 The diagram illustrates a first optimizing agent, a second optimizing agent, and a third optimizing agent, etc. Optionally, such as... Figure 2 As shown, the offline agent may also include a scheduling agent for scheduling the use of the evaluation agent and various optimization agents.

[0040] In this embodiment of the invention, the dialogue agent that responds to user-input questions in real time can be called an online dialogue agent. Conversely, multiple agents that allow for non-real-time (i.e., delayed) optimization of prompts on the dialogue records generated by the online dialogue agent are called offline agents. The method of using multiple offline agents to jointly optimize the prompts of the online dialogue agent has two advantages. First, since the online dialogue agent's main function is to respond to user questions promptly, its processing logic is simple, so usually only one agent with a suitable structure is needed. Moreover, it can better respond to user questions by utilizing the optimized output data obtained from multiple offline agents. Second, by setting up multiple offline agents, it can handle more complex optimization problems. That is, through the cooperation of multiple offline agents, more accurate optimized output data can be obtained for optimizing the prompts of the large language model corresponding to the input dialogue agent. Compared to the online dialogue agent performing this optimization process, the method of optimization by multiple offline agents avoids interference from the optimization process in the timely response to user questions, allowing the dialogue agent to focus solely on timely responses to user questions.

[0041] Based on the above description, the specific execution process of a prompt word optimization method provided by an embodiment of the present invention will be described in detail below.

[0042] like Figure 1 As shown, the method may include the following steps:

[0043] S101, Obtain the first dialogue record generated by the online dialogue agent, the first dialogue record including the first question information and the first response information as a question-answer pair.

[0044] S102, the first dialogue record is input into the offline evaluation agent to obtain the first evaluation information output by the large language model corresponding to the evaluation agent. The first evaluation information is used to provide feedback on the error description information corresponding to the first response information.

[0045] S103, determine the offline optimized agent corresponding to the first evaluation information.

[0046] S104, Generate optimized input data, input the optimized input data into the optimizing agent to obtain optimized output data of the large language model corresponding to the optimizing agent. The optimized input data includes first evaluation information and at least some information in the first dialogue record. The optimized output data is used to optimize the prompt words of the large language model corresponding to the input dialogue agent.

[0047] S105, add the optimized output data to the optimization experience database for use by the dialogue agent.

[0048] First, the first dialogue record generated by the online dialogue agent is obtained. The online dialogue agent can interact with the user in real time. Specifically, the online dialogue agent can obtain the first question information generated by the user in real time, and analyze this first question information using the large language model corresponding to the dialogue agent to provide the first response information corresponding to the first question information. At this point, the first question information and the first response information, as a question-answer pair, can be included in the first dialogue record.

[0049] Optionally, the first dialogue record may also include question-and-answer process information. Specifically, the question-and-answer process information may include: first relevant knowledge corresponding to the first question information retrieved from a set knowledge base using the first question information as query input, and first prompt words generated based on the first relevant knowledge, the first question information, and the prompt word template, etc.

[0050] Optionally, Retrieval-Augmented Generation (RAG) technology can be used to retrieve relevant knowledge corresponding to the query input information from a set knowledge base.

[0051] Optionally, the knowledge base can include knowledge from different domains applicable to different dialogue scenarios. For example, in a corporate dialogue scenario, the knowledge base could include knowledge about the company's internal policies and processes, background information, and the characteristics of the products the company develops. In a dialogue scenario about legal consultation, the knowledge base could include knowledge about the legal domain, such as legal provisions, case analysis, and legal procedures.

[0052] For generating the first prompt word, specifically, the dialogue agent can first extract multiple keywords from the first question information and related knowledge. Then, based on the needs of the first question information, the dialogue agent can select a preset prompt word template and fill in the multiple keywords into the corresponding positions in the prompt word template to generate the complete first prompt word. Optionally, the prompt word template can be associated with the dialogue scenario, and it can also include guiding statements, such as "Please start from perspective A," etc., to improve the agent's comprehension ability.

[0053] Understandably, the initial dialogue record generated by an online dialogue agent can serve as a historical dialogue record for offline agents to learn from and improve upon.

[0054] Specifically, optionally, the scheduling agent can first input this first dialogue record into an offline evaluation agent, which then outputs first evaluation information through its corresponding large language model. This first evaluation information is used to provide feedback on the error description information corresponding to the first response information. Optionally, this error description information can indicate the specific error type corresponding to the response error, and can also indicate the reason for this response error.

[0055] Optionally, different initial evaluation information can reflect different error types. Therefore, for different error types, the scheduling agent can use different optimization agents to optimize the prompts in the large language model corresponding to the input dialogue agent. For example, for the planning rewrite error type, different optimization agents can be used... Figure 2 The first optimized agent shown; for recall error types, it can use Figure 2 The second optimized agent shown; for the generation error type, it can use Figure 2 The third optimized agent is shown.

[0056] Specifically, for optimizing the agent, the scheduling agent can generate optimized input data based on the first evaluation information output by the evaluation agent and at least a portion of the content in the first dialogue record. Then, the scheduling agent can input this optimized input data into the optimizing agent corresponding to the error type indicated by the first evaluation information to obtain the optimized output data of the large language model corresponding to that optimizing agent.

[0057] Specifically, optimizing the input data serves to guide the optimizing agent in the direction of optimization. By optimizing the first evaluation information in the input data, the optimizing agent can become aware of the error type corresponding to the incorrect response. Furthermore, by optimizing at least a portion of the information in the first dialogue record within the input data, such as the first question information, the first response information, the first relevant knowledge, and the first prompt word, the optimizing agent can become aware of the information in the first dialogue record that led to the incorrect response.

[0058] Optionally, different optimization agents can incorporate different optimization strategies. These strategies guide the agents to perform specific optimization operations based on the input data, and the optimization result becomes the output data. This output data can be used to optimize the prompts in the large language model corresponding to the input dialogue agent. Optionally, the content included in the output data differs depending on the error type.

[0059] Finally, the optimizing agent can add this optimized output data to the optimization experience database for use by the dialogue agent. For the optimization of the dialogue agent, it can directly use the optimized output data in the optimization experience database to optimize the prompts of the large language model corresponding to the input dialogue agent. The specific generation process of the optimization experience database can be found in the description of the following embodiments.

[0060] For example, assuming the error type reflected in the first evaluation information is a planning rewrite error, the scheduling agent can use the first optimizing agent corresponding to the planning rewrite error type. Through the optimization strategy built into the first optimizing agent, the first problem information can be rewritten to obtain the rewritten, optimized query input information. This optimized query input information is the optimized output data. Furthermore, the dialogue agent can use this optimized query input information to more accurately retrieve relevant knowledge corresponding to the first problem information from the established knowledge base, thereby more accurately outputting prompts for the large language model corresponding to the optimized input dialogue agent.

[0061] In this embodiment, by utilizing an offline evaluation agent and different offline optimization agents, optimization experience can be obtained to address errors in the first response information. Furthermore, this optimization experience can be used to better optimize the prompts for the large language model corresponding to the input dialogue agent. Since the optimized prompts can more accurately guide the large language model corresponding to the dialogue agent to understand the first question information and generate the expected first response information, errors occurring in the large language model during the generation of the first response information can be reduced, thereby improving the optimization efficiency of the online dialogue agent.

[0062] Furthermore, since offline agents can efficiently optimize the dialogue records generated by online dialogue agents, avoiding the large amount of trial and error and computational resource consumption in the online optimization process, the method of optimizing online dialogue agents through offline agents can reduce the time and resource consumption in the optimization process, thereby reducing optimization costs.

[0063] Additionally, it should be noted that during the operation of the different offline intelligent agents mentioned above, operators can provide assistance, supervision, and correction to ensure that the optimization process of the offline intelligent agents is under control, thereby guaranteeing the optimization efficiency of the online dialogue intelligent agents.

[0064] As mentioned above, optimized output data can be obtained by optimizing the large language model corresponding to the agent, and this optimized output data can be added to the optimization experience database. The following section will combine... Figure 3 The illustrated embodiment explains the specific process of generating the optimized experience database. For example... Figure 3 As shown, the following steps may be included:

[0065] S301, Based on the first problem information and the optimized output data, generate optimized query input information.

[0066] S302, retrieve the set knowledge base based on the optimized query input information to obtain the optimized relevant knowledge.

[0067] S303: Generate optimized prompt words based on the first question information and optimized relevant knowledge, and input the optimized prompt words into the large language model corresponding to the dialogue agent to obtain optimized response information.

[0068] S304, input the second dialogue record into the evaluation agent to obtain the second evaluation information output by the large language model corresponding to the evaluation agent. The second dialogue record includes the first question information, the optimized response information, the optimized related knowledge, and the optimized prompt words.

[0069] S305, if the second evaluation information reflects the optimized response information correctly, then the optimized output data is added to the optimization experience database.

[0070] Optionally, the dialogue agent can optimize the first question information based on the optimized output data from the large language model corresponding to the optimization agent, to obtain optimized query input information. The first question information may include natural language text spoken by the user, which can be used as query input to retrieve information from a predefined knowledge base.

[0071] One optional optimization method is to transform the initial question information, which is natural language text, into a Structured Query Language (SQL) statement. The optimized query input is then the SQL statement obtained after transforming the initial question information. Another optional optimization method is to rewrite the initial question information, which is natural language text, to make the rewritten and optimized query input clearer.

[0072] Then, RAG technology can be used to retrieve and optimize relevant knowledge corresponding to the input information of the query from the set knowledge base.

[0073] Next, based on the information from the first question and the relevant knowledge after optimization, optimized prompt words can be generated. Then, the optimized prompt words can be input into the large language model corresponding to the dialogue agent, so that the large language model corresponding to the dialogue agent can output optimized response information.

[0074] For example, suppose the first question is "I've moved my household registration here, what should I do about my child's schooling?", and the optimized query input is "Hello, I have moved my household registration to District A. How should I handle my child's school enrollment procedures, and what materials do I need to prepare?", then the optimized search results will include "You need to prepare your household registration booklet, ID card, and property ownership certificate, and then register at the school corresponding to District A."

[0075] Based on the information from the first question and the optimized relevant knowledge, the optimized prompt can be as follows: "If you have already completed your household registration transfer, please proceed with the enrollment procedures for your child according to the requirements of School District A. Please ensure you have prepared your household registration booklet, ID card, and property ownership certificate, and then go to the corresponding school in School District A to register." Furthermore, the large language model can generate richer optimized response information based on this optimized prompt and the information from the first question.

[0076] Next, the second dialogue record can be input into the evaluation agent to obtain the second evaluation information output by the large language model corresponding to the evaluation agent. The second dialogue record includes the first question information, the optimized response information, the optimized relevant knowledge, and the optimized prompt words. The second evaluation information is used to provide feedback on the error description information corresponding to the optimized response information.

[0077] Finally, if the second evaluation information reflects that the optimized response information is correct, this optimized output data can be added to the optimization experience database, which can then be used by the online dialogue agent to optimize prompts.

[0078] In this embodiment, the prompt words are regenerated using optimized output data to obtain optimized prompt words. These optimized prompt words are then input into the large language model corresponding to the dialogue agent to obtain optimized response information. Furthermore, an evaluation agent is used to verify whether the optimized response information contains errors. If the optimized response information is correct, it indicates the validity of the optimized output data, and the valid optimized output data can be added to the optimization experience database. In other words, by verifying the validity of the optimized output data from the optimization agent, the validity of the optimization experience database can be guaranteed, thereby ensuring the accuracy of the prompt word optimization.

[0079] The working process of the different components in the above-mentioned intelligent agent system will be explained below.

[0080] First, combined Figure 4 This describes the process by which an online dialogue agent optimizes prompts and generates responses using the optimized experience database obtained from the above embodiments.

[0081] Specifically, the dialogue agent can receive a second question from the user. Then, the dialogue agent can determine the target optimization output data that matches the second question from an optimization experience database.

[0082] In this embodiment, the input time of the second question information is later than the input time of the first question information. It should be noted that the first question information mentioned above can be considered historical question information, which can be used as optimization input data for the optimization agent to refine. The second question information can be considered as the question information generated by the user in real time after the offline agent has already optimized the online dialogue agent. That is, the first question information is the question information used during the optimization process, while the second question information is the question information generated by the user in real time after optimization.

[0083] Optionally, the optimization experience database may include different optimization output data from different optimization agents. The target optimization output data may be the data output by the large language model corresponding to the target optimization agent. Optionally, the target optimization agent can be determined based on the error types indicated by the evaluation information output by the evaluation agent.

[0084] Next, the dialogue agent can optimize the second question information using the target optimization output data to obtain the query input information. Optionally, the query input information can be natural language text or an SQL statement. For a detailed explanation of the question information optimization process, please refer to [link to relevant documentation]. Figure 3 The description in the illustrated embodiment.

[0085] Subsequently, the dialogue agent can utilize RAG technology to retrieve second relevant knowledge corresponding to the query input information from a pre-defined knowledge base. Specifically, the query input information can first be converted into a query vector, and then at least one text vector most similar to the query vector can be found from the pre-defined knowledge base. This at least one text vector can be considered as the vector most relevant to the query vector and containing the knowledge needed to answer the user's second question. Further, an extraction model can be used to extract the second relevant knowledge from the at least one text vector.

[0086] Finally, the dialogue agent can generate a second prompt word based on the second question information and second related knowledge. This second prompt word is then input into the large language model corresponding to the dialogue agent to obtain the second response information. The generation process of the second prompt word can be viewed as the process of intelligent decision-making by the online dialogue agent. For details, please refer to the generation process of the first prompt word described above; it will not be repeated here.

[0087] In this embodiment, by leveraging the optimized experience database, the accuracy of the retrieved second relevant knowledge can be guaranteed, and further, the accuracy of the prompt words of the large language model corresponding to the input dialogue agent can be guaranteed, thereby ensuring the accuracy of the second response information output by the large language model corresponding to the dialogue agent, which in turn guarantees the dialogue effect of the online dialogue agent.

[0088] Furthermore, the contents not described in detail in this embodiment and the technical effects that can be achieved can be found in the relevant descriptions in the above embodiments, and will not be repeated here.

[0089] Figure 1 As mentioned in the illustrated embodiment, the evaluation agent can output first evaluation information through its corresponding large language model. Specifically, the scheduling agent can first generate evaluation prompts based on the first dialogue record and reference information. Then, the evaluation prompts containing the reference information and the first dialogue record can be input into the large language model corresponding to the evaluation agent to obtain the first evaluation information output by the large language model corresponding to the evaluation agent.

[0090] The reference information includes the reference knowledge and reference response information corresponding to the first question. Evaluation prompts are used to prompt the large language model corresponding to the evaluation agent to perform a quality assessment of the evaluation item, and the large language model corresponding to the evaluation agent provides feedback on the error description information corresponding to the first response information.

[0091] Figure 1 The illustrated embodiments already mention that the error description information can indicate planning rewriting error types, recall error types, and generation error types. In practice, planning rewriting error types typically refer to situations where the first response information is incorrect because the first question information is too colloquial or unclear, requiring planning rewriting. Recall error types typically refer to situations where the first response information is incorrect because the first relevant knowledge retrieved is inaccurate, requiring recall and re-retrieval. Generation error types typically refer to situations where the first response information is incorrect because the first question information contains proper nouns, requiring explanation of the proper nouns.

[0092] Optionally, the evaluation item may include at least one of the dialogue quality of the question-and-answer pair and the quality of the question-and-answer process information. When the evaluation item includes the dialogue quality of the question-and-answer pair, since the dialogue quality reflects the quality of the generated first response information, the large language model corresponding to the evaluation agent can determine whether a generation error type exists based on this evaluation item. When the evaluation item includes the quality of the question-and-answer process information, since the quality of the question-and-answer process information reflects the quality of the first question information or the quality of the recalled first relevant knowledge, the large language model corresponding to the evaluation agent can determine whether a planning rewrite error type or a recall error type exists based on this evaluation item.

[0093] In this embodiment, by using evaluation prompts, the large language model corresponding to the evaluation agent can comprehensively evaluate the dialogue quality of the question-answer pair and / or the quality of the question-answer process information. That is, it can accurately identify the errors that the dialogue agent makes when answering user questions, and the large language model corresponding to the evaluation agent can accurately feed back the error description information corresponding to the first response information, so that the subsequent optimization agent can provide more targeted optimization experience.

[0094] As mentioned above, the appropriate optimization agent can be determined based on the different error descriptions reflected in the first evaluation information. The optimization process is illustrated below with examples of several common error scenarios.

[0095] In an optional scenario, when the question-and-answer process includes original query input information generated based on the first question information, errors in the first response information may occur due to inaccurate original query input information. In such cases, the planning rewriting quality of the original query input information can be determined as an evaluation item, and an evaluation prompt word can be generated based on this evaluation item. This evaluation prompt word can then be input into the large language model corresponding to the evaluation agent to obtain the first evaluation information output by the large language model. This first evaluation information can indicate that the error type is a planning rewriting error.

[0096] The quality of the rewritten plan can be quantified by a first quality score. This first quality score is obtained by calculating the relevance between the relevant knowledge retrieved based on the original query input and the reference knowledge. If the first quality score, representing the relevance between the relevant knowledge retrieved based on the original query input and the reference knowledge, is less than a preset threshold, it indicates that the original query input may be inaccurate, causing the recalled relevant knowledge to be irrelevant to the first question information. Consequently, the prompts determined based on this first relevant knowledge may also be inaccurate, thus indicating an error in the first response information. Conversely, if the first quality score is greater than or equal to the threshold, it indicates that the first response information is correct.

[0097] If the score of the planning rewriting quality, i.e. the first quality score, is less than the preset threshold and the error type is the planning rewriting error type, it indicates that there is an error in the original query input information and the original query input information needs to be rewritten. Then, the first optimization agent corresponding to the planning rewriting error type can be determined and the first optimization input data can be generated.

[0098] The first optimized input data may include first question information, original query input information generated based on the first question information, and first evaluation information. It may also include first relevant knowledge, first response information, and at least part of the first prompt words. Optionally, the preset threshold may include 0.5.

[0099] Then, this first optimized input data can be input into the first optimized agent, so that the optimized query input information corresponding to the first question information can be output through the large language model corresponding to the first optimized agent.

[0100] Optionally, the first optimizing agent may use a few-shot optimization strategy to optimize the original query input information to increase the amount of correct query input information.

[0101] For example, such as Figure 5 As shown, assuming the original query input is: question = "What is the average age of our students?", the few-shot optimization strategy can be used to rewrite the original query input into a more concise and efficient SQL statement, resulting in the optimized query input: SQL = "SELECT AVG(age) FROM students". Here, "fewshot_Type" indicates the type of statement to be transformed using the few-shot optimization strategy.

[0102] In this embodiment, for the planning rewriting error type, a first optimization agent corresponding to the planning rewriting error type is used to optimize and rewrite the original query input information to obtain optimized query input information that is correctly described and concise. Furthermore, using this optimized query input information, the prompt words of the large language model corresponding to the input dialogue agent can be better optimized, ensuring the dialogue effect of the online dialogue agent.

[0103] Alternatively, in a scenario where the question-and-answer process includes first-related knowledge retrieved from a predefined knowledge base corresponding to the first question, inaccurate recall of this first-related knowledge might lead to errors in the first response. In such cases, the recall quality of the first-related knowledge can be defined as an evaluation item, and an evaluation prompt word can be generated based on this item. This evaluation prompt word can then be input into the large language model corresponding to the evaluation agent to obtain the first evaluation information output by the large language model. This first evaluation information can indicate that the error type is a recall error.

[0104] The recall quality can be quantified using a second quality score. This second quality score is obtained by calculating the relevance between the reference response information and the first relevant knowledge. If the relevance between the reference response information and the first relevant knowledge, i.e., the second quality score, is less than a preset threshold, it indicates that the reference response information is irrelevant to the first relevant knowledge; that is, the prompt words determined based on this first relevant knowledge may also be inaccurate, thus determining that the first response information is incorrect. Conversely, if the relevance is greater than or equal to the threshold, it is determined that the first response information is not incorrect.

[0105] If the recall quality score, i.e., the second quality score, is less than a preset threshold and the error type is a recall error type, it indicates that the recall of the first relevant knowledge is inaccurate, and it is necessary to re-recall the relevant knowledge corresponding to the first question information. Then, a second optimized agent corresponding to the recall error type can be determined, and second optimized input data can be generated. The second optimized input data may include the first relevant knowledge, and may also include at least some of the following: first evaluation information, the first question information and the first response information as a question-answer pair, and the first prompt word.

[0106] Then, the second optimization input data can be input into the second optimization agent, so that the second optimization agent can output the recall optimization data structure corresponding to the first problem information through the large language model corresponding to the second optimization agent, based on the built-in recall optimization strategy corresponding to the error description information.

[0107] Optionally, the second optimization agent can obtain different recall optimization data structures based on different built-in recall optimization strategies. Specifically, the recall optimization data structure may include a data filtering structure corresponding to the keywords in the first question information, or a scenario filtering structure corresponding to the application scenario to which the first question information belongs. The data filtering structure is used to filter out relevant knowledge from documents in the set knowledge base that match the keywords, and the scenario filtering structure is used to filter out relevant knowledge from documents in the set knowledge base that match the application scenario.

[0108] Furthermore, online dialogue agents can utilize this recall optimization data structure to filter knowledge in a set knowledge base, thereby optimizing the prompts used to input the large language model corresponding to the dialogue agent based on the filtered relevant knowledge.

[0109] The structure of the data filtering structure can be combined Figure 6 Understanding. For example... Figure 6 As shown, the data filtering structure includes optimization strategies, input question information, keywords, and output information obtained after data filtering.

[0110] For example, assuming the optimization strategy used is a data filtering strategy, and the user inputs the question "What was the annual revenue of xx company in 2022?", and the keyword to be filtered is "xx company" determined by using this data filtering strategy, then the data filtering structure can output the knowledge related to "xx company" filtered from the set knowledge base.

[0111] In this embodiment, for recall error types, a second optimization agent corresponding to the recall error type is used to re-optimize the knowledge in the set knowledge base to obtain a data filtering structure corresponding to the keywords in the first question information. Furthermore, using this data filtering structure, relevant knowledge corresponding to the keywords in the first question information can be accurately filtered from the set knowledge base to improve the accuracy of the optimization of prompt words of the large language model corresponding to the input dialogue agent, thereby ensuring the dialogue effect of the online dialogue agent.

[0112] In another optional scenario, when the first question information includes proper nouns, the large language model corresponding to the dialogue agent may generate an error, meaning the large language model outputs an incorrect first response. In this case, the dialogue quality of the question-answer pair can be defined as an evaluation item, and an evaluation prompt word can be generated based on this item. Then, this evaluation prompt word can be input into the large language model corresponding to the evaluation agent to obtain the first evaluation information output by the large language model. This first evaluation information can indicate the error type as a generation error.

[0113] The quality of the question-and-answer pair dialogue can be quantified by a third quality score. This third quality score is obtained by calculating the similarity between the first response and the reference response of the dialogue agent. If the similarity between the first and reference responses, i.e., the third quality score, is less than a preset threshold, it indicates that the first response and the reference response are dissimilar, and thus the first response is deemed to have an error. Conversely, if the similarity is greater than or equal to the threshold, the first response is deemed to have no error.

[0114] If the dialogue quality score, i.e., the third quality score, is less than a preset threshold and the error type is a generation error, indicating that the large language model corresponding to the dialogue agent has generated an error in the first response information, then a third optimizing agent corresponding to the generation error type can be determined, and third optimizing input data can be generated. The third optimizing input data may include first question information, and may also include at least a portion of first evaluation information, first response information, first relevant knowledge, and first prompt words.

[0115] Subsequently, the third optimization input data can be input into the third optimization agent corresponding to the error type. The third optimization agent, based on its built-in generation optimization strategy corresponding to the error description information, outputs a generation optimization data structure corresponding to the first problem information through the corresponding large language model. This generation optimization data structure includes a knowledge enhancement structure corresponding to the proper nouns in the first problem information, containing explanatory information about the proper nouns.

[0116] Furthermore, the online dialogue agent can leverage this knowledge to enhance the interpretation of proper nouns in the first question information, enabling the dialogue agent to better understand the first question information and optimize the prompt words used to input the large language model corresponding to the dialogue agent.

[0117] The structure of the knowledge enhancement architecture can be combined with Figure 7 Understanding. For example... Figure 7 As shown, the knowledge enhancement structure includes optimization strategies, problem information, term names, and term explanations.

[0118] Assuming the optimization strategy is specifically terminology optimization, and the user input question information is specifically "the short-term debt maturity status of xx company in 2023", then the proper noun can be "short-term debt". Correspondingly, the definition can be "short-term bonds are bonds issued to raise short-term funds, usually with a maturity of less than one year".

[0119] In this embodiment, for each generation error type, a third optimization agent corresponding to that error type is used to obtain a generation optimization data structure for resolving the generation error. Furthermore, this generation optimization data structure can be used to augment the knowledge of proper nouns in the first question information, such as by providing explanations, to improve the accuracy of the prompt words optimized by the large language model corresponding to the input dialogue agent, thereby ensuring the dialogue performance of the online dialogue agent.

[0120] The prompt word optimization apparatus of one or more embodiments of the present invention will be described in detail below. Those skilled in the art will understand that these prompt word optimization apparatuses can all be configured using commercially available hardware components through the steps taught in this solution.

[0121] Figure 8 This is a schematic diagram of a prompt word optimization device provided in an embodiment of the present invention, as shown below. Figure 8 As shown, the device includes:

[0122] The acquisition module 11 is used to acquire a first dialogue record generated by an online dialogue agent, wherein the first dialogue record includes a first question and a first response as a question-and-answer pair.

[0123] Evaluation module 12 is used to input the first dialogue record into an offline evaluation agent to obtain first evaluation information output by the large language model corresponding to the evaluation agent. The first evaluation information is used to provide feedback on the error description information corresponding to the first response information.

[0124] The determination module 13 is used to determine the offline optimized agent corresponding to the first evaluation information.

[0125] The optimization module 14 is used to generate optimized input data and input the optimized input data into the optimization agent to obtain optimized output data output by the large language model corresponding to the optimization agent. The optimized input data includes the first evaluation information and at least some information in the first dialogue record. The optimized output data is used to optimize the prompt words of the large language model corresponding to the dialogue agent.

[0126] Add module 15 to add the optimized output data to the optimization experience database for use by the dialogue agent.

[0127] The first dialogue record includes question-and-answer process information, which includes first relevant knowledge retrieved from a set knowledge base corresponding to the first question information, and first prompt words generated based on the first relevant knowledge and the first question information.

[0128] Optionally, the adding module 15 is configured to generate optimized query input information based on the first question information and the optimized output data; retrieve a set knowledge base based on the optimized query input information to obtain optimized related knowledge; generate optimized prompt words based on the first question information and the optimized related knowledge, and input the optimized prompt words into the large language model corresponding to the dialogue agent to obtain optimized response information; input a second dialogue record into the evaluation agent to obtain second evaluation information output by the large language model corresponding to the evaluation agent, wherein the second dialogue record includes the first question information, the optimized response information, the optimized related knowledge, and the optimized prompt words; if the second evaluation information reflects that the optimized response information is correct, then the optimized output data is added to the optimization experience database.

[0129] Optionally, the device further includes a response information generation module 16, configured to receive second question information input by a user into the dialogue agent; determine target optimization output data matching the second question information from the optimization experience database; generate query input information based on the second question information and the target optimization output data; retrieve a set knowledge base based on the query input information to obtain second related knowledge; and generate a second prompt word based on the second question information and the second related knowledge, so as to input the second prompt word into the large language model corresponding to the dialogue agent to obtain second response information.

[0130] Optionally, the evaluation module 12 is used to input evaluation prompts containing the first dialogue record and reference information into the large language model corresponding to the evaluation agent to obtain the first evaluation information output by the large language model corresponding to the evaluation agent. The evaluation prompts are used to prompt the large language model corresponding to the evaluation agent to perform quality evaluation on the evaluation items and provide feedback on the error description information corresponding to the first response information. The evaluation items include at least one of the following: the dialogue quality of the question-answer pair, the quality of the question-answer process information, the reference information including reference knowledge and reference response information corresponding to the first question information, and the error description information indicating the error type.

[0131] Optionally, the question-and-answer process information includes original query input information generated based on the first question information, which is used to query first related knowledge in a set knowledge base corresponding to the first question information; the quality of the question-and-answer process information includes the planning rewriting quality of the original query input information; based on this, the optimization module 14 is used to generate first optimized input data if the score of the planning rewriting quality is less than a preset threshold and the error type is a planning rewriting error type, the first optimized input data including the original query input information and the first question information; the first optimized input data is input into the first optimization agent corresponding to the planning rewriting error type, so as to output optimized query input information corresponding to the first question information through the large language model corresponding to the first optimization agent.

[0132] Optionally, the question-and-answer process information includes first relevant knowledge retrieved from a set knowledge base corresponding to the first question information; the quality of the question-and-answer process information includes the recall quality of the first relevant knowledge; based on this, the optimization module 14 is further configured to generate second optimization input data if the recall quality score is less than a preset threshold and the error type is a recall error type, the second optimization input data including the first relevant knowledge; input the second optimization input data into the second optimization agent corresponding to the recall error type, so that the second optimization agent outputs a recall optimization data structure corresponding to the first question information through the corresponding large language model according to the built-in recall optimization strategy corresponding to the error description information, wherein the recall optimization data structure includes a data filtering structure corresponding to the keywords in the first question information, the data filtering structure being used to filter out relevant knowledge in documents in the set knowledge base that match the keywords.

[0133] Optionally, the optimization module 14 is further configured to generate third optimization input data if the dialogue quality score of the question-answer pair is less than a preset threshold and the error type is a generation error type, wherein the third optimization input data includes the first question information; input the third optimization input data into the third optimization agent corresponding to the generation error type, so that the third optimization agent outputs a generation optimization data structure corresponding to the first question information through the corresponding large language model according to the built-in generation optimization strategy corresponding to the error description information, wherein the generation optimization data structure includes a knowledge enhancement structure corresponding to the proper nouns in the first question information, and the knowledge enhancement structure contains explanatory information of the proper nouns.

[0134] Figure 8 The device shown can perform Figures 1 to 7 For the methods shown in the embodiments, the parts not described in detail in this embodiment can be referred to the following: Figures 1 to 7 The relevant descriptions of the illustrated embodiments are provided below. For the execution process and technical effects of this technical solution, please refer to [link / reference]. Figures 1 to 7 The descriptions in the illustrated embodiments will not be repeated here.

[0135] In one possible design, the prompt word optimization methods provided in the above embodiments can be applied to an electronic device, such as... Figure 9 As shown, the electronic device may include a processor 21 and a memory 22. The memory 22 is used to store data that supports the electronic device in performing the above-described actions. Figures 1 to 7 In the illustrated embodiment, the program for the prompt word optimization method is configured to execute a program stored in memory 22.

[0136] The program includes one or more computer instructions, wherein the one or more computer instructions, when executed by processor 21, can perform the following steps:

[0137] Acquire a first dialogue record generated by an online dialogue agent, the first dialogue record including a first question and a first response as a question-and-answer pair;

[0138] The first dialogue record is input into an offline evaluation agent to obtain the first evaluation information output by the large language model corresponding to the evaluation agent. The first evaluation information is used to provide feedback on the error description information corresponding to the first response information.

[0139] Identify the offline optimized agent corresponding to the first evaluation information;

[0140] Optimized input data is generated and input into the optimization agent to obtain optimized output data of the large language model corresponding to the optimization agent. The optimized input data includes the first evaluation information and at least some information in the first dialogue record. The optimized output data is used to optimize the prompt words of the large language model corresponding to the dialogue agent.

[0141] The optimized output data is added to the optimization experience database for use by the dialogue agent.

[0142] Optionally, the processor 21 is also used to perform the aforementioned Figures 1 to 7 All or part of the steps in the illustrated embodiments.

[0143] The structure of the electronic device may also include a communication interface 23 for the electronic device to communicate with other devices or communication systems.

[0144] In addition, embodiments of the present invention provide a computer storage medium for storing computer software instructions used by the aforementioned electronic device, which includes instructions for executing the above-mentioned... Figures 1 to 7 The procedure involved in the prompt word optimization method shown.

[0145] In addition, embodiments of the present invention provide a computer program product. This computer program product includes a computer program or instructions. When the computer program or instructions are executed by a processor, the processor is able to perform the above-described functions. Figures 1 to 7 The steps or functions of the method shown.

[0146] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method of prompt word optimization, the method comprising: The method comprises: obtaining a first dialogue record generated by an online dialogue agent, the first dialogue record comprising first question information and first response information as a question and answer pair; inputting the first dialogue record into an offline evaluation agent to obtain first evaluation information output by a large language model corresponding to the evaluation agent, the first evaluation information being used to feed back error description information corresponding to the first response information; determining an offline optimization agent corresponding to the first evaluation information; generating optimization input data, inputting the optimization input data into the optimization agent to obtain optimization output data output by a large language model corresponding to the optimization agent, the optimization input data comprising at least part of the information in the first dialogue record and the first evaluation information, the optimization output data being used to optimize a prompt word input into a large language model corresponding to the dialogue agent; adding the optimization output data to an optimization experience database for being called by the dialogue agent.

2. The method of claim 1, wherein, The adding of the optimization output data to the optimization experience database comprises: generating optimized query input information according to the first question information and the optimization output data; retrieving a set knowledge base according to the optimized query input information to obtain optimized related knowledge; generating an optimized prompt word according to the first question information and the optimized related knowledge, and inputting the optimized prompt word into a large language model corresponding to the dialogue agent to obtain an optimized response information; inputting a second dialogue record into the evaluation agent to obtain second evaluation information output by a large language model corresponding to the evaluation agent, the second dialogue record comprising the first question information, the optimized response information, the optimized related knowledge, and the optimized prompt word; if the second evaluation information reflects that the optimized response information is correct, adding the optimization output data to the optimization experience database.

3. The method of claim 1, wherein, The first dialogue record comprises question and answer process information, the question and answer process information comprising first related knowledge corresponding to the first question information retrieved from a set knowledge base, and a first prompt word generated according to the first related knowledge and the first question information.

4. The method of claim 1, wherein, The method further comprises: receiving second question information input by a user into the dialogue agent; determining target optimization output data matched with the second question information from the optimization experience database; generating query input information according to the second question information and the target optimization output data; retrieving a set knowledge base according to the query input information to obtain second related knowledge; generating a second prompt word according to the second question information and the second related knowledge, and inputting the second prompt word into a large language model corresponding to the dialogue agent to obtain a second response information.

5. The method of claim 1, wherein, The inputting of the first dialogue record into an offline evaluation agent to obtain first evaluation information output by a large language model corresponding to the evaluation agent comprises: inputting the evaluation prompt word containing the first dialogue record and the reference information into the large language model corresponding to the evaluation agent to obtain first evaluation information output by the large language model corresponding to the evaluation agent, wherein the evaluation prompt word is used to prompt the large language model corresponding to the evaluation agent to perform quality evaluation on an evaluation item and feed back error description information corresponding to the first response information, wherein the evaluation item includes at least one of the following: dialogue quality of the question and answer pair, quality of the first question and answer process information, the reference information includes reference knowledge and reference response information corresponding to the first question information, and the error description information indicates an error type.

6. The method of claim 5, wherein, The question and answer process information includes original query input information generated based on the first question information, and the original query input information is used to query first related knowledge corresponding to the first question information in a set knowledge base; The quality of the question and answer process information includes planning rewriting quality of the original query input information; The generation of the optimization input data and the input of the optimization input data into the optimization agent to obtain optimization output data output by the large language model corresponding to the optimization agent include: If the score of the planning rewriting quality is less than a preset threshold and the error type is a planning rewriting error type, first optimization input data is generated, and the first optimization input data includes the original query input information and the first question information; The first optimization input data is input into a first optimization agent corresponding to the planning rewriting error type, so that the large language model corresponding to the first optimization agent outputs optimized query input information corresponding to the first question information.

7. The method of claim 5, wherein, The question and answer process information includes first related knowledge corresponding to the first question information retrieved from a set knowledge base; and the quality of the question and answer process information includes recall quality of the first related knowledge; The generation of the optimization input data and the input of the optimization input data into the optimization agent to obtain optimization output data output by the large language model corresponding to the optimization agent include: If the score of the recall quality is less than a preset threshold and the error type is a recall error type, second optimization input data is generated, and the second optimization input data includes the first related knowledge; The second optimization input data is input into a second optimization agent corresponding to the recall error type, so that the second optimization agent outputs a recall optimization data structure corresponding to the first question information according to a built recall optimization strategy corresponding to the error description information through the corresponding large language model, wherein the recall optimization data structure includes a data filtering structure corresponding to a keyword in the first question information, and the data filtering structure is used to filter related knowledge in a document in the set knowledge base that matches the keyword.

8. The method of claim 5, wherein, The generation of the optimization input data and the input of the optimization input data into the optimization agent to obtain optimization output data output by the large language model corresponding to the optimization agent include: If the dialogue quality score of the question-answer pair is less than a preset threshold and the error type is a generation error type, then third optimized input data is generated, and the third optimized input data includes the first question information; The third optimization input data is input into the third optimization agent corresponding to the generated error type. The third optimization agent outputs a generated optimization data structure corresponding to the first problem information through the corresponding large language model according to the built-in generation optimization strategy corresponding to the error description information. The generated optimization data structure includes a knowledge enhancement structure corresponding to the proper nouns in the first problem information. The knowledge enhancement structure contains explanation information of the proper nouns.

9. An electronic device, comprising: include: The device includes a memory, a processor, and a communication interface; wherein the memory stores executable code, and when the executable code is executed by the processor, the processor performs the prompt word optimization method as described in any one of claims 1 to 8.

10. A non-transitory machine-readable storage medium, comprising: The non-transitory machine-readable storage medium stores executable code that, when executed by a processor of an electronic device, causes the processor to perform the prompt word optimization method as described in any one of claims 1 to 8.

11. A computer program product, characterised in that, include: A computer program, when executed by a processor of an electronic device, causes the processor to perform the prompt word optimization method as described in any one of claims 1 to 8.