Task planning PDDL file automatic generation method based on natural language input
By constructing a pre-trained large language model and dynamic knowledge base based on the Transformer architecture, the problems of PDDL development relying on experts and the poor adaptability of static knowledge bases are solved, achieving efficient and reliable PDDL file generation, which is suitable for multi-domain task planning.
Patent Information
- Application Number
- CN202511491870.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-17
- Publication Date
- 2026-01-23
AI Technical Summary
In existing technologies, PDDL development relies on experts, and NL2PDDL suffers from insufficient reliability, poor adaptability of static knowledge bases, and low verification efficiency, making it difficult to effectively apply intelligent planning technology in real-time dynamic scenarios.
We construct a pre-trained large language model based on the Transformer architecture, combine a low-rank adaptation layer and a dynamic knowledge base, and generate PDDL files through multi-level automated evaluation to achieve end-to-end task planning.
It significantly reduces the generation error rate, improves dynamic adaptability and verification efficiency, enhances cross-domain migration capabilities, and improves system response speed and accuracy.
Smart Images

Figure CN121387250A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to the field of computer application, and discloses a task planning PDDL file automatic generation method based on natural language input. BACKGROUND
[0002] Planning Domain Definition Language (PDDL) is a core modeling language for artificial intelligence automatic planning. It defines the state space, action model and target state of a planning problem through formal syntax, and supports intelligent decision-making systems to generate optimal action sequences. In the field of industrial logistics scheduling, PDDL can optimize warehouse robot collaborative handling paths; in military simulation, it can accurately describe complex action logic such as "warplanes avoiding radar reconnaissance and then implementing strikes".
[0003] However, traditional PDDL development highly depends on manual writing by professionals. Developers need to be proficient in first-order logic expression and PDDL syntax specifications (such as ADL extensions), which results in a high threshold for access. For example, in the task planning of unmanned aerial vehicles, "the reconnaissance process needs to avoid weather disturbed areas" needs to be coded as: precondition(not(weather_disturbed?area)), which is not user-friendly for non-experts. The more prominent contradiction is development efficiency: the average time spent on PDDL development in a single logistics planning field is as long as 12.3 man-days, of which 68% is consumed in debugging logical contradictions. The DARPA 2022 challenge records show that the failure of 30% of the participating teams to plan tasks is directly caused by the failure to update PDDL path constraints in time due to the addition of no-fly zones in the battlefield.
[0004] To reduce the threshold for use, researchers have proposed natural language to PDDL (NL2PDDL) technology. Early methods based on template matching (such as the SUMO project) rely on fixed rule libraries and can only handle limited scenarios. When faced with complex constraints such as "transport vehicles preferentially choosing paths that are fuel-efficient and avoiding enemy areas", the generalization ability drops to less than 40%, and the maintenance cost of templates increases exponentially with the expansion of the field. In recent years, end-to-end pre-trained models (such as PlanGen proposed by AAAI 2022) directly generate PDDL, but they face two major challenges: logical illusions and structural errors. The model fabricates undefined predicates (such as generating (fuel_efficient?path) without declaring the predicate), and omits parameter types (such as the drive action missing the?vehicle type declaration), resulting in a 52.7% failure rate of the planner parser, which seriously restricts the practical value.
[0005] To address the above shortcomings, the PDDL-KB scheme proposed by ICAPS 2023 attempts to introduce a static knowledge base to store predefined action templates. However, its knowledge update lag leads to insufficient adaptation to dynamic scenarios, and the architecture that does not deeply collaborate with the generation model causes more than 34% of constraint conflict rates. More critically, existing technologies generally lack automated verification mechanisms - syntax errors rely on manual VAL tool detection, logical contradictions require domain expert intervention for diagnosis, and error correction cycles can last for several hours. AAMAS 2024 research report points out that due to the lack of closed-loop feedback, the recurrence rate of similar logical errors in the system exceeds 65%, forming a persistent technical debt.
[0006] The current technical ecosystem has three structural contradictions: end-to-end models struggle to balance between generalization and reliability, manual verification accuracy and automation needs are mutually opposed, and static knowledge bases and real-time environmental adaptation needs are fundamentally in conflict. These deficiencies are amplified in real-time dynamic scenarios such as emergency response and military decision-making, becoming key bottlenecks restricting the landing of intelligent planning technology. Breaking through this bottleneck requires building a systematic solution that integrates dynamic knowledge enhancement, real-time constraint generation, and closed-loop self-correction. SUMMARY
[0007] In view of the above background, the purpose of the present application is to provide a task planning PDDL file automatic generation method based on natural language input, to solve the problems of PDDL development relying on experts, insufficient reliability of NL2PDDL, poor adaptability of static knowledge base, and low efficiency of verification in the prior art; the scheme has the advantages of low error rate, fast dynamic response, strong multi-field migration, etc.
[0008] The application achieves the purpose of the invention by adopting the following technical solutions, the specific steps are as follows:
[0009] (10) Construct a task environment description word.
[0010] (11) Analyze the task environment: receive original task environment data such as natural language description, sensor data or user input, etc.; identify entities, participants and spatial relationships in the environment; extract constraint conditions such as time limit, weather constraint and physical rule, etc.
[0011] (12) Extract structured task description words: convert the analysis results into structured feature description words such as Json format structured description words, NL2Json is a mature technology, which can be realized by using BERT-Bi-LSTM-CRF model.
[0012] (20) Build a knowledge-enhanced fine-tuning model.
[0013] (21) Pre-training large model selection: Select a pre-trained large language model based on the Transformer architecture as the base model, which has an optimized weight distribution in code generation and structured text processing tasks;
[0014] (22) Low-rank adaptation layer injection: Inject a trainable low-rank adaptation layer into the attention mechanism module of the base model while freezing the original parameter matrix of the base model;
[0015] (23) Dynamic knowledge base coupling: Construct a vectorized retrieval database associated with domain knowledge documents, and encode professional terms and rules into dense vector representations through a dedicated embedding model;
[0016] (24) Joint optimization training: Concatenate the output tensor of the low-rank adaptation layer with the knowledge vector obtained from the vectorized retrieval database, input it into the language generation head module for end-to-end training, and update the parameters through the task-specific loss function backpropagation;
[0017] (30) PDDL file generation and knowledge constraints.
[0018] (31) Multi-source input integration step: Concatenate the structured task description words generated in step (10), the domain prompt words retrieved from the vector database constructed in step (20), and the pre-defined PDDL syntax specification constraints to form a fusion input tensor;
[0019] (32) Constraint-guided generation step: Input the fusion input tensor into the knowledge-enhanced fine-tuning model built in step (20), and generate a domain definition file that conforms to the PDDL syntax specification through the topological attention mechanism in the model;
[0020] (40) Multi-level dynamic evaluation.
[0021] (41) Syntax compliance verification: Perform lexical analysis and syntax tree construction on the generated domain definition file through the PDDL syntax parser to detect bracket nesting matching exceptions, keyword missing, and parameter type conflict;
[0022] (42) Static semantic verification: Use a predicate logic verifier to check the consistency of action precondition and effect declaration, and identify undefined predicate reference and parameter type out-of-bound error;
[0023] (43) Dynamic solvability verification: Call the VAL planning verifier to build a state transition graph, execute the action sequence in a simulated environment, and detect target reachability conflicts;
[0024] (44) Resource constraint audit: Calculate the action execution cost through the resource consumption model, and verify whether the task planning scheme meets the pre-designed computational complexity threshold;
[0025] (50) Model closed loop iterative optimization.
[0026] (51) Compliance knowledge persistence: When the multi-level dynamic evaluation result of step (40) is compliance, the corresponding natural language task description and the generated PDDL domain definition file are composed into a knowledge pair and stored in the vector database constructed in step (20);
[0027] (52) Error-oriented feedback: When the multi-level dynamic evaluation of step (40) detects semantic conflicts or syntax violations, the error type code and context information are encapsulated as an optimization instruction set, which is input to step (30) to trigger PDDL file regeneration;
[0028] (53) Periodic fine-tuning trigger: According to the accumulation amount of knowledge pairs in the vector database, automatically start the fine-tuning model parameter update process of step (20), and use the new knowledge pairs for incremental training.
[0029] Compared with the prior art, the beneficial effects of the present application mainly lie in the following aspects:
[0030] Significant improvement in reliability: Through synergistic retrieval enhancement and efficient parameter fine-tuning, the logical illusion and structural error problems of existing end-to-end models are effectively overcome, and the PDDL generation error rate is greatly reduced;
[0031] Enhanced dynamic adaptability: Based on the real-time knowledge fusion mechanism, the system quickly responds to changes in environmental constraints, significantly reducing constraint conflicts caused by static knowledge bases;
[0032] Innovative verification efficiency: The multi-level automated evaluation system replaces manual verification, greatly shortening the error repair cycle and improving the response timeliness of complex scenarios;
[0033] Strengthen the field migration ability: The cross-field task processing success rate is significantly improved, and the field migration development cost is greatly reduced. BRIEF DESCRIPTION OF DRAWINGS
[0034] Figure 1 is a method step flowchart of the present application
[0035] Figure 2 is a system architecture schematic diagram of the present application
[0036] Figure 3 is a Lora fine-tuning pre-training large model schematic diagram
[0037] Figure 4 is a fine-tuning model generating PDDL file flowchart
[0038] Figure 5 is a multi-level evaluation flowchart
[0039] Figure 6 is a closed-loop iterative optimization flowchart
[0040] Figure 7 is a natural language to PDDL file result schematic diagram
[0041] Figure 8 is a knowledge base iterative update schematic diagram DETAILED DESCRIPTION
[0042] In order to make the purpose, technical scheme and advantages of the present application more clear, specific implementation will be further described below in conjunction with the drawings.
[0043] The design of the present application proposes a task planning PDDL file automatic generation method based on natural language input, such as Figure 1 Figure 2 As shown, the following steps are included:
[0044] (10) Construct task environment description words: analyze task environment elements and participants, and extract structured task description words.
[0045] The step of constructing task environment description words in the above (10) is specifically:
[0046] (11) Analyze the task environment: receive raw task environment data such as natural language description, sensor data or user input, etc.; identify entities, participants and spatial relationships in the environment; extract constraints such as time limit, weather constraint and physical rules, etc.
[0047] (12) Extract structured task description words: convert the analysis results into structured feature description words such as Json format structured description words. NL2Json is a mature technology, which can be realized by using BERT-Bi-LSTM-CRF model.
[0048] Technical selection basis:
[0049] Based on the BERT-Bi-LSTM-CRF architecture verified by the industry, the pre-trained model weight is directly called to avoid the calculation resource consumption caused by repeated training. The model selection standard follows:
[0050]
[0051] Among them: Candidate model set, F1 CoNLL F1 value of the model on the CoNLL-2023NER task, Json valid Json structure legality score, a and β are weighting coefficients.
[0052]
[0053] where d is the BERT-base hidden dimension, fixed at 768, h is the BiLSTM hidden unit number, fixed at 256, inter-sign set, is the JsonSchema rule library. Through existing mature natural language processing large models, standard Json structured description words can be generated for subsequent large model fine-tuning and calling.
[0054] (20) Build a knowledge-enhanced fine-tuning model: the model integrates vector RAG knowledge base retrieval results and pre-training model parameters to suppress logical hallucinations.
[0055] As Figure 3 shown, the steps of the above (20) building a knowledge-enhanced fine-tuning model are specifically:
[0056] (21) Pre-training large model selection: select a pre-training large language model based on the Transformer architecture (such as CodeLlama, ChatGLM3) as the base model, and its core advantage is the optimized weight distribution of code generation and structured text processing tasks. The feedforward calculation process of the base model is defined as:
[0057] H out =Transformer(H in )
[0058] where d is the hidden layer dimension (typical value is 4096), and n is the input sequence length. The model captures structured dependencies through multi-head attention mechanism:
[0059]
[0060] By retaining the general language understanding ability obtained in the pre-training stage, the amount of data required for professional field training is greatly reduced, while the efficient inference characteristics of the base model are maintained.
[0061] (22) Low-rank adaptation layer injection: inject a trainable low-rank adaptation layer (LoRA) into the attention mechanism module of the base model, while freezing the original parameter matrix W base of the base model. The specific implementation is to introduce parameter increments in the query (W q ) and value (W v ) projection matrices:
[0062] H out =W base H in +ΔWH in
[0063] ΔW=BA
[0064] wherein (r << d, typical value r = 8), k is the attention head dimension.
[0065] (23) Dynamic knowledge base coupling: build a professional vectorized retrieval database associated with the field knowledge document, encode professional terms and rules into dense vector representation through a special embedding model. Retrieve the most relevant knowledge fragments in real time during the training process to solve the problem of insufficient professional knowledge of pre-trained models.
[0066] To enhance the professional knowledge processing capability, a field-specific vector knowledge base is constructed simultaneously to store task-related professional knowledge constraints:
[0067] D = {f emb (t i )|i = 1,..., N}
[0068] where f emb : is a special embedding model (d k = 1024). Knowledge retrieval is performed in real time during the training process:
[0069]
[0070] Obtain the k most relevant knowledge fragments K = [k1,...,k k ] T .
[0071] (24) Joint optimization training: the output tensor h' of the low-rank adaptation layer is channel spliced with the knowledge vector K obtained from the vectorized retrieval database:
[0072]
[0073] where the trainable gating matrix G dynamically adjusts the knowledge contribution degree through regularization constraint. The final output is trained end-to-end through the language generation head:
[0074] y^ = Decoder(Z)
[0075] Update the parameters through the task-specific loss function backpropagation:
[0076] L = CE(y, y^) + λ||G|| F
[0077] Contains standard cross-entropy loss and Frobenius norm regularization term of gating matrix (λ = 0.2), updates the low-rank matrix parameters {B, A} and gating matrix G simultaneously through end-to-end backpropagation, significantly improves the accuracy and suppresses hallucination.
[0078] (30) PDDL file generation and knowledge constraint: drive the fine-tuning model to combine the scene semantics and knowledge base rules to output the correct PDDL file.
[0079] As shown in Figure 4 , the step of the above (30) PDDL file generation and knowledge constraint is specifically:
[0080] (31) Multi-source input integration step: vector splicing of the structured task description words generated in step (10), the domain prompt words retrieved from the vector database constructed in step (20), and the pre-defined PDDL syntax specification constraints to form a fusion input tensor.
[0081] In the multi-source input integration step, the structured task description words D task , the retrieved domain prompt words P domain , and the PDDL syntax specification G pddl are vectorized and spliced:
[0082] X fusion =Concat[φ(D task ), ψ(P domain ), Ω(G pddl )]
[0083] Where φ(·) is a task description encoder, ψ(·) is a knowledge base retrieval vector (from step (20)), and Ω(·) is a pre-defined syntax constraint encoder. The fusion tensor X fusion integrates the triple constraints of task semantics, domain knowledge, and syntax specification.
[0084] (32) Constraint-guided generation step: input the fusion input tensor into the knowledge-enhanced fine-tuning model built in step (20) to generate a domain definition file that meets the PDDL syntax specification through the model:
[0085] O pddl =LLM rag-lora (X in ; W pddl )
[0086] (40) Multi-level dynamic evaluation: verify the instructions through the knowledge base rule matching degree and execution feasibility index.
[0087] As shown in Figure 5 , the step of the above (40) multi-level dynamic evaluation is specifically:
[0088] (41) Syntax compliance verification: perform lexical analysis and syntax tree construction on the generated domain definition file through the PDDL syntax parser to detect bracket nesting matching abnormalities, keyword missing, and parameter type conflicts;
[0089] (42) Static semantic verification: using predicate logic verifier to check the consistency of action precondition and effect declaration, identify undefined predicate reference and parameter type out-of-bound error;
[0090] (43) Dynamic solvability verification: call VAL planner verifier to build state transition graph, execute action sequence in simulation environment and detect target reachability conflict;
[0091] (44) Resource constraint audit: calculate action execution cost through resource consumption model, verify whether the task planning scheme meets the pre-designed computational complexity threshold;
[0092] (50) Model closed-loop iterative optimization: update RAG knowledge base content and model parameters based on execution feedback, build closed-loop iterative optimization model.
[0093] As shown in Figure 6 , the step of the above (50) model closed-loop iterative optimization is specifically:
[0094] (51) Compliance knowledge persistence: when the multi-level dynamic evaluation result of step (40) is compliant, the corresponding natural language task description and generated PDDL domain definition file are stored as a knowledge pair in the vector database constructed in step (20);
[0095] (52) Error-oriented feedback: when the multi-level dynamic evaluation of step (40) detects semantic conflict or syntax violation, the error type code and context information are encapsulated as an optimization instruction set, which is input to step (30) to trigger PDDL file regeneration;
[0096] (53) Periodic fine-tuning trigger: according to the accumulation amount of knowledge pairs in the vector database, automatically start the fine-tuning model parameter update process of step (20), and use the new knowledge pairs for incremental training.
[0097] The above only describes the preferred embodiments of the present application, and the application is not limited to the above embodiments. Any person should know that the technical solutions with the same or similar technical effects made under the inspiration of the present application fall within the protection scope of the present application.
Claims
1. A method for automatically generating task planning PDDL files based on natural language input, characterized in that, The steps of the method are as follows: (10) Construct task environment descriptors: Analyze task environment elements and participants, and extract structured task descriptors; (20) Building a knowledge-enhanced fine-tuning model: The model integrates the retrieval results of the vector-based RAG knowledge base with the parameters of the pre-trained model to suppress logical illusions; (30) PDDL file generation and knowledge constraints: drive the fine-tuning model to output the correct PDDL file by combining scene semantics and knowledge base rules; (40) Multi-level dynamic evaluation: Verify instructions through knowledge base rule matching degree and execution feasibility indicators; (50) Model closed-loop iterative optimization: Based on the execution feedback, update the RAG knowledge base content and model parameters to construct a closed-loop iterative optimization model.
2. The method for automatically generating task planning PDDL files based on natural language input according to claim 1, characterized in that, The specific steps of constructing the task environment descriptor in (10) are as follows: (11) Analyze the task environment: Receive raw task environment data, such as natural language descriptions, sensor data or user input; identify entities, participants and spatial relationships in the environment; extract constraints, such as time limits, weather constraints and physical rules. (12) Extract structured task descriptors: Convert the parsing results into structured feature descriptors, such as JSON format structured descriptors. NL2Json is a mature technology that can be implemented using models such as BERT-Bi-LSTM-CRF.
3. The method for automatically generating task planning PDDL files based on natural language input according to claim 1, characterized in that, The specific steps for building the knowledge-enhanced fine-tuning model in (20) are as follows: (21) Selection of pre-trained large model: a pre-trained large language model based on the Transformer architecture is selected as the basic model. The basic model has optimized weight distribution in code generation and structured text processing tasks. (22) Low-rank adaptation layer injection: Inject a trainable low-rank adaptation layer into the attention mechanism module of the base model, while freezing the original parameter matrix of the base model. (23) Dynamic knowledge base coupling: Construct a vectorized retrieval database associated with domain knowledge documents, and encode professional terms and rules into dense vector representations through a dedicated embedding model; (24) Joint optimization training: The output tensor of the low-rank adaptation layer is concatenated with the knowledge vector obtained from the vectorized retrieval database, and input into the language generation head module for end-to-end training. The parameters are updated by backpropagation through the task-specific loss function. (25) The method for building a knowledge-enhanced fine-tuning model as described in claim (20) is characterized in that: the pre-trained large language model in step (21) is selected from an architecture containing a self-attention mechanism, including but not limited to the LLaMA series, GPT series or BERT series models. (26) The method for constructing a knowledge-enhanced fine-tuning model as described in claim (20), characterized in that: in step (22), the low-rank adaptation layer achieves parameter dimensionality reduction through matrix decomposition, and its rank dimension r satisfies the following relation: r∈[4,64]∩Z + (27) The method for building a knowledge-enhanced fine-tuning model as described in claim (20) is characterized in that: in step (23), the dedicated embedding model uses cosine similarity metric for vector matching and retrieves the top-k most relevant knowledge fragments, where k is a positive integer greater than or equal to 1; (28) The method for building a knowledge-enhanced fine-tuning model as described in claim (20) is characterized in that: the task-specific loss function in step (24) includes a weighted combination of a structured data matching loss term and a domain term accuracy loss term.
4. The method for automatically generating task planning PDDL files based on natural language input according to claim 1, characterized in that, The specific steps of generating PDDL files and constraining knowledge in (30) are as follows: (31) Multi-source input integration step: The structured task description words generated in step (10), the domain prompt words retrieved from the vector database constructed in step (20), and the predefined PDDL syntax specification constraints are concatenated into vectors to form a fused input tensor; (32) Constraint-guided generation step: Input the fused input tensor into the knowledge enhancement fine-tuning model built in step (20), and generate a domain definition file that conforms to the PDDL syntax specification through the topological attention mechanism in the model.
5. The method for automatically generating task planning PDDL files based on natural language input according to claim 1, characterized in that, The multi-level dynamic evaluation steps (40) are as follows: (41) Syntax compliance verification: The generated domain definition file is lexically analyzed and a syntax tree is constructed using the PDDL syntax parser to detect anomalies in bracket nesting, missing keywords, and parameter type conflicts; (42) Static semantic verification: Use a predicate logic validator to check the consistency between the action preconditions and the effect declaration, and identify undefined predicate references and parameter type out-of-bounds errors; (43) Dynamic solvability verification: The VAL planning verifier is called to construct a state transition diagram, and the action sequence is executed in the simulation environment to detect target reachability conflicts. (44) Resource constraint audit: Calculate the execution cost of actions through the resource consumption model and verify whether the task planning scheme meets the preset computational complexity threshold.
6. The method for automatically generating task planning PDDL files based on natural language input according to claim 1, characterized in that, The specific steps of the closed-loop iterative optimization of the model in (50) are as follows: (51) Compliance knowledge persistence: When the multi-level dynamic evaluation result of step (40) is compliant, the corresponding natural language task description and the generated PDDL domain definition file are combined into a knowledge pair and stored in the vector database constructed in step (20). (52) Error-oriented feedback: When the multi-level dynamic evaluation in step (40) detects semantic conflicts or syntax violations, the error type encoding and context information are encapsulated into an optimization instruction set and input to step (30) to trigger the regeneration of the PDDL file; (53) Periodic fine-tuning trigger: Based on the accumulated knowledge in the vector database, the fine-tuning model parameter update process in step (20) is automatically started, and incremental training is performed using the newly added knowledge.
Citation Information
Cited By
Large language model task planning optimization method and device
CN121882028A
Task planning method and device based on large model feedback optimization
CN121936447A
Task planning method and device based on large model feedback optimization
CN121936447B