Cooperative reasoning method and system based on large language model
By decomposing the inference process behavior of the task into atomic behavior and performing multi-forktree structure orchestration, autonomous collaborative large language models solve the problem of high cost of artificial design model collaboration mechanism, achieving higher efficiency and higher performance inference.
Patent Information
- Application Number
- CN202411812467.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-05-16
AI Technical Summary
In the prior art, the artificially designed model collaboration mechanism is costly and cannot fully realize the potential of each model, resulting in inferential efficiency, limiting the performance of multi-model collaboration in complex tasks, increasing the risk of hallucinations, and reducing the overall inference accuracy and reliability.
By decomposing the inference process behavior of the task into several atomic behaviors, and using preset atomic behavior database and state-based global atomic behavior selection strategy for multi-forktree structure orchestration, we independently coordinate multiple large language models to complete inference of different tasks.
The cost of synergistic reasoning is reduced, the synergistic effect is improved, the reasoning with higher efficiency and higher performance is achieved, the artificial participation is reduced, and the flexibility and interpretability of the inference process are enhanced.
Smart Images

Figure CN120012907A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of natural language processing, and in particular to a collaborative reasoning method and system based on a large language model. Background Art
[0002] With the rapid development of artificial intelligence, large language models (LLMs) have brought revolutionary impacts in many fields. In recent years, with the introduction of contextual memory, planning capabilities, and external tools, the reasoning ability and accuracy of LLMs have been significantly improved. Due to their unique training data and optimization strategies, these models have shown their respective advantages in specific fields or tasks and can efficiently handle a variety of tasks. For example, some models excel in the execution of complex instructions, while others are more suitable for code generation. By integrating the advantages of these models and using collaborative reasoning to complement each other's shortcomings, the overall system's ability to handle complex tasks can be improved, achieving higher accuracy and stronger generalization.
[0003] However, when dealing with tasks in different fields, it is usually necessary to manually design and build multi-model collaborative reasoning mechanisms, which is not only costly but also inefficient. In addition, manually designed collaborative strategies are often difficult to achieve optimality, which limits the full potential of LLMs and sometimes may lead to an increase in hallucinations and high reasoning costs. Summary of the invention
[0004] The present invention provides a collaborative reasoning method and system based on a large language model, which is used to solve the problem that the artificially designed model collaboration mechanism in the prior art is high in cost and cannot give full play to the potential of each model, which not only leads to low reasoning efficiency, but also limits the performance of multi-model collaboration in complex tasks, increases the risk of hallucination, and reduces the overall reasoning accuracy and reliability. The present invention can autonomously collaborate with multiple large language models to complete the reasoning of different tasks, reduce the cost of collaborative reasoning, improve the collaborative effect, and achieve more efficient and higher performance reasoning.
[0005] The present invention provides a collaborative reasoning method based on a large language model, comprising: decomposing the reasoning process behavior of a task into a plurality of atomic behaviors according to a preset atomic behavior library; the atomic behavior comprises a type of a selected model, a reasoning behavior and / or an auxiliary behavior; the selected model is a large language model required for reasoning the task; the reasoning behavior is a behavior driven by a prompting technology, and the auxiliary behavior is a behavior using an external tool; a multi-branch tree structure is arranged according to a plurality of the atomic behaviors and a state-based global atomic behavior selection strategy to obtain an atomic behavior multi-branch tree; collaborative reasoning is performed on the task based on a large language model set and the atomic behavior multi-branch tree to obtain a collaborative reasoning result; the large language model set comprises a plurality of the selected models corresponding to the plurality of the atomic behaviors.
[0006] According to a collaborative reasoning method based on a large language model provided by the present invention, the reasoning process behavior of the task is decomposed into a number of atomic behaviors according to a preset atomic behavior library, including: extracting features of the reasoning process behavior of the task according to a preset feature extraction algorithm to obtain a number of behavior features; matching atomic behaviors according to the several behavior features and the preset atomic behavior library to obtain matching results; and decomposing the reasoning process behavior of the task into a number of atomic behaviors according to the matching results.
[0007] According to a collaborative reasoning method based on a large language model provided by the present invention, the atomic behavior multi-branch tree includes a node set and an edge set; each node in the node set corresponds to one atomic behavior; and the edge set is used to characterize the execution order between atomic behaviors.
[0008] According to a collaborative reasoning method based on a large language model provided by the present invention, the state-based global atomic behavior selection strategy is that the current node selects the atomic behavior of the next node or multiple subsequent nodes based on the state of the overall reasoning process; the state of the current node includes the execution behavior and execution result of the atomic behavior corresponding to the current node.
[0009] According to a collaborative reasoning method based on a large language model provided by the present invention, the initial parameters of the state-based global atomic behavior selection strategy are automatically generated based on prior knowledge of the large language model.
[0010] According to a collaborative reasoning method based on a large language model provided by the present invention, after collaborative reasoning is performed on tasks based on a large language model set and the atomic behavior multi-branch tree to obtain a collaborative reasoning result, the method further includes: determining an execution feedback result based on the collaborative reasoning result and a preset correct result; the execution feedback result is used to characterize whether the collaborative reasoning result is a correct or incorrect result; determining a state value of the state of the overall reasoning process based on the execution feedback result and the state-based global atomic behavior selection strategy; and adjusting the strategy parameters of the state-based global atomic behavior selection strategy based on the state value.
[0011] The present invention also provides a collaborative reasoning system based on a large language model, comprising: a decomposition module, used to decompose the reasoning process behavior of a task into a plurality of atomic behaviors according to a preset atomic behavior library; the atomic behavior includes the type of the selection model, the reasoning behavior and / or the auxiliary behavior; the selection model is a large language model required for reasoning the task; the reasoning behavior is a behavior driven by a prompt technology, and the auxiliary behavior is a behavior using an external tool; an orchestration module, used to perform multi-branch tree structure orchestration according to a plurality of the atomic behaviors and a state-based global atomic behavior selection strategy to obtain an atomic behavior multi-branch tree; a collaborative reasoning module, used to perform collaborative reasoning on the task based on a large language model set and the atomic behavior multi-branch tree to obtain a collaborative reasoning result; the large language model set includes a plurality of the selection models corresponding to the plurality of the atomic behaviors.
[0012] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein when the processor executes the computer program, the collaborative reasoning method based on a large language model as described above is implemented.
[0013] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the collaborative reasoning methods based on a large language model as described above.
[0014] 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 collaborative reasoning methods based on a large language model as described above.
[0015] The present invention provides a collaborative reasoning method and system based on a large language model, the method comprising: decomposing the reasoning process behavior of a task into a number of atomic behaviors according to a preset atomic behavior library; the atomic behavior includes the type of the selected model, the reasoning behavior and / or the auxiliary behavior; arranging a multi-branch tree structure according to a number of atomic behaviors and a state-based global atomic behavior selection strategy to obtain an atomic behavior multi-branch tree; performing collaborative reasoning on the task based on a large language model set and an atomic behavior multi-branch tree to obtain a collaborative reasoning result; the large language model set includes a number of selection models corresponding to the number of atomic behaviors. The present invention can autonomously collaborate with multiple large language models to complete the reasoning of different tasks, reduce the cost of collaborative reasoning, improve the collaborative effect, and achieve more efficient and higher performance reasoning. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] 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.
[0017] Figure 1 It is a flowchart of a collaborative reasoning method based on a large language model provided by the present invention.
[0018] Figure 2 It is a flowchart of the use and update of the atomic behavior selection strategy provided by the present invention.
[0019] Figure 3 It is a structural diagram of a collaborative reasoning system based on a large language model provided by the present invention.
[0020] Figure 4 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0021] 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.
[0022] In the collaborative reasoning process of multiple large language models, traditional methods often achieve collaboration between models through manual construction. This manually constructed collaborative method has many limitations. It is not only difficult to flexibly apply to tasks in different fields, but also may lead to potential performance degradation and lack of adaptability in actual applications due to manually set strategies and model configurations.
[0023] Therefore, in order to solve the technical problems existing in the prior art, the present invention provides a collaborative reasoning method based on a large language model, which can autonomously collaborate with multiple large language models to complete the reasoning of different tasks, and continuously and autonomously optimize the method of the collaborative mechanism, thereby reducing the construction cost of the current collaborative reasoning method, improving the collaborative effect, and achieving more efficient and higher performance reasoning. The present invention can achieve self-organization without human intervention in the reasoning process. Each model adaptively adjusts the reasoning behavior through feedback, so that the collaborative effect between models is natural and coherent. This self-organizing mechanism helps to reduce human participation in the reasoning process. Automatic adaptation to multiple tasks is achieved through a multi-branch tree structure and a state selection strategy, which significantly enhances the flexibility of multi-model collaboration.
[0024] Please refer to Figure 1 , Figure 1 A schematic flow chart of a collaborative reasoning method based on a large language model provided by the present invention.
[0025] The present invention provides a collaborative reasoning method based on a large language model, comprising: 101: Decompose the reasoning process behavior of the task into several atomic behaviors according to the preset atomic behavior library; the atomic behavior includes the type of selected model, reasoning behavior and / or auxiliary behavior; the selected model is a large language model required for reasoning about the task; the reasoning behavior is the behavior driven by prompt technology, and the auxiliary behavior is the behavior using external tools.
[0026] As a preferred embodiment, the reasoning process behavior of the task is decomposed into several atomic behaviors according to a preset atomic behavior library, including: extracting features of the reasoning process behavior of the task according to a preset feature extraction algorithm to obtain several behavior features; matching atomic behaviors according to the several behavior features and the preset atomic behavior library to obtain matching results; and decomposing the reasoning process behavior of the task into several atomic behaviors according to the matching results.
[0027] In this embodiment, first, a preset feature extraction algorithm is used to analyze the reasoning process behavior of the task. The algorithm can identify key behavioral features in the task, such as information retrieval, pattern recognition, logical judgment, etc. Then, the extracted behavioral features are matched with the preset atomic behavior library to obtain matching results. The preset atomic behavior library contains all possible atomic behaviors. According to the matching results, the reasoning process behavior of the large language model for the task is decomposed into several atomic behaviors of the smallest granularity. , where A is the set of atomic behaviors, a j For the j Atomic behavior, j is the sequence number of the atomic behavior, n is the number of atomic behaviors. Atomic behaviors are defined as the basic operation units required by the model during reasoning, including the type of model selection (large language model required for reasoning on tasks), reasoning behaviors driven by prompting techniques, and auxiliary behaviors using external tools (such as search, calculator, file access, etc.). Subdividing the reasoning process into these diverse atomic behaviors can give each language model independent behavior-driving capabilities, thereby completing different tasks more flexibly.
[0028] 102: Arrange a multi-branch tree structure according to a number of atomic behaviors and a state-based global atomic behavior selection strategy to obtain an atomic behavior multi-branch tree.
[0029] As a preferred embodiment, the atomic behavior multitree includes a node set and an edge set; each node in the node set corresponds to an atomic behavior; and the edge set is used to characterize the execution order between the atomic behaviors.
[0030] In this embodiment, in the arrangement of atomic behaviors, atomic behaviors are organized and executed by constructing an atomic behavior multitree. An atomic behavior multitree is a data structure used to clearly represent the execution order and dependency relationship between atomic behaviors. middle, is a set of nodes, each node Represents an atomic behavior. These atomic behaviors can be information retrieval, pattern recognition, logical judgment, etc. is a set of edges, which is used to characterize the execution order between atomic behaviors. Each edge connects two nodes, indicating the start of the next atomic behavior after the completion of one atomic behavior. The basic structure of the multitree consists of a chain path composed of atomic behaviors and its bifurcation points, which describe multiple possible paths in the reasoning process through different branches. In this multitree structure, each node represents an atomic behavior, and the bifurcation points represent different choices that may be generated in the reasoning process. Through this hierarchical structure, all steps in the reasoning process are fully presented, and each path gradually extends from the initial state to the reasoning result. The process of constructing an atomic behavior multitree includes determining the dependencies and execution order of atomic behaviors. This can be achieved by analyzing the logical flow of the task and the characteristics of the atomic behavior. In the collaborative reasoning process, the atomic behavior multitree guides the execution process of LLMs. The execution result of each atomic behavior may affect the selection and execution of subsequent atomic behaviors. For example, if an atomic behavior is information retrieval, its result may be used to trigger subsequent pattern recognition behavior. In the reasoning process, the atomic behavior multitree can be dynamically adjusted according to the newly obtained information or task requirements. This adjustment can be achieved by adding, removing, or reordering nodes and edges to optimize the reasoning path and improve efficiency.
[0031] This embodiment decomposes the reasoning process into atomic behaviors and builds them in a multi-tree structure. Our framework can be easily extended to different fields and new task requirements. New tasks only need to define relevant atomic behaviors and basic rules, and the model can automatically adapt and optimize strategies, showing a high degree of portability. The atomic behavior arrangement based on the multi-tree structure can fully describe various possible paths in the reasoning process, so that the accuracy and consistency of reasoning are guaranteed.
[0032] Take a complex customer service automation system as an example, which needs to handle customer queries and provide accurate answers. First, an atomic behavior multitree is constructed, which contains atomic behaviors such as information retrieval, sentiment analysis, and answer generation. Then, according to the content and sentiment of the customer's query, the system dynamically selects and executes the corresponding atomic behavior through the guidance of the multitree. For example, if the query contains urgent emotions, the system may prioritize the execution of the atomic behavior of emotion soothing before information retrieval and answer generation. In this way, it can be ensured that LLMs can handle various tasks efficiently and accurately during the collaborative reasoning process, while maintaining the flexibility and interpretability of the reasoning process. The construction and application of the atomic behavior multitree provides a structured and modular reasoning framework for LLMs, which helps to improve the accuracy and efficiency of reasoning.
[0033] As a preferred embodiment, the state-based global atomic behavior selection strategy selects the atomic behavior of the next node or multiple subsequent nodes based on the state of the overall reasoning process; the state of the current node includes the execution behavior and execution result of the atomic behavior corresponding to the current node.
[0034] As a preferred embodiment, the initial parameters of the state-based global atomic behavior selection strategy are automatically generated based on prior knowledge of a large language model.
[0035] In this embodiment, in the atomic behavior multi-branch tree, the state of the overall reasoning process A sequence of two tuples consisting of the previous execution behavior and the execution result .in, i is the number of different states in the reasoning process. When the reasoning process changes, you can change from state s i Convert to s i+1 , for t The execution behavior of node 0 (atomic behavior), for t The execution result of node 0, for t 1. Execution behavior of the node, for t 1 Node execution result, for t n The execution behavior of the node, for t n The execution result of the node. Based on the status of the overall reasoning process , in the state-based global atomic behavior selection strategy Under guidance, select the atomic behavior of the next node or multiple subsequent nodes.
[0036] State-based global atomic behavior selection strategy is a probability that represents the possible atomic behavior selection The vector is used to guide the system to choose the most suitable action for the current state in different situations. The initial parameters of the strategy are automatically generated based on the prior knowledge of the large language model. These parameters reflect the model's initial understanding of the task and serve as the default starting point of the strategy.
[0037] in, is the initial parameter of the strategy, P[continual reasoning] is the probability of selecting continuous reasoning behavior, P[conclude] is the probability of selecting conclusion behavior, and P[search wiki] is the probability of selecting search behavior.
[0038] 103: Perform collaborative reasoning on the task based on a large language model set and an atomic behavior multi-branch tree to obtain a collaborative reasoning result; the large language model set includes several selection models corresponding to several atomic behaviors.
[0039] In this embodiment, each large language model is based on an atomic behavior multi-branch tree, and realizes collaborative reasoning of tasks through self-organization, including adaptive adjustment and division of labor mechanism, so as to reduce redundant behavior and enhance reasoning consistency. Overall, this self-organization mechanism ensures the synergy of different models.
[0040] As a preferred embodiment, after collaborative reasoning is performed on tasks based on a large language model set and an atomic behavior multi-branch tree and the collaborative reasoning results are obtained, the method further includes: determining an execution feedback result based on the collaborative reasoning results and a preset correct result; the execution feedback result is used to characterize whether the collaborative reasoning result is a correct or incorrect result; determining the state value of the state of the overall reasoning process based on the execution feedback result and a state-based global atomic behavior selection strategy; and adjusting the strategy parameters of the state-based global atomic behavior selection strategy based on the state value.
[0041] In this embodiment, the behavior selection strategy is continuously adaptively adjusted based on feedback during the reasoning process, so that continuous improvement can be achieved. As the number of reasoning increases, the decision-making ability and reasoning effect of the framework gradually improve.
[0042] Specifically, after the collaborative reasoning obtains the result, the system reaches the termination state At this time, the execution feedback result is determined according to the preset correct result, and the execution feedback result is used to characterize whether the collaborative reasoning result is a correct or incorrect result.
[0043] in, R ( s final , a ) is the execution feedback result. When the collaborative reasoning result is the same as the preset correct result, the execution feedback result is 1; when the collaborative reasoning result is different from the preset correct result, the execution feedback result is -1.
[0044] The state value of the state of the overall reasoning process is determined according to the execution feedback results and the state-based global atomic behavior selection strategy.
[0045] in, V ( s final )for The state value of V ( s ) is the status s The state value of For the status s choose a Atomic behavior strategy, is a discount factor with a value range of [0, 1]. It determines the value of the current action by discounting future rewards. It is used to measure the importance of current rewards and future rewards. Status s 'status value, s 'For s Different status.
[0046] Subsequently, the policy parameters of the state-based global atomic behavior selection strategy are adjusted according to the state value. Specifically, this process increases the probability of selecting the execution of atomic behaviors with high state values and reduces the probability of selecting the execution of atomic behaviors with low state values, thereby optimizing the strategy to achieve the goal more efficiently.
[0047] in, For the status s i choose a Atomic behavior strategy, P( a 1| s i ) is in the state s i When selecting a The probability of 1, P( a 2| s i ) is in the state s i When selecting a The probability of 2, P( a n | s i ) is in the state s i When selecting a n The probability of From the state s i Execute a 1 After the atomic behavior, transfer to the states i+1 The state value of From the state s i Execute a 2 After the atomic behavior, transfer to the state s i+1 The state value of From the state s i Execute a n After the atomic behavior, transfer to the state s i+1 The state value of k is the number of iterations, For the status s i When selecting a 1, For the status s i When selecting a 2, For the status s i When selecting a n , Is positively correlated.
[0048] Please refer to Figure 2 , Figure 2 A schematic diagram of the flow chart of the use and update of the atomic behavior selection strategy provided by the present invention.
[0049] The specific process of using and updating the atomic behavior selection strategy is as follows: In the forward process, first obtain the current state and determine the strategy corresponding to the state. If a strategy already exists, check whether the number of updates reaches the threshold. If it does, update the strategy through the state value; if not, continue to use the existing strategy. If there is no existing strategy, initialize the strategy through the large language model (LLM). In either case, the corresponding atomic behavior is ultimately selected according to the strategy. The state value update process is triggered after the strategy is updated to ensure that the corresponding state value is updated. The backward process starts with obtaining the execution feedback result, which is then fed back to the state value update process to update the strategy through the state value. The entire process ensures a continuous iterative cycle of strategy evaluation, update, and learning.
[0050] As the task progresses, the strategy will be iteratively updated to gradually adapt to the specific needs of the task, making future action selection more accurate and efficient. By dynamically updating the strategy parameters, the collaborative reasoning framework can more efficiently adapt to changing task requirements, improve overall reasoning performance, and obtain more stable reasoning results.
[0051] The collaborative reasoning system based on a large language model provided by the present invention is described below. The collaborative reasoning system based on a large language model described below and the collaborative reasoning method based on a large language model described above can refer to each other.
[0052] Please refer to Figure 3 , Figure 3 A schematic diagram of the structure of a collaborative reasoning system based on a large language model provided by the present invention.
[0053] The present invention also provides a collaborative reasoning system based on a large language model, including: a decomposition module 301, which is used to decompose the reasoning process behavior of a task into several atomic behaviors according to a preset atomic behavior library; the atomic behavior includes the type of the selection model, the reasoning behavior and / or the auxiliary behavior; the selection model is a large language model required for reasoning the task; the reasoning behavior is the behavior driven by the prompt technology, and the auxiliary behavior is the behavior using an external tool; the arrangement module 302 is used to perform multi-branch tree structure arrangement according to several atomic behaviors and a state-based global atomic behavior selection strategy to obtain an atomic behavior multi-branch tree; the collaborative reasoning module 303 is used to perform collaborative reasoning on the task based on the large language model set and the atomic behavior multi-branch tree to obtain a collaborative reasoning result; the large language model set includes several selection models corresponding to several atomic behaviors.
[0054] Figure 4 An example of a structural diagram of an electronic device is shown in FIG. Figure 4 As shown, the electronic device may include: a processor 401, a communication interface 402, a memory 403 and a communication bus 404, wherein the processor 401, the communication interface 402 and the memory 403 communicate with each other through the communication bus 404. The processor 401 may call the logic instructions in the memory 403 to execute a collaborative reasoning method based on a large language model, the method comprising: decomposing the reasoning process behavior of the task into a plurality of atomic behaviors according to a preset atomic behavior library; the atomic behavior includes the type of the selected model, the reasoning behavior and / or the auxiliary behavior; the selected model is a large language model required for reasoning the task; the reasoning behavior is a behavior driven by the prompt technology, and the auxiliary behavior is a behavior using an external tool; a multi-branch tree structure is arranged according to a plurality of atomic behaviors and a state-based global atomic behavior selection strategy to obtain an atomic behavior multi-branch tree; collaborative reasoning is performed on the task based on a large language model set and an atomic behavior multi-branch tree to obtain a collaborative reasoning result; the large language model set includes a plurality of selected models corresponding to the plurality of atomic behaviors.
[0055] In addition, the logic instructions in the above-mentioned memory 403 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.
[0056] On the other hand, the present invention also provides a computer program product, which includes a computer program, and the computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the collaborative reasoning method based on a large language model provided by the above methods, and the method includes: decomposing the reasoning process behavior of the task into a plurality of atomic behaviors according to a preset atomic behavior library; the atomic behavior includes the type of selected model, reasoning behavior and / or auxiliary behavior; the selected model is a large language model required for reasoning the task; the reasoning behavior is the behavior driven by prompt technology, and the auxiliary behavior is the behavior using external tools; a multi-branch tree structure is arranged according to a plurality of atomic behaviors and a state-based global atomic behavior selection strategy to obtain an atomic behavior multi-branch tree; collaborative reasoning is performed on the task based on a large language model set and the atomic behavior multi-branch tree to obtain a collaborative reasoning result; the large language model set includes a plurality of selected models corresponding to the plurality of atomic behaviors.
[0057] 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 collaborative reasoning method based on a large language model provided by the above-mentioned methods, the method comprising: decomposing the reasoning process behavior of the task into a plurality of atomic behaviors according to a preset atomic behavior library; the atomic behavior includes the type of selected model, reasoning behavior and / or auxiliary behavior; the selected model is a large language model required for reasoning the task; the reasoning behavior is the behavior driven by prompt technology, and the auxiliary behavior is the behavior using external tools; a multi-branch tree structure is arranged according to a plurality of atomic behaviors and a state-based global atomic behavior selection strategy to obtain an atomic behavior multi-branch tree; collaborative reasoning is performed on the task based on a large language model set and the atomic behavior multi-branch tree to obtain a collaborative reasoning result; the large language model set includes a plurality of selected models corresponding to the plurality of atomic behaviors.
[0058] 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. Those of ordinary skill in the art may understand and implement it without creative effort.
[0059] 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.
[0060] 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 collaborative reasoning method based on a large language model, characterized in that: include: Decompose the reasoning process behavior of the task into several atomic behaviors according to the preset atomic behavior library; The atomic behavior includes the type of selected model, reasoning behavior and / or auxiliary behavior; the selected model is a large language model required for reasoning about the task; the reasoning behavior is a behavior driven by prompt technology, and the auxiliary behavior is a behavior using external tools; Arranging a multi-branch tree structure according to a plurality of the atomic behaviors and a state-based global atomic behavior selection strategy to obtain an atomic behavior multi-branch tree; Based on a large language model set and the multi-branch tree of atomic behaviors, collaborative reasoning is performed on the task to obtain a collaborative reasoning result; the large language model set includes a plurality of the selected models corresponding to a plurality of the atomic behaviors.
2. The collaborative reasoning method based on a large language model according to claim 1, characterized in that: The reasoning process behavior of the task is decomposed into several atomic behaviors according to the preset atomic behavior library, including: Extracting features of the reasoning process behavior of the task according to a preset feature extraction algorithm to obtain a number of behavior features; Performing atomic behavior matching according to the plurality of behavior features and the preset atomic behavior library to obtain a matching result; The reasoning process behavior of the task is decomposed into a plurality of the atomic behaviors according to the matching result.
3. The collaborative reasoning method based on a large language model according to claim 1, characterized in that: The atomic behavior multitree includes a node set and an edge set; each node in the node set corresponds to one atomic behavior; and the edge set is used to characterize the execution order between atomic behaviors.
4. The collaborative reasoning method based on a large language model according to claim 1, characterized in that: The state-based global atomic behavior selection strategy is that the current node selects the atomic behavior of the next node or multiple subsequent nodes based on the state of the overall reasoning process; the state of the current node includes the execution behavior and execution result of the atomic behavior corresponding to the current node.
5. The collaborative reasoning method based on a large language model according to claim 1, characterized in that: The initial parameters of the state-based global atomic behavior selection strategy are automatically generated based on the prior knowledge of a large language model.
6. The collaborative reasoning method based on a large language model according to any one of claims 1 to 5, characterized in that: After performing collaborative reasoning on the task based on the large language model set and the atomic behavior multitree and obtaining the collaborative reasoning result, the method further includes: Determine an execution feedback result according to the collaborative reasoning result and the preset correct result; the execution feedback result is used to characterize whether the collaborative reasoning result is a correct or incorrect result; Determining a state value of a state of the overall reasoning process according to the execution feedback result and the state-based global atomic behavior selection strategy; The strategy parameters of the state-based global atomic behavior selection strategy are adjusted according to the state value.
7. A collaborative reasoning system based on a large language model, characterized in that: include: A decomposition module is used to decompose the reasoning process behavior of the task into several atomic behaviors according to a preset atomic behavior library; The atomic behavior includes the type of selected model, reasoning behavior and / or auxiliary behavior; the selected model is a large language model required for reasoning about the task; the reasoning behavior is a behavior driven by prompt technology, and the auxiliary behavior is a behavior using external tools; An arrangement module, used for arranging a multi-branch tree structure according to a plurality of the atomic behaviors and a state-based global atomic behavior selection strategy to obtain an atomic behavior multi-branch tree; A collaborative reasoning module is used to perform collaborative reasoning on tasks based on a large language model set and the atomic behavior multi-branch tree to obtain collaborative reasoning results; the large language model set includes several selected models corresponding to several atomic behaviors.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the collaborative reasoning method based on a large language model as described in any one of claims 1 to 6 is implemented.
9. 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 collaborative reasoning method based on a large language model as described in any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the collaborative reasoning method based on a large language model as described in any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Cloud-edge collaborative big language model intelligent customer service deployment optimization method
CN117808481A
Multi-agent task co-processing method and device based on large language model
CN118519739A
Multi-agent collaboration method, device and equipment based on large language model and medium
CN118551751A
Workflow operation method and device based on multi-agent and man-machine cooperation, and medium
CN118691231A
Electric power scene complex task arrangement decision-making method and system based on large semantic model
CN118735222A
Cited By
Semantic understanding method and engine based on multi-model collaborative reasoning and self-supervised learning
CN121659960A
Semantic understanding method and engine based on multi-model collaborative reasoning and self-supervised learning
CN121659960B