A multi-agent system token consumption optimization method, system and device

By introducing marginal information gain and probabilistic early stopping criteria into a multi-agent system, the number of speaking rounds for agents is optimized, solving the problem of excessive token consumption in traditional methods and achieving adaptive token optimization and resource saving under different task scenarios.

CN120951616BActive Publication Date: 2026-03-20INSPUR GENERSOFT CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-16
Publication Date
2026-03-20

AI Technical Summary

Technical Problem

When multi-agent systems face cross-domain, multi-step, and tightly coupled tasks, token consumption increases exponentially. Traditional fixed dialogue rounds and fixed-round sliding window methods cannot adapt to different task difficulties and the number of agents, resulting in token waste or a decrease in task success rate.

Method used

By defining marginal information gain, a probabilistic early stopping criterion and optimal allocation strategy are designed to optimize the interaction of multi-agent systems. A joint probabilistic early stopping criterion and a budget-aware intelligent routing method are adopted to dynamically adjust the number of speaking rounds of agents to minimize token consumption.

Benefits of technology

While ensuring task success rate, it significantly reduces the token consumption of multi-agent systems, implements an adaptive token usage strategy, and reduces redundant speech and token waste.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120951616B_ABST
    Figure CN120951616B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of multi-agent system, and provides a multi-agent system token consumption optimization method, system and device.The multi-agent system token consumption optimization method comprises the following steps: in each round of speech, the independent task success probability of each agent and the task success joint probability of the multi-agent system are calculated; according to the task success joint probability of the multi-agent system, the marginal benefit of the multi-agent system in adjacent two rounds of speech is calculated; according to the ratio of the marginal benefit of the multi-agent system in adjacent two rounds of speech to the token consumption of each agent in the current round of speech, it is judged whether each agent meets the early stop condition, if yes, early stop is triggered, and the agent speech is stopped; otherwise, it is judged whether the remaining agents meet the early stop condition in the next round of speech, until all agents in the multi-agent system stop speaking.Under the same task success rate constraint, the token consumption is significantly reduced.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of Multi-Agent Systems and Large Language Model (LLM) based collaborative reasoning, and in particular to a Multi-Agent System token consumption optimization method, system and device. BACKGROUND

[0002] The statements in this section merely provide background information related to the present application and do not necessarily constitute the prior art.

[0003] With the increasing complexity of information system processing tasks, single agents have shown a bottleneck in the face of cross-domain, multi-step, and strongly coupled tasks. Multi-Agent Collaborative System can significantly improve the completion rate, robustness and system adaptability of complex tasks by integrating the professional capabilities, knowledge structures and reasoning capabilities of each agent, and through the collaboration mechanism between agents. However, with the expansion of system size and the frequent interaction of agents, token consumption grows exponentially, resulting in a significant increase in computing power costs, which restricts the practical application of Multi-Agent System.

[0004] Currently, there are two main methods for optimizing token consumption in Multi-Agent System. The first method is to set a fixed number of dialogue rounds. In a Multi-Agent interaction system, the number of dialogue rounds for each agent is set to a fixed value. That is, when the number of dialogue rounds for each agent reaches a specified number, the task is completed. In the autogen framework released by Microsoft, the maximum number of dialogue rounds is used to limit the termination of Multi-Agent tasks without human intervention. The second method is to limit the context using a fixed number of sliding window. That is, when an agent inputs, the agent references early information from a fixed number of rounds. In the langgraph framework, a fixed number of context is used to limit the input token.

[0005] However, the method of fixed dialogue rounds cannot adaptively adjust to different task difficulties and different numbers of agents. For example, using excessive iterations for simple tasks can result in a large number of invalid iterations, i.e., no success rate gain in subsequent iterations, resulting in token waste. In addition, the dialogue of different agents cannot be evaluated in terms of the size of the success rate gain, resulting in continuous dialogue of low-quality agents and waste of token quantity. The method of limiting context using a fixed number of sliding window can reduce token consumption, but the number of rounds is fixed. If the output needs to use early information, important context may be lost, resulting in a decrease in task success rate. SUMMARY

[0006] To solve the technical problems in the background art, the present application provides a multi-agent system token consumption optimization method, system and device. In multi-agent interaction, the present application defines marginal information gain, designs a probabilistic early stop criterion and an optimal allocation strategy, optimizes multi-agent system interaction, and minimizes the number of tokens consumed by the system to complete a given task under a given overall success probability (task performance constraint).

[0007] To achieve the above-mentioned purposes, the present application adopts the following technical solutions:

[0008] The first aspect of the present application provides a multi-agent system token consumption optimization method.

[0009] A multi-agent system token consumption optimization method comprises:

[0010] A multi-agent system is established, which comprises a plurality of agents, each of which independently completes a task in a target task queue;

[0011] In each round of speech, the independent task success probability of each agent and the task success joint probability of the multi-agent system are calculated; according to the task success joint probability of the multi-agent system, the marginal benefit of the multi-agent system in adjacent two rounds of speech is calculated;

[0012] According to the ratio of the marginal benefit of the multi-agent system in adjacent two rounds of speech to the token consumption of each agent in the current round of speech, it is judged whether each agent meets the early stop condition, if yes, the early stop is triggered and the agent speech is stopped; otherwise, it is judged whether the remaining agents meet the early stop condition in the next round of speech, until all agents in the multi-agent system stop speaking and complete the target task queue.

[0013] Further, the independent task success probability of each agent is represented by the following formula:

[0014]

[0015] wherein, represents the cumulative speech round number of the agent ; represents the probability of independent contribution to task success after rounds of speech of the agent ; represents the capability parameter of the agent , reflecting the information contribution strength of the agent per round, the greater the capability parameter, the stronger the capability; with the increase of the speech round , the information amount As the probability of success accumulates, it gradually increases and eventually reaches saturation, which conforms to the law of diminishing marginal returns.

[0016] Furthermore, the capability parameters are expressed using the following formula:

[0017]

[0018] in, Indicates capability parameters; Indicates the cumulative number of speaking rounds; This represents the observed probability of a task succeeding during round T of speaking.

[0019] Furthermore, the joint probability of task success of the multi-agent system is expressed by the following formula:

[0020]

[0021] in, This represents the joint probability of a successful task in a multi-agent system. Indicates the first Each intelligent agent completes The probability of success of an independent task after a turn of speech; Indicates the number of intelligent agents; This represents an aggregation function that maps the independent task success probabilities of each agent to the overall task success probability.

[0022] Furthermore, during the process of the multi-agent system processing the target task queue, while ensuring that the success probability of the multi-agent system in task collaboration is not lower than a preset threshold, the expected total token consumption is minimized.

[0023]

[0024]

[0025] in, Indicates the first The number of speaking rounds per agent; This represents the expected total token consumption; This indicates the total token consumption of the system; This represents the joint probability of a successful task in a multi-agent system. This indicates a preset threshold.

[0026] Furthermore, the marginal benefit of the multi-agent system in two adjacent rounds of speaking is the difference between the joint probability of task success of the multi-agent system in the current round of speaking and the joint probability of task success of the multi-agent system in the previous round of speaking.

[0027] Further, the method comprises: judging whether each agent meets an early stop condition; the early stop condition is that a ratio of marginal revenue of the multi-agent system in adjacent two rounds of speaking to token consumption of each agent in a current round of speaking is less than an early stop threshold.

[0028] Further, if an agent early stops, in subsequent speaking, an independent task success probability of the agent is an independent task success probability of the agent in a round in which the agent early stops.

[0029] The second aspect of the present application provides a multi-agent system token consumption optimization system.

[0030] The multi-agent system token consumption optimization system comprises:

[0031] A multi-agent system establishment module configured to: establish a multi-agent system, the multi-agent system comprising a plurality of agents, each agent independently completing a task in a target task queue;

[0032] A data calculation module configured to: in each round of speaking, calculate an independent task success probability of each agent and a task success joint probability of the multi-agent system; and according to the task success joint probability of the multi-agent system, calculate marginal revenue of the multi-agent system in adjacent two rounds of speaking.

[0033] An early stop judgment module configured to: according to a ratio of marginal revenue of the multi-agent system in adjacent two rounds of speaking to token consumption of each agent in a current round of speaking, judge whether each agent meets an early stop condition; if yes, trigger early stop and stop the agent from speaking; otherwise, continue to judge whether the remaining agents meet the early stop condition in a next round of speaking until all agents in the multi-agent system stop speaking and complete the target task queue.

[0034] The third aspect of the present application provides a computer device, which comprises:

[0035] A processor adapted to execute a computer program;

[0036] A computer readable storage medium, the computer readable storage medium storing the computer program, the computer program being executed by the processor to implement steps in the multi-agent system token consumption optimization method according to the first aspect.

[0037] Compared with the prior art, the present application has the following beneficial effects:

[0038] The application adopts a joint probability early stopping criterion based on a marginal success rate gain and a token cost ratio, and determines whether the task is terminated based on the probability determination and the success rate contribution measure.

[0039] The application adopts a budget-aware intelligent routing method, minimizes the expected token consumption by optimizing the speaking round number of each agent under the premise of meeting the overall success rate of the task, and integrates the task constraints and cost optimization into an unified optimization problem.

[0040] The application combines the joint probability early stopping criterion and the budget-aware intelligent routing method, and significantly reduces the token consumption of the multi-agent system under the same task success rate (or allowed performance loss) constraint. BRIEF DESCRIPTION OF DRAWINGS

[0041] The drawings constituting a part of the specification of the application are used to provide a further understanding of the application, and the illustrative embodiments of the application and the description thereof are used to explain the application, and do not constitute an improper limitation on the application.

[0042] Figure 1 is a flowchart of the multi-agent system token consumption optimization method according to an embodiment of the application;

[0043] Figure 2 is a flowchart of another embodiment of the multi-agent system token consumption optimization method according to an embodiment of the application;

[0044] Figure 3 is a structural diagram of the multi-agent system token consumption optimization system according to an embodiment of the application;

[0045] Figure 4 is a structural diagram of the computer device according to an embodiment of the application. DETAILED DESCRIPTION

[0046] The application will be further described below in combination with the drawings and embodiments.

[0047] It should be noted that the following detailed description is illustrative only, and is intended to provide further description in order to provide a thorough understanding of the present application. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the application pertains.

[0048] It is to be understood that the terminology used herein is for purpose of describing the particular embodiments only and is not intended to be limiting of the example embodiments in accordance with the present application. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and / or "comprising," when used in this specification, specify the presence of stated features, steps, operations, elements, components, and / or groups thereof, but do not preclude the presence or addition of one or more other features, steps, operations, elements, components, and / or groups thereof.

[0049] As introduced in the background, in the multi-agent system, with the increase of the number of agents and the frequent interaction between them, a large number of tokens are consumed. Further, the cost of computing power rises sharply. The main reasons include three aspects: (1) the number of dialogue rounds is not limited or unreasonable, which leads to linear or super-linear growth of tokens; (2) the reasoning without budget awareness leads to the use of too many rounds and steps for simple tasks; (3) the routing decision (who speaks, who stops) lacks global optimization. At present, the optimization of token consumption in the multi-agent system in the industry mainly includes fixed dialogue round number and fixed context sliding window size. These two methods cannot optimize the token consumption under the condition of meeting the task success rate. The main reason is that the fixed dialogue round number cannot adapt to the task difficulty and cannot evaluate the difference in agent capability. It leads to the use of too many rounds and steps for simple tasks, and the number of speeches between different agents lacks global optimization, thereby increasing the token consumption. The fixed context window cannot adaptively select the importance of the context, which may lead to the loss of early key information, thereby affecting the task success rate.

[0050] In order to solve the above problems, the present application provides a multi-agent system token consumption optimization method, system and device, and the specific implementation process of the present application is described in detail through several embodiments.

[0051] Figure 1 is a flowchart of the multi-agent system token consumption optimization method according to the embodiments of the present application; referring to Figure 1 The method comprises:

[0052] A multi-agent system is established, and the multi-agent system comprises a plurality of agents, and each agent independently completes a task in a target task queue;

[0053] In each round of speech, the independent task success probability of each agent and the task success joint probability of the multi-agent system are calculated; according to the task success joint probability of the multi-agent system, the marginal benefit of the multi-agent system in adjacent two rounds of speech is calculated;

[0054] According to the ratio of the marginal benefit of the multi-agent system in adjacent two rounds of speech to the token consumption of each agent in the current round of speech, it is judged whether each agent meets the early stop condition, if yes, the early stop is triggered, and the agent stops speaking, otherwise, it is judged whether the remaining agents meet the early stop condition in the next round of speech, until all agents in the multi-agent system stop speaking and complete the target task queue.

[0055] The present application proposes a joint budget-aware router of a probability early stop strategy. The multi-agent speech, round control and task success probability are modeled as a joint random decision problem. By defining marginal information gain, a probability early stop criterion and an optimal allocation strategy are designed, so that the expected token consumption of the system reaches the minimum under the given overall success probability (task performance constraint). Figure 2 is the flow chart of another embodiment of the multi-agent system token consumption optimization method shown in the embodiment of the present application; refer to Figure 2 , the detailed technical solutions are as follows.

[0056] In the multi-agent cooperative system, multiple agents need to communicate constantly, and frequent information interaction will consume a large amount of tokens. However, in the multi-agent system, the contribution of each agent to the task success rate is different, and if the speech of some agents contributes little to the task success rate, it will waste tokens to continue speaking. Therefore, the present application designs a joint perception probability early stop mechanism. Under the premise of ensuring that the task completion rate is high enough, the interaction allocation between multiple agents is optimized, and the token consumption is reduced.

[0057] Step 1: multi-agent system parameter initialization.

[0058] The ability parameters, early stop threshold, fixed number of rounds and task success rate threshold of multiple agents are set.

[0059] Step 2: single-agent independent task success probability calculation.

[0060] In the present model, the information benefit is embodied as the contribution to the task success rate. The cumulative gain model in information theory is used to fit the independent task success probability of a single agent:

[0061]

[0062] Wherein, represents the cumulative speech round number of the agent . represents the probability of success of the task after the agent speaks in T rounds. represents the probability of success of the task after the agent speaks in T rounds. represents the capability parameter, reflecting the information contribution strength of the agent in each round, The larger the capability parameter, the stronger the capability. As the speaking round increases, the amount of information accumulates, the success probability gradually increases and tends to saturation, conforming to the law of diminishing marginal returns.

[0063] The estimation method of the capability parameter is as follows:

[0064] Through observation of experimental data (i.e. the observed probability of success of the task under T speaking rounds), the least squares method is used to fit the optimal parameter :

[0065]

[0066] Solving the optimization problem can obtain the optimal estimate , so that the theoretical curve approximates the observed data to the greatest extent. Thus we get:

[0067]

[0068] The derivation process is as follows:

[0069]

[0070] Taking the logarithm of both sides, we get:

[0071]

[0072] Let

[0073] Then we get:

[0074]

[0075] The goal is to minimize the difference between the observed value and the fitted value, i.e. to minimize the following formula:

[0076]

[0077] where represents the difference; represents the observed value; represents the fitted value. Taking the derivative of and setting it to 0, we get:

[0078]

[0079] We can get:

[0080]

[0081] in: Further simplification yields:

[0082] .

[0083] Step 3: Calculate the joint probability of successful multi-agent task.

[0084] Define the overall probability of task success:

[0085]

[0086] in, This represents the joint probability of a successful task in a multi-agent system. Indicates the first Each intelligent agent completes The probability of success of an independent task after a turn of speech; This represents an aggregation function that maps the success probability of each agent to the overall task success probability (such as a joint probability model).

[0087] Assume there is An intelligent agent, an intelligent agent The number of tokens consumed for speaking is The number of rounds of speaking is The total token consumption of the system is:

[0088]

[0089] in, This represents the total token consumption of the system.

[0090] To ensure that the success rate of the task is not lower than a preset threshold Under the premise of minimizing the expected total token consumption:

[0091]

[0092]

[0093] in, This represents the expected total token consumption.

[0094] Step 4: Calculate the marginal revenue per unit token for a single agent.

[0095] Each agent in the first... The information benefit generated by each round of speaking is defined as:

[0096]

[0097] wherein, represents an agent In the first round, the information gain is the information benefit. represents an agent In the first round, the output is the information benefit. represents the information value metric function, such as the task target promotion degree.

[0098] Define the agent In the first round, the marginal information gain is:

[0099]

[0100] wherein, represents an agent In the first round, the marginal information gain is:

[0101] In the present invention, the information benefit is the success rate. Therefore, the marginal information gain is:

[0102]

[0103] The formula indicates that if the agent speaks one more round, the overall task success rate is expected to be improved.

[0104] The present invention is based on the principle of diminishing marginal returns in information theory to model the success rate of a single agent, and to quantify the marginal information contribution of a single agent by least squares fitting of the modeling parameters.

[0105] Step 5: Comparison of the marginal return per token of a single agent with the early stop threshold.

[0106] When the additional speech of the agent brings too low a return per token, stop it from speaking further to avoid excessive waste of resources. The early stop criterion defined in the present invention is as follows.

[0107]

[0108] wherein, represents the marginal information gain of the first round of speech on the task success rate; represents the number of tokens consumed by the speech in this round. represents the early stop threshold, i.e. the minimum success rate gain per unit token. Wherein is set to 0.00003, which can be fine-tuned according to the task.

[0109] Step 6: If the marginal return per unit token for a single agent is less than the early stop threshold, early stop is triggered, and speaking is stopped.

[0110] Step 7: If the multi-agent system stops early, the task is complete.

[0111] This invention employs a joint probabilistic early stopping criterion, which solves the problem that traditional fixed dialogue rounds strategies cannot adapt to different task complexities, and achieves adaptive token consumption optimization in different task scenarios.

[0112] To verify the technical solution of this invention, a specific example is used below for illustration. Taking a content search task as an example, three parallel search agents are set up in the task: Agent 1, Agent 2, and Agent 3.

[0113] Step 1: Set the parameters. The capability parameters of the three agents are 0.7, 0.6, and 0.4 respectively (these capability parameters are obtained from the estimation method in Step 2 above regarding information gains); the early stopping threshold is set to 0.00003. The default value for the fixed number of rounds is 5. The task success rate threshold is 0.9.

[0114] Step 2: In the first round, the token costs for the three agents were 348, 625, and 597 respectively. Calculate the independent task success rates for the three agents as follows:

[0115]

[0116]

[0117]

[0118] in, This represents the success rate of the first agent's independent task in the first round; This represents the success rate of the independent task of the second agent in the first round; This represents the success rate of the independent task of the third agent in the first round.

[0119] Step 3: Calculate the joint probability of the three agents successfully completing the task.

[0120]

[0121] in, This represents the joint probability of the three agents successfully completing the task in the first round.

[0122] Step 4: In the second round, the token costs for the three agents were 627, 724, and 836 respectively. Calculate the independent task success rates for the three agents as follows:

[0123]

[0124]

[0125]

[0126] where, represents the independent task success rate of the first agent in the second round; represents the independent task success rate of the second agent in the second round; represents the independent task success rate of the third agent in the second round.

[0127] Step 5: Calculate the joint probability of task success of the three agents.

[0128]

[0129] where, represents the joint probability of task success of the three agents in the second round.

[0130] Step 6: Calculate the marginal revenue per unit token of each agent in the second round, and determine whether it is less than the early stop threshold.

[0131] (not meet early stop)

[0132] (not meet early stop)

[0133] (not meet early stop)

[0134] where, represents the difference between the joint probability of task success of the three agents in the second round and the joint probability of task success of the three agents in the first round; 、 、 represents the token consumption of the three agents in the second round.

[0135] Step 7: The token consumption of the three agents in the third round is 849, 927, and 1135 respectively. Calculate the independent task success rate of the three agents.

[0136]

[0137]

[0138]

[0139] where, represents the independent task success rate of the first agent in the third round; represents the independent task success rate of the second agent in the third round; P (success | A3) represents the success probability of the third agent in the third round.

[0140] Step 8: Calculate the joint probability of success of the three agents in the third round.

[0141]

[0142] where, P (success | A3) represents the joint probability of success of the three agents in the third round.

[0143] Step 9: Calculate the marginal benefit per token of each agent in the third round, and determine whether it is less than the early stopping threshold.

[0144] (not meet early stop)

[0145] (meet early stop)

[0146] (meet early stop)

[0147] where, P (success | A3) represents the difference between the joint probability of success of the three agents in the third round and the joint probability of success of the three agents in the second round; , , P (success | A3) represents the token consumption of the three agents in the third round.

[0148] Step 10: The token consumption of each agent in the fourth round is 938, 1136, and 1367. Calculate the token consumption of the first agent.

[0149]

[0150]

[0151]

[0152] where, P (success | A3) represents the success probability of the first agent in the fourth round.

[0153] Step 11: Calculate the success probability.

[0154]

[0155] where, P (success | A3) represents the joint probability of success of the three agents in the fourth round.

[0156] Step 12: Calculate the marginal benefit per token of each agent in the fourth round, and determine whether it is less than the early stopping threshold.

[0157] (satisfy early stop)

[0158] wherein, represents the difference between the joint probability of success of the task of the three agents in the fourth round and the joint probability of success of the task of the three agents in the third round; represents the token consumption of the first agent in the fourth round.

[0159] Thirteenth step: the token consumption of each agent in the fifth round is 1127, 1365 and 1524 respectively. The total number of tokens consumed by the early stop mechanism is 7606, and the total number of tokens consumed by the fixed number of rounds is 14125. The token of the early stop mechanism is reduced by 46.2%. The real success rate of the early stop mechanism is 92.6%, and the real success rate of the fixed number of rounds is 93.1%. The success rate of the early stop mechanism is slightly lower than that of the fixed number of rounds, but the token amount is greatly reduced.

[0160] In the experiment of the present application, qwen3-max-preview is selected as a large language model, AutoGen is selected as a multi-agent collaboration framework, and the task success rate threshold is set to 90%. The comparison between the early stop mechanism and the fixed number of rounds is shown in Table 1.

[0161] Table 1 Comparison of technical indexes of different methods of multi-agent collaboration

[0162]

[0163] As shown in Table 1, in a typical multi-agent collaboration task, the probability early stop method proposed in the present application greatly reduces the token consumption amount under the condition of ensuring the task success rate, and the average saving ratio reaches 38.05%, and the success rate is close to that of the fixed number of rounds. The results fully prove that the present application realizes a better balance between resource efficiency and task performance.

[0164] The above Figure 1 The multi-agent system token consumption optimization method provided by the embodiment of the present application is described in detail, and next, the multi-agent system token consumption optimization system provided by the embodiment of the present application will be introduced in combination with the drawings.

[0165] Figure 3 is a structural schematic diagram of the multi-agent system token consumption optimization system shown in the embodiment of the present application, with reference to Figure 3 The system described in the present application comprises:

[0166] The multi-agent system establishment module is configured to establish a multi-agent system, wherein the multi-agent system comprises a plurality of agents, and each agent independently completes a task in a target task queue;

[0167] The data calculation module is configured to: calculate the independent task success probability of each agent and the joint task success probability of the multi-agent system in each round of speech; and calculate the marginal benefit of the multi-agent system in two adjacent rounds of speech based on the joint task success probability of the multi-agent system.

[0168] The early stop judgment module is configured to: determine whether each agent meets the early stop condition based on the ratio of the marginal revenue of the multi-agent system in two adjacent rounds of speech to the token consumption of each agent in the current round of speech; if so, trigger early stop and stop the agent from speaking; otherwise, continue to judge whether the other agents meet the early stop condition in the next round of speech, until all agents in the multi-agent system stop speaking and the target task queue is completed.

[0169] In some embodiments, the independent task success probability of each agent is expressed by the following formula:

[0170]

[0171] in, Represents intelligent agents The cumulative number of speaking rounds; Represents intelligent agents go through After each round of speaking, the probability of independently facilitating the success of the task; Represents intelligent agents The capability parameters reflect the information contribution intensity of the agent per round. The larger the value, the stronger the ability; with each round of speaking... Increase, amount of information As the probability of success accumulates, it gradually increases and eventually reaches saturation, which conforms to the law of diminishing marginal returns.

[0172] In some embodiments, the capability parameter is expressed by the following formula:

[0173]

[0174] in, Indicates capability parameters; Indicates the cumulative number of speaking rounds; This represents the observed probability of a task succeeding during round T of speaking.

[0175] In some embodiments, the joint probability of task success of the multi-agent system is expressed by the following formula:

[0176]

[0177] in, a joint probability of success of a task of the multi-agent system; an independent probability of success of a task of the a number of agents; an aggregation function mapping the independent probabilities of success of a task of the agents to the joint probability of success of a task of the multi-agent system.

[0178] In some embodiments, during processing of the target task queue by the multi-agent system, an expectation of total token consumption is minimized while ensuring that the joint probability of success of a task of the multi-agent system is not less than a preset threshold.

[0179]

[0180]

[0181] wherein, a number of turns of speaking of the an expectation of total token consumption; a total token consumption of the system; a joint probability of success of a task of the multi-agent system; a preset threshold.

[0182] In some embodiments, the marginal gain of the multi-agent system in the two adjacent turns of speaking is a difference between the joint probability of success of a task of the multi-agent system in the current turn of speaking and the joint probability of success of a task of the multi-agent system in the previous turn of speaking.

[0183] In some embodiments, the determining whether each agent satisfies an early stopping condition comprises: determining whether a ratio of the marginal gain of the multi-agent system in the two adjacent turns of speaking to a token consumption amount of each agent in the current turn of speaking is less than an early stopping threshold.

[0184] In some embodiments, if an agent is early stopped, the independent probability of success of a task of the agent in the subsequent turns of speaking is the independent probability of success of a task of the agent in the turn in which the agent is early stopped.

[0185] The multi-agent system token consumption optimization system according to the embodiments of the present application can correspond to the method described in the embodiments of the present application, and the above and other operations and / or functions of each module of the multi-agent system token consumption optimization system are respectively for realizing the corresponding procedures of each method in Figure 1 For brevity, they will not be described here.

[0186] Referring to Figure 4 ​​​A structural diagram of a computer device is shown, the computer device including a processor, a communication interface, and a computer readable storage medium. The processor, the communication interface, and the computer readable storage medium are connected through a bus or other manners. The communication interface is configured to receive and send data. The computer readable storage medium can be stored in a memory of the computer device, and the computer readable storage medium is configured to store a computer program including program instructions, and the processor is configured to execute the program instructions stored in the computer readable storage medium. The processor (or CPU (Central Processing Unit)) is a computing core and a control core of the computer device, and is adapted to implement one or more instructions, and is specifically adapted to load and execute one or more instructions to implement corresponding steps in the multi-agent system token consumption optimization method embodiment.

[0187] Those skilled in the art will understand that embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can take the form of hardware embodiments, software embodiments, or embodiments combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer usable storage media (including, but not limited to, disk storage and optical storage, etc.) containing computer usable program code.

[0188] The present application is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing apparatus to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing apparatus generate a means for implementing the functions specified in the flowcharts and / or block diagrams. Figure 1 one or more flows and / or blocks Figure 1 an apparatus that performs the functions specified in one or more blocks or flows.

[0189] These computer program instructions can also be stored in a computer readable storage medium that can direct the computer or other programmable data processing apparatus to work in a specific manner, so that the instructions stored in the computer readable storage medium produce a product including instruction apparatus, which implements the functions specified in the flowcharts and / or block diagrams. Figure 1 one or more flows and / or blocks Figure 1 an apparatus that performs the functions specified in one or more blocks or flows.

[0190] These computer program instructions can also be loaded into a computer or other programmable data processing device, so that a series of operational steps are performed on the computer or other programmable data processing device to generate a computer-implemented process, thus the instructions executed on the computer or other programmable data processing device provide the function of implementing the processes specified in the flowchart Figure 1 one flow or multiple flows and / or the functions specified in the block Figure 1 one flow or multiple flows and / or the functions specified in the block

[0191] Those of ordinary skill in the art can understand that all or part of the flow of the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the flow of the above-mentioned embodiment of each method. The storage medium can be a magnetic disc, an optical disc, a read-only memory (ROM), a random access memory (RAM), etc.

[0192] The above only describes the preferred embodiments of the present application and is not intended to limit the present application. For those skilled in the art, the present application can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A method for optimizing token consumption in a multi-agent system, characterized in that, include: A multi-agent system is established, comprising multiple agents, each independently completing tasks in a target task queue; the target task queue includes specific tasks in the fields of report generation, intelligent operation and maintenance, and content search in the computer technology field. In each round of speaking, the independent task success probability of each agent and the joint task success probability of the multi-agent system are calculated; based on the joint task success probability of the multi-agent system, the marginal reward of the multi-agent system in adjacent rounds of speaking is calculated. Based on the ratio of the marginal revenue of the multi-agent system in two adjacent rounds of speech to the token consumption of each agent in the current round of speech, determine whether each agent meets the early stop condition. If so, trigger early stop and stop the agent from speaking; otherwise, continue to determine whether the other agents in the next round of speech meet the early stop condition, until all agents in the multi-agent system stop speaking and the target task queue is completed. The probability of success of each agent's independent task is expressed by the following formula: in, Represents intelligent agents The cumulative number of speaking rounds; Represents intelligent agents go through After each round of speaking, the probability of independently facilitating the success of the task; Represents intelligent agents The capability parameters reflect the information contribution intensity of the agent per round. The larger the value, the stronger the ability; with each round of speaking... Increase, amount of information As the probability of success accumulates, it gradually increases and then tends to saturate, which conforms to the law of diminishing marginal returns. The capability parameters are expressed using the following formula: in, Indicates capability parameters; Indicates the cumulative number of speaking rounds; This represents the observed probability of task success during round T of speaking; During the process of the multi-agent system processing the target task queue, while ensuring that the success probability of the multi-agent system in task collaboration is not lower than a preset threshold, the expected total token consumption is minimized. in, Indicates the first The number of speaking rounds per agent; This represents the expected total token consumption; This indicates the total token consumption of the system; This represents the joint probability of a successful task in a multi-agent system. This indicates a preset threshold.

2. The method for optimizing token consumption in a multi-agent system according to claim 1, characterized in that, The joint probability of task success in the multi-agent system is expressed by the following formula: in, This represents the joint probability of a successful task in a multi-agent system. Indicates the first Each intelligent agent completes The probability of success of an independent task after a turn of speech; Indicates the number of agents; This represents an aggregation function that maps the independent task success probabilities of each agent to the overall task success probability.

3. The method for optimizing token consumption in a multi-agent system according to claim 1, characterized in that, The marginal benefit of the multi-agent system in two adjacent rounds of speaking is the difference between the joint probability of task success of the multi-agent system in the current round of speaking and the joint probability of task success of the multi-agent system in the previous round of speaking.

4. The method for optimizing token consumption in a multi-agent system according to claim 1, characterized in that, The method for determining whether each agent meets the early stopping condition includes: determining whether the ratio of the marginal revenue of the multi-agent system in two adjacent rounds of speech to the token consumption of each agent in the current round of speech is less than the early stopping threshold.

5. The method for optimizing token consumption in a multi-agent system according to claim 1, characterized in that, If an agent stops early, then in subsequent speeches, the probability of success of that agent's independent task is the same as the probability of success of the independent task in the round in which the agent stopped early.

6. A token consumption optimization system for multi-agent systems, characterized in that, include: A multi-agent system establishment module is configured to: establish a multi-agent system, which includes multiple agents, each agent independently completing tasks in a target task queue; the target task queue includes specific tasks in the fields of report generation, intelligent operation and maintenance, and content search in the field of computer technology. The data calculation module is configured to: calculate the independent task success probability of each agent and the joint task success probability of the multi-agent system in each round of speech; and calculate the marginal benefit of the multi-agent system in two adjacent rounds of speech based on the joint task success probability of the multi-agent system. The early stop judgment module is configured to: determine whether each agent meets the early stop condition based on the ratio of the marginal benefit of the multi-agent system in two adjacent rounds of speech to the token consumption of each agent in the current round of speech; if so, trigger early stop and stop the agent from speaking; otherwise, continue to judge whether the other agents meet the early stop condition in the next round of speech, until all agents in the multi-agent system stop speaking and the target task queue is completed. The probability of success of each agent's independent task is expressed by the following formula: in, Represents intelligent agents The cumulative number of speaking rounds; Represents intelligent agents go through After each round of speaking, the probability of independently facilitating the success of the task; Represents intelligent agents The capability parameters reflect the information contribution intensity of the agent per round. The larger the value, the stronger the ability; with each round of speaking... Increase, amount of information As the probability of success accumulates, it gradually increases and then tends to saturate, which conforms to the law of diminishing marginal returns. The capability parameters are expressed using the following formula: in, Indicates capability parameters; Indicates the cumulative number of speaking rounds; This represents the observed probability of task success during round T of speaking; During the process of the multi-agent system processing the target task queue, while ensuring that the success probability of the multi-agent system in task collaboration is not lower than a preset threshold, the expected total token consumption is minimized. in, Indicates the first The number of speaking rounds per agent; This represents the expected total token consumption; This indicates the total token consumption of the system; This represents the joint probability of a successful task in a multi-agent system. This indicates a preset threshold.

7. A computer device, characterized in that, A processor, adapted to execute computer programs; A computer-readable storage medium storing a computer program, which, when executed by the processor, implements the steps in the multi-agent system token consumption optimization method as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Automatic application program control method based on visual language large model agent

    CN120215768A

  • Method and system for optimizing performance of multi-agent system and medium

    CN120494091A