Multi-agent question-answer interaction efficiency and performance optimization method based on large model

By dynamically adjusting role nodes and reducing unnecessary information transmission in the communication graph of the multi-agent system, the high token consumption and computing cost problems faced by the multi-agent system based on the large language model in practical applications is solved, and efficiency and performance optimization is achieved.

CN119849644AActive Publication Date: 2025-04-18HARBIN INSTITUTE OF TECHNOLOGY (SHENZHEN) (INSTITUTE OF SCIENCE AND TECHNOLOGY INNOVATION HARBIN INSTITUTE OF TECHNOLOGY SHENZHEN)

Patent Information

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

AI Technical Summary

Technical Problem

Multi-agent systems based on large language models face problems such as high token consumption, long inference time and high computational cost in practical applications, especially when conducting in-wheel communication and inter-wheel communication.

Method used

By calculating the degree of role nodes in the communication graph and discarding the less important nodes, the participant's roles are dynamically adjusted to improve efficiency; at the same time, the matrix parameters are updated using the policy gradient to reduce unnecessary information transmission.

Benefits of technology

It realizes the improvement of multi-agent Q&A interaction efficiency and optimization of performance, reduces token consumption and computing costs, and improves the robustness of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119849644A_ABST
    Figure CN119849644A_ABST
Patent Text Reader

Abstract

The invention provides a multi-agent question-answer interaction efficiency and performance optimization method and device based on a large model, and relates to the technical field of multi-agent interaction. The method comprises the steps of constructing a first communication graph and a first graph weight model according to a training question and answer task based on multiple agents; based on a first preset round, according to the training data and the first communication graph, performing first-stage optimization training on the first graph weight model by using an unbiased strategy gradient estimation method 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, and using an unbiased strategy gradient estimation method to carry out second-stage optimization training on the second graph weight model to obtain a third graph weight model; and according to the actual question and answer task, performing question and answer reasoning by using the third graph weight model to obtain an actual question and answer reasoning result. The multi-agent question and answer interaction efficiency and performance optimization method based on the multi-agent role is high in efficiency and good in 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 a powerful tool for solving tasks in a wide range of fields. The development of autonomous multi-agent systems (MASs) based on large language models has become a current research hotspot. The system aims to use the collective intelligence of multiple LLM-based agents to collaboratively solve problems and make decisions. However, the current LLM-based MAS faces significant difficulties in practical application. Coordination and communication between agents are often inefficient, resulting in lengthy information interactions, which in turn leads to a large amount of token consumption, longer reasoning time, and higher computational costs.

[0003] In recent years, domestic and foreign research has shown that multiple LLM-based agents can greatly improve their performance on a variety of tasks compared to a single LLM through cooperation methods such as dialogue and debate. In order to facilitate the representation and optimization of MAS, researchers use communication graphs to represent the communication process of multiple agents. This graph consists of nodes and edges. Each node plays an agent with a specific role, and directed edges represent the transmission of information between agents. In this case, MAS is conceptualized as a graph to form a coherent functional entity. Faced with the high token overhead and computing cost of MAS, researchers define communication redundancy in MAS, that is, a large amount of message transmission in MAS has no meaningful contribution to collaborative intelligence and will not improve the performance of multi-agent cooperation. Based on the above research theory, the method of pruning the communication edges between agents has become the main research direction, that is, by pruning the unimportant edges, the number of communications is reduced, and the purpose of improving efficiency is achieved. However, there is currently no method to optimize the roles of agents in MAS.

[0004] In the prior art, there is a lack of a multi-agent question-answering interaction efficiency and performance optimization method based on multi-agent roles with high efficiency and good robustness. Summary of the invention

[0005] In order to solve the problem of huge token overhead and computing cost in the existing MAS, especially the technical problem of MAS that performs intra-round communication and inter-round communication at the same time, the embodiment of 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. 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 being implemented by a multi-agent question-answering interaction efficiency and performance optimization device, the method comprising:

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

[0008] 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;

[0009] Based on the 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;

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

[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, and the device is applied to a method for optimizing the efficiency and performance of multi-agent question-answering interaction based on a large model, and the device comprises:

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

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

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

[0015] The question-answering reasoning module is used to obtain the actual question-answering task; according to 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.

[0016] On the other hand, a multi-agent question-answering interaction efficiency and performance optimization device is provided, and the multi-agent question-answering interaction efficiency and performance optimization device comprises: 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] The present invention proposes a multi-agent question-answering interaction efficiency and performance optimization method based on a large model. By calculating the degree of the role nodes in the communication graph and discarding the nodes with lower importance, the dynamic adjustment of the roles of the participants in teamwork is simulated to improve efficiency; the matrix parameters are updated using the policy gradient through the training samples, and the edges with low communication within and between rounds are discarded, thereby reducing unnecessary information transmission. The present invention is a multi-agent question-answering interaction efficiency and performance optimization method based on multi-agent roles with high efficiency and good robustness. 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 It is a flow chart of a method for optimizing the efficiency and performance of multi-agent question-answering interaction based on a large model provided by an embodiment of the present invention;

[0022] Figure 2 It is a block diagram of a multi-agent question-answering interaction efficiency and performance optimization device based on a large model provided by an embodiment of the present invention;

[0023] Figure 3 It 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 "example" in the present invention should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of the word "example" is intended to present the concept in a specific way. In addition, in the embodiments of the present invention, the meaning expressed by "and / or" can be both, or it can be either of the two.

[0026] In the embodiments of the present invention, "image" and "picture" can sometimes be used interchangeably. It should be noted that when the difference between them is not emphasized, the meanings they intend to express are the same. "of", "corresponding, relevant" and "corresponding" can sometimes be used interchangeably. It should be noted that when the difference between them is not emphasized, the meanings they intend to express are the same.

[0027] In the embodiments of the present invention, sometimes the subscripts such as W 1 It may be written in non-subscript form such as W1. When the difference is not emphasized, the meaning is the same.

[0028] In order to make the technical problems, technical solutions and advantages to be solved by the present invention more clear, 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 multi-agent question-answering interaction efficiency and performance optimization method based on a large model is shown. The processing flow of the method may include the following steps:

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

[0031] Optionally, based on the multi-agent, 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 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;

[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 agent and the first communication graph.

[0035] In a feasible implementation, in a question-answering scenario, MAS usually 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 as to analyze and answer questions from different perspectives.

[0036] These agents can not only independently answer user needs, but also criticize or suggest other agents' views, thus 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 agents can communicate efficiently 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, which is suitable for tasks that require a high degree of coordination; the layer graph restricts the communication path through a hierarchical structure, which is suitable for hierarchical task scenarios; and the random graph provides a flexible and 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 graph 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 discarding.

[0038] Among them, 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.

[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 Agent communication path. is a set of mapping functions used to abstract the reasoning process of the intelligent agent. Each node 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 get the final answer. The communication graph for 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] Subgraph 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 intra-wheel graph weight model, is the intra-round graph weight model of the t-th round communication graph, and is a subset of the inter-round graph weight model, It 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] Using the DAGSample algorithm, resample the first communication graph according to the first graph weight model, and construct the first round of internal graph weight model;

[0045] Calculate the conditional sampling probability of the first communication graph according to the model parameters of the first round of 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, the first round of internal graph weight model is trained for a first preset round to obtain a first gradient estimate;

[0047] According to the first gradient estimation, the first round of internal graph weight model is optimized using the gradient ascent method to obtain the second round of 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 first 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 a feasible implementation, when dealing with various question-and-answer questions, by adjusting the roles involved in the discussion in different rounds, the most relevant contributors in each stage can be focused on to improve team performance. Therefore, the nodes that contribute less 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 of graph weight model . Train the first round of internal graph weight model To obtain an optimized second-round internal graph weight model, in preparation for character node discarding.

[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 a feasible domain of the first communication graph sampling; represents the first optimization objective; Score for performance.

[0056] Since the utility function It depends on 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. We use the Directed Acyclic Graph Sampling Algorithm (DAGSample) to sample M communication graphs and in each graph Run the training samples on to get the performance score , the calculation formula of the first gradient estimate is as follows (2): (2);

[0057] in, represents the gradient, Represents the graph weight model given the current weighted round Under the condition of The conditional sampling probability, the calculation formula of the first conditional sampling probability is as follows (3): (3);

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

[0059] 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 the edges connected to them are removed. The process of obtaining the discarded node set is as follows: (4);

[0060] in, is a function used to return 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 discard rate.

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

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

[0063] Optionally, based on the 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, including:

[0064] Using the DAGSample algorithm, according to the second graph weight model, the second communication graph is resampled, and a second round intra-graph weight model and a second round inter-graph weight model are constructed;

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

[0066] Based on the TopkEdges function, the edge communication efficiency set is obtained by calculating the model parameters of the third round of internal graph weight model;

[0067] According to the edge communication efficiency set, the first 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;

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

[0069] In a feasible implementation, by promoting more focused and efficient interactions between agents, the efficiency of the team as a whole 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.

[0070] 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);

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

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

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

[0074] 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;

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

[0076] 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;

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

[0078] In a feasible implementation, after the role node is discarded, the second round of internal graph weight model is reinitialized. and the second round of 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): (6);

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

[0080] The first stage of training is similar, using the weighted average performance of the samples to approximate the performance expectation. Unlike the first stage of training, and The probability and gradient of the second communication graph are calculated as follows in the second stage of training: (7);

[0081] The second term represents low-rank sparsity, which is used as a proxy indicator for communication efficiency. Since low-rank optimization is a nondeterministic polynomial-time (NP) problem, the present invention uses the nuclear norm to replace the rank function. represents the optimization objective, and its mathematical expression is as follows (8): (8);

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

[0083] S4. Obtain an actual question-answering task. According to the actual question-answering task, use the third graph weight model to perform question-answering reasoning to obtain an actual question-answering reasoning result.

[0084] 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 performance and robustness of MAS while improving its efficiency.

[0085] For tasks performed by a single agent, the present invention is compared with a direct reasoning method (called Vanilla) and a Chain of Thought (CoT) method. In the context of multi-agent collaboration, for methods that communicate only within a round, the present invention compares a single-round dialogue multi-agent system, denoted as MAS_round=1. For methods that communicate within and across rounds, the present invention compares multi-round MAS_round=T and AgentPrune, where rounds represent the number of rounds of cross-round communication between agents. Both agent pruning and agent discarding are optimized based on MAS_round=T, which makes the comparison of these methods more intuitive. The comparison results are shown in Table 1 (Multi-test set score comparison table for agent discarding).

[0086] Table 1

[0087]

[0088] As shown in Table 1, regardless of the model size, the present invention consistently outperforms the single-agent method CoT and the state-of-the-art multi-agent communication method agent pruning in all benchmarks. For example, based on the Llama3 model, the agent dropping of the present invention improves the accuracy by 2.19 compared with the state-of-the-art method. In experiments using Qwen2.5 and Deepseek-V3, the accuracy is improved by 0.77 and 0.47, respectively. These results demonstrate the effectiveness of the present invention.

[0089] The present invention proposes a multi-agent question-answering interaction efficiency and performance optimization method based on a large model. By calculating the degree of the role nodes in the communication graph and discarding the nodes with lower importance, the dynamic adjustment of the roles of the participants in teamwork is simulated to improve efficiency; the matrix parameters are updated using the policy gradient through the training samples, and the edges with low communication within and between rounds are discarded, thereby reducing unnecessary information transmission. The present invention is a multi-agent question-answering interaction efficiency and performance optimization method based on multi-agent roles with high efficiency and good robustness.

[0090] Figure 2 This is a block diagram of a multi-agent question-answering interaction efficiency and performance optimization device based on a large model according to an exemplary embodiment. The device is used for a multi-agent question-answering interaction efficiency and performance optimization method 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. Among them:

[0091] A model building module 210 is used to obtain a training question-answering task and training data; based on a multi-agent, a first communication graph and a first graph weight model are built according to the training question-answering task;

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

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

[0094] The question-answering reasoning module 240 is used to obtain the actual question-answering task; according to 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.

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

[0096] 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;

[0097] 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;

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

[0099] Among them, 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.

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

[0101] Using the DAGSample algorithm, resample the first communication graph according to the first graph weight model, and construct the first round of internal graph weight model;

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

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

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

[0105] 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;

[0106] According to the role node degree set, the first 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;

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

[0108] Optionally, the second model optimization module 230 is further used to:

[0109] Using the DAGSample algorithm, according to the second graph weight model, the second communication graph is resampled, and a second round intra-graph weight model and a second round inter-graph weight model are constructed;

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

[0111] Based on the TopkEdges function, the edge communication efficiency set is obtained by calculating the model parameters of the third round of internal graph weight model;

[0112] According to the edge communication efficiency set, the first 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;

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

[0114] Optionally, the second model optimization module 230 is further used to:

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

[0116] 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;

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

[0118] 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;

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

[0120] The present invention proposes a multi-agent question-answering interaction efficiency and performance optimization method based on a large model. By calculating the degree of the role nodes in the communication graph and discarding the nodes with lower importance, the dynamic adjustment of the roles of the participants in teamwork is simulated to improve efficiency; the matrix parameters are updated using the policy gradient through the training samples, and the edges with low communication within and between rounds are discarded, thereby reducing unnecessary information transmission. The present invention is a multi-agent question-answering interaction efficiency and performance optimization method based on multi-agent roles with high efficiency and good robustness.

[0121] Figure 3 is a schematic diagram of a structure of a multi-agent question-answering interaction efficiency and performance optimization device provided by an embodiment of the present invention, such as 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.

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

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

[0124] Combine the following Figure 3 The components of the multi-agent question-answering interaction efficiency and performance optimization device 310 are specifically introduced:

[0125] 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 processor or a general term for multiple processing elements. For example, the first processor 2001 is one or more central processing units (CPUs), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement an embodiment of the present invention, such as one or more microprocessors (digital signal processors, DSPs), or one or more field programmable gate arrays (field programmable gate arrays, FPGAs).

[0126] 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 a software program stored in the memory 2002 and calling data stored in the memory 2002.

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

[0128] In a specific implementation, as an embodiment, the multi-agent question-answering interaction efficiency and performance optimization device 310 may also include multiple processors, such as Figure 3 The first processor 2001 and the second processor 2004 are shown in FIG. Each of these processors may be a single-core processor (single-CPU) or a multi-core processor (multi-CPU). The processor here may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).

[0129] The memory 2002 is used to store the software program for executing the solution of the present invention, and is controlled to be executed by the first processor 2001. The specific implementation method can refer to the above method embodiment, which will not be repeated here.

[0130] Optionally, the memory 2002 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices 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 compressed optical 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 that can be used to carry or store the 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 may exist independently, and may be 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.

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

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

[0133] Optionally, the transceiver 2003 may be integrated with the first processor 2001, or may exist independently, and communicate with the first processor 2001 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.

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

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

[0136] It should be understood that the first processor 2001 in the embodiment of the present invention may be a central processing unit (CPU), and the processor may also 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. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0137] It should also be understood that the memory in the embodiments of the present invention may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a 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 synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM).

[0138] The above embodiments can be implemented in whole or in part by software, hardware (such as circuits), firmware or any other combination. When implemented by software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. 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 computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a tape), an optical medium (for example, a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state hard disk.

[0139] It should be understood that the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. A and B can be singular or plural. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship, but it may also indicate an "and / or" relationship. Please refer to the context for specific understanding.

[0140] In the present invention, "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 items 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 multiple.

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

[0142] 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. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0143] Those skilled in the art can 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.

[0144] 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 only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, 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 interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0145] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

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

[0147] If the functions are implemented in the form of 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 part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program codes.

[0148] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A method for optimizing the efficiency and performance of multi-agent question-answering interaction based on a large model, characterized in that: The method comprises: Acquire a training question-answering task and training data; construct a first communication graph and a first graph weight model based on the multi-agent and the 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; Based on the 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; Obtain the actual question-answering task; according to the actual question-answering task, use the third graph weight model to perform question-answering reasoning to obtain the actual question-answering reasoning result.

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 and a training question-answering task includes: Based on the large language model and the 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, construct a first communication graph 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 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, characterized in that: The method of performing first-stage optimization training on the first graph weight model based on the first preset round, according to the training data and the first communication graph, using an unbiased policy gradient estimation method to obtain a second graph weight model and a second communication graph includes: Using the DAGSample algorithm, resample the first communication graph according to the first graph weight model, and construct the first round of internal graph weight model; Calculate the conditional sampling probability of the first communication graph according to the model parameters of the first round of 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, the first round of internal graph weight model is trained for a first preset round to obtain a first gradient estimate; According to the first gradient estimation, the first round of internal graph weight model is optimized using the gradient ascent method to obtain the second round of 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 first 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; 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.

5. The method for optimizing the efficiency and performance of multi-agent question-answering interaction based on a large model according to claim 1, characterized in that: The method of performing second-stage optimization training on the second graph weight model based on the second preset round, using the training data and the second communication graph, and using an unbiased policy gradient estimation method to obtain a third graph weight model includes: Using the DAGSample algorithm, according to the second graph weight model, the second communication graph is resampled, and a second round intra-graph weight model and a second round inter-graph weight model are constructed; Based on the second-round internal graph weight model and the second-round inter-graph weight model, according to the training data and the second communication graph, the second-round internal graph weight model is trained for a second preset round to obtain a third-round internal graph weight model; Based on the TopkEdges function, the edge communication efficiency set is obtained by calculating the model parameters of the third round of internal graph weight model; According to the edge communication efficiency set, the first 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; The second graph weight model is optimized according to the discarded edge set to obtain the third graph weight model.

6. The method for optimizing the efficiency and performance of multi-agent question-answering interaction based on a large model according to claim 5 is characterized in that: The method of performing a second preset round of training on the second round of internal graph weight model based on the second round of internal graph weight model and the second round of inter-graph weight model according to the training data and the second communication graph to obtain a third round of internal graph weight model includes: Calculate the conditional sampling probability of the second communication graph according to the model parameters of the second round of 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, the second round of internal graph weight model is trained 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.

7. A multi-agent question-answering interaction efficiency and performance optimization device based on a large model, the multi-agent question-answering interaction efficiency and performance optimization device based on a large model is used to implement the multi-agent question-answering interaction efficiency and performance optimization method based on a large model as described in any one of claims 1-6, characterized in that: The device comprises: A model building module is used to obtain training question-answering tasks and training data; based on multi-agents, a first communication graph and a first graph weight model are built according to the training question-answering tasks; A first model optimization module is used to perform a first-stage optimization training on the first graph weight model based on a first preset round, according to the training data and the first communication graph, using an unbiased policy gradient estimation method to obtain a second graph weight model and a second communication graph; A second model optimization module is used to perform a second-stage optimization training on the second graph weight model based on a second preset round, using the training data and the second communication graph, and using an unbiased policy gradient estimation method to obtain a third graph weight model; The question-answering reasoning module is used to obtain the actual question-answering task; according to 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.

8. The multi-agent question-answering interaction efficiency and performance optimization device based on a large model according to claim 7 is characterized in that: The model building module is further used to: Based on the large language model and the 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, construct a first communication graph 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 agent and the first communication graph.

9. A multi-agent question-answering interaction efficiency and performance optimization device, 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 6 is implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program codes, 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 reinforcement learning cooperation method based on dynamic graph communication

    CN116306966A

  • Decentralized policy gradient descent and ascent for safe multi-agent reinforcement learning

    US20230113168A1

Cited By

  • Multi-agent system initialization method and device oriented to large question and answer model

    CN120492600A

  • A multi-agent system initialization method and device for question-answering large models

    CN120492600B

  • Multi-agent question-answer interaction efficiency and performance optimization method based on large model

    CN121125676A