Prompt word generation method and system based on large language model semantic reflection and multi-objective evolution

By combining genetic algorithms with semantic understanding of large language models, and employing multi-objective optimization and semantic reflection mechanisms, this approach solves the problems of reliance on expert experience, overfitting, and semantic destruction in existing prompt word optimization. It generates high-performance prompt words with strong generalization capabilities, reduces inference costs, and improves the optimization success rate.

CN121960463APending Publication Date: 2026-05-01DILING ZHIYUAN TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610067179.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-19
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Existing prompt word optimization methods rely on expert experience, which can disrupt semantic logic, lead to overfitting, make it difficult to maintain semantic diversity in multi-objective optimization, lack deep semantic optimization, and result in high inference costs.

Method used

Combining genetic algorithms with semantic understanding from large language models, this paper balances performance and cost through multi-objective optimization, introduces abstraction index and semantic reflection mechanism, adopts multi-objective Pareto optimization and hierarchical greedy strategy, and utilizes large language models for mutation and crossover operations.

Benefits of technology

Generate high-performance, highly generalizable prompts to avoid overfitting, reduce inference costs, improve optimization success rates, and ensure semantic diversity and logical consistency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121960463A_ABST
    Figure CN121960463A_ABST
Patent Text Reader

Abstract

The invention discloses a cue word generation method and system based on large language model semantic reflection and multi-objective evolution. The method comprises the following steps: initializing a cue word population; calculating a performance index of each cue word, and performing semantic segmentation by using a large language model to calculate an abstraction degree index; performing comprehensive evaluation based on the performance and the abstraction degree, and screening elite individuals by adopting a hierarchical greedy strategy based on a Pareto level; performing semantic reflection variation or parent fusion crossover on elite individuals by using a large language model to generate a next generation population; and the above process is iterated until a termination condition is met. According to the method, the abstraction degree index and the semantic reflection mechanism are introduced, so that the problems of easy overfitting and low variation efficiency in the traditional cue word optimization are solved, and the cue word with high performance and strong generalization ability can be automatically generated.
Need to check novelty before this filing date? Find Prior Art

Description

A method and system for generating cue words based on semantic reflection and multi-objective evolution of large language models Technical Field

[0001] This invention relates to the fields of artificial intelligence and natural language processing, specifically to a method and system for generating prompt words based on semantic reflection and multi-objective evolution of a large language model. Background Technology

[0002] With the widespread application of Large Language Models (LLM), prompt engineering has become a key means to improve model performance. However, existing prompt optimization methods have the following significant problems: 1. Manual debugging relies on expert experience: Manual debugging of prompts is highly dependent on expert experience. The process is carried out through trial and error, which is time-consuming, labor-intensive, and difficult to reproduce.

[0003] 2. Traditional Automated Optimization Disrupts Semantic Logic: Traditional automated optimization methods (such as genetic algorithms based on shallow syntactic mutations like word substitution, insertion, and deletion) have limitations when processing natural language. These methods treat prompt words as discrete character sequences and randomly perturb them, easily disrupting the semantic coherence and logical reasoning chain within the prompt words. This generates "adversarial examples" rather than truly "optimized examples," causing large language models to be unable to understand them or to experience illusions.

[0004] 3. Prone to overfitting and high inference costs: Existing optimization methods often only focus on accuracy metrics on the validation set. In pursuit of high scores, algorithms tend to stuff a large number of few-shot examples into the prompts. While this approach may improve scores on specific datasets, it leads to severe overfitting.

[0005] 4. The Challenge of Maintaining Diversity in Multi-Objective Optimization: Although some existing technologies have introduced multi-objective evolutionary algorithms (such as NSGA-II), their diversity maintenance mechanisms (such as crowding distance) are usually calculated based on the numerical distribution of the "objective space." In the scenario of prompt word optimization, two prompt words with completely different semantics but similar performance indicators may be misjudged as "crowded" and eliminated by traditional algorithms, resulting in the loss of true diversity of the population in the "semantic space" (decision space), and the algorithm is prone to getting trapped in local optima.

[0006] 5. Lack of deep semantic optimization: Existing prompt word optimization based on genetic algorithms is often limited to word-level replacement, insertion, or deletion. This shallow grammatical variation is unable to capture the complex logical structure and semantic dependencies within the prompt words. Summary of the Invention

[0007] The purpose of this invention is to address the aforementioned problems in existing technologies by providing a method and system for generating prompt words based on semantic reflection and multi-objective evolution using a large language model. This method combines the global search capability of a genetic algorithm with the semantic understanding capability of a large language model, achieving efficient and automated generation of prompt words through multi-objective optimization to balance performance and cost.

[0008] Firstly, this invention provides a prompt word generation method based on semantic reflection and multi-objective evolution using a large language model, comprising the following steps: S1: Initializing a prompt word population and constructing a set containing multiple initial prompt words; S2: Multi-dimensional evaluation: Calculating the performance index of each prompt word in the population on the validation set. Simultaneously, to address the overfitting problem, an "abstraction index" is introduced. A semantic segmentation method based on a large language model is used to construct an extraction template containing semantic recognition instructions. In the absence of fixed format markers, the method automatically identifies and separates the minority sample portion of the prompt words, calculating its length proportion (case proportion). The lower the case proportion, the more concise and abstract the prompt word; S3: Comprehensive selection: A comprehensive evaluation of the prompt words is performed based on the performance index and the abstraction index. A multi-objective Pareto optimization strategy is employed to find a non-dominated solution that achieves the best balance between accuracy and conciseness. Furthermore, to prevent premature population convergence and compensate for the shortcomings of the Pareto front in crowding control, a hierarchical greedy strategy is adopted: individuals with high Pareto rank are retained first, and individuals with the lowest semantic similarity to the selected set are selected iteratively within the same rank; S4: Semantic evolution: Based on the selected elite individuals, evolutionary operations are performed using a large language model: Semantic reflective mutation: cases where the parent generation predicts incorrectly are identified, meta-cue words containing error information are constructed, and the large language model is required to analyze the reasons and rewrite the cue words; Parent fusion crossover: two parents are selected, conflicting cases where their predictions are inconsistent are identified, and the large language model is required to combine the advantages of both to generate new cue words; S5: Iterative optimization: the above steps are repeated until the termination condition is met.

[0009] Preferably, in step S2, calculating the abstractness index of the prompt word specifically includes: constructing a prompt word extraction template containing semantic recognition instructions, taking the prompt word to be evaluated as input, requesting a large language model to identify and extract a few sample example text; calculating the proportion of the length metric of the extracted few sample example text to the total length metric of the prompt word, denoted as the case ratio; the abstractness index is negatively correlated with the case ratio.

[0010] Preferably, the method utilizes a large language model for identification and extraction, employing a strategy of multiple concurrent sampling to obtain the median.

[0011] Preferably, in step S3, the comprehensive evaluation adopts a multi-objective Pareto optimization strategy, specifically including: defining a multi-objective vector containing at least one performance index and at least one abstraction index; calculating the number of individuals in the population dominated by other individuals, as their Pareto level; the selection of elite individuals by combining the comprehensive evaluation results and diversity penalty values ​​specifically adopts a hierarchical greedy strategy: selecting layer by layer according to Pareto level from high to low; when the number of individuals in a certain level exceeds the remaining quota, initializing the candidate set of that level; iteratively executing the greedy selection: calculating the maximum text similarity between each candidate individual and the selected elite set as a penalty; selecting the individual with the smallest penalty to add to the elite set, and updating the penalty of the remaining candidate individuals until the quota is filled.

[0012] Preferably, in step S4, the semantic reflection mutation specifically includes: sampling and identifying a set of cases where the current parent prompt word prediction is incorrect from the training set; constructing a structured meta-prompt word, which includes: the content of the current parent prompt word, the current performance index, the set of incorrect cases, and optimization constraints; inputting the meta-prompt word into a large language model, requiring it to analyze the cause of the error and generate corrected prompt word candidates.

[0013] Preferably, in step S4, the parent fusion cross specifically includes: selecting two parent prompt words from the prompt word population; constructing a fused prompt word, wherein the fused prompt word contains at least the text content of the two parent prompt words; inputting the fused prompt word into a large language model, and requesting it to combine the features of the two parent prompt words to generate a new prompt word.

[0014] Secondly, this invention provides a prompt word generation system based on semantic reflection and multi-objective evolution using a large language model, comprising: a genetic optimizer module for coordinating the entire process of population initialization, evaluation, selection, and reproduction; a population manager module for persistent storage and loading of population data, supporting the retrieval of historically best individuals from the database to construct the initial population; a multidimensional evaluator module for performing concurrent inference tests on the prompt words on the validation set, calculating performance indicators, and using the large language model to calculate abstraction indicators; a selection strategy module for elite selection based on Pareto fronts and diversity selection based on text similarity; and a semantic reproduction module for performing semantic reflection mutation and parent fusion crossover operations using the large language model to generate the next generation of candidate prompt words.

[0015] Thirdly, the present invention provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the memory stores the computer program; and the processor executes the aforementioned prompt word generation method.

[0016] Fourthly, the present invention provides a readable storage medium storing a computer program; when the computer program is executed by a processor, it is used to implement the aforementioned prompt word generation method.

[0017] The beneficial effects of this invention are as follows: 1. By introducing an abstractness index and a semantic reflection mechanism, this invention solves the problems of overfitting and low mutation efficiency in traditional prompt word optimization, and can automatically generate prompt words with both high performance and strong generalization ability.

[0018] 2. This invention employs a multi-objective Pareto optimization strategy to find the optimal balance between accuracy and simplicity, avoiding increased inference costs caused by excessively long prompts.

[0019] 3. The hierarchical greedy selection strategy proposed in this invention effectively overcomes the deficiency of traditional Pareto optimization (such as NSGA-II) which only calculates crowding in the target space. By dynamically calculating the relative semantic similarity penalty in the decision space, it ensures the maximum distribution of the elite population in the semantic space, avoids the accidental deletion of semantically unique potential individuals due to similar performance indicators, and thus prevents the algorithm from getting trapped in local optima.

[0020] 4. This invention utilizes the semantic understanding capabilities of a large language model for mutation and crossover. Compared to traditional character-level mutation, the generated prompts are more readable and logical, effectively improving the success rate of optimization. Attached Figure Description

[0021] Figure 1 is an overall flowchart of an embodiment of the present invention.

[0022] Figure 2 is a schematic diagram of multi-objective Pareto optimization and diversity selection in an embodiment of the present invention.

[0023] Figure 3 is a schematic diagram of the mutation process based on semantic reflection in an embodiment of the present invention.

[0024] Figure 4 is a schematic diagram of the crossover process based on parent fusion in an embodiment of the present invention. Detailed Implementation

[0025] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings.

[0026] Firstly, this invention provides a prompt word generation method based on semantic reflection and multi-objective evolution of a large language model, comprising the following steps: S1: Initializing the prompt word population and constructing a set containing multiple initial prompt words; specifically, the system first loads the seed prompt word (Base Prompt). Simultaneously, the population manager module retrieves historical high-scoring individuals from the database. If the number of historical individuals is insufficient, it randomly generates or fills the population with seed prompt words to construct an initial population (size N, e.g., 64).

[0027] S2: Multidimensional Evaluation: Calculate the performance metrics of each prompt word in the population on the validation set. Simultaneously, to address the overfitting problem, an "abstraction metric" is introduced. A semantic segmentation method based on a large language model is employed to construct an extraction template containing semantic recognition instructions. In the absence of fixed-format labeling, it automatically identifies and separates the minority sample portion of the prompt words, calculating its length proportion (case proportion). The lower the case proportion, the more concise and abstract the prompt word. Specifically, for each individual in the population, the multidimensional evaluator module performs the following evaluations: 1. Performance Evaluation: Submit the prompt word to the Execution Model for inference on the validation set, calculating the F1 score (…). ).

[0028] 2. Abstraction degree calculation: In order to avoid the failure of simple regular expression matching to accurately extract examples from complex prompts, a special extraction template was built. The prompts to be evaluated are input into a special case proportion calculation model, which is instructed to "extract the Few-shot Examples text".

[0029] - Semantic Segmentation and Extraction Template Design: This invention employs a semantic segmentation method based on a large language model to construct an extraction prompt word template containing semantic recognition instructions. The template's structural configuration includes: * Role Definition Layer: The large language model is designated as a text analysis expert, granting it the authority to recognize the structure of prompt words; * Boundary Recognition Instructions: Contains discrimination rules that distinguish between the instruction domain and the example domain, requiring the model to identify text fragments in the prompt words that are only used for demonstration rather than direct instructions; * Lossless Extraction Constraints: The model is required to maintain the original characters of the example text during extraction without rewriting or summarizing them, ensuring the accuracy of length calculation; * Structured Output Layer: Constrains the model to merge all extracted examples into text blocks of a specific format for output, facilitating subsequent length statistics.

[0030] This semantic segmentation-based extraction method enables the system to be compatible with various styles of Prompt (such as conversational, completion, and XML tag-based), making it highly versatile.

[0031] Concurrent Sampling Strategy: To eliminate the instability of the output of a large language model, this system employs a multiple concurrent sampling strategy. For the same prompt word to be evaluated, the semantic extractor independently performs N (e.g., 3) extraction operations, calculates the length proportion of the extracted content in each operation, and takes the median as the final "case proportion". - Mathematical definition: Abstraction index The definition is as follows: in It is the first one extracted from the large language model A small sample example, This is the complete prompt word. Indicates the character length or the number of tokens.

[0032] - Indicator significance: The lower (i.e.) The higher the value, the more the prompt relies on the instruction itself rather than the accumulation of examples, the stronger the generalization ability, and the lower the reasoning cost for the same effect.

[0033] S3: Comprehensive Selection: Prompt words are comprehensively evaluated based on performance and abstraction metrics. A multi-objective Pareto optimization strategy is employed to find a non-dominated solution that achieves the optimal balance between accuracy and conciseness. Furthermore, to prevent premature population convergence and compensate for the Pareto front's limitations in crowding control, a hierarchical greedy strategy is used: individuals with high Pareto rank are preferentially retained, and within the same rank, individuals with the lowest semantic similarity to the already selected set are iteratively selected. The selection strategy module aims to select elite individuals that possess both high performance and high abstraction, and are highly differentiated from each other.

[0034] 1. Pareto Domination Definition: Define a multi-objective vector S3: Comprehensive Selection: Evaluate prompt words comprehensively based on performance and abstraction metrics. A multi-objective Pareto optimization strategy is employed to find a non-dominated solution that achieves the optimal balance between accuracy and simplicity. Furthermore, to prevent premature population convergence and compensate for the Pareto front's shortcomings in crowding control, a hierarchical greedy strategy is adopted: prioritizing the retention of individuals with high Pareto rank, and iteratively selecting individuals with the lowest semantic similarity to the already selected set within the same rank; the selection strategy module aims to select elite individuals that possess both high performance and high abstraction, and are highly differentiated from each other.

[0035] 1. Pareto Domination Definition: Defines a multi-objective vector : For two individuals and If the following conditions are met, then it is called Dominate (recorded as) ): 2. Pareto Rank: Calculates the dominant individuals in a population. The number of other individuals, as The Pareto rank. Individuals with a rank of 0 constitute the Pareto Front.

[0036] 3. Hierarchical Greedy Selection: To compensate for the shortcomings of the Pareto front in controlling congestion, this system adopts a hierarchical greedy strategy for elite selection.

[0037] - Priority tier: Prioritize individuals with higher Pareto rank (Rank 0 > Rank 1 > ...).

[0038] - Intra-level greedy: When the number of individuals in a certain level exceeds the remaining quota (e.g., the number of elites > the number of Pareto frontiers, so selection must continue in Rank 1; or the population size < the number of Pareto frontiers, so selection must be done in Rank 0), the diversity greedy process is initiated.

[0039] - Dynamic penalty: Initialize the candidate set for this level and iteratively execute the following steps: a. Calculate the value of each candidate individual. Gathering with the selected elites Maximum text similarity .

[0040] b. Choose The smallest (i.e., the one with the least penalty) individual joins. .

[0041] c. Update the remaining candidate individuals value (because) As the penalty value increases, it becomes relative and dynamically changes.

[0042] This strategy ensures that, under the same performance level, individuals with the greatest semantic differences are retained first, effectively preventing the population from getting trapped in local optima.

[0043] S4: Semantic Derivation: Based on the selected elite individuals, evolutionary operations are performed using a large language model: Semantic Reflective Mutation: Identify cases where the parent generation predicts incorrectly, construct meta-cue words containing error information, and require the large language model to analyze the reasons and rewrite the cue words; Parent Fusion and Crossover: Select two parents, identify conflicting cases where their predictions are inconsistent, and require the large language model to combine the advantages of both to generate new cue words; Specifically, the semantic derivation module adopts semantic-based evolutionary operators and introduces a ReflectionModel pool, supporting the selection of different strong inference models from the pool in a probabilistic manner to perform the following operations: 1. Semantic Reflective Mutation: - Feedback Case Set Construction: The system samples from the training set to construct a feedback case set. To improve the robustness of the algorithm and prevent the destruction of existing correct knowledge when correcting errors, the set includes not only cases of incorrect predictions, but also a certain percentage (e.g., 20%) of cases of correct predictions.

[0044] - Meta-Prompt Construction: Construct a Meta-Prompt containing the following elements: the content of the prompts to be optimized; current performance metrics (F1, Recall, Precision); and a list of feedback cases. (Including input, model output, and real labels); optimization constraints (such as "Please keep the case ratio between 10% and 30%").

[0045] - Closed-loop feedback mechanism: The calculated abstraction index (case ratio) is injected into the meta prompt words as an explicit negative feedback signal, forcing the large language model to perceive and adjust its dependence on examples during the generation process, thereby achieving closed-loop control of "performance-abstraction".

[0046] - Reflective Generation: Input Meta-Prompt into LLM and ask it to analyze the cause of the error and rewrite the prompt words.

[0047] - The specific meta-prompt template (REFLECTION_TEMPLATE) is as follows: ```You are a senior Prompt optimization expert proficient in Large Language Models (LLM), linguistics, and the {task_type} system. Your goal is to: optimize a given Prompt based on model performance and bad case analysis.

[0048] ---###

Input Information

[0049] * **Recall**: The proportion of violating samples identified by the model out of all real violating samples, reflecting the detection coverage.

[0050] * **Precision:** The proportion of samples identified as violations by the model that are actually violations, reflecting its accuracy.

[0051] 4. **Summary of the Prompt Execution Results (Badcase Example)** ```{feedback_text}```---###

Optimization Task Description

[0052] 2. Focus on the parts directly related to bad cases and propose modifications, **leaving the irrelevant parts unchanged** unless there are obvious logical or semantic conflicts.

[0053] 3. Pay attention to the following aspects during optimization: * Delete or merge duplicate, contradictory or redundant statements; * Make the language expression more precise, concise and logically clear; * Maintain a reasonable dependence of the Prompt on cases, ensuring that <Case ratio> is between 10% - 40%; 4. Before each modification, list: *

Modification point number

Differences between the content before and after modification

Reason for modification

Output requirements

Goal

[0054] ```- Among them, the specific format of "Summary of the running results of the Prompt to be optimized (bad case examples)" is as follows:```# Case 1## Sample content"This is a non-violating sample case"## True label of this sample"Non-violating"## Model output"{"violation_reason": "Reason for violation","result": "Violation"}"The model output result is: *Violation* The judgment of the model is *incorrect*, and the correct result should be: *Non-violating*...# Case n...```2. Parent fusion crossover (Crossover): - Parent selection: Select two parents, usually one with excellent performance (Pareto front) and the other with a large difference from the former (based on diversity).

[0055] - Construction of the fusion reference set: Evaluate both on the sampling set and identify "conflicting cases" (Parent A is right and B is wrong, or vice versa). At the same time, to consolidate the common advantages, a small number of cases where both predictions are correct can be added to jointly form the fusion reference set.

[0056] - Construction of the fusion instruction: Construct the fusion Prompt: "Prompt A is good at handling... (attach the content of A); Prompt B is good at handling... (attach the content of B); Please combine the advantages of both to generate a new prompt that can handle the cases in the above fusion reference set simultaneously..."

[0057] ```- Among them, the specific format of "Summary of the running results of the Prompt to be optimized (bad case examples)" is as follows:```# Case 1## Sample content"This is a non-violating sample case"## True label of this sample"Non-violating"## Model output"{"violation_reason": "Reason for violation","result": "Violation"}"The model output result is: *Violation* The judgment of the model is *incorrect*, and the correct result should be: *Non-violating*...# Case n...```2. Parent fusion crossover (Crossover): - Parent selection: Select two parents, usually one with excellent performance (Pareto front) and the other with a large difference from the former (based on diversity). - Construction of the fusion reference set: Evaluate both on the sampling set and identify "conflicting cases" (Parent A is right and B is wrong, or vice versa). At the same time, to consolidate the common advantages, a small number of cases where both predictions are correct can be added to jointly form the fusion reference set. - Construction of the fusion instruction: Construct the fusion Prompt: "Prompt A is good at handling... (attach the content of A); Prompt B is good at handling... (attach the content of B); Please combine the advantages of both to generate a new prompt that can handle the cases in the above fusion reference set simultaneously..."```- The specific cross-prompt template (CROSSOVER_TEMPLATE) is as follows: ```You are an expert in LLM, linguistics, and {task_type} prompt optimization. Your task is to help me optimize the content moderation prompt.

[0058] # Task Description: There are two prompts that perform differently in certain cases. Please analyze their differences, advantages, and disadvantages, and generate a better prompt.

[0059] Special attention should be paid to: - the differences between prompt A and prompt B in these cases and the reasons for them.

[0060] - Which prompt strategies are better in what situations and why?

[0061] - Try to choose strategies from the prompt that are highly generalizable, versatile, and effective.

[0062] - How to combine the advantages of two prompts while discarding their disadvantages.

[0063] - The case percentage refers to the proportion of text in the prompt that relates to a specific case within the overall prompt. It reflects the degree to which the prompt depends on specific cases and the degree of overfitting. If it is too high (>40%), it may lead to a decrease in generalization ability.

[0064] # prompt A: <prompt> {instructions_a}< / prompt> ## Performance of prompt A: Recall rate {recall_a:.1%}, Precision rate {precision_a:.1%}, F1 score {f1_a:.1%}, Case ratio {case_ratio_a:.1%}.

[0065] # prompt B: <prompt> {instructions_b}< / prompt> ## Performance of prompt B: Recall rate {recall_b:.1%}, Precision rate {precision_b:.1%}, F1 score {f1_b:.1%}, Case ratio {case_ratio_b:.1%}.

[0066] # Key Case Comparison: ```{cases_text}```# After comprehensive analysis, output optimization points or comparative analysis conclusions, then combine the advantages of the two prompts to create the final complete prompt. <prompt>Wrap it up.

[0067] The specific format for "Key Case Comparison" is as follows: Case 1: Sample content: "This is a non-violation sample case." The true label of this sample: "Non-violation" Output of A: {"violation_reason": "Reason for violation","result": "Violation"} The output result of model A is: *Violation*, the judgment of model A is *incorrect*, the correct result should be: *Non-violation* Output of B: {"violation_reason": "Reason for non-violation","result": "Non-violation"} The output result of model B is: *Non-violation*, the judgment of model B is *correct*.

[0068] ...

[0068] Case n:...```< / prompt>

Claims

1. A cue word generation method based on semantic reflection and multi-objective evolution of a large language model, characterized in that, Includes the following steps: S1: Initialize the prompt word population and construct a set containing multiple initial prompt words; S2: Multidimensional evaluation: Calculate the performance index of each prompt word in the population on the validation set, and use a large language model to assist in calculating the abstraction index of each prompt word; S3: Comprehensive selection: Perform hierarchical screening based on Pareto rank and diversity greed; Individuals with high Pareto rank are prioritized for retention. When selecting individuals of the same rank, a greedy strategy is adopted to iteratively select the individual with the lowest semantic similarity to the selected elite set in order to make up for the shortcomings of the Pareto front in crowding control. S4: Semantic Derivation: Based on the selected elite individuals, construct meta-prompt words containing feedback from the current level of abstraction and input them into the large language model. Generate revised prompt word candidates through a semantic reflection mechanism, or generate new prompt words that combine the advantages of both parents through a parent fusion mechanism. S5: Iterative optimization: Repeat steps S2 to S4 until the preset number of iterations or performance threshold is met, and output the optimal prompt word.

2. The cue word generation method based on semantic reflection and multi-objective evolution of a large language model according to claim 1, characterized in that, In step S2, the abstractness index of the prompt words is calculated using a semantic segmentation method based on a large language model. Specifically, this includes: constructing an extraction prompt word template containing semantic recognition instructions, whereby the instructions define the semantic features of few-sample examples, i.e., specific sample data in the prompt words used to demonstrate input-output patterns, distinguishing them from task instructions and logical constraints; semantic deconstruction: embedding the prompt word to be evaluated as context into the extraction prompt word template and inputting it into the large language model; utilizing the semantic understanding capabilities of the large language model, automatically identifying and separating the example text portion of the prompt word to be evaluated in the absence of fixed format markers; index quantification: calculating the proportion of the length metric of the separated example text portion to the total length metric of the prompt word, denoted as the case proportion; the abstractness index is negatively correlated with the case proportion.

3. The prompt word generation method based on semantic reflection and multi-objective evolution of a large language model according to claim 2, characterized in that, The structural configuration of the extracted prompt word template includes: a role definition layer: setting the large language model as a text analysis expert, granting it the authority to recognize the structure of prompt words; boundary recognition instructions: containing discrimination rules to distinguish between the instruction domain and the example domain, requiring the model to identify text fragments in the prompt words that are only used for demonstration rather than direct instructions; lossless extraction constraints: requiring the model to keep the original characters of the example text from being rewritten or summarized during the extraction process to ensure the accuracy of length calculation; and a structured output layer: constraining the model to merge all extracted examples into text blocks of a specific format for output, so as to facilitate subsequent length statistics.

4. The prompt word generation method based on semantic reflection and multi-objective evolution of a large language model according to claim 2, characterized in that, To eliminate the instability of the output of the large language model, the calculation process adopts a multiple concurrent sampling strategy: for the same prompt word to be evaluated, the semantic extractor independently performs N extraction operations; the length ratio of the extracted content in each extraction is calculated, and the median is taken as the final case ratio.

5. The cue word generation method based on semantic reflection and multi-objective evolution of a large language model according to claim 1, characterized in that, In step S3, the comprehensive evaluation adopts a multi-objective Pareto optimization strategy. Specific steps include: defining a multi-objective vector containing at least one performance indicator and at least one abstraction indicator; calculating the number of individuals dominated by other individuals in the population, as their Pareto level; the selection of elite individuals by combining the comprehensive evaluation results and diversity penalty values ​​specifically adopts a hierarchical greedy strategy: selecting individuals layer by layer from high to low Pareto level; when the number of individuals in a certain level exceeds the remaining quota, initializing the candidate set for that level; iteratively executing the greedy selection: calculating the maximum text similarity between each candidate individual and the selected elite set as a penalty; selecting the individual with the smallest penalty to add to the elite set, and updating the penalty of the remaining candidate individuals until the quota is filled.

6. The cue word generation method based on semantic reflection and multi-objective evolution of a large language model according to claim 1, characterized in that, In step S4, the semantic reflexive mutation specifically includes: sampling and constructing a feedback case set from the training set, the feedback case set containing at least cases where the current parent prompt word prediction is incorrect, the feedback case set containing input data, model output, and real labels; constructing a structured meta-prompt word, the meta-prompt word containing: the content of the current parent prompt word, the current performance metric, the feedback case set, and optimization constraints containing error cause analysis instructions; inputting the meta-prompt word into a large language model, requiring it to analyze the error cause and generate corrected prompt word candidates.

7. The prompt word generation method based on semantic reflection and multi-objective evolution of a large language model according to claim 6, characterized in that, The optimization constraints include limiting the proportion of case samples in the generated prompts to prevent overfitting or insufficient generalization ability.

8. The cue word generation method based on semantic reflection and multi-objective evolution of a large language model according to claim 1, characterized in that, In step S4, the parent fusion cross specifically includes: selecting two parent prompt words from the prompt word population; constructing a fused prompt word, wherein the fused prompt word contains at least the text content of the two parent prompt words; inputting the fused prompt word into a large language model, and requesting it to combine the features of the two parent prompt words to generate a new prompt word.

9. The prompt word generation method based on semantic reflection and multi-objective evolution of a large language model according to claim 8, characterized in that, The process of constructing the fusion prompt word further includes: evaluating the two parent progenitors on the sampled dataset, constructing a fusion reference set, which contains at least conflicting cases where the prediction results of the two progenitors are inconsistent; and adding the fusion reference set to the fusion prompt word to assist the large language model in analyzing the advantages and disadvantages of the two parent progenitors in different cases.

10. The prompt word generation method based on semantic reflection and multi-objective evolution of a large language model according to claim 6, characterized in that, The specific structure of the meta-prompt includes: an input information section, which includes the Prompt to be optimized, performance indicators, and a summary of the running results; an optimization task description section, which includes analysis instructions, modification principles, and format requirements; and an output requirement section.

11. The cue word generation method based on semantic reflection and multi-objective evolution of a large language model according to claim 8, characterized in that, The specific structure of the fusion prompt includes: a task description section; the content and performance indicators of the two parent prompts; a key case comparison section, which shows the different performances of the two parent prompts on the same case; and a comprehensive analysis and output instruction section.

12. A prompt word generation system based on semantic reflection and multi-objective evolution of a large language model, characterized in that, The system includes interconnected modules: a genetic optimizer module, a population manager module, a multidimensional evaluator module, a selection strategy module, and a semantic reproduction module. The genetic optimizer module, as the central control unit of the system, is used to send scheduling instructions to other modules to coordinate the entire process of population initialization, evaluation, selection, and reproduction. The population manager module is used to respond to the instructions of the genetic optimizer module, perform persistent storage and loading of population data, and retrieve historical best individuals from the database to construct the initial population and return it to the genetic optimizer module. The multidimensional evaluator module receives the group of prompt words to be evaluated, performs concurrent inference tests on the validation set to calculate performance indicators, calls the large language model to calculate the abstraction index, and returns the evaluation results. The selection strategy module receives the evaluated population data, performs elite screening based on Pareto fronts and diversity screening based on text similarity, and outputs a set of elite individuals. The semantic proliferation module receives a set of elite individuals, performs semantic reflexive mutation and parent fusion crossover operations using a large language model, generates candidate prompt words for the next generation, and returns them to the genetic optimizer module.

13. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: The memory stores a computer program; the processor executes the prompt word generation method as described in any one of claims 1-11.

14. A readable storage medium storing a computer program; characterized in that: When the computer program is executed by a processor, it is used to implement the prompt word generation method as described in any one of claims 1-11.