A method and device for constructing a large language model agent based on graph-guided task decomposition

By employing a graph-guided task decomposition method and multi-stage adapter optimization, the large language model intelligent agent system solves the problems of error propagation and target interference, achieves clear and controllable task structure and easy error repair, and improves the execution accuracy and interpretability of complex tasks.

CN122133826BActive Publication Date: 2026-07-03NANJING UNIV OF POSTS & TELECOMM

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NANJING UNIV OF POSTS & TELECOMM
Filing Date
2026-05-08
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

Existing large language model intelligent agent systems suffer from error propagation and target interference problems in complex task processing. Linear programming methods lead to error propagation, end-to-end optimization methods cause negative transfer, and graph structure representations have insufficient stability.

Method used

A graph-guided task decomposition method is adopted, which explicitly constructs a directed acyclic graph of tasks and uses a decoupled multi-stage adapter for parameter fine-tuning, including the tool selection, graph synthesis and instruction derivation stages. Low-rank adapters and prompt words are introduced for optimization, so as to achieve a clear and controllable task structure and easy error repair.

Benefits of technology

It significantly improves the accuracy and controllability of task decomposition, reduces training and deployment costs, enhances the interpretability and robustness of agents, and improves the accuracy of planning and execution of complex tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122133826B_ABST
    Figure CN122133826B_ABST
Patent Text Reader

Abstract

The application discloses a kind of big language model agent construction methods and devices based on graph guide task decomposition, belong to artificial intelligence and natural language processing technical field.This method includes: selecting Transformer big language model as backbone model, and constructs tool library;Tool selection adapter is loaded on backbone model, obtain the tool subset related to task request, and train the tool selection adapter;Graph synthesis adapter is loaded on backbone model, generate the directed acyclic graph describing task structure, and train the graph synthesis adapter;Instruction deduction adapter is loaded on backbone model, generate final step-by-step execution instruction, and train the instruction deduction adapter;Finally, obtain big language model agent based on graph guide task decomposition.The application realizes on the premise of not increasing large-scale parameter overhead, significantly reduces training and deployment cost, while improving the accuracy and controllability of task decomposition and tool call.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of artificial intelligence and natural language processing technology, specifically relating to a method and apparatus for constructing a large language model intelligent agent based on graph-guided task decomposition. Background Technology

[0002] Intelligent agent systems based on Large Language Models (LLMs) can effectively handle complex real-world tasks by combining natural language understanding with planning and decision-making. However, existing methods mainly employ linear programming or end-to-end fine-tuning strategies, which suffer from significant error propagation and interference with the target task. Linear programming methods decompose tasks into sequential execution steps; if errors occur in tool selection or dependency omissions in the early planning stages, the errors will continue to propagate throughout the execution process and are difficult to locate and correct. While end-to-end fine-tuning methods can optimize model behavior, the joint optimization of multiple objectives such as tool selection, structural planning, and answer generation within a single model can easily lead to negative transfer, meaning that optimizing one sub-objective negatively impacts other sub-objectives.

[0003] In existing technologies, while chain-of-thought (CoT)-based linear programming methods improve the transparency of task processing through stepwise reasoning, they still cannot effectively express the complex dependencies between tasks. Graph-of-Thoughts (GoT) methods, although introducing graph structures to represent thought processes, lack explicit modeling of specific tool bindings and dependency constraints. Recent benchmark systems such as AsyncHow have proposed task representation methods using Directed Acyclic Graphs (DAGs) to support parallel execution and local fixation, but existing large language models still suffer from insufficient stability in generating high-quality task graphs.

[0004] In summary, existing intelligent agent systems based on large language models face two main challenges in handling complex tasks: first, the error propagation problem caused by linear programming methods; and second, the target interference phenomenon caused by end-to-end optimization methods. These technical bottlenecks severely restrict the reliability and practicality of intelligent agent systems in real-world applications. Summary of the Invention

[0005] To address the aforementioned issues, this invention proposes a method and apparatus for constructing a large language model agent based on graph-guided task decomposition. By explicitly constructing a directed acyclic graph of the task and employing a decoupled multi-stage adapter for efficient parameter fine-tuning, the task structure becomes clear and controllable, errors are easily corrected locally, and the negative transfer problem in multi-objective training is significantly alleviated.

[0006] To achieve the above objectives, the technical solution adopted by the present invention is as follows:

[0007] This invention provides a method for constructing a large language model agent based on graph-guided task decomposition, comprising:

[0008] We selected the Transformer large language model as the backbone model and built a tool library for task processing.

[0009] A tool selection adapter is loaded onto the backbone model. Using the model with the tool selection adapter loaded, tools related to the task request are filtered from the tool library based on the task request and tool selection stage prompts. The parameters of the tool selection adapter are then optimized and trained on the training set.

[0010] A graph synthesis adapter is loaded onto the backbone model. Using the model with the graph synthesis adapter loaded, a directed acyclic graph describing the task structure is generated with the task request, the tool subset, and graph synthesis stage prompts as input. The parameters of the graph synthesis adapter are then optimized and trained on the training set.

[0011] An instruction derivation adapter is loaded onto the backbone model. Using the model with the instruction derivation adapter loaded, the task request, the directed acyclic graph, and the instruction derivation stage prompts are used as inputs to generate step-by-step execution instructions. The parameters of the instruction derivation adapter are optimized and trained on the training set.

[0012] After all adapter parameters have been trained, a large language model agent based on graph-guided task decomposition is obtained.

[0013] Preferably, the backbone model is used to perform word segmentation, word embedding and position embedding, and multi-layer Transformer encoding processing on the input text;

[0014] The tool library for task processing is described as follows: Each tool Includes name and function description, , This indicates the number of tools in the tool library.

[0015] Preferably, a tool selection adapter is loaded onto the backbone model. Using the model with the tool selection adapter loaded, a subset of tools related to the task request is obtained from the tool library based on the task request and tool selection stage prompts, including:

[0016] Based on task requests and tool libraries, construct tool selection phase input text. , is represented as:

[0017] ,

[0018] in, The tool selection stage prompts are output format requirements. For task requests, For connection functions;

[0019] The backbone model is used to process the input text during the tool selection phase. Perform word segmentation, embedding, and multi-layer Transformer encoding;

[0020] Based on the backbone model, a tool selection adapter is loaded to obtain the model after loading the tool selection adapter. And the model parameters after selecting the adapter in the loading tool. :

[0021] ,

[0022] in, Select adapter parameters for the tool. This is the set of parameters for the backbone model.

[0023] Using the model Input text for the encoded tool selection stage Perform autoregressive decoding to obtain the output sequence. and according to the preset format from The selected tool subset is obtained from the parsing. .

[0024] Preferably, the step of loading a graph synthesis adapter onto the backbone model, and using the model after loading the graph synthesis adapter, to generate a directed acyclic graph describing the task structure, taking the task request, the tool subset, and graph synthesis stage prompts as input, includes:

[0025] By concatenating the task request, tool subset, and prompts for the graph composition stage, we obtain the input text for the graph composition stage. , is represented as:

[0026] ,

[0027] in, The prompts for the graph synthesis stage are task graphs that output JSON format.

[0028] The backbone model is used to input text in the graph synthesis stage. Perform word segmentation, embedding, and multi-layer Transformer encoding;

[0029] A graph synthesis adapter is loaded onto the backbone model to obtain the model after the graph synthesis adapter is loaded. And the model parameters after loading the graph synthesis adapter. :

[0030] ,

[0031] in, To synthesize adapter parameters for the graph;

[0032] Using the model Input text for the encoded graph synthesis stage Perform autoregressive decoding to obtain the output sequence. ;

[0033] From the parser Extract JSON fragments, perform syntax repair and pattern validation, and parse them into a directed acyclic graph.

[0034] Preferably, an instruction derivation adapter is loaded onto the backbone model. Using the model with the instruction derivation adapter loaded, and taking the task request, the directed acyclic graph, and instruction derivation stage prompts as input, step-by-step execution instructions are generated, including:

[0035] The task request, the JSON text of the directed acyclic graph, and the prompts for the instruction derivation stage are concatenated to obtain the input text for the instruction derivation stage. , is represented as:

[0036] ,

[0037] in, These are prompts for the instruction derivation stage, specifically constraint terms that first output numbered steps and then output the final answer. For a directed acyclic graph JSON text;

[0038] The backbone model is used to process the input text during the instruction derivation stage. Perform word segmentation, embedding, and multi-layer Transformer encoding;

[0039] A stage instruction derivation adapter is loaded onto the backbone model to obtain the model after loading the instruction derivation adapter. And the model parameters after loading instructions derive the adapter. :

[0040] ,

[0041] in, Deducing adapter parameters from instructions;

[0042] Model Input text for the encoded instruction derivation stage Autoregressive decoding is performed to obtain a step-by-step instruction sequence.

[0043] Preferably, the steps of optimizing the tool selection adapter parameters, optimizing the graph synthesis adapter parameters, and optimizing the instruction derivation adapter parameters on the training set include:

[0044] A weighted autoregressive loss function is used, and the backbone model parameters remain unchanged during training.

[0045] Preferably, the method further includes,

[0046] The DeepSeek-Chat model is used as the optimizer. A prompt word optimization algorithm is employed to train prompt words for the tool selection stage, graph synthesis stage, and instruction derivation stage. The objective function is:

[0047] ,

[0048] in, For the stage Use prompt words The score, For the stage The validation set for Input samples in For input samples The corresponding standard answer, To use prompt words Phase The output, For the stage Evaluation indicators, stages This refers to the tool selection stage, the graph synthesis stage, and the instruction derivation stage.

[0049] Preferably, the evaluation indicators include:

[0050] Precision, recall, F1 score, semantic similarity, and structural similarity are all possible values.

[0051] Preferably, the tool selection adapter, graph synthesis adapter, and instruction derivation adapter are all low-rank adapters.

[0052] The present invention also provides a device for constructing a large language model agent based on graph-guided task decomposition, for implementing the above-described method for constructing a large language model agent based on graph-guided task decomposition, the device comprising:

[0053] The initialization module is used to select the Transformer large language model as the backbone model and build a tool library for task processing.

[0054] The first training module is used to load a tool selection adapter onto the backbone model, and using the model after loading the tool selection adapter, filter from the tool library based on the task request and tool selection stage prompts to obtain a subset of tools related to the task request; and optimize the parameters of the tool selection adapter on the training set.

[0055] The second training module is used to load a graph synthesis adapter onto the backbone model, and using the model after loading the graph synthesis adapter, with the task request, the tool subset and graph synthesis stage prompts as input, generate a directed acyclic graph describing the task structure; and optimize the graph synthesis adapter parameters on the training set.

[0056] The third training module is used to load an instruction derivation adapter onto the backbone model, and using the model after loading the instruction derivation adapter, the task request, the directed acyclic graph, and the instruction derivation stage prompts as input, generate step-by-step execution instructions; and optimize the parameters of the instruction derivation adapter on the training set.

[0057] The output module is used to obtain a large language model agent based on graph-guided task decomposition after all adapter parameters have been trained.

[0058] The beneficial effects of this invention are as follows:

[0059] To address the common problems of opaque planning, arbitrary subtask division, high error rates in tool invocation, and difficulty in fine-tuning parameters in existing large language models for complex tool invocation and task planning scenarios, this invention proposes an agent construction method based on a task graph and phased modeling. On one hand, by decoupling "tool selection—graph synthesis—instruction derivation" and loading different low-rank adapters onto a unified backbone model, targeted capability alignment and optimization for different subtasks are achieved without increasing large-scale parameter overhead, significantly reducing training and deployment costs while improving the accuracy and controllability of task decomposition and tool invocation. On the other hand, by introducing explicit graph structure representation and corresponding structured evaluation metrics, the planning process for complex tasks is transformed from "black-box chain reasoning" to "visual graph structure reasoning," facilitating error location and correction, and enhancing the interpretability and robustness of the agent. Furthermore, by incorporating structural metrics such as semantic similarity NodeSim, edge F1, and tool F1, as well as answer quality scores, into the objectives of prompt word optimization and adapter training, this invention improves the quality of the final answer while achieving synergistic optimization of task decomposition quality, graph structure rationality, and answer correctness. It balances global planning performance with local execution accuracy and is suitable for widespread application in complex scenarios with multiple tools. Attached Figure Description

[0060] Figure 1 This is a schematic diagram of the construction process of a large language model intelligent agent based on graph-guided task decomposition provided by the present invention;

[0061] Figure 2 This is a schematic diagram of the experimental results on the validation set using the DeepSeek-Chat model as the base model in an embodiment of the present invention;

[0062] Figure 3 This is a schematic diagram of the experimental results on the validation set using the Llama 3.1-8 model as the base model in an embodiment of the present invention;

[0063] Figure 4 This is a schematic diagram of the experimental results on the validation set using the Qwen3-8B model as the base model in an embodiment of the present invention;

[0064] Figure 5 This is a schematic diagram of the experimental results on the validation set using the Qwen3-14B model as the base model in an embodiment of the present invention;

[0065] Figure 6 This is a schematic diagram illustrating the experimental results of the single-stage method and the multi-stage method in this embodiment of the invention on the AsyncHow dataset;

[0066] Figure 7This is a schematic diagram illustrating the experimental results of the single-stage method and the multi-stage method in this embodiment of the invention on the DailyLife dataset;

[0067] Figure 8 This is a schematic diagram illustrating the experimental results of the single-stage method and the multi-stage method in this embodiment of the invention on the HF dataset;

[0068] Figure 9 This is a schematic diagram illustrating the experimental results of the single-stage method and the multi-stage method in this embodiment of the invention on the Multimedia dataset;

[0069] Figure 10 This is a schematic diagram illustrating the experimental results on the AsyncHow dataset regarding whether or not a prompt word optimization strategy was adopted in this embodiment of the invention;

[0070] Figure 11 This is a schematic diagram illustrating the experimental results on the DailyLife dataset regarding whether or not a prompt word optimization strategy was adopted in this embodiment of the invention.

[0071] Figure 12 This is a schematic diagram illustrating the experimental results on the HF dataset regarding whether or not a prompt word optimization strategy was adopted in this embodiment of the invention;

[0072] Figure 13 This is a schematic diagram illustrating the experimental results on the Multimedia dataset regarding whether or not a prompt word optimization strategy is employed in this embodiment of the invention. Detailed Implementation

[0073] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the embodiments and accompanying drawings. Here, the illustrative embodiments and descriptions of this invention are used to explain the invention, but are not intended to limit the invention.

[0074] It should also be noted that, in order to avoid obscuring the invention with unnecessary details, only the structures and / or processing steps closely related to the solution according to the invention are shown in the accompanying drawings, while other details that are not closely related to the invention are omitted.

[0075] It should be emphasized that the term "including / comprises" as used herein refers to the presence of a feature, element, step, or component, but does not exclude the presence or addition of one or more other features, elements, steps, or components.

[0076] It should also be noted that, unless otherwise specified, the term "connection" in this article can refer not only to a direct connection, but also to an indirect connection involving an intermediary.

[0077] In the following description, embodiments of the invention will be illustrated with reference to the accompanying drawings. In the drawings, the same reference numerals represent the same or similar parts, or the same or similar steps.

[0078] It should be emphasized here that the step markers mentioned below are not a limitation on the order of the steps, but should be understood as meaning that the steps can be executed in the order mentioned in the embodiments, or in a different order than in the embodiments, or several steps can be executed simultaneously.

[0079] This invention proposes a graph-guided agentic task decomposition (GATD) method for constructing large language model agents, which breaks down the traditional "unified" natural language processing process into three stages: tool selection, graph structure synthesis, and instruction derivation. Its theoretical framework is as follows: Figure 1 As shown, specifically: First, under a unified autoregressive Transformer backbone model, for user task requests, the tool selection adapter and dedicated prompt words are used to automatically filter the candidate tool set, obtaining a subset of tools strongly related to the user task request. Second, a graph synthesis adapter is loaded onto the same backbone model. Taking the user request and the selected tool subset as input, a directed acyclic graph of the task conforming to a preset JSON specification is generated through structured prompt words, realizing explicit graph structure planning for complex tasks at the tool and subtask levels. Third, an instruction derivation adapter is loaded. The directed acyclic graph of the task and the original user task request are input into the model together, automatically deriving corresponding step-by-step execution instructions, realizing controllable execution of the task graph and result aggregation. All three stages are superimposed on the same large model using a parameter-efficient Quantized Low-Rank Adaptation (QLoRA) and trained independently to align their respective subtasks. Dedicated evaluation metrics for tool selection, graph structure similarity, and answer quality are introduced, and an external large model is used to perform optimization by prompting (OPRO). The prompt words and adapter parameters for each stage are adjusted in a closed loop on the validation set, thus achieving an integrated working mechanism of "graph-guided – metric-driven – multi-stage adaptation".

[0080] Based on the above inventive concept, the method for constructing a large language model agent based on graph-guided task decomposition provided by this invention is implemented as follows:

[0081] S1. Select the backbone model and build a tool library.

[0082] In a preferred embodiment of the present invention, an autoregressive Transformer large language model with a parameter scale of several billion is selected as the backbone model, and the parameter set of the backbone model is denoted as . .

[0083] The backbone model is used for word segmentation, word embedding and position embedding, and multi-layer Transformer encoding of the input text.

[0084] Meanwhile, this invention builds a tool library from the AsyncHow and TaskBench dataset collection tools. Each tool Includes name and function description, , This indicates the number of tools in the tool library.

[0085] S2. Load the tool selection adapter onto the backbone model of S1, and automatically filter relevant tools from the tool library for user task requests to obtain a subset of tools strongly related to the user task requests. The specific implementation process includes:

[0086] S2.1, Let the user task request be... The tool library is Construct tools select stage input text , is represented as:

[0087] ,

[0088] in, Select stage prompts for the tool, including output format requirements (such as outputting only a list of tool names or a JSON array). This is a join function.

[0089] S2.2, Using a backbone model to process the input text during the tool selection stage. Perform word segmentation, embedding, and multi-layer Transformer encoding.

[0090] The tool selection adapter is loaded onto the backbone model to obtain the model after loading the tool selection adapter. And the model parameters after selecting the adapter in the loading tool. :

[0091] ,

[0092] in, Select adapter parameters for the tool;

[0093] Using the model Input text for the encoded tool selection stage Perform autoregressive decoding to obtain the output sequence. and according to the preset format from The selected tool subset is obtained from the parsing. :

[0094] ,

[0095] In terms of form, the selection tool can be The process can be represented as a maximization problem over all subsets of the toolkit:

[0096] ,

[0097] in, Representation Model The conditional probability distribution function.

[0098] S2.3 Select adapter parameters for the tool Conduct training.

[0099] Constructing the training set During training, an autoregressive language model loss function is used. , is represented as:

[0100] ,

[0101] in, This indicates the input text. for The corresponding list of target tools for annotation. express The length of the sequence, i.e., the number of elements in the sequence. Indicates that under known input And all previously generated annotations Under the conditions, the first The label is The probability of.

[0102] After training, the tool's precision, recall, and F1 score are calculated on the validation set to evaluate the effectiveness of the tool selection.

[0103] S3. Load the graph synthesis adapter onto the backbone model, in the task request. The tool subset obtained from S2 Based on this, a directed acyclic graph describing the task structure is generated. The specific implementation process is as follows:

[0104] S3.1 Request the task Tools subset Image synthesis stage prompts Concatenation yields the input text for the graph synthesis stage. , is represented as:

[0105] ,

[0106] in, Includes <thinking>The structured output requirement stipulates that the model output should conform to the JSON pattern for the task graph.

[0107] S3.2 uses a backbone model to process the input text in the graph synthesis stage. Perform word segmentation, embedding, and multi-layer Transformer encoding.

[0108] A graph synthesis adapter is loaded onto the backbone model to obtain the model after the graph synthesis adapter is loaded. And the model parameters after loading the graph synthesis adapter. :

[0109] ,

[0110] in, The parameters of the synthesized adapter are shown in the figure.

[0111] Using the model Input text for the encoded graph synthesis stage Perform autoregressive decoding to obtain the output sequence. ;

[0112] From the parser Extracting JSON fragments, performing syntax repair and pattern validation, and parsing them into a directed acyclic graph, represented as:

[0113] ,

[0114] in, For the set of subtask nodes, It is a set of directed edge dependencies.

[0115] S3.3 Image Synthesis Adapter Parameters Conduct training.

[0116] Constructing the training set During training, an autoregressive language model loss function is used. , is represented as:

[0117] ,

[0118] in, Representation Model The conditional probability distribution function, This indicates the input text. for The corresponding list of target tools for annotation. express The length of the sequence, i.e., the number of elements in the sequence. Indicates that under known input And all previously generated annotations Under the conditions, the first The label is The probability of.

[0119] S4. Load the instruction derivation adapter onto the backbone model, using task requests and directed acyclic graphs. As input, step-by-step execution instructions are generated, and the specific implementation process is as follows:

[0120] S4.1 will request the task. Directed acyclic graph JSON text With instruction derivation stage prompts The input text is obtained by concatenating the strings to derive the instruction. , is represented as:

[0121] ,

[0122] in, The constraint model first outputs the numbered steps, and then outputs the final answer.

[0123] S4.2 uses a backbone model to process the input text during the instruction derivation stage. Perform word segmentation, embedding, and multi-layer Transformer encoding.

[0124] A stage instruction derivation adapter is loaded onto the backbone model to obtain the model after loading the instruction derivation adapter. And the model parameters after loading instructions derive the adapter. :

[0125] ,

[0126] in, The adapter parameters are deduced from the instructions.

[0127] Model Input text for the encoded instruction derivation stage Autoregressive decoding is performed to obtain the final step-by-step instruction sequence. , is represented as:

[0128] ,

[0129] in This is a set of execution instructions arranged by number.

[0130] Both use autoregressive language model loss to derive adapter parameters from instructions. Optimize the training.

[0131] To further improve performance at each stage, this invention employs the Optimization by Prompting (OPRO) method to optimize prompts at each stage. , , Automatic generation and optimization are performed, treating prompts at each stage as parameters to be optimized, and using an external large model as the optimizer to construct the stages. objective function as follows:

[0132] ,

[0133] in, For the stage Use prompt words The score, For the stage The validation set for Input samples in For input samples The corresponding standard answer, To use prompt words Phase The output, For the stage Evaluation indicators, stages This refers to the tool selection stage, the graph synthesis stage, and the instruction derivation stage. For example, the evaluation metric for the tool selection stage is F1 score, the evaluation metric for the graph synthesis stage is Structural Similarity Index (SSI), and the evaluation metric for the instruction derivation stage is AnswerScore.

[0134] Using the DeepSeek-Chat model as the large optimizer model, and employing the OPRO optimization strategy, the large optimizer model is fed with previous suggestion word-score pairs and task descriptions to generate new candidate suggestion words, which are then optimized based on the objective function. The selection process is iterated until convergence. The DeepSeek-Chat model is a series of large language models developed by Hangzhou DeepSeek Co., Ltd., specifically optimized for dialogue scenarios.

[0135] To avoid full parameter fine-tuning of a large-scale backbone model, this invention employs a low-rank adapter (QLoRA) for efficient parameter adjustment across all three stages (tool selection, graph synthesis, and instruction derivation). The implementation process is as follows:

[0136] For the weight matrix involved in the adaptation Its update format is as follows:

[0137] ,

[0138] in, This represents the weight matrix before the update. This represents the updated weight matrix. Indicates the update quantity. These represent the tool selection stage, the graph composition stage, and the instruction derivation stage, respectively. and These represent the rows and columns of the weight matrix, respectively.

[0139] in Low-rank decomposition is used:

[0140] , , , ,

[0141] in, , It is a low-rank matrix. Indicates rank;

[0142] In the QLoRA scenario, Quantization to low-bit approximation If the adapter is kept in full precision, then:

[0143] ,

[0144] The parameter sets for each stage are as follows:

[0145] ,

[0146] ,

[0147] .

[0148] For any stage Given a training set A unified autoregressive loss is used to evaluate the low-rank adapter parameters. Training, backbone parameters Remaining constant, autoregressive loss Represented as:

[0149] .

[0150] in, Representation Model The conditional probability distribution function, This indicates the input text. for The corresponding list of target tools for annotation. express The length of the sequence, i.e., the number of elements in the sequence. Indicates that under known input And all previously generated annotations Under the conditions, the first The label is The probability of.

[0151] To systematically evaluate the performance of the method of this invention in terms of tool selection, graph structure planning, and final response quality, the present invention adopts the following structured evaluation indicators.

[0152] Precision, Recall, and F1 Scores for Tools, Nodes, and Edges:

[0153] (True Example): The number of tools correctly selected by the model. That is, the number of tools in the subset of tools selected by the model that are indeed relevant to the task request.

[0154] (False positives): The number of tools incorrectly selected by the model. That is, the number of tools in the subset of tools selected by the model that are irrelevant to the task request.

[0155] (False counterexample): The number of tools that the model missed selecting. That is, the number of tools in the tool library that should be relevant to the task request but were not selected by the model.

[0156] Taking the tool level as an example, let's define accuracy. Recall rate and F1 score :

[0157] ,

[0158] ,

[0159] ,

[0160] F1 at the node and edge levels , The definition is similar.

[0161] Node semantic similarity NodeSim:

[0162] Let the node sets of the standard graph and the prediction graph be respectively... and The node labels and predicted labels are respectively and The embedding function is The cosine similarity is Define semantic similarity :

[0163] .

[0164] Structural Similarity Index (SSI):

[0165] By combining node semantics and edge structure information, a structural similarity index (SSI) is defined:

[0166] .

[0167] The F1 score for the edge level.

[0168] In the following embodiments, the present invention uses two datasets with graph structure annotations, AsyncHow and TaskBench, to verify the large language model agent construction method based on graph-guided subtask decomposition provided above. AsyncHow is used for complex task graph decomposition and sequential scenario testing, while TaskBench covers three domains: DailyLife, HF, and Multimedia, and is used for large-scale tool graph planning evaluation. The comparison methods include: untuned backbone model, backbone + chained thinking prompts, backbone + chained thinking prompts + single model fine-tuning, single-stage graph planning, single-stage graph planning fine-tuning, three-stage graph guidance, and the complete GATD (three-stage + adapter + OPRO) of the present invention.

[0169] The experimental results are as follows:

[0170] (1) Evaluation indicators

[0171] The following metrics were used to evaluate the model performance:

[0172] Tool F1: Used to measure the accuracy of tool selection;

[0173] Node F1: Used to measure the prediction accuracy of subtask nodes;

[0174] Edge F1: Used to measure the accuracy of subtask dependency prediction;

[0175] SSI: Used to measure the similarity between the generated subtask structure and the target structure;

[0176] AnswerScore: Used to measure the accuracy of the final task execution result.

[0177] The above indicators can comprehensively reflect the model performance from both structural rationality and execution effectiveness.

[0178] (2) Comparison of overall experimental results

[0179] Experimental results of different methods on the validation set are as follows Figure 2 , Figure 3 , Figure 4 and Figure 5 As shown. Among them, Figure 2 The results are experimental on the validation set using the DeepSeek-Chat model as the base model. Figure 3 The results are experimental findings on the validation set using the Llama 3.1-8 model as the base model. Figure 4 The results are experimental findings on the validation set using the Qwen3-8B model as the base model. Figure 5 The results are shown on the validation set using the Qwen3-14B model as the base model. Llama3.1-8B is the 8 billion parameter version of the Llama 3.1 open-source large language model series released by Meta, designed for efficient inference and lightweight deployment while maintaining strong multilingual understanding and generation capabilities. Qwen3-8B is a large language model released by the Alibaba Cloud Tongyi Qianwen team, belonging to the 8 billion parameter dense model in the Qwen3 series, using the Apache 2.0 open-source license, supporting multilingual, long context processing, and various inference modes. Qwen3-14B is a large language model released by the Alibaba Cloud Tongyi Qianwen team, belonging to the 14B (14.8 billion parameters) dense model in the Qwen3 series. It can be seen that, under the same base model conditions, the proposed method scores higher than or close to the comparative methods on multiple datasets. The method of this invention can improve the accuracy of the final execution result while ensuring the correctness of the subtask decomposition structure, demonstrating that the graph-guided subtask decomposition mechanism has significant advantages in handling complex tasks. Furthermore, under different base model scales, the method of this invention consistently achieves performance superior to the comparative methods, indicating that the method of this invention has good versatility and stability.

[0180] A comparative experiment was conducted on single-stage and multi-stage graph generation methods, and the results are as follows: Figure 6 , Figure 7 , Figure 8 and Figure 9 As shown. Among them, Figure 6 Here are the experimental results of different methods on the AsyncHow dataset. Figure 7 The experimental results of different methods on the DailyLife dataset are presented. Figure 8 Experimental results of different methods on the HF dataset, Figure 9 The results show experimental findings for different methods on the Multimedia dataset. It can be seen that single-stage methods, which handle tool selection, structure construction, and instruction generation simultaneously in the same output process, are prone to structural confusion and incorrect tool selection.

[0181] The method of this invention processes the above process in stages, so that each stage is optimized for a single objective, thereby significantly improving the stability of the subtask structure and the overall execution success rate.

[0182] The comparison results show that, under cross-dataset training conditions, single-stage fine-tuning models are prone to task mode confusion and tool misuse.

[0183] The method of this invention introduces a staged subtask structure representation, which enables the model to focus only on the corresponding objective at each stage, thereby effectively reducing interference between different tasks and mitigating the performance degradation caused by negative transfer.

[0184] While keeping the model structure unchanged, we compared schemes that did not employ the prompt word optimization strategy, and the experimental results are as follows: Figure 10 , Figure 11 , Figure 12 and Figure 13 As shown. Among them, Figure 10 The results of experiments on the AsyncHow dataset show whether or not a prompt word optimization strategy was adopted. Figure 11 The results of experiments on the DailyLife dataset show whether or not a cue word optimization strategy was adopted. Figure 12 The results of experiments on the HF dataset show whether or not a cue word optimization strategy was adopted. Figure 13 The results are shown on the Multimedia dataset with and without the cue word optimization strategy. It can be seen that optimizing the cue words can further improve the accuracy of the subtask decomposition structure and the final execution effect, thus enhancing the performance of the method of this invention in complex tasks.

[0185] Based on the above inventive concept, the present invention also provides a large language model intelligent agent construction device based on graph-guided task decomposition, used to implement the above-mentioned large language model intelligent agent construction method based on graph-guided task decomposition, the device comprising:

[0186] The initialization module is used to select the Transformer large language model as the backbone model and build a tool library for task processing.

[0187] The first training module is used to load a tool selection adapter onto the backbone model, and using the model after loading the tool selection adapter, filter from the tool library based on the task request and tool selection stage prompts to obtain a subset of tools related to the task request; and optimize the parameters of the tool selection adapter on the training set.

[0188] The second training module is used to load a graph synthesis adapter onto the backbone model, and using the model after loading the graph synthesis adapter, with the task request, the tool subset and graph synthesis stage prompts as input, generate a directed acyclic graph describing the task structure; and optimize the graph synthesis adapter parameters on the training set.

[0189] The third training module is used to load an instruction derivation adapter onto the backbone model, and using the model after loading the instruction derivation adapter, the task request, the directed acyclic graph, and the instruction derivation stage prompts as input, generate step-by-step execution instructions; and optimize the parameters of the instruction derivation adapter on the training set.

[0190] The output module is used to obtain a large language model agent based on graph-guided task decomposition after all adapter parameters have been trained.

[0191] It is worth noting that this device embodiment corresponds to the above method embodiment. The implementation methods of the above method embodiments are all applicable to this device embodiment and can achieve the same or similar technical effects, so they will not be described in detail here.

[0192] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0193] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0194] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0195] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0196] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.< / thinking>

Claims

1. A method for constructing a large language model agent based on graph-guided task decomposition, characterized in that, include: We selected the Transformer large language model as the backbone model and built a tool library for task processing. A tool selection adapter is loaded onto the backbone model. Using the model with the tool selection adapter loaded, a tool subset related to the task request is obtained by filtering from the tool library based on the task request and tool selection stage prompts. Optimize the tool selection adapter parameters on the training set; A graph synthesis adapter is loaded onto the backbone model. Using the model after loading the graph synthesis adapter, a directed acyclic graph describing the task structure is generated with the task request, the tool subset, and graph synthesis stage prompts as input. The graph synthesis adapter parameters were optimized and trained on the training set. An instruction derivation adapter is loaded onto the backbone model. Using the model with the instruction derivation adapter loaded, and taking the task request, the directed acyclic graph, and instruction derivation stage prompts as input, step-by-step execution instructions are generated, including: The task request, the JSON text of the directed acyclic graph, and the instruction derivation stage prompt word are concatenated to obtain an instruction derivation stage input text , which is represented as: , wherein, is an instruction derivation stage prompt word, the instruction derivation stage prompt word being a constraint phrase that outputs a numbered step first and a final answer second, is a directed acyclic graph of JSON text, is a task request, is a connection function; The backbone model is used to process the input text during the instruction derivation stage. Perform word segmentation, embedding, and multi-layer Transformer encoding; Load the stage instruction derivation adapter on the backbone model, obtain the model after loading the instruction derivation adapter , and the model parameters after loading the instruction derivation adapter : , wherein, is an instruction derivation adapter parameter, is a set of backbone model parameters; Adopting a model Deriving the input text for the encoded instruction phase Performing autoregressive decoding to obtain a sequence of step-by-step execution instructions; The instruction derivation adapter parameters are optimized and trained on the training set; after all adapter parameters are trained, a large language model agent based on graph-guided task decomposition is obtained.

2. The method for constructing a large language model agent based on graph-guided task decomposition according to claim 1, characterized in that, The backbone model is used to perform word segmentation, word embedding and position embedding, and multi-layer Transformer encoding on the input text. The tool library for task processing is constructed, denoted as: Each tool contains a name and a function description, , denotes the number of tools in the tool library.

3. The method of claim 2, wherein the method further comprises: A tool selection adapter is loaded onto the backbone model. Using the model with the tool selection adapter loaded, tools are filtered from the tool library based on the task request and tool selection stage prompts to obtain a subset of tools related to the task request, including: Based on the task request and the tool library, a tool selection stage input text is constructed is represented as: , wherein, a tool selection stage prompt word, the tool selection stage prompt word being an output format requirement, a task request, a connection function; applying the backbone model to the tool selection stage input text performing tokenization, embedding, and multi-layer transformer encoding; Based on the backbone model, a tool selection adapter is loaded to obtain the model after loading the tool selection adapter. And the model parameters after selecting the adapter in the loading tool. : , wherein, selecting an adapter parameter for the tool, a set of backbone model parameters; Utilizing the model The encoded tool selection stage input text Performing autoregressive decoding to obtain an output sequence And parsing the selected tool subset from According to the preset format .

4. The method of claim 3, wherein the method further comprises: The process involves loading a graph synthesis adapter onto the backbone model, and using the model with the graph synthesis adapter loaded, taking the task request, the tool subset, and graph synthesis stage prompts as input, to generate a directed acyclic graph describing the task structure, including: The task request, the tool subset, and the graph synthesis stage prompt word are concatenated to obtain a graph synthesis stage input text is represented as: , wherein, graph synthesis stage hint, the graph synthesis stage hint being to output a task graph that conforms to a JSON schema; The backbone model is used to input text in the graph synthesis stage performing word segmentation, embedding, and multi-layer Transformer encoding; loading a graph synthesis adapter on the backbone model, to obtain a model after loading the graph synthesis adapter , and a model parameter after loading the graph synthesis adapter : , wherein is a graph synthesis adapter parameter; Utilizing the model input text to the synthesis stage of the encoded graph performing autoregressive decoding to obtain an output sequence ; From the parser Extract JSON fragments, perform syntax repair and pattern validation, and parse them into a directed acyclic graph.

5. The graph-guided task decomposition based large language model agent construction method of claim 1, wherein, The optimization training of tool selection adapter parameters, graph synthesis adapter parameters, and instruction derivation adapter parameters on the training set includes: A weighted autoregressive loss function is used, and the backbone model parameters remain unchanged during training.

6. The graph-guided task decomposition-based large language model agent construction method of claim 1, wherein, The method also includes, The DeepSeek-Chat model is used as the optimizer. A prompt word optimization algorithm is employed to train prompt words for the tool selection stage, graph synthesis stage, and instruction derivation stage. The objective function is: , in, For the stage Use prompt words The score, For the stage The validation set for Input samples in For input samples The corresponding standard answer, To use prompt words Phase The output, For the stage Evaluation indicators, stages This refers to the tool selection stage, the graph synthesis stage, and the instruction derivation stage.

7. The graph-guided task decomposition based large language model agent construction method according to claim 6, characterized in that, The evaluation indicators include: Precision, recall, F1 score, semantic similarity, and structural similarity are all possible values.

8. The graph-guided task decomposition-based large language model agent construction method of claim 1, wherein, The tool selection adapter, graph synthesis adapter, and instruction derivation adapter all use low-rank adapters.

9. A device for constructing a large language model intelligent agent based on graph-guided task decomposition, characterized in that, The apparatus for implementing the method for constructing a large language model agent based on graph-guided task decomposition as described in claim 1 includes: The initialization module is used to select the Transformer large language model as the backbone model and build a tool library for task processing. The first training module is used to load a tool selection adapter onto the backbone model, and using the model after loading the tool selection adapter, filter from the tool library based on the task request and tool selection stage prompts to obtain a subset of tools related to the task request; and optimize the parameters of the tool selection adapter on the training set. The second training module is used to load a graph synthesis adapter onto the backbone model, and using the model after loading the graph synthesis adapter, with the task request, the tool subset and graph synthesis stage prompts as input, generate a directed acyclic graph describing the task structure; and optimize the graph synthesis adapter parameters on the training set. The third training module is used to load an instruction derivation adapter onto the backbone model, and using the model after loading the instruction derivation adapter, the task request, the directed acyclic graph, and the instruction derivation stage prompts as input, generate step-by-step execution instructions; and optimize the parameters of the instruction derivation adapter on the training set. The output module is used to obtain a large language model agent based on graph-guided task decomposition after all adapter parameters have been trained.