Prompt word optimization method and device, equipment, medium and product

By evaluating and optimizing the error sample information of prompt words, using the language model to generate prompt words that are more suitable for business reality, solving the problem of lack of targeted and adaptable prompt word optimization in the existing technology, and achieving more efficient prompt word optimization results .

CN119180351AActive Publication Date: 2024-12-24BEIJING ZITIAO NETWORK TECH CO LTD

Patent Information

Application Number
CN202411331367.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-23
Publication Date
2024-12-24
Estimated Expiration
2044-09-23

AI Technical Summary

Technical Problem

The existing technology is difficult to meet the task processing needs in different businesses, the optimization of prompt words is not targeted, manual optimization is inefficient, and automatic optimization methods are difficult to adapt to model upgrade or switching.

Method used

By obtaining the prompt words and business data sample sets associated with the target business, evaluating the error sample information of the prompt words, optimizing the prompt words using the language model to generate optimized prompt words that are more suitable for the actual business.

Benefits of technology

The prompting ability and prompt effect of optimized prompt words in the target business has been improved, adapting to different business needs, and improving the optimization efficiency and applicability of prompt words.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119180351A_ABST
    Figure CN119180351A_ABST
Patent Text Reader

Abstract

The invention provides a cue word optimization method and device, equipment, a medium and a product, and the method comprises the steps: obtaining at least one first cue word related to a target business, and obtaining a business data sample set related to the target business; for each first cue word in the at least one first cue word, executing the following steps: acquiring a first evaluation result of the first cue word on a business data sample set, and determining error sample information corresponding to the first cue word based on the first evaluation result; sending a target cue word used for optimizing the first cue word to a first language model; and obtaining a second cue word output by the first language model. In the method, aiming at the cue word to be optimized, the task processing effect of the cue word in a business data sample set is evaluated, the cue word is optimized by combining related information of an error data sample and utilizing a language model, the cue capability of the optimized cue word in a target business is improved, and the cue effect of the cue word is optimized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a prompt word optimization method, device, electronic device, computer-readable storage medium, and computer program product. Background Art

[0002] With the continuous development of computer technology and natural language processing (NLP) technology, the scale of language models has gradually expanded. In order to obtain better model reasoning effects, prompt learning came into being.

[0003] Prompt learning refers to the transformation of downstream tasks through prompt words without changing the parameters of the pre-trained language model, so that the pre-trained language model can better understand the downstream tasks and thus obtain better model reasoning effects.

[0004] In prompt learning, the design of prompt words is particularly important. In related technologies, technicians can use language models to achieve automatic optimization of prompt words. However, the above method is difficult to meet the task processing requirements in different businesses. Summary of the invention

[0005] The present application provides a method for optimizing prompt words. The method can improve the prompt effect of prompt words in specific services. The present application also provides a device, an electronic device, a computer-readable storage medium, and a computer program product corresponding to the above method.

[0006] In a first aspect, the present application provides a method for optimizing a prompt word, the method comprising:

[0007] Acquire at least one first prompt word associated with a target business, and acquire a business data sample set related to the target business; wherein the data samples in the business data sample set include a labeling result;

[0008] For each first prompt word in the at least one first prompt word, perform the following steps:

[0009] Obtain a first evaluation result of the first prompt word on the business data sample set, and determine error sample information corresponding to the first prompt word based on the first evaluation result; send a target prompt word for optimizing the first prompt word to a first language model, wherein the target prompt word includes the first prompt word and the error sample information corresponding to the first prompt word; and obtain a second prompt word output by the first language model.

[0010] In a second aspect, the present application provides a prompt word optimization device, the device comprising:

[0011] An acquisition module, used to acquire at least one first prompt word associated with a target business, and to acquire a business data sample set related to the target business; wherein the data samples in the business data sample set include a labeling result;

[0012] The execution module is used to perform the following steps for each first prompt word of the at least one first prompt word: obtain a first evaluation result of the first prompt word on the business data sample set, and determine error sample information corresponding to the first prompt word based on the first evaluation result; send a target prompt word for optimizing the first prompt word to the first language model, wherein the target prompt word includes the first prompt word and the error sample information corresponding to the first prompt word; and obtain a second prompt word output by the first language model.

[0013] In a third aspect, the present application provides an electronic device, the electronic device comprising a processor and a memory. The processor and the memory communicate with each other. The processor is used to execute instructions stored in the memory, so that the electronic device performs the optimization method of the prompt word in the first aspect or any implementation of the first aspect.

[0014] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, wherein the instructions instruct an electronic device to execute the method for optimizing prompt words described in the first aspect or any one of the implementations of the first aspect.

[0015] In a fifth aspect, the present application provides a computer program product comprising instructions, which, when executed on an electronic device, enables the electronic device to execute the method for optimizing prompt words as described in the first aspect or any one of the implementations of the first aspect.

[0016] Based on the implementations provided in the above aspects, this application can also be further combined to provide more implementations.

[0017] It can be seen from the above technical solutions that this application has the following advantages:

[0018] The present application provides a method for optimizing prompt words. The method first obtains at least one first prompt word associated with a target business, and obtains a business data sample set related to the target business, wherein the data samples in the business data sample set include annotation results. Then, for each first prompt word in the at least one first prompt word, the following steps are performed: obtaining a first evaluation result of the first prompt word on the business data sample set, determining error sample information corresponding to the first prompt word based on the first evaluation result, sending a target prompt word for optimizing the first prompt word to a first language model, wherein the target prompt word includes the first prompt word and the error sample information corresponding to the first prompt word, and obtaining a second prompt word output by the first language model.

[0019] In this method, for the prompt word to be optimized (i.e., the first prompt word), its task processing effect in the business data sample set is evaluated, and by comparing the annotation results and the evaluation results, the wrong data samples with wrong judgments are found, and the language model is used to optimize the prompt word in combination with the relevant information of the wrong data samples. In this way, the prompt ability of the optimized prompt word (i.e., the second prompt word) in the target business can be improved, and the prompt effect of the prompt word can be optimized. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical method of the embodiments of the present application, the drawings required for use in the embodiments are briefly introduced below.

[0021] Figure 1 A flowchart of a method for optimizing prompt words provided in an embodiment of the present application;

[0022] Figure 2 A flowchart of a method for optimizing prompt words provided in an embodiment of the present application;

[0023] Figure 3 A flowchart of a method for optimizing prompt words provided in an embodiment of the present application;

[0024] Figure 4 A schematic diagram of the structure of a prompt word optimization device provided in an embodiment of the present application;

[0025] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0026] The terms "first" and "second" in the embodiments of the present application are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features.

[0027] First, some technical terms and application scenarios involved in the embodiments of this application are introduced.

[0028] Natural language processing (NLP) is a machine learning technology that enables computing devices to interpret, process and understand human language. Computing devices can complete a variety of tasks based on natural language processing, including but not limited to part-of-speech tagging, word sense disambiguation, speech recognition, machine translation, sentiment analysis, etc.

[0029] With the continuous development of natural language processing technology, the industry has seen the emergence of a natural language processing paradigm of "pre-training + prompt + prediction". The "pre-training + prompt + prediction" paradigm uses a pre-trained language model based on prompt learning to perform natural language processing. There is no need to apply the pre-trained language model to downstream tasks for parameter fine-tuning, that is, the parameters of the pre-trained language model are not changed, and the downstream tasks are transformed through prompt words, so that the pre-trained language model can better understand the downstream tasks.

[0030] Specifically, the prompt word usually includes a placeholder, and the user's input text or other text is filled into the placeholder of the prompt word to form a complete prompt information.

[0031] Taking the downstream task of "text classification" as an example, the pre-trained language model needs to analyze the user's input text and output the classification result of the input text. For example, the user's input text is "The plot is smooth, the actors' acting skills are good, and the special effects are also very good", and the prompt word is "The user's evaluation of this movie is {{xxx}}". The prompt word prompts the pre-trained language model to perform text classification, so that the pre-trained language model can output the classification result of the input text (such as positive evaluation category or negative evaluation category). In this way, the pre-trained language model can better understand the downstream tasks and generate accurate model output.

[0032] Considering the increasing amount of training corpus and the continuous breakthroughs in model ontology technology, the capabilities of pre-trained language models are also continuously improving, and prompt words should also be updated and optimized accordingly. In related technologies, the methods of optimizing prompt words are mainly divided into manual optimization and automatic optimization.

[0033] Manual optimization of prompt words can be understood as manual adjustment of prompt words by technical personnel. Manual optimization of prompt words is inefficient, and the optimization experience of technical personnel is not universal enough. When the language model is upgraded or switched, the original optimization experience may not be applicable.

[0034] In the method of automatically optimizing prompt words, a language model is usually used as a prompt word generator. For example, the prompt word is scored using the language model, and then the score of the prompt word and the prompt word are input into the language model together, so that the language model combines the score to generate an optimized prompt word.

[0035] However, in the above-mentioned method of automatically optimizing prompt words, it is difficult to meet the task processing requirements in different businesses, and the optimization of prompt words lacks pertinence.

[0036] In view of this, the present application provides a method for optimizing prompt words. The method first obtains at least one first prompt word associated with a target business, and obtains a business data sample set related to the target business, wherein the data samples in the business data sample set include annotation results, and then, for each first prompt word in the at least one first prompt word, performs the following steps: obtain a first evaluation result of the first prompt word on the business data sample set, determine error sample information corresponding to the first prompt word based on the first evaluation result, send a target prompt word for optimizing the first prompt word to a first language model, wherein the target prompt word includes the first prompt word and the error sample information corresponding to the first prompt word, and obtain a second prompt word output by the first language model.

[0037] In this method, for the prompt word to be optimized (i.e., the first prompt word), its task processing effect in the business data sample set is evaluated, and by comparing the annotation results and the evaluation results, the wrong data samples with wrong judgments are found, and the language model is used to optimize the prompt word in combination with the relevant information of the wrong data samples. In this way, the prompt ability of the optimized prompt word (i.e., the second prompt word) in the target business can be improved, and the prompt effect of the prompt word can be optimized.

[0038] To facilitate understanding of the technical solution provided by the embodiments of the present application, it will be described below with reference to the accompanying drawings.

[0039] See also Figure 1 The flowchart of a method for optimizing a prompt word provided in an embodiment of the present application is shown, and the method specifically includes:

[0040] S101: Acquire at least one first prompt word associated with a target business, and acquire a business data sample set related to the target business.

[0041] In the embodiment of the present application, the first prompt word can be understood as a prompt word to be optimized, and the target business can be any business associated with the first prompt word.

[0042] The target business may be associated with a target task, wherein the target task may be any natural language processing task. In other words, in the process of processing the target task with the aid of a language model, the first prompt word may assist the language model in processing the target task.

[0043] Different target businesses may correspond to different target tasks, and thus may correspond to different first prompt words. For example, when the target business is customer service, the target task may be to judge the service quality of the customer service based on the conversation content, and the first prompt word may be "The conversation content between the customer service and the customer is {{xxx}}, please give the service quality of the customer service." For another example, when the target business is document management, the target task may be to score the document, and the first prompt word may be "The document content is {{xxx}}, please give the document score."

[0044] The business data sample set usually includes multiple data samples, and the data samples are related to the target business. In some embodiments, the data samples in the business data sample set can be real business data, such as business data generated during the operation of the target business. In other embodiments, the data samples in the business data sample set can also be generated business data, such as test business data generated in combination with the business logic of the target business, or business data collected by other data collection methods, which is not limited in the embodiments of the present application.

[0045] In an embodiment of the present application, data samples in a business data sample set may be pre-labeled, that is, the data samples in the business data sample set include labeling results. Generally, the labeling results can be understood as labels, and the labeling results can represent the reference evaluation or benchmark evaluation of the data samples in the target task.

[0046] For example, when the target business is customer service and the target task is to judge the service quality of customer service, the labeling results of the data sample can be "excellent", "good", "qualified" and "unqualified". For another example, when the target business is document management and the target task is to score documents, the labeling results of the data sample can be scores such as "90", "80", "75" and "60".

[0047] The embodiments of the present application do not limit the method of annotating data samples. For example, data samples can be annotated manually (such as business personnel, annotators), or data samples can be automatically annotated by an annotation model, an annotation tool, etc.

[0048] For each first prompt word in the at least one first prompt word, the following S102 to S104 are performed:

[0049] S102: Obtain a first evaluation result of the first prompt word on the business data sample set, and determine error sample information corresponding to the first prompt word based on the first evaluation result.

[0050] The first prompt word may be understood as the first prompt word currently being optimized, and the first evaluation result may be understood as the evaluation of the data sample in the target task after the target task is processed with the help of the first prompt word.

[0051] That is to say, in the embodiment of the present application, the first prompt word is actually applied in the target task, and the evaluation result of the data sample after the target task is processed by applying the first prompt word is obtained, and then the prompt ability of the first prompt word is evaluated.

[0052] The above process can be implemented with the help of a second language model. The second language model can be understood as a model that has the ability to understand and generate natural language and can process different natural language tasks. For example, the second language model can be a deep learning model trained using text data.

[0053] In a specific implementation, a first evaluation prompt word for evaluating the first prompt word is sent to the second language model, and a first evaluation result output by the second language model is received, wherein the first evaluation prompt word includes the first prompt word and a business data sample set.

[0054] In other words, by evaluating the prompting ability of the first evaluation prompt word, the second language model is instructed to use the first prompt word to process the data samples in the business data sample set for the target task, thereby generating a first evaluation result of the data samples in the business data sample set. In this way, the evaluation of the prompting ability of the first prompt word in actual business is achieved.

[0055] The error sample information may be understood as information related to the error data sample. Specifically, the error sample information may include the error data sample, the labeling result of the error data sample, and the first evaluation result of the error data sample.

[0056] The erroneous data sample may be a data sample whose first evaluation result is inconsistent with the labeling result. In other words, the erroneous data sample refers to a data sample whose evaluation output by the language model is different from the reference evaluation when the target task is processed with the help of the first prompt word, that is, a data sample in which an error occurs under the prompt capability of the first prompt word.

[0057] In the embodiment of the present application, the error data samples, the annotation results of the error data samples and the first evaluation results of the error data samples are collected so as to subsequently optimize the first prompt word in combination with the error sample information.

[0058] In some possible implementations, the error sample information may also be output by the second language model. Specifically, the first evaluation prompt word may also indicate the method for determining the error data sample and the content of the error sample information. In this way, through the prompt capability of the first evaluation prompt word, the second language model may also output the error sample information after generating the first evaluation result.

[0059] It should be noted that the above process can also be implemented in other ways, for example, by using a machine learning algorithm to obtain the first evaluation result and error sample information.

[0060] In some embodiments, the data samples in the business data sample set may further include a marking reason, wherein the marking reason may indicate the reason for generating the marking result, that is, the marking reason may be used to explain the marking result of the data sample in the business data sample set.

[0061] The marking reason can be presented in the form of business rules. For example, when the target business is customer service, the marking result of a data sample is "unqualified", and the marking reason can be "customer service did not ask questions". For another example, when the target business is document management, the marking result of a data sample is "60", and the marking reason can be "document content format error".

[0062] When the error sample information includes multiple error data samples, the error data samples may be sorted. Specifically, the multiple error data samples are sorted according to the degree of difference between the first evaluation results and the annotation results of the multiple error data samples, and / or the number of occurrences of the annotation reasons of the multiple error data samples in the business data sample set, to obtain the sorting results of the multiple error data samples, and in the error sample information corresponding to the first prompt word, the multiple error sample data are arranged according to the sorting results of the multiple error data samples.

[0063] The difference between the first evaluation result and the labeling result can be understood as the prediction error of the target task processed by the first prompt word. For example, when the task type indicated by the first prompt word (i.e., the task type of the target task) is a regression task, the labeling result of the wrong data sample is 90, the first evaluation result of the wrong data sample is 70, and the difference between the first evaluation result and the labeling result is 20.

[0064] The number of occurrences of the labeling reason of the erroneous data sample in the business data sample set can be understood as the number of data samples in the business data sample set. For example, the number of data samples in the business data sample set is 100, and the labeling reason of the erroneous data sample is labeling reason A. Among the 100 data samples, there are 40 data samples with the labeling reason A. At this time, the number of occurrences of labeling reason A in the business data sample set is 40.

[0065] In the embodiment of the present application, the error sample information is integrated in combination with the sorting results of multiple error data samples to form an error data sample sequence in the error sample information, wherein in the error data sample sequence, information related to the error data sample is arranged according to the sorting results.

[0066] For example, the erroneous data samples include erroneous data sample A, erroneous data sample B and erroneous data sample C, and the sorting results are erroneous data sample B, erroneous data sample A, erroneous data sample C. At this time, the erroneous data sample sequence in the erroneous sample information can be: {erroneous data sample B, the labeling result of erroneous data sample B, the first sorting result of erroneous data sample B}, {erroneous data sample A, the labeling result of erroneous data sample A, the first sorting result of erroneous data sample A}, {erroneous data sample C, the labeling result of erroneous data sample C, the first sorting result of erroneous data sample C}.

[0067] In some possible implementations, the greater the difference between the first evaluation result and the labeling result, the higher the ranking of the erroneous data sample, and the more times the labeling reason of the erroneous data sample appears in the business data sample set, the higher the ranking of the erroneous data sample. In this way, when subsequently optimizing the first prompt word, focus on the erroneous sample information related to the erroneous data samples with a large degree of difference and / or the erroneous sample information related to the erroneous data samples with a large number of labeling reasons, so as to further improve the optimization effect.

[0068] S103: Sending a target prompt word for optimizing the first prompt word to the first language model.

[0069] S104: Obtain a second prompt word output by the first language model.

[0070] In the embodiment of the present application, the optimization of the prompt words is achieved with the help of the first language model, and the first language model can be understood as a language model used to optimize the prompt words. The first language model can be understood as a model that has the ability to understand and generate natural language and can process different natural language tasks. For example, the first language model can be a deep learning model trained using text data.

[0071] It should be noted that the first language model and the second language model can be the same language model or different language models. Furthermore, the first language model and the second language model can be flexibly selected according to business requirements, and the first language model and the second language model can be publicly deployed or privately deployed, which is not limited in the embodiments of the present application.

[0072] The target prompt word can be understood as a prompt word used to optimize the first prompt word. In other words, through the prompt ability of the target prompt word, the first language model is instructed to optimize the first prompt word in combination with the error sample information to generate the optimized second prompt word. In this way, the first language model learns and understands the error sample information, and optimizes the prompt word in combination with the business data sample set, so that the optimized second prompt word is more in line with the actual business and has better prompt ability.

[0073] In some possible implementations, the target prompt word may be presented in the following form:

[0074] "You are a professional prompt word optimization master. You are responsible for reflecting on the incorrect results obtained by sample judgment based on the given prompt words and the language model. You need to carefully analyze the given prompt words, and then carefully analyze why the prompt words get the wrong results for the given business data samples. Through analysis and reflection, you need to output optimized prompt words with structured information such as roles, goals, and key business rules, so that the optimized prompt words can better get the correct judgment results for the given samples.

[0075] The input includes prompt words and error sample information. The error sample information contains a series of information related to the error data sample. Each information related to the error data sample consists of the error data sample, the evaluation result of the error data sample, the labeling result and the labeling reason of the labeling result. Different samples represent the conversation content of different engineers.

[0076] Tips:

[0077] {{prompt}}

[0078] Sample error message:

[0079] {{examples}}

[0080] Please combine the above information and directly output optimized prompt words with structured information. "

[0081] In this method, for the prompt word to be optimized (i.e., the first prompt word), its task processing effect in the business data sample set is evaluated, and by comparing the annotation results and the evaluation results, the wrong data samples with wrong judgments are found, and the language model is used to optimize the prompt word in combination with the relevant information of the wrong data samples. In this way, the prompt ability of the optimized prompt word (i.e., the second prompt word) in the target business can be improved, and the prompt effect of the prompt word can be optimized.

[0082] The above article describes the optimization process of the first prompt word. After the optimization of the first prompt word is completed, the optimization effect can be further evaluated.

[0083] In some embodiments, the second prompt word includes multiple prompt words. For example, when the first prompt word includes multiple prompt words, batch optimization is performed on the multiple first prompt words to obtain multiple second prompt words.

[0084] Considering that the optimized second prompt word has not been processed for the target task, the prompting ability of the second prompt word cannot be known, therefore, the second prompt word can also be actually applied in the target task. Specifically, the optimization effect of each second prompt word is determined, and according to the optimization effect of each second prompt word, the third prompt word is determined from at least one second prompt word.

[0085] In the embodiment of the present application, the optimization effect can be determined based on the second evaluation result and the annotation result of the business data sample set. The second evaluation result of the business data sample set can be understood as the evaluation of the data sample in the target task after the target task is processed with the help of the second prompt word.

[0086] That is to say, the optimized second prompt word is actually applied in the target task, and the prompt ability of the second prompt word is evaluated through the evaluation results of the business data sample after the second prompt word is applied to process the target task, so as to determine the optimization effect of the prompt word.

[0087] Specifically, the optimization effect can be the ratio of the number of data samples whose second evaluation results and annotation results meet the set conditions to the number of business data samples in the business data sample set. That is, the optimization effect can be represented in the form of a score. For example, when the number of data samples whose second evaluation results and annotation results meet the set conditions is 80 and the number of data samples in the business data sample set is 100, the optimization effect can be 0.8.

[0088] Different target tasks may have different setting conditions. For example, when the target task type is a classification task, the setting condition may be that the second evaluation result is the same as the labeling result. For another example, when the target task type is a regression task, the setting condition may be that the difference between the second evaluation result and the labeling result is less than a difference degree threshold.

[0089] Similarly, the above process can also be implemented with the help of a second language model. In specific implementation, for each second prompt word, the following steps are performed: sending a second evaluation prompt word for evaluating the optimization effect of the second prompt word to the second language model, and receiving the optimization effect output by the second language model. The second evaluation prompt word includes the second prompt word, a business data sample set, and a method for determining the optimization effect.

[0090] In other words, through the prompting ability of the second evaluation prompt word, the second language model is instructed to use the second prompt word to process the data samples in the business data sample set for the target task, generate the second evaluation result of the data samples in the business data sample set, and determine the optimization effect in combination with the second evaluation result. In this way, the prompting ability of the second prompt word in the actual business is evaluated, and then the optimization effect of the prompt word is determined.

[0091] After determining the optimization effect of the second prompt word, the second prompt words may be screened to determine the third prompt word. For example, when the optimization effect is represented in the form of a score, the optimization effects of the second prompt words may be sorted from high to low, and the top-K second prompt words may be screened as the third prompt word.

[0092] In this way, after the prompt word optimization is completed, the prompt ability of the optimized prompt words is evaluated in actual business, and the prompt words that perform well in actual business are selected for actual use, thereby ensuring the effect of the optimized prompt words in actual business.

[0093] Based on the optimization method of prompt words described in the above content, the embodiment of the present application can also provide a framework for optimizing prompt words. Figure 2 As shown, the first prompt word can be generated from the initial prompt word, and the prompt ability of the first prompt word is evaluated with the help of the second language model to obtain error sample information, and then, combined with the error sample information, the first prompt word is optimized with the help of the first language model to generate the second prompt word. Then, the prompt ability of the second prompt word is evaluated with the help of the second language model to obtain the optimization effect, and then, combined with the optimization effect, the third prompt word is selected from the second prompt word.

[0094] In some embodiments, there are multiple rounds of optimization processes for optimizing the prompt word. Specifically, the third prompt word can be determined as the first prompt word in the next round of optimization process, so as to optimize the third prompt word in the next round of optimization process.

[0095] That is to say, after optimizing the first prompt word and selecting a third prompt word with better prompting ability from the optimized second prompt word, the third prompt word can be further optimized to enhance the relevance of the prompt word to the target business and continue to improve the prompting ability of the prompt word.

[0096] It should be noted that the embodiment of the present application does not limit the number of iterative cycles of the optimization process. For example, a loop termination condition can be pre-set, and after the loop termination condition is reached, the prompt word generated in the last round of optimization process is used as the final prompt word.

[0097] The following describes the process of generating the first prompt word from the initial prompt word.

[0098] In actual applications, the number of initial prompt words associated with the target business may be small, for example, there is only one initial prompt word associated with the target business. In this case, the first prompt word can be generated from the initial prompt word in different ways, and the number of prompt words can be enriched on the basis of preliminary optimization of the prompt words, so as to achieve better optimization effect in the future.

[0099] In some possible implementations, the process of generating the first prompt word from the initial prompt word is implemented with the help of a third language model, and the third language model can be understood as a language model for initial optimization of the prompt word. The third language model can be understood as a model that has the ability to understand and generate natural language and can process different natural language tasks. For example, the third language model can be a deep learning model trained using text data.

[0100] Similarly, the third language model may be the same language model as the first language model and the second language model, or may be a different language model from the first language model or the second language model, which is not limited in the embodiments of the present application.

[0101] In specific implementation, the initial prompt word is first obtained, an optimized prompt word for optimizing the initial prompt word is sent to the third language model, and at least one first prompt word output by the third language model is received, wherein the optimized prompt word includes the initial prompt word.

[0102] By optimizing the prompting ability of the prompting words, the third language model is instructed to optimize the initial prompting words to generate the first prompting words. In this way, the initial prompting words with low quality are preliminarily optimized, so that the generated first prompting words are logically smooth, and the prompting ability of the prompting words is enhanced to a certain extent, thereby improving the optimization efficiency of subsequent prompting words.

[0103] In some embodiments, the optimization prompt words may be presented in the following forms:

[0104] “You are a professional prompt word optimization master. Please fully understand the input prompt words, and then output optimized prompt words with structured information such as roles, goals, and key business rules.

[0105] The input prompt words are as follows:

[0106] {{prompt}}

[0107] Please output optimized prompt words with structured information. "

[0108] In other embodiments, the data samples in the business data sample set include the marking reasons. In this case, the optimization prompt words may also include the marking reasons. In this way, when the third language model optimizes the initial prompt words, it can learn the business rules related to the target task by optimizing the marking reasons in the prompt words. The optimization prompt words may be presented in the following form:

[0109] "You are a professional prompt word optimization master. Please deeply analyze the given prompt words and common marking reasons. When providing marking reasons, the marking times will be provided. The more marking times, the more important the corresponding marking reasons are, and the more important they need to be considered when generating optimized prompt words. Please deeply and comprehensively analyze the given prompt words, marking reasons and corresponding marking times, and then output optimized prompt words with structured information such as roles, goals and key business rules.

[0110] The prompt words to be entered are as follows:

[0111] {{prompt}}

[0112] Common reasons for annotation are as follows:

[0113] {{reasons}}

[0114] Based on the above information, optimized prompt words with structured information such as roles, goals, and key business rules are directly output.

[0115] In some other possible implementations, the first prompt word may be generated without the aid of a language model. In a specific implementation, an initial prompt word is first obtained, and at least one target data sample is determined from a business data sample set, and the initial prompt word and the at least one target data sample are concatenated to obtain at least one first prompt word.

[0116] That is, some target data samples are selected from the business data sample set, and based on the few shot technology, the first prompt word is directly formed by using the target data samples and the initial prompt word. For example, the target data sample can be added to the initial prompt word to form the first prompt word.

[0117] Since the target data sample is associated with the target business, and the initial business data sample includes the annotation result, the first prompt word generated by using the target data sample and the initial prompt word has the ability to process the target task to a certain extent.

[0118] The embodiments of the present application support screening target data samples in different ways. In some possible implementations, based on the semantic information of the data samples in the business data sample set, the data samples in the business data sample set are clustered, the clustering results are determined, and at least one target data sample is determined based on the clustering results.

[0119] In other words, based on the semantics represented by the data samples in the business data sample set, the data samples are screened. For example, semantic information can be represented by a semantic vector, and the m data samples closest to the cluster center are selected, and then the data samples with different annotation results from the m data samples and the closest distance in the cluster results are selected, and a total of 2m data samples are obtained. Then, the 2m data samples are deduplicated to screen out the target business data samples. Among them, m is a natural number greater than 0.

[0120] In some other possible implementations, the data samples in the business data sample set also include marking reasons, and at least one target data sample is determined according to the number of occurrences of the marking reasons in the business data sample set.

[0121] In other words, the data samples are screened based on the reasons for their annotation. For example, the number of occurrences of each annotation reason in the business data sample set is counted, and the numbers of occurrences are sorted from high to low. The n annotation reasons with the highest number of occurrences are selected, and the data samples with these n annotation reasons are determined as the target business data samples.

[0122] The framework for optimizing prompt words provided in the embodiments of the present application can be applied to the optimization of a single prompt word and the batch optimization of multiple prompt words. In some embodiments, the initial prompt word may include only one prompt word, and the initial prompt word is preliminarily optimized to obtain a first prompt word, and the first prompt word is evaluated in a business data sample set using a second language model to obtain a first evaluation result, and the error sample information is determined based on the first evaluation result, and then the first prompt word is optimized using the first language model in combination with the error sample information to generate a second prompt word.

[0123] In other embodiments, the initial prompt word may also include multiple prompt words. Figure 3 As shown, each of the multiple initial prompt words is initially optimized to obtain multiple first prompt words that are initially optimized by each initial prompt word. Then, each first prompt word is evaluated in the business data sample set using the second language model to obtain the first evaluation result and corresponding error sample information of each first prompt word. Each first prompt word is optimized using the first language model in combination with the error sample information corresponding to each first prompt word to generate the second prompt word that is optimized by each first prompt word. In this way, batch optimization of prompt words is achieved and the optimization efficiency of prompt words is improved.

[0124] Furthermore, in the above-mentioned prompt word optimization process, in addition to presenting the optimized prompt word to the user (eg, a business person), the intermediate results related to the prompt word optimization may also be presented to the user.

[0125] In some embodiments, the intermediate result includes a difficult data sample. Specifically, according to the difference between the first evaluation result of the erroneous data sample and the annotation result, the difficult data sample is determined from the erroneous data sample and presented.

[0126] Among them, the difficult data samples can be understood as erroneous data samples with a large degree of difference between the first evaluation result and the annotation result, that is, after processing the target task with the help of the first prompt word, it is still difficult to obtain data samples for accurate judgment.

[0127] On the one hand, difficult data samples help optimize prompt words. On the other hand, difficult data samples may also be data samples with labeling errors, such as data samples with incorrect labeling results or incorrect labeling reasons. Therefore, presenting difficult data samples to users helps optimize business rules and labeling processes.

[0128] In some other embodiments, the intermediate result includes a prediction result. Specifically, the first prompt word includes a plurality of prompt words, and the prediction result is determined based on the first evaluation results of at least some of the first prompt words for the same data sample, and the prediction result is presented.

[0129] Among them, when the task type indicated by the first prompt word (i.e., the task type of the target task) is a classification task, the prediction result is the evaluation result with the most occurrences in the first evaluation results of at least some of the first prompt words for the same data sample. In this case, the number of at least some of the first prompt words needs to be an odd number (2k+1, where k is a natural number greater than 0). For example, the number of first prompt words is 5, and the number of at least some of the first prompt words is 3, including first prompt word A, first prompt word B, and first prompt word C. The first evaluation result of the first prompt word A for data sample A is A1, the first evaluation result of the first prompt word B for data sample A is A2, and the first evaluation result of the first prompt word C for data sample A is A1. At this time, the prediction result is A1.

[0130] When the task type indicated by the first prompt word (i.e., the task type of the target task) is a regression task, the prediction result is the average of the first evaluation results of at least some of the first prompt words for the same data sample. In this case, there is no limit on the number of at least some of the first prompt words. For example, the number of first prompt words is 5, and the number of at least some of the first prompt words is 2, including the first prompt word D and the first prompt word E. The first evaluation result of the first prompt word D for the business data sample B is 70, and the first evaluation result of the first prompt word E for the business data sample B is 74. At this time, the prediction result is 72.

[0131] By presenting the prediction results to the user, the user can understand the overall judgment of multiple first prompt words, so that the user can filter out prompt words with poor prompt ability and poor prompt effect from multiple first prompt words, thereby improving the optimization efficiency in subsequent rounds of optimization.

[0132] In the embodiment of the present application, high-quality delivery is achieved by presenting difficult data samples and / or prediction results to users, which helps business personnel to combine business experience and the optimization process of prompt words to obtain prompt words with better prompt effects.

[0133] Combination of the above Figures 1 to 3 The optimization method of the prompt words provided in the embodiment of the present application is introduced in detail. The device and equipment provided in the embodiment of the present application will be introduced in conjunction with the accompanying drawings.

[0134] See also Figure 4 The schematic diagram of the structure of the optimization device of the prompt word shown in FIG. 40 includes:

[0135] The acquisition module 401 is used to acquire at least one first prompt word associated with a target business, and acquire a business data sample set related to the target business; wherein the data samples in the business data sample set include a labeling result;

[0136] The execution module 402 is used to perform the following steps for each first prompt word of the at least one first prompt word: obtain a first evaluation result of the first prompt word on the business data sample set, and determine error sample information corresponding to the first prompt word based on the first evaluation result; send a target prompt word for optimizing the first prompt word to the first language model, wherein the target prompt word includes the first prompt word and the error sample information corresponding to the first prompt word; and obtain a second prompt word output by the first language model.

[0137] In some possible implementations, the error sample information includes: an error data sample, a labeling result of the error data sample, and a first evaluation result of the error data sample.

[0138] In some possible implementations, the execution module 402 is specifically configured to:

[0139] Sending a first evaluation prompt word for evaluating the first prompt word to a second language model, wherein the first evaluation prompt word includes the first prompt word and the business data sample set;

[0140] A first evaluation result output by the second language model is received.

[0141] In some possible implementations, the data sample in the business data sample set further includes a marking reason, where the marking reason indicates a reason for generating a marking result; the error sample information includes a plurality of error data samples; and the execution module 402 is further configured to:

[0142] Sorting the plurality of erroneous data samples according to the degree of difference between the first evaluation results and the marking results of the plurality of erroneous data samples, and / or the number of occurrences of the marking reasons of the plurality of erroneous data samples in the business data sample set, to obtain a sorting result of the plurality of erroneous data samples;

[0143] In the error sample information corresponding to the first prompt word, the plurality of error sample data are arranged according to the sorting result of the plurality of error data samples.

[0144] In some possible implementations, the acquisition module 401 is specifically used to:

[0145] Get the initial prompt word;

[0146] Sending an optimized prompt word for optimizing the initial prompt word to a third language model, wherein the optimized prompt word includes the initial prompt word;

[0147] At least one first prompt word output by the third language model is received.

[0148] In some possible implementations, the acquisition module 401 is specifically used to:

[0149] Acquire an initial prompt word, and determine at least one target data sample from the business data sample set;

[0150] The initial prompt word and the at least one target data sample are concatenated to obtain at least one first prompt word.

[0151] In some possible implementations, the data samples in the business data sample set further include a marking reason, and the marking reason indicates a reason for generating a marking result; the acquisition module 401 is specifically used to:

[0152] Determine at least one target data sample according to the number of occurrences of the marking reason in the business data sample set; or,

[0153] Based on the semantic information of the data samples in the business data sample set, the data samples in the business data sample set are clustered to determine a clustering result; and according to the clustering result, at least one target data sample is determined.

[0154] In some possible implementations, the apparatus 40 further includes a determining module, and the determining module is configured to:

[0155] Determining the optimization effect of each of the second prompt words;

[0156] According to the optimization effect of each of the second prompt words, a third prompt word is determined from at least one second prompt word.

[0157] In some possible implementations, the determining module is specifically configured to:

[0158] For each second prompt word, perform the following steps:

[0159] Sending a second evaluation prompt word for evaluating an optimization effect of the second prompt word to the second language model, wherein the second evaluation prompt word includes the second prompt word, a business data sample set, and a determination method of the optimization effect;

[0160] Receive the optimization effect output by the second language model.

[0161] In some possible implementations, the determining module is further configured to:

[0162] The third prompt word is determined as the first prompt word in the next round of prompt word optimization process, so as to optimize the third prompt word in the next round of prompt word optimization process.

[0163] In some possible implementations, the error sample information includes an error data sample, and the apparatus 40 further includes a presentation module, wherein the presentation module is configured to:

[0164] Determining a difficult data sample from the erroneous data sample according to the degree of difference between the first evaluation result and the labeling result of the erroneous data sample;

[0165] The difficult data sample is presented.

[0166] In some possible implementations, the first prompt word includes a plurality of prompt words, and the presentation module is further configured to:

[0167] Determining a prediction result according to a first evaluation result of at least part of the first prompt words for the same data sample;

[0168] The prediction results are presented.

[0169] The prompt word optimization device 40 according to the embodiment of the present application may correspond to the method described in the embodiment of the present application, and the above and other operations and / or functions of each module / unit of the prompt word optimization device 40 are respectively to achieve Figures 1 to 3 For the sake of brevity, the corresponding processes of each method in the illustrated embodiment are not described in detail here.

[0170] The present application also provides an electronic device. The electronic device is specifically used to implement Figure 3 The function of the optimization device 40 for the prompt words in the illustrated embodiment.

[0171] Figure 5 A schematic diagram of the structure of an electronic device 500 is provided. Figure 5 As shown, the electronic device 500 includes a bus 501, a processor 502, a communication interface 503 and a memory 504. The processor 502, the memory 504 and the communication interface 503 communicate with each other via the bus 501.

[0172] The bus 501 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0173] The processor 502 may be any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).

[0174] The communication interface 503 is used for communicating with the outside. For example, the communication interface 503 can be used for communicating with a terminal.

[0175] The memory 504 may include a volatile memory, such as a random access memory (RAM). The memory 504 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).

[0176] The memory 504 stores executable codes, and the processor 502 executes the executable codes to perform the aforementioned prompt word optimization method.

[0177] Specifically, in implementing Figure 4 In the case of the embodiment shown, and Figure 4 When each module or unit of the prompt word optimization device 40 described in the embodiment is implemented by software, the execution Figure 4 The software or program code required for the functions of each module / unit in the system may be partially or completely stored in the memory 504. The processor 502 executes the program code corresponding to each unit stored in the memory 504 to perform the aforementioned optimization method of the prompt word.

[0178] The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center that contains one or more available media. The available medium can be a magnetic medium (such as a floppy disk, a hard disk, a tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid-state hard disk). The computer-readable storage medium includes instructions that instruct the computing device to execute the optimization method of the prompt word of the optimization device 40 applied to the prompt word.

[0179] The embodiment of the present application further provides a computer program product, which includes one or more computer instructions. When the computer instructions are loaded and executed on a computing device, the process or function described in the embodiment of the present application is generated in whole or in part.

[0180] The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer or data center to another website, computer or data center via wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means.

[0181] When the computer program product is executed by a computer, the computer executes any of the aforementioned methods for optimizing prompt words. The computer program product may be a software installation package, and when any of the aforementioned methods for optimizing prompt words is needed, the computer program product may be downloaded and executed on a computer.

[0182] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to each embodiment of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0183] The units involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the unit / module does not, in some cases, constitute a limitation on the unit itself.

[0184] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0185] In the context of the present application embodiment, machine-readable medium can be a tangible medium that can contain or store a program for use by an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. Machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable medium can include but is not limited to electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the above. More specific examples of machine-readable storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above.

[0186] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the various embodiments can be referred to each other. For the system or device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.

[0187] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0188] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0189] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0190] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A prompt word optimization method, characterized in that: The method comprises: Acquire at least one first prompt word associated with a target business, and acquire a business data sample set related to the target business; wherein the data samples in the business data sample set include a labeling result; For each first prompt word in the at least one first prompt word, perform the following steps: Obtain a first evaluation result of the first prompt word on the business data sample set, and determine error sample information corresponding to the first prompt word based on the first evaluation result; send a target prompt word for optimizing the first prompt word to a first language model, wherein the target prompt word includes the first prompt word and the error sample information corresponding to the first prompt word; and obtain a second prompt word output by the first language model.

2. The method according to claim 1, characterized in that: The error sample information includes: an error data sample, a labeling result of the error data sample, and a first evaluation result of the error data sample.

3. The method according to claim 1, characterized in that The obtaining of a first evaluation result of the first prompt word on the business data sample set includes: Sending a first evaluation prompt word for evaluating the first prompt word to a second language model, wherein the first evaluation prompt word includes the first prompt word and the business data sample set; A first evaluation result output by the second language model is received.

4. The method according to claim 1, characterized in that: The data samples in the business data sample set also include a marking reason, where the marking reason indicates the reason for generating the marking result; the error sample information includes a plurality of error data samples; For each first prompt word in the at least one first prompt word, the following steps are further performed: Sorting the plurality of erroneous data samples according to the degree of difference between the first evaluation results and the marking results of the plurality of erroneous data samples, and / or the number of occurrences of the marking reasons of the plurality of erroneous data samples in the business data sample set, to obtain a sorting result of the plurality of erroneous data samples; In the error sample information corresponding to the first prompt word, the plurality of error sample data are arranged according to the sorting result of the plurality of error data samples.

5. The method according to claim 1, characterized in that The acquiring of at least one first prompt word associated with the target business includes: Get the initial prompt word; Sending an optimized prompt word for optimizing the initial prompt word to a third language model, wherein the optimized prompt word includes the initial prompt word; At least one first prompt word output by the third language model is received.

6. The method according to claim 1, characterized in that The acquiring of at least one first prompt word associated with the target business includes: Acquire an initial prompt word, and determine at least one target data sample from the business data sample set; The initial prompt word and the at least one target data sample are concatenated to obtain at least one first prompt word.

7. The method according to claim 6, characterized in that The data samples in the business data sample set also include a marking reason, where the marking reason indicates a reason for generating a marking result; and determining at least one target data sample from the business data sample set includes: Determine at least one target data sample according to the number of occurrences of the marking reason in the business data sample set; or, Based on the semantic information of the data samples in the business data sample set, the data samples in the business data sample set are clustered to determine a clustering result; and according to the clustering result, at least one target data sample is determined.

8. The method according to any one of claims 1 to 7, characterized in that: The method further comprises: Determining the optimization effect of each of the second prompt words; According to the optimization effect of each of the second prompt words, a third prompt word is determined from at least one second prompt word.

9. The method according to claim 8, characterized in that The step of determining the optimization effect of each of the second prompt words includes: For each second prompt word, perform the following steps: Sending a second evaluation prompt word for evaluating an optimization effect of the second prompt word to the second language model, wherein the second evaluation prompt word includes the second prompt word, a business data sample set, and a determination method of the optimization effect; Receive the optimization effect output by the second language model.

10. The method according to claim 8, characterized in that The method further comprises: The third prompt word is determined as the first prompt word in the next round of prompt word optimization process, so as to optimize the third prompt word in the next round of prompt word optimization process.

11. The method according to any one of claims 1 to 7, characterized in that: The error sample information includes an error data sample, and the method further includes: Determining a difficult data sample from the erroneous data sample according to the degree of difference between the first evaluation result and the labeling result of the erroneous data sample; The difficult data sample is presented.

12. The method according to any one of claims 1 to 7, characterized in that: The first prompt word includes a plurality of prompt words, and the method further includes: Determining a prediction result according to a first evaluation result of at least part of the first prompt words for the same data sample; The prediction results are presented. Wherein, when the task type indicated by the first prompt word is a classification task, the prediction result is the evaluation result with the largest number of occurrences among the first evaluation results of at least some of the first prompt words for the same data sample; When the task type indicated by the first prompt word is a regression task, the prediction result is an average of first evaluation results of at least some of the first prompt words for the same data sample.

13. A prompt word optimization device, characterized in that: The device comprises: An acquisition module, used to acquire at least one first prompt word associated with a target business, and to acquire a business data sample set related to the target business; wherein the data samples in the business data sample set include a labeling result; The execution module is used to perform the following steps for each first prompt word of the at least one first prompt word: obtain a first evaluation result of the first prompt word on the business data sample set, and determine error sample information corresponding to the first prompt word based on the first evaluation result; send a target prompt word for optimizing the first prompt word to the first language model, wherein the target prompt word includes the first prompt word and the error sample information corresponding to the first prompt word; and obtain a second prompt word output by the first language model.

14. An electronic device, characterized in that: The electronic device comprises a processor and a memory; The processor is configured to execute instructions stored in the memory, so that the electronic device performs the method according to any one of claims 1 to 12.

15. A computer-readable storage medium, characterized in that: The method comprises instructions, wherein the instructions instruct an electronic device to execute the method according to any one of claims 1 to 12.

16. A computer program product, characterized in that The computer program product comprises computer readable instructions for implementing the method according to any one of claims 1 to 12.

Citation Information

Patent Citations

  • Fine adjustment method and device of pre-training model, equipment and storage medium

    CN117349674A

  • Decompilation result optimization method and system based on large language model

    CN117421010A

  • Prompt word optimization method for processing multi-label classification task for large language model

    CN118350361A

  • Prompt generation method and text processing method

    CN118655989A

  • Facial recognition model evaluation method and apparatus, and storage medium and computer device

    WO2020147408A1

Cited By

  • Text processing method, computing device, electronic device and storage medium

    CN119378523A

  • Task process optimization method and device, equipment, medium and product

    CN120087735A

  • Prompt word optimization method, intelligent agent and storage medium

    CN120278153A

  • A prompt word optimization method, intelligent agent and storage medium

    CN120278153B

  • Prompt information optimization method and device, computer readable medium and electronic equipment

    CN121052384A