A multi-agent collaboration method based on a large language model

By constructing a multi-agent coordinated resource allocation model and an improved particle swarm algorithm, the problems of uncertainty accumulation and unbalanced resource allocation in large language model multi-agent collaborative systems are solved, and dynamic adaptation of task allocation and improvement of the reliability and efficiency of results are achieved.

CN120338035BActive Publication Date: 2025-09-05北京长河数智科技有限责任公司 +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510827689.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-20
Publication Date
2025-09-05
Estimated Expiration
2045-06-20

AI Technical Summary

Technical Problem

Existing large language model multi-agent collaborative systems suffer from problems of uncertainty accumulation and unbalanced resource allocation in complex tasks, resulting in reduced result reliability and insufficient system performance.

Method used

A multi-agent coordinated resource allocation model is constructed, task allocation is performed through an improved particle swarm algorithm, uncertainty perception mechanism and multi-agent cross-validation are introduced, and the task allocation strategy is optimized to adapt to the dynamic environment.

Benefits of technology

It improves the reasoning quality and efficiency of multi-agent systems in complex tasks, ensuring the reliability of results and the balance of resource utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120338035B_ABST
    Figure CN120338035B_ABST
Patent Text Reader

Abstract

The present application discloses a multi-agent collaboration method based on a large language model, which relates to the field of collaborative control of intelligent agents, including: constructing a multi-agent system; establishing a multi-agent coordinated resource allocation model; converting the task allocation problem in the resource allocation model into a multi-objective optimization problem, where the optimization objectives include minimizing the task completion time and optimizing resource utilization; using an improved particle swarm algorithm (PSO) to solve the multi-objective optimization problem and obtain the optimal collaboration solution between the master intelligent agent, the task creation intelligent agent, the intention orchestration intelligent agent, and at least one professional intelligent agent. The improved particle swarm algorithm (PSO) evaluates the uncertainty of each candidate solution through multiple random samplings, and when the uncertainty exceeds a threshold, cross-validation is performed through a multi-agent voting mechanism. In response to the uncertainty accumulation of multi-agent systems under complex cognitive tasks, the present application improves the efficiency and stability of collaborative decision-making and task scheduling of multi-agent systems.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of intelligent agent collaborative control, and in particular to a multi-agent collaborative method based on a large language model. Background Art

[0002] With the rapid development of artificial intelligence (AI), large language models (LLMs), with their powerful natural language understanding and generation capabilities, have become a core technology driving intelligent applications. To address the limitations of single large language models in handling complex tasks, multi-agent collaborative systems have emerged. By organizing agents with different functions into a collaborative working model, multi-agent systems can handle more complex cognitive tasks, significantly expanding the application boundaries of large language models.

[0003] Such systems have been widely used in fields such as intelligent finance, medical diagnosis, scientific research, and complex decision support. For example, in intelligent financial risk assessment, the system must simultaneously analyze multi-dimensional information, including corporate financial statements, industry risks, credit history, and market prospects, and comprehensively integrate these factors to make accurate risk assessments. This exceeds the processing capabilities of a single model and requires the collaborative work of multiple intelligent agents.

[0004] However, existing large language model multi-agent collaboration technologies have significant shortcomings, primarily manifested in the following aspects: First, the reasoning process of large language models is inherently uncertain. When multiple agents collaborate serially according to a specific process, the uncertainty of the previous agent is transmitted and amplified to subsequent agents, resulting in a significant decrease in the reliability of the final result. For example, in financial risk assessment, if the financial analysis agent's interpretation of certain financial indicators is biased, this bias will affect the judgment of subsequent industry risk assessment agents and ultimately lead to erroneous credit decisions. Second, traditional multi-agent systems typically use methods such as fixed rule allocation, simple polling mechanisms, or static priority queues for task allocation and resource scheduling. These methods lack environmental adaptability and cannot dynamically adjust resource allocation strategies based on task complexity and system load. In high-concurrency scenarios, this can easily lead to uneven resource utilization, with some agents overloaded and others idle, affecting overall system performance.

[0005] For example, related technology CN202211459220.1 discloses a multi-agent collaborative task allocation method based on an improved particle swarm algorithm using non-dominated sorting, including: establishing a target benefit model for multi-agent task allocation in combination with operating environment information; establishing a loss cost model for multi-agent task allocation in combination with operating environment information; establishing a multi-agent collaborative task allocation model based on a multi-objective function and the constraints during the agent's task execution; solving the obtained model using an improved particle swarm algorithm based on non-dominated sorting to obtain a Pareto solution set; and obtaining a Pareto optimal solution based on the Pareto solution set using the maximum distance method. However, this scheme assumes that the operating environment is statically determined and does not consider the impact of environmental parameter fluctuations on task allocation. In actual applications, parameters such as task processing time, resource consumption, and agent availability fluctuate randomly, resulting in the "optimal solution" it produces being unstable or even completely ineffective under environmental disturbances. Summary of the Invention

[0006] In response to the problem of uncertainty accumulation in multi-agent systems under complex cognitive tasks, this application provides a multi-agent collaboration method based on a large language model. It improves the traditional particle swarm algorithm by introducing uncertainty perception, and breaks through the limitations of traditional fixed task allocation strategies through a multi-agent cross-validation mechanism.

[0007] The present application provides a multi-agent collaboration method based on a large language model, including: constructing a multi-agent system, wherein the multi-agent architecture includes a master agent, a task creation agent, an intent orchestration agent and at least one professional agent; the master agent is responsible for overall coordination and decision-making; the task creation agent is responsible for task decomposition; the intent orchestration agent is responsible for execution process planning; and the professional agent is responsible for target domain task processing.

[0008] Establish a multi-agent coordinated resource allocation model for managing the computing resources and task processing time of the multi-agent system; the resource allocation model includes a resource supply matrix, a task demand vector and resource allocation constraints, including: establishing a resource supply matrix R, which represents the type and amount of computing resources provided by each agent, where Represents the supply of the jth type of resources by the i-th agent; establishes the task demand vector D, which represents the demand for computing resources and processing time requirements of each task, where Indicates the demand of the kth task for the jth type of resource; sets resource allocation constraints C, including execution time constraints; establishes the task allocation matrix X, where Indicates that the kth task is assigned to the i-th agent, Indicates no allocation; build a multi-agent coordinated resource allocation model , where the task allocation problem is defined as: determine the optimal task allocation matrix X while satisfying the constraint conditions C.

[0009] The task allocation problem in the resource allocation model is transformed into a multi-objective optimization problem. The optimization objectives include minimizing the task completion time and optimizing resource utilization, including: defining the task completion time objective function , represents the total completion time of all tasks after they are assigned according to the task assignment matrix X, ,in, represents the completion time of the kth task, which depends on the processing capacity of the assigned agent and the current load; defines the resource utilization objective function , represents the balance of system resource utilization after allocation according to the task allocation matrix X, ,in, represents the resource load rate of the i-th agent, Represents the standard deviation function. The smaller the standard deviation, the more balanced the resource utilization. Construct the objective function ,in, and Represent the weight coefficients of task completion time and resource utilization respectively; set the total resource constraint, , which means that the total demand for various resources of all tasks assigned to each agent shall not exceed the supply of corresponding resources of the corresponding agent; set the execution time constraint, for task k assigned to agent i, its completion time Must not exceed the preset task deadline ,Right now ;

[0010] The task allocation problem is formulated as a multi-objective optimization problem: ; Constraints:

[0011] (1) ;

[0012] (2) ;

[0013] (3) ;

[0014] (4) ;

[0015] Among them, X is a 0-1 integer matrix, which represents the assignment relationship between tasks and agents.

[0016] In particular, task allocation in traditional multi-agent systems often relies on rule engines or heuristic algorithms. This application, by introducing objective functions and constraints, makes the multi-agent collaboration problem a solvable optimization problem.

[0017] The improved particle swarm algorithm (PSO) is used to solve the multi-objective optimization problem and obtain the optimal collaboration solution, including: initializing the particle swarm, where each particle represents a candidate task assignment matrix X, the number of particles is N, and the number of iterations is G; calculating the objective function value F(X) of each particle;

[0018] Evaluate the uncertainty index of each particle through multiple random sampling , including: generating m environmental parameter perturbations for each particle X, wherein the environmental parameter perturbations include random changes in task processing time, resource consumption, and agent availability; wherein each perturbation is actually a simulation of the possible state of the real environment, building a "digital twin" of the solution to predict its behavior in actual deployment. Specifically, task processing time perturbation: simulates the processing time fluctuations caused by changes in data complexity and quality in the real environment, usually within the range of [-15%, +25%]. Resource consumption perturbation: simulates the changes in resource requirements of different task instances, usually within the range of [-10%, +20%]. Agent availability perturbation: simulates the temporary unavailability of the agent with a certain probability (usually 5%), which reflects the possible model update, maintenance or failure scenarios in the actual system.

[0019] Under each disturbance condition, calculate the objective function value ; Introduce the time decay factor λ to increase the influence of the latest sampling results on the uncertainty assessment and calculate the uncertainty index : , where 0<λ<1, σ is the standard deviation function; in particular, environmental disturbance is essentially a non-stationary process, that is, the statistical characteristics of the system change over time, so the most recent observations have a higher predictive value for the current state. weights so that the most recent samples have a significantly higher influence than earlier samples.

[0020] When the uncertainty index of the particle When the value is greater than the preset threshold τ, the master agent broadcasts an evaluation request to at least one professional agent; each professional agent evaluates the candidate solution X and calculates the local score , the calculation formula is: ,in, represents the priority of the kth task, represents the processing capability coefficient of the i-th professional agent for the k-th task, Indicates the execution efficiency of the i-th professional agent on the k-th task; sets the credibility weight of each professional agent : ,in, Indicates the number of correct historical evaluations of the professional agent, Indicates the total number of times participating in the evaluation; a weighted voting mechanism is used to integrate the evaluation results of each professional agent to obtain a comprehensive score ; Based on comprehensive rating The objective function value Correction is made, and the calculation formula is: , where α is the correction coefficient, and its value range is [0, 2], S(X)∈[0, 1].

[0021] For each particle, the corrected objective function value of the current position X is and the historical optimal position of the corresponding individual The objective function value of Compare; according to the corrected objective function value and uncertainty indicators, calculation criteria ;

[0022] , where β is the uncertainty sensitivity coefficient, and its value range is [0, 1]. and are the uncertainty indicators of the current position and the individual's historical optimal position respectively; when When , update the individual optimal position , otherwise it remains unchanged; after each iteration, the particle with the minimum objective function value is selected from the individual optimal positions of all particles The position of ; Set the global optimal position update counter , when continuous When the global optimal position of the iteration does not change, Perform local random perturbations to avoid falling into local optima: random selection For r% of the elements in the matrix, its value is reversed, that is, for the selected element (k, i), execute .

[0023] In particular, traditional PSO requires strict monotonic improvement, i.e. , whereas this application allows, in certain circumstances, to accept solutions with slightly worse objective function values ​​but significantly reduced uncertainty. This non-monotonic improvement strategy enables the algorithm to escape local optima, improving global search capabilities. Furthermore, this application allows for non-monotonic updates at the individual level through uncertainty trade-offs, while at the global level, random perturbations provide for wide-ranging jumps. This multi-level escape strategy significantly improves the algorithm's performance on complex multimodal optimization problems.

[0024] Update the particle's velocity and position;

[0025] ;

[0026] ;in, represents the velocity vector of the particle at time t, represents the position vector of the particle at time t, is the inertia weight, which controls the influence of the velocity at the previous moment. is the individual optimal position acceleration coefficient, which controls the degree to which the particle moves toward its own historical optimal position. is the global optimal position acceleration coefficient, which controls the degree to which particles move toward the global optimal position of the population. is the uncertainty correction factor, is a random number in the interval [0, 1], is the position of the particle with the lowest uncertainty in the current population. Represents the position of the particle with the lowest uncertainty index μ(X) in the current population.

[0027] Constrain the updated particle positions to satisfy the set constraints (1) to (4);

[0028] Repeat the iteration until the preset number of iterations G or convergence condition is reached, and output the global optimal solution As the final task assignment matrix X.

[0029] In particular, the traditional PSO adopts a dual-source guidance mechanism (individual optimal and global optimal), while this scheme introduces a third guidance source (Lowest Uncertainty Position), achieving a fundamental shift from "performance-driven" to "performance-and-stability dual-driven." This three-source guidance mechanism significantly expands the algorithm's search capabilities, enabling it to simultaneously optimize both the objective function value and stability.

[0030] Compared with the existing technology, the advantages of this application are:

[0031] In multi-agent systems, the uncertainty of each agent's reasoning results in complex cognitive tasks accumulates and amplifies during the serial collaboration process. Traditional methods such as fixed rule allocation, simple polling mechanisms, or static priority queues use fixed task allocation strategies, but they lack environmental adaptability, are unable to perceive reasoning uncertainty, lead to unbalanced resource utilization, and easily lead to a significant decline in reasoning quality in dynamic environments.

[0032] This application transforms the task allocation problem into a multi-objective optimization problem that balances time efficiency and resource balance by constructing a multi-agent coordinated resource allocation model and precise task-resource demand mapping. It also introduces an uncertainty-aware particle swarm optimization algorithm, assessing the stability of the solution through multiple sampling with time decay. When the uncertainty exceeds a threshold, a multi-agent cross-validation mechanism is triggered. Furthermore, an update strategy that comprehensively considers the objective function value and uncertainty is adopted, enabling active perception and intervention of uncertainty in dynamic environments. This improves the quality and efficiency of reasoning. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] The present application will be further described in the form of exemplary embodiments, which will be described in detail with reference to the accompanying drawings. These embodiments are not limiting, and in these embodiments, the same numbers represent the same structures, wherein:

[0034] Figure 1 is an exemplary flow chart of a multi-agent collaboration method based on a large language model according to some embodiments of the present application;

[0035] Figure 2 is an exemplary flow chart of a construction task allocation problem according to some embodiments of the present application;

[0036] Figure 3 This is an exemplary flowchart of a method for obtaining a global optimal solution according to some embodiments of the present application. DETAILED DESCRIPTION

[0037] The method and system provided in the embodiments of the present application are described in detail below with reference to the accompanying drawings.

[0038] like Figure 1 As shown, a multi-agent system is constructed, wherein the multi-agent architecture includes a master agent, a task creation agent, an intent orchestration agent, and at least one specialized agent. A multi-agent coordinated resource allocation model is established to manage the computing resources and task processing time of the multi-agent system. The resource allocation model includes a resource supply matrix, a task demand vector, and resource allocation constraints. The task allocation problem in the resource allocation model is transformed into a multi-objective optimization problem, with the optimization objectives including minimizing task completion time and optimizing resource utilization. An improved particle swarm algorithm (PSO) is used to solve the multi-objective optimization problem and obtain the optimal collaboration solution among the master agent, task creation agent, intent orchestration agent, and at least one specialized agent. The improved particle swarm algorithm (PSO) evaluates the uncertainty of each candidate solution through multiple random samplings. When the uncertainty exceeds a threshold, cross-validation is performed through a multi-agent voting mechanism.

[0039] In this example, a multi-agent system for risk assessment of corporate financing applications was constructed. Based on large language model technology, the system consists of four core agents: a master agent, a task creation agent, an intent orchestration agent, and multiple specialized agents.

[0040] The master agent utilizes a large language model with 175B parameters and possesses global decision-making and coordination capabilities. It is responsible for overall system control and the synthesis and output of final risk assessment results. Its primary responsibilities include receiving corporate financing applications, confirming the start of the assessment task, and generating the final risk assessment report after all assessment steps are completed. It monitors system resource usage in real time, including each agent's computing resource utilization, task queue depth, and processing latency. When an anomaly is detected (such as excessive uncertainty in an assessment result), a multi-agent voting mechanism is triggered for cross-validation. The output of each agent is quality-assessed to ensure the accuracy and consistency of the risk assessment process. The master agent utilizes a global state representation method based on an attention mechanism, encoding the state information and output of each agent into a unified vector representation, enabling awareness of the system's global state. When processing a large number of concurrent tasks, the master agent uses a hierarchical scheduling strategy to assign applications of varying risk levels and complexities to the appropriate processing queues.

[0041] The task creation agent uses a large language model with a 70B parameter scale and focuses on task parsing and decomposition. Its main responsibilities include: parsing the financing application materials submitted by the enterprise (including financial statements, business plans, market analysis and other documents) and extracting key information. The risk assessment task is decomposed into multiple subtasks, such as financial status analysis, industry risk assessment, credit history review, fraud detection and compliance review. Each subtask is assigned a priority weight based on factors such as the amount of financing, enterprise size, and industry type. The extracted data is standardized and structured to generate a data format suitable for processing by various professional agents. In this embodiment, the task creation agent uses multimodal information processing capabilities and can simultaneously process application materials in text, table, and image formats.

[0042] The intent-based orchestration agent uses a large language model with 35B parameters and is responsible for planning the task execution process. Its main responsibilities include: designing the optimal task execution process based on task types and dependencies, determining which tasks can be executed in parallel and which require serial processing; dynamically adjusting subsequent execution plans based on intermediate results during execution; providing resource allocation recommendations to the master agent based on task complexity and urgency; and monitoring task execution progress to ensure tasks are completed as planned. The intent-based orchestration agent uses a directed acyclic graph (DAG) to represent task dependencies and calculates the optimal execution path using a dynamic programming algorithm. In this example, the standard process for financing risk assessment consists of five main stages and 18 subtasks, forming a complex task network.

[0043] The system comprises multiple specialized agents, each responsible for risk assessment tasks in a specific area: The Financial Analysis Agent utilizes a specialized financial model with a 13B parameter scale, focusing on analyzing corporate financial data, including assessing solvency, profitability, operational capacity, and development capabilities. The Industry Risk Assessment Agent utilizes an industry analysis model with a 20B parameter scale, focusing on assessing industry prospects, market competition, and macroeconomic impacts. The Credit History Agent utilizes a model with a 7B parameter scale, analyzing a company's historical credit history, repayment behavior, and credit events. The Fraud Detection Agent utilizes a model with a 15B parameter scale, focusing on identifying potential financial fraud and anomalies. The Compliance Review Agent utilizes a model with a 10B parameter scale, assessing compliance risks in a company's operations and financing applications. Each specialized agent is fine-tuned using relevant domain data and equipped with specialized reasoning plug-ins to enhance its specialized capabilities. For example, the Financial Analysis Agent integrates financial ratio calculation tools and a database of industry standard comparisons; the Fraud Detection Agent is equipped with anomaly detection algorithms and a library of historical fraud cases.

[0044] like Figure 2 As shown, resource allocation is crucial in intelligent financial risk assessment systems, directly impacting system processing efficiency and assessment quality. In this example, the system comprises eight agents (one master agent, one task creation agent, one intent orchestration agent, and five specialized agents). Resource types include computing resources (GPU computing power), memory resources, and bandwidth resources. Therefore, the resource supply matrix R is an 8×3 matrix, with units of GPU cores, GB, and Mbps, respectively:

[0045] R=[[32, 128, 1000], / / master agent;

[0046] [16, 64, 800], / / Task creation agent;

[0047] [8, 32, 500], / / Intent orchestration agent;

[0048] [16, 48, 300], / / Financial analysis agent;

[0049] [24, 56, 300], / / Industry risk assessment agent;

[0050] [4, 16, 200], / / Credit history agent;

[0051] [12, 32, 250], / / Fraud detection agent;

[0052] [8, 24, 200] / / Compliance Review Agent].

[0053] For example, R[0, 0] = 32 indicates that the master agent is provided with 32 GPU cores of computing resources, and R[3, 1] = 48 indicates that the financial analysis agent is provided with 48 GB of memory resources. The system is deployed on a private cloud platform owned by a financial institution, with a total of 128 GPU cores, 400 GB of memory, and 3550 Mbps of bandwidth. Resource allocation is based on the functional complexity and processing requirements of each agent. Resource allocation also takes into account the typical workload of various tasks in historical data. For example, industry risk assessments typically require processing large amounts of external market data, resulting in higher computational resources.

[0054] In the enterprise financing risk assessment scenario, a typical assessment task consists of 18 subtasks, each with different resource requirements. The task requirement vector D is an 18×3 matrix, which also corresponds to computing resources, memory resources, and bandwidth resources:

[0055] D=[[4, 8, 100], / / Extract basic information of the enterprise;

[0056] [6, 12, 150], / / Financial statement data extraction;

[0057] [8, 16, 200], / / Financial ratio calculation and analysis;

[0058] [10, 24, 120], / / cash flow status assessment;

[0059] [12, 32, 150], / / Debt repayment capacity analysis;

[0060] [14, 28, 160], / / Profitability analysis;

[0061] [8, 16, 180], / / Industry development trend analysis;

[0062] [16, 36, 220], / / Market competition situation assessment;

[0063] [12, 24, 180], / / Macroeconomic impact analysis;

[0064] [3, 8, 120], / / Credit history record retrieval;

[0065] [5, 12, 100], / / Analysis of historical repayment behavior;

[0066] [4, 10, 80], / / Credit event impact assessment;

[0067] [10, 20, 150], / / Financial data consistency check;

[0068] [12, 28, 120], / / Abnormal transaction pattern identification;

[0069] [8, 16, 100], / / Financial indicator anomaly detection;

[0070] [6, 12, 80], / / Industry compliance requirements review;

[0071] [8, 20, 100], / / Anti-money laundering compliance assessment;

[0072] [4, 8, 60] / / Internal control risk assessment].

[0073] For example, D[2, 0] = 8 indicates that the "Financial Ratio Calculation and Analysis" task requires the computing resources of 8 GPU cores, and D[7, 1] = 36 indicates that the "Market Competitive Situation Assessment" task requires 36GB of memory resources. Task requirements are determined through analysis of historical execution data. The system records the resource consumption of 2,500 financing applications processed over the past six months and uses regression analysis to establish a mapping between task complexity and resource requirements. Computing resource requirements take into account the computational effort and parallel processing capabilities required for model inference; memory requirements consider model size and storage requirements for intermediate data processing results; and bandwidth requirements consider the requirements for external data access and internal communication.

[0074] In response to the special needs of financial risk assessment scenarios, the following constraints are set: Execution time constraint: Different assessment time limits are set according to the financing amount. For financing applications below 10 million yuan, the system must complete the assessment within 2 hours; applications between 10 million yuan and 50 million yuan must be completed within 4 hours; and applications above 50 million yuan must be completed within 8 hours. Priority constraint: Applications from high-risk industries (such as real estate, new energy and other industries with large fluctuations) are given priority. An industry risk coefficient table is set up in the system, which contains the risk levels of 42 industries. Quality assurance constraint: For large-scale financing applications (above 50 million yuan), at least 3 professional agents are required to cross-validate the same key indicators to ensure the reliability of the assessment results. Resource efficiency constraint: The average resource utilization rate of any agent should not be lower than 60% or higher than 90% to avoid resource waste and system bottlenecks.

[0075] The task allocation matrix X is an 18×8 0-1 matrix that represents the assignment of 18 subtasks to 8 agents. For example, X[2, 3] = 1 assigns the third task, "Financial Ratio Calculation and Analysis," to the fourth agent (the Financial Analyst). During resource allocation, the system must determine the optimal task allocation matrix X to minimize overall evaluation time while ensuring balanced resource utilization across agents. Furthermore, task allocation must meet professional matching requirements. For example, financial tasks should be assigned first to the Financial Analyst to fully leverage their expertise.

[0076] Integrate the above elements to build a multi-agent coordinated resource allocation model The core of this model is to determine the optimal task allocation matrix X so that the efficiency and quality of financing risk assessment are optimized while satisfying the constraint condition C.

[0077] like Figure 3 As shown in the figure, in the intelligent financial risk assessment system, the task allocation problem is transformed into a multi-objective optimization problem that takes into account the assessment time and resource utilization. The task completion time objective function T(X) is defined as the total completion time of all tasks after they are allocated according to the allocation matrix X, and is calculated using the critical path method: ,in, represents the completion time of the kth task, which is determined by the following factors: Basic processing time: Through historical data analysis, the basic processing time matrix B of each task on different agents is established, where Indicates the baseline time (in seconds) for the kth task to be processed by the ith agent. For example, a financial ratio analysis task takes 120 seconds to be processed by a financial analysis agent, but may take 180 seconds or more to be processed by other non-specialized agents. Load impact factor: The current load of the agent will affect the task processing time. Define the load impact function When the agent load L exceeds 60%, the processing time begins to increase significantly. Task complexity adjustment: According to the complexity of the financing application (considering the size of the enterprise, industry type, financing amount, etc.), the basic processing time is adjusted. Define the complexity coefficient , ranging from [0.8, 1.5]. Task dependencies: Many tasks have dependencies between them. For example, "Financial Data Extraction" must be completed before "Financial Ratio Analysis." The system uses a directed acyclic graph to represent task dependencies, and the completion time of the predecessor task is taken into account when calculating the completion time.

[0078] Taking all the above factors into consideration, the calculation formula for the completion time of the kth task is: ,in, represents the set of completion times for all predecessor tasks of the kth task. During implementation, the system dynamically adjusts the base processing time and complexity coefficient based on the characteristics of the financing application. For example, for a large enterprise with a complex group structure, the complexity coefficient of a financial analysis task might reach 1.4; whereas for a small enterprise with a high degree of standardization, the complexity coefficient might be only 0.9.

[0079] Resource utilization objective function Indicates the degree of balance of system resource utilization, defined as: ,in, represents the resource load rate of the ith agent, and σ represents the standard deviation function. The smaller the standard deviation, the more balanced the load of each agent and the higher the value of the resource utilization objective function.

[0080] Resource load ratio of agent i The calculation considers the comprehensive usage of three types of resources (computing resources, memory resources, and bandwidth resources): ,in: (Calculation resource load rate); (memory resource load ratio); (Bandwidth resource load ratio); In financial risk assessment scenarios, uneven load distribution among agents can cause delays in processing some high-value assessment tasks, impacting overall risk control effectiveness. By optimizing resource utilization, the system can avoid overloading some agents while leaving others idle, improving overall processing capacity.

[0081] The comprehensive objective function F(X) combines the two objectives of task completion time and resource utilization: ;in, and Respectively represent the weight coefficients of task completion time and resource utilization. In this embodiment, the weight coefficient setting is related to the urgency of the financing application: for an application marked as "urgent", , , giving priority to completion time; for regular applications, , taking into account the balance of time and resources; for batch processing applications, , and pay more attention to resource utilization efficiency.

[0082] The task allocation problem is formulated as a multi-objective optimization problem: ; Constraints:

[0083] (1) , (each task is assigned a variable of 0 or 1);

[0084] (2) ; (each task must be assigned to one and only one agent);

[0085] (3) ; (total amount of intelligent agent resources constraint);

[0086] (4) ; (task completion time constraint).

[0087] To solve the above multi-objective optimization problem, a particle swarm containing N = 50 particles is initialized in the intelligent financial risk assessment system, where each particle represents a candidate task assignment matrix X (an 18×8 0-1 matrix). The initialization process takes professional matching into account, making the initial particles reasonable: 60% of the particles are initialized based on professional matching rules, that is, they tend to assign tasks to agents with high professional matching. For example, financial analysis tasks are preferentially assigned to financial analysis agents. 30% of the particles are initialized completely randomly to maintain population diversity. 10% of the particles are initialized based on historical optimal solutions, using the system's past successful task assignment schemes. The system maintains a database of 500 historical high-quality solutions, indexed by financing type, enterprise size, and industry classification. For each initialized particle, the system performs a constraint repair process to ensure that all particles meet the basic constraints, especially constraints (1) and (2). The repair process adopts a greedy strategy, giving priority to resource utilization efficiency and professional matching. The number of iterations is set to G = 200, but if the objective function value does not improve by more than 0.1% after 30 consecutive iterations, the iteration is terminated early.

[0088] In financial risk assessment scenarios, the task execution environment is subject to various uncertainties, such as fluctuations in data quality, changes in external system response time, and fluctuations in model inference performance. To evaluate the stability of each candidate solution in an uncertain environment, the system generates m = 20 environmental parameter perturbations for each particle X:

[0089] Random perturbations are applied to the basic processing time matrix B, ranging from -15% to +25%, to reflect actual execution time fluctuations. Fluctuations in financial data processing time are primarily due to changes in data quality and complexity. For example, processing non-standardized financial statements can take 25% longer than standard statements.

[0090] Random perturbations are applied to the task demand vector D, with a perturbation range of [-10%, +20%], to reflect the uncertainty of task resource requirements. For example, when the number of external data sources that need to be processed increases, memory consumption may exceed expectations.

[0091] We simulated a 5% probability of an agent being temporarily unavailable, requiring its tasks to be reassigned to other agents. This reflects the potential for system maintenance, model updates, or hardware failures that may occur in real operations.

[0092] Under each disturbance condition, the objective function value is recalculated The calculation of the objective function after the disturbance takes into account the additional cost and delay of task reallocation. The time decay factor λ=0.9 is introduced to calculate the uncertainty index : More recent sampling results (with larger numbers) have a greater impact on uncertainty assessments, reflecting the system's sensitivity to recent conditions. This time decay mechanism is particularly well-suited for financial risk assessments, as recent market fluctuations and policy changes often have a greater impact on risk assessments.

[0093] Set the uncertainty threshold τ = 0.15, when the uncertainty index of the particle When , the multi-agent voting mechanism is triggered. In financial risk assessment systems, high uncertainty can mean that simple task allocation schemes may lead to unstable risk assessment results in situations of high market volatility or complex corporate financial situations. When a highly uncertain candidate solution X is detected, the master agent broadcasts an evaluation request to the five specialized agents, including the detailed task allocation scheme and historical execution statistics for candidate solution X.

[0094] Each professional agent evaluates the candidate solution from its own professional perspective and calculates the local score : ;in: is the priority of the kth task, ranging from [1, 10]. Tasks with larger financing amounts and higher risk levels have higher priorities. is the processing capability coefficient of the i-th professional agent for the k-th task, ranging from [0.6, 1.2], reflecting the professional matching degree; is the execution efficiency of the i-th professional agent on the k-th task, ranging from [0.7 to 1.3], reflecting the historical execution speed; for example, the processing capacity coefficient of the financial analysis agent for financial tasks , the processing capacity coefficient for fraud detection tasks , reflecting the differences in expertise among professional intelligent agents.

[0095] Set the credibility weight of the professional agent: ;in, Indicates the number of correct historical evaluations of the professional agent, Represents the total number of assessments participated in. The system records the difference between each assessment result and the actual execution result, and the assessment is considered correct when the difference is less than 10%. Initially, each agent has a similar credibility weight. As the system operates and historical data accumulates, more accurate agents receive higher weights. For example, after three months of operation, the Financial Analysis agent had a historical accuracy rate of 92% (460 / 500), with a weight of W=0.92; while the Compliance Review agent had a historical accuracy rate of 78% (312 / 400), with a weight of W=0.78.

[0096] A weighted voting mechanism is used to integrate the evaluation results of each professional agent: ; Based on comprehensive rating Correct the objective function value: ;in, is the correction coefficient, S(X)∈[0,1]. When , it indicates that the professional agent believes that the solution is better than the average level, and the corrected objective function value becomes smaller (for minimization problems, this means that the solution quality is improved); when When , it indicates that the professional agent thinks that the solution is not good, and the corrected objective function value becomes larger.

[0097] Based on the corrected objective function value , update the individual optimal position of each particle and the global optimal position :For each particle, calculate the criterion : ; where β = 0.3 is the uncertainty sensitivity coefficient. This criterion considers both the objective function value and uncertainty. When the objective function values ​​of two solutions are close, the solution with lower uncertainty is preferred.

[0098] when When , update the individual optimal position After each iteration, the particle with the minimum objective function value is selected from the individual optimal positions of all particles. The position of . Set the global optimal position update counter , when the global optimal position does not change after Ks=20 consecutive iterations, Perform local random perturbations: Random selection The values ​​of the elements in the matrix that are equal to r=10% are inverted. This perturbation mechanism helps the algorithm escape local optima and is particularly important in complex scenarios such as financial risk assessment.

[0099] Update the particle's velocity and position:

[0100] ; Among them: ω=0.7 is the inertia weight; is the individual optimal position acceleration coefficient; is the global optimal position acceleration coefficient; is the uncertainty correction factor; is a random number in the interval [0, 1]; is the position of the particle with the lowest uncertainty in the current population. The innovation of this velocity update formula lies in the introduction of a third uncertainty correction term, which biases particles toward regions of lower uncertainty during the update process. This improvement is particularly important for applications requiring stability, such as financial risk assessment.

[0101] After the particle positions are updated, the elements of the X matrix are often continuous values, which need to be converted to 0-1 integers to ensure that each task is assigned to only one agent:

[0102] The system uses an improved S-shaped mapping function to map continuous values ​​to binary values: ; When random (0, 1) <probability, , other situations This probabilistic mapping maintains the randomness of the search process and helps the algorithm escape from the local optimum. For example, when , the probability of transitioning to 1 is about 0.82, rather than being set to 1 deterministically.

[0103] Processing of constraints (1) and (2): Completeness and uniqueness of task assignment. After binarization, the system checks the assignment of each task. There are three possible situations: Multiple assignments: Task k is assigned to multiple agents. The system calculates the comprehensive score based on the professional matching matrix E and the current load: The highest-scoring assignment is retained, and the others are set to 0. For example, the task "Financial Ratio Calculation and Analysis" is assigned to both the Financial Analyst agent (match 0.95, load 0.75) and the Intent Orchestration agent (match 0.45, load 0.55). The calculated scores are: Financial Analyst agent: 0.7*0.95+0.3*(1-0.75)=0.665+0.075=0.74; Intent Orchestration agent: 0.7*0.45+0.3*(1-0.55)=0.315+0.135=0.45. The system retains the assignment to the Financial Analyst agent (X[2, 3]=1) and sets the assignment to the Intent Orchestration agent to 0 (X[2, 2]=0).

[0104] No assignment: Task k is not assigned to any agent ( ), the system also selects the best agent based on the comprehensive score: ; For example, if the task “credit history retrieval” is not assigned, the system calculates the comprehensive scores of each agent and selects the credit history agent with the highest score (X[9, 5]=1).

[0105] Correct assignment: Task k is assigned to exactly one agent ( ), no adjustments are needed, keep the current allocation.

[0106] Processing of constraint (3): Total resource constraint. After processing constraints (1) and (2), the system checks whether the resource usage of each agent exceeds its supply:

[0107] Calculate the total demand of each agent i for various resources j: ; Check if there are any resource limits exceeded: . For agents with exceeded resource limits, the system adopts a greedy adjustment algorithm. For example, the computational resources of the fraud detection agent exceed the limit (Demand[6, 0]=14>R[6, 0]=12), and the system attempts to migrate its lowest priority task "Financial Indicator Anomaly Detection" (Priority=5.8) to the financial analysis agent (E[14, 3]=0.65>E_min

[14] =0.6) to ensure that resource usage meets the constraints. Resource adjustment may trigger a chain reaction, and the migration of one agent's task may cause another agent's resources to exceed the limit. The system adopts an iterative adjustment strategy until the resource usage of all agents meets the constraints or the maximum number of iterations (usually set to 5) is reached.

[0108] Constraint (4) processing: After executing the time constraint and processing the resource constraint, the system checks whether the task completion time meets the deadline requirement:

[0109] Calculate the completion time of each task based on the task dependency graph and current allocation Check if any task has completed beyond the deadline: For timed-out tasks, high-priority tasks can pause the execution of low-priority tasks. For example, when the "abnormal trading pattern recognition" task is expected to timeout, the system raises its priority from 7 to 9, allowing it to preempt other tasks being processed by the agent.

[0110] The invention of the present application and its implementation methods are described schematically above. This description is not restrictive. Without departing from the spirit or basic features of the present application, the present application can be implemented in other specific forms. What is shown in the accompanying drawings is only one of the implementation methods of the invention of the present application, and the actual structure is not limited to this. Therefore, if a person of ordinary skill in the art is inspired by it, without departing from the purpose of the invention, a structural method and embodiment similar to the technical solution are designed without creativity, which should all fall within the scope of protection of the present application. In addition, the word "including" does not exclude other elements or steps, and the word "one" before an element does not exclude the inclusion of "multiple" elements. Words such as first and second are used to indicate names and do not indicate any specific order.

Claims

1. A multi-agent collaboration method based on a large language model, characterized in that: include: Constructing a multi-agent system, the multi-agent system including a master agent, a task creation agent, an intent orchestration agent, and at least one professional agent; Establishing a multi-agent coordinated resource allocation model for managing computing resources and task processing time of the multi-agent system; the resource allocation model includes a resource supply matrix, a task demand vector, and resource allocation constraints; The task allocation problem in the resource allocation model is transformed into a multi-objective optimization problem, where the optimization objectives include minimizing task completion time and optimizing resource utilization; An improved particle swarm algorithm (PSO) is used to solve a multi-objective optimization problem and obtain the optimal collaboration solution among a master agent, a task creation agent, an intent orchestration agent, and at least one specialized agent. The improved particle swarm algorithm (PSO) evaluates the uncertainty of each candidate solution through multiple random samplings. When the uncertainty exceeds a threshold, cross-validation is performed through a multi-agent voting mechanism. Among them, solving the multi-objective optimization problem includes: evaluating the uncertainty index of each particle through multiple random sampling : Generate m environmental parameter perturbations for each particle X, including random changes to task processing time, resource consumption, and agent availability; Under each disturbance condition, calculate the objective function value ; Introducing a time decay factor , in order to increase the influence of the most recent sampling results on the uncertainty assessment, calculate the uncertainty index : , where 0<λ<1 and σ is the standard deviation function.

2. The multi-agent collaboration method based on a large language model according to claim 1, characterized in that: The master agent is responsible for overall coordination and decision-making; The task creation agent is responsible for task decomposition; The intent orchestration agent is responsible for executing process planning; Professional agents are responsible for processing tasks in the target domain.

3. The multi-agent collaboration method based on a large language model according to claim 2, characterized in that: Establish a multi-agent coordinated resource allocation model, including: Establish a resource supply matrix R, which represents the type and quantity of computing resources provided by each agent, where represents the supply of the jth type of resources by the i-th agent; Establish a task demand vector D, which represents the demand for computing resources and processing time required by each task, where D[k, j] represents the demand for the jth type of resources by the kth task; Set resource allocation constraints C, including execution time constraints; Establish a task allocation matrix X, where Indicates that the kth task is assigned to the i-th agent, Indicates no allocation; Constructing a multi-agent coordinated resource allocation model , where the task allocation problem is defined as: determine the optimal task allocation matrix X while satisfying the constraint conditions C.

4. The multi-agent collaboration method based on a large language model according to claim 3, characterized in that: The task allocation problem in the resource allocation model is transformed into a multi-objective optimization problem, including: Define the task completion time objective function T(X), which represents the total completion time of all tasks after they are assigned according to the task assignment matrix X. ,in, represents the completion time of the kth task, which depends on the processing capacity of the assigned agent and the current load; Define resource utilization objective function , represents the balance of system resource utilization after allocation according to the task allocation matrix X, ,in, represents the resource load rate of the i-th agent, represents the standard deviation function, the smaller the standard deviation, the more balanced the resource utilization; Constructing the objective function ,in, and Represent the weight coefficients of task completion time and resource utilization respectively; Set resource constraints. , which means that the total demand for various resources of all tasks assigned to each agent must not exceed the supply of the corresponding resources of the corresponding agent; Set the execution time constraint. For task k assigned to agent i, its completion time is Must not exceed the preset task deadline ,Right now ; The task allocation problem is formulated as a multi-objective optimization problem: ; Constraints: (1) ; (2) ; (3) ; (4) ; Where X is a 0-1 integer matrix, representing the assignment relationship from tasks to agents.

5. The multi-agent collaboration method based on a large language model according to claim 4 is characterized in that: The improved particle swarm algorithm (PSO) is used to solve the multi-objective optimization problem and obtain the optimal collaboration solution, including: Initialize the particle swarm, where each particle represents a candidate task assignment matrix X, the number of particles is N, and the number of iterations is G; Calculate the objective function value F(X) of each particle; Evaluate the uncertainty index of each particle through multiple random sampling ; Setting uncertainty thresholds , when the uncertainty index of the particle When , the multi-agent voting mechanism is triggered, and the master agent organizes multiple professional agents to evaluate the corresponding solution and modify the objective function value according to the voting results; Update the individual optimal position of each particle according to the corrected objective function value and the global optimal position ; Update the particle's velocity and position; Constrain the updated particle positions to satisfy the set constraints (1) to (4); Repeat the iteration until the preset number of iterations G or convergence condition is reached, and output the global optimal solution As the final task assignment matrix X.

6. The multi-agent collaboration method based on a large language model according to claim 5, characterized in that: When the uncertainty index of the particle When , the multi-agent voting mechanism is triggered, including: When the uncertainty index of the particle Greater than the preset threshold When , the master agent broadcasts an evaluation request to at least one professional agent; Each professional agent evaluates the candidate solution X and calculates a local score , the calculation formula is: ,in, represents the priority of the kth task, represents the processing capability coefficient of the i-th professional agent for the k-th task, represents the execution efficiency of the i-th professional agent on the k-th task; Set the credibility weight of each professional agent : ,in, Indicates the number of correct historical evaluations of the professional agent, Indicates the total number of times the assessment was participated in; A weighted voting mechanism is used to integrate the evaluation results of each professional agent to obtain a comprehensive score ; According to the comprehensive score S (X) the objective function value Correction is made, and the calculation formula is: , where α is the correction coefficient, and its value range is [0, 2], S(X)∈[0, 1].

7. The multi-agent collaboration method based on a large language model according to claim 5, characterized in that: Update the individual optimal position of each particle according to the corrected objective function value and the global optimal position ,include: For each particle, the corrected objective function value of the current position X is and the corresponding individual's historical optimal position The objective function value of Make comparisons; According to the corrected objective function value and uncertainty indicators, calculation criteria ; when When , update the individual optimal position , otherwise remain unchanged; At the end of each iteration, the particle with the minimum objective function value is selected from the individual optimal positions of all particles. The position of ; Set the global optimal position update counter , when continuous When the global optimal position of the iteration does not change, Perform local random perturbations to avoid falling into local optima: random selection For r% of the elements in the matrix, its value is reversed, that is, for the selected element (k, i), execute .

8. The multi-agent collaboration method based on a large language model according to claim 7, characterized in that: According to the corrected objective function value and uncertainty indicators, calculation criteria , using the following formula: , where β is the uncertainty sensitivity coefficient, and its value range is [0, 1]. and are the uncertainty indicators of the current position and the individual's historical optimal position, respectively.

9. The multi-agent collaboration method based on a large language model according to claim 5, characterized in that: Update the particle's velocity and position using the following formula: ; ; in, represents the velocity vector of the particle at time t, Represents the position vector of the particle at time t, ω is the inertia weight, which controls the influence of the velocity at the previous moment, is the individual optimal position acceleration coefficient, which controls the degree to which the particle moves toward its own historical optimal position. is the global optimal position acceleration coefficient, which controls the degree to which particles move toward the global optimal position of the population. is the uncertainty correction factor, is a random number in the interval [0, 1], is the position of the particle with the lowest uncertainty in the current population.

Citation Information

Patent Citations

  • Multi-agent cooperative task allocation method of improved particle swarm algorithm based on non-dominated sorting

    CN115809547A

  • Unmanned cluster cooperation strategy reconstruction method and device based on two-layer scheduling

    CN115857558A