Collaborative reasoning method and system based on large language model
Patent Information
- Application Number
- CN202411812467.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2026-10-23
- Estimated Expiration
- 2044-12-10
AI Technical Summary
[0004]本发明提供一种基于大型语言模型的协同推理方法及系统,用以解决现有技术中人工设计的模型协同机制成本高且无法充分发挥各模型的潜力,不仅导致推理效率低下,还限制了多模型协同在复杂任务中的性能表现,增加了幻觉风险,降低了整体的推理准确性和可靠性的缺陷
[0015]本发明提供的一种基于大型语言模型的协同推理方法及系统,该方法包括:根据预设原子行为库将任务的推理过程行为分解为若干个原子行为;原子行为包括选取模型的类型、推理行为和/或辅助行为;根据若干个原子行为和基于状态的全局原子行为选择策略进行多叉树结构编排,得到原子行为多叉树;基于大型语言模型集合和原子行为多叉树对任务进行协同推理,得到协同推理结果;大型语言模型集合包括与若干个原子行为对应的若干个选取模型。本发明能够自主协同多个大型语言模型完成不同任务的推理,降低了协同推理成本,提升协同效果,实现更高效率和更高性能的推理。
Smart Images

Figure CN120012907B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of natural language processing technology, and in particular to a collaborative reasoning method and system based on a large language model. Background Technology
[0002] With the rapid development of artificial intelligence, large language models (LLMs) have brought revolutionary changes to numerous 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. These models, due to their unique training data and optimization strategies, exhibit their respective advantages in specific domains or tasks, enabling them to efficiently handle diverse tasks. For example, some models excel in executing complex instructions, while others are better suited for code generation. By integrating the strengths of these models and employing collaborative reasoning to complement their weaknesses, the overall system's ability to handle complex tasks can be enhanced, achieving higher accuracy and stronger generalization.
[0003] However, when dealing with tasks in different domains, it is often necessary to manually design and construct multi-model collaborative reasoning mechanisms, which is not only costly but also has limited efficiency. In addition, manually designed collaborative strategies often fail to reach the optimal state, which limits the full potential of LLMs and may sometimes lead to an increase in hallucinations and higher reasoning costs. Summary of the Invention
[0004] This invention provides a collaborative reasoning method and system based on large-scale language models. It addresses the shortcomings of existing manually designed model collaboration mechanisms, which are costly and fail to fully utilize the potential of each model. These mechanisms not only lead to low reasoning efficiency but also limit the performance of multi-model collaboration in complex tasks, increase the risk of illusion, and reduce the overall accuracy and reliability of reasoning. This invention enables autonomous collaboration of multiple large-scale language models to complete reasoning tasks across different tasks, reducing collaborative reasoning costs, improving collaboration effectiveness, and achieving higher efficiency and performance in reasoning.
[0005] This invention provides a collaborative reasoning method based on a large language model, comprising: decomposing the reasoning process of a task into several atomic behaviors according to a preset atomic behavior library; the atomic behaviors include the selection of a model type, reasoning behavior, and / or auxiliary behavior; the selected model is a large language model required for reasoning on the task; the reasoning behavior is a behavior driven by prompting technology, and the auxiliary behavior is a behavior using external tools; arranging a multi-branch tree structure according to the several 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 the atomic behavior multi-branch tree to obtain a collaborative reasoning result; the large language model set includes several selected models corresponding to the several atomic behaviors.
[0006] According to a collaborative reasoning method based on a large language model provided by the present invention, the step of decomposing the reasoning process behavior of a task into several atomic behaviors according to a preset atomic behavior library includes: extracting features from the reasoning process behavior of the task according to a preset feature extraction algorithm to obtain several behavioral features; matching atomic behaviors with the several behavioral features and the preset atomic behavior library to obtain a matching result; and decomposing the reasoning process behavior of the task into several atomic behaviors according to the matching result.
[0007] According to a collaborative reasoning method based on a large language model provided by the present invention, the atomic behavior multi-way tree includes a node set and an edge set; each node in the node set corresponds to one atomic behavior; the edge set is used to characterize the execution order between atomic behaviors.
[0008] According to the 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 corresponding atomic behavior of the current node.
[0009] According to the 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 the 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 performing collaborative reasoning on a task 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 correct or incorrect; determining the 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] This invention also provides a collaborative reasoning system based on a large language model, comprising: a decomposition module, used to decompose the reasoning process of a task into several atomic behaviors according to a preset atomic behavior library; the atomic behaviors include the type of model selection, reasoning behavior, and / or auxiliary behavior; the selected model is a large language model required for reasoning on the task; the reasoning behavior is a behavior driven by prompting technology, and the auxiliary behavior is a behavior using external tools; an orchestration module, used to orchestrate a multi-branch tree structure according to the several atomic behaviors and a state-based global atomic behavior selection strategy to obtain an atomic behavior multi-branch tree; and 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 several selected models corresponding to the several atomic behaviors.
[0012] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor executes the computer program to implement the collaborative reasoning method based on a large language model as described above.
[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 the collaborative reasoning method based on a large language model as described above.
[0014] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the collaborative reasoning method based on a large language model as described above.
[0015] This invention provides a collaborative reasoning method and system based on a large-scale language model. The method includes: decomposing the reasoning process of a task into several atomic behaviors according to a pre-defined atomic behavior library; each atomic behavior includes the selection of a model type, reasoning behavior, and / or auxiliary behavior; arranging a multi-branch tree structure based on the several atomic behaviors and a state-based global atomic behavior selection strategy to obtain an atomic behavior multi-branch tree; and performing collaborative reasoning on the task based on a large-scale language model set and the atomic behavior multi-branch tree to obtain a collaborative reasoning result; the large-scale language model set includes several selected models corresponding to the several atomic behaviors. This invention can autonomously collaborate multiple large-scale language models to complete reasoning for different tasks, reducing the cost of collaborative reasoning, improving collaborative effects, and achieving higher efficiency and higher performance reasoning. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0017] Figure 1 This is a flowchart illustrating a collaborative reasoning method based on a large language model provided by the present invention.
[0018] Figure 2 This is a flowchart illustrating the use and updating of the atomic behavior selection strategy provided by this invention.
[0019] Figure 3 This is a schematic diagram of the structure of a collaborative reasoning system based on a large language model provided by the present invention.
[0020] Figure 4 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0021] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0022] In collaborative reasoning among multiple large-scale language models, traditional methods often achieve collaboration between models through manual construction. This manually constructed collaboration approach has many limitations. Not only is it difficult to apply flexibly to tasks in different domains, but in practical applications, it may also lead to potential performance degradation and insufficient adaptability due to manually set strategies and model configurations.
[0023] Therefore, to address the technical problems existing in current technologies, this invention provides a collaborative reasoning method based on large-scale language models. This method autonomously collaborates multiple large-scale language models to complete reasoning tasks for different purposes and continuously optimizes the collaborative mechanism, thereby reducing the construction cost of current collaborative reasoning methods, improving collaborative effects, and achieving higher efficiency and performance in reasoning. This invention achieves self-organization during the reasoning process without human intervention. Each model adaptively adjusts its reasoning behavior through feedback, resulting in natural and consistent collaborative effects between models. This self-organizing mechanism helps reduce human involvement in the reasoning process. Automatic adaptation to various tasks is achieved through a multi-branch tree structure and state selection strategy, significantly enhancing the flexibility of multi-model collaboration.
[0024] Please refer to Figure 1 , Figure 1 This is a flowchart illustrating a collaborative reasoning method based on a large language model provided by the present invention.
[0025] This invention provides a collaborative reasoning method based on a large-scale language model, comprising: 101: Based on the preset atomic behavior library, the reasoning process of the task is decomposed into several atomic behaviors; atomic behaviors include the selection of model type, reasoning behavior and / or auxiliary behavior; the selected model is a large language model required for reasoning on the task; the reasoning behavior is the behavior driven by prompting technology, and the auxiliary behavior is the behavior using external tools.
[0026] In a preferred embodiment, the reasoning process behavior of a task is decomposed into several atomic behaviors according to a preset atomic behavior library, including: extracting features from the reasoning process behavior of the task according to a preset feature extraction algorithm to obtain several behavioral features; matching the several behavioral features with 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, firstly, a preset feature extraction algorithm is used to analyze the reasoning process behavior of the task. This algorithm can identify key behavioral features in the task, such as information retrieval, pattern recognition, and logical judgment. Then, several extracted behavioral features are matched with a preset atomic behavior library to obtain matching results. The preset atomic behavior library contains all possible atomic behaviors. Based on 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 first j Individual atomic behavior, j This represents the sequence number of the atomic behavior. n This refers to the number of atomic behaviors. An atomic behavior is defined as the basic operational unit required by the model during the reasoning process. This includes selecting the type of model (the large language model needed to reason about the task), reasoning behaviors driven by prompting techniques, and auxiliary behaviors using external tools (such as searching, calculators, accessing files, etc.). Subdividing the reasoning process into these diverse atomic behaviors endows each language model with independent behavioral driving capabilities, thus enabling more flexible completion of different tasks.
[0028] 102: Arrange the multi-branch tree structure according to several atomic behaviors and a state-based global atomic behavior selection strategy to obtain an atomic behavior multi-branch tree.
[0029] In a preferred embodiment, the atomic behavior multi-way tree includes a node set and an edge set; each node in the node set corresponds to an atomic behavior; the edge set is used to characterize the execution order between atomic behaviors.
[0030] In this embodiment, atomic behaviors are organized and executed by constructing an atomic behavior multi-way tree. An atomic behavior multi-way tree is a data structure used to clearly represent the execution order and dependencies between atomic behaviors. middle, For a set of nodes, each node This represents an atomic behavior. These atomic behaviors can be information retrieval, pattern recognition, logical judgment, etc. The multi-branch tree is a set of edges used to represent the execution order between atomic behaviors. Each edge connects two nodes, indicating the start of the next atomic behavior after the completion of the previous one. The basic structure of the multi-branch tree consists of chain-like paths formed by atomic behaviors and their branching points, describing multiple possible paths in the reasoning process through different branches. In this multi-branch tree structure, each node represents an atomic behavior, while the branching points represent different choices that may arise during the reasoning process. Through this hierarchical structure, all steps in the reasoning process are fully presented, and each path extends progressively from the initial state to the reasoning result. The process of constructing the atomic behavior multi-branch tree 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 behaviors. In collaborative reasoning, the atomic behavior multi-branch tree guides the execution flow 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 behaviors. During the reasoning process, the atomic behavior multi-branch tree can be dynamically adjusted according to newly acquired information or task requirements. This adjustment can be achieved by adding, deleting, or reordering nodes and edges to optimize inference paths and improve efficiency.
[0031] This embodiment decomposes the reasoning process into atomic behaviors and constructs them within a multi-branch tree structure. Our framework can be easily extended to different domains and new task requirements. For new tasks, only the relevant atomic behaviors and basic rules need to be defined; the model can automatically adapt and optimize its strategies, demonstrating high portability. The multi-branch tree-based orchestration of atomic behaviors can comprehensively describe all possible paths in the reasoning process, ensuring the accuracy and consistency of the reasoning.
[0032] Taking a complex customer service automation system as an example, this system needs to process customer queries and provide accurate answers. First, an atomic behavior multi-branch tree is constructed, containing atomic behaviors such as information retrieval, sentiment analysis, and answer generation. Then, based on the content and sentiment of the customer query, the system dynamically selects and executes the corresponding atomic behaviors guided by the multi-branch tree. For example, if the query contains an urgent sentiment, the system might prioritize executing the sentiment-soothing atomic behavior before performing information retrieval and answer generation. This approach ensures that LLMs can efficiently and accurately handle various tasks during collaborative reasoning, while maintaining the flexibility and interpretability of the reasoning process. The construction and application of the atomic behavior multi-branch tree provides LLMs with a structured and modular reasoning framework, helping 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, the state of the overall reasoning process in the atomic behavior multi-branch tree A sequence of binary pairs consisting of preceding actions and their results. .in, i These are the numbers assigned to different states during the reasoning process. When a transition occurs during the reasoning process, it can be determined from the state... s i Switch to s i+1 , for t The execution behavior of node 0 (atomic behavior), for t The execution result of node 0, for t The execution behavior of node 1 for t The execution result of node 1 for t n The execution behavior of the node, for t n The execution result of the node. The state based on 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 It is a probability representing the possible atomic behavior selection. The vector is used to guide the system in selecting the most suitable action for the current state under different contexts. The initial parameters of this policy are automatically generated based on the prior knowledge of a large language model. These parameters reflect the model's initial understanding of the task and serve as the default starting point for the policy.
[0037] in, Here are the initial parameters for the strategy: P[continual reasoning] is the probability of choosing the continuous reasoning action, P[conclude] is the probability of choosing the conclusion action, and P[search wiki] is the probability of choosing the search action.
[0038] 103: Perform collaborative reasoning on tasks based on a large set of language models and a multi-branch tree of atomic behaviors to obtain collaborative reasoning results; the large set of language models includes several selected models corresponding to several atomic behaviors.
[0039] In this embodiment, each large language model, based on an atomic behavior multi-branch tree, achieves collaborative reasoning on tasks through a self-organizing mechanism, including adaptive adjustment and division of labor mechanisms, to reduce redundant behaviors and enhance reasoning consistency. Overall, this self-organizing mechanism ensures the collaborative effect of different models.
[0040] As a preferred embodiment, after performing collaborative reasoning on the task based on a large set of language models and a multi-branch tree of atomic behaviors to obtain the collaborative reasoning result, the method further includes: determining the execution feedback result based on the collaborative reasoning result and the preset correct result; the execution feedback result is used to characterize whether the collaborative reasoning result is correct or incorrect; determining the 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.
[0041] In this embodiment, the behavior selection strategy continuously adjusts itself based on feedback during the reasoning process, thereby achieving continuous improvement. As the number of reasoning iterations increases, the framework's decision-making ability and reasoning performance gradually improve.
[0042] Specifically, after the collaborative reasoning yields a result, the system reaches a termination state. At this point, the execution feedback result is determined based on the preset correct result. The execution feedback result is used to characterize whether the collaborative reasoning result is correct or incorrect.
[0043] in, R ( s final , a The execution feedback result is 1 if the collaborative reasoning result is the same as the preset correct result, and -1 if the collaborative reasoning result is different from the preset correct result.
[0044] The state value of the state in the overall reasoning process is determined based on the execution feedback results and the state-based global atomic behavior selection strategy.
[0045] in, V ( s final )for State value, V ( s ) is the state s State value, In the state s choose a Strategies for atomic behavior This is a discount factor, with a value range of [0, 1]. It determines the value of the current action by discounting future rewards, and is used to measure the importance weight between current and future rewards. For state s 'State value, s 'For and s Different states.
[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 actions for atomic behaviors with high state values and decreases the probability of selecting actions for atomic behaviors with low state values, thereby optimizing the strategy in a direction that can more efficiently achieve the goal.
[0047] in, In the state s i choose a Atomic behavior strategy, P( a 1| s i ) is in state s i Time Selection a The probability of 1, P( a 2| s i ) is in state s i Time Selection a The probability of 2, P( a n | s i ) is in state s i Time selection a n The probability, From state s i Execution a After one atomic action, the state transitions.s i+1 State value, From state s i Execution a After two atomic actions, the state transitions. s i+1 State value, From state s i Execution a n After the atomic behavior, the state transitions. s i+1 State value, k For the number of iterations, In the state s i Time selection a 1, In the state s i Time selection a 2, In the state s i Time selection a n , It is positively correlated.
[0048] Please refer to Figure 2 , Figure 2 A schematic diagram illustrating the usage and updating of the atomic behavior selection strategy provided by this invention.
[0049] The process of using and updating the atomic behavior selection strategy is as follows: In the forward process, the current state is first obtained and the corresponding strategy is determined. If a strategy already exists, it is checked whether the number of updates has reached a threshold. If it has, the strategy is updated using the state value; otherwise, the existing strategy continues to be used. If no strategy exists, the strategy is initialized using a large language model (LLM). Regardless of the method, the corresponding atomic behavior is ultimately selected based on the strategy. The state value update process is triggered after the strategy update, ensuring that the corresponding state value is updated. The backward process begins by obtaining the execution feedback result, which is then fed back to the state value update process to update the strategy using the state value. The entire process ensures the continuous iterative operation of strategy evaluation, updating, and learning.
[0050] As the task progresses, the strategy is iteratively updated to gradually adapt to the specific needs of the task, making future action selections 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 this invention will be described below. The collaborative reasoning system based on a large language model described below can be referred to in correspondence with the collaborative reasoning method based on a large language model described above.
[0052] Please refer to Figure 3 , Figure 3 This is a schematic diagram of the structure of a collaborative reasoning system based on a large language model, provided by the present invention.
[0053] This invention also provides a collaborative reasoning system based on a large language model, comprising: a decomposition module 301, used to decompose the reasoning process of a task into several atomic behaviors according to a preset atomic behavior library; the atomic behaviors include the type of model selection, reasoning behavior, and / or auxiliary behavior; the selected model is a large language model required for reasoning on the task; the reasoning behavior is behavior driven by prompting technology, and the auxiliary behavior is behavior using external tools; an orchestration module 302, used to orchestrate a multi-branch tree structure according to several atomic behaviors and a state-based global atomic behavior selection strategy to obtain an atomic behavior multi-branch tree; and a collaborative reasoning module 303, 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 several selected models corresponding to several atomic behaviors.
[0054] Figure 4 An example is a schematic diagram of the structure of an electronic device, such as... Figure 4 As shown, the electronic device may include: a processor 401, a communications interface 402, a memory 403, and a communication bus 404, wherein the processor 401, the communications interface 402, and the memory 403 communicate with each other through the communication bus 404. The processor 401 can call logical instructions in the memory 403 to execute a collaborative reasoning method based on a large language model. This method includes: decomposing the reasoning process of a task into several atomic behaviors according to a preset atomic behavior library; the atomic behaviors include the type of model selection, reasoning behavior, and / or auxiliary behavior; the selected model is a large language model required for reasoning on the task; the reasoning behavior is a behavior driven by prompting technology, and the auxiliary behavior is a behavior using external tools; arranging a multi-branch tree structure according to several 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 the atomic behavior multi-branch tree to obtain a collaborative reasoning result; the large language model set includes several selected models corresponding to several atomic behaviors.
[0055] Furthermore, the logical instructions in the aforementioned memory 403 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0056] On the other hand, the present invention also provides a computer program product, which includes a computer program that 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. The method includes: decomposing the reasoning process behavior of a task into several atomic behaviors according to a preset atomic behavior library; the atomic behaviors include the type of model selection, reasoning behavior, and / or auxiliary behavior; the selected model is a large language model required for reasoning on the task; the reasoning behavior is a behavior driven by prompting technology, and the auxiliary behavior is a behavior using external tools; arranging a multi-branch tree structure according to several 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 the atomic behavior multi-branch tree to obtain a collaborative reasoning result; the large language model set includes several selected models corresponding to several atomic behaviors.
[0057] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the collaborative reasoning method based on a large language model provided by the above methods. This method includes: decomposing the reasoning process behavior of a task into several atomic behaviors according to a preset atomic behavior library; the atomic behaviors include the type of model selection, reasoning behavior, and / or auxiliary behavior; the selected model is a large language model required for reasoning on the task; the reasoning behavior is behavior driven by prompting technology, and the auxiliary behavior is behavior using external tools; arranging a multi-branch tree structure according to several 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 the atomic behavior multi-branch tree to obtain a collaborative reasoning result; the large language model set includes several selected models corresponding to several atomic behaviors.
[0058] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0059] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments 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, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate 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-scale language model, characterized in that, include: The reasoning process of the task is decomposed into several atomic behaviors based on a pre-defined atomic behavior library. The atomic behavior includes selecting the type of 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 prompting technology, and the auxiliary behavior is a behavior using external tools. A multi-branch tree structure is arranged according to several 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 set of language models and the multi-branch tree of atomic behaviors to obtain collaborative reasoning results; the large set of language models includes several selected models corresponding to several atomic behaviors; 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; After obtaining the collaborative reasoning result by performing collaborative reasoning on the task based on the large language model set and the atomic behavior multi-branch tree, the method further includes: Based on the collaborative reasoning result and the preset correct result, an execution feedback result is determined; the execution feedback result is used to characterize whether the collaborative reasoning result is correct or incorrect. Based on the execution feedback results and the state-based global atomic behavior selection strategy, determine the state value of the overall reasoning process. The strategy parameters of the state-based global atomic behavior selection strategy are adjusted according to the state value.
2. The collaborative reasoning method based on a large language model according to claim 1, characterized in that, The step of decomposing the reasoning process of the task into several atomic behaviors based on a preset atomic behavior library includes: Based on a preset feature extraction algorithm, the reasoning process behavior of the task is feature extracted to obtain several behavioral features; Atomic behavior matching is performed based on several behavioral features and the preset atomic behavior library to obtain matching results; Based on the matching results, the reasoning process of the task is decomposed into several atomic behaviors.
3. The collaborative reasoning method based on a large language model according to claim 1, characterized in that, The atomic behavior multi-way tree includes a node set and an edge set; each node in the node set corresponds to one atomic behavior; the edge set is used to represent 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 initial parameters of the state-based global atomic behavior selection strategy are automatically generated based on prior knowledge of a large language model.
5. A collaborative reasoning system based on a large-scale language model, characterized in that, include: The decomposition module is used to decompose the reasoning process of a task into several atomic behaviors based on a preset atomic behavior library. The atomic behavior includes selecting the type of 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 prompting technology, and the auxiliary behavior is a behavior using external tools. An orchestration module is used to orchestrate a multi-branch tree structure based on several 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 a task based on a large set of language models and the atomic behavior multi-branch tree to obtain a collaborative reasoning result; the large set of language models includes several selected models corresponding to several atomic behaviors; 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; After obtaining the collaborative reasoning result by performing collaborative reasoning on the task based on the large language model set and the atomic behavior multi-branch tree, the method further includes: Based on the collaborative reasoning result and the preset correct result, an execution feedback result is determined; the execution feedback result is used to characterize whether the collaborative reasoning result is correct or incorrect. Based on the execution feedback results and the state-based global atomic behavior selection strategy, determine the state value of the overall reasoning process. The strategy parameters of the state-based global atomic behavior selection strategy are adjusted according to the state value.
6. 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, it implements the collaborative reasoning method based on a large language model as described in any one of claims 1 to 4.
7. 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, it implements the collaborative reasoning method based on a large language model as described in any one of claims 1 to 4.
8. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the collaborative reasoning method based on a large language model as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Cloud-edge collaborative big language model intelligent customer service deployment optimization method
CN117808481A
Multi-agent collaboration method, device and equipment based on large language model and medium
CN118551751A