Information processing method and apparatus, and computer program product, computer device and computer-readable storage medium
By automatically optimizing the semantic direction of prompts through network models, and combining chain thinking and few-shot learning, the problem of low efficiency in prompt optimization in existing technologies is solved, achieving efficient and accurate prompt optimization and improving the data prediction accuracy of large language models.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2025-10-27
- Publication Date
- 2026-06-04
Smart Images

Figure CN2025130193_04062026_PF_FP_ABST
Abstract
Description
Information processing methods, apparatus, computer program products, computer equipment and computer-readable storage media
[0001] Cross-reference to related applications
[0002] This application is based on and claims priority to Chinese Patent Application No. 202411758843.8, filed on November 29, 2024, the entire contents of which are incorporated herein by reference. Technical Field
[0003] This application relates to the field of artificial intelligence, and more particularly to an information processing method, apparatus, computer program product, computer equipment, and computer-readable storage medium. Background Technology
[0004] Large language models are deep learning models trained on massive amounts of text data. They can predict data based on rules indicated by input prompts, and the quality of these prompts significantly impacts the accuracy of these predictions. With the development of natural language processing technology, the design of prompts has a significant impact on model performance and task completion quality; therefore, how to efficiently and automatically optimize prompts has become a key research focus.
[0005] In related technologies, prompts are typically optimized manually using expert experience to improve their quality, allowing large language models to make more accurate data predictions. However, this method of optimizing prompts is inefficient and largely relies on subjective human factors, resulting in inconsistent optimization effects and low accuracy. Summary of the Invention
[0006] This application provides an information processing method, apparatus, computer program product, computer equipment, and computer-readable storage medium that can improve the efficiency and accuracy of optimizing prompt information.
[0007] This application provides an information processing method executed by a computer device. The method includes: acquiring first prompt information to be optimized and a sample dataset, wherein the first prompt information is used to suggest rules for predicting sample data in the sample dataset; invoking a network model to perform predictive processing on the sample data in the sample dataset according to the rules suggested by the first prompt information, thereby obtaining prediction results for the sample data in the sample dataset; invoking the network model to perform semantic understanding processing on the first prompt information based on the prediction results of the sample data in the sample dataset, thereby obtaining optimization instruction information for the first prompt information; the optimization instruction information is used to indicate the semantic direction for optimizing the first prompt information; and invoking the network model to perform optimization processing on the first prompt information according to the semantic direction indicated by the optimization instruction information, thereby obtaining second prompt information.
[0008] This application provides an information processing apparatus, comprising: an acquisition module configured to acquire first prompt information to be optimized and a sample dataset, wherein the first prompt information indicates rules for predicting sample data in the sample dataset; a prediction module configured to invoke a network model to predict the sample data in the sample dataset according to the rules indicated by the first prompt information, thereby obtaining prediction results for the sample data in the sample dataset; a generation module configured to invoke a network model to perform semantic understanding processing on the first prompt information based on the prediction results of the sample data in the sample dataset, thereby obtaining optimization instruction information for the first prompt information; the optimization instruction information is used to indicate the semantic direction for optimizing the first prompt information; and an optimization module configured to invoke a network model to optimize the first prompt information according to the semantic direction indicated by the optimization instruction information, thereby obtaining second prompt information.
[0009] This application provides a computer device, including a memory and a processor. The memory is used to store computer-executable instructions or computer programs; the processor is used to implement the above-described method when the computer-executable instructions or computer programs stored in the memory are used.
[0010] This application provides a computer-readable storage medium that stores computer-executable instructions or computer programs. When the computer-executable instructions or computer programs are executed by a processor, they implement the above-described method.
[0011] This application provides a computer program product, which includes computer-executable instructions or a computer program. When the computer-executable instructions or the computer program are executed by a processor, the above-described method is implemented.
[0012] In this embodiment, the computer device can acquire a first prompt message to be optimized and a sample dataset. The first prompt message is used to suggest rules for predicting the sample data in the sample dataset. The device can then call a network model to perform prediction processing on the sample data in the sample dataset according to the rules suggested by the first prompt message, thereby obtaining the prediction results of the sample data in the sample dataset. Then, the device can call the network model to perform semantic understanding processing on the first prompt message based on the prediction results of the sample data in the sample dataset, thereby generating optimization instruction information for the first prompt message. The optimization instruction information clarifies the semantic direction that the first prompt message needs to be optimized. Finally, the device calls the network model to perform optimization processing on the first prompt message according to the instructions of the optimization instruction information, thereby obtaining a second prompt message. Therefore, this application proposes an automatic optimization method for the first prompt information. In this embodiment, the network model can use the prediction result obtained by actually predicting sample data using the first prompt information as a reference to perform semantic understanding processing on the first prompt information, thereby generating optimization indication information that guides the semantic direction of optimization of the first prompt information. Through this optimization indication information, the network model can achieve automated and accurate optimization processing of the first prompt information. Furthermore, by combining the prediction result with semantic understanding, it can automatically identify problematic parts in the first prompt information and provide targeted optimization suggestions, thereby achieving efficient iterative optimization of the first prompt information. Thus, this application improves the efficiency and accuracy of optimizing the first prompt information. Attached Figure Description
[0013] To more clearly illustrate the technical solutions in this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0014] Figure 1 is a schematic diagram of the network architecture of an information processing network provided in an embodiment of this application;
[0015] Figure 2 is a schematic diagram of a scenario for an optimized prompt message provided in an embodiment of this application;
[0016] Figure 3 is a flowchart illustrating an information processing method provided in an embodiment of this application;
[0017] Figure 4 is a schematic diagram of the effect of optimizing the prompt information in a client interface according to an embodiment of this application;
[0018] Figure 5 is a schematic diagram of the effect of another client interface for optimizing prompt information provided in an embodiment of this application;
[0019] Figure 6 is a schematic diagram of a process for selecting reference sample data from a sample dataset according to an embodiment of this application;
[0020] Figure 7 is a schematic diagram of an optimized architecture for prompting information provided in an embodiment of this application;
[0021] Figure 8 is a schematic diagram of a process for obtaining second prompt information by optimizing instruction information according to an embodiment of this application;
[0022] Figure 9 is a schematic diagram of a scenario where the prompt information is iteratively optimized in multiple rounds according to an embodiment of this application;
[0023] Figure 10 is a schematic diagram of the structure of an information processing device provided in an embodiment of this application;
[0024] Figure 11 is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0025] The technical solutions of this application will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0026] First, it should be noted that all data collected in the embodiments of this application (such as prompt information, sample data, and test data) are collected with the consent and authorization of the data subject (such as user, organization, or enterprise), and the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant regions.
[0027] Here, the relevant technical concepts involved in the embodiments of this application are explained:
[0028] (1) Artificial Intelligence (AI): is a new technical science that studies, develops, and applies theories, methods, technologies, and application systems to simulate, extend, and expand human intelligence. The embodiments of this application mainly involve the process of data prediction using a large language model trained through machine learning in artificial intelligence.
[0029] (2) Large Language Model (LLM): This is a deep learning model trained using a large amount of text data, capable of generating natural language text or understanding the meaning of language text. LLMs can handle various natural language tasks, such as text classification, question answering, and dialogue, and are an important pathway to artificial intelligence. The network model mentioned in the embodiments of this application generally refers to a large language model. The network model mentioned in the embodiments of this application can be a deep learning-based natural language processing model capable of generating corresponding output results based on input prompts. Through training, the network model acquires a large amount of language knowledge and can generate outputs with different styles or structures based on different prompts.
[0030] (3) Prompts for the Large Language Model: Also referred to as prompt information in this embodiment, prompts for the large language model are key information or guiding statements provided to the large language model to help it better understand the user's question and generate more accurate and targeted answers. Prompts can be text input used to guide the large language model in performing a specific task. Prompts can contain information such as task descriptions, example data, and expected output formats, and are an important guiding mechanism in the reasoning process of the large language model. Prompts can be in the form of questions, instructions, descriptions, etc., and their purpose is to stimulate the large language model to generate relevant and meaningful outputs. All the prompt information described in this application can be considered prompts for the large language model.
[0031] (4) Chain of Thought (COT): This refers to breaking down a logically complex problem and forming a complete thinking process through a series of logically related thoughts.
[0032] (5) Few Shot: Few-shot learning refers to a method in which the model understands and completes a specific task by providing a small number of examples during training. It is particularly suitable for dealing with limited data. The core of Few Shot learning is to guide the model with a small number of examples so that it can better understand the goal and output requirements of the task.
[0033] (6) Prediction Result: This refers to the output result obtained by the network model after reasoning about the sample data based on the prompt information. The prediction result can be used to evaluate the effectiveness of the current prompt information and serve as the basis for subsequent optimization.
[0034] (7) Semantic Understanding Processing: This refers to the process of using a network model to analyze the differences between predicted and actual results, extracting the causes of errors or directions for improvement, and generating optimized instruction information. This process relies on the network model's ability to understand language, identify potential problems in the prompt information, and propose improvement suggestions.
[0035] (8) Optimization Instruction Information: This is a text message generated by the network model based on the difference between the predicted and actual results. It indicates how to adjust the original prompts to improve the network model's performance. Optimization instruction information can include the cause of the error, suggested directions for modification, etc., and is the core basis for achieving automatic optimization.
[0036] (9) Iterative Optimization: A method that gradually improves prompts through multiple iterations. Each iteration includes three steps: calling the network model to make predictions, analyzing the prediction results and generating optimization suggestions, and adjusting the prompts based on the suggestions. Through continuous iteration, the optimal prompt words can be approximated, improving the accuracy and recall of the network model.
[0037] (10) Evaluation Metric Values: A set of quantitative metrics used to measure the effectiveness of the optimized prompt information, such as precision, recall, and F1 score. These metrics reflect the performance of the network model on a specific task and are important criteria for determining whether to continue optimization.
[0038] (11) Bad case: refers to sample data in which the predicted result is inconsistent with the actual result during the prediction process of the network model. By analyzing the bad case, the shortcomings of the current prompt information can be found, and targeted optimization can be carried out accordingly.
[0039] (12) Few-shot Learning: A method that requires only a small number of examples to complete model training or optimization. In the embodiments of this application, a small number of examples are introduced to help the network model better understand the task requirements, thereby achieving high prediction performance under limited data conditions.
[0040] Please refer to Figure 1, which is a schematic diagram of the network architecture of an information processing network provided in an embodiment of this application. As shown in Figure 1, the network architecture may include a server 200 and a cluster of terminal devices. The cluster of terminal devices may include one or more terminal devices; the number of terminal devices is not limited here. As shown in Figure 1, the multiple terminal devices may specifically include terminal device 1, terminal device 2, terminal device 3, ..., terminal device n. As shown in Figure 1, terminal device 1, terminal device 2, terminal device 3, ..., terminal device n can all be connected to the server 200 via the network, so that each terminal device can interact with the server 200 through the network connection.
[0041] As shown in Figure 1, server 200 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. Terminal devices can be smart terminals such as smartphones, tablets, laptops, desktop computers, smart TVs, in-vehicle terminals, and smart home devices. The following description uses the communication between terminal device 1 and server 200 as an example to illustrate the specific implementation of this application.
[0042] The aforementioned terminal device 1 can be a user's user terminal. Terminal device 1 may include a client that can request optimization of the prompts in the large language model. Server 200 can be the backend server for this client. In this embodiment, the prompts in the large language model can be referred to as prompt information. Therefore, the user can input the desired prompt information (which can be called initial prompt information) into the client of terminal device 1. Terminal device 1 can then send the initial prompt information input by the user to server 200 for optimization. Server 200 can then return the optimized prompt information (which can be called target prompt information) to the client in terminal device 1, allowing the client to output the target prompt information for the user's use. The process of server 200 optimizing the initial prompt information can be further described in the embodiment corresponding to Figure 2 below.
[0043] Please refer to Figure 2, which is a schematic diagram of a scenario for optimizing prompt information provided in an embodiment of this application. As shown in Figure 2, the server 200 in Figure 1 can obtain a sample dataset, and the initial prompt information can be used to indicate the rules for predicting the sample data in the sample dataset. The server 200 can first pre-optimize the initial prompt information provided by the user, so that the server 200 can pre-learn the rules indicated by the initial prompt information. The prompt information obtained after pre-optimizing the initial prompt information can be used to indicate the rules for predicting the sample data in the sample dataset. Here, the principle of the server 200 optimizing the first prompt information is mainly described. The specific process of pre-optimizing the initial prompt information can be found in the relevant description in the embodiment corresponding to Figure 3 below.
[0044] Server 200 can obtain network model 201, which can be a large language model. Server 200 can call network model 201 to perform prediction processing on sample data in sample dataset 202 according to the rules prompted by the first prompt information, so as to obtain prediction results 203 of sample data in sample dataset.
[0045] Therefore, server 200 can call network model 201 to generate optimization instruction information 204 for the first prompt information based on the prediction results 203 of the sample data in the sample dataset. This optimization instruction information 204 indicates the semantic direction for optimizing the first prompt information. Thus, server 200 can call network model 201 to optimize the first prompt information using the generated optimization instruction information 204 to obtain second prompt information 205. If the second prompt information 205 meets the optimization termination condition, server 200 can directly use the second prompt information 205 as the final optimized target prompt information. If the second prompt information 205 does not meet the optimization termination condition, server 200 can continue to iteratively optimize the second prompt information according to the principle of optimizing the first prompt information, until a prompt information meeting the optimization termination condition is finally obtained, which can then be used as the final optimized target prompt information. The specific definition of the optimization termination condition can be found in the relevant description in the embodiment corresponding to Figure 8 below.
[0046] This application provides a method for automatically optimizing prompt words. This application can use a network model combined with the prediction results of sample data to perform semantic understanding processing on the prompt words (such as the first prompt information) that need to be optimized, so as to generate optimized instruction information for the prompt words. Thus, the optimization processing of the prompt words can be realized through the optimized instruction information to improve the quality of the prompt words and obtain prompt words with excellent results.
[0047] Please refer to Figure 3, which is a flowchart illustrating an information processing method provided in an embodiment of this application. The executing entity in this embodiment can be an information processing device (hereinafter referred to as a processing device). This processing device can be a single computer device or a cluster of multiple computer devices. The computer device can be a server, a terminal device, or other devices; this embodiment does not impose any limitations on this. As shown in Figure 3, taking a single computer device as an example, the method may include steps S101 to S104:
[0048] Step S101: Obtain the first prompt information to be optimized and the sample dataset. The first prompt information is used to prompt the rules for predicting the sample data in the sample dataset.
[0049] The computer device can obtain the first prompt information to be optimized and the sample dataset. The sample dataset can contain multiple sample data. The first prompt information can be used to prompt the rules for predictive processing of the sample data in the sample dataset. The rules can be any required rules. Since the rules for predictive processing of the data can be arbitrary, the data format of the data to be predicted can also be arbitrary. For example, the data format of the sample data can be any data format that the rules prompted by the first prompt information require for predictive processing. For example, the data format that the rules prompted by the first prompt information require for predictive processing can be text data format or image data format, etc.
[0050] In practice, the first prompt is a text input used to guide a Large Language Model (LLM) to perform a specific task. It typically includes a task description, sample data, and the expected output format. For example, the first prompt might be to determine whether a user's resume meets the job requirements and output "yes" or "no." The task description above constitutes a specific example of a first prompt. The sample dataset is a collection of data used to train or evaluate the model, and can include multiple sample data points and their corresponding labels or target results. For example, in a resume screening scenario, the sample data could be multiple resumes and their actual labeled results indicating whether they meet the job requirements. By acquiring the first prompt and the sample dataset, the computer device can provide the basic input for subsequent prediction processing and optimization.
[0051] For example, the first prompt could also be "Categorize news about natural disasters, which may include, but are not limited to, floods, typhoons, earthquakes, and wildfires. News about post-disaster reconstruction and ecological protection is not considered natural disaster news." The rule indicated by this first prompt could be to predict and categorize news about natural disasters.
[0052] In this embodiment, obtaining the first prompt information may include: a computer device acquiring input initial prompt information, which may be the prompt information initially provided and input by the user. This initial prompt information can also be used to indicate the rules for predictive processing of sample data in the sample dataset. The quality of the initial prompt information provided by the user may be poor; for example, the initial prompt information may not clearly indicate the rules for predictive processing of sample data in the sample dataset. Therefore, this embodiment provides a method for automatically optimizing the initial prompt information.
[0053] The computer device can perform pre-optimization processing on the initial prompt information. The prompt information obtained by pre-optimizing the initial prompt information can be called the basic prompt information, which is the prompt information to be iteratively optimized.
[0054] For example, the process of pre-optimizing the initial prompt information to generate basic prompt information may include: the computer device can obtain a network model, which may be the aforementioned large language model, or the network model may also be called a language understanding model, such as an LLM model. In this embodiment of the application, the network model can be used to optimize the prompt information, as described below.
[0055] Computer devices can invoke network models to generate derivation information corresponding to the rules suggested in the initial prompts. This derivation information can be generated by the network model itself to guide its derivation of the rules suggested in the initial prompts; that is, it guides the network model on how to deduce the rules suggested in the initial prompts. Therefore, the network model can use this derivation information to process the rules suggested in the initial prompts. In this derivation process, the network model can optimize the initial prompts. The prompt information obtained after optimizing the initial prompts during this derivation process can be called intermediate prompt information.
[0056] The above derivation process can be achieved by applying Chain Thinking (COT) to the network model. The network model can use COT to deduce the rules suggested by the initial prompts and, in the process of derivation, think about and learn the rules suggested by the initial prompts. Thus, the network model can optimize the initial prompts by the results of thinking about and learning the rules suggested by the initial prompts during the derivation process (the specific results may depend on the network model's own language comprehension ability) to generate intermediate prompts. These intermediate prompts can describe the suggested rules more clearly and accurately than the initial prompts. Through this derivation process, the network model can be stimulated to have relevant knowledge and understanding of the rules suggested by the initial prompt. In fact, the network model itself is fully capable of understanding the rules suggested by the initial prompt, but this ability is implicit and needs to be stimulated (i.e., guided). Therefore, in this embodiment, by having the network model use chain thinking (COT) to deduce the rules suggested by the initial prompt, the network model's relevant knowledge and understanding of the rules suggested by the initial prompt are stimulated. Furthermore, in the subsequent optimization process of the prompt, the network model can also use this stimulated knowledge and understanding to perform semantic understanding and optimization of the prompt.
[0057] The rules suggested by the intermediate prompts and those suggested by the initial prompts share the same purpose, such as predicting and classifying news about natural disasters. However, the intermediate prompts describe the rules more accurately and clearly than the initial prompts. For example, the intermediate prompts provide clearer and more accurate definitions and explanations of news about natural disaster categories compared to the initial prompts. In other words, the intermediate prompts are an optimization of the rule description in the initial prompts, but this optimization does not change the core purpose of the rules suggested by the initial prompts. In fact, the optimization of the prompts in this application embodiment aims to make the prompts describe and explain the rules more clearly and accurately. This optimization does not change the core purpose of the rules suggested by the prompts; that is, whether it is the prompt before or after optimization, the intended function is the same, such as instructing the corresponding predictive processing for the same type of data.
[0058] The computer device can generate the aforementioned basic prompt information using this intermediate prompt information. This process may include: the computer device acquiring a sample example, which may contain sample data and the actual result required to predict the sample data according to the rules suggested in the initial prompt information. For example, the actual result may indicate that the sample data is actually news about a natural disaster or not. The data format of the sample data and the aforementioned sample data may be the same, such as both being text format data.
[0059] The computer device can invoke the network model to adaptively learn the rules suggested by the intermediate prompts through the above sample examples. That is, the sample examples can guide (i.e. instruct) the network model to learn and understand the rules suggested by the intermediate prompts. Furthermore, during this adaptive learning process, the network model can optimize the intermediate prompts by using the knowledge learned under the guidance of the sample examples to obtain the above basic prompts.
[0060] The aforementioned adaptive learning process may employ a Few-Shot learning method. In this embodiment, this Few-Shot method can guide the network model to further learn the rules suggested by the intermediate prompts. The learning results (which may also depend on the network model's own language comprehension ability) are then used to optimize the intermediate prompts, thereby obtaining basic prompts. The sample examples described above can be examples from this Few-Shot method. The basic prompts, intermediate prompts, and the initial prompts all convey the same main idea of the rules. However, the basic prompts are obtained through further optimization of the intermediate prompts, and the rules suggested by the basic prompts are clearer and more accurate than those suggested by the intermediate prompts.
[0061] Through the aforementioned pre-optimization process of the initial prompts, not only is the initial prompts pre-optimized, but the network model also achieves pre-learning and adaptive learning of the rules suggested by the initial prompts. Furthermore, the chain-thinking COT mechanism stimulates the network model's understanding of the rules suggested by the initial prompts, and the Few Shot method guides the network model's understanding of data prediction using the rules suggested by the initial prompts, thus providing the network model with the foundation for semantic understanding of the rules suggested by the initial prompts.
[0062] The aforementioned first prompt information can be obtained by performing the i-th round of iterative optimization on the basic prompt information generated above using the method provided in the embodiments of this application, where i is greater than or equal to 0 and i is an integer. If i equals 0, then the first prompt information can be the basic prompt information, that is, the first prompt information can be the prompt information that needs to be optimized during any round of iterative optimization of the basic prompt information. Therefore, it can be understood that the method in the embodiments of this application can describe the process of performing the (i+1)-th round of iterative optimization on the basic prompt information. The (i+1)-th round of iterative optimization can be any round of iterative optimization on the basic prompt information, and the principle of each round of iterative optimization on the basic prompt information can be the same.
[0063] In other words, the prompt information obtained from the first round of iterative optimization of the basic prompt information can be obtained by optimizing the basic prompt information; the second round of iterative optimization of the basic prompt information can be obtained by optimizing the prompt information obtained from the first round of iterative optimization; the third round of iterative optimization of the basic prompt information can be obtained by optimizing the prompt information obtained from the second round of iterative optimization, and so on.
[0064] Furthermore, since the network model's ability to understand the rules suggested by the initial prompts has been stimulated during the pre-optimization process of the initial prompts, and the Few Shot method has guided the network model to understand how to use the rules suggested by the initial prompts for data prediction, the network model can also use the abilities learned and stimulated during the pre-optimization process of the initial prompts to achieve accurate multi-round iterative optimization of the basic prompts.
[0065] In practice, computer devices can retrieve initial prompts and sample datasets from external storage, databases, or user interfaces. This data may have already been pre-processed to ensure a consistent format and clear structure, facilitating subsequent processing by the network model. Obtaining high-quality initial prompts and sample datasets provides a reliable foundation for subsequent predictions and optimizations.
[0066] After optimizing the initial prompt information using the aforementioned chain-thinking COT method to obtain intermediate prompt information, the computer device can also acquire the performance evaluation index value associated with the intermediate prompt information. This performance evaluation index value is used to evaluate the effectiveness of data prediction using the intermediate prompt information, and it can include the accuracy and recall rate of data prediction using the intermediate prompt information. The principle for acquiring the performance evaluation index value associated with the intermediate prompt information can be the same as the principle for acquiring the performance evaluation index value associated with the first prompt information in the corresponding embodiment of Figure 6 below; both can be obtained through statistical calculation using a test dataset. The computer device can also output the performance evaluation index value associated with the intermediate prompt information to the client interface for user viewing and reference. For example, the computer device can send the performance evaluation index value associated with the intermediate prompt information to the client, allowing the client to display the performance evaluation index value associated with the intermediate prompt information on its client interface.
[0067] Similarly, after optimizing the intermediate prompt information using the aforementioned few shots to obtain the basic prompt information, the computer device can also obtain the performance evaluation index value associated with the basic prompt information. This performance evaluation index value is used to evaluate the effectiveness of data prediction using the basic prompt information. The performance evaluation index value can include the accuracy and recall of data prediction using the basic prompt information. The principle for obtaining the performance evaluation index value associated with the basic prompt information can be the same as the principle for obtaining the performance evaluation index value associated with the first prompt information in the corresponding embodiment of Figure 6 below; both can be obtained through statistical calculation using a test dataset. The computer device can also output the performance evaluation index value associated with the basic prompt information to the client interface for user viewing and reference. For example, the computer device can send the performance evaluation index value associated with the basic prompt information to the client, allowing the client to display the performance evaluation index value associated with the basic prompt information on the client interface.
[0068] Please refer to Figure 4, which is a schematic diagram illustrating the effect of an optimized client interface for prompting information provided in an embodiment of this application. As shown in Figure 4, the client interface allows users to select the desired network model (e.g., a large language model named "gpt-4o" is selected here), and also allows users to select the task type of the selected network model. This task type can be the type of data prediction task performed by the network model, such as a discriminative task (e.g., determining the category of news) or a generative task (e.g., generating specific data (e.g., image data containing specific content)). Furthermore, the client interface allows users to set hyperparameters related to the selected network model. By setting different hyperparameters, the data prediction effect of the network model can also vary. Subsequently, the network model can perform data prediction based on the hyperparameters set by the user, such as predictive processing of sample data and predictive processing of test data. For example, the hyperparameters that users can set for the selected network model may include, but are not limited to, temperature parameters (used to control the diversity and randomness of the data generated by the network model), candidate list size (Top-p parameter, such as a list of candidate prompts corresponding to any round of iteration optimization in the embodiment shown in Figure 8 below), maximum tokens (Max-tokens parameter, used to limit the length of the network model output), and few-shot parameters (kshot, used to determine the number of samples). Furthermore, users can input the initial prompt information 401 in the client interface. For example, the initial prompt information 401 in the client interface may include the task description 402 entered by the user in the client interface, plus the task rules 403. In addition, the client interface may also display a prompt result list 404. In this prompt result list 404, prompt_COT may refer to the method of optimizing the initial prompt information using the aforementioned chain-thinking COT, prompt_few_shot may refer to the method of optimizing the intermediate prompt information using the aforementioned few-shot, and prompt_complex may refer to the method of performing multiple rounds of iterative optimization on the basic prompt information. The prompt information list can be updated to display the prompt information obtained from each optimization process, such as intermediate prompt information (the prompt information obtained through prompt_COT), basic prompt information (the prompt information obtained through prompt_few_shot), the prompt information obtained after the first iteration of optimization of the basic prompt information (the prompt information corresponding to "Iteration: 1" here), and the prompt information obtained after the second iteration of optimization of the basic prompt information (the prompt information corresponding to "Iteration: 2" here).Furthermore, the "Test Details and Optimization Suggestions" module on the client interface can also display the performance evaluation metrics (including accuracy and recall) associated with the prompts obtained from any optimization process.
[0069] In addition, users can also provide the aforementioned sample dataset and test dataset in the client interface. For example, they can provide the sample dataset in the "Sample Data Path" field of the client interface (the source path of the sample dataset can be provided or the sample dataset can be uploaded directly), and they can provide the test dataset in the "Test Data Path" field of the client interface (the source path of the test dataset can be provided or the test dataset can be uploaded directly).
[0070] Please refer to Figure 5, which is a schematic diagram of another client interface for optimizing prompt information provided in an embodiment of this application. As shown in Figure 5, V1 can refer to a strategy that adopts the product writing rules initially provided by the user, which can be the initial prompt information initially provided by the user; V2 can refer to a strategy that adds chain thinking COT on the basis of the initial prompt information; V3 can refer to a strategy that adds few-shot learning on the basis of intermediate prompt information; and V4 can refer to a strategy that introduces multiple rounds of iterative optimization on the basis of basic prompt information.
[0071] The client interface can also display the precision and recall rates associated with product writing rules (i.e., initial prompt information) (P53 / R91, where P53 represents a precision rate of 53% and R91 represents a recall rate of 91%), the precision and recall rates associated with intermediate prompt information (P57 / R87, where P57 represents a precision rate of 57% and R87 represents a recall rate of 87%), the precision and recall rates associated with basic prompt information (P71 / R93, where P71 represents a precision rate of 71% and R93 represents a recall rate of 93%), and the precision and recall rates associated with the prompt information obtained after the latest iteration optimization in multiple iterations (P80 / R95, where P80 represents a precision rate of 80% and R95 represents a recall rate of 95%). Through the precision and recall rates of the prompt information associated with each optimization process, users can intuitively observe the gradual improvement in the effectiveness of optimizing prompt information using the method provided in this application embodiment.
[0072] The above sample dataset can be used to optimize the first prompt information, as described below.
[0073] Step S102: The network model is invoked to perform prediction processing on the sample data in the sample dataset according to the rules suggested in the first prompt information, so as to obtain the prediction results of the sample data in the sample dataset.
[0074] The computer device can call the network model to perform prediction processing on the sample data in the sample dataset according to the rules suggested by the first prompt information above, so as to obtain the prediction result of the sample data in the sample dataset. A sample data can have a prediction result. For example, the prediction result of the network model for a sample data can be that the sample data is predicted to be news of the type of natural disaster, or the sample data is predicted not to be news of the type of natural disaster.
[0075] In practical implementation, a network model refers to a large language model based on deep learning. These models, trained on massive corpora, acquire rich linguistic knowledge and can generate outputs with different styles or structures based on various prompts. Examples of network models include GPT, BERT, and T5. Based on the task rules given in the first prompt, the network model performs inference processing on each sample in the dataset and outputs a prediction result. This prediction result may be a classification result (e.g., matching or not matching), text summary, answer extraction, etc., depending on the task type and the instructions in the first prompt.
[0076] Computer devices can input sample datasets one by one into a network model and generate prediction results based on the initial prompts. This process can involve multiple sub-tasks such as natural language understanding, logical reasoning, and contextual modeling. By performing predictive processing on the sample data, the performance of the network model under the current initial prompts can be obtained, thus providing a basis for subsequent optimization.
[0077] Step S103: The network model is invoked to perform semantic understanding processing on the first prompt information based on the prediction results of the sample data in the sample dataset, so as to obtain the optimized instruction information for the first prompt information; the optimized instruction information is used to indicate the semantic direction for optimizing the first prompt information.
[0078] Computer devices can invoke network models to perform semantic understanding processing on the first prompt information using the prediction results of sample data in the sample dataset. For example, semantic understanding processing can be performed on the rules suggested by the first prompt information to generate optimization instruction information for the first prompt information. This optimization instruction information can be used to indicate the semantic direction that needs to be optimized for the first prompt information, as described in the following content.
[0079] The sample data in the above sample dataset can have data labels. Each sample data can have one data label. The data label of any sample data can indicate the true result that needs to be predicted for that sample data. For example, the data label of a sample data indicates that the sample data is actually news of a natural disaster type, or news of a natural disaster type.
[0080] In practice, semantic understanding processing refers to the process of using a network model to analyze the discrepancies between predicted and actual results, identifying the causes of errors, and proposing improvement suggestions. For example, if the actual label of a sample data point matches, but the network model's prediction does not, the network model can analyze the content of the initial prompt to identify potential causes of errors, such as missing key feature descriptions or unclear task instructions. Optimization instructions are textual information generated by the network model based on the analysis results, guiding how to adjust the original initial prompt to improve the network model's performance. For example, optimization instructions might suggest adding specific skill descriptions required for the job to the initial prompt.
[0081] In this embodiment, the computer device compares the predicted results with the actual results and feeds the differences back to the network model. The network model then generates optimization suggestions based on these differences, forming optimization instruction information. This optimization instruction information not only identifies the problem but also provides specific directions for improvement, making subsequent optimizations targeted and actionable. Through semantic understanding processing, a closed-loop feedback mechanism from prediction results to optimization suggestions can be achieved, providing a scientific basis for subsequent optimization.
[0082] In some embodiments, the computer device may select reference sample data from the sample dataset based on the difference between the predicted and actual results of the sample data in the sample dataset (e.g., whether the predicted and actual results are the same). This reference sample data may be sample data whose predicted results are inconsistent with (i.e., different from) the actual results; that is, the reference sample data may be sample data where the network model made a wrong prediction. Therefore, this reference sample data can be recorded as a bad case. The number of reference sample data can be determined according to the actual application scenario. The specific process of selecting the reference sample data from the sample dataset based on the difference between the predicted and actual results of the sample data in the sample dataset can be found in the relevant description in the embodiment corresponding to Figure 6 below.
[0083] The computer device can call the network model to perform semantic understanding processing on the first prompt information using the selected reference sample data to generate optimized instruction information. For example, the computer device can use the reference sample data as a negative example to perform semantic understanding processing on the first prompt information, and can generate optimized instruction information based on the understanding results.
[0084] For example, the process by which a network model performs semantic understanding processing on the first prompt information using reference sample data to generate optimized instruction information may include: a computer device may invoke the network model to perform semantic understanding processing on the first prompt information using the reference sample data to generate a reason text for the incorrect prediction of the reference sample data using the first prompt information. That is, the network model can use the reference sample data to understand and analyze why the first prompt information was used to make an incorrect prediction of the reference sample data. In other words, the network model can use the reference sample data to understand the reason for the incorrect prediction of the reference sample data using the first prompt information. This reason can be a piece of text, and therefore can be called reason text.
[0085] The network model can also generate optimization suggestion text for the first prompt information using the aforementioned cause text. That is, the network model can also perform semantic understanding processing on the cause text to find suggestions for resolving the cause indicated by the cause text. This suggestion can also be a piece of text, hence it can be called optimization suggestion text. Therefore, the network model can use the aforementioned cause text and optimization suggestion text to generate the aforementioned optimization instruction information. This optimization instruction information can include both the cause text and the optimization suggestion text, and the optimization instruction information can also be a piece of text.
[0086] For example, if the rule suggested in the first prompt includes "determine whether the text contains offensive language," the aforementioned reason text could include "the prompt is too broad and lacks a definition of offensive language, causing the model to incorrectly identify negative emotions as offensive language." Correspondingly, the aforementioned optimization suggestion text could include "it is recommended to add a specific description of offensive language to the prompt, such as including derogatory language against a group." Therefore, the optimization instruction information generated through this reason text and optimization suggestion text could include "the prompt is too broad and lacks a definition of offensive language, causing the model to incorrectly identify negative emotions as offensive language. It is recommended to add a specific description of offensive language to the prompt, such as including offensive language against a group or derogatory language."
[0087] Step S104: Call the network model to optimize the first prompt information according to the semantic direction indicated by the optimization instruction information to obtain the second prompt information.
[0088] The computer device can call the network model to optimize the first prompt information according to the instructions of the optimization instruction information generated above, so as to obtain the second prompt information. The second prompt information is the prompt information obtained after optimizing the first prompt information. The second prompt information can be the prompt information obtained after performing the i+1th round of iterative optimization on the above basic prompt information.
[0089] In practice, optimization refers to the process of modifying, supplementing, or reconstructing the first prompt information based on the improvement suggestions provided in the optimization instruction information. For example, if the optimization instruction information suggests adding specific skill descriptions required for the job to the first prompt information, then specific content such as needing to master Python programming language and database technology can be added to the original first prompt information. Based on the above optimization processing method, the new prompt information can more accurately guide the network model to complete the task and improve the prediction effect. In the embodiments of this application, the computer device will automatically edit the first prompt information according to the optimization instruction information to generate the second prompt information. Optimization processing may involve various methods such as text insertion, deletion, and replacement to ensure that the optimized first prompt information retains its original function while improving the accuracy and completeness of its expression. Through optimization processing, the optimal prompt information can be continuously approached, improving the overall performance of the network model. The specific process of how to optimize the first prompt information using the generated optimization instruction information to obtain the second prompt information can be found in the description of the embodiment corresponding to Figure 8 below.
[0090] The above process achieves one round of iterative optimization of the basic prompt information. The computer device can perform multiple rounds of iterative optimization of the basic prompt information according to the above principles to obtain the final optimized prompt information. This final optimized prompt information can be called the target prompt information. The target prompt information clearly and accurately describes the suggested rules and is the high-quality prompt information obtained from the final optimization. Then, in actual business scenarios, users can use the final optimized target prompt information to call the network model for corresponding business processing, such as accurate prediction processing of data in the business scenario. The generated optimization indication information can be understood as the gradient (which can be called gradient information) used in training a deep learning model. During the training of a deep learning model, the model parameters can be optimized using the gradient information generated in each round of iterative training. In this embodiment, the optimization indication information generated in each round of iterative optimization is used as the gradient information (which can be denoted as g) used to optimize the discrete prompt information in each round of iterative optimization, thereby achieving multi-round iterative optimization of the prompt information.
[0091] As can be seen from the above, the method of this application embodiment does not rely on predefined rules and templates for optimizing prompt information. This application embodiment utilizes automated optimization technology, which can adapt to diverse and dynamically changing business needs. Regardless of the style of the prompt information, it can achieve accurate and rapid optimization processing. The automatic prompt optimization method of this application embodiment can cover a large number of application scenarios, reduce the problem of decreased performance in prompt information optimization caused by special or unforeseen circumstances, and improve the optimization performance of the model in complex prompt information scenarios.
[0092] This application embodiment can obtain a first prompt information to be optimized and a sample dataset. The first prompt information indicates rules for predicting the sample data in the sample dataset. A network model can be invoked to predict the sample data in the sample dataset according to the rules indicated by the first prompt information, obtaining the prediction results of the sample data in the sample dataset. Then, based on the prediction results of the sample data in the sample dataset, the network model can perform semantic understanding processing on the first prompt information to generate optimization instruction information for the first prompt information. The optimization instruction information indicates the semantic direction for optimizing the first prompt information. Furthermore, the network model can be invoked to optimize the first prompt information according to the instructions of the optimization instruction information to obtain a second prompt information. Therefore, this application embodiment proposes an automatic optimization method for prompt information. In this application embodiment, the network model can use the prediction results obtained from the actual prediction of the sample data using the first prompt information as a reference to perform semantic understanding processing on the first prompt information, thereby generating optimization instruction information to indicate the semantic direction for optimizing the first prompt information. Through this optimization instruction information, the network model can achieve automated and accurate optimization processing of the first prompt information, thus improving the efficiency and accuracy of optimizing the first prompt information. In practical implementation, the information processing method provided in this application obtains the first prompt information and sample dataset, calls the network model for prediction processing, analyzes the prediction results and generates optimization indication information, and then optimizes the first prompt information based on the optimization indication information to finally generate a better second prompt information. The entire process realizes a closed-loop process from initial prompt to optimized prompt, ensuring continuous improvement in model performance. Furthermore, the information processing method provided in this application significantly improves the prediction accuracy and recall of the model under conditions of a small number of samples by introducing a gradient descent strategy and a multi-round iteration mechanism. It also possesses good flexibility and scalability, enabling rapid response to changes in business needs and making it suitable for various application scenarios.
[0093] Please refer to Figure 6, which is a schematic flowchart illustrating the process of selecting reference sample data from a sample dataset according to an embodiment of this application. As shown in Figure 6, the process may include the following steps S201 to S204:
[0094] Step S201: Obtain the test dataset. The test data in the test dataset has data labels. The data label of any test data indicates the true result to be predicted for any test data.
[0095] Computer equipment can acquire a test dataset, which is a set of known real-world data used to evaluate model performance. The test data in this dataset can also have data labels; each test data point can have one data label. The data label of any test data point can be used to indicate the true result that needs to be predicted for that test data point. In other words, the data label of any test data point clearly defines the correct output or expected result corresponding to that test data point. For example, the data label of a test data point can be used to indicate whether the test data is actually news about a natural disaster or not; or, in an image classification task, the test data might be an image, and the data label might be a category such as cat or dog; in a text generation task, the data label of the test data can be the expected output text content.
[0096] The purpose of a test dataset is to provide an objective standard for measuring the generalization ability and accuracy of a network model on unseen data. By using labeled test data, computing devices can perform comparative analysis after the model has made predictions, determine whether the network model's performance meets the requirements, and use the test dataset as the basis for subsequent optimization. Test datasets can come from manually labeled datasets, public datasets, historical business data, etc. To ensure the fairness and representativeness of the evaluation, the test dataset can be independent of the training dataset and have sufficient diversity to cover different input scenarios.
[0097] The test dataset can contain multiple test data sets, and the data format of these test data sets can be the same as that of the sample data sets. In practice, test data can also be used as sample data, or vice versa. In this embodiment, the data to be predicted can be divided into a sample dataset and a test dataset. The sample dataset can be used to optimize the prompt information, while the test dataset can be used to test the prompt information. This testing can include statistically analyzing and calculating the effectiveness evaluation index value of using the prompt information for data prediction using the test dataset. For example, the effectiveness evaluation index value can include the precision and recall rate (which includes accuracy and recall) of using the prompt information for data prediction.
[0098] Step S202: Call the network model to perform prediction processing on the test data in the test dataset according to the rules suggested in the first prompt information, and obtain the prediction results of the test data in the test dataset.
[0099] The computer device can invoke the network model to perform prediction processing on the test data in the test dataset according to the rules indicated by the first prompt information, so as to obtain the prediction result of the test data in the test dataset. Each test data can have one prediction result. The principle by which the network model obtains the prediction result of the test data through the first prompt information can be the same as the principle by which it obtains the prediction result of the sample data through the first prompt information. For example, the prediction result of a test data can be that the test data is a news item of the type of natural disaster, or that the test data is not a news item of the type of natural disaster, as predicted by the network model.
[0100] When invoking the network model, the computer device can combine test data and initial prompts into a complete input, which is then fed into the network model for inference. Based on the input, the network model, combined with its trained parameters and knowledge base, generates a prediction result. The prediction result can be returned in a structured format, such as category labels, numerical values, or text. In this embodiment, by introducing initial prompts, the network model can more accurately understand the task objective and the input content, thereby improving the quality of the prediction result. This step provides fundamental data support for subsequent performance evaluation.
[0101] Step S203: Based on the difference between the predicted results and the actual results of the test data in the test dataset, determine the performance evaluation index value of using the first prompt information for data prediction.
[0102] Computer equipment calculates the performance evaluation index of data prediction using the first prompt information by comparing the difference between the predicted results and the actual results in the test dataset (i.e., whether the predicted results are the same as or differ from the actual results). This performance evaluation index is a numerical metric used to quantify the model's prediction performance. The performance evaluation index can include metrics such as accuracy, recall, F1 score, and AUC value for data prediction using the first prompt information. These metrics reflect the network model's performance in different dimensions, such as the proportion of correct predictions, the number of missed detections, and overall performance balance. The calculated performance evaluation index of data prediction using the first prompt information can be referred to as the performance evaluation index of the first prompt information association.
[0103] In this embodiment, the computer device compares the predicted results of the test data with the actual results one by one, identifies bad cases, and then calculates corresponding evaluation metrics based on the number and type of errors. For example, if the network model's prediction for a certain test data does not match the actual label, it is included in the error statistics, affecting the final accuracy or recall calculation. In this way, the impact of the current prompt information on the network model's performance can be quantitatively measured, providing a scientific basis for the formulation of subsequent optimization strategies. Simultaneously, this process can also identify which types of samples are prone to errors, thus providing direction for subsequent sample selection.
[0104] The calculation process for the accuracy of the first prompt information association mentioned above may include: the computer device can obtain the total number of test data in the test dataset, and the computer device can also obtain the number of test data in the test dataset whose predicted results are inconsistent with the actual results (i.e., different from the actual results indicated by the data labels). These test data whose predicted results are inconsistent with the actual results are the test data whose predictions are incorrectly made by the network model. Therefore, the computer device can calculate the ratio between the number of test data whose predicted results are inconsistent with the actual results and the total number of test data (which can be the ratio of the number of incorrectly predicted test data to the total number of test data), and thus obtain the accuracy of the first prompt information association.
[0105] The calculation process for the recall associated with the first prompt information can include: the computer device can also obtain the total number of test data in the test dataset, and the computer device can also obtain the number of test data in the test dataset whose test results match the rule suggested by the first prompt information (which can be called the predicted result being true) and whose actual results also match the rule suggested by the first prompt information (which can be called the actual result being true). The test results of the test data whose predicted result is true and whose actual result is also true are the same as the actual result. Therefore, the computer device can calculate the ratio between the number of test data whose predicted result is true and whose actual result is also true and the total number of test data (which can be the ratio of the number of test data whose predicted result is true and whose actual result is also true to the total number of test data), and thus obtain the recall associated with the first prompt information.
[0106] The prediction results of the test data here are obtained through prediction processing using the first prompt information. For a test data point to match the rule suggested by the first prompt information, it means that the prediction result indicates that the test data is data that needs to be classified and recalled according to the rule suggested by the first prompt information. For example, if the rule suggested by the first prompt information includes "classify news of natural disaster type," and the prediction result of a test data point predicts that the predicted data is news of natural disaster type, then the prediction result matches the rule suggested by the first prompt information. Conversely, if the prediction result of a test data point predicts that the predicted data is not news of natural disaster type, then the prediction result does not match the rule suggested by the first prompt information. Similarly, if the actual result of the test data matches the rule suggested by the first prompt information, it also means that the actual result of the test data indicates that the test data is data that needs to be classified and recalled according to the rule suggested by the first prompt information.
[0107] Through the above process, the recall and precision of the first prompt information association can be calculated using the test dataset. The recall and precision of the first prompt information association can then be used as performance evaluation metrics for the first prompt information association.
[0108] Step S204: Select reference sample data from the sample dataset based on the difference between the predicted results and the actual results of the sample data in the sample dataset, and the effect evaluation index value associated with the first prompt information.
[0109] The computer device can select reference sample data from the sample dataset based on the difference between the predicted results and the actual results of the sample data in the above sample dataset, as well as the accuracy and recall associated with the first prompt information, as described below.
[0110] The computer device can obtain a first ratio, which is the ratio of the recall associated with the first prompt information to the precision associated with the first prompt information. This first ratio can be in fractional form. For example, if the precision associated with the first prompt information is 70% and the recall associated with the first prompt information is 80%, then the first ratio is 8 / 7. Therefore, the computer device can select reference sample data from the sample dataset based on this first ratio and the difference between the predicted and actual results of the sample data in the sample dataset (this difference can refer to whether the predicted and actual results of the sample data are the same).
[0111] Reference sample data is a set of representative samples selected from the original sample dataset. Reference sample data may have high prediction errors or significantly impact the performance of the network model. Once selected, reference sample data can be used to further optimize prompts, adjust model parameters, or perform targeted training. For example, if a certain type of sample data has a large prediction error, and although this type of sample data represents a small percentage of the entire test dataset, it significantly affects the overall evaluation metrics, then this type of sample will be prioritized as reference sample data. By selecting reference sample data and focusing on the sample data with the greatest potential for improving model performance, resources can be focused on those sample data with the greatest potential for improvement, avoiding waste on sample data that generally performs well. This process of selecting reference sample data and focusing on the sample data with the greatest potential for improving model performance not only improves optimization efficiency but also enhances the adaptability of the network model in key scenarios.
[0112] In some embodiments, the computer device can obtain erroneous prediction sample data and erroneous recall sample data from a sample dataset. The erroneous prediction sample data may refer to sample data in the sample dataset where the predicted result is inconsistent with the actual result. The erroneous recall sample data may include sample data in the sample dataset where the predicted result conforms to the rule indicated by the first prompt (i.e., the predicted result is true), but the actual result does not conform to the rule indicated by the first prompt (i.e., the actual result is false). The erroneous recall sample data also belongs to the category of erroneous prediction sample data.
[0113] The computer device can select sample data from all predicted error sample data and from all recalled error sample data using the aforementioned first ratio. The sample data selected from the predicted error sample data can be referred to as the first sample data, and the sample data selected from the recalled error sample data can be referred to as the second sample data. The second ratio between the number of first sample data and the number of second sample data can be equal to the first ratio. In one feasible implementation, the numerator and denominator of the first ratio can be multiplied simultaneously by a specified target multiple, which can be pre-set, such as 1 or 2 times. The value obtained by multiplying the denominator by the target multiple can be determined as the number of first sample data to be selected from the predicted error sample data, and the value obtained by multiplying the numerator by the target multiple can be determined as the number of second sample data to be selected from the recalled error sample data. In other words, the number of first samples selected from the incorrectly predicted sample data and the number of second samples selected from the incorrectly recalled sample data can both be determined by the first ratio. The specific first samples selected from the incorrectly predicted sample data and the specific second samples selected from the incorrectly recalled sample data can be randomly chosen. For example, if the target multiple is 2, and the first ratio is 8 / 7, then the number of first samples to be selected can be 16, and the number of second samples to be selected can be 14. The ratio of the number of first samples to the number of second samples is also 8 / 7, which equals the aforementioned first ratio.
[0114] Since the first sample data is selected from the sample data of prediction errors, and the second sample data is selected from the sample data of recall errors, the first sample data can be the sample data corresponding to the precision associated with the first prompt information, and the second sample data can be the sample data corresponding to the recall associated with the first prompt information. Furthermore, the first ratio is the ratio obtained by dividing the recall associated with the first prompt information by the precision associated with the first prompt information, and the second ratio obtained by dividing the number of first sample data corresponding to the precision by the number of second sample data corresponding to the recall is the same as the first ratio. Therefore, it can be understood that if the recall associated with the first prompt information is higher than the precision, the number of first sample data corresponding to the precision can be greater than the number of second sample data corresponding to the recall. Conversely, if the precision associated with the first prompt information is higher than the recall, the number of second sample data corresponding to the recall will be greater than the number of first sample data corresponding to the precision. This is because when the precision associated with the first prompt message is greater than its recall, more attention can be paid to improving the recall of the first prompt message, which has a smaller numerical value. Therefore, the number of second sample data corresponding to the recall can be larger. Conversely, when the recall associated with the first prompt message is greater than its precision, more attention can be paid to improving the precision of the first prompt message, which has a smaller numerical value. Therefore, the number of first sample data corresponding to the precision can be larger. Thus, high-quality optimization of the first prompt message can be achieved from both precision and recall perspectives.
[0115] The second ratio between the number of first sample data and the number of second sample data, as described above, equals the first ratio. This is an exemplary method for selecting the first and second sample data. In practical applications, other methods can be used to determine the number of first and second sample data to be selected. This achieves the same effect: when the accuracy associated with the first prompt information is higher than the recall associated with it, the number of second sample data selected is greater than the number of first sample data selected; and when the recall associated with the first prompt information is higher than the accuracy associated with it, the number of first sample data selected is greater than the number of second sample data selected. In other words, the smaller the value of the accuracy or recall associated with the first prompt information, the greater the number of sample data corresponding to that smaller value can be compared to the number of sample data corresponding to the larger value.
[0116] Here, we further exemplify a feasible method for selecting first sample data from the aforementioned sample data with prediction errors and second sample data from the sample data with recall errors. This method may include: pre-setting a first quantity and a second quantity, where the first quantity is greater than the second quantity, for example, the first quantity is 16 and the second quantity is 8. Then, when the accuracy associated with the first prompt information is less than its associated recall rate, the number of first sample data to be selected can be the first quantity, and the number of second sample data to be selected can be the second quantity. Conversely, when the accuracy associated with the first prompt information is greater than its associated recall rate, the number of first sample data to be selected can be the second quantity, and the number of second sample data to be selected can be the first quantity.
[0117] After selecting the first sample data and the second sample data, the computer device can use both the first sample data and the second sample data as reference sample data. The total number of reference sample data can be equal to the number of the first sample data plus the number of the second sample data.
[0118] Please refer to Figure 7, which is a schematic diagram of an optimization architecture for prompt information provided in an embodiment of this application. As shown in Figure 7, the optimization architecture 700 may include an inference and evaluation module 701 (which may be denoted as inferno_prompt evaluation) and a prompt word optimization module 702 (which may be denoted as inferno_prompt optimization). The inference and evaluation module 701 can be used to calculate and output the precision and recall (PR) associated with the obtained prompt information according to the principles described above, select and output reference sample data from the sample dataset (such as bad cases output here), and output the most recent prompt word (last_prompt, i.e., the latest optimized prompt word, used for further optimization processing). It can also output the prediction results of the sample data in the sample dataset using the last_prompt, which can be viewed and referenced by the user. The reference sample data (bad cases) and last_prompt output by the inference and evaluation module 701 can be input into the prompt word optimization module 702. The hyperparameters set by the user for the selected network model (here, model hyperparameters) can also be input into the prompt word optimization module 702. Furthermore, the data input into the prompt word optimization module 702 can also include environment parameters (venus), which may contain the user's identity information. The prompt word optimization module 702 can use this identity information to authenticate the user (which can be referred to as the object), such as determining whether the user has permission to call internal tools (including the network model) for prompt word optimization. If so, it indicates that the user has permission to call the internal tools and can proceed with subsequent optimization of the prompt information; if not, it indicates that the user does not have permission to call the internal tools and the optimization of the prompt information can be terminated. Therefore, in the prompt word optimization module 702, the selected network model can be called to optimize the prompt information based on the input data. For example, the input data can be used to generate optimized instruction information first, and then the generated optimized instruction information can be used to optimize the input prompt information (such as last_prompt).
[0119] In this embodiment, the strategy for iteratively optimizing the prompt information in each round can be dynamically adjusted by using the accuracy and recall associated with the iteratively optimized prompt information. This strategy can involve dynamically changing the number of the first and second sample data sets, thereby ensuring the effectiveness of the prompt information optimization process. This results in a lower error rate and higher accuracy and recall for data prediction using the optimized prompt information. The prompt optimization system in this embodiment effectively improves the model's precision and recall performance, meeting users' needs for high-performance prompt generation. The multi-round iterative optimization strategy in this embodiment ensures that the final generated prompt has high accuracy and high recall, providing users with an excellent user experience.
[0120] Please refer to Figure 8, which is a schematic flowchart of obtaining second prompt information by optimizing indication information according to an embodiment of this application. As shown in Figure 8, the process may include the following steps S301 to S304:
[0121] Step S301: Call the network model to optimize the first prompt information according to the semantic direction indicated by the optimization instruction information, and obtain N optimization prompt information corresponding to the (i+1)th round of iteration optimization, where N is a positive integer.
[0122] The first prompt information mentioned above is the prompt information obtained after the i-th round of iterative optimization of the basic prompt information to be iteratively optimized, where i is greater than or equal to 0 and i is an integer. The i-th round of iterative optimization refers to the process in which the computer device gradually improves the initial prompt words (basic prompt information) through multiple rounds of optimization during the prompt engineering process based on the large language model, in order to improve the quality of the model output. In the prompt engineering process based on the large language model, the i-th round of iterative optimization indicates which round of optimization is currently in, with an initial value of 0, representing the initial version. Each round of iterative optimization generates new prompt information based on the result of the previous round of iterative optimization, and uses this new prompt information as the input for the next round of iterative optimization. Therefore, in the (i+1)-th round of iterative optimization of the basic prompt information described in the embodiment corresponding to Figure 3 above, the computer device can call the network model to optimize the first prompt information according to the instructions of the optimization instruction information generated in the (i+1)-th round of iterative optimization, and can generate N optimized prompt information corresponding to the (i+1)-th round of iterative optimization. N is a positive integer, which can be a pre-defined value, such as N equal to 3. This means that in each round, when the generated optimization instruction information is used to optimize the prompt information, N optimized prompt information messages can be generated for each round. The network model can perform semantic understanding processing on the generated optimization instruction information and optimize the first prompt information in the corresponding semantic direction based on the understanding result (which may depend on the network model's own language understanding ability). This can be understood as backpropagating the generated optimization instruction information as a gradient to the network model, allowing the network model to optimize the input first prompt information using this backpropagated optimization instruction information to generate N optimized prompt information messages corresponding to the (i+1)th round of iteration.
[0123] In this embodiment, by introducing the concept of the i-th iteration optimization, a continuous optimization process for the prompt information can be achieved, avoiding the limitations of a one-time design and ensuring that each adjustment is based on feedback from the previous optimization result, thus more efficiently approaching the optimal solution. By adopting the i-th iteration optimization method, experience can be accumulated and errors corrected in each iteration optimization process, thereby driving the model performance to gradually improve and ultimately achieving higher accuracy and recall.
[0124] Optimization prompts refer to guiding instructions generated by computer devices based on model inference results, used to direct the optimization of the next set of prompts. For example, when the model predicts incorrectly, the computer device identifies the cause of the error and generates feedback in natural language, pointing out problems or areas for improvement in the prompts. This feedback guides the direction of the next round of optimization, and the computer device generates new prompts based on this feedback. N optimization prompts refer to the fact that in the (i+1)th iteration of optimization, the computer device generates multiple possible optimization versions for subsequent selection. This multi-candidate mechanism helps explore different optimization paths, improves the optimization success rate, and enhances the stability and adaptability of the computer device to changes in input data. By calling the network model to generate N optimization prompts, researchers can simultaneously explore multiple optimization directions, thereby increasing the likelihood of finding better prompts and ultimately improving the performance of the network model.
[0125] Step S302: Obtain the candidate hint information corresponding to the k neighboring iterations before the (i+1)th iteration; one iteration corresponds to M candidate hint information, where M is a positive integer.
[0126] The computer device can obtain candidate hints from the k nearest iterations before the (i+1)th iteration. Each iteration can correspond to M candidate hints, where M is a positive integer or a pre-defined value (e.g., M equals N, or M equals 3). The "k nearest iterations" refers to the optimization results in the (i+1)th iteration referencing the hints from the previous k iterations. This reference to the previous k iterations in the (i+1)th iteration effectively introduces historical information to aid current optimization decisions, avoiding blind searching and improving optimization efficiency.
[0127] The M candidate suggestion information indicates that in each round of iterative optimization, the computer device retains several suggestion word versions that perform well and uses these suggestion word versions for subsequent selection and comparison. Using M candidate suggestion information avoids overfitting or local optima problems that may arise from a single version, while providing diverse options for subsequent optimization. How the M candidate suggestion information for each round of iterative optimization is obtained can be found in the relevant description of step S303 in the embodiments of this application, as the principle is the same.
[0128] By incorporating historical data from the k nearest iterations and M candidate prompts, the computer can comprehensively consider past performance in the current iteration, thereby more accurately adjusting prompts and improving overall optimization. In practice, there is a strong correlation between the k nearest iterations and the current (i+1)th iteration. Specifically, the data from the k nearest iterations provides context and trend analysis, while the current (i+1)th iteration is based on this data for specific operations and optimizations. Therefore, in the (i+1)th iteration, it is essential to fully integrate the information from the k nearest iterations to achieve effective prompt adjustment.
[0129] k can be a pre-set number of rounds. For example, if k equals 2, then the k nearest rounds of iteration before the (i+1)th round can be the two nearest rounds of iteration before the (i+1)th round, including the i-th round and the (i-2)-th round. If i is less than 2, such as when i equals 1, the computer can obtain the M candidate hints corresponding to the only iteration before the (i+1)-th round. If i equals 0, then the candidate hints obtained by the computer for the first k rounds of iteration can be empty.
[0130] In other words, the computer device can obtain M candidate hints corresponding to the k nearest iterations before the (i+1)th iteration. One iteration can correspond to M candidate hints. If there are fewer than k nearest iterations before the (i+1)th iteration, the computer device can obtain candidate hints corresponding to all iterations before the (i+1)th iteration as the candidate hints for the k iterations. If there are no earlier iterations before the (i+1)th iteration, the candidate hints for the k iterations obtained by the computer device can be empty.
[0131] Furthermore, the computer device can obtain candidate hint information corresponding to the k nearest iterations before the (i+1)th iteration optimization with a precondition: whether the optimization effect of the first hint information in the (i+1)th iteration optimization is better. Therefore, candidate hint information corresponding to the k iterations optimization will only be obtained when the optimization effect of the first hint information in the (i+1)th iteration optimization meets this precondition (i.e., the optimization effect of the first hint information in the (i+1)th iteration optimization is better). Conversely, if the optimization effect of the first hint information in the (i+1)th iteration optimization does not meet this precondition (i.e., the optimization effect of the first hint information in the (i+1)th iteration optimization is worse or there is no improvement), candidate hint information corresponding to the k iterations optimization will not be obtained. Instead, the current optimization processing of the first hint information in the (i+1)th iteration optimization will be withdrawn, such as discarding the N optimization hint information corresponding to the (i+1)th iteration optimization obtained by optimizing the first hint information. New optimization indication information can be regenerated in the (i+1)th iteration optimization to re-optimize the first hint information. The specific description of this prerequisite can be as follows.
[0132] Here, each iteration of the basic prompt information can yield N optimized prompts and M candidate prompts for each iteration. The principle for obtaining the N optimized prompts and M candidate prompts for each iteration is the same as that described in the embodiments of this application for obtaining the N optimized prompts and M candidate prompts for the (i+1)th iteration. Therefore, the computer device can obtain the performance evaluation index values for data prediction using the N optimized prompts for the (i+1)th iteration and the N optimized prompts for the i-th iteration. Here, the principle by which the computer device obtains the performance evaluation index values associated with the optimized prompts is the same as that for obtaining the performance evaluation index values associated with the first prompt in the embodiment corresponding to Figure 6. Both are obtained through the statistical calculation of the test dataset. An optimized prompt can have an associated performance evaluation index value, which can include the accuracy and recall of data prediction using the optimized prompt.
[0133] This application embodiment can determine whether the optimization effect on the first prompt information is better in the current (i+1)th iteration by comparing the change in the effect evaluation index value associated with the N optimization prompt information corresponding to the current (i+1)th iteration with the effect evaluation index value associated with the N optimization prompt information corresponding to the previous (i)th iteration. If the maximum effect evaluation index value associated with the N optimization prompt information corresponding to the current (i+1)th iteration is greater than the maximum effect evaluation index value associated with the N optimization prompt information corresponding to the previous (i)th iteration, it indicates that the optimization effect on the first prompt information is better in the current (i+1)th iteration, and subsequent steps can be continued to obtain the candidate prompt information corresponding to the above k iterations.
[0134] If the maximum effect evaluation index value associated with the N optimization prompts corresponding to the (i+1)th iteration optimization is less than or equal to the maximum effect evaluation index value associated with the N optimization prompts corresponding to the i-th iteration optimization, it indicates that the optimization effect of the first prompt in the (i+1)th iteration optimization is worse or there is no further improvement in the optimization effect. In this case, the computer device can terminate the acquisition of the candidate prompts corresponding to the k iteration optimizations and can withdraw the optimization processing of the first prompt in the (i+1)th iteration optimization. For example, the N optimization prompts obtained by optimizing the first prompt can be discarded. In addition, the new optimization instruction information can be regenerated in the (i+1)th iteration optimization. For example, the reference sample data can be reselected according to the above principle, and the new optimization instruction information can be regenerated using the reselected reference sample data. The first prompt can then be re-optimized using the regenerated new optimization instruction information to regenerate the N optimization prompts corresponding to the (i+1)th iteration optimization.
[0135] Following the principle of judging the preconditions described above, the computer device can determine whether the effect of re-optimizing the first prompt in the (i+1)th iteration has improved by using the N optimization prompts corresponding to the (i+1)th iteration and the N optimization prompts corresponding to the (i)th iteration. If the optimization effect is better, the computer device can continue to acquire the candidate prompts corresponding to the above k iterations. If the optimization effect is not better (e.g., the optimization effect is worse or there is no improvement), the computer device can withdraw the optimization processing of the first prompt in the current (i+1)th iteration and re-optimize the first prompt again, and so on, until the effect of optimizing the first prompt is better.
[0136] Step S303: Select M candidate suggestions for the (i+1)th iteration optimization from the candidate suggestions for the kth iteration optimization and the N suggestions for the (i+1)th iteration optimization.
[0137] The computer device can select M candidate suggestions for the (i+1)th iteration optimization from the candidate suggestions for the k rounds of iteration optimization and the N suggestions for the (i+1)th iteration optimization.
[0138] The computer device acquires performance evaluation index values for data prediction using candidate hints corresponding to the k-th round of iterative optimization and N optimized hints corresponding to the (i+1)-th round of iterative optimization. Each hint (such as a candidate hint corresponding to the k-th round of iterative optimization or an optimized hint corresponding to the (i+1)-th round of iterative optimization) can have one performance evaluation index value, which may include the accuracy and recall of data prediction using that hint. The principle for acquiring the performance evaluation index values associated with the candidate hints corresponding to the k-th round of iterative optimization and the N optimized hints corresponding to the (i+1)-th round of iterative optimization is the same as the principle for acquiring the performance evaluation index value associated with the first hint in the embodiment corresponding to Figure 6; both can be obtained through statistical calculations using the aforementioned test dataset.
[0139] Therefore, the computer device can select the M prompts with the largest sum of associated performance evaluation metrics from the candidate prompts corresponding to the k rounds of iteration and the N optimization prompts corresponding to the (i+1)th round of iteration as the M candidate prompts for the (i+1)th round of iteration. These M prompts with the largest sum of associated performance evaluation metrics are, in other words, the M prompts with the largest associated performance evaluation metrics, arranged in descending order from the candidate prompts corresponding to the k rounds of iteration and the N optimization prompts corresponding to the (i+1)th round of iteration. The sum of the performance evaluation metrics associated with these M prompts can refer to the sum of the M precision and M recall values associated with these M prompts.
[0140] Through the above process, the M candidate hints corresponding to the (i+1)th round of iteration optimization can be obtained.
[0141] Step S304: Select the second prompt information from the M candidate prompt information corresponding to the (i+1)th round of iteration optimization; the second prompt information is the prompt information obtained after the (i+1)th round of iteration optimization of the basic prompt information.
[0142] The computer device can select the second prompt information from the M candidate prompt information corresponding to the above (i+1)th round of iterative optimization. The selected second prompt information is the prompt information obtained after the (i+1)th round of iterative optimization of the basic prompt information. The relationship between the second prompt information and the (i+1)th round of iterative optimization is the same as the relationship between the first prompt information and the i-th round of iterative optimization.
[0143] The method of selecting the second prompt from the M candidate prompts corresponding to the (i+1)th iteration optimization can include: the computer device can obtain the performance evaluation index values for data prediction using the M candidate prompts corresponding to the (i+1)th iteration optimization, respectively. Each candidate prompt can have one performance evaluation index value, which can include the accuracy and recall of data prediction using the candidate prompt. The principle for obtaining the performance evaluation index values associated with the M candidate prompts corresponding to the (i+1)th iteration optimization is the same as the principle for obtaining the performance evaluation index values associated with the first prompt in the embodiment corresponding to Figure 6 above; both can be obtained through statistical calculation using the aforementioned test dataset.
[0144] Therefore, the computer device can select the candidate prompt with the highest associated performance evaluation index value from the M candidate prompts corresponding to the (i+1)th round of iteration optimization as the second prompt, thereby achieving automated selection of the second prompt. The candidate prompt with the highest associated performance evaluation index value can refer to the candidate prompt with the highest sum of associated precision and recall.
[0145] Alternatively, the computer device can output the M candidate prompts corresponding to the (i+1)th iteration optimization in the client interface. For example, the computer device can send the M candidate prompts corresponding to the (i+1)th iteration optimization to the client, allowing the client to output (e.g., display) these M candidate prompts in its interface for the user to choose from. Thus, the computer device can use the candidate prompt selected in the client interface as the second prompt. For instance, the client can respond to the user's selection of the displayed M candidate prompts corresponding to the (i+1)th iteration optimization and send the selected prompt to the server. The server can then use the user's selected prompt as the second prompt. This second prompt is the one closest to the user's expectation, chosen according to their preference. Therefore, using this method to select the second prompt can also indicate the effect of subsequent iterative optimization based on the prompt.
[0146] In this embodiment of the application, the method of obtaining the second prompt information from the prompt information corresponding to the most recent rounds (such as the most recent k+1 rounds, including the current i+1 round and the k rounds adjacent to the i+1 round) may use a beam search strategy, while the method of obtaining the candidate prompt information corresponding to the i+1 round of iterative optimization from the prompt information corresponding to the most recent rounds may use a multi-armed slot machine strategy.
[0147] It should be noted that the core of steps S303 and S304 lies in selecting the M best-performing candidate prompts from a large number of candidate prompts, and further selecting the final second prompt from these M candidate prompts. This process can employ strategies such as beam search or multi-armed bandit algorithms to balance exploration and utilization, ensuring that potential high-quality prompts are not ignored, nor are computational resources wasted on inefficient versions. The final selected second prompt is the best version after the (i+1)th round of iteration optimization. This second prompt will serve as input for the next stage of optimization, further driving the improvement of model performance in the next stage of optimization. By introducing a multi-level screening mechanism, the computer device can select and use the optimal prompt in each round of iteration optimization, thereby ensuring the continuity and effectiveness of the optimization process and ultimately achieving high-quality prompt generation.
[0148] In this embodiment, an automatic optimization of prompt information is achieved by introducing a multi-round iterative optimization mechanism combined with gradient descent and beam search methods. This automatic optimization effectively reduces manual intervention, improves optimization efficiency, and allows for rapid response to changes in business needs, significantly enhancing the network model's performance under limited sample conditions. In actual implementation, the entire optimization process is a closed-loop iterative system, with each step closely cooperating and supporting each other. First, the current prompt information is obtained through the i-th round of iterative optimization. Then, optimization indication information is generated based on the model output, and multiple optimized prompt information is generated using this indication information. Next, historical data from the k-th round of iterative optimization is backtracked, and combined with the multiple candidate prompt information generated in the current (i+1)-th round of iterative optimization, a comprehensive evaluation and screening are performed to finally determine the second prompt information for this round of iterative optimization. The second prompt information serves as the starting point for the next round of iterative optimization, forming a continuously optimizing and improving cyclical system.
[0149] In summary, this application's embodiments, by introducing a multi-round iterative optimization mechanism and combining various algorithmic methods, achieve automated and intelligent optimization of prompt information. Under limited sample conditions, this optimization method significantly improves the overall performance of the network model.
[0150] In some embodiments, after obtaining the second prompt information, the computer device can further determine whether the second prompt information meets the optimization termination condition. This optimization termination condition is the condition for determining whether to stop iteratively optimizing the basic prompt information. Therefore, if the second prompt information does not meet the optimization termination condition, the computer device can continue iterative optimization of the second prompt information for the (i+2)th round, that is, it can continue iterative optimization of the basic prompt information for the (i+2)th round, so that in the (i+2)th round of iterative optimization, the second prompt information can continue to be optimized according to the same principle as the optimization of the first prompt information described above.
[0151] If the second prompt meets the aforementioned optimization termination condition, the computer device can use it as the final optimized target prompt. Alternatively, in this case, the computer device can output the M candidate prompts corresponding to the (i+1)th iteration optimization to the client interface for the user to choose from, thus using the user-selected candidate prompt as the final optimized target prompt. The principle of selecting the target prompt in the client interface is the same as that of selecting the second prompt in the client interface. The user can then apply this highly optimized target prompt to actual business scenarios for business processing, such as using it to accurately predict and process actual business data.
[0152] The computer device may determine whether the second prompt message meets the optimization termination condition in the following ways: if the optimization termination condition includes a set iteration count threshold, and if i+1 equals the iteration count threshold, then the second prompt message meets the optimization termination condition. This iteration count threshold can be a user-defined threshold or a system-default threshold, and it represents the total number of iterations required to optimize the basic prompt message.
[0153] When the optimization termination condition includes a set performance evaluation index threshold, if the performance evaluation index value of the data prediction using the second prompt information is greater than or equal to the performance evaluation index threshold, then the second prompt information can be determined to meet the optimization termination condition. The principle for obtaining the performance evaluation index value associated with the second prompt information is the same as the principle for obtaining the performance evaluation index value associated with the first prompt information in the corresponding embodiment of Figure 6 above. Both can be obtained through statistical calculation using the aforementioned test dataset. The performance evaluation index value associated with the second prompt information may also include the accuracy and recall rate of data prediction using the second prompt information, which will not be elaborated further here.
[0154] The performance evaluation metric threshold can be the minimum performance evaluation metric value that the user sets to meet their expectations, or it can be the minimum performance evaluation metric value that the system defaults to meet expectations. This performance evaluation metric threshold can also include set precision and recall thresholds. Therefore, "the performance evaluation metric value associated with the second prompt message is greater than or equal to this performance evaluation metric threshold" can mean that the precision associated with the second prompt message is greater than or equal to this precision threshold, and the recall associated with the second prompt message is also greater than or equal to this recall threshold.
[0155] In some embodiments, when performing multiple rounds of iterative optimization on the basic prompt information, the computer device can statistically calculate the effect evaluation index value associated with the prompt information obtained after each round of iterative optimization, and can display the effect evaluation index value associated with the prompt information obtained after each round of iterative optimization, as well as the prompt information obtained after each round of iterative optimization, on the client interface, such as sending it to the client so that the client can display it on the client interface, so that the user can intuitively view and refer to the effect after each round of iterative optimization.
[0156] Please refer to Figure 9, which is a schematic diagram of a scenario for multi-round iterative optimization of prompt information provided in an embodiment of this application. As shown in Figure 9, the computer device can obtain the first prompt information 901 to be optimized. The computer device can call the network model to perform prediction processing on the sample data in the sample dataset 902 according to the rules indicated by the first prompt information 901, so as to obtain the prediction result of the sample data in the sample dataset 902. The prediction result can be "yes" (indicating that the current input text contains offensive language) or "no" (indicating that the current input text does not contain offensive language). The sample data in the sample dataset 902 can also have data labels, which are used to indicate the true result of the sample data. The true result can also be "yes" (indicating that the current input text contains offensive language) or "no" (indicating that the current input text does not contain offensive language).
[0157] The computer device can perform semantic understanding processing on the first prompt information 901 using the actual and predicted results of the sample data in the sample dataset 902. For example, it can use reference sample data selected from the actual and predicted results of the sample data in the sample dataset to perform semantic understanding processing on the first prompt information 901, thereby generating a natural language gradient. This natural language gradient is the aforementioned optimization instruction information. The natural language gradient is a text used to indicate the semantic direction of optimizing the first prompt information. For instance, here, the natural language gradient could include: "The prompt words are too broad and lack a clear definition of offensive language, causing the model to incorrectly judge negative emotions as offensive language. It is recommended to add a more specific description of offensive language to the prompt words, such as including derogatory comments about certain people or things."
[0158] Therefore, the computer device can invoke the network model to optimize the first prompt information according to the semantics indicated by the natural language gradient, in order to obtain the second prompt information. If the second prompt information does not meet the optimization termination condition, the same principle as optimizing the first prompt information can be used to continue the next round of iterative optimization, and so on, to achieve multiple rounds of iterative optimization of the prompt information until a prompt information that meets the optimization termination condition is obtained. This prompt information can then be used as the final optimized target prompt information.
[0159] Through the above process, the basic prompt information can be automatically optimized in multiple rounds to improve the precision and recall rate of data prediction based on the prompt information, and finally optimize it to obtain target prompt information that is extremely accurate and clear and can be applied to actual business scenarios.
[0160] This application employs an automatic prompt optimization strategy using gradient descent, automatically optimizing prompt information through multiple iterations. Each iteration optimizes the prompt information by analyzing bad cases output by the network model, simulating the gradient descent and backpropagation processes of a deep learning model, gradually approaching the optimal solution and thus improving the model's final performance. Furthermore, this application can quickly respond to business needs. The prompt information optimization system designed in this application can quickly adjust and adapt to different business requirements without retraining the network model, achieving automated optimization of prompt information and significantly shortening the time from business requirement submission to model response. In addition, the method provided in this application can significantly improve the performance of the network model on specific tasks using only a small number of samples (e.g., a small amount of sample data in the sample dataset), achieving excellent optimization of prompt information, and obtaining high-quality output (i.e., high-quality target prompt information) even in situations lacking large amounts of training data.
[0161] In summary, the method provided by the embodiments of this application can improve the response speed to business needs, reduce training costs (successful training of prompt information is equivalent to optimizing prompt words), and improve model performance under conditions of limited data. Therefore, the method provided by the embodiments of this application has significant advantages.
[0162] The method provided in this application significantly reduces the cost of optimizing prompts compared to traditional methods that require manual annotation of large amounts of sample data to optimize prompts according to specific templates and rules. This cost reduction includes the cost of manually annotating sample data and the service costs of maintaining and updating the templates and rules for optimizing prompts. Furthermore, compared to traditional methods that rely on manual annotation of large amounts of sample data to optimize prompts according to specific templates and rules, the templates and rules can only cover a limited range of business scenarios. In some complex prompt optimization scenarios, the accuracy is very low, and the optimization effect is poor. In contrast, the automated prompt optimization method provided in this application can cover the vast majority of business scenarios, achieving excellent optimization of prompts, improving user experience, and increasing user stickiness.
[0163] Please refer to Figure 10, which is a schematic diagram of the structure of an information processing device provided in an embodiment of this application. As shown in Figure 10, the information processing device 100 may include: an acquisition module 11, a prediction module 12, a generation module 13, and an optimization module 14. The acquisition module 11 is configured to acquire a first prompt information to be optimized and a sample dataset. The first prompt information indicates rules for predicting sample data in the sample dataset. The prediction module 12 is configured to call a network model to perform prediction processing on the sample data in the sample dataset according to the rules indicated by the first prompt information, and obtain prediction results for the sample data in the sample dataset. The generation module 13 is configured to call a network model to perform semantic understanding processing on the first prompt information based on the prediction results of the sample data in the sample dataset, and obtain optimization instruction information for the first prompt information. The optimization instruction information is used to indicate the semantic direction for optimizing the first prompt information. The optimization module 14 is configured to call a network model to perform optimization processing on the first prompt information according to the semantic direction indicated by the optimization instruction information, and obtain second prompt information.
[0164] In some embodiments, the sample data in the sample dataset has data labels, and the data label of any sample data indicates the true result to be predicted for any sample data; the generation module 13 is further configured to: select reference sample data from the sample dataset based on the difference between the predicted result and the true result of the sample data in the sample dataset, the reference sample data being the sample data whose predicted result is inconsistent with the true result; and call the network model to perform semantic understanding processing on the first prompt information based on the reference sample data to obtain optimized prompt information.
[0165] In some embodiments, the generation module 13 is further configured to: call the network model to perform semantic understanding processing on the first prompt information based on the reference sample data to obtain the reason text for the incorrect prediction of the reference sample data using the first prompt information; generate optimization suggestion text for the first prompt information based on the reason text; and generate optimization instruction information using the reason text and the optimization suggestion text.
[0166] In some embodiments, the generation module 13 is further configured to: obtain a test dataset, wherein the test data in the test dataset has data labels, and the data label of any test data indicates the true result to be predicted for any test data; call the network model to perform prediction processing on the test data in the test dataset according to the rules suggested by the first prompt information, and obtain the prediction result of the test data in the test dataset; determine the effect evaluation index value of using the first prompt information for data prediction based on the difference between the prediction result and the true result of the test data in the test dataset; and select reference sample data from the sample dataset based on the difference between the prediction result and the true result of the sample data in the sample dataset, and the effect evaluation index value associated with the first prompt information.
[0167] In some embodiments, the performance evaluation index values associated with the first prompt information include: the accuracy and recall of data prediction using the first prompt information; the generation module 13 is further configured to: obtain a first ratio between the recall associated with the first prompt information and the accuracy associated with the first prompt information; and select reference sample data from the sample dataset based on the first ratio and the difference between the prediction results and the actual results of the sample data in the sample dataset.
[0168] In some embodiments, the generation module 13 is further configured to: obtain erroneous prediction sample data and erroneous recall sample data from the sample dataset; wherein, the erroneous prediction sample data includes sample data in the sample dataset where the prediction result is inconsistent with the actual result, and the erroneous recall sample data includes sample data in the sample dataset where the prediction result conforms to the rule indicated by the first prompt information, and the actual result does not conform to the rule indicated by the first prompt information; select first sample data from the erroneous prediction sample data based on a first ratio, and select second sample data from the erroneous recall sample data; a second ratio between the number of first sample data and the number of second sample data is equal to the first ratio; and determine both the first sample data and the second sample data as reference sample data.
[0169] In some embodiments, the acquisition module 11 is further configured to: acquire the input initial prompt information, the initial prompt information being used to prompt the rules for predicting sample data in the sample dataset; perform pre-optimization processing on the initial prompt information to obtain basic prompt information to be iteratively optimized; perform i rounds of iterative optimization on the basic prompt information to obtain first prompt information, where i is greater than or equal to 0 and i is an integer; if i is equal to 0, then the first prompt information is the basic prompt information.
[0170] In some embodiments, the acquisition module 11 is further configured to: acquire the prompt information to be optimized in each round of iterative optimization; wherein, if i equals 1, the prompt information to be optimized is the basic prompt information; if i is greater than 1, the prompt information to be optimized is the prompt information after the (i-1)th round of iterative optimization; call the network model to perform prediction processing on the sample data in the sample dataset according to the rules indicated by the prompt information to be optimized, and obtain the prediction result of the sample data in the sample dataset; call the network model to perform semantic understanding processing on the prompt information to be optimized based on the prediction result of the sample data in the sample dataset, and obtain optimization instruction information for the prompt information to be optimized; the optimization instruction information is used to indicate the semantic direction of optimizing the prompt information to be optimized; call the network model to perform optimization processing on the prompt information to be optimized according to the semantic direction indicated by the optimization instruction information, and obtain the prompt information after each round of iterative optimization; and determine the prompt information after the i-th round of iterative optimization as the first prompt information.
[0171] In some embodiments, the acquisition module 11 is further configured to: call the network model to generate derivation information corresponding to the rules suggested by the initial prompt information; call the network model to perform derivation processing on the rules suggested by the initial prompt information based on the derivation information; optimize the initial prompt information during the derivation processing to obtain intermediate prompt information; and generate basic prompt information based on the intermediate prompt information.
[0172] In some embodiments, the acquisition module 11 is further configured to: acquire sample examples; the sample examples include example data and the true results required to predict the example data according to the rules suggested by the initial prompt information; call the network model to adaptively learn the rules suggested by the intermediate prompt information based on the sample examples; and optimize the intermediate prompt information during the adaptive learning process to obtain basic prompt information.
[0173] In some embodiments, the first prompt information is the prompt information obtained after performing the i-th round of iterative optimization on the basic prompt information to be iteratively optimized, where i is greater than or equal to 0 and i is an integer; the optimization module 14 is further configured to: call the network model to optimize the first prompt information according to the semantic direction indicated by the optimization instruction information, to obtain N optimized prompt information corresponding to the (i+1)-th round of iterative optimization, where N is a positive integer; obtain candidate prompt information corresponding to the k-th round of iterative optimization before the (i+1)-th round of iterative optimization; one round of iterative optimization corresponds to M candidate prompt information, where M is a positive integer; select M candidate prompt information corresponding to the (i+1)-th round of iterative optimization from the candidate prompt information corresponding to the k-th round of iterative optimization and the N optimized prompt information corresponding to the (i+1)-th round of iterative optimization; select the second prompt information from the M candidate prompt information corresponding to the (i+1)-th round of iterative optimization; the second prompt information is the prompt information obtained after performing the i+1-th round of iterative optimization on the basic prompt information.
[0174] In some embodiments, the optimization module 14 is further configured to: obtain the effect evaluation index value of data prediction using candidate prompt information corresponding to k rounds of iterative optimization, and obtain the effect evaluation index value of data prediction using N optimization prompt information corresponding to the (i+1)th round of iterative optimization; and determine the M prompt information with the largest sum of associated effect evaluation index values among the candidate prompt information corresponding to k rounds of iterative optimization and the N optimization prompt information corresponding to the (i+1)th round of iterative optimization as the M candidate prompt information corresponding to the (i+1)th round of iterative optimization.
[0175] In some embodiments, the optimization module 14 is further configured to: obtain the effect evaluation index value of data prediction using the N optimization prompts corresponding to the (i+1)th iteration optimization, and obtain the effect evaluation index value of data prediction using the N optimization prompts corresponding to the i-th iteration optimization; in response to the maximum effect evaluation index value associated with the N optimization prompts corresponding to the (i+1)th iteration optimization being greater than the maximum effect evaluation index value associated with the N optimization prompts corresponding to the i-th iteration optimization, obtain the candidate prompts corresponding to the k-th iteration optimization; in response to the maximum effect evaluation index value associated with the N optimization prompts corresponding to the (i+1)th iteration optimization being less than or equal to the maximum effect evaluation index value associated with the N optimization prompts corresponding to the i-th iteration optimization, terminate the acquisition of the candidate prompts corresponding to the k-th iteration optimization, withdraw the current optimization processing of the first prompts in the (i+1)th iteration optimization, and re-optimize the first prompts.
[0176] In some embodiments, the optimization module 14 is further configured to: obtain the effect evaluation index value of data prediction using the M candidate prompt information corresponding to the (i+1)th round of iterative optimization; and determine the candidate prompt information with the largest effect evaluation index value among the M candidate prompt information corresponding to the (i+1)th round of iterative optimization as the second prompt information.
[0177] In some embodiments, the optimization module 14 is further configured to: obtain the effect evaluation index value of data prediction using the M candidate prompt information corresponding to the (i+1)th round of iterative optimization; output the M candidate prompt information corresponding to the (i+1)th round of iterative optimization on the client interface; and determine the candidate prompt information selected in the client interface as the second prompt information.
[0178] In some embodiments, the optimization module 14 is further configured to: determine whether the second prompt information meets the optimization termination condition; if the second prompt information does not meet the optimization termination condition, continue to perform the i+2th round of iterative optimization on the second prompt information; and if the second prompt information meets the optimization termination condition, determine the second prompt information as the optimized target prompt information.
[0179] In some embodiments, the optimization module 14 is further configured to: determine that the second prompt information meets the optimization termination condition in response to the optimization termination condition including a set iteration number threshold and i+1 being equal to the iteration number threshold; and determine that the second prompt information meets the optimization termination condition in response to the optimization termination condition including a set effect evaluation index threshold and the effect evaluation index value of data prediction using the second prompt information being greater than or equal to the effect evaluation index threshold.
[0180] According to one embodiment of this application, the steps involved in the information processing method shown in FIG3 can be executed by various modules in the information processing apparatus 100 shown in FIG10. For example, step S101 shown in FIG3 can be executed by the acquisition module 11 in FIG10, step S102 shown in FIG3 can be executed by the prediction module 12 in FIG10, step S103 shown in FIG3 can be executed by the generation module 13 in FIG10, and step S104 shown in FIG3 can be executed by the optimization module 14 in FIG10.
[0181] This application embodiment can obtain a first prompt information to be optimized and a sample dataset. The first prompt information indicates rules for predicting the sample data in the sample dataset. A network model can be invoked to predict the sample data in the sample dataset according to the rules indicated by the first prompt information, obtaining the prediction results of the sample data in the sample dataset. Then, based on the prediction results of the sample data in the sample dataset, the network model can perform semantic understanding processing on the first prompt information to generate optimization instruction information for the first prompt information. The optimization instruction information indicates the semantic direction for optimizing the first prompt information. Furthermore, the network model can be invoked to optimize the first prompt information according to the instructions of the optimization instruction information to obtain a second prompt information. Therefore, this application embodiment proposes an automatic optimization device for prompt information. In this application embodiment, the network model can use the prediction results obtained from the actual prediction of the sample data using the first prompt information as a reference to perform semantic understanding processing on the first prompt information, thereby generating optimization instruction information to indicate the semantic direction for optimizing the first prompt information. Through this optimization instruction information, the network model can achieve automated and accurate optimization processing of the first prompt information, thus improving the efficiency and accuracy of optimizing the first prompt information.
[0182] According to one embodiment of this application, the modules in the information processing device 100 shown in FIG10 can be individually or entirely merged into one or more units, or some of the units can be further divided into multiple functionally smaller sub-units to achieve the same operation without affecting the technical effect of the embodiment of this application. The above modules are based on logical function division. In practical applications, the function of one module can also be implemented by multiple units, or the function of multiple modules can be implemented by one unit. In other embodiments of this application, the information processing device 100 may also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented by multiple units working together.
[0183] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0184] According to one embodiment of this application, a computer-executable instruction or computer program capable of executing the steps involved in the corresponding methods shown in the various embodiments of this application can be run on a general-purpose computer device (which may include processing elements and storage elements such as a central processing unit (CPU), random access memory (RAM), and read-only memory (ROM)) to construct the information processing apparatus 100 shown in FIG10. The aforementioned computer-executable instruction or computer program can be recorded on a computer-readable recording medium, and can be loaded into the aforementioned computer device through the computer-readable recording medium and run therein.
[0185] Please refer to Figure 11, which is a schematic diagram of the structure of a computer device provided in an embodiment of this application. As shown in Figure 11, the computer device 1000 may include: a processor 1001, a network interface 1004, and a memory 1005. Furthermore, in some embodiments, the computer device 1000 may also include: a user interface 1003, and at least one communication bus 1002. The communication bus 1002 is used to implement communication between these components. The user interface 1003 may include a display screen and a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory, such as at least one disk storage device. Optionally, the memory 1005 may also be at least one storage device located remotely from the aforementioned processor 1001. As shown in Figure 11, the memory 1005, as a computer storage medium, may include an operating system, a network communication module, a user interface module, and a device control application.
[0186] In the computer device 1000 shown in Figure 11, the network interface 1004 provides network communication functionality; the user interface 1003 is mainly used to provide an input interface for the user; and the processor 1001 can be used to call the device control application stored in the memory 1005 to achieve the following: obtaining a first prompt message to be optimized and a sample dataset, wherein the first prompt message is used to prompt the rules for predicting the sample data in the sample dataset; calling the network model to perform predicting processing on the sample data in the sample dataset according to the rules prompted by the first prompt message, and obtaining the prediction result of the sample data in the sample dataset; calling the network model to perform semantic understanding processing on the first prompt message based on the prediction result of the sample data in the sample dataset, and obtaining optimization instruction information for the first prompt message, wherein the optimization instruction information is used to indicate the semantic direction for optimizing the first prompt message; and calling the network model to perform optimization processing on the first prompt message according to the semantic direction indicated by the optimization instruction information, and obtaining a second prompt message.
[0187] It should be understood that the computer device 1000 described in the embodiments of this application can execute the information processing methods described in the embodiments of this application, and can also execute the information processing apparatus 100 described in the embodiments corresponding to FIG10 above, which will not be repeated here. In addition, the beneficial effects of using the same method will not be repeated here.
[0188] Furthermore, it should be noted that this application also provides a computer-readable storage medium storing computer-executable instructions or a computer program. When a processor executes the computer-executable instructions or the computer program, it can perform the information processing methods described in the various embodiments of this application. Therefore, these will not be repeated here. Additionally, the beneficial effects of using the same method will also not be repeated. For technical details not disclosed in the embodiments of the computer storage medium involved in this application, please refer to the description of the method embodiments of this application.
[0189] As an example, the aforementioned computer-executable instructions or computer programs may be deployed on a single computer device for execution, or deployed on multiple computer devices located in one location for execution, or executed on multiple computer devices distributed across multiple locations and interconnected via a communication network. These multiple computer devices distributed across multiple locations and interconnected via a communication network can form a blockchain network.
[0190] The aforementioned computer-readable storage medium can be an internal storage unit of the computer device, such as a hard drive or memory. It can also be an external storage device, such as a plug-in hard drive, smart media card (SMC), secure digital card (SD), flash card, etc. The computer-readable storage medium may include both internal and external storage units. It is used to store executable instructions or computer programs, as well as other programs and data required by the computer device. It can also be used to temporarily store data that has been output or will be output.
[0191] This application provides a computer program product comprising computer-executable instructions or a computer program stored in a computer-readable storage medium. A processor of a computer device reads the computer-executable instructions or computer program from the computer-readable storage medium and executes the computer-executable instructions or computer program, causing the computer device to perform the information processing methods described in the embodiments of this application; therefore, they will not be repeated here. Furthermore, the beneficial effects of using the same method will also not be repeated. For technical details not disclosed in the embodiments of the computer-readable storage medium involved in this application, please refer to the description of the method embodiments of this application.
[0192] In the embodiments of this application, the terms "first," "second," etc., are used to distinguish different objects, rather than to describe a specific order. Furthermore, the term "comprising," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, apparatus, product, or device that includes a series of steps or units is not limited to the listed steps or modules, but may optionally include steps or modules not listed, or may optionally include other step units inherent to these processes, methods, apparatuses, products, or devices.
[0193] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed in this application can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0194] The above-disclosed embodiments are merely preferred embodiments of this application and should not be construed as limiting the scope of this application. Therefore, any equivalent variations made in accordance with the claims of this application shall still fall within the scope of this application.
Claims
1. An information processing method, the method being executed by a computer device, the method comprising: Obtain the first prompt information to be optimized and the sample dataset, wherein the first prompt information is used to prompt the rules for predictive processing of the sample data in the sample dataset; The network model is invoked to perform prediction processing on the sample data in the sample dataset according to the rules suggested by the first prompt information, so as to obtain the prediction results of the sample data in the sample dataset; The network model is invoked to perform semantic understanding processing on the first prompt information based on the prediction results of the sample data in the sample dataset, thereby obtaining optimized instruction information for the first prompt information. The optimization indication information is used to indicate the semantic direction for optimizing the first prompt information; The network model is invoked to optimize the first prompt information according to the semantic direction indicated by the optimization instruction information, so as to obtain the second prompt information.
2. The method as described in claim 1, wherein, The sample data in the sample dataset has data labels, and the data label of any sample data indicates the true result to be predicted for any sample data. The step of invoking the network model to perform semantic understanding processing on the first prompt information based on the prediction results of the sample data in the sample dataset, and obtaining optimized instruction information for the first prompt information, includes: Based on the difference between the predicted results and the actual results of the sample data in the sample dataset, reference sample data is selected from the sample dataset. The reference sample data is the sample data whose predicted results are inconsistent with the actual results. The network model is invoked to perform semantic understanding processing on the first prompt information based on the reference sample data to obtain the optimized instruction information.
3. The method as described in claim 1 or 2, wherein, The step of invoking the network model to perform semantic understanding processing on the first prompt information based on the reference sample data to obtain the optimized instruction information includes: The network model is invoked to perform semantic understanding processing on the first prompt information based on the reference sample data, thereby obtaining the reason text for the incorrect prediction of the reference sample data using the first prompt information; Generate optimized suggestion text for the first prompt information based on the reason text; The optimization instruction information is generated using the reason text and the optimization suggestion text.
4. The method as described in any one of claims 1 to 3, wherein, The step of selecting reference sample data from the sample dataset based on the difference between the predicted results and the actual results of the sample data in the sample dataset includes: Obtain a test dataset, wherein the test data in the test dataset has data labels, and the data label of any test data indicates the true result to be predicted for any test data. The network model is invoked to perform prediction processing on the test data in the test dataset according to the rules suggested by the first prompt information, so as to obtain the prediction results of the test data in the test dataset; Based on the difference between the predicted results and the actual results of the test data in the test dataset, determine the performance evaluation index value of using the first prompt information for data prediction; The reference sample data is selected from the sample dataset based on the difference between the predicted results and the actual results of the sample data in the sample dataset, and the effect evaluation index value associated with the first prompt information.
5. The method according to any one of claims 1 to 4, wherein, The performance evaluation metrics associated with the first prompt information include: the accuracy and recall rate of data prediction using the first prompt information; The step of selecting the reference sample data from the sample dataset based on the difference between the predicted results and the actual results of the sample data in the sample dataset, and the effect evaluation index value associated with the first prompt information, includes: Obtain a first ratio between the recall rate associated with the first prompt information and the precision rate associated with the first prompt information; The reference sample data is selected from the sample dataset based on the first ratio and the difference between the predicted and actual results of the sample data in the sample dataset.
6. The method according to any one of claims 1 to 5, wherein, The step of selecting the reference sample data from the sample dataset based on the first ratio and the difference between the predicted and actual results of the sample data in the sample dataset includes: Obtain incorrect prediction sample data and incorrect recall sample data from the sample dataset; wherein, the incorrect prediction sample data includes sample data in the sample dataset where the prediction result is inconsistent with the actual result, and the incorrect recall sample data includes sample data in the sample dataset where the prediction result conforms to the rule indicated by the first prompt information, but the actual result does not conform to the rule indicated by the first prompt information; Based on the first ratio, a first sample data is selected from the sample data of the prediction error, and a second sample data is selected from the sample data of the recall error; the second ratio between the number of the first sample data and the number of the second sample data is equal to the first ratio. Both the first sample data and the second sample data are determined as the reference sample data.
7. The method according to any one of claims 1 to 6, wherein, The process of obtaining the first prompt information to be optimized includes: Obtain initial prompt information for input, the initial prompt information being used to prompt the rules for predictive processing of sample data in the sample dataset; The initial prompt information is pre-optimized to obtain the basic prompt information to be iteratively optimized. The basic prompt information is iteratively optimized through i rounds to obtain the first prompt information, where i is greater than or equal to 0 and i is an integer. If i is equal to 0, then the first prompt information is the basic prompt information.
8. The method according to any one of claims 1 to 7, wherein, The step of performing i rounds of iterative optimization on the basic prompt information to obtain the first prompt information includes: In each round of iterative optimization, the prompt information to be optimized is obtained; where, if i equals 1, the prompt information to be optimized is the basic prompt information; if i is greater than 1, the prompt information to be optimized is the prompt information after the (i-1)th round of iterative optimization. The network model is invoked to perform prediction processing on the sample data in the sample dataset according to the rules suggested by the prompt information to be optimized, so as to obtain the prediction results of the sample data in the sample dataset. The network model is invoked to perform semantic understanding processing on the prompt information to be optimized based on the prediction results of the sample data in the sample dataset, so as to obtain optimization indication information for the prompt information to be optimized; the optimization indication information is used to indicate the semantic direction for optimizing the prompt information to be optimized. The network model is invoked to optimize the prompt information to be optimized according to the semantic direction indicated by the optimization instruction information, so as to obtain the prompt information after each round of iteration optimization; The prompt information optimized in the i-th iteration is determined as the first prompt information.
9. The method according to any one of claims 1 to 8, wherein, The pre-optimization process of the initial prompt information to obtain basic prompt information for iterative optimization includes: The network model is invoked to generate derivation information corresponding to the rules suggested by the initial prompt information; The network model is invoked to derive the rules suggested by the initial prompt information based on the inference information; During the derivation process, the initial prompt information is optimized to obtain intermediate prompt information; The basic prompt information is generated based on the intermediate prompt information.
10. The method according to any one of claims 1 to 9, wherein, The process of generating the basic prompt information based on the intermediate prompt information includes: Obtain a sample example; the sample example includes sample data and the actual result required to perform prediction processing on the sample data according to the rules suggested in the initial prompt information; The network model is invoked to adaptively learn the rules suggested by the intermediate prompt information based on the sample examples; During the adaptive learning process, the intermediate prompt information is optimized to obtain the basic prompt information.
11. The method according to any one of claims 1 to 10, wherein, The first prompt information is the prompt information obtained after performing the i-th round of iterative optimization on the basic prompt information to be iteratively optimized, where i is greater than or equal to 0 and i is an integer; The step of calling the network model to optimize the first prompt information according to the semantic direction indicated by the optimization instruction information to obtain the second prompt information includes: The network model is invoked to optimize the first prompt information according to the semantic direction indicated by the optimization instruction information, so as to obtain N optimization prompt information corresponding to the (i+1)th round of iteration optimization, where N is a positive integer; Obtain the candidate hint information corresponding to the k neighboring iterations before the (i+1)th iteration; one iteration corresponds to M candidate hint information, where M is a positive integer; From the candidate suggestion information corresponding to the k rounds of iteration optimization and the N optimization suggestion information corresponding to the (i+1)th round of iteration optimization, select M candidate suggestion information corresponding to the (i+1)th round of iteration optimization; The second prompt information is selected from the M candidate prompt information corresponding to the (i+1)th round of iteration optimization; the second prompt information is the prompt information obtained after the (i+1)th round of iteration optimization of the basic prompt information.
12. The method as claimed in any one of claims 1 to 11, wherein, The step of selecting M candidate suggestions corresponding to the (i+1)th iteration optimization from the candidate suggestion information corresponding to the k-th iteration optimization and the N optimization suggestion information corresponding to the (i+1)th iteration optimization includes: Obtain the performance evaluation index value of data prediction using the candidate prompt information corresponding to the k rounds of iterative optimization, and obtain the performance evaluation index value of data prediction using the N optimization prompt information corresponding to the (i+1)th round of iterative optimization. The M prompts with the largest sum of associated effect evaluation index values among the candidate prompts corresponding to the k-th round of iteration optimization and the N optimization prompts corresponding to the (i+1)-th round of iteration optimization are determined as the M candidate prompts corresponding to the (i+1)-th round of iteration optimization.
13. The method as claimed in any one of claims 1 to 12, wherein, The step of obtaining the candidate suggestion information corresponding to the k nearest iterations before the (i+1)th iteration optimization includes: Obtain the performance evaluation index value of data prediction using the N optimization prompts corresponding to the (i+1)th round of iterative optimization, and obtain the performance evaluation index value of data prediction using the N optimization prompts corresponding to the i-th round of iterative optimization. If the maximum effect evaluation index value associated with the N optimization prompts corresponding to the (i+1)th iteration optimization is greater than the maximum effect evaluation index value associated with the N optimization prompts corresponding to the i-th iteration optimization, then the candidate prompts corresponding to the k-th iteration optimization are obtained. If the maximum effect evaluation index value associated with the N optimization prompts corresponding to the (i+1)th iteration optimization is less than or equal to the maximum effect evaluation index value associated with the N optimization prompts corresponding to the i-th iteration optimization, the acquisition of candidate prompts corresponding to the k-th iteration optimization is terminated, the current optimization processing of the first prompt in the (i+1)th iteration optimization is withdrawn, and the first prompt is re-optimized.
14. The method as claimed in any one of claims 1 to 13, wherein, The step of selecting the second hint information from the M candidate hint information corresponding to the (i+1)th round of iteration optimization includes: Obtain the performance evaluation index value of data prediction using the M candidate prompts corresponding to the (i+1)th round of iterative optimization; The candidate prompt information with the largest effect evaluation index value associated with the M candidate prompt information corresponding to the (i+1)th round of iterative optimization is determined as the second prompt information.
15. The method as claimed in any one of claims 1 to 14, wherein, The step of selecting the second hint information from the M candidate hint information corresponding to the (i+1)th round of iteration optimization includes: Obtain the performance evaluation index value of data prediction using the M candidate prompts corresponding to the (i+1)th round of iterative optimization; Output the M candidate prompts corresponding to the (i+1)th round of iterative optimization on the client interface; The candidate prompt information selected in the client interface is determined as the second prompt information.
16. The method as claimed in any one of claims 1 to 15, wherein, The method further includes: Determine whether the second prompt message meets the optimization termination conditions; If the second prompt message does not meet the optimization termination condition, continue to perform the (i+2)th round of iterative optimization on the second prompt message; In response to the second prompt message meeting the optimization termination condition, the second prompt message is determined as the target prompt message obtained through optimization.
17. The method as claimed in any one of claims 1 to 16, wherein, Determining whether the second prompt message meets the optimization termination condition includes: In response to the fact that the optimization termination condition includes a set iteration number threshold, and i+1 is equal to the iteration number threshold, it is determined that the second prompt information meets the optimization termination condition; In response to the optimization termination condition including a set effect evaluation index threshold, and the effect evaluation index value of data prediction using the second prompt information being greater than or equal to the effect evaluation index threshold, it is determined that the second prompt information meets the optimization termination condition.
18. An information processing apparatus, the apparatus comprising: The acquisition module is configured to acquire a first prompt information to be optimized and a sample dataset, wherein the first prompt information is used to prompt the rules for predictive processing of the sample data in the sample dataset; The prediction module is configured to call the network model to perform prediction processing on the sample data in the sample dataset according to the rules suggested by the first prompt information, and obtain the prediction results of the sample data in the sample dataset. The generation module is configured to call the prediction results of the network model based on the sample data in the sample dataset to perform semantic understanding processing on the first prompt information and obtain optimized instruction information for the first prompt information. The optimization indication information is used to indicate the semantic direction for optimizing the first prompt information; The optimization module is configured to call the network model to optimize the first prompt information according to the semantic direction indicated by the optimization instruction information, so as to obtain the second prompt information.
19. A computer program product comprising computer-executable instructions or a computer program, wherein when executed by a processor, the computer-executable instructions or the computer program implement the information processing method as described in any one of claims 1 to 17.
20. A computer device, comprising: Memory is used to store executable instructions or computer programs. A processor, when executing computer-executable instructions or computer programs stored in the memory, implements the information processing method as described in any one of claims 1 to 17.
21. A computer-readable storage medium storing computer-executable instructions or a computer program, which, when executed by a processor, implement the information processing method as described in any one of claims 1 to 17.