A large model intelligent agent prompt optimization method, system and device
By constructing a version evolution graph and a multi-dimensional evaluation mechanism, the problems of fuzzy feedback processing and version management in the Prompt optimization of large model agents are solved, realizing an efficient and traceable optimization process and improving the quality and efficiency of Prompt optimization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHONGQING UNIV
- Filing Date
- 2026-01-27
- Publication Date
- 2026-06-05
AI Technical Summary
Existing technologies suffer from problems in large-scale intelligent agent Prompt optimization, such as lack of fuzzy feedback processing capabilities, passive and unguided optimization process, and chaotic and untraceable version management, resulting in low optimization efficiency and difficulty in guaranteeing quality.
By constructing a version evolution graph, receiving and parsing user input, using multiple large model agents for multi-dimensional evaluation, recommending optimized resources, and recording semantic link information during the optimization process, we can achieve intelligent parsing of fuzzy feedback and proactive optimization direction mining.
It significantly improves the efficiency and quality of Prompt optimization interaction, realizes full-process traceable version management, lowers the user threshold and improves the reliability and reusability of optimization results.
Smart Images

Figure CN122154734A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of artificial intelligence and relates to a method, system and device for Prompt optimization of large model intelligent agents. Background Technology
[0002] With the widespread application of large-scale intelligent models in the field of natural language processing, the quality of the Prompt, as a key medium for human-computer interaction, directly determines the accuracy, relevance, and logicality of the model output. Existing technologies are dedicated to improving the generation and optimization capabilities of Prompts, but they generally suffer from shortcomings such as passive optimization processes, low interaction efficiency, and a lack of systematic management.
[0003] Specifically, existing technologies mainly follow the following two paths, but neither has effectively solved the problems in multi-round collaborative Prompt optimization:
[0004] 1. Knowledge-enhanced static Prompt generation methods: For example, Chinese patent CN117591663B. The core of this type of method lies in using external knowledge bases to enrich the initial content of the Prompt. Its typical process is: parsing user input to identify intent and key entities, then retrieving relevant entities, attributes, and relationships from a knowledge graph, and filling this information into a predefined template to construct an information-rich Prompt. This method solves the problem of insufficient information in a single Prompt generation to some extent. However, this approach is essentially one-off and cannot handle scenarios requiring multiple iterations and dynamic adjustments for Prompt optimization. When users are dissatisfied with the initial output and provide vague feedback such as "not concise enough" or "lacking in professionalism," this type of method lacks the ability to parse vague intents and dynamically adjust the Prompt structure or content accordingly. The optimization process is forced to be interrupted or relies on extremely precise modification instructions from the user, resulting in insufficient practicality.
[0005] 2. General-purpose intelligent agent systems based on modular architecture: Examples include Chinese patents CN120046645A and CN120235181A, which focus on building general multi-module intelligent agent frameworks. These systems typically include modules for perception, planning, tool invocation, and memory, capable of handling complex multi-step tasks. Although some modules conceptually involve task decomposition, and some systems introduce graph structures to manage knowledge, their design goals are task execution and intelligent agent behavior management, without focusing on fine-grained optimization of the specific text object, "Prompt." For example, their graphs might be used to store domain knowledge or record dependencies between intelligent agent components, but there is no mechanism specifically for recording the complete evolution history of a Prompt text itself across multiple iterations, the semantic motivation for each modification, and the logical connections between different optimization paths. Therefore, such systems cannot provide clear and traceable optimization version management, leading to a chaotic optimization process and high trial-and-error costs.
[0006] In summary, existing technologies face the following pressing technical challenges in Prompt optimization tasks for large models: (1) Lack of ability to handle fuzzy feedback: Existing technologies rely heavily on users to provide clear and structured feedback instructions. For optimization needs that are often vaguely expressed in practice, such as "it doesn't feel right" or "make it more dynamic", deep semantic analysis and intent mapping cannot be performed, resulting in a loss of optimization direction and low iteration efficiency.
[0007] (2) The optimization process is passive and lacks guidance: The optimization process is entirely initiated and driven by the user, and the system only plays a passive role. It lacks the ability to actively evaluate the current prompt defects after each round of optimization and intelligently generate specific and actionable optimization suggestions, which makes the optimization process a one-way mental labor of the user and fails to form an intelligent closed loop of human-machine collaboration.
[0008] (3) Version management is chaotic and untraceable: There is a lack of a version control system specifically designed for Prompt. Intermediate versions, reasons for modification, and relationships between different trial paths during the optimization process cannot be systematically recorded and visualized, resulting in the inability to quickly backtrack and compare, difficulty in reusing successful experiences, unknown optimization process, and high management costs.
[0009] The present invention aims to overcome the shortcomings of the prior art and provide a large-scale intelligent agent Prompt optimization scheme that can intelligently analyze fuzzy feedback, proactively explore optimization directions, and realize full-process traceable version management, so as to significantly improve the interaction efficiency, output quality and process management capabilities of Prompt optimization. Summary of the Invention
[0010] In view of this, the purpose of the present invention is to provide a method, system and apparatus for Prompt optimization of large model intelligent agents.
[0011] To achieve the above objectives, In a first aspect, the present invention provides a large-scale agent Prompt optimization method, comprising: S1. Receive the initial Prompt input by the user and extract the semantic features of the initial Prompt; S2. Based on the semantic features, match and recommend optimized resources from a pre-set resource library, wherein the optimized resources include at least one of optimization templates, optimization frameworks, and optimization models; S3. Optimize the initial Prompt using the recommended optimization resources to generate an optimized Prompt; S4. Call multiple large model agents to actively evaluate the optimized Prompt in multiple dimensions, and generate at least one feedback suggestion label based on the evaluation results; S5. Receive user feedback, wherein the user feedback includes tags selected from the feedback suggestion tags, explicit instructions or vague expressions entered; S6. When the user feedback contains a vague expression, perform in-depth analysis on the vague expression and map it into a specific optimization instruction; S7. Based on user feedback and / or the optimization instructions obtained from parsing, iteratively optimize the current version of Prompt; During the optimization process, a version evolution graph is constructed and maintained. The version evolution graph records the iteration relationship of each version Prompt, including the initial Prompt and the Prompts generated in each iteration, in the form of nodes and edges. Structured semantic link information is recorded for the connection edges between adjacent versions. The structured semantic link information includes at least the user feedback content that triggered the generation of the new version and a description of the core changes before and after optimization.
[0012] Further, in step S1, the extraction of semantic features includes: performing deep analysis on the initial Prompt, automatically identifying its scene domain, task type and target requirements, and generating corresponding feature labels and feature vectors; supporting users to add custom labels, and merging the system-identified labels with the user-defined labels to jointly constitute the semantic features.
[0013] Further, in step S2, matching and recommending optimized resources from a preset resource library includes: The feature vector is semantically matched with the meta tags in the resource library. The meta tags represent the applicable scenarios, task types, or requirements of the resources. The resource library includes a template library that stores preset Prompt structure templates for different scenarios, a framework library that stores advanced Prompt engineering frameworks, and a model library that stores performance data of different AI models. Based on the matching degree, recommend one or more candidate Prompt templates and / or Prompt project frameworks; and / or, based on the feature vector and the user-specified task requirement attributes, recommend an AI model for this optimization.
[0014] Furthermore, step S3 also includes: After generating the optimized Prompt, it is determined according to preset rules whether it is necessary to dynamically generate or match Few-Shot examples from the example library for the optimized Prompt; if so, based on the content of the optimized Prompt, a specified number of high-quality input-output example pairs with specified complexity, domain relevance and format requirements are generated or retrieved, and the example pairs are integrated into the Prompt for the next round of optimization or the final output.
[0015] Furthermore, in step S4, the invocation of multiple large model agents for proactive multi-dimensional evaluation includes: At least two large model agents with different evaluation focuses are invoked in parallel or serially; each large model agent independently evaluates the optimized Prompt by selecting one or more dimensions from a preset set of evaluation dimensions, and outputs evaluation opinions and / or modification suggestions; the outputs proposed by each agent are deduplicated, clustered, and prioritized to generate a specified number of clearly guiding feedback suggestion labels for the user to select.
[0016] Furthermore, the construction and maintenance of the version evolution graph includes: storing the initial Prompt as the root node in the version evolution graph; and linking the new Prompt generated in each iteration as a child node to its corresponding root node.
[0017] Secondly, the present invention also provides a system for implementing the above method, comprising: The input processing and version management module 100 is used to receive and standardize the initial Prompt of user input, extract its semantic features, and construct and manage a version evolution graph that records the evolution relationship of Prompt versions. The intelligent recommendation module 200 is used to intelligently recommend optimized resources from a pre-set resource library based on the semantic features. An optimization module 300 is used to optimize the initial Prompt using recommended optimization resources to generate an optimized Prompt. The feedback intelligent parsing and optimization direction mining module 400 is used to actively call multiple large model agents to perform multi-dimensional evaluation and generate at least one feedback suggestion label after the optimization generation module 300 outputs the optimized Prompt. It is also used to receive and parse user feedback, which includes the selection of the feedback suggestion label, the input of explicit instructions or fuzzy expressions. When the user feedback contains fuzzy expressions, it is parsed into specific optimization instructions. The system drives the generation optimization module 300 to perform iterative optimization based on the optimization instructions obtained by the feedback intelligent analysis and optimization direction mining module 400, and the input processing and version management module 100 updates the version evolution map.
[0018] Furthermore, the input processing and version management module 100 includes: (1) Multimodal input adapter unit 110, used to receive text, image or audio input and convert it into standardized text Prompt; (2) Semantic feature extraction and labeling unit 120, used to analyze the standardized text Prompt, identify the scene domain, task type and target requirements, and generate feature vectors; (3) Version evolution graph management unit 130 is used to store different versions of the Prompt in a tree or graph structure, and to record optimized semantic link information for the connection edges between adjacent versions, and to support version rollback, branch creation and semantic-based version clustering operations.
[0019] Furthermore, the feedback intelligent analysis and optimization direction mining module 400 includes: (1) Feedback intelligent parsing unit 410 is used to directly convert the user’s explicit instructions or selected tags into optimization instructions, and to perform semantic deep decomposition and demand mapping on fuzzy expressions, and convert them into specific optimization instructions; (2) The optimization direction active mining unit 420 is used to call multiple large model agents in parallel to evaluate the optimized Prompt and generate the feedback suggestion label based on the evaluation results.
[0020] Compared with the prior art, the beneficial effects of the present invention are as follows: Through mechanisms such as "fuzzy feedback intelligent parsing" and "proactive optimization direction mining," the efficiency and quality of human-machine collaborative optimization of Prompts are significantly improved. The system can accurately understand the user's fuzzy expressions and translate them into specific instructions, while proactively providing multi-dimensional optimization suggestions, effectively lowering the user's learning curve and reducing ineffective iterations.
[0021] Furthermore, by constructing a version evolution graph that records the complete "structured semantic link", this invention achieves full traceability and explainability of the Prompt optimization process, making the reasons, content and logic of each user's modification clearly visible, thus solving the defects of version chaos and difficulty in reusing experience in the Prompt project.
[0022] Ultimately, the aforementioned technical features collectively constitute an intelligent and collaborative Prompt optimization system. It not only transforms the optimization model from a passive "user command-machine execution" to an active "machine guidance-user selection," but also ensures the reliability and reusability of optimization results through scenario-based resource matching and dynamic example enhancement, thereby comprehensively improving the application quality of large-scale intelligent agents.
[0023] Other advantages, objectives, and features of the invention will be set forth in part in the description which follows, and in part will be apparent to those skilled in the art from the following examination, or may be learned from practice of the invention. The objectives and other advantages of the invention can be realized and obtained through the following description. Attached Figure Description
[0024] To make the objectives, technical solutions, and advantages of the present invention clearer, the preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings, wherein: Figure 1 This is a schematic diagram of the overall system architecture of the present invention; Figure 2 This invention provides a detailed architecture of a large-scale intelligent agent Prompt optimization system. Figure 3 This is a schematic diagram of the entire Prompt optimization process of this invention. Detailed Implementation
[0025] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0026] The accompanying drawings are for illustrative purposes only and are schematic diagrams, not actual pictures. They should not be construed as limiting the invention. To better illustrate the embodiments of the invention, some parts in the drawings may be omitted, enlarged, or reduced, and do not represent the actual product dimensions. It is understandable to those skilled in the art that some well-known structures and their descriptions may be omitted in the drawings.
[0027] Please see Figures 1-3 The present invention will be further explained below with reference to various embodiments.
[0028] Example 1: A Prompt Optimization System for Large-Scale Intelligent Agents This embodiment combines Figures 1 to 3 The implementation architecture and workflow of the system of the present invention are described in detail.
[0029] like Figure 1 As shown, the present invention provides a large-scale intelligent agent Prompt optimization system, the core of which lies in the collaboration and data closure of four functional modules: input processing and version management module 100, intelligent recommendation module 200, generation and optimization module 300, and feedback intelligent analysis and optimization direction mining module 400. Each module exchanges data through a predefined interface protocol, jointly completing iterative optimization from the original requirements to a high-quality Prompt.
[0030] 1.1 Input Processing and Version Management Module 100 is used to receive and standardize user input and manage the version evolution of Prompt. Specifically, it includes: (1) Multimodal input adaptation unit 110: used to receive text, image or audio input. For image input, it calls the integrated visual language model (such as GPT-4V, Qwen-VL) to understand and extract the text description; for voice input, it calls the speech recognition service (such as OpenAI Whisper, iFlytek engine) to convert it into text. It outputs a unified standardized text prompt.
[0031] (2) Semantic Feature Extraction and Tagging Unit 120: Performs in-depth analysis on the standardized Prompt, automatically identifying its scenario domain (e.g., finance, healthcare), task type (e.g., translation, summarization), and target requirements (e.g., improving accuracy, enhancing creativity). Supports users adding custom tags. Merges the system-identified tags with user-defined tags and encodes them into the feature vector of this Prompt version.
[0032] (3) Version Evolution Graph Management Unit 130: The initial Prompt is stored as the root node. Each new Prompt generated by optimization is linked to its parent version as a child node, forming a tree or graph structure. Optimization semantic links are constructed for the connection edges between adjacent parent and child nodes, recording: ① user feedback information that triggered this optimization, ② core changes before and after optimization, ③ the core goals and logic of this optimization. The system supports semantic clustering of versions based on feature vectors and allows users to jump to any historical version with one click or create a new optimization branch based on any historical version.
[0033] 1.2 The intelligent recommendation module 200 is used to intelligently match the optimal optimization resources based on the characteristics of the current Prompt. Specifically, it includes: (1) Scene-Resource Mapping Library 210: Stores template library, framework library and model library.
[0034] The template library stores preset Prompt structure templates for different scenarios. For example, the "Academic Paper Abstract Optimization Template" may contain placeholder structures for "Background, Purpose, Methods, Results, and Conclusions".
[0035] The framework library stores high-level Prompt project frameworks. For example, the `CRISPE` (Capacity, Role, Insight, Statement, Personality, Experiment) framework is used for role setting and task decomposition.
[0036] The model library stores performance data (such as accuracy, creativity, cost, and speed) of different AI models (such as GPT-4, Claude, Qwen, and Wenxin Yiyan) in various task types and domains.
[0037] (2) Recommendation Engine 220: Receives the Prompt feature vector from module 100. Matches the feature vector with the meta-labels of resources in the mapping library 210. For example, if identified as an "academic writing" task, it prioritizes recommending relevant academic templates and logic-focused frameworks. Simultaneously, based on the user's choice of task requirements (e.g., "high creativity"), it recommends the most suitable optimized model (e.g., GPT-4) from the model library.
[0038] 1.3 Generate optimization module 300, which is used to perform specific Prompt optimization operations. Specifically, this includes: (1) Prompt generation optimization unit 310: integrates the templates, frameworks and models recommended by module 200. The Prompt to be optimized is reconstructed according to the selected framework, and the corresponding parts of the template are filled in to form a structured optimization instruction, which calls the recommended model to generate the optimized Prompt.
[0039] (2) Few-Shot Generation Optimization Unit 320: Pre-defined Few-Shot generation rules, including the number of examples, complexity, domain relevance, and format requirements. Based on the optimized Prompt content, several high-quality input-output example pairs are generated in real time from the internal example library or through a large model. The constructed example library adds semantic tags and usage effect records to each example, forming a reuse mechanism.
[0040] 1.4 The feedback intelligent analysis and optimization direction mining module 400 is used to analyze user feedback and proactively propose optimization suggestions. Specifically, it includes: (1) Feedback Intelligent Analysis Unit 410: For explicit user instructions or selected tags, directly convert them into optimization instructions. For vague feedback such as "not good enough" or "optimize it further", perform semantic deep decomposition: extract keywords, combine them with the current Prompt, expand the vague expression into multiple specific candidate expressions, and map them into specific and executable optimization instructions based on historical cases.
[0041] (2) Optimization Direction Active Mining Unit 420: After each optimization result is generated, the system automatically calls multiple large model agents, each evaluating the current Prompt from different dimensions such as completeness, professionalism, clarity, and creativity, and actively mining potential optimization directions. Based on the evaluation results and task scenario, a specified number of feedback suggestion tags with clear guidance are generated, such as: "Should the abstract length be limited to within 200 words?", for users to quickly select.
[0042] Example 2: A Prompt Optimization Method for Large-Scale Intelligent Agents like Figure 3 As shown, this embodiment provides an optimization method for the above system, including the following steps: S101: Receives the user-input Prompt to be optimized and / or related multimodal data, such as text, images, and audio, and performs standardization processing. Through semantic feature extraction and labeling, the input content is transformed into structured semantic features, and a feature vector is generated. Simultaneously, the current Prompt is stored as the initial version in the version evolution graph.
[0043] S102: Based on the feature vector and combined with the historical records in the version evolution map, intelligently match and recommend applicable Prompt templates, optimization frameworks and AI models from the pre-set resource library (including database, framework library and model library).
[0044] S103: Using recommended templates, frameworks, and models, the Prompt to be optimized is refactored and rewritten to generate the first version of the optimized result. Based on preset rules, the system automatically detects whether Few-Shot examples are needed. If so, relevant examples are intelligently matched or dynamically generated from the example library and optimized to enhance the Prompt's context adaptability.
[0045] S104: Call multiple large model agents to evaluate the optimized Prompt from multiple dimensions, proactively explore possible optimization directions based on the evaluation results, and generate a batch of feedback suggestion tags for users to refer to or select.
[0046] S105: Receive user feedback. Feedback may take the form of one or more suggestions selected by the user from the suggestion tabs, explicit text instructions entered, or vague natural language feedback.
[0047] S106: Intelligently analyze user feedback. If it is a clear instruction or tag, it is directly converted into an optimization instruction; if it is a vague feedback, it is converted into a specific and executable optimization instruction through semantic decomposition and requirement mapping.
[0048] S107: Based on the parsed optimization instructions and combined with recommended resources, generate a new round of optimization prompts and link them to the version evolution graph as a new version to form an optimization path record.
[0049] S108: Determine if further optimization is needed. If yes, return to step S104; otherwise, if the optimization termination conditions are met (such as user satisfaction or reaching the maximum number of iterations), output the final optimized Prompt and its complete version evolution graph, and end the process.
[0050] Example 3: The entire process of Prompt optimization based on in-vehicle scenarios This embodiment takes the "user control command generalization" task in the vehicle intelligent interaction scenario as an example to fully demonstrate the collaborative optimization process of the system of the present invention, especially focusing on demonstrating the practical role of the two core innovations of fuzzy feedback parsing and active optimization mining.
[0051] 3.1 Initial Input and Version Initialization (1) User input: The user submitted a request through the text input box: "I want to generalize the control commands of smart car users to obtain more command data that simulates real-world scenarios. Please help me generate a Prompt." The user did not add any custom tags.
[0052] (2) System processing (corresponding to the input processing and version management module): A. Standardization: The system directly receives text and generates a standardized initial Prompt (P). i ).
[0053] B. Semantic Feature Extraction and Labeling: The system extracts and labels P i Perform semantic analysis to automatically identify and generate feature vector F={Scene Domain: "Technology / Smart Car / Cockpit Interaction", Task Type: "Data Generation / Command Generalization", Target Requirement: "Simulate Real-World Scenarios"}.
[0054] C. Creating the initial version: The system creates a root node Prompt_V1.0 in the version evolution graph, storing P i The optimization direction is determined by the number of proactively mined agents and the number of optimization suggestion tags. Since the user did not specify this, the default value of 5 is used.
[0055] 3.2 First Round of Intelligent Recommendation and Optimization Generation (1) Intelligent recommendation (corresponding to the intelligent recommendation module): The recommendation engine matches resources from the scene-resource mapping library according to F and outputs the recommendation strategy R.
[0056] ①Framework Recommendation: Matches the EAR framework, which has a simple structure and is suitable for initial task definition.
[0057] ② Model Recommendation: Considering the creative requirements of the "data generation" task, the GPT-4o model is recommended.
[0058] (2) Generation optimization (corresponding to the generation optimization module): The system, based on R, will optimize P. i Applying the EAR framework and refining it using the GPT-4o model, a new Prompt _V1.1 is generated: "Role: You are a professional content generation assistant, specializing in generating high-quality simulated data for natural language processing and machine learning tasks in the field of intelligent vehicles."
[0059] Expectation: Generate user control command text for smart cars that closely resembles real-world scenarios to expand and enhance the quality and generalization capabilities of existing datasets.
[0060] Action: Generalizing the cockpit control commands given by the user. (3) Version record: Create a new version node V1.1 as a child node of V1.0.
[0061] 3.3 First Round of Proactive Optimization Direction Discovery The system automatically invokes five large model agents in parallel to evaluate V1.1 from different dimensions and proactively generates suggestions. Table 1 summarizes the mining results of each agent.
[0062] Table 1. Multi-agent optimization recommendation results
[0063] The system deduplicates, clusters, and prioritizes the above suggestions, generating five targeted feedback suggestion tags to present to the user, as detailed in Table 2.
[0064] Table 2 Feedback and Suggestion Tags
[0065] 3.4 User Feedback Reception and Intelligent Analysis (1) User feedback: After viewing the suggested tags in V1.1 and Table 2, users perform two actions: ① Select the specific labels: "Change Frame" and "Add Example".
[0066] ② Inputting fuzzy voice feedback: "The framework and dimensions are too simple. We need to simulate real data to train the in-vehicle AI." The system converts this into text using ASR (Automatic Speech Recognition).
[0067] (2) Intelligent analysis feedback (corresponding to the intelligent analysis feedback module): (1) Handling clear feedback: The system will directly convert the selected tags into optimization instructions such as "replace execution framework" and "add execution example".
[0068] (2) Deep analysis of fuzzy feedback: The system performs deep analysis on the statement "the framework and dimensions are too simple", including ① Semantic in-depth analysis: Extract the core keywords "framework", "dimension", and "simple", and expand them into specific candidate expressions based on the current task scenario: a. The EAR framework has too few elements to bear complex constraints; b. The definition of "generalization" is vague and lacks operable dimensional guidance; c. There is a lack of quantitative requirements for the "authenticity" and "complexity" of the generated results.
[0069] ② Specific requirement mapping: Based on the "Change framework" tag already selected by the user, vague requirements are mapped to executable instructions: "It is recommended to upgrade to a structured framework with multiple elements (such as CRISPE)" and "At least 3 specific instruction generalization dimensions (such as synonym replacement, sentence transformation, and scenario expansion) need to be clearly defined in the Prompt".
[0070] 3.5 Second Round of Intelligent Recommendation and Optimization Generation (1) Intelligent recommendation: The system integrates and parses the instructions to form a new feature vector F1, which adds information such as "requires a complex framework" and "requires a refined dimension" to F. The recommendation engine rematches and recommends from the resource library to generate a new round of optimization strategy (recommending the CRISPE framework).
[0071] (2) Generation Optimization: The system reconstructs the Prompt based on the CRISPE framework to generate P_V1.2: "Capacity and Role: You are a professional content generation assistant... with a strong ability to understand intent and rewrite user commands in a human-like manner."
[0072] Insight: Current simple instructions are insufficient to simulate complex and ever-changing real-world scenarios... A large amount of diverse instruction data is needed for training and testing.
[0073] Statement: Your core task is to generalize the cockpit control commands provided by the user in a multi-dimensional and high-quality manner... Personality: 1. Enhance the humanistic and realistic qualities of generalized instructions through multiple dimensions such as sentence structure variation, vocabulary generalization, scene embedding, and style diversification... Experiment: Based on the above requirements, please demonstrate the complete generalization process and results for the example instruction "Turn on the air conditioner". (3) Structured version record: Create version node V1.2. Record structured semantic link information on the edge connecting V1.1 to V1.2: ① Reason for initiation: User feedback: "The framework and dimensions are too simple. We need to simulate real data to train the in-vehicle AI."; Check the tags: "Change Framework" and "Add Example".
[0074] ②Core changes: 1. Optimized framework: EAR→CRISPE; 2. Refined requirements: Added "multi-dimensional (sentence transformation, word generalization, scene embedding, style diversification)" generalization description; 3. Added background.
[0075] ③ Optimize objectives and logic: Enhance the structured guidance capabilities of Prompt and the authenticity of generated results to meet the requirements of model training data.
[0076] 3.6 FewShot Generation and Optimization The system starts the dynamic Few-Shot generator according to the requirements of the "Experiment" section in V1.2.
[0077] Based on the rules (3 examples, medium complexity, strong domain relevance, format "original instruction + generalization dimension + thought process + generalization result"), examples are generated in real time or retrieved from the library, as shown below.
[0078] The generated examples are integrated into the "Experiment" section of V1.2 to form the final usable Prompt version P. f .
[0079] Example 1: Original instruction: Turn on the air conditioner.
[0080] Generalization dimension: scene embedding + style diversification.
[0081] Thought process: The core function was clearly defined as "air conditioning - turn on operation," taking into account the different expression habits and scenario needs of different users. To address passengers' needs in hot weather, a scenario guide "hot weather" was added, using expressions closer to everyday communication and with diverse styles to ensure the instructions are concise and natural.
[0082] Generalization result: It's too hot, can you turn on the air conditioner for me?
[0083] Example 2: Original instruction: Turn on the air conditioner.
[0084] Generalization dimension: sentence structure transformation + word generalization.
[0085] Thought process: The core function is "air conditioner - turn on operation". Considering different expression habits, the sentence structure was reversed to enhance the flexibility of the command. More colloquial language was used to reduce the technical feel and adapt to diverse users. For example, "turn on" was replaced with "turn on briefly" or "adjust briefly".
[0086] Generalization result: Hey you, turn on that thing that's blowing cold air, hurry up and turn it on.
[0087] Example 3: Original instruction: Turn on the air conditioner.
[0088] Generalization dimensions: sentence structure transformation + word generalization + scenario embedding.
[0089] Thought Process: The core function is "Air Conditioning - Turn On Operation." Considering the characteristic of a car's enclosed space being prone to temperature rise, the real-world scenario of "in-car temperature rising" is incorporated to enhance the rationality of the command trigger. The sentence structure is transformed into a rhetorical question, conveying both the urgency of the user's command and expanding the natural tone of user interaction in real driving scenarios. At the scenario embedding level and word generalization level, the colloquial "turn on" is replaced with "start," while "air conditioning" is expanded to "air conditioning system."
[0090] Generalized result: The car's interior temperature is so high, why isn't the air conditioning system turned on?
[0091] 3.7 Optimization Completed and Loop Closed User Evaluation P f Once satisfied, the optimization process ends. Throughout the process, the system proactively provided optimization ideas, deeply analyzed and understood the user's ambiguous intentions, and fully recorded the evolution logic and semantic links from V1.0 to V1.2 using a version graph. If the user still has new ideas, they can submit them based on P. fA new round of optimizations will be launched, and the system will continue this closed loop.
[0092] The final version, Propmt_V1.2 (without Fewshot), is shown below: Capabilities and Role: You are a professional content generation assistant, specializing in generating high-quality, diverse simulated data for natural language processing and machine learning tasks in the field of intelligent vehicles. You have strong intent understanding and the ability to rewrite user commands in a human-like manner.
[0093] Insight: Current simple commands are insufficient to simulate complex and ever-changing real-world scenarios. The voice command system of intelligent car cockpits needs a large amount of diverse command data that simulates actual in-vehicle scenarios and closely reflects the expression habits of real users for training and testing.
[0094] Statement: Your core task is to perform multi-dimensional, high-quality generalization of the cockpit control commands provided by users, generating a batch of command variants that are semantically the same but express different meanings and are close to real user speech.
[0095] Personality: 1. Improve the human-like and realistic nature of generalized commands from multiple dimensions such as sentence structure transformation, word generalization, scene embedding, and style diversification, and generate intelligent car user control command text that is close to real-world scenarios.
[0096] 2. Please strictly follow the structured requirements provided below to generate generalized instructions that meet your needs.
[0097] Experiments can generalize instructions from single or multiple dimensions. Here are some examples you can learn from: Example 1: Original instruction: Turn on the air conditioner.
[0098] Generalization dimension: scene embedding + style diversification.
[0099] Thought process: The core function was clearly defined as "air conditioning - turn on operation," taking into account the different expression habits and scenario needs of different users. To address passengers' needs in hot weather, a scenario guide "hot weather" was added, using expressions closer to everyday communication and with diverse styles to ensure the instructions are concise and natural.
[0100] Generalization result: It's too hot, can you turn on the air conditioner for me?
[0101] Example 2: Original instruction: Turn on the air conditioner.
[0102] Generalization dimension: sentence structure transformation + word generalization.
[0103] Thought process: The core function is "air conditioner - turn on operation". Considering different expression habits, the sentence structure was reversed to enhance the flexibility of the command. More colloquial language was used to reduce the technical feel and adapt to diverse users. For example, "turn on" was replaced with "turn on briefly" or "adjust briefly".
[0104] Generalization result: Hey you, turn on that thing that's blowing cold air, hurry up and turn it on.
[0105] Example 3: Original instruction: Turn on the air conditioner.
[0106] Generalization dimensions: sentence structure transformation + word generalization + scenario embedding.
[0107] Thought Process: The core function is "Air Conditioning - Turn On Operation." Considering the characteristic of a car's enclosed space being prone to temperature rise, the design incorporates the real-world scenario of "in-car temperature rising," enhancing the rationality of the command trigger. The sentence structure is transformed into a rhetorical question, conveying both the urgency of the user's command and expanding upon the natural tone of user interaction in real driving scenarios. At the scenario embedding level and word generalization level, the colloquial "turn on" is replaced with "start," while "air conditioning" is expanded to "air conditioning system."
[0108] Generalization result: The car's interior temperature is so high, why isn't the air conditioning system turned on? Example 4: Variations in Scene and Core Mechanism The following three different scenarios demonstrate the versatility of this system.
[0109] 4.1 Variation Example 1: Optimization of Academic Paper Abstracts. This example uses text input and emphasizes structure and rigor.
[0110] (1) Input: The user inputs the text "Help me optimize the Prompt for writing academic paper abstracts for large models. The current version is not standardized enough". (2) System Operation: The identification features are {"educational / academic writing", "creativity", "ensuring rigor"}. The system intelligently recommends the BROKE framework and GPT-4 (due to their high historical accuracy scores in this field). The agent may suggest "Should the abstract explicitly include the five elements of 'background, purpose, methods, results, and conclusions'?", "Should the word count of the abstract be limited to 250-300 words?", "Should the use of the first person be prohibited?" to actively mine information.
[0111] (3) User feedback: Check the three suggestion tags above.
[0112] (4) System optimization: Generate a Prompt that integrates all constraints and has a clear structure, and may dynamically generate Few-Shot examples that conform to the norms of each discipline.
[0113] 4.2 Variation Example 2: Code Comment Generation. This example uses multimodal input, with input images and audio.
[0114] (1) Input: The user uploads a screenshot of a complex function code and adds in voice: "Generate detailed comments for this code and explain the algorithm logic clearly." (2) System Operation: Processes multimodal input, VLM recognizes code text, ASR converts the speech to "Generate detailed comments for this code, explaining the algorithm logic clearly.", and merges them into the initial prompt. Recognized features are {"programming development", "code generation / comment", "improving accuracy"}. Intelligently uses dedicated templates for code tasks and the Claude-3 model (due to its outstanding performance in code understanding). Proactively mines and suggests "Should the comment language be Chinese or English?", "Should every line be commented or key function blocks be commented?", "Should time complexity analysis be included?". Generates dynamic Few-Shot "code snippet-detailed comment" example pairs to enhance model understanding.
[0115] 4.3 Variation Example 3: Multi-turn Dialogue Optimization. This example has no explicit initial prompt.
[0116] (1) Input: User's first interaction: "I want AI to play the role of a history teacher, but I don't know how to write a Prompt." (2) System Operation: The system treats this as an extremely vague initial requirement. Feature extraction may only yield {"education", "role-playing"}. It intelligently recommends general role-playing templates and frameworks. A basic role-playing prompt is generated, and proactive data mining immediately begins, posing numerous guiding questions such as "Which historical period should be taught?", "What age group is it aimed at?", "Should the style be serious or humorous?", and "Do we need to design interactive Q&A?". This example highlights the system's proactive guidance capability when user needs are extremely unclear.
[0117] (3) Users work with the system by continuously selecting tags and making simple additions to obtain an accurate prompt.
[0118] The following shows different implementations of the core mechanism.
[0119] (1) Fuzzy Feedback Analysis Method A (as described in Examples 1-3): Use a large model for end-to-end deep decomposition and mapping.
[0120] Method B (Step-by-Step Parsing): First, a model categorizes fuzzy feedback into predefined "problem types," such as "structural problems," "content problems," and "style problems." Then, based on the problem type, different sub-parsing models or rule bases are invoked to generate specific instructions. This method improves the determinism and efficiency of parsing.
[0121] (2) Proactively explore optimization directions Method A (parallel multi-agent evaluation, as in the main embodiment): multiple agents work independently, with broad coverage.
[0122] Method B (Mining Based on Optimization History): The system analyzes past successful optimization cases in the version graph that are similar to the current feature vector. It extracts common optimization patterns or strategies from the "semantic links" of these cases and recommends them to the current user. This method is more data-driven.
[0123] (3) Version Evolution Chart Method A (Structural Deformation): In addition to tree structures, graph structures can be supported. For example, when a new version Vy generated based on a historical version Vx is evaluated and found to be applicable to another completely different historical task version Vz, an "applicability association" edge can be established between Vy and Vz to form a knowledge network and enhance reusability.
[0124] Method B (Link Information Variation): In addition to recording text information, it can store the vector representation of the Prompt before and after optimization, quantify the "degree of change" by calculating the difference in vectors, or store multiple candidate results generated by calling different models to form decision branches.
[0125] Example 5: Modified Device The system of this invention can be deployed in software, hardware, or a combination of both. This invention can be deployed on a cloud server and provide services through a web interface or API. Each module can be microservice-based and scaled independently.
[0126] This embodiment also provides a large-scale intelligent agent Prompt optimization device, including a memory, a processor, and a computer program stored in the memory. When the processor executes the program, it implements the method of any of the embodiments described above.
[0127] Furthermore, this embodiment also provides a medium storing a computer program, which, when executed, implements the method of any of the preceding embodiments.
[0128] Finally, it should be noted that the specific model names, framework names, quantities, etc. mentioned in the above embodiments are all exemplary and not intended to limit the present invention. Any model, framework, or reasonable quantity configuration that can achieve the corresponding function falls within the scope of the present invention. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A Prompt optimization method for large-scale intelligent agents, characterized in that, include: S1: Receive the initial Prompt input by the user and extract the semantic features of the initial Prompt; S2: Based on the semantic features, match and recommend optimized resources from a pre-set resource library, wherein the optimized resources include at least one of optimization templates, optimization frameworks, and optimization models; S3: Optimize the initial Prompt using recommended optimization resources to generate an optimized Prompt; S4: Invoke multiple large model agents to actively evaluate the optimized Prompt in multiple dimensions, and generate at least one feedback suggestion label based on the evaluation results; S5: Receive user feedback, which includes tags selected from the feedback suggestion tags, explicit instructions or vague expressions entered; S6: When the user feedback contains a vague expression, perform in-depth analysis on the vague expression and map it into a specific optimization instruction; S7: Iteratively optimize the current version of Prompt based on user feedback and / or the optimization instructions obtained from parsing; During the optimization process, a version evolution graph is constructed and maintained. The version evolution graph records the iteration relationship of each version Prompt, including the initial Prompt and the Prompts generated in each iteration, in the form of nodes and edges. Structured semantic link information is recorded for the connection edges between adjacent versions. The structured semantic link information includes at least the user feedback content that triggered the generation of the new version and a description of the core changes before and after optimization.
2. The method according to claim 1, characterized in that, In step S1, the extraction of semantic features includes: The initial prompt is subjected to in-depth analysis to automatically identify its scene domain, task type and target requirements, and generate corresponding feature labels and feature vectors; users can add custom labels, and the system-identified labels and user-defined labels are merged to form the semantic features.
3. The method according to claim 1, characterized in that, In step S2, matching and recommending optimized resources from a pre-set resource library includes: The feature vector is semantically matched with the meta tags in the resource library. The meta tags represent the applicable scenarios, task types, or requirements of the resources. The resource library includes a template library that stores preset Prompt structure templates for different scenarios, a framework library that stores advanced Prompt engineering frameworks, and a model library that stores performance data of different AI models. Based on the matching degree, recommend one or more candidate Prompt templates and / or Prompt project frameworks; and / or, based on the feature vector and the user-specified task requirement attributes, recommend an AI model for this optimization.
4. The method according to claim 1, characterized in that, Step S3 also includes: After generating the optimized Prompt, it is determined according to preset rules whether it is necessary to dynamically generate or match Few-Shot examples from the example library for the optimized Prompt. If so, based on the content of the optimized Prompt, generate or retrieve a specified number of high-quality input-output example pairs with a specified complexity, domain relevance, and format requirements, and integrate the example pairs into the Prompt for the next round of optimization or the final output.
5. The method according to claim 1, characterized in that, In step S4, the invocation of multiple large model agents for proactive multi-dimensional evaluation includes: Call at least two large model agents with different evaluation focuses in parallel or serial manner; Each large model agent independently evaluates the optimized Prompt by selecting one or more dimensions from a preset set of evaluation dimensions, and outputs evaluation opinions and / or modification suggestions. The outputs proposed by each agent are deduplicated, clustered, and prioritized to generate a specified number of clearly guiding feedback suggestion labels for the user to choose from.
6. The method according to claim 1, characterized in that, The construction and maintenance of the version evolution graph includes: storing the initial Prompt as the root node in the version evolution graph; and linking the new Prompt generated in each iteration as a child node to its corresponding root node.
7. A large-scale intelligent agent Prompt optimization system, characterized in that, include: The input processing and version management module (100) is used to receive and standardize the initial Prompt of user input, extract its semantic features, and construct and manage a version evolution graph that records the evolution relationship of Prompt versions. The intelligent recommendation module (200) is used to intelligently recommend optimized resources from a pre-set resource library based on the semantic features. An optimization module (300) is used to optimize the initial Prompt using recommended optimization resources to generate an optimized Prompt. The feedback intelligent parsing and optimization direction mining module (400) is used to actively call multiple large model agents to perform multi-dimensional evaluation and generate at least one feedback suggestion label after the optimization generation module (300) outputs the optimized Prompt, and to receive and parse user feedback, wherein the user feedback includes the selection of the feedback suggestion label, the input of explicit instructions or fuzzy expressions; when the user feedback contains fuzzy expressions, it is parsed into specific optimization instructions; The system drives the generation optimization module (300) to perform iterative optimization based on the optimization instructions obtained by the feedback intelligent analysis and optimization direction mining module (400), and the input processing and version management module (100) updates the version evolution map.
8. The system according to claim 7, characterized in that, The input processing and version management module (100) includes: A multimodal input adapter unit (110) is used to receive text, image or audio input and convert it into a standardized text prompt; The semantic feature extraction and labeling unit (120) is used to analyze the standardized text Prompt, identify the scene domain, task type and target requirements, and generate feature vectors; The version evolution graph management unit (130) is used to store different versions of the Prompt in a tree or graph structure, record optimized semantic link information for the connection edges between adjacent versions, and support version rollback, branch creation and semantic-based version clustering operations.
9. The system according to claim 7, characterized in that, The feedback intelligent analysis and optimization direction mining module (400) includes: The feedback intelligent parsing unit (410) is used to directly convert the user's explicit instructions or selected tags into optimization instructions, and to perform semantic deep decomposition and requirement mapping on ambiguous expressions, and convert them into specific optimization instructions; The optimization direction active mining unit (420) is used to call multiple large model agents in parallel to evaluate the optimized Prompt, and generate the feedback suggestion label based on the evaluation results.
10. A large-scale intelligent agent Prompt optimization device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method as described in any one of claims 1 to 6.