A multi-agent system initialization method and device for question-answering large models
Through the method of multiple rounds of iterative generation and Pareto optimal set screening, the problem of unreasonable team structure in multi-agent systems is solved, and the collaborative efficiency and overall performance of the large question-answering model are improved.
Patent Information
- Application Number
- CN202511000129.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-21
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2045-07-21
AI Technical Summary
In the existing multi-agent system initialization methods for large question-answering models, the collaboration efficiency between agents is low, there are duplicate roles or irrelevant agents, which leads to task deviation and redundancy, and is easily restricted by language model bias.
A multi-round iterative method is used to generate a set of candidate agents, which are then embedded and encoded using a pre-trained text encoder. The relevance of user question-answering query tasks and the agent diversity target are calculated. A non-dominated sorting algorithm is used to construct a Pareto-optimal frontier team structure and select the optimal agent team.
It improves the collaborative efficiency and overall performance of the multi-agent system, and enhances the system's adaptability and synergy.
Smart Images

Figure CN120492600B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of large language model multi-agent systems for question and answering, and in particular to a method and device for initializing a multi-agent system for a large language model for question and answering. Background Art
[0002] The development of large language models (LLMs) has driven the development of autonomous agents capable of complex tasks. Initialization, a critical step in multi-agent systems for large question-answering models, clarifies the roles and responsibilities of each agent, ensuring efficient execution of the question-answering task and improving overall system performance. Currently, most multi-agent systems for large question-answering models still rely on manually designed initialization schemes. However, automated agent generation methods are gradually emerging as a key technical direction for improving the scalability and adaptability of multi-agent systems for large question-answering models.
[0003] While initialization technology for multi-agent systems with large question-answering models has made some progress, existing methods still fall short in fully considering subsequent collaboration between agents. This can lead to duplicate or unrelated agents in the generated team, which in turn causes deviations in the user-input query and answering tasks and redundant steps, impacting the overall performance of the multi-agent system. At the same time, existing team configuration optimization methods based on large language models are easily limited by the model's own capabilities and biases. For example, language models often show a tendency to favor their own outputs when self-evaluating, which limits their ability to identify and eliminate redundant or low-quality agents. The resulting lack of efficient collaboration in the initialized team structure highlights the urgent need for more robust initialization mechanisms to improve the collaborative efficiency and execution effectiveness of multi-agent systems. Summary of the Invention
[0004] In order to solve the problem of unreasonable team structure in the initialization of a multi-agent system based on a large question-answering model in the existing technology, which leads to low collaboration efficiency of the multi-agent system based on the large question-answering model, the embodiment of the present invention provides a method and device for initializing a multi-agent system based on a large question-answering model. The technical solution is as follows:
[0005] On the one hand, a method for initializing a multi-agent system for a large question-answering model is provided. The method is implemented by a device for initializing a multi-agent system for a large question-answering model, and the method includes:
[0006] S1. Obtain a user question-answering query task; use a pre-built question-answering planning agent to decompose the user question-answering query task into multiple subtasks and generate an agent corresponding to each subtask;
[0007] S2. Standardize the agent corresponding to each subtask using a formatted agent to obtain a standardized agent corresponding to each subtask;
[0008] S3. Use the observation agent to evaluate the standardized agent corresponding to each subtask and obtain feedback information. Then, perform the next round of optimization iteration based on the feedback information, and generate a set of candidate agents through multiple rounds of iteration.
[0009] S4. Use the pre-trained text encoder to embed the candidate agent set to generate the semantic representation of each agent; use the pre-trained text encoder to embed the user question-answering query task to obtain the user question-answering query task representation;
[0010] S5. Calculate the user question-answering query task relevance objective based on the semantic representation of each agent and the user question-answering query task representation; calculate the agent diversity objective based on the semantic representation of each agent and the user question-answering query task representation; construct a multi-objective optimization problem based on the user question-answering query task relevance objective and the agent diversity objective;
[0011] S6. Based on the multi-objective optimization problem, a non-dominated sorting algorithm is used to obtain the Pareto optimal frontier team structure set;
[0012] S7. Based on the team structure set on the Pareto optimal frontier, use the selection agent to select the optimal agent team set.
[0013] On the other hand, a device for initializing a multi-agent system for a large question-answering model is provided. The device is applied to a method for initializing a multi-agent system for a large question-answering model. The device includes:
[0014] The first generation unit is used to obtain a user question-answering query task; use a pre-built question-answering planning agent to decompose the user question-answering query task into multiple subtasks, and generate an agent corresponding to each subtask;
[0015] A first acquisition unit is configured to perform standardization processing on the agent corresponding to each subtask using a formatted agent to obtain a standardized agent corresponding to each subtask;
[0016] The second generation unit is used to use the observation agent to evaluate the standardized agent corresponding to each subtask and obtain feedback information; the next round of optimization iteration is carried out based on the feedback information, and a set of candidate agents is generated through multiple rounds of iteration;
[0017] The second acquisition unit is used to use a pre-trained text encoder to embed the candidate agent set to generate a semantic representation of each agent; and use the pre-trained text encoder to embed the user question-answering query task to obtain the user question-answering query task representation;
[0018] A construction unit is used to calculate the user question-answering query task relevance target based on the semantic representation of each agent and the user question-answering query task representation; calculate the agent diversity target based on the semantic representation of each agent and the user question-answering query task representation; and construct a multi-objective optimization problem based on the user question-answering query task relevance target and the agent diversity target;
[0019] The third acquisition unit is used to obtain a Pareto optimal frontier team structure set using a non-dominated sorting algorithm according to a multi-objective optimization problem;
[0020] The selection unit is used to select the optimal agent team set using the selection agent according to the team structure set of the Pareto optimal frontier.
[0021] On the other hand, a multi-agent system initialization device for a question-answering large model is provided, and the multi-agent system initialization device for a question-answering large model includes: a processor; a memory, and the memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, any one of the above-mentioned multi-agent system initialization methods for a question-answering large model is implemented.
[0022] On the other hand, a computer-readable storage medium is provided, in which at least one instruction is stored, and the at least one instruction is loaded and executed by a processor to implement any one of the above-mentioned multi-agent system initialization methods for the question-answering large model.
[0023] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:
[0024] The embodiment of the present invention first obtains a user question-answering query task; uses a pre-built question-answering planning agent to decompose the user question-answering query task into multiple subtasks, and generates an agent corresponding to each subtask; uses a formatting agent to standardize the agent corresponding to each subtask, and obtains a standardized agent corresponding to each subtask; secondly, uses an observation agent to evaluate the standardized agent corresponding to each subtask, and obtains feedback information; performs the next round of optimization iteration based on the feedback information, and generates a candidate agent set through multiple rounds of iteration; uses a pre-trained text encoder to embed the candidate agent set to generate a semantic representation of each agent; uses The pre-trained text encoder embeds and encodes the user question and answer query task to obtain the user question and answer query task representation; based on the semantic representation of each agent and the user question and answer query task representation, the user question and answer query task relevance target is calculated; based on the semantic representation of each agent and the user question and answer query task representation, the agent diversity target is calculated; finally, based on the user question and answer query task relevance target and the agent diversity target, a multi-objective optimization problem is constructed; based on the multi-objective optimization problem, a non-dominated sorting algorithm is used to obtain the team structure set of the Pareto optimal frontier; based on the team structure set of the Pareto optimal frontier, the selection agent is used to select the optimal agent team set.
[0025] In response to the problem of unreasonable team structure in the initialization of a multi-agent system based on a large question-answering model, the embodiment of the present invention proposes a multi-agent system initialization method based on a combination of multi-round generation, standardized processing and Pareto optimal set screening. The embodiment of the present invention enhances the overall performance and adaptability of the multi-agent system while improving collaboration efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0027] Figure 1 This is a flow chart of a method for initializing a multi-agent system for a large question-answering model provided by an embodiment of the present invention;
[0028] Figure 2 This is a schematic diagram of the structure of a multi-agent system initialization for a large question-answering model provided by an embodiment of the present invention;
[0029] Figure 3 This is a flowchart of a specific implementation of a multi-agent system initialization method for a large question-answering model provided by an embodiment of the present invention;
[0030] Figure 4 This is a block diagram of a multi-agent system initialization device for a large question-answering model provided by an embodiment of the present invention;
[0031] Figure 5 This is a structural diagram of a multi-agent system initialization device for a large question-answering model provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0032] The technical solution of the present invention is described below in conjunction with the accompanying drawings.
[0033] In the embodiments of the present invention, words such as "exemplarily" and "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as an "exemplary" in the present invention should not be interpreted as being preferred or advantageous over other embodiments or designs. Rather, the use of the word "exemplary" is intended to present concepts in a concrete manner. Furthermore, in the embodiments of the present invention, "and / or" can mean both or either of the two.
[0034] In the embodiments of the present invention, the terms "image" and "picture" may sometimes be used interchangeably. It should be noted that, when the distinction is not emphasized, the meanings they convey are the same. The terms "of," "corresponding," and "corresponding" may sometimes be used interchangeably. It should be noted that, when the distinction is not emphasized, the meanings they convey are the same.
[0035] In the embodiments of the present invention, sometimes a subscript such as W1 may be written as a non-subscript such as W1. When the difference is not emphasized, the meanings to be expressed are the same.
[0036] In order to make the technical problems, technical solutions and advantages to be solved by the present invention clearer, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.
[0037] The embodiment of the present invention provides a method for initializing a multi-agent system for a large question-answering model. The method can be implemented by a multi-agent system initialization device for a large question-answering model. The multi-agent system initialization device for a large question-answering model can be a terminal or a server. Figure 1 The flowchart of the method for initializing a multi-agent system for a large question-answering model is shown. The processing flow of the method may include the following steps:
[0038] S1. Obtain the user question-answering query task; use the pre-built question-answering planning agent to decompose the user question-answering query task into multiple subtasks, and generate an agent corresponding to each subtask.
[0039] The user question-answering query task may be a knowledge question-answering task.
[0040] Among them, the overall framework of the multi-agent system based on the question-answering language model can be expressed as ,in represents a set of agents, each of which represents the i-th agent, and F represents the interaction framework between agents.
[0041] The pre-built question-answering planning agent performs two tasks: task decomposition and agent construction. Task decomposition divides the user question-answering query task into several subtasks; agent construction generates a corresponding agent role for each subtask, which can be expressed by the following formula (1):
[0042] (1)
[0043] in, represents a pre-built question-answering planning agent; Indicates task decomposition; Represents the construction of intelligent agents;
[0044] The process of generating the agent corresponding to each subtask is expressed by the following formula (2):
[0045] (2)
[0046] in, represents the set of agents generated in round t; Represents the construction of intelligent agents; Represents the subtask of round t.
[0047] Among them, an embodiment of the present invention proposes a method for generating a set of intelligent agents based on input problems, which can adapt to a variety of different interaction frameworks to achieve efficient and high-quality multi-agent collaborative reasoning and task execution.
[0048] S2. Use the formatted agent to standardize the agent corresponding to each subtask to obtain the standardized agent corresponding to each subtask.
[0049] Optionally, S2 uses a formatted agent to standardize the agent corresponding to each subtask. The process of obtaining the standardized agent corresponding to each subtask is expressed by the following formula (3):
[0050] (3)
[0051] in, Indicates the Standardized agent representation corresponding to the wheel task; Represents a formatting agent; Represents the agent corresponding to each subtask.
[0052] S3. Use the observation agent to evaluate the standardized agent corresponding to each subtask and obtain feedback information; perform the next round of optimization iteration based on the feedback information, and generate a set of candidate agents through multiple rounds of iteration.
[0053] Among them, the feedback information is used to guide the optimization of the next round of user question-answering query task decomposition and intelligent agent construction.
[0054] Optionally, S3 uses an observation agent to evaluate the standardized agent corresponding to each subtask, and the process of obtaining feedback information is expressed by the following formula (4):
[0055] (4)
[0056] in, Represents the feedback information of round t; represents the observing agent; Indicates the The normalized agent representation corresponding to each subtask; Represents each subtask.
[0057] In a feasible implementation mode, In the round iteration, the task decomposition stage receives user question and answer query tasks , based on the feedback information from the previous round , the set of subtasks generated in the previous round And the corresponding standardized agent set , generate the subtasks of the current round, where represents the number of subtasks and agents in round t-1; the subtask set generated in round t can be expressed by the following formula (5):
[0058] (5)
[0059] in, Indicates the Wheel subtasks; Indicates task decomposition; Represents a user query; represents the feedback of round t-1; represents the subtask in round t-1; represents the normalized agent in round t-1.
[0060] In a feasible implementation, through K rounds of iteration, the candidate agent set is generated as , where the last iteration does not call the question-answering observation agent.
[0061] Among them, the embodiment of the present invention sets up two modules, including: a standardized agent generation module and a balanced team selection module; the standardized agent generation module generates a set of candidate agents with clear structure and unified format through multiple rounds of interaction based on the user question-answering query task, and the module adopts predefined question-answering planning agents and observer agent , the two optimize the agent generation process through iterative interaction. Unlike the method of enforcing format restrictions, which may reduce the agent's expressive ability and quality, the embodiment of the present invention does not impose format constraints during the generation phase, but formats the agent after generation. Standardization is performed to align new agents with system goals, facilitate unified evaluation and collaboration, and achieve fair evaluation and effective screening. The balanced team selection module is designed with two optimization goals, including task relevance and team diversity, to build an agent team with the best synergy effect through these two optimization goals.
[0062] According to the above process of generating a set of candidate agents, the standardized agent generation module can be expressed by the following formula (6):
[0063] (6)
[0064] in, Represents the standardized agent generation module; Represents a formatting agent; represents the planning agent; represents the observing agent; Represents a compound operation; K represents the maximum number of iterations.
[0065] S4. Use a pre-trained text encoder to embed the candidate agent set to generate a semantic representation of each agent; use a pre-trained text encoder to embed the user question-answering query task to obtain the user question-answering query task representation.
[0066] Among them, the pre-trained text encoder , from the natural language space Mapping to vector space , encode the candidate agent set and the user question-answering query task into a vector.
[0067] S5. Calculate the user question-answering query task relevance target based on the semantic representation of each agent and the user question-answering query task representation; calculate the agent diversity target based on the semantic representation of each agent and the user question-answering query task representation; construct a multi-objective optimization problem based on the user question-answering query task relevance target and the agent diversity target.
[0068] The correlation is the average cosine similarity between the descriptions of all agents in the candidate team and the query question answering task.
[0069] Optionally, the process of calculating the relevance target of the user question-answering query task based on the semantic representation of each agent and the user question-answering query task representation is expressed by the following formula (7):
[0070] (7)
[0071] in, Represents the user question-answering query task relevance goal; represents a team of agents; A vector representation of a single agent; A vector representation of the user question-answering query task; Represents a single agent in a team; Represents a user question-answering query task; L2 norm of the vector representing a single agent; The L2 norm of the vector representing the user question-answering query task.
[0072] Optionally, based on the semantic representation of each agent and the user question-answering query task representation, the agent diversity objective is calculated including:
[0073] Construct a similarity matrix of agent team member embeddings;
[0074] The agent diversity target is obtained by calculating the Vendi score based on the embedded similarity matrix, the semantic representation of each agent, and the user question-answering query task representation;
[0075] Among them, the Vendi score is a reference-free objective that measures the intrinsic diversity of a group rather than its relationship to a reference distribution.
[0076] Optionally, the similarity matrix of the agent team member embedding is expressed by the following formula (8):
[0077] (8)
[0078] in, Represents the similarity between agents i and j; represents the vector representation of agent i; represents the vector representation of agent j; The L2 norm of the vector representing agent i; The L2 norm of the vector representing agent j;
[0079] The elements of the similarity matrix are the cosine similarities between member pairs.
[0080] Among them, the agent diversity goal is obtained; it is expressed by the following formula (9):
[0081] (9)
[0082] in, Represents the diversity goal of the agent set; Represents similarity matrix The characteristic value of represents a feasible team of agents.
[0083] S6. Based on the multi-objective optimization problem, a non-dominated sorting algorithm is used to obtain the Pareto optimal frontier team structure set.
[0084] Optionally, S6 uses a non-dominated sorting algorithm to obtain a Pareto-optimal frontier team structure set based on a multi-objective optimization problem, including:
[0085] From the candidate agent set, construct a set of all candidate agent teams;
[0086] In one feasible implementation, based on the set of candidate agents, all subset teams that meet the team size constraint are constructed, where the number of agents is between the minimum and maximum numbers of the constraint.
[0087] Among them, the set of all candidate agent teams is expressed by the following formula (10):
[0088] (10)
[0089] in, represents the set of all candidate agent teams; Indicates the maximum number of agents; The minimum number of agents that are restricted; represents the set of feasible agents; represents the set of candidate agents; Indicates the number of agents;
[0090] Based on the user question-answering task relevance goal and the agent diversity goal, a multi-objective optimization problem is constructed, and a Pareto-optimal frontier team structure set is obtained through a non-dominated sorting algorithm.
[0091] The process of obtaining the Pareto optimal frontier team structure set is expressed by the following formula (11):
[0092] (11)
[0093] in, represents the Pareto optimal set of candidate agent teams; represents a team of agents; represents the set of all candidate agent teams; Represents the other agent teams in the collection; express The relevance goal of user question-answering query tasks in the team; Represents a user query; express The relevance goal of user question-answering query tasks in the team; express Diversity goals within the team; express Diversity goals within the team.
[0094] S7. Based on the team structure set on the Pareto optimal frontier, use the selection agent to select the optimal agent team set.
[0095] Among them, the selected intelligent agent team will be assigned to the multi-agent interaction framework, such as graph-based interaction, to respond to given question-and-answer queries.
[0096] The process of using the selection agent to select the optimal agent team set is expressed by the following formula (12):
[0097] (12)
[0098] in, represents the optimized set of agents; represents the Pareto optimal set of the agent team; Represents a user query; Indicates the selection of an agent.
[0099] Among them, the optimized agent set is the optimal agent team set.
[0100] Among them, the optimal agent team set is obtained through the above steps S1-S7 to complete the initialization; the optimal agent team set is deployed in different multi-agent frameworks, including graph-based interaction.
[0101] The embodiments of the present invention set multiple comparison baselines in single-agent tasks and multi-agent initialization tasks. In single-agent tasks, the method proposed in the embodiments of the present invention was compared with the direct reasoning method and the thought chain method. In multi-agent collaboration tasks, the embodiments of the present invention selected the complete agent discarding method as the multi-agent system (MAS) baseline and further compared multiple initialization strategies, including a no-role-assignment strategy, two initialization methods: automatic agent and evolving agent, and a preset agent strategy. As shown in Table 1, the method proposed in the embodiments of the present invention was tested and compared on different models; the overall performance of all benchmark tests was consistently better than the current single-agent method and the current MAS initialization method. Specifically, in experiments using the Qwen2.5 model and the Deepseek-V3 model, the accuracy of the multi-agent initialization method proposed in the embodiments of the present invention increased by 1.0 and 1.1, respectively, demonstrating the effectiveness of the embodiments of the present invention.
[0102] Table 1
[0103]
[0104] Among them, Figure 2 The figure shows a structural diagram of the initialization of a multi-agent system for a large question-answering model provided by an embodiment of the present invention; the embodiment of the present invention has two modules, including: a standardized agent generation module and a balanced team selection module; the standardized agent generation module generates a standardized agent set based on the query and question-answering task input by the user by constructing intelligence and formatting processing, and generates a candidate agent set based on the standardized agent set; the balanced team selection module selects the optimal agent team set based on the candidate agent set.
[0105] Among them, Figure 3The figure shows a flowchart of a specific implementation of a multi-agent system initialization method for a large question-answering model provided by an embodiment of the present invention; in a feasible implementation method, for a user question-answering query task, based on historical feedback information, a pre-built question-answering planning agent is used to decompose the user question-answering query task into multiple subtasks, and an agent corresponding to each subtask is generated; a formatting agent is used to standardize the agent corresponding to each subtask, and a standardized agent corresponding to each subtask is obtained; it is determined whether the current round has reached the preset maximum iteration round, if it has reached the preset maximum iteration round, the iteration is stopped, and the standardized whole corresponding to each subtask is formed into a candidate agent set, and a candidate agent team is formed through the candidate agent set, and the team level is screened; if the preset maximum iteration round has not been reached, Then, the observation agent is used to process the subtasks of the current round and the standardized agents corresponding to the subtasks to obtain feedback information; the next iterative processing is continued according to the feedback information until the current iteration round reaches the preset maximum iteration round, the iteration is stopped, and the candidate agent set is output; the specific screening process includes: using an encoder to encode the user's query and question-answering tasks and the candidate agent set, generating a semantic representation of each agent and a user question-answering query task representation; calculating the query and question-answering task relevance target and team diversity target based on the semantic representation of each agent and the user question-answering query task representation; constructing the Pareto optimal set that maximizes the two objective functions based on the query and question-answering task relevance and team diversity targets; and using the selection agent to select the optimal agent team based on the Pareto optimal set.
[0106] The embodiment of the present invention first obtains a user question-answering query task; uses a pre-built question-answering planning agent to decompose the user question-answering query task into multiple subtasks, and generates an agent corresponding to each subtask; uses a formatting agent to standardize the agent corresponding to each subtask, and obtains a standardized agent corresponding to each subtask; secondly, uses an observation agent to evaluate the standardized agent corresponding to each subtask, and obtains feedback information; performs the next round of optimization iteration based on the feedback information, and generates a candidate agent set through multiple rounds of iteration; uses a pre-trained text encoder to embed the candidate agent set to generate a semantic representation of each agent; uses The pre-trained text encoder embeds and encodes the user question and answer query task to obtain the user question and answer query task representation; based on the semantic representation of each agent and the user question and answer query task representation, the user question and answer query task relevance target is calculated; based on the semantic representation of each agent and the user question and answer query task representation, the agent diversity target is calculated; finally, based on the user question and answer query task relevance target and the agent diversity target, a multi-objective optimization problem is constructed; based on the multi-objective optimization problem, a non-dominated sorting algorithm is used to obtain the team structure set of the Pareto optimal frontier; based on the team structure set of the Pareto optimal frontier, the selection agent is used to select the optimal agent team set.
[0107] In response to the problem of unreasonable team structure in the initialization of a multi-agent system based on a large question-answering model, the embodiment of the present invention proposes a multi-agent system initialization method based on a combination of multi-round generation, standardized processing and Pareto optimal set screening. The embodiment of the present invention enhances the overall performance and adaptability of the multi-agent system while improving collaboration efficiency.
[0108] Figure 4 This is a block diagram of a multi-agent system initialization device for a large question-answering model according to an exemplary embodiment. The device is used for a multi-agent system initialization method for a large question-answering model. Figure 4 The device includes a first generating unit 410, a first acquiring unit 420, a second generating unit 430, a second acquiring unit 440, a constructing unit 450, a third acquiring unit 460, and a selecting unit 470.
[0109] The first generation unit 410 is used to obtain a user question-answering query task; use a pre-built question-answering planning agent to decompose the user question-answering query task into multiple subtasks, and generate an agent corresponding to each subtask;
[0110] A first acquisition unit 420 is configured to perform standardization processing on the agent corresponding to each subtask using a formatted agent to obtain a standardized agent corresponding to each subtask;
[0111] The second generation unit 430 is configured to evaluate the standardized agent corresponding to each subtask using an observation agent to obtain feedback information; perform the next round of optimization iteration based on the feedback information, and generate a set of candidate agents through multiple rounds of iterations;
[0112] The second acquisition unit 440 is configured to perform embedding encoding on the candidate agent set using a pre-trained text encoder to generate a semantic representation of each agent; and to perform embedding encoding on the user question-answering query task using a pre-trained text encoder to obtain a user question-answering query task representation;
[0113] A construction unit 450 is configured to calculate a user question-answering query task relevance target based on the semantic representation of each agent and the user question-answering query task representation; calculate an agent diversity target based on the semantic representation of each agent and the user question-answering query task representation; and construct a multi-objective optimization problem based on the user question-answering query task relevance target and the agent diversity target;
[0114] A third obtaining unit 460 is configured to obtain a Pareto optimal frontier team structure set using a non-dominated sorting algorithm according to a multi-objective optimization problem;
[0115] The selection unit 470 is used to select an optimal agent team set using a selection agent according to the team structure set of the Pareto optimal frontier.
[0116] Optionally, the process of using the formatted agent to standardize the agent corresponding to each subtask and obtaining the standardized agent corresponding to each subtask is expressed by the following formula (1):
[0117] (1)
[0118] in, Indicates the Standardized agent representation corresponding to the wheel task; Represents a formatting agent; Represents the agent corresponding to each subtask.
[0119] Optionally, the process of using the observation agent to evaluate the standardized agent corresponding to each subtask and obtaining feedback information is expressed by the following formula (2):
[0120] (2)
[0121] in, Represents the feedback information in round t; represents the observing agent; Indicates the The normalized agent representation corresponding to each subtask; Represents each subtask.
[0122] Optionally, the process of calculating the user question-answering query task relevance target based on the semantic representation of each agent and the user question-answering query task representation is expressed by the following formula (3):
[0123] (3)
[0124] in, Represents the user question-answering query task relevance goal; represents a feasible team of agents; A vector representation of a single agent; A vector representation of the user question-answering query task; represents a single candidate agent in the set; Represents a user question-answering query task; L2 norm of the vector representing a single agent; The L2 norm of the vector representing the user question-answering query task.
[0125] Optionally, calculating the agent diversity target based on the semantic representation of each agent and the user question-answering query task representation includes:
[0126] Construct a similarity matrix of agent team member embeddings;
[0127] The agent diversity target is obtained by calculating the Vendi score based on the embedded similarity matrix, the semantic representation of each agent, and the user question-answering query task representation;
[0128] Optionally, the similarity matrix of the agent team member embedding is expressed by the following formula (4):
[0129] (4)
[0130] in, Represents the similarity between agents i and j; represents the vector representation of agent i; represents the vector representation of agent j; The L2 norm of the vector representing agent i; The L2 norm of the vector representing agent j;
[0131] The target of obtaining agent diversity is expressed by the following formula (5):
[0132] (5)
[0133] in, Represents the diversity goal of the agent set; Represents similarity matrix The characteristic value of represents a feasible team of agents.
[0134] Optionally, the method of obtaining a Pareto optimal frontier team structure set using a non-dominated sorting algorithm according to a multi-objective optimization problem includes:
[0135] From the candidate agent set, construct a set of all candidate agent teams;
[0136] Among them, the set of all candidate agent teams is expressed by the following formula (6):
[0137] (6)
[0138] in, represents the set of all candidate agent teams; Indicates the maximum number of agents; The minimum number of agents that are restricted; represents a team of agents; represents the set of candidate agents; Indicates the number of agents;
[0139] Based on the user question-answering task relevance goal and the agent diversity goal, a multi-objective optimization problem is constructed, and a Pareto-optimal frontier team structure set is obtained through a non-dominated sorting algorithm.
[0140] The process of obtaining the Pareto optimal frontier team structure set is expressed by the following formula (7):
[0141] (7)
[0142] in, represents the Pareto optimal set of candidate agent teams; represents a team of agents; represents the set of all candidate agent teams; Represents the other agent teams in the collection; express The relevance goal of user question-answering query tasks in the team; Represents a user query; express The relevance goal of user question-answering query tasks in the team; express Diversity goals within the team; express Diversity goals within the team.
[0143] The embodiment of the present invention first obtains a user question-answering query task; uses a pre-built question-answering planning agent to decompose the user question-answering query task into multiple subtasks, and generates an agent corresponding to each subtask; uses a formatting agent to standardize the agent corresponding to each subtask, and obtains a standardized agent corresponding to each subtask; secondly, uses an observation agent to evaluate the standardized agent corresponding to each subtask, and obtains feedback information; performs the next round of optimization iteration based on the feedback information, and generates a candidate agent set through multiple rounds of iteration; uses a pre-trained text encoder to embed the candidate agent set to generate a semantic representation of each agent; uses The pre-trained text encoder embeds and encodes the user question and answer query task to obtain the user question and answer query task representation; based on the semantic representation of each agent and the user question and answer query task representation, the user question and answer query task relevance target is calculated; based on the semantic representation of each agent and the user question and answer query task representation, the agent diversity target is calculated; finally, based on the user question and answer query task relevance target and the agent diversity target, a multi-objective optimization problem is constructed; based on the multi-objective optimization problem, a non-dominated sorting algorithm is used to obtain the team structure set of the Pareto optimal frontier; based on the team structure set of the Pareto optimal frontier, the selection agent is used to select the optimal agent team set.
[0144] In response to the problem of unreasonable team structure in the initialization of a multi-agent system based on a large question-answering model, the embodiment of the present invention proposes a multi-agent system initialization method based on a combination of multi-round generation, standardized processing and Pareto optimal set screening. The embodiment of the present invention enhances the overall performance and adaptability of the multi-agent system while improving collaboration efficiency.
[0145] Figure 5 This is a schematic diagram of the structure of a multi-agent system initialization device for a large question-answering model provided by an embodiment of the present invention. Figure 5 As shown, the multi-agent system initialization device for the question-answering large model may include the above Figure 4 The multi-agent system initialization device 510 for the question-answering large model shown in FIG. Optionally, the multi-agent system initialization device 510 for the question-answering large model may include a first processor 2001 .
[0146] Optionally, the multi-agent system initialization device 510 for the question-answering large model may also include a memory 2002 and a transceiver 2003.
[0147] The first processor 2001, the memory 2002 and the transceiver 2003 may be connected via a communication bus.
[0148] The following combination Figure 5The components of the multi-agent system initialization device 510 for the large question-answering model are described in detail:
[0149] The first processor 2001 is the control center of the multi-agent system initialization device 510 for the large-scale question-answering model. It can be a single processor or a collective term for multiple processing elements. For example, the first processor 2001 can be one or more central processing units (CPUs), or application-specific integrated circuits (ASICs), or one or more integrated circuits configured to implement embodiments of the present invention, such as one or more digital signal processors (DSPs) or one or more field programmable gate arrays (FPGAs).
[0150] Optionally, the first processor 2001 can perform various functions of the multi-agent system initialization device 510 for the question-answering large model by running or executing a software program stored in the memory 2002 and calling data stored in the memory 2002.
[0151] In a specific implementation, as an embodiment, the first processor 2001 may include one or more CPUs, such as Figure 5 CPU0 and CPU1 are shown in FIG.
[0152] In a specific implementation, as an embodiment, the multi-agent system initialization device 510 for the question-answering large model may also include multiple processors, such as Figure 5 1 and 2. The first processor 2001 and the second processor 2004 are shown in FIG. Each of these processors can be a single-core processor (single-CPU) or a multi-core processor (multi-CPU). A processor herein can refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).
[0153] The memory 2002 is used to store the software program for executing the solution of the present invention, and is controlled by the first processor 2001 for execution. The specific implementation method can refer to the above method embodiment and will not be repeated here.
[0154] Alternatively, the memory 2002 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, a random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, an optical disc storage (including a compact disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and capable of being accessed by a computer, but not limited thereto. The memory 2002 may be integrated with the first processor 2001 or exist independently and be initialized via the interface circuit ( Figure 5 (not shown) is coupled to the first processor 2001, which is not specifically limited in this embodiment of the present invention.
[0155] The transceiver 2003 is used to communicate with a network device or a terminal device.
[0156] Optionally, the transceiver 2003 may include a receiver and a transmitter ( Figure 5 The receiver is used to implement a receiving function, and the transmitter is used to implement a sending function.
[0157] Optionally, the transceiver 2003 can be integrated with the first processor 2001 or can exist independently and initialize the interface circuit of the multi-agent system 510 for the question-answering large model ( Figure 5 (not shown) is coupled to the first processor 2001, which is not specifically limited in this embodiment of the present invention.
[0158] It should be noted that Figure 5 The structure of the multi-agent system initialization device 510 for the question-answering large model shown in the figure does not constitute a limitation on the router. The actual knowledge structure recognition device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0159] In addition, the technical effects of the multi-agent system initialization device 510 for the question-answering large model can refer to the technical effects of the multi-agent system initialization method for the question-answering large model described in the above method embodiment, and will not be repeated here.
[0160] It should be understood that the first processor 2001 in the embodiment of the present invention may be a central processing unit (CPU), or may be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor, or the processor may be any conventional processor, etc.
[0161] It should also be understood that the memory in the embodiments of the present invention may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory may be random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM).
[0162] The above embodiments can be implemented in whole or in part via software, hardware (e.g., circuits), firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product comprises one or more computer instructions or computer programs. When loaded or executed on a computer, the processes or functions described in accordance with the embodiments of the present invention are fully or partially performed. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired means (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium accessible by a computer or a data storage device such as a server or data center that contains a collection of one or more available media. The available medium can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media. The semiconductor media can be a solid-state drive.
[0163] It should be understood that the term "and / or" as used herein simply describes a relationship between associated objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A alone, A and B together, or B alone. A and B can be singular or plural. Furthermore, the character " / " as used herein generally indicates an "or" relationship between the associated objects, but it may also indicate an "and / or" relationship. For specific understanding, please refer to the context.
[0164] In this disclosure, "at least one" means one or more, and "plurality" means two or more. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, "at least one of a, b, or c" can mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or plural.
[0165] It should be understood that in various embodiments of the present invention, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0166] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.
[0167] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described equipment, devices and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0168] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interface, indirect coupling or communication connection of the device or unit, which can be electrical, mechanical or other forms.
[0169] The units described as separate components may or may not be physically separate, and 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 these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0170] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0171] If the functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or the portion 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 for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage media include various media that can store program code, such as USB flash drives, mobile hard drives, read-only memories (ROM), random access memories (RAM), magnetic disks, or optical disks.
[0172] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present invention should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.
Claims
1. A multi-agent system initialization method for a large question-answering model, characterized in that: The method comprises: S1. Obtain a user question-answering query task; use a pre-built question-answering planning agent to decompose the user question-answering query task into multiple subtasks and generate an agent corresponding to each subtask; S2. Standardize the agent corresponding to each subtask using a formatted agent to obtain a standardized agent corresponding to each subtask; S3. Use the observation agent to evaluate the standardized agent corresponding to each subtask and obtain feedback information. Then, perform the next round of optimization iteration based on the feedback information, and generate a set of candidate agents through multiple rounds of iteration. S4. Use the pre-trained text encoder to embed the candidate agent set to generate the semantic representation of each agent; use the pre-trained text encoder to embed the user question-answering query task to obtain the user question-answering query task representation; S5. Calculate the user question-answering query task relevance objective based on the semantic representation of each agent and the user question-answering query task representation; calculate the agent diversity objective based on the semantic representation of each agent and the user question-answering query task representation; construct a multi-objective optimization problem based on the user question-answering query task relevance objective and the agent diversity objective; The process of calculating the relevance target of the user question-answering query task based on the semantic representation of each agent and the user question-answering query task representation is expressed by the following formula (1): (1) in, Represents the user question-answering query task relevance goal; represents the set of feasible agents; A vector representation of a single agent; A vector representation of the user question-answering query task; represents a single candidate agent in the set; Represents a user question-answering query task; L2 norm of the vector representing a single agent; The L2 norm of the vector representing the user question-answering query task; S6. Based on the multi-objective optimization problem, a non-dominated sorting algorithm is used to obtain the Pareto optimal frontier team structure set; S7. Based on the team structure set on the Pareto optimal frontier, use the selection agent to select the optimal agent team set.
2. The multi-agent system initialization method for the question-answering large model according to claim 1 is characterized in that: The process of using the formatted agent in S2 to standardize the agent corresponding to each subtask and obtain the standardized agent corresponding to each subtask is expressed by the following formula (2): (2) in, Indicates the Standardized agent representation corresponding to the wheel task; Represents a formatting agent; Represents the agent corresponding to each subtask.
3. The multi-agent system initialization method for the question-answering large model according to claim 1 is characterized in that: The process of using the observation agent in S3 to evaluate the standardized agent corresponding to each subtask and obtain feedback information is expressed by the following formula (3): (3) in, Represents the feedback information of round t; represents the observing agent; Indicates the The normalized agent representation corresponding to each subtask; Represents each subtask.
4. The method for initializing a multi-agent system for a large question-answering model according to claim 1, characterized in that: The agent diversity target is calculated based on the semantic representation of each agent and the user question-answering query task representation, including: Construct a similarity matrix of agent team member embeddings; The agent diversity target is obtained by calculating the Vendi score based on the embedded similarity matrix, the semantic representation of each agent, and the user question-answering query task representation.
5. The method for initializing a multi-agent system for a large question-answering model according to claim 4, characterized in that: The similarity matrix of the agent team member embedding is expressed by the following formula (4): (4) in, Represents the similarity between agents i and j; represents the vector representation of agent i; represents the vector representation of agent j; The L2 norm of the vector representing agent i; The L2 norm of the vector representing agent j; The target of obtaining agent diversity is expressed by the following formula (5): (5) in, Represents the diversity goal of the agent set; Represents similarity matrix The characteristic value of represents the set of feasible agents.
6. The method for initializing a multi-agent system for a large question-answering model according to claim 1, characterized in that: The S6 method uses a non-dominated sorting algorithm to obtain a Pareto-optimal frontier team structure set based on a multi-objective optimization problem, including: From the candidate agent set, construct a set of all candidate agent teams; Among them, the set of all candidate agent teams is expressed by the following formula (6): (6) in, represents the set of all candidate agent teams; Indicates the maximum number of agents; The minimum number of agents that are restricted; represents the set of feasible agents; represents the set of candidate agents; Indicates the number of agents; Based on the user question-answering task relevance goal and the agent diversity goal, a multi-objective optimization problem is constructed, and a Pareto-optimal frontier team structure set is obtained through a non-dominated sorting algorithm. The process of obtaining the Pareto optimal frontier team structure set is expressed by the following formula (7): (7) in, represents the Pareto optimal set of candidate agent teams; represents a team of agents; represents the set of all candidate agent teams; Represents the other agent teams in the collection; express The relevance goal of user question-answering query tasks in the team; Represents a user query; express The relevance goal of user question-answering query tasks in the team; express Diversity goals within the team; express Diversity goals within the team.
7. A multi-agent system initialization device for a question-answering large model, wherein the multi-agent system initialization device for a question-answering large model is used to implement the multi-agent system initialization method for a question-answering large model according to any one of claims 1 to 6, characterized in that: The device comprises: The first generation unit is used to obtain a user question-answering query task; use a pre-built question-answering planning agent to decompose the user question-answering query task into multiple subtasks, and generate an agent corresponding to each subtask; A first acquisition unit is configured to perform standardization processing on the agent corresponding to each subtask using a formatted agent to obtain a standardized agent corresponding to each subtask; The second generation unit is used to use the observation agent to evaluate the standardized agent corresponding to each subtask and obtain feedback information; the next round of optimization iteration is carried out based on the feedback information, and a set of candidate agents is generated through multiple rounds of iteration; The second acquisition unit is used to use a pre-trained text encoder to embed the candidate agent set to generate a semantic representation of each agent; and use the pre-trained text encoder to embed the user question-answering query task to obtain the user question-answering query task representation; A construction unit is used to calculate the user question-answering query task relevance target based on the semantic representation of each agent and the user question-answering query task representation; calculate the agent diversity target based on the semantic representation of each agent and the user question-answering query task representation; and construct a multi-objective optimization problem based on the user question-answering query task relevance target and the agent diversity target; The third acquisition unit is used to obtain a Pareto optimal frontier team structure set using a non-dominated sorting algorithm according to a multi-objective optimization problem; The selection unit is used to select the optimal agent team set using the selection agent according to the team structure set of the Pareto optimal frontier.
8. A multi-agent system initialization device for a large question-answering model, characterized in that: The multi-agent system initialization device for the large question-answering model includes: processor; A memory having computer-readable instructions stored thereon, wherein when the computer-readable instructions are executed by the processor, the method according to any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program code, which can be called by a processor to execute the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Multi-agent question-answer interaction efficiency and performance optimization method based on large model
CN119849644A
Question and answer method and system based on multi-agent reinforcement learning
CN120181229A