A method for optimizing the efficiency and performance of multi-agent question-answering interactions based on a large model

By building and optimizing the communication diagram of the multi-agent Q&A system, dynamically adjusting roles and pruning unimportant nodes and edges, the problems of high token overhead and computing cost in MAS are solved, and efficient and robust multi-agent Q&A interaction is achieved.

CN119849644BActive Publication Date: 2025-08-26HARBIN INSTITUTE OF TECHNOLOGY (SHENZHEN) (INSTITUTE OF SCIENCE AND TECHNOLOGY INNOVATION HARBIN INSTITUTE OF TECHNOLOGY SHENZHEN)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510333136.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-20
Publication Date
2025-08-26
Estimated Expiration
2045-03-20

AI Technical Summary

Technical Problem

Existing multi-agent systems (MAS) based on large language models have problems with high token overhead and computational cost in practical applications, especially in in-wheel and inter-wheel communication, resulting in lengthy information interaction and performance degradation.

Method used

By building a communication graph and using an unbiased policy gradient estimation method, we optimize the weight model of role nodes and edges during the training process, dynamically adjust the participant role and communication methods, and prune unimportant nodes and edges to reduce unnecessary information transmission.

Benefits of technology

Improves the efficiency and performance of multi-agent Q&A interaction, reduces token consumption and computing costs, while maintaining the robustness of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119849644B_ABST
    Figure CN119849644B_ABST
Patent Text Reader

Abstract

The present invention provides a method and device for optimizing the efficiency and performance of multi-agent question-answering interaction based on a large model, and relates to the field of multi-agent interaction technology. The method includes: based on multi-agents, constructing a first communication graph and a first graph weight model according to a training question-answering task; based on a first preset round, using the training data and the first communication graph, using an unbiased policy gradient estimation method to perform a first-stage optimization training on the first graph weight model to obtain a second graph weight model and a second communication graph; based on a second preset round, using the training data and the second communication graph, using an unbiased policy gradient estimation method to perform a second-stage optimization training on the second graph weight model to obtain a third graph weight model; according to the actual question-answering task, using the third graph weight model to perform question-answering reasoning to obtain the actual question-answering reasoning result. The present invention is a method for optimizing the efficiency and performance of multi-agent question-answering interaction based on multi-agent roles with high efficiency and good robustness.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of multi-agent interaction technology, and in particular to a method and device for optimizing the efficiency and performance of multi-agent question-answering interaction based on a large model. Background Art

[0002] From natural language processing to complex reasoning, large language models (LLMs) have become powerful tools for solving a wide range of tasks. The development of autonomous multi-agent systems (MASs) based on LLMs has become a research hotspot. These systems aim to leverage the collective intelligence of multiple LLM-based agents for collaborative problem solving and decision-making. However, current LLM-based MASs face significant challenges in practical application. Coordination and communication between agents are often inefficient, resulting in lengthy information exchanges, significant token consumption, longer inference times, and higher computational costs.

[0003] Recent research both domestically and internationally has demonstrated that multiple LLM-based agents, through collaborative methods like dialogue and debate, can significantly improve performance on various tasks compared to a single LLM. To facilitate the representation and optimization of multi-agent automated systems (MASs), researchers use communication graphs to represent the multi-agent communication process. These graphs consist of nodes and edges, with each node representing an agent playing a specific role, and directed edges representing the exchange of information between agents. In this context, the MAS is conceptualized as a graph, forming a coherent functional entity. To address the high token overhead and computational costs of MASs, researchers define communication redundancy in MASs as the excessive amount of message passing within a MAS that does not meaningfully contribute to collaborative intelligence and does not improve the performance of multi-agent cooperation. Based on this research theory, methods for pruning communication edges between agents have become a major research direction. Pruning removes unimportant edges, reducing the number of communications and improving efficiency. However, currently, no method exists to optimize the roles of agents in MASs.

[0004] In the existing technology, there is a lack of a multi-agent question-answering interaction efficiency and performance optimization method based on multi-agent roles that is efficient and robust. Summary of the Invention

[0005] To address the significant token overhead and computational costs associated with existing MASs, particularly those that perform both intra-round and inter-round communication, the present invention provides a method and apparatus for optimizing the efficiency and performance of multi-agent question-and-answer interactions based on a large model. The technical solution is as follows:

[0006] On the one hand, a method for optimizing the efficiency and performance of multi-agent question-answering interaction based on a large model is provided. The method is implemented by a multi-agent question-answering interaction efficiency and performance optimization device, and the method includes:

[0007] Obtaining a training question-answering task and training data; constructing a first communication graph and a first graph weight model based on the multi-agent and training question-answering task;

[0008] Based on the first preset round, according to the training data and the first communication graph, an unbiased policy gradient estimation method is used to perform a first-stage optimization training on the first graph weight model to obtain a second graph weight model and a second communication graph;

[0009] Based on the second preset round, using the training data and the second communication graph, an unbiased policy gradient estimation method is used to perform a second-stage optimization training on the second graph weight model to obtain a third graph weight model;

[0010] Obtain the actual question-answering task; based on the actual question-answering task, use the third graph weight model to perform question-answering reasoning to obtain the actual question-answering reasoning results.

[0011] On the other hand, a device for optimizing the efficiency and performance of multi-agent question-answering interaction based on a large model is provided. The device is applied to a method for optimizing the efficiency and performance of multi-agent question-answering interaction based on a large model. The device includes:

[0012] A model construction module is used to obtain training question-answering tasks and training data; based on multi-agent, a first communication graph and a first graph weight model are constructed according to the training question-answering tasks;

[0013] A first model optimization module is configured to perform a first-stage optimization training on the first graph weight model using an unbiased policy gradient estimation method based on the training data and the first communication graph in a first preset round to obtain a second graph weight model and a second communication graph;

[0014] A second model optimization module is configured to perform a second-stage optimization training on the second graph weight model using the training data and the second communication graph and an unbiased policy gradient estimation method based on a second preset round to obtain a third graph weight model;

[0015] The question-answering reasoning module is used to obtain actual question-answering tasks; based on the actual question-answering tasks, the third graph weight model is used to perform question-answering reasoning to obtain actual question-answering reasoning results.

[0016] On the other hand, a multi-agent question-answering interaction efficiency and performance optimization device is provided, which includes: a processor; a memory, on which computer-readable instructions are stored, and when the computer-readable instructions are executed by the processor, any one of the above-mentioned large-model-based multi-agent question-answering interaction efficiency and performance optimization methods is implemented.

[0017] 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 methods for optimizing the efficiency and performance of multi-agent question-and-answer interaction based on a large model.

[0018] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:

[0019] This paper proposes a method for optimizing the efficiency and performance of multi-agent question-and-answer interactions based on a large model. By calculating the degrees of role nodes in a communication graph and discarding less important nodes, this method simulates the dynamic adjustment of participant roles in teamwork to improve efficiency. Using training samples, policy gradients are used to update matrix parameters, discarding edges with low intra- and inter-round communication, thereby reducing unnecessary information transfer. This method is a highly efficient and robust method for optimizing the efficiency and performance of multi-agent question-and-answer interactions based on multi-agent roles. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] 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.

[0021] Figure 1 This is a flow chart of a method for optimizing the efficiency and performance of multi-agent question-answering interactions based on a large model, provided by an embodiment of the present invention;

[0022] Figure 2 This is a block diagram of a device for optimizing the efficiency and performance of multi-agent question-answering interactions based on a large model, provided by an embodiment of the present invention;

[0023] Figure 3 This is a structural diagram of a multi-agent question-answering interaction efficiency and performance optimization device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0024] The technical solution of the present invention is described below in conjunction with the accompanying drawings.

[0025] 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.

[0026] 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.

[0027] 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.

[0028] 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.

[0029] The embodiment of the present invention provides a method for optimizing the efficiency and performance of multi-agent question-answering interaction based on a large model. The method can be implemented by a multi-agent question-answering interaction efficiency and performance optimization device, which can be a terminal or a server. Figure 1 The flowchart of the method for optimizing the efficiency and performance of multi-agent question-answering interaction based on a large model is shown. The processing flow of the method may include the following steps:

[0030] S1. Obtain a training question-answering task and training data; based on multi-agent, construct a first communication graph and a first graph weight model according to the training question-answering task.

[0031] Optionally, based on the multi-agent system, constructing a first communication graph and a first graph weight model according to the training question-answering task includes:

[0032] Based on the large language model and preset role prompts, a multi-role intelligent agent is constructed according to the training question-answering task; the multi-role intelligent agent is constructed according to the task requirements of the training question-answering task;

[0033] Based on the training question-answering task, a first communication graph is constructed according to the multi-role intelligent agents; the first communication graph is used to determine the communication relationship between the multi-role intelligent agents;

[0034] A first graph weight model is constructed according to the multi-role intelligent agent and the first communication graph.

[0035] In a feasible implementation, in a question-answering context, MAS typically includes agents with different roles and functions, each of which is composed of an LLM. Each agent is given a specific role definition and prompt words so that it can analyze and answer questions from different perspectives.

[0036] These agents can not only independently answer user needs, but also criticize or make suggestions on the views of other agents, thereby promoting more comprehensive and in-depth discussions. For different types of problems, it is crucial to choose the right agent role, because agents with different roles have unique advantages in dealing with specific problems. In the initialization stage of the communication graph, since how to efficiently communicate between agents to maximize system performance is still an open problem, a fixed graph structure is usually used to define the intra-round communication method. Common initialization methods include fully connected graphs, layer graphs, and random graphs. The fully connected graph ensures that each agent can communicate directly with all other agents and is suitable for tasks that require a high degree of coordination; the layer graph restricts the communication path through a hierarchical structure and is suitable for hierarchical task scenarios; and the random graph provides a flexible and somewhat uncertain communication method by randomly connecting agents, which is suitable for exploratory tasks or scenarios that require diversity.

[0037] The present invention provides a MAS topology optimization method including intra-round and inter-round communication, which dynamically adjusts the roles participating in the discussion in different rounds and the communication mode between them to improve efficiency and effect, which is called agent dropping.

[0038] Among them, the first graph weight model includes role nodes and edges; the role nodes are constructed corresponding to multi-role intelligent agents; and the edges are constructed corresponding to the first communication graph.

[0039] In one feasible implementation, MAS can be expressed as .in, Represents a collection of role nodes, each of which represents an agent. is a set of edges, each edge Represents the agent To the agent communication path. It is a set of mapping functions used to abstract the reasoning process of the intelligent agent. Receives a query q and its output from neighbors , and generate your own output For some complex tasks, the entire communication graph needs to run multiple rounds to obtain the final answer. The communication graph of each round of operation is defined as: ,in represents an intra-round edge, which only connects nodes in the same round. The output of any node in round t-1 can be passed to any node in round t, forming an inter-round edge , and communication connection diagram and .

[0040] Subgraphs of all reasoning rounds pass Combined into a multi-round communication graph ,in, , ,and , Represents the union of all elements in the following collection.

[0041] Converting a communication graph to a weighted graph , each edge in the graph is a trainable graph, and each trainable graph is a graph weight model ranging from 0 to 1. The graph weight model set is Include and ,in is a subset of the in-wheel graph weight model, is the intra-round graph weight model of the t-th round communication graph, and is a subset containing the inter-round graph weight model, is the inter-round graph weight model between round t-1 and round t.

[0042] S2. Based on the first preset round, according to the training data and the first communication graph, use an unbiased policy gradient estimation method to perform a first-stage optimization training on the first graph weight model to obtain a second graph weight model and a second communication graph.

[0043] Optionally, based on the first preset round, according to the training data and the first communication graph, using an unbiased policy gradient estimation method to perform a first-stage optimization training on the first graph weight model to obtain a second graph weight model and a second communication graph, including:

[0044] Use the DAGSample algorithm to resample the first communication graph according to the first graph weight model and construct the first round of internal graph weight model;

[0045] Calculating the conditional sampling probability of the first communication graph according to the model parameters of the first round of the internal graph weight model to obtain a first conditional sampling probability;

[0046] Based on the first optimization objective function and the first conditional sampling probability, and according to the training data, training the first round of the internal graph weight model for a first preset round to obtain a first gradient estimate;

[0047] According to the first gradient estimation, the first round internal graph weight model is optimized using the gradient ascent method to obtain the second round internal graph weight model;

[0048] Based on the TopkNodes function, the model parameters of the second round of internal graph weight model are calculated to obtain the role node degree set;

[0049] According to the role node degree set, the top k nodes with the smallest role node degree in the second round of internal graph weight model are screened out to obtain the discarded node set;

[0050] The first graph weight model is optimized according to the discarded node set to obtain a second graph weight model and a second communication graph.

[0051] In one feasible implementation, when handling various question-and-answer questions, by adjusting the roles of participants in different rounds, we can focus on the most relevant contributors at each stage and improve team performance. Therefore, nodes with low contributions to each round of communication are removed from the first communication graph.

[0052] Initialize the first round of the internal graph weight model by initializing the weights of all edges to 0.5 and the first-round inter-graph weight model . Train the first round of internal graph weight model This is done to obtain an optimized second-round internal graph weight model in preparation for discarding character nodes.

[0053] The goal of the first node optimization training is simple and clear, that is, to achieve high task performance. The first optimization objective function is as follows (1):

[0054] (1);

[0055] in, represents the feasible domain of the first communication graph sampling; represents the first optimization objective; Score for performance.

[0056] Since the utility function It relies on an external application programming interface (API) and is usually not differentiable. Therefore, the present invention adopts an unbiased policy gradient estimation method. This method approximates the overall performance expectation by the probability-weighted average performance of a finite number of question-answer samples. Use the Directed Acyclic Graph Sampling Algorithm (DAGSample) to sample M communication graphs and Run the training samples on to get the performance score , the calculation formula of the first gradient estimate is as follows (2):

[0057] (2);

[0058] in, represents the gradient, Represents the graph weight model in a given current weighted round Under the conditions, the first communication diagram The calculation formula of the first conditional sampling probability is as follows (3):

[0059] (3);

[0060] in, Represents cumulative multiplication; i and j are the role node numbers. After calculating the gradient, the gradient ascent method is used to update the first round of internal graph weight model .

[0061] After the optimization is completed, the nodes with the smallest weighted in-degree and out-degree in each round graph are selected, and these nodes and all connected edges are removed. The process of obtaining the discarded node set is as follows:

[0062] (4);

[0063] in, It is a function that returns the set of k role nodes with the largest sum of in-degree and out-degree according to the graph weight model parameters. The sum of the in-degree and out-degree of a role node is the degree of the role node. The preset role node drop rate.

[0064] By removing all rows and columns associated with the deleted node, and It will also be modified synchronously.

[0065] S3. Based on the second preset round, using the training data and the second communication graph, use an unbiased policy gradient estimation method to perform a second-stage optimization training on the second graph weight model to obtain a third graph weight model.

[0066] Optionally, based on the second preset round, using the training data and the second communication graph, and using an unbiased policy gradient estimation method, a second-stage optimization training is performed on the second graph weight model to obtain a third graph weight model, including:

[0067] Use the DAGSample algorithm to resample the second communication graph according to the second graph weight model, and construct a second-round intra-graph weight model and a second-round inter-graph weight model;

[0068] Based on the second-round intra-graph weight model and the second-round inter-graph weight model, and according to the training data and the second communication graph, the second-round intra-graph weight model is trained for a second preset round to obtain a third-round intra-graph weight model;

[0069] Based on the TopkEdges function, the edge communication efficiency set is calculated according to the model parameters of the third round of internal graph weight model;

[0070] According to the edge communication efficiency set, the top k edges with the lowest edge efficiency in the third round of the internal graph weight model are screened out to obtain the discarded edge set;

[0071] The second graph weight model is optimized according to the discarded edge set to obtain the third graph weight model.

[0072] In a feasible implementation, by promoting more focused and efficient interactions between agents, the overall efficiency of the team in answering questions can also be improved. Therefore, the present invention deletes the intra-round and inter-round edges in the second communication graph that are less important for improving communication efficiency.

[0073] After the graph optimization is completed, we select the edges with the smallest weight in each round of the graph and remove them. The process of obtaining the discarded edge set is as follows (5):

[0074] (5);

[0075] in, Is a function that returns the largest set of k edges according to the graph weight model parameters. is the preset edge drop rate. At the same time, by removing the relevant communication edges, and It will also be modified synchronously.

[0076] Optionally, based on the second-round intra-graph weight model and the second-round inter-graph weight model, the second-round intra-graph weight model is trained for a second preset round according to the training data and the second communication graph to obtain a third-round intra-graph weight model, including:

[0077] Calculating the conditional sampling probability of the second communication graph according to the model parameters of the second-round internal graph weight model to obtain a second conditional sampling probability;

[0078] Calculating the conditional sampling probability of the second communication graph according to the model parameters of the second inter-round graph weight model to obtain a third conditional sampling probability;

[0079] Based on the second optimization objective function, the second conditional sampling probability and the third conditional sampling probability, and according to the training data, training the second round of the internal graph weight model for a second preset round to obtain a second gradient estimate;

[0080] Based on the second optimization objective function, the second conditional sampling probability and the third conditional sampling probability, and according to the training data, training the second inter-round graph weight model for a second preset round to obtain a third gradient estimate;

[0081] According to the second gradient estimation and the third gradient estimation, the second-round internal graph weight model is optimized using the gradient ascent method to obtain the third-round internal graph weight model.

[0082] In one feasible implementation, after the role node is discarded, the second round of internal graph weight model is reinitialized. and the second-round inter-graph weight model , and start training. The second stage optimizes the training goal, taking into account both high performance and token efficiency. The second optimization objective function is as follows (6):

[0083] (6);

[0084] in, represents the feasible region of the second communication graph sampling after the node is dropped, represents the second optimization objective.

[0085] The first stage training is similar, using the weighted average performance of the samples to approximate the performance expectation. The difference from the first stage training is that and The probability and gradient of , in the second stage training, the calculation formula for the conditional sampling probability of the second communication graph is as follows (7):

[0086] (7);

[0087] Among them, the second term represents low-rank sparsity, which serves as a proxy indicator of communication efficiency. Since low-rank optimization is a nondeterministic polynomial-time (NP) problem, this paper uses the nuclear norm to replace the rank function. It represents the optimization objective, and its mathematical expression is as follows (8):

[0088] (8);

[0089] After calculating the gradient, use the gradient ascent method to update the second round of internal graph weight model .

[0090] S4. Obtain the actual question-answering task; based on the actual question-answering task, use the third graph weight model to perform question-answering reasoning to obtain the actual question-answering reasoning result.

[0091] In a feasible implementation, the present invention provides a method for constructing an efficient communication topology optimization method. The core goal is to improve the efficiency of MAS while enhancing its performance and robustness.

[0092] For tasks performed by a single agent, this paper compares to a direct reasoning approach (referred to as Vanilla) and a Chain of Thought (CoT) approach. In the context of multi-agent collaboration, for methods that communicate only within a turn, this paper compares a single-turn dialogue multi-agent system, denoted as MAS_round=1. For methods that communicate both within and across turns, this paper compares multi-round MAS_round=T and AgentPrune, where rounds represents the number of rounds of cross-turn communication between agents. Both agent pruning and agent dropping are optimized based on MAS_round=T, making the comparison of these methods more intuitive. The comparison results are shown in Table 1 (Multi-test set score comparison table for agent dropping).

[0093] Table 1

[0094]

[0095] As shown in Table 1, our method consistently outperforms the single-agent CoT method and the state-of-the-art multi-agent communication method, Agent Pruning, across all benchmarks, regardless of model size. For example, based on the Llama3 model, our method's agent pruning improves accuracy by 2.19% compared to the state-of-the-art approach. In experiments using Qwen2.5 and Deepseek-V3, the accuracy improvements are 0.77% and 0.47%, respectively. These results demonstrate the effectiveness of our method.

[0096] This paper proposes a method for optimizing the efficiency and performance of multi-agent question-and-answer interactions based on a large model. By calculating the degrees of role nodes in a communication graph and discarding less important nodes, this method simulates the dynamic adjustment of participant roles in teamwork to improve efficiency. Using training samples, policy gradients are used to update matrix parameters, discarding edges with low intra- and inter-round communication, thereby reducing unnecessary information transfer. This method is a highly efficient and robust method for optimizing the efficiency and performance of multi-agent question-and-answer interactions based on multi-agent roles.

[0097] Figure 2 This is a block diagram of a device for optimizing the efficiency and performance of multi-agent question-answering interaction based on a large model according to an exemplary embodiment. The device is used for optimizing the efficiency and performance of multi-agent question-answering interaction based on a large model. Figure 2 The device includes a model building module 210, a first model optimization module 220, a second model optimization module 230, and a question-answering reasoning module 240.

[0098] Model construction module 210, for obtaining a training question-answering task and training data; constructing a first communication graph and a first graph weight model based on the training question-answering task based on multi-agent;

[0099] A first model optimization module 220 is configured to perform a first-stage optimization training on the first graph weight model using an unbiased policy gradient estimation method based on the training data and the first communication graph in a first preset round to obtain a second graph weight model and a second communication graph;

[0100] A second model optimization module 230 is configured to perform a second-stage optimization training on the second graph weight model using the training data and the second communication graph and an unbiased policy gradient estimation method based on a second preset round to obtain a third graph weight model;

[0101] The question-answering reasoning module 240 is used to obtain the actual question-answering task; based on the actual question-answering task, the third graph weight model is used to perform question-answering reasoning to obtain the actual question-answering reasoning result.

[0102] Optionally, the model building module 210 is further configured to:

[0103] Based on the large language model and preset role prompts, a multi-role intelligent agent is constructed according to the training question-answering task; the multi-role intelligent agent is constructed according to the task requirements of the training question-answering task;

[0104] Based on the training question-answering task, a first communication graph is constructed according to the multi-role intelligent agents; the first communication graph is used to determine the communication relationship between the multi-role intelligent agents;

[0105] A first graph weight model is constructed according to the multi-role intelligent agent and the first communication graph.

[0106] Among them, the first graph weight model includes role nodes and edges; the role nodes are constructed corresponding to multi-role intelligent agents; and the edges are constructed corresponding to the first communication graph.

[0107] Optionally, the first model optimization module 220 is further configured to:

[0108] Use the DAGSample algorithm to resample the first communication graph according to the first graph weight model and construct the first round of internal graph weight model;

[0109] Calculating the conditional sampling probability of the first communication graph according to the model parameters of the first round of the internal graph weight model to obtain a first conditional sampling probability;

[0110] Based on the first optimization objective function and the first conditional sampling probability, and according to the training data, training the first round of the internal graph weight model for a first preset round to obtain a first gradient estimate;

[0111] According to the first gradient estimation, the first round internal graph weight model is optimized using the gradient ascent method to obtain the second round internal graph weight model;

[0112] Based on the TopkNodes function, the model parameters of the second round of internal graph weight model are calculated to obtain the role node degree set;

[0113] According to the role node degree set, the top k nodes with the smallest role node degree in the second round of internal graph weight model are screened out to obtain the discarded node set;

[0114] The first graph weight model is optimized according to the discarded node set to obtain a second graph weight model and a second communication graph.

[0115] Optionally, the second model optimization module 230 is further configured to:

[0116] Use the DAGSample algorithm to resample the second communication graph according to the second graph weight model, and construct a second-round intra-graph weight model and a second-round inter-graph weight model;

[0117] Based on the second-round intra-graph weight model and the second-round inter-graph weight model, and according to the training data and the second communication graph, the second-round intra-graph weight model is trained for a second preset round to obtain a third-round intra-graph weight model;

[0118] Based on the TopkEdges function, the edge communication efficiency set is calculated according to the model parameters of the third round of internal graph weight model;

[0119] According to the edge communication efficiency set, the top k edges with the lowest edge efficiency in the third round of the internal graph weight model are screened out to obtain the discarded edge set;

[0120] The second graph weight model is optimized according to the discarded edge set to obtain the third graph weight model.

[0121] Optionally, the second model optimization module 230 is further configured to:

[0122] Calculating the conditional sampling probability of the second communication graph according to the model parameters of the second-round internal graph weight model to obtain a second conditional sampling probability;

[0123] Calculating the conditional sampling probability of the second communication graph according to the model parameters of the second inter-round graph weight model to obtain a third conditional sampling probability;

[0124] Based on the second optimization objective function, the second conditional sampling probability and the third conditional sampling probability, and according to the training data, training the second round of the internal graph weight model for a second preset round to obtain a second gradient estimate;

[0125] Based on the second optimization objective function, the second conditional sampling probability and the third conditional sampling probability, and according to the training data, training the second inter-round graph weight model for a second preset round to obtain a third gradient estimate;

[0126] According to the second gradient estimation and the third gradient estimation, the second-round internal graph weight model is optimized using the gradient ascent method to obtain the third-round internal graph weight model.

[0127] This paper proposes a method for optimizing the efficiency and performance of multi-agent question-and-answer interactions based on a large model. By calculating the degrees of role nodes in a communication graph and discarding less important nodes, this method simulates the dynamic adjustment of participant roles in teamwork to improve efficiency. Using training samples, policy gradients are used to update matrix parameters, discarding edges with low intra- and inter-round communication, thereby reducing unnecessary information transfer. This method is a highly efficient and robust method for optimizing the efficiency and performance of multi-agent question-and-answer interactions based on multi-agent roles.

[0128] Figure 3 This is a schematic diagram of a multi-agent question-answering interaction efficiency and performance optimization device provided by an embodiment of the present invention. Figure 3 As shown, the multi-agent question-answering interaction efficiency and performance optimization device may include the above Figure 2 The multi-agent question-answering interaction efficiency and performance optimization device based on a large model is shown. Optionally, the multi-agent question-answering interaction efficiency and performance optimization device 310 may include a first processor 2001.

[0129] Optionally, the multi-agent question-answer interaction efficiency and performance optimization device 310 may also include a memory 2002 and a transceiver 2003.

[0130] The first processor 2001, the memory 2002 and the transceiver 2003 may be connected via a communication bus.

[0131] The following combination Figure 3 The components of the multi-agent question-answering interaction efficiency and performance optimization device 310 are described in detail:

[0132] The first processor 2001 is the control center of the multi-agent question-answer interaction efficiency and performance optimization device 310 and 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).

[0133] Optionally, the first processor 2001 can perform various functions of the multi-agent question-and-answer interaction efficiency and performance optimization device 310 by running or executing software programs stored in the memory 2002 and calling data stored in the memory 2002.

[0134] In a specific implementation, as an embodiment, the first processor 2001 may include one or more CPUs, such as Figure 3 CPU0 and CPU1 are shown in FIG.

[0135] In a specific implementation, as an embodiment, the multi-agent question-answer interaction efficiency and performance optimization device 310 may also include multiple processors, such as Figure 3 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).

[0136] 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.

[0137] Alternatively, the memory 2002 may be a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (RAM) or other type of dynamic storage device that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 2002 may be integrated with the first processor 2001 or exist independently and accessed through the interface circuit ( Figure 3 (not shown) is coupled to the first processor 2001, which is not specifically limited in this embodiment of the present invention.

[0138] The transceiver 2003 is used to communicate with a network device or a terminal device.

[0139] Optionally, the transceiver 2003 may include a receiver and a transmitter ( Figure 3 The receiver is used to implement a receiving function, and the transmitter is used to implement a sending function.

[0140] Optionally, the transceiver 2003 can be integrated with the first processor 2001 or can exist independently and be connected to the multi-agent question-answer interaction efficiency and performance optimization device 310 through the interface circuit ( Figure 3 (not shown) is coupled to the first processor 2001, which is not specifically limited in this embodiment of the present invention.

[0141] It should be noted that Figure 3 The structure of the multi-agent question-answering interaction efficiency and performance optimization device 310 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.

[0142] In addition, the technical effects of the multi-agent question-answering interaction efficiency and performance optimization device 310 can refer to the technical effects of the multi-agent question-answering interaction efficiency and performance optimization method based on a large model described in the above method embodiment, and will not be repeated here.

[0143] 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.

[0144] 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).

[0145] 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.

[0146] 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.

[0147] 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.

[0148] 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.

[0149] 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.

[0150] 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.

[0151] 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.

[0152] 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.

[0153] 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.

[0154] 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.

[0155] 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 method for optimizing the efficiency and performance of multi-agent question-answering interactions based on a large model, characterized in that: The method comprises: Obtaining a training question-answering task and training data; constructing a first communication graph and a first graph weight model based on the multi-agent and training question-answering task; Based on the first preset round, according to the training data and the first communication graph, the first phase optimization training of the first graph weight model is performed using an unbiased policy gradient estimation method to obtain a second graph weight model and a second communication graph, including: Use the DAGSample algorithm to resample the first communication graph according to the first graph weight model and construct the first round of internal graph weight model; Calculating the conditional sampling probability of the first communication graph according to the model parameters of the first round of the internal graph weight model to obtain a first conditional sampling probability; Based on the first optimization objective function and the first conditional sampling probability, and according to the training data, training the first round of the internal graph weight model for a first preset round to obtain a first gradient estimate; According to the first gradient estimation, the first round internal graph weight model is optimized using the gradient ascent method to obtain the second round internal graph weight model; Based on the TopkNodes function, the model parameters of the second round of internal graph weight model are calculated to obtain the role node degree set; According to the role node degree set, the top k nodes with the smallest role node degree in the second round of internal graph weight model are screened out to obtain the discarded node set; Optimizing the first graph weight model according to the discarded node set to obtain a second graph weight model and a second communication graph; Based on the second preset round, using the training data and the second communication graph, an unbiased policy gradient estimation method is used to perform a second-stage optimization training on the second graph weight model to obtain a third graph weight model, including: Use the DAGSample algorithm to resample the second communication graph according to the second graph weight model, and construct a second-round intra-graph weight model and a second-round inter-graph weight model; Based on the second-round intra-graph weight model and the second-round inter-graph weight model, and according to the training data and the second communication graph, the second-round intra-graph weight model is trained for a second preset round to obtain a third-round intra-graph weight model; Based on the TopkEdges function, the edge communication efficiency set is calculated according to the model parameters of the third round of internal graph weight model; According to the edge communication efficiency set, the top k edges with the lowest edge efficiency in the third round of the internal graph weight model are screened out to obtain the discarded edge set; According to the discarded edge set, the second graph weight model is optimized to obtain the third graph weight model; Obtain the actual question-answering task; based on the actual question-answering task, use the third graph weight model to perform question-answering reasoning to obtain the actual question-answering reasoning results.

2. The method for optimizing the efficiency and performance of multi-agent question-answering interaction based on a large model according to claim 1 is characterized in that: The method of constructing a first communication graph and a first graph weight model based on a multi-agent training question-answering task includes: Based on the large language model and preset role prompt words, a multi-role intelligent agent is constructed according to the training question-answering task; the multi-role intelligent agent is constructed according to the task requirements of the training question-answering task; Based on the training question-answering task, a first communication graph is constructed according to the multi-role intelligent agents; the first communication graph is used to determine the communication relationship between the multi-role intelligent agents; A first graph weight model is constructed according to the multi-role intelligent agent and the first communication graph.

3. The method for optimizing the efficiency and performance of multi-agent question-answering interaction based on a large model according to claim 2 is characterized in that: The first graph weight model includes role nodes and edges; the role nodes are constructed corresponding to multi-role agents; and the edges are constructed corresponding to the first communication graph.

4. The method for optimizing the efficiency and performance of multi-agent question-answering interaction based on a large model according to claim 1 is characterized in that: The method of performing a second preset round of training on the second-round intra-graph weight model based on the second-round intra-graph weight model and the second-round inter-graph weight model according to the training data and the second communication graph to obtain a third-round intra-graph weight model includes: Calculating the conditional sampling probability of the second communication graph according to the model parameters of the second-round internal graph weight model to obtain a second conditional sampling probability; Calculating the conditional sampling probability of the second communication graph according to the model parameters of the second inter-round graph weight model to obtain a third conditional sampling probability; Based on the second optimization objective function, the second conditional sampling probability and the third conditional sampling probability, and according to the training data, training the second round of the internal graph weight model for a second preset round to obtain a second gradient estimate; Based on the second optimization objective function, the second conditional sampling probability and the third conditional sampling probability, and according to the training data, training the second inter-round graph weight model for a second preset round to obtain a third gradient estimate; According to the second gradient estimation and the third gradient estimation, the second-round internal graph weight model is optimized using the gradient ascent method to obtain the third-round internal graph weight model.

5. A device for optimizing the efficiency and performance of multi-agent question-answering interaction based on a large model, wherein the device is used to implement the method for optimizing the efficiency and performance of multi-agent question-answering interaction based on a large model as claimed in any one of claims 1 to 4, characterized in that: The device comprises: A model construction module is used to obtain training question-answering tasks and training data; based on multi-agent, a first communication graph and a first graph weight model are constructed according to the training question-answering tasks; A first model optimization module is configured to perform a first-stage optimization training on the first graph weight model using an unbiased policy gradient estimation method based on the training data and the first communication graph in a first preset round to obtain a second graph weight model and a second communication graph; A second model optimization module is configured to perform a second-stage optimization training on the second graph weight model using the training data and the second communication graph and an unbiased policy gradient estimation method based on a second preset round to obtain a third graph weight model; The question-answering reasoning module is used to obtain actual question-answering tasks; based on the actual question-answering tasks, the third graph weight model is used to perform question-answering reasoning to obtain actual question-answering reasoning results.

6. The multi-agent question-answering interaction efficiency and performance optimization device based on a large model according to claim 5 is characterized in that: The model building module is further used to: Based on the large language model and preset role prompt words, a multi-role intelligent agent is constructed according to the training question-answering task; the multi-role intelligent agent is constructed according to the task requirements of the training question-answering task; Based on the training question-answering task, a first communication graph is constructed according to the multi-role intelligent agents; the first communication graph is used to determine the communication relationship between the multi-role intelligent agents; A first graph weight model is constructed according to the multi-role intelligent agent and the first communication graph.

7. A device for optimizing the efficiency and performance of multi-agent question-answering interactions, characterized in that: The multi-agent question-answering interaction efficiency and performance optimization device 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 4 is implemented.

8. 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 4.