Method and device for adjusting cue word

By generating multiple samples, including edge samples, performing error analysis to calibrate user intentions, and dynamically adjusting prompt words, the problem that prompt word adjustment methods in the prior art cannot flexibly respond to different task requirements, and achieve a more efficient training process and output that is more in line with user needs.

CN119691542APending Publication Date: 2025-03-25MASHANG CONSUMER FINANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411595408.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-08
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

The prompt word adjustment method in the existing model training field cannot be flexibly adjusted according to different task requirements, resulting in the generated output being unable to meet the actual needs of users, and the training process is cumbersome, which increases costs.

Method used

By generating multiple samples, including edge samples, based on the prompt word and target task, error analysis is performed to calibrate user intentions, and dynamically adjust the prompt word until preset conditions are met.

Benefits of technology

It realizes flexible adjustment of prompt words according to different task needs, so that the generated output is more in line with the actual needs of users, and at the same time reduces the cost of prompt words adjustment and the complexity of the training process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119691542A_ABST
    Figure CN119691542A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a cue word adjustment method and device, and the method comprises the steps: classifying a first sample based on a first input cue word and a first classification task, and obtaining a classification result; comparing a classification result of the first sample with a labeling result, and adjusting the first input cue word based on a comparison result and the first classification task to obtain a first output cue word; determining a first sample corresponding to the first output prompt word and the first classification task; and taking the first output cue word as a first input cue word, repeatedly executing the steps until the first output cue word meets a first preset condition, ending the iteration process, and outputting the first output cue word meeting the first preset condition. By adopting the embodiment of the invention, the prompt word after adjustment can meet the actual demand of the user, and the adjustment cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of model training, and in particular to a method and device for adjusting prompt words. Background Art

[0002] The field of model training is a multidisciplinary field that integrates knowledge from computer science, statistics, and artificial intelligence. It aims to improve the performance of the model and meet user needs by continuously adjusting the model. In this field, prompt words play a vital role. They can guide the model to understand the task requirements more accurately, thereby generating output results that are more in line with user expectations. However, the current prompt word adjustment methods are usually unable to flexibly adjust according to different task requirements, resulting in the output generated based on the adjusted prompt words unable to meet the actual needs of users. In addition, the training process is cumbersome, which greatly increases the cost of prompt word adjustment. Summary of the invention

[0003] The embodiments of the present application provide a method and device for adjusting prompt words, which can generate multiple samples based on prompt words and target tasks, including edge samples, and calibrate user intentions by performing error analysis on the generated samples, so that the output generated based on the adjusted prompt words can meet the actual needs of the user and reduce the cost of prompt word adjustment.

[0004] In a first aspect, an embodiment of the present application provides a method for adjusting a prompt word, which is applied to a large language model; the method comprises:

[0005] Based on a first input prompt word and a first classification task, a first sample is classified to obtain a classification result; the classification result of the first sample is compared with the labeling result, and the first input prompt word is adjusted based on the comparison result and the first classification task to obtain a first output prompt word; a first sample corresponding to the first output prompt word and the first classification task is determined, the first sample includes a first positive sample and a first marginal sample, and the first marginal sample is determined based on the previous iteration of the first classification task; the first output prompt word is used as the first input prompt word, and the above steps are repeated until the first output prompt word meets a first preset condition, the iterative process is terminated, and the first output prompt word that meets the first preset condition is output.

[0006] In the embodiment of the present application, a prompt word adjustment method is provided, which can generate a first sample (i.e., a classification sample) through the prompt word and the target task, the first sample can include a positive sample and an edge sample, and the first sample is subjected to error analysis, the prompt word is adjusted according to the strengths and weaknesses of the prompt word in the error analysis, and the above steps are repeated based on the adjusted prompt word until the prompt word is adjusted to meet the preset requirements. In the embodiment of the present application, edge samples can be generated through the weaknesses of the prompt word in the iterative process, and the prompt word can be adjusted through the error analysis of the edge case, so that the adjusted prompt word can flexibly respond to diverse and complex task scenarios and meet the actual needs of users; further, in the embodiment of the present application, the prompt word is also adjusted through an automated iterative process, that is, the user only needs to provide basic input (prompt word and target task), and the system can automatically execute the whole process of adjusting the prompt word from the initial prompt word to the prompt word that meets the preset conditions, which improves the training efficiency while reducing labor costs.

[0007] In a possible implementation, the determining of the first sample corresponding to the first input prompt word and the first classification task includes: generating the corresponding first positive sample based on the first input prompt word and the first classification task; and determining the first marginal sample based on the comparison result. In the embodiment of the present application, the accuracy and typicality of the basic data are ensured by combining the first input prompt word and the first classification task to generate positive samples, providing a reliable reference for subsequent classification and prompt word adjustment. At the same time, determining marginal samples based on the weaknesses of the prompt words in the previous round of iterations can accurately capture the weak links and fuzzy areas of the model in the classification process, making the first sample more targeted and comprehensive, enabling the prompt words to adapt to complex and changeable task scenarios more quickly, and improving the ability to process diversified data, thereby improving the accuracy and adaptability of the prompt words and better meeting user needs.

[0008] In a possible implementation, the determining of the first edge sample based on the comparison result includes: determining the first deviation between the first input prompt word and the first classification task based on the comparison result; generating the first edge sample based on the first deviation. In the embodiment of the present application, the edge sample is determined using the comparison results of the previous iteration, which provides a highly targeted direction for the adjustment of the prompt word. It is possible to accurately find areas where the model is prone to errors and confusion during the classification process, so that subsequent adjustments to the prompt words can hit the key points, effectively improve the accuracy and effectiveness of the prompt words, effectively reduce reliance on manual annotations, and perform error analysis through generated examples to calibrate user intent, thereby breaking through the limitations of traditional methods, not only effectively reducing the probability of inaccurate generated content due to comprehension bias, but also improving the accuracy of classification results.

[0009] In a possible implementation, the comparing the classification result of the first sample with the annotation result, and adjusting the first input prompt word based on the comparison result and the first classification task, includes: calculating the similarity score between the classification result of the first sample and the annotation result, and adjusting the first input prompt word according to the similarity score and the first classification task. In an embodiment of the present application, the score of each classified sample is obtained by calculating the similarity between the classification result and the annotation to quantify the degree of difference between the classification result and the annotation result. This provides a clear and measurable basis for adjusting the first input prompt word, and can accurately adjust the parts with larger differences. For example, when the similarity score is low, the shortcomings of the prompt word in guiding model understanding and classification can be accurately identified, so as to modify the expression of the prompt word, focus on the content, etc. in a targeted manner, so that the prompt word is more in line with the task requirements.

[0010] In a possible implementation, the method further includes: classifying the second sample based on the first output prompt word and the first classification task to obtain the classification result; adjusting the second input prompt word based on the classification result and the first generation task to obtain the second output prompt word, the first input prompt word and the first classification task are obtained based on the second input prompt word and the first generation task; determining the second sample corresponding to the second input prompt word and the first generation task, the second sample includes a second positive sample and a second edge sample, and the second edge sample is iteratively determined based on the first generation task; using the second output prompt word as the second input prompt word, repeating the above steps until the second output prompt word meets the second preset condition, ending the iterative process, and outputting the second output prompt word that meets the second preset condition.

[0011] In the embodiment of the present application, multiple generated samples (i.e., second samples) are generated by introducing a second input prompt word and a first generation task, and the multiple generated samples may include edge samples generated by the deviation content of the second input prompt word in the previous round of iterations, and the quality of the generated content is evaluated by the evaluation prompt word (i.e., the first output prompt word) trained by the classification task (i.e., the classification task is performed on the above-mentioned multiple generated samples by the first output prompt word), and the prompt word of the generation task is dynamically adjusted based on the evaluation result; further, in the embodiment of the present application, the above steps can also be repeated based on the adjusted prompt word until the prompt word is adjusted to meet the preset requirements, ensuring that the output generated based on the adjusted prompt word is more in line with the user's intention, while improving the quality and consistency of the generated content. In summary, the embodiment of the present application realizes the dynamic adjustment and adjustment of the prompt word by combining the classification task with the generation task, which not only improves the adjustment effect and efficiency of the prompt word, but also further reduces the cost of prompt word adjustment through automated training.

[0012] In a possible implementation, the adjusting the second input prompt word based on the classification result and the first generation task to obtain the second output prompt word includes: determining the second deviation between the second input prompt word and the first generation task based on the classification result; generating the second edge sample based on the second deviation. In the embodiment of the present application, by determining the deviation part of the second input prompt word through the classification result, it is possible to accurately find the problems existing in the prompt word in the process of guiding the execution of the task. By generating edge samples in a targeted manner based on the deviation, it is possible to further focus on areas that are prone to errors or ambiguity, provide an accurate data basis for prompt word adjustment, make the adjusted prompt word more in line with task requirements, and improve accuracy.

[0013] In a second aspect, an embodiment of the present application provides a method for applying a large language model, including:

[0014] Input the third input prompt word into the large language model to obtain the adjusted prompt word; wherein the large language model is trained according to the prompt word adjustment method of the first aspect. In the embodiment of the present application, by receiving the third input prompt word input by the user and inputting it into the adjusted large language model, the system can automatically generate the adjusted prompt word, without the need for the user to perform tedious manual adjustments, that is, the user only needs to provide basic input, and the system can automatically perform the entire process from initial prompt to performance adjustment, which greatly simplifies the operation process, not only significantly reduces the user's intervention in the prompt word adjustment, but also effectively avoids the uncertainty and inefficiency caused by manual operation, so that the output generated based on the adjusted prompt word is more in line with the user's actual needs.

[0015] In a third aspect, an embodiment of the present application provides a device for adjusting a prompt word, including:

[0016] a classification module, classifying the first sample based on the first input prompt word and the first classification task to obtain a classification result; wherein the first classification task is used to indicate the first classification task;

[0017] A first input prompt word adjustment module is used to perform a first comparison between the classification result of the first sample and the labeling result, and the first input prompt word is adjusted based on the first comparison result and the first classification task to obtain a first output prompt word;

[0018] A determination module, configured to determine a first sample corresponding to the first input prompt word and the first classification task, wherein the first sample includes a first positive sample and a first marginal sample, and the first marginal sample is determined based on a previous iteration of the first classification task;

[0019] The first output prompt word iteration module is used to use the first output prompt word as the first input prompt word, repeatedly execute the above steps until the first output prompt word meets a first preset condition, end the iteration process, and output the first output prompt word that meets the first preset condition.

[0020] In a third aspect, an embodiment of the present application provides a device for adjusting a prompt word, the device comprising:

[0021] A memory, a processor, and a prompt word adjustment program stored in the memory and executable on the processor, wherein the prompt word adjustment device implements part or all of the steps described in any method in the first aspect.

[0022] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a prompt word adjustment program is stored. When the prompt word adjustment program is executed by a processor, part or all of the steps described in any method in the first aspect are implemented.

[0023] In a fifth aspect, an embodiment of the present application provides a computer program product, wherein the computer program product includes a computer program, and the computer program is operable to cause a computer to execute some or all of the steps described in any method of the first aspect of the embodiment of the present application. The computer program product can be a software installation package.

[0024] By implementing the embodiment of the present application, the system first classifies the first sample based on the first input prompt word and the first classification task to obtain a classification result; wherein the first classification task is used to indicate the first classification task; then the classification result of the first sample is compared with the annotation result, and the first input prompt word is adjusted based on the comparison result and the first classification task to obtain a first output prompt word; then the first sample corresponding to the first output prompt word and the first classification task is determined, the first sample includes a first positive sample and a first edge sample, and the first edge sample is iteratively determined based on the first classification task; then the classification result of the first sample is first compared with the annotation result, and the first input prompt word is adjusted based on the first comparison result and the first classification task to obtain a first output prompt word; finally, the first output prompt word is used as the first input prompt word, and the above steps are repeated until the first output prompt word meets the first preset condition, the iterative process is terminated, and the first output prompt word that meets the first preset condition is output. Edge samples are generated by fusing the prompt words and the templates of the target task with a heuristic method, and the prompt words are adjusted based on the edge samples. Compared with the existing technology of only generating samples through templates for few-sample learning, the heuristic fusion template generates edge samples, so that the adjusted prompt words can flexibly cope with diverse and complex task scenarios and meet the actual needs of users.

[0025] In the embodiment of the present application, samples can be generated based on prompt words and target tasks, and the multiple samples may include marginal samples. The multiple samples are classified and the classification results are analyzed for errors. The prompt words are adjusted according to the strengths and weaknesses of the prompt words in the error analysis, and the above-mentioned iterative process is automatically repeated. In each round of iteration, marginal samples can be generated based on the weaknesses of the prompt words in the previous round of iteration, and the prompt words meet the preset requirements through multiple rounds of iterations. Compared with the prior art of only generating samples through templates for few-sample learning, in the embodiment of the present application, marginal samples are generated through the strengths and weaknesses of the prompt words in each round of iteration, and the prompt words are further adjusted through the marginal samples, so that the adjusted prompt words can flexibly cope with diverse and complex task scenarios, and the output generated based on the adjusted prompt words can meet the actual needs of users. In addition, in the embodiment of the present application, prompt words are adjusted through an automated iterative process, which improves training efficiency while reducing labor costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the background technology, the drawings required for use in the embodiments of the present application or the background technology will be described below.

[0027] Figure 1 It is a schematic diagram of a data processing and analysis framework provided in an embodiment of the present application.

[0028] Figure 2 This is a prompt word adjustment flow chart provided in an embodiment of the present application.

[0029] Figure 3 A schematic diagram of a classification task flow provided in an embodiment of the present application.

[0030] Figure 4 A schematic diagram of a task generation process provided in an embodiment of the present application.

[0031] Figure 5 It is a structural schematic diagram of a prompt word adjustment device provided in an embodiment of the present application.

[0032] Figure 6 This is a schematic diagram of the structure of another prompt word adjustment device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0033] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. According to the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this application.

[0034] The terms "first", "second", "third", etc. in the specification, claims and drawings of this application are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.

[0035] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0036] The field of model training is a multidisciplinary field that integrates knowledge from computer science, statistics, and artificial intelligence. It aims to improve the performance of the model and meet user needs by continuously adjusting the model. In this field, prompt words play a vital role. They can guide the model to understand the task requirements more accurately, thereby generating output results that are more in line with user expectations. However, current prompt word adjustment methods are usually unable to flexibly adjust according to different task requirements, the training process is cumbersome, and the training effect is poor, resulting in the output generated based on the adjusted prompt words failing to meet the actual needs of users.

[0037] The prior art method for adjusting prompt words may specifically include the following disadvantages:

[0038] Disadvantage 1: Generate samples based on prompt words and target task templates. Although it is easy to generate samples based on fixed prompt words and target task templates, its static characteristics limit the adaptability of the method, making it perform poorly in the face of diverse and complex task scenarios and difficult to meet the ever-changing user needs and task environments.

[0039] Disadvantage 2: Adjusting prompt words through reinforcement learning paths. Existing prompt word adjustment methods usually continuously adjust prompt strategies through the interaction between staff and models, but their training process usually requires a long time and a large amount of data support, which not only takes a long training cycle, but also increases computing and labor costs.

[0040] In response to the above two problems, an embodiment of the present application provides a method and device for adjusting a prompt word. First, the first sample is classified based on a first input prompt word and a first classification task to obtain a classification result; then the classification result of the first sample is compared with the annotation result, and the first input prompt word is adjusted based on the comparison result and the first classification task to obtain a first output prompt word; then the first sample corresponding to the first output prompt word and the first classification task is determined, the first sample includes a first positive sample and a first marginal sample, and the first marginal sample is iteratively determined based on the first classification task; finally, the first output prompt word is used as the first input prompt word, and the above steps are repeated until the first output prompt word meets the first preset condition, the iterative process is terminated, and the first output prompt word that meets the first preset condition is output, so that the output generated based on the first output prompt word meets the actual needs of the user.

[0041] The prompt word adjustment method and device provided in the embodiments of the present application can be applied to Figure 1 For the data processing and analysis framework shown in Figure 1 , Figure 1 is a schematic diagram of a data processing and analysis framework provided in an embodiment of the present application, such as Figure 1 As shown, the data processing and analysis framework may include four modules: data management unit 101, sample estimation engine 102, performance evaluation component 103, and strategy adjustment controller 104. The data processing and analysis framework is designed to efficiently process and analyze data sets, while taking into account the execution capabilities of large-scale estimation tasks, so as to achieve full process automation and intelligence from data processing to model evaluation. The above four are described in detail below.

[0042] The data management unit 101 implements the manipulation of data sets by adopting a localization strategy and based on the high-performance Pandas library. The data management unit 101 can support operations such as create, read, update, and delete, and can also integrate advanced data cleaning mechanisms, such as semantic deduplication and intelligent sampling functions, to ensure data quality. Furthermore, the data management unit 101 can also automatically generate a basic first sample by calling the dynamic sample generation and adaptation unit 101-A. The basic first sample can be generated by the data management unit 101 based on the current task status and historical feedback, and the sample quality can be dynamically adjusted through a semantic similarity algorithm, thereby improving the relevance of the sample to the task.

[0043] The sample estimation engine 102, by combining the manual annotation interface with the large language model (LLM) integrated evaluation capability, can efficiently process batch samples through a parallel computing architecture and an asynchronous calling mechanism, and can run in parallel through multiple LLM execution environments, greatly improving the accuracy and processing rate of sample estimation. Furthermore, the sample estimation engine 102 can annotate the generated samples by calling the annotation service 102-A, and return the annotation results to the sample estimation engine 102, so as to adjust the prompt words in subsequent processing based on the annotation results of the samples.

[0044] The performance evaluation component 103 is used to perform comparative analysis between the model output and the actual annotation. The evaluation criteria of the performance evaluation component 103 can be customized by the user, and the labeled samples can be automatically analyzed at the line level; further, the performance evaluation component 103 also uses built-in error detection and depth analysis tools, and feeds back the analysis results to the effect feedback analysis component 103-A to generate a detailed performance report, identify the error type and adjustment direction; further, the performance evaluation component 103 can automatically design the prompt words for the next round of iteration based on the above analysis results and past performance data through the prompt word intelligent iteration engine 103-B; the prompt word intelligent iteration engine 103-B can generate more adjusted prompt words through the score history of the prompt words and analyze the error mode (i.e. the reason for the deduction).

[0045] The strategy adjustment controller 104 is used to direct the other three modules in the data processing and analysis framework and control the entire analysis process. The strategy adjustment controller 104 can dynamically adjust the processing parameters and model configuration through a continuous feedback loop to ensure that the adjustment process can be effectively terminated when the preset performance threshold is reached, and output a prompt word that the preset condition is met after adjustment.

[0046] For example, in the embodiment of the present application, when the prompt word is adjusted through the classification task or the generation task, the system can trigger the data management unit 101 to clean and remove duplicates of the data set through the strategy adjustment controller 104; then, the system processes the generated samples in parallel through the sample estimation engine 102, and evaluates these samples through the performance evaluation component 103, and calculates the score for each sample; further, if in a certain round of iterations, the system detects that the target prompt word performs poorly, the system can automatically adjust the prompt word through one or more of the three components of the dynamic sample generation and adaptation unit 101-A, the effect feedback analysis component 103-A and the prompt word intelligent iteration engine 103-B to improve the accuracy of the next round of tasks. Finally, when the set accuracy or other preset conditions are reached, the system can automatically stop the iteration and output the prompt word that finally meets the preset conditions.

[0047] See also Figure 2 , Figure 2 is a prompt word adjustment flow chart provided in an embodiment of the present application, such as Figure 2 As shown, the method includes the following steps S201 to S204:

[0048] Step S201: classify the first sample based on the first input prompt word and the first classification task to obtain a classification result.

[0049] Specifically, the large language model can perform classification prediction on the labeled samples based on the current first input prompt word and the first classification task to obtain a classification result. For example, taking the correctly classified car sample as an example, the classification prediction result of the large language model can be "family sedan"; taking the incorrectly classified flying car concept model as an example, the classification prediction result of the large language model can be "off-road vehicle".

[0050] In a possible implementation, the first input prompt word and the first classification task can be user input, and the first classification task is used to indicate the first classification task, wherein the first input prompt word can be adjusted in each round of iteration, and the first classification task is fixed; in the first round of iteration of the first classification task, the classification sample can be a sample pre-input by the user, or a sample generated based on a large language model; the user input can be completed through various interactive methods, such as through text boxes, voice input, handwriting input, etc. Exemplarily, the first input prompt word input by the user through the text box can be "Please classify the car", and the first classification task can be "Classify cars for different purposes". Optionally, the system can also provide a certain feedback mechanism when receiving the user's input content, such as prompting the user whether the format or content of the input meets the requirements, so as to avoid unnecessary errors or ambiguities.

[0051] In a possible implementation, in an embodiment of the present application, after receiving the initial prompt word and target task input by the user, the system can automatically adjust the prompt word by classifying the task, thereby reducing user participation and improving the efficiency of prompt word adjustment.

[0052] Step S202: comparing the classification result of the first sample with the labeling result, and adjusting the first input prompt word based on the comparison result and the first classification task to obtain a first output prompt word.

[0053] Specifically, after the system performs classification prediction on each sample, it can compare the classification result of the sample with the annotation, and analyze the error cause for the misclassified sample to adjust the prompt word. For example, assuming that the first input prompt word is "car classification", the first classification task is "classify different types of cars", and the annotation of the sample of the flying car concept model is "car model", the classification prediction result of the large language model for the sample (i.e., the flying car concept model) is "off-road vehicle", then it is judged that the classification prediction ability of the large language model for the sample is 0 points, and the system can use the large language model to carefully classify and summarize the misclassified sample; if the large language model analyzes that the problem of misclassification is due to the failure to mention the key features such as the wheelbase and displacement of the vehicle in the first input prompt word, the large language model can add the above information to the first input prompt word to obtain the first output prompt word, for example, the first input prompt word is adjusted from "car classification" to "classify cars according to vehicle wheelbase and displacement", that is, the first output prompt word is "classify cars according to vehicle wheelbase and displacement".

[0054] Step S203: determining the first sample corresponding to the first input prompt word and the first classification task.

[0055] Specifically, the first sample includes a first positive sample and a first marginal sample, and the first marginal sample is determined based on the iteration of the first classification task. After receiving the first input prompt word and the first classification task, the system can generate a set of samples for training through the large language model to cover various situations that may occur in the task, such as positive samples and some marginal samples (i.e., marginal samples) that may cause the model to misclassify, so as to make more accurate predictions in different situations when subsequently training the classification ability of the large language model. Exemplarily, the large language model can directly generate samples based on the prompt word input by the user. For example, the first input prompt word can be "please classify the car", the first classification task can be "classify cars of different uses", and the positive sample generated by the large language model through the first input prompt word and the first classification task can be, for example, a sedan, a business sedan, etc.; the large language model can determine the weakness (i.e., the deviation part) of the first input prompt word by comparing the classification result corresponding to each classification sample with the annotation result in the previous round of iteration, and generate edge samples based on the weakness. For example, in the previous round of iteration, the first classification task is prone to classification deviation for the new flying car concept model. In this round of iteration, the large language model can generate edge samples based on the new flying car concept model, and perform the first classification task to determine whether it should be classified as a car. Optionally, the first input prompt word can be the first input prompt word input by the user, or the first input prompt word provided in step S204 below; further optionally, the above sample can also be provided by the user and participate in subsequent training. In summary, by generating diverse samples, the system can provide rich training data for the large language model, thereby improving its learning ability and prediction accuracy.

[0056] Step S204: taking the first output prompt word as the first input prompt word, repeating the above steps until the first output prompt word meets a first preset condition, terminating the iterative process, and outputting a first output prompt word that meets the first preset condition.

[0057] Specifically, the system can evaluate the enhanced prompt word through the large language model to determine whether it meets the established standard. If it meets the established standard, the system determines that the classification prediction performance of the large language model has reached the preset requirement; if it does not meet the established standard, the system can input the enhanced prompt word as the first prompt word into step S201, and re-perform the prompt word adjustment process of step S201-step S203. For example, assuming that in the automobile classification task, the established standard is that the proportion of misclassified samples is less than 5%, or the average classification prediction score is higher than 85 points; if the proportion of misclassified samples of the enhanced prompt word in the new round of testing is 4%, or the average classification prediction score reaches 90 points, it can be determined that the classification prediction performance of the large language model has reached the established standard; or, if the proportion of misclassified samples is 6%, and the average classification prediction score is only 70 points, it is determined that the classification performance of the large language model has not reached the established standard.

[0058] For a detailed description of the classification task in the above steps S201 to S204, please refer to Figure 3 , Figure 3 A schematic diagram of a classification task flow provided in an embodiment of the present application is shown in FIG. Figure 3 As shown, the method may include the following steps S301-S308.

[0059] Step S301: User input.

[0060] Specifically, the system receives the user's input, wherein the user's input content may include a first classification task and a first input prompt word, wherein the first input prompt word is used to indicate the purpose of the task, and the first classification task is used to indicate the goal of this task, wherein the first input prompt word may be adjusted based on the iterative process in step S302-step S307, and the first classification task remains unchanged and is used to guide the goal of the classification task. For specific examples, see Figure 2 The corresponding description of the embodiment in step S201 will not be repeated here.

[0061] Step S302: Sample generation.

[0062] Specifically, after receiving the first input prompt word and the first classification task, the system can generate a set of samples for training through the large language model to cover various situations that may occur in the task, such as positive samples and marginal samples generated based on cases that caused the model to misclassify in the previous iteration process, so as to make more accurate predictions in different situations when subsequently training the classification ability of the large language model. For specific examples, see Figure 2 The corresponding description of the embodiment in step S201 will not be repeated here.

[0063] Step S303: marking.

[0064] Specifically, after receiving the samples generated in step S302, the system may annotate the samples to clarify the category or characteristics of each sample. Optionally, the annotation may also be performed manually, that is, the user annotates each sample one by one to ensure the accuracy of the annotation. For example, for some special or uncommon car types, accurate results may be obtained through manual annotation.

[0065] Step S304: prediction.

[0066] Specifically, the large language model can classify and predict the labeled samples based on the current first input prompt word and the first classification task to evaluate the classification ability of the large language model. In the embodiment of the present application, the system can classify the samples generated in step S302 through the large language model to obtain the classification results, and evaluate the scores of the above classification results by taking the annotations of the samples in step S303 as the answers to determine the classification performance of the large language model. Exemplarily, taking the positive example as an example, assuming that for a certain car sample, the annotation in step S303 is "family sedan", and the classification prediction result of the large language model is also "family sedan", the system can judge that the classification prediction ability of the large language model for the sample is 10 points (taking the full score of 10 points as an example); taking the marginal sample as an example, if the annotation of the flying car concept model in step S303 is "car model", and the classification prediction result of the large language model is "off-road vehicle", then the classification prediction ability of the large language model for the sample is judged to be 2 points (taking the full score of 10 points as an example). Optionally, cross-validation or an independent test set can also be performed to more comprehensively evaluate the prediction ability of the model.

[0067] Step S305: Prompt word analysis.

[0068] Specifically, the system can analyze the prediction results in step S304 in detail through the large language model, and analyze the causes of errors for the samples that are misclassified (i.e., the analysis results of the samples with lower scores in step S304). Exemplarily, the analysis process can classify and summarize the samples that are misclassified, and find out the common problems that cause errors, such as unclear prompt words, incomplete feature descriptions, etc.; assuming that the flying car concept model is labeled as "car model" in step S303, and the classification prediction result of the large language model for the sample (i.e., the flying car concept model) is "off-road vehicle", then the classification prediction ability of the large language model for the sample is judged to be 0 points, and the system can classify and summarize the misclassified samples in detail through the large language model; for example, it may be because the description of some key features of the car in the prompt word is not clear enough, or the wheelbase, displacement and other features of the vehicle are not mentioned, which leads to misclassification when the large language model classifies and predicts the sample. Optionally, the system can also display the relationship between the prompt word and the classification prediction result through data visualization, more intuitively find problems, and determine differences and improvement directions.

[0069] Step S306: Prompt word reinforcement.

[0070] Specifically, the large language model can adjust the prompt word according to the result of the prompt word analysis in step S305 to strengthen and improve it. For example, if the large language model analyzes that the problem of misclassification is due to incomplete feature description, the large language model can adjust the prompt word by supplementing the prompt word with more necessary feature descriptions. For example, in step S305, if the classification prediction error is found due to the failure to mention key features such as vehicle wheelbase and displacement, the large language model can strengthen the prompt word by adding the above information to the prompt word.

[0071] Step S307: Whether the iteration standard is met.

[0072] Specifically, the system can evaluate the enhanced prompt word through the large language model to determine whether it meets the established iteration standard. If it meets the established standard, the system determines that the classification prediction performance of the large language model has reached the preset requirements; if it does not meet the established standard, the system can input the enhanced prompt word as the first input prompt word into step S302, and re-perform the classification prediction ability training process of the large language model from step S302 to step S307. For details, please refer to Figure 2 The description of the embodiment corresponding to step S204 is omitted here.

[0073] Step S308: the final adjusted prompt word.

[0074] Specifically, the system confirms and outputs the first output prompt word obtained after the final adjustment. Optionally, after multiple rounds of adjustment and verification, the first output prompt word can be used as an evaluation prompt word for the following Figure 4 Corresponding step S404.

[0075] In a possible implementation, the system can also Figure 2 The embodiment of step S201 to step S204 in the above example realizes the generation task, that is, the quality of the generated content is evaluated by the classification task in the process of the generation task, so as to adjust the prompt words in the generation task and adjust the performance of the large language model in performing the generation task. Figure 4 , Figure 4 A schematic diagram of a task generation process provided in an embodiment of the present application is shown in FIG. Figure 4 As shown, the method may include the following steps S401-S404.

[0076] Step S401: classifying the second sample based on the first output prompt word and the first classification task to obtain the classification result.

[0077] Specifically, the large language model can classify and score the second sample through the first output prompt word and the first classification task. The second sample can be a generated sample input by the user or preset, and the samples are sorted based on the score of each sample in the second sample. The classification criteria can be multiple aspects such as the degree of fit between the sample and the first generation task, the accuracy and completeness of the content, the clarity of the language expression, etc., and the large language model can sort these samples based on the score obtained by each sample. Exemplarily, it is assumed that the second sample includes three generated samples: Sample A is an article content with the theme of "elaborating on the specific hazards and response strategies of global warming to marine ecosystems", Sample B is an article content with the theme of "briefly analyzing the partial impact of climate change on agriculture", and Sample C is an article content with the theme of "exploring the complex relationship between economic development and climate change". First, the large language model can classify the second sample according to the fit between the second sample and the first output prompt word. If the prompt word is to study the impact of global warming on a specific ecosystem in depth, sample A may be classified as a high-quality sample because it performs well in this regard, because it explicitly mentions global warming, marine ecosystems, and response strategies, which are highly consistent with the prompt word and the first generation task, and the score is high; and from the accuracy and completeness of the content, sample A not only points out the impact, but also mentions the response strategy, and the content is relatively complete and accurate; sample B may be classified as a low-quality sample and have a slightly lower score because it is only a brief analysis and has a narrow scope; sample C is the relationship between economic development and climate change, and the direct correlation with the second input prompt word and the first generation task is relatively weak. The large language model can classify sample C as a low-quality sample, and the score may be lower. Further, the system can also analyze the clarity of language expression through the large language model. For example, sample A is clearly expressed and logically coherent; while because samples B and C are brief analyses, they may be poor in the level of detail and logical coherence of the expression. The system can use a large language model to comprehensively consider the above evaluation criteria and score sample A, sample B, and sample C respectively. Sample A has the highest score, followed by sample B, and sample C has the lowest score. The large language model can sort the three samples in descending order of scores, i.e., sample A, sample B, and sample C.

[0078] Step S402: adjusting the second input prompt word based on the classification result and the first generation task to obtain a second output prompt word.

[0079] Specifically, the first input prompt word and the first classification task are obtained based on the second input prompt word and the first generation task; after the system classifies the second sample through the large language model to obtain the classification result, it can adjust the second input prompt word based on the sorting and analysis of the classification result. For samples with higher classification result scores, the system can analyze the reasons for their scores through the large language model, such as the accuracy of the second input prompt word, the rationality of the language structure, etc., and strengthen the second input prompt word based on these characteristics to obtain the adjusted second output prompt word; and for samples with lower scores, the system can analyze the reasons for the problems of the sample through the large language model, such as the ambiguity of the second input prompt word, the lack of keyword information, etc., so as to adjust the second input prompt word in a targeted manner to obtain the adjusted second output prompt word, so that the large language model generates an output that meets the first generation task and has higher quality. Exemplarily, the large language model can accurately classify and predict the above-mentioned positive sample and marginal sample through the first output prompt word in the first classification task. For example, for the positive sample article with the theme of "elaborating on the harm of global warming to the marine ecosystem", its score is high, which may be because the prompt word clearly points out the content and direction of the research; while for the marginal sample article with the theme of "analyzing the impact of the economy on climate change", its score is low, which may be because the second input prompt word does not fully emphasize the specific connection and analysis focus between the economy and climate change. Further, the system can adjust and adjust the second input prompt word based on the analysis of the sample by the large language model, for example, adjusting the second input prompt word from "generate an article" to the second output prompt word "generate an article on the harm of climate change to the marine ecosystem", so as to improve the accuracy of the content generated by the generation task based on the adjusted prompt word.

[0080] In a possible implementation, the first generation task and the second input prompt word may be input by the user, the first generation task is used to indicate the goal of this task, and the second input prompt word is used to indicate the preliminary direction of the task, wherein the second input prompt word can be adjusted based on the iterative process in step S401 to step S404, and the first generation task remains unchanged, and is used to guide the goal of the classification task. Exemplarily, user input can be completed through various interactive methods, such as through text boxes, voice input, handwriting input, etc.; for example, the second input prompt word entered by the user through the text box can be "generate an article", and the first generation task can be "generate an article about climate change". Optionally, the system can also provide a certain feedback mechanism when receiving the user's input content, such as prompting the user whether the format or content of the input meets the requirements, so as to avoid unnecessary errors or ambiguities.

[0081] In one possible implementation, after receiving user input, the system may rewrite the second input prompt word corresponding to the first generation task through the large language model to perform a classification task, that is, adjust the second input prompt word applied to the first generation task to the first input prompt word applied to the first classification task. Exemplarily, if the meta-prompt structure of the generation task input by the user includes a second input prompt word and a first generation task, wherein the second input prompt word is "generate an article" and the first generation task is "generate an article about climate change". The system may rewrite the meta-prompt structure of the above generation task into the meta-prompt structure of the classification task through the large language model. For example, the prompt word may be rewritten from "generate an article" to "evaluate the quality of the article", and the first generation task may be rewritten from "generate an article about climate change" to "evaluate the quality of the article about climate change". Furthermore, the large language model may also perform the classification task based on the rewritten meta-prompt structure to obtain a trained evaluation prompt word (i.e., the first output prompt word obtained after the final adjustment obtained in step S308). For details, please refer to Figure 3 The description of the implementation example of the classification task corresponding to steps S301 to S308 will not be repeated here.

[0082] Step S403: Determine a second sample corresponding to the second input prompt word and the first generation task.

[0083] Specifically, the second sample includes a second positive sample and a second marginal sample, and the second marginal sample is determined based on the iteration of the first generation task; the large language model can generate corresponding multiple scene simulations based on the second input prompt word corresponding to the first generation task, that is, multiple positive samples and marginal samples, and annotate the above multiple positive samples and marginal samples through the large language model or a pre-trained annotation model. Exemplarily, if the second input prompt word is "generate an article" and the first generation task is "generate an article about climate change", the positive samples generated by the large language model may include articles with themes such as "elaborating on the hazards of global warming to marine ecosystems" and "exploring how climate change affects the stability of agricultural production" and other content related to the first generation task, and marginal samples may include articles with themes such as "analyzing the impact of the economy on climate change" and "studying work problems caused by climate change" that are easy to cause the large language model to misjudge. Optionally, the system can also annotate the above multiple positive samples and marginal samples through a large language model or a pre-trained annotation model; for details, please refer to Figure 3 The corresponding description of the embodiment in step S303 is omitted here.

[0084] Scene simulation and annotation.

[0085] Step S404: taking the second output prompt word as the second input prompt word, and repeating the above steps until the second output prompt word satisfies a second preset condition, terminating the iterative process, and outputting the second output prompt word that satisfies the second preset condition.

[0086] Specifically, the system can evaluate the adjusted prompt word through the large language model to determine whether it meets the preset iteration standard. If the adjustment effect of the second output prompt word meets the system preset standard, such as the accuracy or quality of the generated content meets the requirements, the system will end the iteration process; otherwise, the system can re-perform the loop process of step S401-step S404 based on the adjusted second output prompt word until the adjusted second output prompt word meets the above preset standard. For details, please refer to the description of the embodiment corresponding to step S307, which will not be repeated here.

[0087] In a possible implementation, after confirming that the second output prompt word has reached the preset adjustment standard, the system will output the final adjusted second output prompt word. The user can select the second output prompt word and input it into the large language model to generate the output content that the user really needs. In a specific application scenario, the second input prompt word can be selected from a preset prompt word library, or manually input by the user. In an embodiment of the present application, after the user inputs the second input prompt word into the large language model, the large language model will analyze and process the prompt word to generate an adjusted prompt word. The user can select the adjusted prompt word and input it into the large language model or other text large model for content generation. For example, the second input prompt word may be "describe the characteristics of an animal", and the prompt word adjusted by the large language model may be "describe the appearance, habits and living environment of an animal". Furthermore, the user can generate more detailed content by inputting the adjusted prompt word into the text model. For example, in a text generation task, the large language model can generate a more detailed description text about the animal's characteristics based on the adjusted prompt word. For example, after the user inputs the above-mentioned adjusted prompt word and "tiger" into the text model, the text model can output more detailed content about the tiger, such as "This animal is a tiger. It has yellow fur and black stripes. It has ferocious habits and likes to live alone. Its living environment is mainly forests and grasslands." In the embodiment of the present application, after the prompt word is adjusted by the large language model, the adjusted prompt word can be input into the large language model or other text models to more accurately output the content that the user really needs.

[0088] See also Figure 5 , Figure 5 is a structural diagram of a prompt word adjustment device provided in an embodiment of the present application, such as Figure 5 As shown, the adjustment device 50 for the first prompt word includes:

[0089] A classification module 501, classifying the first sample based on the first input prompt word and the first classification task to obtain a classification result;

[0090] The first input prompt word adjustment module 502 compares the classification result of the first sample with the labeling result, and adjusts the first input prompt word based on the comparison result and the first classification task to obtain a first output prompt word;

[0091] A determination module 503 is used to determine a first sample corresponding to the first input prompt word and the first classification task, wherein the first sample includes a first positive sample and a first marginal sample, and the first marginal sample is determined iteratively based on the first classification task;

[0092] In a possible implementation, the determining module 503 is specifically configured to:

[0093] Generate the corresponding first positive sample based on the first input prompt word and the first classification task;

[0094] The first edge sample is determined based on the first comparison result in the previous iteration.

[0095] In a possible implementation, the determining module 503 is specifically configured to:

[0096] Determining a first deviation of the first input prompt word compared to the first classification task based on the first comparison result;

[0097] The first edge sample is generated based on the first deviation.

[0098] The first output prompt word iteration module 504 is used to use the first output prompt word as the first input prompt word, repeatedly execute the above steps until the first output prompt word meets the first preset condition, end the iteration process, and output the first output prompt word that meets the first preset condition.

[0099] The first output prompt word iteration module 504 is used to use the first output prompt word as the first input prompt word, repeatedly execute the above steps until the first output prompt word meets the first preset condition, end the iteration process, and output the first output prompt word that meets the first preset condition.

[0100] In a possible implementation, the first prompt word adjustment device 50 further includes:

[0101] Acquire a second input prompt word and a first generation task, wherein the second input prompt word is used to indicate the first generation task; the first input prompt word applicable to the classification task type and the first classification task are converted based on the second input prompt word applicable to the generation task type and the first generation task;

[0102] Determine a plurality of generated samples corresponding to the second input prompt word and the first generation task, wherein the plurality of generated samples include a second positive sample and a second marginal sample, and the second marginal sample is determined based on a previous iteration of the first generation task;

[0103] Performing the first classification task on the plurality of generated samples by using the first output prompt word to obtain the classification result;

[0104] adjusting the second input prompt word based on the classification result and the first generation task to obtain the second output prompt word, wherein the classification result is used to indicate the quality of the second input prompt word;

[0105] The second output prompt word is used as the second input prompt word, and the above steps are repeatedly performed until the second output prompt word meets the second preset condition, the iterative process is terminated, and the second output prompt word that meets the second preset condition is output.

[0106] In a possible implementation, the first prompt word adjustment device 50 further includes:

[0107] Determining a second deviation of the second input prompt word compared to the first generation task based on the classification result;

[0108] The second edge sample is generated based on the second deviation.

[0109] In a possible implementation, the first prompt word adjustment device 50 further includes:

[0110] A second input prompt word and the first generation task input by a user are received.

[0111] It is worth pointing out that the specific functional implementation of the first prompt word adjustment device 50 is shown in the above Figure 1 In the data processing and analysis framework shown, for example, the data management unit 101 is used to implement execution through the dynamic sample generation and adaptation unit 101-A. Figure 2The relevant contents of step S201 in the above description, the sample estimation engine 102 is used to implement the relevant contents of step S202, and the performance evaluation component 103 executes the relevant contents of step S203-step S204 through the effect feedback analysis component 103-A and the prompt word intelligent iteration engine 103-B. Each unit or module in the adjustment device 50 of the first prompt word can be respectively or completely merged into one or several other units or modules to form, or one (some) of the units or modules can also be further divided into multiple smaller units or modules in function to form, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present invention. The above-mentioned units or modules are divided according to logical functions. In practical applications, the function of one unit (or module) is realized by multiple units (or modules), or the function of multiple units (or modules) is realized by one unit (or module).

[0112] According to the description of the above method embodiment and related device embodiment, please refer to Figure 6 , Figure 6 Schematic diagram of another device for adjusting prompt words provided in an embodiment of the present application. Schematic diagram of another device for adjusting second prompt words 600 provided in an embodiment of the present application. Figure 6 The second prompt word adjustment device 600 shown includes a processor 601, a memory 602, a communication interface 603 and a bus 604. The processor 601, the memory 602 and the communication interface 603 are connected to each other through the bus 604.

[0113] Optionally, the memory 602 is a ROM, a static storage device, a dynamic storage device or a RAM.

[0114] The memory 602 can store executable program codes. When the executable program codes stored in the memory 602 are executed by the processor 601, the processor 601 and the communication interface 603 are used to execute Figure 1 The various steps of the method for adjusting the prompt words of the illustrated embodiment.

[0115] The processor 601 adopts a general-purpose CPU, a microprocessor, an application-specific integrated circuit ASIC, a GPU or one or more integrated circuits to execute relevant programs to perform the method for adjusting the prompt word of the method embodiment of the present application.

[0116] Processor 601 can also be an integrated circuit chip with signal processing capability. In the implementation process, each step of the method for adjusting the prompt word of the present application can be completed by the hardware integrated logic circuit or software instructions in the processor 601. Optionally, processor 601 is a general-purpose processor, DSP, ASIC, FPGA or other programmable logic device, discrete gate or transistor logic device, discrete hardware component. The processor can implement or execute the disclosed methods, steps and logic block diagrams in the embodiments of the present application. The general-purpose processor is a microprocessor or the processor is any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor to execute, or the hardware and software modules in the decoding processor are combined and executed. The optional software module is located in a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register or other mature storage media in the art. The storage medium is located in the memory 602, and the processor 601 reads the information in the memory 602, and combines its hardware to complete the functions required to be executed by the modules included in the second prompt word adjustment device 600 of the embodiment of the present application, or executes the prompt word adjustment method of the method embodiment of the present application.

[0117] The communication interface 603 uses a transceiver or other related device such as, but not limited to, a transceiver.

[0118] The bus 604 may include a path for transmitting information between various components of the second prompt word adjustment device 600 (eg, the memory 602 , the processor 601 , and the communication interface 603 ).

[0119] It should be noted that although Figure 6 The second prompt word adjustment device 600 shown only shows a memory, a processor, and a communication interface. However, in the specific implementation process, those skilled in the art should understand that the second prompt word adjustment device 600 also includes other devices necessary for normal operation. At the same time, according to specific needs, those skilled in the art should understand that the second prompt word adjustment device 600 may also include hardware devices for implementing other additional functions. In addition, those skilled in the art should understand that the second prompt word adjustment device 600 may also only include the devices necessary for implementing the embodiment of the present application, and does not necessarily include Figure 6 All devices shown in .

[0120] An embodiment of the present application provides a computer-readable storage medium, in which a computer program for electronic data exchange is stored. The computer program includes execution instructions, and the execution instructions are used to execute part or all of the steps of any one of the prompt word adjustment methods recorded in the above-mentioned prompt word adjustment method embodiments. The above-mentioned computer includes an electronic terminal device.

[0121] An embodiment of the present application provides a computer program product, wherein the computer program product includes a computer program, and the computer program can be operated to enable a computer to perform part or all of the steps of any prompt word adjustment method recorded in the above method embodiment. The computer program product can be a software installation package.

[0122] It should be noted that, for the sake of simplicity, the embodiments of any of the aforementioned methods for adjusting the prompt words are all described as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the present application.

[0123] The embodiments of the present application are introduced in detail above. Specific examples are used herein to illustrate the principle and implementation method of a prompt word adjustment method and device of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for a general technician in this field, according to the idea of ​​a prompt word adjustment method and device of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

[0124] The present application is described with reference to the flowcharts and / or block diagrams of the methods, hardware products, and computer program products of the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0125] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1The memory may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0126] Although the present application is described herein in conjunction with various embodiments, in the process of implementing the claimed application, those skilled in the art may understand and implement other variations of the disclosed embodiments by viewing the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "one" does not exclude multiple situations. Certain measures are recorded in different dependent claims, but this does not mean that these measures cannot be combined to produce good results.

[0127] A person skilled in the art can understand that all or part of the steps in the various methods of the above-mentioned method for adjusting the prompt word can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable memory, and the memory can include: a flash drive, a read-only memory (English: Read-Only Memory, abbreviated: ROM), a random access memory (English: Random Access Memory, abbreviated: RAM), a disk or an optical disk, etc.

[0128] It can be understood that any product that is controlled or configured to execute the processing method of the flowchart described in an embodiment of a prompt word adjustment method of the present application, such as the device and computer program product of the above flowchart, belongs to the category of related products described in the present application.

[0129] Obviously, those skilled in the art can make various changes and modifications to the method and device for adjusting prompt words provided by the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application is also intended to include these modifications and variations.

Claims

1. A method for adjusting a prompt word, characterized in that: Applied to a large language model; the method comprises: Classify the first sample based on the first input prompt word and the first classification task to obtain a classification result; Comparing the classification result of the first sample with the labeling result, and adjusting the first input prompt word based on the comparison result and the first classification task to obtain a first output prompt word; Determine a first sample corresponding to the first output prompt word and the first classification task, wherein the first sample includes a first positive sample and a first marginal sample, and the first marginal sample is iteratively determined based on the first classification task; The first output prompt word is used as the first input prompt word, and the above steps are repeatedly performed until the first output prompt word meets the first preset condition, the iterative process is terminated, and the first output prompt word that meets the first preset condition is output.

2. The method according to claim 1, characterized in that The determining the first sample corresponding to the first input prompt word and the first classification task includes: Generate the corresponding first positive sample based on the first input prompt word and the first classification task; The first edge sample is determined based on the comparison result.

3. The method according to claim 2, characterized in that The determining the first edge sample based on the comparison result includes: Determining a first deviation between the first input prompt word and the first classification task based on the comparison result; The first edge sample is generated based on the first deviation.

4. The method according to any one of claims 1 to 3, characterized in that The step of comparing the classification result of the first sample with the labeling result, and adjusting the first input prompt word based on the comparison result and the first classification task, includes: A similarity score between a classification result and an annotation result of the first sample is calculated, and the first input prompt word is adjusted according to the similarity score and the first classification task.

5. The method according to any one of claims 1 to 4, characterized in that The method further comprises: Classify the second sample based on the first output prompt word and the first classification task to obtain the classification result; Adjusting a second input prompt word based on the classification result and the first generation task to obtain a second output prompt word, wherein the first input prompt word and the first classification task are obtained based on the second input prompt word and the first generation task; Determine a second sample corresponding to the second input prompt word and the first generation task, the second sample includes a second positive sample and a second marginal sample, and the second marginal sample is iteratively determined based on the first generation task; The second output prompt word is used as the second input prompt word, and the above steps are repeatedly performed until the second output prompt word meets the second preset condition, the iterative process is terminated, and the second output prompt word that meets the second preset condition is output.

6. The method according to claim 5, characterized in that The step of adjusting the second input prompt word based on the classification result and the first generation task to obtain a second output prompt word includes: Determining a second deviation between the second input prompt word and the first generated task based on the classification result; The second edge sample is generated based on the second deviation.

7. A method for applying a large language model, characterized in that: The method comprises: Inputting the third input prompt word into the large language model to obtain an adjusted prompt word; The large language model is trained according to the method for adjusting prompt words described in any one of claims 1 to 6.

8. A device for adjusting prompt words, characterized in that: The device comprises: a classification module, classifying the first sample based on the first input prompt word and the first classification task to obtain a classification result; A first input prompt word adjustment module is used to compare the classification result of the first sample with the labeling result, and the first input prompt word is adjusted based on the comparison result and the first classification task to obtain a first output prompt word; A determination module, configured to determine a first sample corresponding to the first input prompt word and the first classification task, wherein the first sample includes a first positive sample and a first marginal sample, and the first marginal sample is determined iteratively based on the first classification task; The first output prompt word iteration module is used to use the first output prompt word as the first input prompt word, repeatedly execute the above steps until the first output prompt word meets a first preset condition, end the iteration process, and output the first output prompt word that meets the first preset condition.

9. A device for adjusting prompt words, characterized in that: The device comprises: A memory, a processor, and an executable program code stored in the memory and executable on the processor, wherein the processor executes the steps of the method for adjusting the prompt word according to any one of claims 1 to 7 when executing the executable program code.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores executable program codes, wherein the executable program codes include execution instructions, and the execution instructions are used to execute the steps of the method for adjusting the prompt words according to any one of claims 1 to 7.

11. A computer program product, characterized in that The computer program product comprises a computer program, and the computer program is used to enable a computer to execute the steps of the method for adjusting the prompt word according to any one of claims 1 to 7.