Prompt information determination method, prompt information optimization method, and task processing method

By acquiring historical optimization metrics and Bayesian statistics of candidate prompt information, and combining them with the Thompson sampling algorithm to generate utility metrics, the problem of low efficiency in prompt information optimization in existing technologies is solved, achieving an efficient and stable prompt information optimization process with generalization ability to adapt to complex scenarios.

CN123048778APending Publication Date: 2026-11-06SWEET POTATO TECHNOLOGY (SHANGHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611250113.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-18
Publication Date
2026-11-06

AI Technical Summary

Technical Problem

In existing technologies, manually designed or randomly generated prompts are difficult to achieve the desired effect, resulting in high computational costs and long time consumption in the prompt optimization process. Furthermore, existing solutions lack dynamic discrimination when selecting target prompts, leading to resource waste and limitations in optimization quality.

Method used

By acquiring historical optimization metrics of candidate prompts, sampling is performed using Bayesian statistics and Thompson's sampling algorithm. The utility metrics are then combined with the prompt metrics and sampling metrics to accurately identify target prompts with high accuracy, high generalization power, and high evolutionary space.

Benefits of technology

It improves the efficiency of prompt message optimization, avoids wasting computing resources, ensures the long-term stability of the optimization direction and the high quality of prompt messages, and has the ability to generalize to complex scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123048778A_ABST
    Figure CN123048778A_ABST
Patent Text Reader

Abstract

This specification provides a method for determining prompt information, a method for optimizing prompt information, and a task processing method. The method for determining prompt information includes: acquiring historical optimization indicators for multiple candidate prompt information, where the historical optimization indicators reflect the task execution status of the candidate prompt information during the historical optimization process; sampling based on the historical optimization indicators to obtain sampling indicators for multiple candidate prompt information, where the sampling indicators reflect the exploration potential of the candidate prompt information; generating utility indicators for multiple candidate prompt information based on the prompt indicators and sampling indicators, where the prompt indicators reflect the hard sample solving ability of the candidate prompt information; and determining the target prompt information from the multiple candidate prompt information based on the utility indicators. By using the utility indicators, target prompt information with high accuracy, high generalization ability, and large evolutionary space can be accurately identified.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments in this specification relate to the field of artificial intelligence technology, and in particular to methods for determining prompt information, optimizing prompt information, and processing tasks. Background Technology

[0002] With the rapid development of artificial intelligence technology, pre-trained models, represented by large language models, have made breakthrough progress in natural language processing and multimodal tasks. Prompt engineering, as an efficient human-computer interaction paradigm, aims to guide models to perform specific tasks through natural language prompts without the need for fine-tuning model parameters.

[0003] Although prompts are widely used in engineering, manually designed or randomly generated prompts often fail to achieve the desired results, leading to computationally expensive and time-consuming optimization processes. Therefore, identifying superior prompts before or during the optimization process is crucial for improving overall optimization efficiency. Summary of the Invention

[0004] In view of this, embodiments of this specification provide a method for determining prompt information. One or more embodiments of this specification also relate to a prompt information optimization method, a task processing method, a prompt information determination device, a prompt information optimization device, a task processing device, a computing device, a computer-readable storage medium, and a computer program product, to address the technical deficiencies existing in the prior art.

[0005] According to a first aspect of the embodiments of this specification, a method for determining prompt information is provided, including: Historical optimization metrics for multiple candidate prompts are obtained, whereby the historical optimization metrics are used to reflect the task execution status of the candidate prompts during the historical optimization process. Based on historical optimization metrics, sampling metrics for multiple candidate hints are obtained. These sampling metrics are used to reflect the exploration potential of the candidate hints. Based on the prompting indicators and sampling indicators of multiple candidate prompts, utility indicators of multiple candidate prompts are generated respectively. Among them, the prompting indicators are used to reflect the difficulty sample solving ability of candidate prompts. Based on utility metrics, the target prompt is determined from multiple candidate prompts.

[0006] According to a second aspect of the embodiments of this specification, a method for optimizing prompt messages is provided, including: Obtain target prompt information, wherein the target prompt information is determined based on the prompt information determination method; The information optimization model is invoked to optimize the target prompt information, thereby obtaining optimized target prompt information.

[0007] According to a third aspect of the embodiments of this specification, a task processing method is provided, including: Obtain the target task data and target optimization hints for the target task, wherein the target optimization hints are obtained based on the hints optimization method; The task processing model is invoked, and the target task data is processed based on the target optimization prompts to obtain the target task results.

[0008] According to a fourth aspect of the embodiments of this specification, a prompting information determining device is provided, comprising: The first acquisition module is configured to acquire historical optimization metrics for multiple candidate prompts, wherein the historical optimization metrics are used to reflect the task execution status of the candidate prompts during the historical optimization process. The sampling module is configured to sample based on historical optimization metrics to obtain sampling metrics for multiple candidate hints, where the sampling metrics are used to reflect the exploration potential of the candidate hints. The generation module is configured to generate utility metrics for multiple candidate prompts based on prompt metrics and sampling metrics. The prompt metrics are used to reflect the difficulty sample solving ability of the candidate prompts. The first determination module is configured to determine the target prompt information from multiple candidate prompt information based on a utility index.

[0009] According to a fifth aspect of the embodiments of this specification, a prompt message optimization device is provided, comprising: The second acquisition module is configured to acquire target prompt information, wherein the target prompt information is determined based on the prompt information determination method; The optimization module is configured to call the information optimization model to optimize the target prompt information and obtain the target optimized prompt information.

[0010] According to a sixth aspect of the embodiments of this specification, a task processing apparatus is provided, comprising: The third acquisition module is configured to acquire the target task data and target optimization prompt information of the target task, wherein the target optimization prompt information is obtained based on the prompt information optimization method; The processing module is configured to invoke the task processing model, process the target task data based on the target optimization prompt information, and obtain the target task result.

[0011] According to a seventh aspect of the embodiments of this specification, a computing device is provided, comprising: Memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions, which, when executed by the processor, implement the steps of the methods provided in the first, second, or third aspects described above.

[0012] According to an eighth aspect of the embodiments of this specification, a computer-readable storage medium is provided that stores a computer program / instructions that, when executed by a processor, implement the steps of the methods provided in the first, second, or third aspects described above.

[0013] According to a ninth aspect of the embodiments of this specification, a computer program product is provided, including a computer program / instructions that, when executed by a processor, implement the steps of the methods provided in the first, second, or third aspects described above.

[0014] The prompt information determination method provided in one embodiment of this specification introduces historical optimization indicators that reflect the historical optimization process. This allows the prompt information determination system to trace the evolution trajectory of candidate prompt information, identifying "pseudo-optimal" prompt information that, while currently acceptable, has stagnated, thus avoiding wasting computational resources on ineffective paths. Simultaneously, by sampling based on historical optimization indicators to measure exploration potential, it ensures that prompt information in its growth stage or with the potential for mutation receives sufficient sampling opportunities, preventing high-potential prompt information from being prematurely eliminated due to short-term fluctuations. Furthermore, by introducing prompt indicators reflecting the ability to solve difficult samples, it breaks the previous limitation of focusing only on overall accuracy while ignoring sample difficulty, forcing the prompt information determination process to lean towards long-tail and complex scenarios. Finally, by using utility indicators generated based on prompt indicators and sampling indicators, it can accurately identify target prompt information that combines high accuracy, high generalization ability, and large evolutionary space, further significantly improving the efficiency of prompt information optimization. Attached Figure Description

[0015] Figure 1 This is a flowchart illustrating a method for determining prompt information according to one embodiment of this specification; Figure 2 This is a schematic diagram illustrating the processing steps of a prompt message determination method provided in one embodiment of this specification; Figure 3 This is a flowchart illustrating a method for optimizing prompt messages according to one embodiment of this specification; Figure 4 This is a flowchart illustrating a task processing method provided in one embodiment of this specification; Figure 5 This is a flowchart of a task processing method provided in one embodiment of this specification; Figure 6 This is a schematic diagram of a prompt information determining device provided in one embodiment of this specification; Figure 7 This is a schematic diagram of the structure of a prompt information optimization device provided in one embodiment of this specification; Figure 8 This is a schematic diagram of the structure of a task processing device provided in one embodiment of this specification; Figure 9 This is a structural block diagram of a computing device provided in one embodiment of this specification. Detailed Implementation

[0016] Many specific details are set forth in the following description to provide a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this specification. Therefore, this specification is not limited to the specific implementations disclosed below.

[0017] The terminology used in one or more embodiments of this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of one or more embodiments of this specification. The singular forms “a,” “described,” and “the” as used in one or more embodiments of this specification and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items. The term “at least one” as used in one or more embodiments of this specification means “one or more,” and “a plurality of” means “two or more.” The term “comprising” is an open-ended description and should be understood as “including but not limiting,” and may include other content in addition to what has been described.

[0018] It should be understood that although the terms first, second, etc., may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first may also be referred to as second without departing from the scope of one or more embodiments of this specification, and similarly, second may also be referred to as first. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to a determination."

[0019] Furthermore, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in one or more embodiments of this specification are obtained through open-source datasets or public datasets that comply with their license agreements, or are obtained with full authorization from the relevant parties. Moreover, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.

[0020] In one or more embodiments of this specification, a large model refers to a deep learning model with a large number of model parameters, typically containing hundreds of millions, tens of billions, hundreds of billions, trillions, or even tens of trillions of model parameters. A large model can also be called a foundation model. It is pre-trained using large-scale unlabeled corpora to produce a pre-trained model with hundreds of millions of parameters. Such models can adapt to a wide range of downstream tasks and have good generalization ability. Examples include Large Language Models (LLMs) and multi-modal pre-training models.

[0021] In practical applications, large models only require a small number of samples to fine-tune the pre-trained model before they can be applied to different tasks. Large models can be widely used in fields such as Natural Language Processing (NLP) and Computer Vision. Specifically, they can be applied to computer vision tasks such as Visual Question Answering (VQA), Image Captioning (IC), and Image Generation, as well as natural language processing tasks such as text-based sentiment classification, text summarization, and machine translation. The main application scenarios of large models include digital assistants, intelligent robots, search, online education, office software, e-commerce, and intelligent design.

[0022] First, the terms and concepts used in one or more embodiments of this specification will be explained.

[0023] Automatic Prompt Optimization (APO) is a technique that leverages the capabilities of large language models or specific algorithms to automatically generate, evaluate, and iteratively improve prompts. It aims to transform the traditional "prompt engineering" process, which relies on human experience and trial-and-error, into an automated, quantifiable scientific process. By automatically restructuring, enhancing, or refining the logic of original prompts, it helps developers find better ways to ask questions in less time and significantly improves the output quality, accuracy, and stability of large language models across various tasks.

[0024] The Beta distribution is a continuous probability distribution defined on the interval [0,1], whose shape is determined by two positive parameters α and β. It is often understood as a "probability distribution of probability" and is mainly used to characterize the uncertainty of the probability of an event occurring. In Bayesian statistical inference, it is also the conjugate prior distribution of the binomial distribution.

[0025] Thompson Sampling is a probabilistic algorithm based on Bayesian inference designed to solve the "exploration and exploitation" dilemma in decision-making (such as the multi-armed gambling machine problem). It maintains a probability distribution describing the potential reward for each option (usually using the Beta distribution as the conjugate prior of the binomial distribution). At each decision, it randomly samples from the posterior distribution of each option and selects the option with the highest value. Then, based on the actual feedback, it uses Bayesian update rules to correct the distribution parameters. Thus, it adaptively explores options with higher uncertainty while mining known high-reward options, ultimately maximizing long-term cumulative rewards.

[0026] Multi-Armed Bandit (MAB) is a classic decision optimization model, often considered a simplified version of reinforcement learning. Its core scenario is that a decision-maker faces multiple options (i.e., "arms") with unknown reward probability distributions. Within a limited number of attempts, the decision-maker must balance exploration (trying unknown options to obtain more information) with exploitation (choosing the currently known best option to obtain immediate benefits) through continuous trial and error. The aim is to develop a strategy to maximize long-term cumulative rewards (or equivalently minimize cumulative regret). It is widely used in fields such as online advertising recommendation, clinical trial design, dynamic pricing, and content distribution.

[0027] Optical Character Recognition (OCR) is a technology that uses electronic devices and computer vision to automatically detect characters in images (such as scanned documents and photos) and convert them into editable and searchable machine text through image processing and pattern recognition.

[0028] Currently, while large language models have shown great potential in various natural language processing tasks, their actual performance is highly sensitive to the design of prompts. This means that subtle changes in the wording of the input can often lead to drastic fluctuations in the quality of the model's output.

[0029] Faced with complex and diverse task requirements in real-world scenarios (such as fine-grained content tagging for different categories or identifying search intent based on subtle semantics), relying solely on human experience to construct prompts is not only extremely inefficient but also makes it difficult to traverse the vast search space to find a better solution. Furthermore, since most advanced large-scale models currently provide services primarily in the form of black-box application programming interfaces (APIs), developers cannot access their underlying parameters, rendering traditional parameter fine-tuning solutions ineffective in such scenarios.

[0030] To overcome this bottleneck, the core technical requirement has shifted to developing an APO (Automatic Prompt) technology. This technology aims to transform the design process of prompts into a systematic search problem within a discrete text space. The goal is to automatically discover and iterate high-performance prompts through algorithms while minimizing human intervention, thereby improving model performance.

[0031] While current mainstream feedback-based APO solutions have made some progress in iteratively modifying prompts by diagnosing model errors, they still have significant shortcomings in resource allocation and decision-making mechanisms during the iteration process, especially in the overly rough control of the core step of "selecting the target prompt information to be optimized".

[0032] First, current selection strategies are often too simplistic and short-sighted. For example, they tend to directly select the most accurate prompts on the current validation set as the target prompts to be optimized. This strategy severely ignores the differences in difficulty among the samples, causing the optimization process to be dominated by a large number of simple, basic problems. The direct consequence is that the system assigns excessive weight to prompts that can only solve simple tasks and lack the ability to generalize to complex scenarios, making the final optimized prompts inadequate when facing high-difficulty or marginal cases.

[0033] Secondly, current solutions generally fail to effectively mine and utilize historical optimization data, lacking long-term consideration of the evolution trajectory of prompts. During the optimization process, some prompts, while currently scoring highly, may actually be trapped in local optima, unable to achieve further performance breakthroughs even after multiple optimizations. Meanwhile, other highly promising prompts are prematurely abandoned due to initial random fluctuations or slightly lower scores. This prompt selection mechanism, lacking dynamic discriminative power, not only results in a significant waste of valuable computing resources and optimization budgets but also fundamentally limits the quality and generalization ceiling of prompts achievable through automatic optimization.

[0034] Based on this, this specification provides a method for determining prompt information. This specification also relates to a prompt information optimization method, a task processing method, a prompt information determination device, a prompt information optimization device, a task processing device, a computing device, a computer-readable storage medium, and a computer program product, which will be described in detail in the following embodiments.

[0035] See Figure 1 , Figure 1 A flowchart of a prompt message determination method according to an embodiment of this specification is shown, specifically including the following steps 102 to 108: Step 102: Obtain the historical optimization metrics for multiple candidate prompts, where the historical optimization metrics are used to reflect the task execution status of the candidate prompts during the historical optimization process.

[0036] It should be noted that candidate prompts refer to multiple prompt texts to be filtered during the current optimization process / round. These can be randomly generated by the prompt information determination system (hereinafter referred to as "the system" for ease of description), optimized based on historical prompt information, or manually preset initial prompt templates. Candidate prompts can serve as the basic unit for automatic prompt optimization, evolving into the best-performing target prompts through continuous iteration and filtering. For example, for a sentiment analysis task, the first candidate prompt might be "Please judge whether this sentence is positive or negative"; the second candidate prompt might be "You are a professional film critic, please analyze the sentiment tendency of the following text."

[0037] Historical optimization metrics refer to statistical data reflecting the task execution performance of candidate suggestions during past optimization processes. These metrics include not only the accuracy of candidate suggestions but also time-series data such as optimization success rate, number of times a suggestion was selected, and historical average score. By using historical optimization metrics, the stability and evolution trajectory of candidate suggestions can be evaluated, helping the system determine whether a suggestion is in an upward, stagnant, or declining phase, thus providing data support for subsequent sampling strategies.

[0038] In practical applications, there are various ways to obtain historical optimization metrics for multiple candidate prompts, and the specific method should be chosen based on the actual situation. This specification does not impose any limitations on these methods in its embodiments. One possible implementation of this specification involves maintaining a counter or log table in the system to record the specific performance of each candidate prompt during the historical optimization process. Whenever a candidate prompt is used to execute a task, the system updates the corresponding historical optimization metrics based on the task execution result. Another possible implementation of this specification involves treating each candidate prompt as a "multi-armed slot machine," using Bayesian statistical methods to model its potential optimization success rate. The system sets a prior distribution (such as a Beta distribution), and then continuously updates the parameters of the posterior distribution based on the cumulative number of successes and failures observed during the historical optimization process to obtain the historical optimization metrics for each candidate prompt.

[0039] In one optional embodiment of this specification, the above-mentioned historical optimization metrics for obtaining multiple candidate prompts may include the following steps: For the first candidate suggestion information, obtain the historical suggestion information of the first candidate suggestion information in the historical optimization process, wherein the historical suggestion information is obtained based on the optimization of the first candidate suggestion information, and the first candidate suggestion information is any one of multiple candidate suggestion information; The performance of historical prompts and first candidate prompts is evaluated separately to obtain the first evaluation index of historical prompts and the second evaluation index of first candidate prompts. Based on the first evaluation index and the second evaluation index, historical optimization indicators for the first candidate prompt information are generated.

[0040] It should be noted that historical prompts refer to new versions of prompts generated after optimization based on the first candidate prompt. For example, if the first candidate prompt is "Please translate this sentence," the optimized historical prompt would be "You are a professional translator, please translate the following sentence into idiomatic English."

[0041] During the performance evaluation of prompts, historical prompt information can provide a reference for comparing prompt performance. By comparing historical prompt information with the first candidate prompt information, it can be determined whether the optimization direction of the first candidate prompt information is correct or has led to performance degradation.

[0042] Evaluation metrics are specific levels or values ​​used to quantify the performance of prompt information tasks. The first evaluation metric corresponds to historical prompt information, and the second evaluation metric corresponds to the first candidate prompt information. By comparing the second and first evaluation metrics, it can be determined whether the first candidate prompt information can improve prompt performance. Evaluation metrics can be accuracy, F1 score, etc., calculated based on sample task data and sample task results, objectively reflecting the performance of prompt information on a specific task.

[0043] In practical applications, there are multiple ways to evaluate the prompting performance of historical prompts and first candidate prompts separately, and to obtain the first evaluation index for historical prompts and the second evaluation index for first candidate prompts. The specific method chosen depends on the actual situation, and this specification does not limit this approach. In one possible implementation, the same sample task data is processed based on both historical prompts and first candidate prompts, and then the outputs corresponding to these two prompts are compared with the sample task results to obtain the first and second evaluation indices. In another possible implementation, the output obtained from processing the same sample task data based on historical prompts and first candidate prompts, along with the same sample task data, is input into a more powerful referee model, which then outputs the first and second evaluation indices.

[0044] Furthermore, there are multiple ways to generate historical optimization indicators for the first candidate prompt information based on the first and second evaluation indicators. The specific method chosen depends on the actual situation, and this specification does not limit this approach. One possible implementation of this specification involves constructing a dynamic posterior distribution based on Bayesian inference. Specifically, the system first obtains the prior distribution information of the first candidate prompt information as a basic expectation. Then, by comparing the first and second evaluation indicators, it judges the actual effectiveness of the optimization process from the first candidate prompt information to historical prompt information, and determines the cumulative number of successes and failures of the first candidate prompt information accordingly. Finally, the cumulative number of successes and failures is combined with the prior distribution information to update and generate historical optimization indicators (i.e., posterior distribution parameters) that accurately reflect the potential optimization success rate and exploration potential of the first candidate prompt information, providing a mathematical basis for subsequent Thompson sampling. In another possible implementation of this specification, the success or failure of optimization can be determined directly by using the difference between the first evaluation index and the second evaluation index, without relying on prior distribution information, and the result can be converted into an incremental signal. Subsequently, the system obtains the dynamic decay coefficient accumulated by the first candidate prompt information in past iterations, and weights and fuses this incremental signal with the dynamic decay coefficient to generate a historical optimization index that can smoothly reflect the recent optimization trend while automatically fading outdated performance in the early stages.

[0045] By applying the scheme in the embodiments of this specification and combining historical prompt information to generate historical optimization indicators, it is possible not only to identify those "pseudo-optimal" prompts that are currently acceptable but have stagnated, thus avoiding wasting computing resources on invalid paths, but also to provide high-quality signals for subsequent sampling, ensuring that the system always evolves in the direction of performance improvement and avoiding wasting computing resources on inefficient prompts.

[0046] In one optional embodiment of this specification, the above-described performance evaluation of historical prompt information and first candidate prompt information to obtain a first evaluation index for historical prompt information and a second evaluation index for first candidate prompt information may include the following steps: The task processing model is invoked to process the sample task data based on historical prompt information to obtain the first sample prediction result. The task processing model is then invoked to process the sample task data based on the first candidate prompt information to obtain the second sample prediction result. Based on the sample task results and the first sample prediction results from the sample task data, a first evaluation index for historical prompt information is generated. Based on the sample task results and the second sample prediction results from the sample task data, a second evaluation index is generated for the first candidate prompt information.

[0047] It should be noted that the task processing model refers to the large language model or artificial intelligence inference engine that actually performs specific tasks. The task processing model itself does not participate in the optimization and evaluation of prompts. Instead, it is responsible for receiving sample task data and prompts (including historical prompts and candidate prompts), and based on its powerful semantic understanding and generation capabilities, outputting the corresponding sample prediction results (including the first sample prediction result and the second sample prediction result).

[0048] Sample task data refers to input data (such as a text to be translated, a math problem, or a set of notes to be evaluated) used to evaluate and test the performance of prompts. By using standardized sample task data, it is possible to fairly and objectively compare the performance differences of different prompts when handling the same task. Sample task results refer to the true and correct standard answers corresponding to the sample task data, serving as an objective basis for measuring the correctness of the output corresponding to the prompts.

[0049] The first sample prediction result refers to the actual output generated by the task processing model after inferring the sample task data under the guidance of historical prompts. The second sample prediction result refers to the actual output generated by the task processing model after inferring the sample task data under the guidance of the first candidate prompts.

[0050] In practical applications, there are multiple ways to generate the first evaluation index for historical prompt information based on the sample task results and the first sample prediction results of the sample task data. The specific method chosen depends on the actual situation, and this specification does not impose any limitations on this approach. In one possible implementation, the first sample prediction result and the sample task result can be converted into high-dimensional vectors, and then the distance between the two high-dimensional vectors in the semantic space can be calculated to obtain the first evaluation index. In another possible implementation, the sample task result and the first sample prediction result, along with the sample task data, can be input into the referee model, and the referee model can output the first evaluation index. The implementation of "generating the second evaluation index for the first candidate prompt information based on the sample task results and the second sample prediction results of the sample task data" is the same as "generating the first evaluation index for historical prompt information based on the sample task results and the first sample prediction results of the sample task data," and will not be described again in this specification.

[0051] By applying the solutions in the embodiments of this specification, and by introducing sample task data with sample task results, the judgment of the quality of prompt information is transformed from subjective judgment to objective data proof. This allows for the accurate extraction of the performance fluctuations caused by the prompt information itself, providing real, reliable, and traceable data support for subsequent optimization iterations.

[0052] In one optional embodiment of this specification, the historical optimization metrics for generating the first candidate prompt information based on the first evaluation metric and the second evaluation metric may include the following steps: Obtain the prior distribution information of the first candidate prompt; Based on the first evaluation indicator and the second evaluation indicator, the cumulative number of successful and cumulative number of failed attempts for the first candidate prompt message are determined. Based on prior distribution information, cumulative success count, and cumulative failure count, historical optimization metrics for generating the first candidate prompt information are generated.

[0053] It should be noted that the prior distribution information of the first candidate suggestion refers to an initial estimate or basic probability distribution of the success rate of optimizing the first candidate suggestion based on past experience or default settings, before obtaining the second evaluation index of the first candidate suggestion. This prior distribution information can be understood as the "initial impression score" or "base score" of the first candidate suggestion, providing a mathematical starting point for evaluation. This ensures that even with limited data (cold start), the system can still provide a relatively reasonable historical optimization index based on the prior distribution information, avoiding the complete rejection or affirmation of a candidate suggestion due to a single accidental performance. In Bayesian statistics (such as Thompson sampling), the prior distribution information is usually represented by two parameters (α and β) of the Beta distribution, for example, α=2, β=1.

[0054] The cumulative success count and cumulative failure count refer to the total number of times the first candidate prompt message "wins" and "loses" based on the comparison results of the first and second evaluation indicators, accumulated over a long period of iteration. The determination of the cumulative success count and cumulative failure count is a dynamically updated process. During the optimization process, the system compares the first and second evaluation indicators. If the first evaluation indicator is higher than the second evaluation indicator, the optimization of the first candidate prompt message is determined to be "successful," and the cumulative success count is incremented by 1; otherwise, the optimization of the first candidate prompt message is determined to be "failed," and the cumulative failure count is incremented by 1.

[0055] Historical optimization metrics are quantitative indicators (usually represented by a posterior probability distribution) that reflect the success rate of optimizing the first candidate suggestion information. These metrics are generated by combining prior distribution information with the cumulative number of successes and failures. The system can randomly sample a value based on the historical optimization metrics, thus accommodating both candidate suggestions with high historical optimization metrics and those with potential but fewer attempts.

[0056] For example, each candidate suggestion can be considered as one arm of a multi-armed slot machine, and its potential optimization success rate is denoted as . Assuming the first candidate suggestion information... An optimization rewrite generated historical notification information. .like If successful, it is recorded as a successful exploration; otherwise, it is recorded as a failure. Obtain the first candidate hint information. The cumulative number of successes throughout the entire historical optimization process and cumulative number of failures Among them, the cumulative number of successful times The larger the value, the more likely it is to be the first candidate suggestion. The greater the potential for development; the more failures accumulated. The larger the value, the more likely it is to be the first candidate suggestion. It may have already gotten stuck in a local optimum or is a stubborn clue; the more you continue mining, the lower the cost-effectiveness. Let the prior distribution information be... ,in To assign higher initial expectations to unexplored candidate suggestions. Based on the cumulative number of successes. and cumulative number of failures Construct the posterior distribution As the first candidate prompt information The historical optimization metric, where the historical optimization metric represents the performance of the first candidate suggestion information when it is known. Success The second attempt failed. Under the premise of this, the first candidate prompt information The true success rate How much? By abstracting the iterative optimization process of discrete candidate hints into a Bernoulli trial and continuously tracking the posterior success rate of each candidate hint using a Beta distribution, excellent automatic suggestion optimization efficiency can be achieved in sparse feedback environments. With the number of failures... The addition of the first candidate prompt information The posterior mean automatically decays monotonically, thus achieving "fast-failing" of "stubborn" candidate suggestions that have a decent current score but cannot be substantially improved by multiple optimizations. This process does not require manually setting thresholds, greatly saving the cost and computing power of calling the black-box large model API.

[0057] By applying the solutions in the embodiments of this specification, and by maintaining the cumulative number of successes and failures and updating the prior distribution information, the system can not only accurately filter out candidate prompts that have performed well over the long term, but also effectively smooth out evaluation fluctuations caused by data noise or chance. It is particularly suitable for automatic prompt optimization scenarios that require continuous trial and error and exploration, ensuring the long-term stability and scientific nature of the optimization direction.

[0058] Step 104: Sampling is performed based on historical optimization metrics to obtain sampling metrics for multiple candidate hints. The sampling metrics are used to reflect the exploration potential of the candidate hints.

[0059] It's important to note that the sampling metric refers to an instantaneous value generated by the system using a sampling algorithm based on historical optimization metrics. The process of adopting a suggestion based on historical optimization metrics can be understood as giving each candidate suggestion a chance to "draw a lottery." Even if a candidate suggestion has a high historical optimization metric, the sampled metric might be low; conversely, a candidate suggestion with a low historical optimization metric has a chance to draw a high adoption metric. By introducing the sampling metric, randomness is achieved, preventing the system from prematurely focusing only on currently performing candidate suggestions (getting stuck in local optima), thus giving those with potential but fewer attempts a chance to stand out. For example, the system samples the historical optimization metric of the first candidate suggestion (Beta(9,3)) and obtains a sampling metric of 0.75; it samples the historical optimization metric of the second candidate suggestion (Beta(2,2)) and obtains a sampling metric of 0.82.

[0060] In practical applications, there are various methods for sampling multiple candidate hints based on historical optimization metrics. The specific method chosen depends on the actual situation, and this specification does not limit this approach. One possible implementation in this specification is based on Thompson's sampling method, using the historical optimization metrics of each candidate hint as a probability model, and randomly selecting a value as the sampling metric for that candidate hint. For example, a candidate hint with a historical optimization metric of 70% might have a randomly selected sampling metric of 0.75 this time and 0.68 next time. This method ensures that candidate hints with good historical performance (right-leaning posterior distribution) are selected with a high probability, while also giving candidate hints with limited historical data and high uncertainty (flat posterior distribution) a chance to occasionally receive high scores, achieving a balance between exploration and utilization. Another possible implementation in this specification is based on the Upper Confidence Bound (UCB) sampling method, calculating the sampling metric using a formula based on the distribution characteristics of the historical optimization metrics. For example, the calculation logic could be: Sampling metric = Historical optimization metric + Exploration coefficient × Uncertainty (standard deviation). This means that candidate suggestions receive a high sampling metric either because of their "high historical optimization metrics" or because of their "few attempts and unknown potential." This approach ensures that the system proactively tests candidate suggestions that are underestimated or poorly understood.

[0061] Step 106: Based on the prompting indicators and sampling indicators of multiple candidate prompting information, generate utility indicators for multiple candidate prompting information respectively. The prompting indicators are used to reflect the difficulty sample solving ability of the candidate prompting information.

[0062] It should be noted that the hint metric is a quantitative indicator used to measure the performance of each candidate hint in handling difficult, complex, or boundary-point samples. Since ordinary accuracy may mask the inadequacy of candidate hints on difficult samples, this embodiment uses a hint metric to compensate for the shortcomings of simply focusing on historical optimization metrics. This takes into account the "problem-solving capability" of each candidate hint, ensuring that the final selected target hint can not only handle simple problems but also solve challenging complex ones. If a candidate hint can correctly solve a difficult problem that most models answer incorrectly, then its hint metric will be very high.

[0063] The utility index is a comprehensive score used for final decision-making, derived by weighting or fusing "sampling index" (representing the exploration potential of candidate hints) and "hint index" (representing the problem-solving ability of candidate hints) through a specific algorithm. The utility index considers both the exploration opportunities brought by sampling and the hard power of hints in solving difficult problems, ensuring that the target hints determined based on the utility index have a very high comprehensive value at the current stage.

[0064] In practical applications, there are various ways to generate utility indices for multiple candidate prompts based on their prompting and sampling indices. The specific method chosen depends on the actual situation, and this specification does not impose any limitations on this approach. One possible implementation of this specification is to assign a weighting coefficient (e.g., a weight sum of 1) to both the sampling and prompting indices, and then sum them using weighted averages to obtain the utility index. Another possible implementation of this specification is to apply a temperature hyperparameter to each candidate prompt. The utility index of each candidate prompt is calculated by nonlinear transformation.

[0065] For example, the utility index can be calculated using the following formula (1) to illustrate the application of a nonlinear transformation method that includes temperature hyperparameters: (1) in, Indicates the first candidate suggestion information Utility indicators. Indicates the first candidate suggestion information The indicator is a prompt. Indicates the first candidate suggestion information Sampling metrics. This represents the temperature hyperparameter and can be used as an adjustment knob to control the "greedyness" of the utility index calculation algorithm. When At very low (low temperature) times, The difference will be amplified dramatically, making the algorithm "snobbish" and inclined to select candidate prompts with extremely high prompt metrics. When At very high (high temperature) times, The curve will flatten out, making the algorithm more "lenient" and giving candidate suggestions with lower suggestions more opportunities (to explore). If the first candidate suggestion... If the prompt indicator is large, and the sampling indicator is also large, then its utility indicator will increase explosively; if the first candidate prompt information If the prompt indicator is small and the adoption indicator is also small, then its utility indicator will approach 0, and it will almost never be identified as a target prompt information.

[0066] It is worth noting that a nonlinear transformation method incorporating temperature hyperparameters was applied to construct a joint discrimination mechanism for the current performance and potential optimizability of candidate suggestions. By introducing temperature hyperparameters into the joint discrimination formula to dynamically adjust the balance between development and exploration, the one-sidedness of traditional single-dimensional evaluation is effectively overcome. This mechanism can not only accurately identify candidate suggestions with high but already limited performance to avoid wasting resources, but also effectively filter out inferior candidate suggestions with high theoretical potential but poor actual performance, preventing blind exploration. This ensures that the computational budget for automatic suggestion optimization can be accurately allocated to high-quality targets that possess both current competitiveness and future improvement potential, significantly improving the overall efficiency and success rate of suggestion iterative optimization.

[0067] Step 108: Determine the target prompt from multiple candidate prompts based on the utility index.

[0068] It's important to note that the target suggestion information is the candidate suggestion information that the system determines has very high overall utility during the current optimization process and selects. The target suggestion information is neither simply based on high historical optimization metrics, nor on luck in drawing a high-sampled metric. Rather, it is the candidate suggestion information that, after joint evaluation, is considered to have achieved a balance between "current development and utilization value" and "exploration potential." The target suggestion information can serve as a benchmark for the next round of iteration optimization or be directly deployed to the production environment.

[0069] In practical applications, there are multiple ways to determine the target prompt information from multiple candidate prompt information based on utility indicators. The specific method chosen depends on the actual situation, and this specification does not impose any limitations on this approach. One possible implementation of this specification involves iterating through all candidate prompt information, comparing their respective utility indicators, and determining the candidate prompt information with the highest utility indicator as the target prompt information. Another possible implementation of this specification involves randomly selecting the target prompt information from candidate prompt information whose utility indicator is greater than a preset utility indicator threshold.

[0070] For example, the target prompt information can be determined by the following formula (2): (2) in, This indicates a target prompt message. This indicates multiple candidate suggestions.

[0071] The scheme implemented in this specification introduces a historical optimization index scoring mechanism based on verification difficulty weights and a posterior potential evaluation mechanism based on sampling. This allows for the joint modeling of the "current development and utilization value" and "exploration potential" of candidate suggestion information, thereby achieving a dynamic and reasonable allocation of computational resources between automatic suggestion optimization steps. This improves the overall convergence efficiency and final suggestion performance of automatic suggestion optimization.

[0072] In one optional embodiment of this specification, generating utility metrics for multiple candidate prompts based on prompt metrics and sampling metrics may include the following steps: Based on the prompting indicators of multiple candidate prompts, the target candidate prompt is selected from the multiple candidate prompts; Based on the prompting indicators and sampling indicators of the target candidate prompting information, utility indicators of the target candidate prompting information are generated respectively. Determining the target prompt from multiple candidate prompts based on utility metrics may include the following steps: The target prompt information is determined from the target candidate prompt information based on the utility index of the target candidate prompt information.

[0073] It should be noted that the target candidate suggestion information refers to the subset of candidate suggestions that successfully made it into the shortlist after filtering all candidate suggestions based on suggestion indicators. The suggestion indicator of the target candidate suggestion information is greater than the suggestion indicator of all other candidate suggestions among the multiple candidate suggestions.

[0074] For example, multiple candidate prompts can be sorted according to their prompt indicators from largest to smallest or from highest to lowest, and the top k candidate prompts can be determined as target candidate prompts, where k is a positive integer.

[0075] By applying the solutions in the embodiments of this specification, and through pre-screening of prompt indicators, inferior candidate prompt information that has high sampling indicators but poor actual ability to solve difficult samples can be eliminated in advance, thus avoiding these inferior candidate prompt information from wasting computing resources or interfering with the final decision in subsequent stages.

[0076] In practical applications, there are multiple ways to obtain the prompt indicators for each candidate prompt information. The specific method should be selected according to the actual situation, and this specification does not limit the specific methods used in this embodiment. In one possible implementation, a verification set containing multiple verification task data with verification task results can be obtained. Then, for the first candidate prompt information, a task processing model is invoked to process each verification task data in the verification set one by one, obtaining multiple first verification prediction results corresponding to each verification task data. Next, by comparing these first verification prediction results with the actual verification task results, the initial prompt indicators for the first candidate prompt information on each verification task data are determined. Finally, these initial prompt indicators are weighted and fused based on the preset verification difficulty weights of each verification task data, thereby generating prompt indicators that accurately reflect the comprehensive performance (especially problem-solving ability) of the first candidate prompt information on tasks of varying difficulty. In another possible implementation, a difficult error set (usually cases that previous model versions easily failed to handle) can be directly established to collect samples of high-difficulty, error-prone, or long-tail scenarios. The task processing model is invoked to process all samples in the difficult error question set based on the first candidate prompt information. The processing result of each sample is "binary judgment" (i.e., successful solution is recorded as 1, and failure is recorded as 0). Finally, the overall success rate of the first candidate prompt information on the entire difficult error question set is calculated. This overall success rate can be directly used as the prompt indicator of the first candidate prompt information, which can intuitively reflect the actual ability of the first candidate prompt information to tackle real task pain points and high-difficulty challenges.

[0077] In one optional embodiment of this specification, before generating the utility index of multiple candidate prompts based on the prompt index and sampling index of multiple candidate prompts, the following step may be included: Obtain the verification set, which includes multiple verification task data, and the verification task data carries the verification task results; For the first candidate prompt information, the task processing model is invoked. Based on the first candidate prompt information, multiple verification task data are processed to obtain multiple first verification prediction results. The first candidate prompt information is any one of the multiple candidate prompt information, and the first verification prediction results correspond one-to-one with the verification task data. Based on the first verification prediction results and the verification task results, multiple initial prompt indicators for the first candidate prompt information are determined, wherein each initial prompt indicator corresponds one-to-one with the verification task data. Based on the verification difficulty weights of multiple initial prompt indicators and multiple verification task data, the prompt indicators for the first candidate prompt information are generated.

[0078] It should be noted that the validation set refers to a pre-constructed dataset containing multiple validation task data sets with standard answers. The validation task result refers to the true and correct standard answer corresponding to the validation task data.

[0079] The first validation prediction result refers to the actual output of the task processing model after processing a specific validation task data under the guidance of the first candidate prompt information. Multiple first validation prediction results can reflect the true performance of the first candidate prompt information in the actual task.

[0080] The initial suggestion metric refers to the score or matching degree of a single task dimension obtained by comparing the first verification prediction result with the verification task result one by one. It reflects whether the first candidate suggestion information is successful on a specific, fine-grained verification task data.

[0081] The verification difficulty weight is a numerical coefficient pre-assigned to each verification task data point, representing the processing difficulty of that data. For example, a simple question might have a verification difficulty weight of only 0.5, while a logically complex and error-prone "final question" might have a verification difficulty weight as high as 2.0. The verification difficulty weight can play a regulatory role in the calculation of the hint indicator, ensuring that the results achieved by the first candidate hint information in solving difficult samples receive higher recognition than in solving simple samples, thus guiding optimization towards tackling more challenging problems.

[0082] The prompt index refers to the final quantitative score that reflects the overall ability to tackle the first candidate prompt information by combining the initial prompt index of all verification task data and their corresponding verification difficulty weights through weighted calculation.

[0083] In practical applications, the implementation method of "determining multiple initial prompt indicators for the first candidate prompt information based on the first verification prediction result and the verification task result" can refer to the implementation method of "generating the first evaluation indicator for historical prompt information based on the sample task result of the sample task data and the first sample prediction result" described above. The embodiments in this specification will not be repeated here.

[0084] Furthermore, there are multiple ways to obtain the verification difficulty weights for each verification task data, and the specific method should be selected according to the actual situation. This specification does not impose any limitations on this method in the embodiments. In one possible implementation of this specification, any verification task data (i.e., the first verification task data) can be selected, and the task processing model can be called to process the same question based on all candidate prompts, thereby obtaining a set of corresponding prediction results (i.e., the second verification prediction results). Subsequently, by comparing these second verification prediction results with the verification task results of the first verification task data, the overall pass rate or average score of the candidate prompts on the first verification task data can be calculated. If most candidate prompts can be answered correctly, it means that the first verification task data is very simple, and the calculated verification difficulty weight will be low; conversely, if the vast majority of candidate prompts are answered incorrectly, it means that the first verification task data is extremely challenging, and the system will assign it a higher verification difficulty weight. In another possible implementation of this specification, a series of objective indicators that can reflect the complexity of the task (such as the length of the text, the number of logical conditions contained, the density of professional terms involved, or the number of layers of calculation steps, etc.) can be predefined, and corresponding weighting coefficients can be set for each objective indicator. Next, the system can extract the feature values ​​of a single verification task data based on these objective indicators, and calculate the complexity score as the verification difficulty weight through linear weighting or a complexity scoring function.

[0085] By introducing verification difficulty weights, the solution implemented in this specification makes the generation process of prompt indicators more closely resemble the demand for "complex problem-solving capabilities" in real-world task scenarios. This allows for the accurate selection of high-quality prompts that truly possess strong problem-solving abilities, preventing the system from being misled by the inflated accuracy of a large number of simple samples. Consequently, the optimization of automatic prompts is always moving towards higher-order reasoning and problem-solving capabilities.

[0086] In one optional embodiment of this specification, before generating the first candidate prompt information based on multiple initial prompt indicators and the verification difficulty weights of multiple verification task data, the following steps may be included: For the first verification task data, the task processing model is invoked to process the first verification task data based on multiple candidate prompts to obtain multiple second verification prediction results. The first verification task data is any one of the multiple verification task data, and the second verification prediction results correspond one-to-one with the candidate prompts. Based on the results of multiple second verification predictions and the verification task results of the first verification task data, the verification difficulty weight of the first verification task data is determined.

[0087] It should be noted that the second verification prediction result refers to the set of multiple corresponding prediction results output by the task processing model after processing the same first verification task data under the guidance of multiple different candidate prompts. For example, if the system calls four candidate prompts to answer a logic problem and obtains four answers, these four answers together constitute multiple second verification prediction results for that logic problem.

[0088] For example, in the current iteration step, obtain the contents Candidate pool of candidate prompts and validation set The verification set includes a total of For the verification task data and verification task results, This represents the data for the i-th verification task. This represents the verification result of the i-th verification task data. The task processing model is invoked to perform inference on the verification set, and the first candidate prompt information is defined. With the data of the i-th verification task Correctness indicator When the task processing model is based on the first candidate prompt information For the i-th verification task data The output of the second validation prediction result is compared with the true label. A value of 1 indicates a match, otherwise 0. Statistics show that data correctly answered in the i-th validation task is processed. The total number of candidate prompts The i-th verification task data is calculated using the following formula (3), formula (4), or formula (5). Verification difficulty weight In this way, verification task data that can be resolved by a very small number of candidate hints can be given an exponentially amplified verification difficulty weight.

[0089] (3) (4) (5) in, This indicates the focusing hyperparameter. ; Indicates the adjustment parameter. ; This indicates temperature hyperparameters. .

[0090] For each candidate suggestion, its suggestion index is calculated using the following formula (6). : (6) In one optional embodiment of this specification, prompt indicators can be used directly. Calculate utility indicators, and also provide prompt indicators. Perform min-max normalization to obtain the normalized cue index. And a minimal constant is introduced at the denominator. To prevent division by zero overflow, use normalized indicator prompts. Calculate utility indicators.

[0091] The solution implemented in this specification abandons the traditional average accuracy evaluation method. By statistically analyzing the proportion of candidate hints in the candidate pool that solve specific samples, and dynamically allocating verification difficulty weights, the optimization process is effectively prevented from being constrained by candidate hints that "can only solve trivial / simple problems". This forces the system to focus on difficult samples that can reflect true generalization ability (such as boundary terms that are easily confused in search relevance determination), thereby improving the quality of target hints.

[0092] In content search tasks on social media platforms, a core challenge is how to accurately filter out truly "useful" and "authentic" content from massive amounts of notes to continuously improve the user's search experience. To address this, a large-scale model can be introduced to evaluate and score the quality of notes. The score obtained from the quality evaluation can serve as a core feature, directly inputting into the downstream search ranking model. In other words, the higher the quality score determined by the large-scale model, the higher the note will rank in the search results. The goal of the search ranking model is to ensure that users see as much authentic and valuable content as possible. However, because the semantic boundaries of "usefulness" and "authenticity" in notes are very vague and highly subjective, the design of prompts for handling such tasks by the large-scale model is extremely sensitive. Even a slight deviation can lead to drastically different evaluation results. Therefore, the prompt determination method proposed in the embodiments of this specification can be applied to the automated prompt optimization in this scenario to ensure the quality of the prompts from the large-scale model.

[0093] See Figure 2 , Figure 2This diagram illustrates the processing steps of a prompt information determination method according to an embodiment of this specification. Taking a content search task scenario on a social platform as an example, the system needs to accurately identify the deep content features of massive amounts of notes (such as determining whether a note "has a commercial orientation," "is shared by a real user," and "has high usefulness / content"). These fine-grained identification results will be input as core features to the downstream search engine to adjust the final search result ranking. For this task scenario, the specific application process of the prompt information determination method proposed in this invention includes the following three stages: In the "Note Feature Recognition" stage, a weighted scoring phase based on verification difficulty weights is applied: For a specific task (such as "Note Authenticity Judgment Task"), the system currently maintains a candidate pool containing multiple candidate prompts. These candidate prompts are applied to real note verification sets for inference testing. A single note sample in this verification set is a multimodal aggregate, fully containing: note title, body text, image (visual features or OCR text), video (keyframe parsing clips), and a list of user comments. When evaluating the performance of the candidate prompts, the system can dynamically calculate the verification difficulty weight for each note sample. For example, a low-quality advertorial with a title containing an explicit purchase link and promotional language throughout the body can be accurately identified as "not a genuine share" by the vast majority of candidate prompts. Therefore, the verification difficulty weight of this note sample is low. Extremely low. For example, a well-disguised high-end PR product recommendation note might resemble a genuine personal review. In practice, only through comprehensive cross-analysis of fleeting commercial logos in the video's keyframes and the highly homogenized comment control and referral tactics in the comments section can the note be identified as a fake post. Only a very small number of logically sound candidate prompts can correctly identify such note samples; therefore, the system assigns this note sample an extremely high verification difficulty weight. This enables candidate suggestions that can overcome the challenge of judging such complex multimodal features to achieve extremely high suggestion metrics. This ensures that the optimization direction of the prompts is not swayed by simple, mediocre note samples.

[0094] The modeling phase of Thompson sampling for optimizing the "note feature recognition" prompts: During the continuous iteration of prompts for the "note usefulness judgment task" or "note business orientation judgment task," the system can track the historical performance of each candidate prompt after it has been rewritten by the large model. For example, a prompt for a certain "note business orientation judgment task" currently scores reasonably well, its logic mainly being "statistical analysis of the number of images and the frequency of specific praise words in the text." However, the system finds in its historical trajectory that whenever the large model attempts to rewrite this prompt (e.g., trying to further analyze the "coherence between image and video content" to improve accuracy), the score of the rewritten prompt always decreases on the note validation set due to the inherent structural limitations of this prompt. At this point, the cumulative number of failures for this prompt is recorded. High. The sampling index of posterior sampling was obtained through Thompson sampling. The performance will be significantly reduced. The system can accurately identify these "stubborn" prompts that are stuck in local optima, execute them quickly, and stop wasting computing power on large model inference.

[0095] The targeted selection phase of the "note feature recognition" prompt message evolution seed: In each round of prompt message optimization iteration, the system can combine the prompt indicators obtained in the first stage. and the sampling indicators obtained in the second phase Calculate the utility index for each candidate suggestion. The system can ultimately select the candidate suggestion with the highest utility index from the candidate pool as the "target" for this round. This selected candidate suggestion can accurately identify complex long-tail notes containing titles, body text, images, videos, and comments, and also has extremely high potential for further improvement by large-scale model rewriting. Furthermore, this selected candidate suggestion can be fed into the underlying automatic suggestion optimization pipeline for next-generation evolution, thereby continuously providing the search engine with efficient and accurate note feature extraction instructions.

[0096] It is worth noting that, on the one hand, the prompt information determination scheme proposed in the embodiments of this specification adopts a "note sample verification difficulty weighting" mechanism. In the traditional evaluation process, some mediocre prompt information receives inflated scores because it can easily identify those "extremely crude" or "extremely high-quality" simple samples. However, the "note sample verification difficulty weighting" mechanism can effectively prevent the optimization trajectory from being constrained by these simple samples, thereby forcing the system to focus on those long-tail, highly deceptive difficult samples (such as low-quality articles disguised as valuable information, or hardcore experience posts with rough layout but extremely authentic content). Only prompt information that can still make correct judgments in these complex scenarios can obtain higher prompt scores, which greatly enhances the generalization ability of prompt information in real task scenarios.

[0097] On the other hand, facing the vast space for rewriting prompt information, the embodiments in this specification also propose a "Thompson sampling" mechanism. During the automated prompt information optimization process, the system can dynamically evaluate the historical potential of each optimization direction. For those "stubborn" prompts whose indicators are acceptable but have fallen into local optima, and whose accuracy cannot be improved no matter how many times they are modified, the system can decisively implement a fast-fail strategy to directly eliminate them. This ensures that the expensive computational power of large-scale model inference can be accurately invested in prompts that truly have the potential to improve quality recognition recall. Through this efficient screening and iteration, the system can continuously deliver very high-quality note feature extraction instructions to the underlying search and ranking model.

[0098] See Figure 3 , Figure 3 A flowchart of a prompt message optimization method according to an embodiment of this specification is shown, specifically including the following steps 302 to 304: Step 302: Obtain target prompt information, wherein the target prompt information is determined based on the prompt information determination method.

[0099] Step 304: Call the information optimization model to optimize the target prompt information and obtain the target optimized prompt information.

[0100] It's important to note that an information optimization model (IMM) refers to an algorithmic model (typically a large language model or a specialized prompt fine-tuning model) used to rewrite, refine, expand, or reconstruct prompt information. The IIM receives target prompt information as input and considers how to optimize it (e.g., semantic enhancement or structural reorganization). This can make the target prompt information clearer, more logically rigorous, and better stimulate the potential of the task processing model, thereby unlocking the capabilities of the target prompt information. For example, an IIM could be a fine-tuned LLM that, upon receiving target prompt information, automatically rewrites the vague instruction "Please analyze carefully" into a specific thought chain instruction: "Please analyze in three steps: first extract entities, second deduce relationships, and finally draw conclusions."

[0101] Target-optimized hints refer to the final version generated after processing by the information optimization model, which is expected to outperform the target hints. Target-optimized hints retain the core intent of the target hints but have been significantly improved in terms of expression techniques, constraints, or guidance strategies, and can serve as high-quality hints for final deployment or the next round of validation.

[0102] The solution implemented in this specification, which determines the target prompt information based on the prompt information determination method, has high accuracy, high generalization ability, and large evolution space. Therefore, by optimizing the target prompt information, the waste of resources on low-quality or invalid prompt information is avoided, thereby obtaining high gains in model performance with very low computational cost.

[0103] It is worth noting that the prompt information optimization scheme proposed in the embodiments of this specification (hereinafter referred to as "this scheme") can be used as the underlying core framework in the large model-related task support system and applied in the field of automated APO, aiming to solve the problems of low efficiency and weak generalization ability of prompt information design in complex task scenarios. For example, in large-scale model-based tasks involving understanding text, images, and video notes, this solution can automatically search for and generate prompts that accurately capture cross-modal semantic relationships (such as the matching degree between keyframes in the video and text summaries), thereby significantly improving the accuracy of content structure parsing and tagging. In search ranking relevance determination tasks, when faced with ambiguous or polysemous user search intentions, this solution can iteratively optimize prompts with deep semantic understanding capabilities, helping large-scale models accurately identify and rank high-quality content that best meets users' actual needs from a vast amount of candidate content. In platform content quality assessment tasks, this solution can automatically mine highly robust prompts that effectively determine the authenticity and compliance of content for diverse content formats (such as identifying clickbait or misleading text and video content), thereby systematically improving the performance and decision-making quality of large-scale models in various vertical tasks with minimal human intervention.

[0104] See Figure 4 , Figure 4 A flowchart of a task processing method provided in one embodiment of this specification is shown, specifically including the following steps 402 to 404: Step 402: Obtain the target task data and target optimization hint information for the target task, wherein the target optimization hint information is obtained based on the hint information optimization method.

[0105] Step 404: Invoke the task processing model, process the target task data based on the target optimization prompt information, and obtain the target task result.

[0106] It should be noted that target task data refers to user input or raw information that needs to be analyzed and processed by the task processing model during the actual task execution phase.

[0107] The target task result refers to the final output generated by the task processing model based on the target task data, driven by the target optimization prompts.

[0108] By applying the solutions in the embodiments of this specification, the task processing model can avoid common logical pitfalls and comprehension biases when faced with complex target task data, thanks to the use of deeply optimized target optimization prompts. This not only significantly improves the accuracy and usability of the target task results but also reduces the need for repeated trial and error in the task processing model, thereby improving the stability and professionalism of the task processing process.

[0109] See Figure 5 , Figure 5 The flowchart of a task processing method according to an embodiment of this specification is shown. During the task processing, the server and the client interact with each other. The client is used to send multiple candidate prompts to the server. On the server side, historical optimization metrics are obtained for multiple candidate prompts, reflecting their task execution during the historical optimization process. Based on these historical metrics, sampling metrics are obtained for each candidate prompt, reflecting their exploration potential. Utility metrics are generated for each candidate prompt based on their prompt and sampling metrics, reflecting their ability to solve difficult samples. The target prompt is determined from the candidate prompts based on these utility metrics. Finally, an information optimization model is invoked to optimize the target prompt, resulting in the optimized target prompt. The client is also used to send target task data to the server. The server-side is also used to call the task processing model, process the target task data based on the target optimization prompts, and obtain the target task results.

[0110] In practical applications, considering the large number of model parameters in the information optimization model and task processing model, and the limited computing resources of the client, the prompt information optimization method and task processing method proposed in the embodiments of this specification can be executed by the server. The task processing model and information optimization model are deployed on the server, which can connect to one or more clients via a local area network (LAN), wide area network (WAN), internet connection, or other types of data network. Clients can include, but are not limited to, smartphones, tablets, laptops, PDAs, personal computers (PCs), smart home devices, and in-vehicle devices. Clients can also interact with users through a graphical user interface to invoke the information optimization model and task processing model, thereby implementing the prompt information optimization method and task processing method provided in the embodiments of this specification.

[0111] It is worth noting that the prompt information optimization method and task processing method provided in the embodiments of this specification are generally executed by the server. However, in other embodiments of this specification, if the client's runtime resources can meet the deployment and runtime conditions of the information optimization model and task processing model, the client can also have similar functions to the server, thereby executing the prompt information optimization method and task processing method provided in the embodiments of this specification. In other embodiments, the prompt information optimization method and task processing method provided in the embodiments of this specification can also be jointly executed by the client and the server.

[0112] Corresponding to the above-described embodiments of the method for determining prompt information, this specification also provides embodiments of the device for determining prompt information. Figure 6 A schematic diagram of a prompting information determining device according to one embodiment of this specification is shown. Figure 6 As shown, the device includes: The first acquisition module 602 is configured to acquire historical optimization indicators of multiple candidate prompts, wherein the historical optimization indicators are used to reflect the task execution status of the candidate prompts during the historical optimization process; The sampling module 604 is configured to sample based on historical optimization indicators to obtain sampling indicators for multiple candidate prompts, wherein the sampling indicators are used to reflect the exploration potential of the candidate prompts. The generation module 606 is configured to generate utility metrics for multiple candidate prompts based on prompt metrics and sampling metrics for multiple candidate prompts, wherein the prompt metrics are used to reflect the difficulty sample solving ability of the candidate prompts; The first determining module 608 is configured to determine the target prompt information from multiple candidate prompt information based on a utility index.

[0113] Optionally, the first acquisition module 602 is further configured to acquire historical prompt information of the first candidate prompt information during the historical optimization process, wherein the historical prompt information is obtained based on the optimization of the first candidate prompt information, and the first candidate prompt information is any one of multiple candidate prompt information; to perform prompt performance evaluation on the historical prompt information and the first candidate prompt information respectively, and to obtain a first evaluation index of the historical prompt information and a second evaluation index of the first candidate prompt information; and to generate historical optimization index of the first candidate prompt information based on the first evaluation index and the second evaluation index.

[0114] Optionally, the first acquisition module 602 is further configured to invoke a task processing model to process the sample task data based on historical prompt information to obtain a first sample prediction result, and invoke the task processing model to process the sample task data based on the first candidate prompt information to obtain a second sample prediction result; generate a first evaluation index for historical prompt information based on the sample task results and the first sample prediction result; and generate a second evaluation index for the first candidate prompt information based on the sample task results and the second sample prediction result.

[0115] Optionally, the first acquisition module 602 is further configured to acquire prior distribution information of the first candidate prompt information; determine the cumulative number of successes and cumulative number of failures of the first candidate prompt information based on the first evaluation index and the second evaluation index; and generate historical optimization indexes of the first candidate prompt information based on the prior distribution information, the cumulative number of successes and the cumulative number of failures.

[0116] Optionally, the generation module 606 is further configured to filter out target candidate prompt information from multiple candidate prompt information based on prompt indicators of multiple candidate prompt information; and generate utility indicators of target candidate prompt information based on prompt indicators and sampling indicators of target candidate prompt information respectively; the first determination module 608 is further configured to determine target prompt information from target candidate prompt information based on utility indicators of target candidate prompt information.

[0117] Optionally, the device further includes: a fourth acquisition module configured to acquire a verification set, wherein the verification set includes multiple verification task data, and the verification task data carries verification task results; for the first candidate prompt information, a task processing model is invoked to process the multiple verification task data based on the first candidate prompt information to obtain multiple first verification prediction results, wherein the first candidate prompt information is any one of the multiple candidate prompt information, and the first verification prediction results correspond one-to-one with the verification task data; based on the first verification prediction results and the verification task results, multiple initial prompt indicators for the first candidate prompt information are determined, wherein the initial prompt indicators correspond one-to-one with the verification task data; and based on the multiple initial prompt indicators and the verification difficulty weights of the multiple verification task data, a utility indicator for the first candidate prompt information is generated.

[0118] Optionally, the device further includes: a second determining module, configured to, for the first verification task data, invoke a task processing model to process the first verification task data based on multiple candidate prompts to obtain multiple second verification prediction results, wherein the first verification task data is any one of the multiple verification task data, and the second verification prediction results correspond one-to-one with the candidate prompts; and determine the verification difficulty weight of the first verification task data based on the multiple second verification prediction results and the verification task results of the first verification task data.

[0119] By applying the solutions in the embodiments of this specification, and by generating utility metrics based on prompting metrics and sampling metrics, target prompting information that combines high accuracy, high generalization ability, and high evolutionary space can be accurately located, thereby significantly improving the efficiency of prompting information optimization.

[0120] The above is a schematic scheme of a prompt information determining device according to this embodiment. It should be noted that the technical solution of this prompt information determining device and the technical solution of the prompt information determining method described above belong to the same concept. For details not described in detail in the technical solution of the prompt information determining device, please refer to the description of the technical solution of the prompt information determining method described above.

[0121] Corresponding to the above-described embodiments of the prompt information optimization method, this specification also provides embodiments of the prompt information optimization device. Figure 7 A schematic diagram of a prompt information optimization device according to one embodiment of this specification is shown. Figure 7 As shown, the device includes: The second acquisition module 702 is configured to acquire target prompt information, wherein the target prompt information is determined based on the prompt information determination method. The optimization module 704 is configured to call the information optimization model to optimize the target prompt information and obtain the target optimized prompt information.

[0122] The solution implemented in this specification, which determines the target prompt information based on the prompt information determination method, has high accuracy, high generalization ability, and large evolution space. Therefore, by optimizing the target prompt information, the waste of resources on low-quality or invalid prompt information is avoided, thereby obtaining high gains in model performance with very low computational cost.

[0123] The above is an illustrative scheme of a prompt information optimization device according to this embodiment. It should be noted that the technical solution of this prompt information optimization device and the technical solution of the above-described prompt information optimization method belong to the same concept. For details not described in detail in the technical solution of the prompt information optimization device, please refer to the description of the technical solution of the above-described prompt information optimization method.

[0124] Corresponding to the above-described task processing method embodiments, this specification also provides embodiments of a task processing apparatus. Figure 8 A schematic diagram of a task processing apparatus according to one embodiment of this specification is shown. Figure 8 As shown, the device includes: The third acquisition module 802 is configured to acquire target task data and target optimization prompt information of the target task, wherein the target optimization prompt information is obtained based on the prompt information optimization method. Processing module 804 is configured to invoke the task processing model, process the target task data based on the target optimization prompt information, and obtain the target task result.

[0125] By applying the solutions in the embodiments of this specification, the task processing model can avoid common logical pitfalls and comprehension biases when faced with complex target task data, thanks to the use of deeply optimized target optimization prompts. This not only significantly improves the accuracy and usability of the target task results but also reduces the need for repeated trial and error in the task processing model, thereby improving the stability and professionalism of the task processing process.

[0126] The above is an illustrative scheme of a task processing device according to this embodiment. It should be noted that the technical solution of this task processing device and the technical solution of the task processing method described above belong to the same concept. For details not described in detail in the technical solution of the task processing device, please refer to the description of the technical solution of the task processing method described above.

[0127] Figure 9 A structural block diagram of a computing device according to one embodiment of this specification is shown. The components of the computing device 900 include, but are not limited to, a memory 910 and a processor 920. The processor 920 is connected to the memory 910 via a bus 930, and a database 950 is used to store data.

[0128] The computing device 900 also includes an access device 940, which enables the computing device 900 to communicate via one or more networks 960. Examples of these networks include Public Switched Telephone Network (PSTN), Local Area Network (LAN), Wide Area Network (WAN), Personal Area Network (PAN), or combinations of communication networks such as the Internet. The access device 940 may include one or more of any type of wired or wireless network interface (e.g., Network Interface Card (NIC)), such as an IEEE 802.11 Wireless Local Area Networks (WLAN) interface, a Wi-MAX (World Interoperability for Microwave Access) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a Near Field Communication (NFC) interface, and so on.

[0129] In one embodiment of this specification, the aforementioned components of the computing device 900 and Figure 9 Other components, not shown, can also be connected to each other, for example, via a bus. It should be understood that... Figure 9 The block diagram of the computing device shown is for illustrative purposes only and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.

[0130] The computing device 900 can be any type of stationary or mobile computing device, including mobile computers or mobile computing devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones), wearable computing devices (e.g., smartwatches, smart glasses, etc.) or other types of mobile devices, or stationary computing devices such as desktop computers or personal computers. The computing device 900 can also be a mobile or stationary server.

[0131] The processor 920 is used to execute computer programs / instructions, which, when executed by the processor, implement the steps of the above-mentioned prompt information determination method, prompt information optimization method, or task processing method.

[0132] The above is an illustrative scheme of a computing device according to this embodiment. It should be noted that the technical solution of this computing device belongs to the same concept as the technical solutions of the above-described prompt information determination method, prompt information optimization method, and task processing method. For details not described in detail in the technical solution of the computing device, please refer to the description of the technical solutions of the above-described prompt information determination method, prompt information optimization method, or task processing method.

[0133] An embodiment of this specification also provides a computer-readable storage medium storing a computer program / instructions that, when executed by a processor, implement the steps of the above-described prompt information determination method, prompt information optimization method, or task processing method.

[0134] The above is an illustrative scheme of a computer-readable storage medium according to this embodiment. It should be noted that the technical solution of this storage medium belongs to the same concept as the technical solutions of the above-described prompt information determination method, prompt information optimization method, and task processing method. For details not described in detail in the technical solution of the storage medium, please refer to the description of the technical solutions of the above-described prompt information determination method, prompt information optimization method, or task processing method.

[0135] An embodiment of this specification also provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the above-described prompt information determination method, prompt information optimization method, or task processing method.

[0136] The above is an illustrative scheme of a computer program product according to this embodiment. It should be noted that the technical solution of this computer program product belongs to the same concept as the technical solutions of the above-mentioned prompt information determination method, prompt information optimization method, and task processing method. For details not described in detail in the technical solution of the computer program product, please refer to the description of the technical solutions of the above-mentioned prompt information determination method, prompt information optimization method, or task processing method.

[0137] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0138] Computer instructions include computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. Computer-readable media can include: any entity or device capable of carrying computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in computer-readable media can be appropriately added or removed according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media do not include electrical carrier signals and telecommunication signals.

[0139] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments in this specification are not limited to the described order of actions, because according to the embodiments in this specification, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the embodiments in this specification.

[0140] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0141] The preferred embodiments disclosed above are merely illustrative of this specification. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the embodiments described herein. These embodiments are selected and specifically described in this specification to better explain the principles and practical applications of the embodiments, thereby enabling those skilled in the art to better understand and utilize this specification. This specification is limited only by the claims and their full scope and equivalents.

Claims

1. A method for determining a prompt message, characterized in that, include: Historical optimization metrics for multiple candidate prompts are obtained, wherein the historical optimization metrics are used to reflect the task execution status of the candidate prompts during the historical optimization process; Based on the historical optimization indicators, sampling indicators are obtained for the multiple candidate prompts, wherein the sampling indicators are used to reflect the exploration potential of the candidate prompts. Based on the prompting indicators and the sampling indicators of the multiple candidate prompting information, utility indicators of the multiple candidate prompting information are generated respectively, wherein the prompting indicators are used to reflect the difficulty sample solving ability of the candidate prompting information; Based on the utility index, the target prompt information is determined from the plurality of candidate prompt information.

2. The method according to claim 1, characterized in that, The historical optimization metrics for acquiring multiple candidate suggestion information respectively include: For the first candidate prompt information, obtain the historical prompt information of the first candidate prompt information in the historical optimization process, wherein the historical prompt information is obtained based on the optimization of the first candidate prompt information, and the first candidate prompt information is any one of the plurality of candidate prompt information; The historical prompt information and the first candidate prompt information are evaluated respectively to obtain a first evaluation index of the historical prompt information and a second evaluation index of the first candidate prompt information. The historical optimization metrics for generating the first candidate prompt information are generated based on the first evaluation metric and the second evaluation metric.

3. The method according to claim 2, characterized in that, The step of evaluating the prompting performance of the historical prompting information and the first candidate prompting information respectively, and obtaining a first evaluation index for the historical prompting information and a second evaluation index for the first candidate prompting information, includes: The task processing model is invoked to process the sample task data based on the historical prompt information to obtain a first sample prediction result. The task processing model is then invoked to process the sample task data based on the first candidate prompt information to obtain a second sample prediction result. Based on the sample task results of the sample task data and the first sample prediction results, the first evaluation index of the historical prompt information is generated. The second evaluation index of the first candidate prompt information is generated based on the sample task results of the sample task data and the second sample prediction results.

4. The method according to claim 2, characterized in that, The historical optimization metrics used to generate the first candidate suggestion information based on the first evaluation metric and the second evaluation metric include: Obtain the prior distribution information of the first candidate prompt information; Based on the first evaluation indicator and the second evaluation indicator, the cumulative number of successful attempts and the cumulative number of failures of the first candidate prompt information are determined; Based on the prior distribution information, the cumulative number of successes, and the cumulative number of failures, the historical optimization index of the first candidate prompt information is generated.

5. The method according to claim 1, characterized in that, The step of generating utility metrics for the multiple candidate prompts based on their prompt metrics and the sampling metrics includes: Based on the prompting indicators of the multiple candidate prompting information, the target candidate prompting information is selected from the multiple candidate prompting information; Based on the prompting index and the sampling index of the target candidate prompting information, respectively generate the utility index of the target candidate prompting information; The step of determining the target prompt information from the plurality of candidate prompt information based on the utility index includes: The target prompt information is determined from the target candidate prompt information based on the utility index of the target candidate prompt information.

6. The method according to any one of claims 1 to 5, characterized in that, Before generating the utility index of the plurality of candidate prompts based on the prompt index and the sampling index, the method further includes: Obtain a verification set, wherein the verification set includes multiple verification task data, and the verification task data carries the verification task results; For the first candidate prompt information, the task processing model is invoked, and the multiple verification task data are processed based on the first candidate prompt information to obtain multiple first verification prediction results. The first candidate prompt information is any one of the multiple candidate prompt information, and the first verification prediction result corresponds one-to-one with the verification task data. Based on the first verification prediction result and the verification task result, multiple initial prompt indicators for the first candidate prompt information are determined, wherein the initial prompt indicators correspond one-to-one with the verification task data; The prompt indicators for the first candidate prompt information are generated based on the plurality of initial prompt indicators and the verification difficulty weights of the plurality of verification task data.

7. The method according to claim 6, characterized in that, Before generating the prompt indicators for the first candidate prompt information based on the plurality of initial prompt indicators and the verification difficulty weights of the plurality of verification task data, the method further includes: For the first verification task data, the task processing model is invoked to process the first verification task data based on the multiple candidate prompts to obtain multiple second verification prediction results. The first verification task data is any one of the multiple verification task data, and the second verification prediction results correspond one-to-one with the candidate prompts. Based on the plurality of second verification prediction results and the verification task results of the first verification task data, the verification difficulty weight of the first verification task data is determined.

8. A method for optimizing prompt information, characterized in that, include: Obtain target prompt information, wherein the target prompt information is determined based on the method described in any one of claims 1 to 7; The information optimization model is invoked to optimize the target prompt information, thereby obtaining optimized target prompt information.

9. A task processing method, characterized in that, include: Obtain target task data and target optimization prompts for the target task, wherein the target optimization prompts are obtained based on the method described in claim 8; The task processing model is invoked, and the target task data is processed based on the target optimization prompt information to obtain the target task result.

10. A computing device, characterized in that, include: Memory and processor; The memory is used to store computer programs / instructions, and the processor is used to execute the computer programs / instructions, which, when executed by the processor, implement the steps of the method according to any one of claims 1 to 9.

11. A computer-readable storage medium, characterized in that, It stores a computer program / instructions that, when executed by a processor, implement the steps of the method according to any one of claims 1 to 9.

12. A computer program product, characterized in that, Includes a computer program / instructions that, when executed by a processor, implement the steps of the method according to any one of claims 1 to 9.