A text task processing control method and device based on large language model

By constructing a thinking logic diagram and using a graph representation learning model to classify nodes, dynamically updating the pending node queue and thinking logic diagram, the problem of poor training of large language models in specific text tasks is solved, and the optimization of inference logic and resource saving is achieved.

CN119623649BActive Publication Date: 2025-05-13INST OF SOFTWARE - CHINESE ACAD OF SCI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510147375.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-11
Publication Date
2025-05-13
Estimated Expiration
2045-02-11

AI Technical Summary

Technical Problem

The existing large language models have poor training results in specific text tasks, high resource consumption in pre-training and fine-tuning stages, and limited application in the field of data scarcity, which poses problems such as risk of overfitting and limited migration capabilities.

Method used

By inputting the basic text of the text task into the large language model, generating task description text and constructing a thinking logic diagram, using graph representation learning model and thinking logic diagram for node classification, dynamically updating the pending node queue and thinking logic diagram, using iterable update optimization method, integrating graph representation learning, and optimizing the reasoning logic of the large language model.

Benefits of technology

The inference logic optimization of large language models on specific text tasks is realized, the resources required for model optimization are saved, and the application capabilities and task migration capabilities in the field of data scarcity are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119623649B_ABST
    Figure CN119623649B_ABST
Patent Text Reader

Abstract

The present invention provides a text task processing control method and device based on a large language model. The method comprises the following steps: inputting a basic task text of a text task into a large language model to obtain a task description text of the text task; constructing a thinking logic graph based on the graph nodes corresponding to the task description text and placing the graph nodes into a queue of nodes to be processed; obtaining the first graph node of the queue of nodes to be processed in a node classification step; classifying the first graph node based on a graph representation learning model and a thinking logic graph to obtain a category of the first graph node; in a control step, if the category of the first graph node is termination, the text task is terminated; otherwise, the queue of nodes to be processed or the thinking logic graph and the queue of nodes to be processed are updated. Without updating the large language model, an iterative update optimization method is adopted to integrate graph representation learning, thereby realizing the optimization of the reasoning logic of the large language model for specific text tasks and saving resources required for model optimization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of natural language processing, and in particular to a text task processing control method and device based on a large language model. Background Art

[0002] Large language models are natural language processing models that are trained using massive amounts of text data based on deep learning technology. They are designed to generate, understand, and process human language. This type of model can capture complex grammatical, semantic, and contextual information in language through a large number of parameters and a hierarchical neural network structure. Large language models are usually trained using self-supervised learning methods, such as masked language models and autoregressive language models, which learn extensive knowledge of the language by predicting missing words or the next word during the pre-training phase. In recent years, as the scale of the model continues to expand, the number of parameters has reached billions or even hundreds of billions, allowing large language models to perform well in a variety of natural language processing tasks, such as text generation, translation, question answering, reasoning, etc. In addition, the model can be further adapted to specific tasks and fields through fine-tuning, demonstrating a strong ability to transfer tasks.

[0003] The training process of a large language model is usually divided into two stages: model pre-training and fine-tuning. In the model pre-training stage, the model can learn the basic knowledge and general representation of the language through unsupervised learning on large-scale, wide-ranging datasets. This process mainly relies on self-supervised learning tasks such as masked language models and autoregressive language models to capture the grammatical and semantic features of the language by predicting missing words or the next word.

[0004] The fine-tuning phase conducts supervised learning on the pre-trained model on a dataset of a specific task to adjust the performance of the model in a specific application scenario. In this phase, the task adaptability and performance of the model are further optimized by using task-related labeled data for model training.

[0005] Chain-of-Thought (COT) technology in large language models is a method developed in recent years. It improves the performance of the model in complex reasoning tasks by guiding the model to explicitly express the intermediate reasoning steps when generating answers. This technology helps the model generate answers more accurately when dealing with tasks involving multi-step reasoning through explicit thinking chains, thereby enhancing the model's reasoning and interpretation capabilities. After COT, a large number of large language model reasoning optimization frameworks have also emerged, including thinking methods based on tree-like thinking and graph-like thinking.

[0006] However, the two-stage training method of model pre-training and fine-tuning of large language models is effective, but has many disadvantages. First, the pre-training stage requires large-scale data sets and computing resources, resulting in extremely large training costs, which not only has high requirements on hardware costs, but also takes a lot of time. In addition, although the pre-trained model is highly versatile, the fine-tuning stage relies on a large amount of labeled data for specific tasks, which limits its application in data-scarce fields. At the same time, the fine-tuning process may lead to overfitting risks. The fine-tuned model has relatively limited migration capabilities for new tasks and requires repeated training, which increases the training cycle and cost. Although the chain reasoning technology has shown good performance in complex reasoning tasks, it also has some limitations. The COT technology requires the model to be able to clearly express the intermediate reasoning steps during the generation process, which improves the reasoning quality in certain cases. However, its inability to iterate training limits its adaptability and flexibility. COT cannot update the model, so it cannot become better with training. Summary of the invention

[0007] The present invention provides a text task processing control method and device based on a large language model, which are used to solve the defect that the training effect of the large language model for a specific text task in the prior art is poor.

[0008] The present invention provides a text task processing control method based on a large language model, comprising:

[0009] Initialization step: inputting the basic text of the text task into the large language model, obtaining the task description text of the text task output by the large language model, constructing a thinking logic diagram based on the graph nodes corresponding to the task description text and placing the graph nodes into the queue of nodes to be processed;

[0010] Node classification step: obtaining the first graph node of the queue of nodes to be processed, classifying the first graph node based on the graph representation learning model and the thinking logic graph, and obtaining the category of the first graph node;

[0011] Control step: if the category of the first graph node is termination, then end the text task; otherwise, update the queue of nodes to be processed or update the thinking logic graph and the queue of nodes to be processed, and jump to the iteration step;

[0012] Iteration step: if the current time is the preset optimization time, the graph representation learning model is updated based on the score of the first graph node; jump to the node classification step.

[0013] According to a text task processing control method based on a large language model provided by the present invention, if the category of the first graph node is thought continuation, updating the queue of nodes to be processed or updating the thought logic graph and the queue of nodes to be processed specifically includes:

[0014] Repeatedly inputting the node content of the first graph node into the large language model to obtain a plurality of task execution texts respectively output by the large language model;

[0015] Constructing graph nodes corresponding to the multiple task execution texts respectively, and updating the thinking logic graph based on the graph nodes corresponding to the multiple task execution texts;

[0016] The first graph node is dequeued from the queue of nodes to be processed, and the graph nodes corresponding to the multiple task execution texts are added to the queue of nodes to be processed.

[0017] According to a text task processing control method based on a large language model provided by the present invention, if the category of the first graph node is thought backtracking, updating the queue of nodes to be processed or updating the thought logic graph and the queue of nodes to be processed specifically includes:

[0018] Determine the parent node of the first graph node in the thought logic graph;

[0019] Inputting the node content of the parent node, the node content of the first graph node, and the backtracking prompt word into the large language model to obtain the task execution text output by the large language model;

[0020] Constructing a graph node corresponding to the task execution text, and updating the thinking logic graph based on the graph node corresponding to the task execution text;

[0021] The first graph node is dequeued from the queue of nodes to be processed, and the graph node corresponding to the task execution text is added to the queue of nodes to be processed.

[0022] According to a text task processing control method based on a large language model provided by the present invention, if the category of the first graph node is thought suspension, updating the queue of nodes to be processed or updating the thought logic graph and the queue of nodes to be processed specifically includes:

[0023] The first graph node is dequeued from the queue of nodes to be processed.

[0024] According to a text task processing control method based on a large language model provided by the present invention, the first graph node is classified based on the graph representation learning model and the thinking logic graph to obtain the category of the first graph node, specifically including:

[0025] Perform feature extraction on the thinking logic graph based on the graph neural network layer in the graph representation learning model to obtain a vector representation of each graph node in the thinking logic graph;

[0026] The vector representation of the first graph node is classified based on the classification layer in the graph representation learning model to determine the category of the first graph node.

[0027] According to a text task processing control method based on a large language model provided by the present invention, the score of any graph node is obtained in the following manner:

[0028] Constructing a scoring input text based on the scoring standard text of the text task, the task description text of the text task, and the node content of any graph node;

[0029] The scoring input text is input into the large language model to obtain the score of any graph node output by the large language model.

[0030] The present invention also provides a text task processing control device based on a large language model, comprising:

[0031] An initialization unit, used to input a basic task text of a text task into a large language model, obtain a task description text of the text task output by the large language model, construct a thinking logic graph based on graph nodes corresponding to the task description text, and place the graph nodes into a queue of nodes to be processed;

[0032] A node classification unit, used for obtaining a first graph node of the queue of nodes to be processed, classifying the first graph node based on a graph representation learning model and the thinking logic graph, and obtaining a category of the first graph node;

[0033] A control unit, configured to terminate the text task when the category of the first graph node is termination; otherwise, update the queue of nodes to be processed or update the thinking logic graph and the queue of nodes to be processed, and call an iteration unit;

[0034] An iteration unit is used to update the graph representation learning model based on the score of the first graph node when the current moment is a preset optimization moment; and call the node classification unit.

[0035] According to a text task processing control device based on a large language model provided by the present invention, if the category of the first graph node is thought continuation, updating the queue of nodes to be processed or updating the thought logic graph and the queue of nodes to be processed specifically includes:

[0036] Repeatedly inputting the node content of the first graph node into the large language model to obtain a plurality of task execution texts respectively output by the large language model;

[0037] Constructing graph nodes corresponding to the multiple task execution texts respectively, and updating the thinking logic graph based on the graph nodes corresponding to the multiple task execution texts;

[0038] The first graph node is dequeued from the queue of nodes to be processed, and the graph nodes corresponding to the multiple task execution texts are added to the queue of nodes to be processed.

[0039] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the text task processing control method based on a large language model as described above is implemented.

[0040] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the text task processing control method based on a large language model as described in any one of the above is implemented.

[0041] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the above-mentioned text task processing control methods based on a large language model.

[0042] The present invention provides a text task processing control method and device based on a large language model. The method inputs a basic task text of a text task into a large language model to obtain a task description text of the text task, constructs a thinking logic diagram based on the graph nodes corresponding to the task description text and places the graph nodes into a queue of nodes to be processed, obtains the first graph node of the queue of nodes to be processed in a node classification step, classifies the first graph node based on a graph representation learning model and a thinking logic diagram, and obtains a category of the first graph node; in a control step, if the category of the first graph node is termination, the text task is terminated; otherwise, the queue of nodes to be processed or the thinking logic diagram and the queue of nodes to be processed are updated, and the process jumps to an iteration step; in an iteration step, if the current time is a preset optimization moment, the graph representation learning model is updated based on the score of the first graph node, and then the process jumps to a node classification step. Without updating the large language model, an iterative update optimization method is adopted to integrate graph representation learning, thereby realizing the optimization of the reasoning logic of the large language model for specific text tasks and saving resources required for model optimization. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0044] Figure 1 It is a flow chart of a text task processing control method based on a large language model provided by the present invention;

[0045] Figure 2 This is one of the flow charts of the thinking expansion method provided by the present invention;

[0046] Figure 3 This is the second flow chart of the thinking expansion method provided by the present invention;

[0047] Figure 4 It is a structural schematic diagram of a text task processing control device based on a large language model provided by the present invention;

[0048] Figure 5 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0049] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0050] Figure 1 is a flow chart of a text task processing control method based on a large language model provided by the present invention, such as Figure 1 As shown, the method includes:

[0051] Initialization step 110: inputting the task basic text of the text task into the large language model, obtaining the task description text of the text task output by the large language model, constructing a thinking logic graph based on the graph nodes corresponding to the task description text and placing the graph nodes into a queue of nodes to be processed;

[0052] Node classification step 120: obtaining the first graph node of the queue of nodes to be processed, classifying the first graph node based on the graph representation learning model and the thinking logic graph, and obtaining the category of the first graph node;

[0053] Control step 130: if the category of the first graph node is termination, then end the text task; otherwise, update the queue of nodes to be processed or update the thinking logic graph and the queue of nodes to be processed, and jump to the iteration step;

[0054] Iteration step 140: if the current time is the preset optimization time, the graph representation learning model is updated based on the score of the first graph node; and jumping to the node classification step.

[0055] Specifically, before formally executing the text task, the basic task description of the text task and the scoring benchmark for whether the task execution is successful can be pre-constructed. Subsequently, the text of the basic task description of the text task (i.e., the basic task text) is input into the large language model, and by combining the prompt words, the large language model generates the task description text (prompt) for the basic text of the task, and then constructs the graph node corresponding to the task description text to form a preliminary "thinking node", and uses it as the root node of the thinking logic graph. At the same time, the graph node is placed in the queue of nodes to be processed to mark the graph node as a node to be processed.

[0056] During the task execution process, a node classification step can be performed. The node classification step obtains the first graph node in the queue of nodes to be processed, classifies the first graph node based on the graph representation learning model and the thinking logic graph, and obtains the category of the first graph node. Among them, the graph representation learning model can convert the graph structure data into a low-dimensional vector representation through machine learning technology, so as to process and analyze it in downstream classification tasks. In some embodiments, a graph representation learning model can be constructed based on a graph neural network layer. After the thinking logic graph is input into the graph representation learning model, the thinking logic graph can be feature extracted based on the graph neural network layer in the graph representation learning model to obtain the vector representation of each graph node in the thinking logic graph, thereby classifying the vector representation of the first graph node based on the classification layer in the graph representation learning model to determine the category of the first graph node.

[0057] The types of graph nodes include the following:

[0058] 1. Thought continuation: Indicates that the thought process of task execution needs to continue. Therefore, based on the graph node and the prompt word, the large language model can continue to generate the next thought step to continue the execution of the text task.

[0059] 2. Thinking stop: It means that the thinking process stops here and will not continue, so the subsequent thinking generation based on this graph node can be stopped;

[0060] 3. Thinking back: It means that the thinking process needs to be backtracked, so the graph node can be deleted and the subsequent thinking steps can be regenerated based on its parent node;

[0061] 4. Termination: Indicates that the node content of the current graph node is the final answer to the text task, so it can be marked as the final answer node, and the node content of this graph node will be used as the final output answer.

[0062] Therefore, if the category of the first graph node is termination, the current text task is terminated and the node content of the graph node is output as the final answer; otherwise, the queue of nodes to be processed is updated or the thinking logic diagram and the queue of nodes to be processed are updated, and the process is jumped to the iteration step to continue the large language model reasoning. In the iteration step, when the preset optimization moment is reached (a preset optimization moment can be set for model optimization every M times the large language model performs reasoning), the graph representation learning model is updated based on the score of the first graph node, thereby further improving the node classification ability of the graph representation learning model and the control ability of the text task execution, and jumping to the above-mentioned node classification step.

[0063] Among them, Figure 2 As shown, if the category of the first graph node is thought continuation, update the queue of nodes to be processed or update the thought logic graph and the queue of nodes to be processed, specifically including:

[0064] Step 210, repeatedly inputting the node content of the first graph node into the large language model to obtain a plurality of task execution texts respectively output by the large language model;

[0065] Step 220, respectively constructing graph nodes corresponding to the plurality of task execution texts, and updating the thinking logic graph based on the graph nodes corresponding to the plurality of task execution texts;

[0066] Step 230: dequeue the first graph node from the queue of nodes to be processed, and add the graph nodes corresponding to the multiple task execution texts to the queue of nodes to be processed.

[0067] Here, the randomness of the large language model itself can be used to repeatedly perform multiple inferences, and the node content of the first graph node can be repeatedly input into the large language model, thereby obtaining multiple different task execution texts output by the large language model. After constructing the graph nodes corresponding to the multiple task execution texts respectively, the graph nodes corresponding to the above multiple task execution texts are added to the thinking logic graph as child nodes of the first graph node to complete the expansion of the thinking logic graph. Subsequently, the first graph node is dequeued from the queue of nodes to be processed, and the graph nodes corresponding to the above multiple task execution texts are added to the end of the queue of nodes to be processed.

[0068] like Figure 3 As shown, if the category of the first graph node is thinking backtracking, update the queue of nodes to be processed or update the thinking logic graph and the queue of nodes to be processed, specifically including:

[0069] Step 310, determining the parent node of the first graph node in the thought logic graph;

[0070] Step 320, inputting the node content of the parent node, the node content of the first graph node, and the backtracking prompt word into the large language model to obtain the task execution text output by the large language model;

[0071] Step 330, constructing a graph node corresponding to the task execution text, and updating the thinking logic graph based on the graph node corresponding to the task execution text;

[0072] Step 340: dequeue the first graph node from the queue of nodes to be processed, and add the graph node corresponding to the task execution text to the queue of nodes to be processed.

[0073] Among them, the parent node of the first graph node in the thinking logic graph can be obtained, and then the node content of the parent node, the node content of the first graph node and the backtracking prompt word (describing that it has been generated, but backtracking processing is performed) are input into the large language model to obtain the task execution text output by the large language model, and the graph node corresponding to the task execution text is constructed, and the parent node of the first graph node is replaced with the graph node corresponding to the task execution text, and the first graph node is deleted at the same time to realize the update of the thinking logic graph. Subsequently, the first graph node is dequeued from the queue of nodes to be processed, and the graph node corresponding to the task execution text is added to the end of the queue of nodes to be processed.

[0074] If the category of the first graph node is thought suspension, the first graph node is dequeued from the queue of pending nodes and is no longer visited.

[0075] In some embodiments, in order to update the graph representation learning model, the node content of the first graph node can be scored based on a preset scoring benchmark, the score is used as a reward function, the classification output is used as an action, and the node features (which can be the vector representation of each node output by the graph neural network layer in the graph representation learning model) are used as the state. Based on a reinforcement learning algorithm, such as the PPO (Proximal Policy Optimization) algorithm, the graph representation learning model is updated and optimized. The execution process of the PPO algorithm when updating and optimizing the graph representation learning model can be summarized as the following steps: the graph representation learning model selects a classification category for the current node, and calculates the reward based on the score output by the large language model for the node; based on the next state of the state, action, reward, and environmental feedback, these interaction data are stored for policy optimization; PPO uses a clipped objective function to limit the policy update range to ensure stable training while the policy is improved. The entire process gradually converges the policy to a policy that can obtain higher rewards in this specific classification task through multiple sampling and updates, thereby gradually improving the classification ability of the graph representation learning model for nodes.

[0076] In some embodiments, the score of any graph node is obtained by constructing a score input text based on the scoring standard text of the text task, the task description text of the text task, and the node content of the graph node, and then inputting the score input text into the large language model.

[0077] In summary, the method provided by the embodiment of the present invention obtains the task description text of the text task by inputting the task basic text of the text task into the large language model, constructs a thinking logic graph based on the graph nodes corresponding to the task description text and places the graph nodes into the queue of nodes to be processed, and then obtains the first graph node of the queue of nodes to be processed in the node classification step, classifies the first graph node based on the graph representation learning model and the thinking logic graph, and obtains the category of the first graph node; in the control step, if the category of the first graph node is termination, the text task is terminated; otherwise, the queue of nodes to be processed or the thinking logic graph and the queue of nodes to be processed are updated, and the step is jumped to the iteration step; in the iteration step, if the current time is the preset optimization moment, the graph representation learning model is updated based on the score of the first graph node, and then the step is jumped to the node classification step. Without updating the large language model, an iterative update optimization method is adopted to integrate graph representation learning, thereby realizing the optimization of the reasoning logic of the large language model for specific text tasks and saving the resources required for model optimization.

[0078] The text task processing control device based on a large language model provided by the present invention is described below. The text task processing control device based on a large language model described below and the text task processing control method based on a large language model described above can be referred to each other.

[0079] Based on any of the above embodiments, Figure 4 is a structural diagram of a text task processing control device based on a large language model provided by the present invention, such as Figure 4 As shown, the device comprises:

[0080] Initialization unit 410, used for inputting the task basic text of the text task into the large language model, obtaining the task description text of the text task output by the large language model, constructing a thinking logic graph based on the graph nodes corresponding to the task description text and placing the graph nodes into a queue of nodes to be processed;

[0081] A node classification unit 420 is used to obtain a first graph node in the queue of nodes to be processed, classify the first graph node based on a graph representation learning model and the thinking logic graph, and obtain a category of the first graph node;

[0082] The control unit 430 is used to end the text task when the category of the first graph node is termination; otherwise, update the queue of nodes to be processed or update the thinking logic graph and the queue of nodes to be processed, and call the iteration unit;

[0083] The iteration unit 440 is used to update the graph representation learning model based on the score of the first graph node when the current moment is a preset optimization moment; and call the node classification unit.

[0084] The device provided by the embodiment of the present invention obtains the task description text of the text task by inputting the task basic text of the text task into the large language model, constructs a thinking logic graph based on the graph nodes corresponding to the task description text and places the graph nodes into the queue of nodes to be processed, then obtains the first graph node of the queue of nodes to be processed in the node classification step, classifies the first graph node based on the graph representation learning model and the thinking logic graph, and obtains the category of the first graph node; in the control step, if the category of the first graph node is termination, the text task is terminated; otherwise, the queue of nodes to be processed or the thinking logic graph and the queue of nodes to be processed are updated, and the process jumps to the iteration step; in the iteration step, if the current time is the preset optimization moment, the graph representation learning model is updated based on the score of the first graph node, and then the process jumps to the node classification step, and without updating the large language model, an iterative update optimization method is adopted to integrate the graph representation learning, thereby realizing the optimization of the reasoning logic of the large language model for specific text tasks and saving the resources required for model optimization.

[0085] Based on any of the above embodiments, if the category of the first graph node is thought continuation, updating the queue of nodes to be processed or updating the thought logic graph and the queue of nodes to be processed specifically includes:

[0086] Repeatedly inputting the node content of the first graph node into the large language model to obtain a plurality of task execution texts respectively output by the large language model;

[0087] Constructing graph nodes corresponding to the multiple task execution texts respectively, and updating the thinking logic graph based on the graph nodes corresponding to the multiple task execution texts;

[0088] The first graph node is dequeued from the queue of nodes to be processed, and the graph nodes corresponding to the multiple task execution texts are added to the queue of nodes to be processed.

[0089] Based on any of the above embodiments, if the category of the first graph node is thinking backtracking, updating the queue of nodes to be processed or updating the thinking logic graph and the queue of nodes to be processed specifically includes:

[0090] Determine the parent node of the first graph node in the thought logic graph;

[0091] Inputting the node content of the parent node, the node content of the first graph node, and the backtracking prompt word into the large language model to obtain the task execution text output by the large language model;

[0092] Constructing a graph node corresponding to the task execution text, and updating the thinking logic graph based on the graph node corresponding to the task execution text;

[0093] The first graph node is dequeued from the queue of nodes to be processed, and the graph node corresponding to the task execution text is added to the queue of nodes to be processed.

[0094] Based on any of the above embodiments, if the category of the first graph node is thought suspension, updating the queue of nodes to be processed or updating the thought logic graph and the queue of nodes to be processed specifically includes:

[0095] The first graph node is dequeued from the queue of nodes to be processed.

[0096] Based on any of the above embodiments, the classifying the first graph node based on the graph representation learning model and the thinking logic graph to obtain the category of the first graph node specifically includes:

[0097] Perform feature extraction on the thinking logic graph based on the graph neural network layer in the graph representation learning model to obtain a vector representation of each graph node in the thinking logic graph;

[0098] The vector representation of the first graph node is classified based on the classification layer in the graph representation learning model to determine the category of the first graph node.

[0099] Based on any of the above embodiments, the score of any graph node is obtained in the following manner:

[0100] Constructing a scoring input text based on the scoring standard text of the text task, the task description text of the text task, and the node content of any graph node;

[0101] The scoring input text is input into the large language model to obtain the score of any graph node output by the large language model.

[0102] Figure 5 is a schematic diagram of the structure of the electronic device provided by the present invention, such as Figure 5As shown, the electronic device may include: a processor (processor) 510, a memory (memory) 520, a communication interface (Communications Interface) 530 and a communication bus 540, wherein the processor 510, the memory 520, and the communication interface 530 communicate with each other through the communication bus 540. The processor 510 can call the logic instructions in the memory 520 to execute a text task processing control method based on a large language model, which includes: an initialization step: inputting the task basic text of the text task into the large language model, obtaining the task description text of the text task output by the large language model, constructing a thinking logic diagram based on the graph nodes corresponding to the task description text and placing the graph nodes into a queue of nodes to be processed; a node classification step: obtaining the first graph node of the queue of nodes to be processed, classifying the first graph node based on the graph representation learning model and the thinking logic diagram, and obtaining the category of the first graph node; a control step: if the category of the first graph node is termination, then ending the text task; otherwise, updating the queue of nodes to be processed or updating the thinking logic diagram and the queue of nodes to be processed, and jumping to an iteration step; an iteration step: if the current time is a preset optimization moment, then updating the graph representation learning model based on the score of the first graph node; jumping to the node classification step.

[0103] In addition, the logic instructions in the above-mentioned memory 520 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0104] On the other hand, the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the text task processing control method based on the large language model provided by the above methods, and the method includes: an initialization step: inputting the task basic text of the text task into the large language model, obtaining the task description text of the text task output by the large language model, constructing a thinking logic diagram based on the graph nodes corresponding to the task description text and placing the graph nodes into a queue of nodes to be processed; a node classification step: obtaining the first graph node of the queue of nodes to be processed, classifying the first graph node based on the graph representation learning model and the thinking logic diagram, and obtaining the category of the first graph node; a control step: if the category of the first graph node is termination, then ending the text task; otherwise, updating the queue of nodes to be processed or updating the thinking logic diagram and the queue of nodes to be processed, and jumping to the iteration step; an iteration step: if the current is a preset optimization moment, then updating the graph representation learning model based on the score of the first graph node; jumping to the node classification step.

[0105] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the above-mentioned large language model-based text task processing control method, the method comprising: an initialization step: inputting the task basic text of the text task into the large language model, obtaining the task description text of the text task output by the large language model, constructing a thinking logic diagram based on the graph nodes corresponding to the task description text and placing the graph nodes into a queue of nodes to be processed; a node classification step: obtaining the first graph node of the queue of nodes to be processed, classifying the first graph node based on the graph representation learning model and the thinking logic diagram, and obtaining the category of the first graph node; a control step: if the category of the first graph node is termination, then ending the text task; otherwise, updating the queue of nodes to be processed or updating the thinking logic diagram and the queue of nodes to be processed, and jumping to the iteration step; an iteration step: if the current is a preset optimization moment, then updating the graph representation learning model based on the score of the first graph node; jumping to the node classification step.

[0106] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0107] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0108] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A text task processing control method based on a large language model, characterized in that: include: Initialization step: inputting the basic text of the text task into the large language model, obtaining the task description text of the text task output by the large language model, constructing a thinking logic diagram based on the graph nodes corresponding to the task description text and placing the graph nodes into the queue of nodes to be processed; Node classification step: obtaining the first graph node of the queue of nodes to be processed, classifying the first graph node based on the graph representation learning model and the thinking logic graph, and obtaining the category of the first graph node; Control step: if the category of the first graph node is termination, then end the text task; otherwise, update the queue of nodes to be processed or update the thinking logic graph and the queue of nodes to be processed, and jump to the iteration step; Iteration step: if the current time is a preset optimization time, updating the graph representation learning model based on the score of the first graph node; Jump to the node classification step.

2. The text task processing control method based on a large language model according to claim 1, characterized in that: If the category of the first graph node is thought continuation, the updating of the queue of nodes to be processed or the updating of the thought logic graph and the queue of nodes to be processed specifically includes: Repeatedly inputting the node content of the first graph node into the large language model to obtain a plurality of task execution texts respectively output by the large language model; Constructing graph nodes corresponding to the multiple task execution texts respectively, and updating the thinking logic graph based on the graph nodes corresponding to the multiple task execution texts; The first graph node is dequeued from the queue of nodes to be processed, and the graph nodes corresponding to the multiple task execution texts are added to the queue of nodes to be processed.

3. The text task processing control method based on a large language model according to claim 1, characterized in that: If the category of the first graph node is thought backtracking, the updating of the queue of nodes to be processed or the updating of the thought logic graph and the queue of nodes to be processed specifically includes: Determine the parent node of the first graph node in the thought logic graph; Inputting the node content of the parent node, the node content of the first graph node, and the backtracking prompt word into the large language model to obtain the task execution text output by the large language model; Constructing a graph node corresponding to the task execution text, and updating the thinking logic graph based on the graph node corresponding to the task execution text; The first graph node is dequeued from the queue of nodes to be processed, and the graph node corresponding to the task execution text is added to the queue of nodes to be processed.

4. The text task processing control method based on a large language model according to claim 1, characterized in that: If the category of the first graph node is thinking suspension, the updating of the queue of nodes to be processed or the updating of the thinking logic graph and the queue of nodes to be processed specifically includes: The first graph node is dequeued from the queue of nodes to be processed.

5. The text task processing control method based on a large language model according to any one of claims 1 to 4, characterized in that: The classifying the first graph node based on the graph representation learning model and the thinking logic graph to obtain the category of the first graph node specifically includes: Based on the graph neural network layer in the graph representation learning model, feature extraction is performed on the thinking logic graph to obtain a vector representation of each graph node in the thinking logic graph; The vector representation of the first graph node is classified based on the classification layer in the graph representation learning model to determine the category of the first graph node.

6. The text task processing control method based on a large language model according to any one of claims 1 to 4, characterized in that: The score of any graph node is obtained as follows: Constructing a scoring input text based on the scoring standard text of the text task, the task description text of the text task, and the node content of any graph node; The scoring input text is input into the large language model to obtain the score of any graph node output by the large language model.

7. A text task processing control device based on a large language model, characterized in that: include: An initialization unit, used to input a basic task text of a text task into a large language model, obtain a task description text of the text task output by the large language model, construct a thinking logic graph based on graph nodes corresponding to the task description text, and place the graph nodes into a queue of nodes to be processed; A node classification unit, used for obtaining a first graph node of the queue of nodes to be processed, classifying the first graph node based on a graph representation learning model and the thinking logic graph, and obtaining a category of the first graph node; A control unit, configured to terminate the text task when the category of the first graph node is termination; otherwise, update the queue of nodes to be processed or update the thinking logic graph and the queue of nodes to be processed, and call an iteration unit; An iteration unit, configured to update the graph representation learning model based on the score of the first graph node when the current moment is a preset optimization moment; The node classification unit is called.

8. The text task processing control device based on a large language model according to claim 7, characterized in that: If the category of the first graph node is thought continuation, the updating of the queue of nodes to be processed or the updating of the thought logic graph and the queue of nodes to be processed specifically includes: Repeatedly inputting the node content of the first graph node into the large language model to obtain a plurality of task execution texts respectively output by the large language model; Constructing graph nodes corresponding to the multiple task execution texts respectively, and updating the thinking logic graph based on the graph nodes corresponding to the multiple task execution texts; The first graph node is dequeued from the queue of nodes to be processed, and the graph nodes corresponding to the multiple task execution texts are added to the queue of nodes to be processed.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the text task processing control method based on the large language model as described in any one of claims 1 to 6 is implemented.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the text task processing control method based on a large language model as described in any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Document-level relation extraction method based on graph neural network and reasoning path

    CN114818658A

  • Power distribution network fault attribution analysis method based on graph node sampling and large language model

    CN118503452A