Cue word layered optimization method for complex problem decomposition
Through the hierarchical task modeling and feedback-driven prompt word optimization methods, the problem of difficulty in logical hierarchical understanding in complex problem processing and lack of systematic optimization of prompt word optimization is solved, and higher task processing capabilities and output accuracy are achieved, and the stability and adaptability of prompt words are enhanced.
Patent Information
- Application Number
- CN202510712716.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-30
- Publication Date
- 2025-07-01
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
When the prior art deals with complex problems, it is difficult to accurately understand the logical level of the problem, resulting in inaccurate and incomplete generation results, and lack of systematic means for prompt word optimization, affecting generalization capabilities, poor stability of output results, lack of dynamic optimization mechanisms, and is susceptible to noise interference.
The hierarchical task modeling and prompt word optimization methods are adopted, and complex tasks are disassembled into multiple subtasks through dependency analysis, semantic analysis and task disassembly algorithms, and the first-level, second-level, third-level and deeper prompt words are generated. The feedback-driven optimization mechanism is used to dynamically adjust the prompt word structure to improve the task completion rate and output accuracy.
It improves the processing capability and output accuracy of complex tasks, enhances the generalization ability and stability of prompt words, realizes dynamic optimization and adaptability improvement, reduces noise interference, and ensures the consistency and reliability of task execution.
Smart Images

Figure CN120234399A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of artificial intelligence (AI) and natural language processing (NLP), and particularly to a method for optimizing hierarchical prompts, aiming to improve the performance of large language models (LLMs) in complex problem parsing and reasoning tasks. Specifically, it is a method for hierarchical optimization of prompts for complex problem decomposition. Background Art
[0002] With the wide application of large language models (such as GPT, LLAMA, etc.) in various industries, the quality of tasks such as intelligent question answering, automated writing, and code generation depends on the design of prompts (Prompts). However, when dealing with complex problems, the existing technologies face the following challenges: 1. Unreasonable decomposition of complex tasks: The model is difficult to accurately understand the logical hierarchy of complex problems, resulting in inaccurate, incomplete, or even self-contradictory generation results.
[0003] 2. Optimization of prompts relying on manual design: Most methods rely on manual adjustment of prompts, lacking systematic optimization means, which affects the generalization ability of prompts.
[0004] 3. Poor stability of output results: For the same task, under different prompt designs, completely different outputs may be generated, lacking consistency and reliability.
[0005] 4. Lack of dynamic optimization mechanism: Existing methods are difficult to automatically adjust prompts according to task requirements and model feedback to improve the task completion rate.
[0006] 5. The reasoning chain is easily interfered by noise: An unreasonable task decomposition structure may lead to the loss of key information or the generation of irrelevant content during the reasoning process. Summary of the Invention
[0007] To solve the above technical problems, the present invention provides a method for hierarchical optimization of prompts for complex problem decomposition, which can adaptively optimize the task decomposition process and improve the processing ability and output accuracy of complex tasks.
[0008] The technical solution of the present invention is: A method for hierarchical optimization of prompts for complex problem decomposition, which guides the large language model to gradually parse complex problems by establishing a task decomposition + prompt hierarchy + feedback optimization mechanism, improving the reasoning quality and the stability of the generation results.
[0009] Including: 1. Hierarchical task modeling: Using methods such as dependency analysis and semantic parsing, decompose complex tasks into multiple subtasks to form a multi-level problem structure.
[0010] 2. Hierarchical Prompt Optimization: Generate first-level, second-level, third-level, and deeper-level prompts for different hierarchical tasks to ensure reasonable task decomposition.
[0011] 3. Feedback-Driven Optimization: Dynamically optimize each layer of prompts based on the model output quality (accuracy, consistency, etc.) to improve the task completion rate.
[0012] 4. Example Enhancement Mechanism: Introduce high-quality examples to enhance the model's understanding ability and reduce incorrect reasoning.
[0013] 5. Multi-Round Interaction Optimization: Combine user feedback to adjust the prompt structure to make it more in line with the actual task requirements and improve adaptability.
[0014] Furthermore, Adopt dependency analysis, syntactic parsing, and task decomposition algorithms to deeply understand and process the input natural language instructions or task descriptions, thereby identifying the logical relationships between various subtasks and finally constructing a clear task hierarchical structure.
[0015] Even further, Dependency analysis analyzes the dependency relationships between words in a sentence to identify the grammatical structures of subject-predicate, verb-object, and adverbial, and clarify the associations between various elements in the task.
[0016] Syntactic parsing uses grammar tree construction to parse natural language instructions into grammar trees using syntactic analysis techniques to clarify the structural composition of the statements.
[0017] Utilize the analysis results of the task decomposition algorithm to further break down the overall task into several executable subtasks, and identify the execution order, dependency relationships, and hierarchy between the subtasks.
[0018] Form a task hierarchical structure, where all identified subtasks are organized into a tree-like or graph-like structure according to their logical relationships; the root node represents the overall target task, the child nodes represent specific subtasks, and the dependency edges indicate the front-to-back dependencies or conditional trigger relationships between them; Decompose into first-level, second-level, third-level, and deeper-level subtasks according to task complexity and logical dependencies to form a task tree.
[0019] Furthermore, The generation of the hierarchical prompts includes first-level, second-level, third-level, and deeper-level task prompts, where: The first-level prompts are used to define the overall task goal and provide task context; The second-level prompts refine the task execution method and clarify the key parameters and limiting conditions; The third-level and deeper-level prompts provide precise guidance for specific subtasks to ensure clear prompt logic, clear task division of labor, and adaptation to different task complexities.
[0020] Furthermore, Model Output Quality Assessment: Adopt consistency analysis and context relevance detection to evaluate the accuracy and coherence of the output; convert the context and the output text into vector representations, calculate the cosine similarity between the vectors to obtain the semantic similarity value, and judge the context relevance according to the semantic similarity value. The closer the value is to 1, the higher the semantic relevance; Feedback-Driven Optimization: Automatically adjust the expression of the prompt words according to the model's performance to improve adaptability; Adopt an incremental learning mechanism to enable the model to gradually adapt to the optimized prompt word structure; Example Reinforcement Learning: Add high-quality examples to the prompt words at different levels to help the model better understand the task requirements; Adopt annotated examples to improve the quality of the examples.
[0021] The present invention optimizes the expression of the prompt words by layering and adjusts the task decomposition strategy to improve the execution effect and adaptability of complex tasks.
[0022] The task parsing divides complex problems into subtasks at different levels according to logical relationships to ensure the rationality and executability of the task decomposition.
[0023] The feedback optimization mechanism adopts consistency analysis, context optimization, and adaptive adjustment strategies. By dynamically analyzing the execution results of the prompt words and combining multi-round feedback data, it optimizes the expression of the prompt words to make them more targeted and executable, improving the accuracy and stability of task completion.
[0024] Example reinforcement learning adds high-quality examples, best practice templates, and dynamic case matching mechanisms to the prompt words at different levels. Through the guiding role of the examples, it improves task adaptability, optimizes the generalization ability of the prompt words for different problem types, and enhances the model's understanding ability of specific tasks.
[0025] Support multi-round interaction, make real-time adjustments in combination with user feedback, optimize the expression of the prompt words to make them more in line with user needs, continuously improve the task completion rate, and support personalized adjustment to adapt to the task preferences and problem backgrounds of different users.
[0026] Applicable to different fields, including but not limited to legal document generation and optimization, code generation and debugging, scientific research writing and paper assistance, business analysis and decision support, intelligent customer service and dialogue system optimization, etc., ensuring that the task execution efficiency and quality can be effectively improved in various application scenarios.
[0027] Supports cross-modal input, is compatible with various data formats such as text, code, images, audio, and video, and can combine multi-modal information for comprehensive analysis to achieve more accurate task decomposition and prompt optimization, improving the intelligent level and wide applicability of task execution. Brief Description of the Drawings
[0028] Figure 1 It is a schematic diagram of the workflow of the present invention. Detailed Embodiments
[0029] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0030] The present invention proposes a method for hierarchical optimization of prompts for complex problem decomposition, which can adaptively optimize the task decomposition process and improve the processing ability and output accuracy of complex tasks.
[0031] The present invention adopts a combination of hierarchical task modeling, prompt optimization, and feedback-driven adjustment to make the parsing and execution of complex tasks more accurate and stable.
[0032] Its core technical solutions include: Task decomposition: Using dependency analysis and knowledge graph modeling to construct a hierarchical task structure and decompose complex tasks into several subtasks.
[0033] Hierarchical prompt generation: Generate prompts with different levels of refinement for tasks at different levels to ensure that the model reasons in a reasonable order.
[0034] Adaptive optimization: Automatically optimize the prompt structure according to task feedback and model output quality to improve the overall effect.
[0035] Specific implementation steps Step 1: Task parsing and hierarchical modeling
[0036] Obtain the complex problem input by the user, perform semantic analysis and task recognition, and determine the main task objective.
[0037] To achieve the efficient management and execution of complex tasks, the system uses dependency analysis, syntactic parsing, and task decomposition algorithms to deeply understand and process the input natural language instructions or task descriptions, thereby identifying the logical relationships between each subtask and finally constructing a clear task hierarchical structure.
[0038] Dependency Analysis By analyzing the dependency relationships between words in a sentence, identify syntactic structures such as subject-predicate, verb-object, and adverbial-middle, and clarify the associations between various elements in the task. For example, in the sentence "First complete data preprocessing, and then train the model", the system can identify that "completing data preprocessing" is a precondition for "training the model".
[0039] Given a sentence S={w1,w2,…,wn}, the goal is to construct a dependency tree (or graph): ; where: T(S): The set of all possible dependency trees; (h,d): Dependency relationship pair (head, dependent); score(h,d): The score of the dependency pair, usually calculated by a neural network model such as BiLSTM+biaffine scoring.
[0040] Syntactic Parsing ; Syntax tree construction (based on Probabilistic Context-Free Grammar PCFG): P(T): The prior probability of the syntax tree; P(S∣T): The probability of generating a sentence under a given syntax tree; In practice, the CKY algorithm is used for parsing, or a Transformer-based Parser (such as BERT-based Constituency Parser) is used.
[0041] Apply syntactic analysis techniques to parse natural language instructions into syntax trees, clarifying the structural composition of the statements (such as noun phrases, verb phrases, etc.). This helps to determine whether the task is in a parallel, sequential, or conditional relationship, and can also assist in subsequent task decomposition and classification.
[0042] Task Decomposition Algorithm Given a task graph G=(V,E), where each node represents a subtask and each edge represents a dependency relationship. The goal is to find a set of subgraphs {G1,G2,…,Gk} such that: ; Based on the above analysis results, the system further splits the overall task into multiple executable subtasks and identifies the execution order, dependency relationships, and hierarchies among the subtasks. This algorithm takes into account semantic relationships, contextual meanings, and logical instruction structures to achieve a modular and structured representation of the task.
[0043] Form a hierarchical task structure All identified subtasks are organized into a tree-like or graph-like structure according to their logical relationships (such as sequence and subordination). The root node represents the overall target task, the child nodes represent specific subtasks, and the dependency edges indicate the forward and backward dependencies or conditional triggering relationships between them. This structure not only facilitates the system scheduling and execution but also provides a good foundation for task monitoring, failure backtracking, and optimization.
[0044] According to the task complexity and logical dependencies, it is decomposed into first-level, second-level, third-level, and deeper-level subtasks to form a task tree. The task complexity is calculated using the following method: (1) Factor evaluation method based on task characteristics Comprehensively consider the task difficulty, including requirements such as knowledge, skills, and experience required for the task; task scale, including the scope and quantity involved in the task; time limit, that is, the urgency for the task to be completed within a certain time; resource requirements, such as inputs of human, material, and financial resources. Quantify and score each factor, determine the corresponding weights, and then calculate the total task complexity score through weighted summation.
[0045] Task complexity = ∑(task impact factor value × corresponding weight) Among them, task impact factors include task difficulty, scale, time limit, resource requirements, etc.
[0046] (2) Analogy method based on algorithm complexity Analogize the task to the execution process of a certain known algorithm, and refer to the time complexity or space complexity of the algorithm to evaluate the task complexity. Or for some tasks with recursive or divide-and-conquer characteristics, a recursive tree can be constructed to analyze the number and scale of recursive calls at each layer, so as to deduce the task complexity.
[0047] Step 2: Hierarchical generation of prompting words
[0048] First-level prompting words (high-level task guidance): 1. Define the overall task goal to guide the model to understand the global framework.
[0049] 2. Use open-ended questions (such as "Please analyze the main steps of...") to ensure that the model covers key points.
[0050] Secondary Prompt (Sub - task Refinement): Further decompose the task according to the overall task objective. During the decomposition process, ensure that each part has relative independence, that is, each part has clear inputs and outputs, and the boundaries with other sub - tasks are clear. At the same time, the sub - tasks should be operable and can be specifically executed and completed. Generate targeted prompt words for each key part.
[0051] Adopt targeted instructions (such as "Please describe in detail the execution steps of...") to enhance the clarity of task execution.
[0052] Tertiary and Deeper Prompts (Fine - grained Control): Refine to specific task modules, such as formula derivation, code writing, logical reasoning, etc.
[0053] Adopt restrictive instructions (such as "Please elaborate based on the XXX method") to enhance the precision of reasoning.
[0054] Step 3: Feedback Optimization and Example Enhancement
[0055] Model Output Quality Assessment: Adopt consistency analysis and context relevance detection to evaluate the accuracy and coherence of the output. Convert the context and the output text into vector representations, calculate the cosine similarity between the vectors to obtain the semantic similarity value, and judge the context relevance according to the semantic similarity value. The closer the value is to 1, the higher the semantic relevance; ; Based on scoring metrics (such as BLEU, ROUGE, etc.), compare different prompt word schemes.
[0056] Feedback - driven Optimization: According to the model's performance, automatically adjust the expression of the prompt words to improve adaptability.
[0057] Adopt an incremental learning mechanism to enable the model to gradually adapt to the optimized prompt word structure.
[0058] Example - based Reinforcement Learning: Add high - quality examples to prompts at different levels to help the model better understand the task requirements.
[0059] Adopt annotated examples to improve the quality of examples and enhance the model's generalization ability.
[0060] The above are only the preferred embodiments of the present invention, which are only used to illustrate the technical solutions of the present invention and are not used to limit the protection scope of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention are included in the protection scope of the present invention.
Claims
1. A method for hierarchical optimization of prompting words for complex problem decomposition, characterized in that it includes: (1) Hierarchical task modeling: Using dependency analysis and semantic parsing methods, decompose complex tasks into several subtasks to form a multi-level problem structure; (2) Hierarchical prompting word optimization: Generate first-level, second-level, third-level and deeper-level prompting words for different hierarchical tasks to ensure reasonable task decomposition; (3) Feedback-driven optimization: Dynamically optimize the prompting words at each layer based on the model output quality; (4) Example reinforcement mechanism: Introduce examples to enhance the model's understanding ability and reduce incorrect reasoning; (5) Multi-round interactive optimization: Combine user feedback to adjust the prompting word structure to make it more in line with the actual task requirements.
2. The method according to claim 1, characterized in that By using dependency analysis, syntactic parsing and task decomposition algorithms, deeply understand and process the input natural language instructions or task descriptions, so as to identify the logical relationships between various subtasks, and finally construct a clear task hierarchy structure.
3. The method according to claim 2, characterized in that Dependency analysis: By analyzing the dependency relationships between words in a sentence, identify the grammatical structures of subject-predicate, verb-object, and adverbial, and clarify the associations between various elements in the task.
4. The method according to claim 2, characterized in that Syntactic parsing uses grammar tree construction, and uses syntactic analysis technology to parse natural language instructions into grammar trees to clarify the structural composition of sentences.
5. The method according to claim 2, characterized in that Using the analysis results of the task decomposition algorithm, further decompose the overall task into several executable subtasks, and identify the execution order, dependency relationships and levels between the subtasks.
6. The method according to claim 2, characterized in that Form a task hierarchy structure, and all identified subtasks are organized into a tree-like or graph-like structure according to their logical relationships; the root node represents the overall target task, the child nodes represent specific subtasks, and the dependency edges indicate the front-back dependency or conditional trigger relationships between them; Decompose into first-level, second-level, third-level and deeper-level subtasks according to task complexity and logical dependencies to form a task tree.
7. The method according to claim 1, characterized in that First-level prompting words: Used to define the overall task goal and provide task context; Second-level prompting words: Refine the task execution method and clarify key parameters and limiting conditions; Third-level and deeper-level prompting words: Deeper-level prompting words guide specific subtasks to ensure clear prompting word logic, clear task division of labor, and adaptation to different task complexities.
8. The method according to claim 1, characterized in that Model output quality evaluation: Adopt consistency analysis and context relevance detection to evaluate the accuracy and coherence of the output; Convert the context and output text into vector representations, calculate the cosine similarity between the vectors to obtain the semantic similarity value, and judge the context relevance according to the semantic similarity value. The closer the value is to 1, the higher the semantic relevance; Feedback-driven optimization: According to the model performance, automatically adjust the expression way of the prompting words to improve adaptability; Adopt an incremental learning mechanism to enable the model to gradually adapt to the optimized prompt structure; Example reinforcement learning: Add high-quality examples to prompts at different levels to help the model better understand the task requirements; Use annotated examples to improve the quality of examples.
Citation Information
Patent Citations
Large model cue word optimization method and device, equipment and storage medium
CN118410778A
Task decomposition method and system based on large language model
CN118520073A
Service combination method based on large language model
CN118709784A
Method and system for optimizing large model task planner based on cue words
CN118747209A
Prompt word optimization method and system based on large language model
CN119047482A
Cited By
Bayesian automatic cue word optimization method based on meta cue word
CN120832540A
Complex task-oriented multi-level cue word generation method
CN120893589A
A multi-level prompt word generation method for complex tasks
CN120893589B
Artificial intelligence data annotation and cue word automatic construction engine system
CN120950973A
News content generation-oriented multi-module collaborative cue word optimization method
CN121658629A