Budget-controllable multi-agent cooperation topology generation method and system based on core-electronic hierarchical architecture

CN122549475APending Publication Date: 2026-08-11ZHEJIANG UNIV +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610556839.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-04-24
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

这种“一刀切”的模式无法适应任务难度的动态变化:在处理简单查询时,全连接图会导致大量的Token浪费和冗余通信;而在处理极难任务时,稀疏的链式结构则限制了信息的深度交互

Benefits of technology

[0025]高弹性与鲁棒性:通过信任链机制,系统能够在智能体意外退出(Dropout)或故障时实现无缝的任务接管,保证任务流不中断;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122549475A_ABST
    Figure CN122549475A_ABST
Patent Text Reader

Abstract

This invention discloses a budget-controllable multi-agent collaborative topology generation method and system based on a core-electron hierarchical architecture. First, a dual-channel probabilistic graph is constructed and initialized. After iterative training and convergence on the training set, the global importance score of each agent is calculated and cluster analysis is performed to divide the system into a set of highly stable cores and a pool of electrons to be excited. Second, during the online inference phase, the task complexity of the user's natural language query is evaluated. Based on the complexity score, a mapping budget is performed, and the optimal electron agent and core agent are selected to form an active agent set. Graph structure and memory optimization are implemented, and a structure-aware loss is introduced to solidify hierarchical stability. Finally, an online evolution mechanism is constructed to periodically analyze the log library. This invention enables seamless takeover in case of agent failure, supports dynamic addition and removal of agents and load rebalancing, reduces search time by combining spatial prediction, optimizes resource allocation using a dual-capacity allocation algorithm, significantly improves throughput, and reduces task conflict rate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the interdisciplinary field of artificial intelligence, distributed computing and complex network control, and specifically to a budget-controllable multi-agent cooperative topology generation method and system based on a core-electronic hierarchical architecture. Background Technology

[0002] With the rapid development of large language models in reasoning, planning, and code generation, single agents, due to their limited context window and singular perspective, are gradually revealing their limitations when handling complex tasks with long horizons, multimodalities, or high logical depth. Multi-agent systems (MAS) based on LLM have emerged to address this need, simulating the collaborative patterns of human teams and leveraging collective intelligence to solve complex problems.

[0003] In MAS design, the "Collaboration Topology"—the connection graph structure and information flow between agents—is a key variable determining system performance and cost. Existing topology design methods suffer from the following technical shortcomings:

[0004] First, the rigidity and inefficiency of static topologies. Traditional chain, star, or fully connected structures are fixed during the initialization phase. This "one-size-fits-all" approach cannot adapt to dynamic changes in task difficulty: when handling simple queries, fully connected graphs lead to a large amount of token waste and redundant communication; while when handling extremely difficult tasks, sparse chain structures limit deep information interaction.

[0005] Second, the stability paradox of dynamic topologies. Although learning-based dynamic graph generation methods have emerged recently, they often face a stability-extensibility trade-off. Topologies generated entirely from scratch are extremely unstable, prone to producing unexecutable deadlock structures or isolated nodes, and difficult to reproduce high-quality collaborative paths.

[0006] Third, there is a mismatch between task difficulty and computational budget. Existing systems lack a fine-grained mechanism for quantifying "task complexity." Systems often blindly allocate a fixed number of agents, resulting in overkill for simple tasks and undercapacity for complex tasks, failing to establish an optimal Pareto front between performance and token economy.

[0007] Specifically, existing technologies lack a mechanism that can dynamically activate edge computing nodes based on the real-time complexity of queries while preserving high-value collaborative paths validated by large amounts of data (i.e., "structural inertia"), thereby achieving a balance between executability, robustness, and economy.

[0008] Therefore, there is an urgent need for a next-generation multi-agent orchestration scheme that can combine the stability of static architecture with the flexibility of dynamic generation, and can adaptively adjust the scale (budget) of collaboration according to the actual difficulty of the task. Summary of the Invention

[0009] To address the aforementioned technical problems, this invention provides a budget-controllable multi-agent cooperative topology generation method and system based on a core-electron hierarchical architecture. For multi-agent systems (MAS) driven by large language models (LMMs), this invention proposes the ATOM (Adaptive Topology Optimization Mechanism) framework. Inspired by atomic physics, this framework constructs a novel core-electron hierarchical architecture. This architecture decouples the multi-agent cooperative graph into two parts: first, a highly cohesive and robust core obtained through offline reinforcement learning, serving as the cooperative backbone; and second, a group of electrons that are dynamically activated during the online inference phase based on task complexity, operating around the core and providing elastic computing power supplementation to the system.

[0010] To achieve the above objectives, the present invention provides the following technical solution:

[0011] In a first aspect, the present invention provides a budget-controllable multi-agent cooperative topology generation method based on a core-electronic hierarchical architecture, comprising the following steps:

[0012] A dual-channel probability map is constructed and initialized. After iterative training and convergence on the training set, the global importance score of each agent is calculated and cluster analysis is performed to divide them into a set of highly stable nuclei and a pool of electrons to be excited.

[0013] After the division of each intelligent agent is completed, the online reasoning stage is entered, where natural language queries input by the user are received, and the task complexity is evaluated by calculating the information dispersion and semantic reasoning depth.

[0014] Budget mapping is completed based on the natural language query, the information dispersion, and the semantic reasoning depth to obtain a task complexity score; the context affinity between the candidate agents in the electron pool and the current task is calculated through a gating network, and an activation set is selected to form an active agent set together with the core agent;

[0015] Based on the active agent set, graph structure optimization and memory optimization are achieved through edge probability calculation, KV cache reuse and DAG repair algorithm, and an executable topology structure is output.

[0016] Based on the executable topology, a structure-aware loss is introduced to strengthen the "core-core" and "core-electron" connections, weaken the "electron-electron" connections, and use the PPO algorithm for end-to-end fine-tuning to solidify the stability of the hierarchical structure.

[0017] An online evolution mechanism is constructed for the aforementioned core-electronic architecture: a successful topology log library is established to record high-scoring collaborative structures in online inference, and the log library is analyzed regularly.

[0018] Secondly, the present invention provides a budget-controllable multi-agent cooperative topology generation system based on a core-electronic hierarchical architecture, comprising:

[0019] The offline learning module is used to construct and initialize the dual-channel probability map. After iterative training and convergence on the training set, it calculates the global importance score of each agent and performs cluster analysis to divide them into a set of highly stable kernels and a pool of electrons to be excited.

[0020] The complexity assessment module is used to evaluate the task complexity after the division of each agent into online reasoning stages. It receives natural language queries input by the user and evaluates the task complexity by calculating information dispersion and semantic reasoning depth.

[0021] The topology generation module is used to complete budget mapping based on the natural language query, the information dispersion, and the semantic reasoning depth, and obtain a task complexity score; it calculates the context affinity between the candidate agents in the electron pool and the current task through a gating network, selects the activation set, and forms an active agent set together with the core agent; and it optimizes the graph structure and memory through edge probability calculation, KV cache reuse, and DAG repair algorithms, and outputs an executable topology structure.

[0022] The topology execution module is used to introduce structure-aware loss based on the executable topology, strengthen the "core-core" and "core-electron" connections, weaken the "electron-electron" connections, and use the PPO algorithm for end-to-end fine-tuning to solidify the stability of the hierarchical structure.

[0023] An online learning module is used to build an online evolution mechanism for the nuclear-electronic architecture: establish a successful topology log library, record high-scoring collaborative structures in online inference, and analyze the log library regularly.

[0024] The beneficial effects of this invention are as follows:

[0025] High flexibility and robustness: Through the trust chain mechanism, the system can seamlessly take over tasks when an agent unexpectedly exits (Dropout) or fails, ensuring that the task flow is not interrupted;

[0026] Dynamic adaptability: Supports dynamically adding or removing agents during task execution and can rebalance the load based on real-time status;

[0027] Improved execution efficiency: By combining spatial prediction with the swarm intelligence layer, the time spent by agents searching for targets in the environment is reduced; the dual capacity allocation algorithm optimizes resource allocation, significantly improving throughput and reducing task conflict rate compared to existing technologies. Attached Figure Description

[0028] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below.

[0029] Figure 1 This is the topology generation paradigm diagram of the system of the present invention;

[0030] Figure 2 The data flow diagram for the overall system architecture of this invention illustrates the entire process from offline training to online inference;

[0031] Figure 3 This is a schematic diagram illustrating the principle of the dual-channel topology generation and structure-aware loss function of the present invention. Detailed Implementation

[0032] To make the technical principles, implementation details, and beneficial effects of this invention clearer, the following will describe in detail the implementation methods in conjunction with specific mathematical models and algorithmic logic. It should be noted that the following detailed descriptions are exemplary and intended to provide further explanation of the invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of exemplary embodiments according to the invention.

[0033] like Figure 2 As shown, this invention provides a budget-controllable multi-agent cooperative topology generation method based on a core-electronic hierarchical architecture. The embodiments of this invention are built on a heterogeneous multi-agent environment, where the total set of agents is denoted as . Each of the intelligent agents Bind a specific system prompt word. ) and a learnable role embedding vector ).For example, It can include roles such as "mathematical problem solver", "Python code interpreter", "common sense reasoner" and "logic verifier".

[0034] In a preferred embodiment of the present invention, in order to further optimize the system's inference latency and memory usage, the complete set of intelligent agents... It supports heterogeneous computing configuration. Specifically, the system decouples the logical roles of agents from the physical foundation models at the underlying level and allocates differentiated computing resources based on the hierarchical structure defined by subsequent offline learning: for the "nucleus" agent, which serves as the collaborative backbone, it is configured to be driven by a foundation model with high parameter count and strong logical reasoning capabilities (such as a large model with more than 70 parameters or the master expert of the MoE model) to ensure the strict adherence to complex instructions; for the "electron" agent, which serves as a dynamic supplement, it is configured to be driven by a lightweight, low-latency model (such as a small model with 7B / 8B parameters or a domain-specific distillation model). This configuration enables the system to significantly reduce the computing cost of edge nodes while ensuring core reasoning capabilities, achieving Pareto optimality in performance and efficiency.

[0035] Furthermore, the objective of this embodiment of the invention is to address a given query. and the current interaction round Generate an optimized collaboration graph:

[0036]

[0037] in This represents the currently active subset of agents (composed of nuclear agents and activated electronic agents). The communication path in single-round reasoning is defined; Represents intelligent agents When generating a response, the agent will be... The current output is used as context input; The memory retrieval path across rounds was defined; Represents intelligent agents In the The wheel will retrieve the intelligent agent. In the Historical memories of wheels.

[0038] Furthermore, the embodiments of the present invention are implemented through the following technical solutions:

[0039] Step S1: Constructing a dual-channel probability map and offline kernel learning

[0040] Furthermore, such as Figure 1 As shown in the embodiments of this application, step S1 aims to automatically emerge the "stability backbone" of the system from unlabeled multi-task data through reinforcement learning, specifically including the following steps:

[0041] S11: Construct and initialize the dual-channel probability map

[0042] Furthermore, in this embodiment, a dual-channel probability graph is first constructed, which serves as a supergraph containing all agents during the initialization phase. Specifically, two parameter matrices are constructed. and These correspond to the Logits of spatial and temporal connections, respectively, and define two edge types: Spatial Edge for information aggregation within a single round, and Temporal Edge for memory retrieval across rounds. During initialization, a Gaussian distribution with a mean of 0 and a variance of 0.02 is used for random filling. At this point, the graph is in a "soft fully connected" state.

[0043] S12: Topology Search Based on Policy Gradient

[0044] Based on the initialized dual-channel probability map, policy gradient algorithms or evolutionary policy algorithms are used on the multi-task training set. The process is iterated until it converges to a high-return collaboration pattern. For each batch of data, the following steps are performed:

[0045] Sampling: Utilizing the Gumbel-Sigmoid reparameterization technique or Bernoulli sampling, based on... Generate a binary temporary adjacency matrix .in The representative sigmoid activation function is used to map continuous parameter values ​​to... The probability distribution of the interval; The learnable edge weight parameter matrix (Logits) contains the spatial connectivity parameter matrix. Time-connected parameter matrix It is used to parameterize the spatial and temporal dependencies between agents.

[0046] Implementation and Evaluation: Based on Perform multi-agent dialogue and receive task rewards. (1 for correct, 0 for incorrect).

[0047] Parameter update: Apply REINFORCE algorithm for update The gradient direction is ,in The moving average baseline is used. This process drives the model to increase the weights of high-value connections and suppress invalid connections.

[0048] S13: Quantification of Node Importance

[0049] Furthermore, after training converges, the edge weight distribution after training is used to calculate the weights for each agent. Global importance score The score is a weighted sum of spatial in-degree / out-degree and temporal in-degree / out-degree, as shown in the following formula:

[0050]

[0051] in (For example, take 0.3) to adjust the importance of cross-wheel memory.

[0052] S14: One-dimensional adaptive K-Means clustering partitioning

[0053] Furthermore, to avoid manually setting thresholds, embodiments of the present invention utilize unsupervised clustering algorithms (such as K-Means, Gaussian Mixture Model, GMM) or percentile-based adaptive threshold segmentation mechanisms to segment the agent set. Divide into sections.

[0054] In this embodiment, a one-dimensional K-Means clustering method is used: based on the statistical distribution characteristics of importance scores, the entire set of agents is dynamically divided into a highly stable "nucleus set" and an "electron pool" to be activated. The specific implementation process is as follows: first, two centroids are initialized. Then, the centroids are updated iteratively to minimize the intra-cluster variance:

[0055]

[0056] Furthermore, after convergence, let... , The adaptive threshold is calculated. Ultimately, the importance score will be higher than the threshold. The intelligent agents are classified into the kernel set. The rest are allocated to the electron pool. .

[0057] S2: Multidimensional Task Complexity Evaluation Based on Semantic Features

[0058] Furthermore, in this embodiment, S2 runs in real time during the inference phase, without requiring fine-tuning of the Large Language Model (LLM). During online inference, the system's backbone Large Language Model (LLM) receives natural language queries input by the user and evaluates task complexity by calculating information dispersion and semantic inference depth. The specific steps are as follows:

[0059] S21: Information Dispersion Calculation

[0060] Furthermore, S21 mainly comprises two parts:

[0061] Semantic divergence sub-items: will query Divided into Each clause is used to calculate its embedding vector. Embedded with the whole sentence The mean cosine distance is the distance between the query and the query. The larger the distance, the more diverse the semantic topics contained in the query.

[0062] Entity density sub-item: Utilize regular expression matching to statistically analyze domain-specific keywords (such as mathematical symbols) in the query. , Density of logical connectors ("Therefore", "Assuming") Its information dispersion The calculation formula is as follows:

[0063]

[0064] in, and These are preset weighting coefficients; The semantic divergence is represented by the embedding vectors of each clause in the query statement. With the global embedding vector of the whole sentence The average cosine distance between them; It is a hyperbolic tangent function used for nonlinear smoothing and normalization of density features.

[0065] S22: Semantic Reasoning Depth Calculation

[0066] Further, the query Input into the backbone LLM and extract the output hidden state of the first layer Transformer. (Representing shallow lexical features) and the last layer Output (Representing deep logical features), calculate the representational drift, and its semantic reasoning depth. The calculation formula is as follows:

[0067]

[0068] Furthermore, a large drift indicates that the model has undergone complex nonlinear transformations in the deep network (i.e., "deep thinking"); a small drift indicates that the shallow features are sufficient to characterize the task (i.e., a simple task).

[0069] S3: Computational Budget Generation and Electron Dynamic Excitation

[0070] Furthermore, in this embodiment, step S3 constructs a mapping function from complexity score to integer budget value, and determines the number of additional agents required for the current task (i.e., the budget value) based on the calculated complexity score. Using a gated attention network, the contextual affinity of all candidate agents in the electron pool to the current task is calculated, and combined with structural bias terms, Top-ranked agents are selected. The most suitable electronic agent is activated, forming an "active agent set" together with the nuclear agent. The specific steps are as follows:

[0071] S31: Budget Mapping

[0072] Furthermore, the information dispersion calculated based on S2 and semantic reasoning depth The calculated overall score is:

[0073]

[0074] in, , , These are the preset weight coefficients corresponding to the information dispersion, semantic reasoning depth, and sequence capacity features, respectively. The sequence length characteristic of the input query (usually measured by the number of tokens).

[0075] Furthermore, based on the overall score, a preliminary budget value is obtained. :

[0076]

[0077] in, This represents the empirical mean of the historical task complexity score. The empirical standard deviation of the historical task complexity score is represented by both, and the Sigmoid function is used to calculate the overall score. Smooth mapping and normalization to The probability range.

[0078] Furthermore, based on this, this embodiment introduces resource-aware dynamic truncation logic, and the system monitors the current hardware load status (such as GPU memory utilization) in real time. Request queue length ), final budget Revised to:

[0079]

[0080] in, This represents the initial budget value, indicating the number of basic (target) agents required to supplement the current task complexity under ideal hardware conditions; The maximum number of agents that can be accommodated is dynamically calculated based on the remaining video memory. When the system is under high load, the algorithm automatically tends to generate a more streamlined topology, prioritizing service availability rather than maximizing inference depth, thus achieving flexible degradation of Quality of Service (QoS).

[0081] S32: Conditional Electron Excitation

[0082] Furthermore, embodiments of this application construct a gating network. The input is the query embedding. and electronic embedding Calculate the context affinity of all candidate agents in the electron pool with the current task to obtain the activation Logits, as shown in the following formula:

[0083]

[0084] in, Indicates candidate electronic intelligent agents Logits score of the probability of being triggered by the current task; Indicates the current input query The transpose of the feature embedding vector; This represents the learnable projection weight matrix in the gated attention network, used to calculate the context affinity matching score between the query task and the agent; These are prior biases learned offline. Select the activation set and apply them to all... Sort, select the first Each agent joins the active agent set. .

[0085] S4: Conditional sampling of dual-channel cooperative topology

[0086] S41: Dual-channel connectivity prediction

[0087] Furthermore, for Any pair of nodes in , concatenate its feature vectors The probability of obtaining a spatial edge is: The time-side probability is: .

[0088] Furthermore, regarding the step S41 above, based on time-side probabilities... To predict and generate cross-turn temporal edges, this embodiment introduces an underlying memory optimization mechanism based on key-value cache reuse. In multi-turn dialogue scenarios, if the generator predicts the existence of temporal edges... That is, the agent in the current round. Need to backtrack intelligent agent The system maintains a global context memory pool at the system level, storing key-value cache pointers for each active agent from the previous round. When a time edge is activated, the execution controller directly retrieves the key-value cache pointers from the memory pool. The KV Cache physical pointers are concatenated to Instead of re-entering the original text for encoding, the prefix context is used. This mechanism reduces the computational cost of cross-round retrieval to While significantly improving inference speed, the complexity of the system also significantly reduces peak memory usage during multi-agent concurrency.

[0089] S42: DAG Repair Algorithm (DAGRepair Mechanism)

[0090] Furthermore, the system first processes the spatial edge probabilities calculated in step S41. Sampling is performed to generate a preliminary graph containing spatial dependencies. Since the spatial graph must be acyclic to ensure execution flow, the system uses the initial graph generated from sampling. Perform the following steps:

[0091] Step 1: Perform Depth-First Search (DFS) and maintain a recursive stack to detect back-edges.

[0092] Step 2: If a loop is detected Query the set of probability values ​​for each edge in a loop. ;

[0093] Step 3: Identify the edge with the lowest probability ;

[0094] Step 4: Force Removal This means setting the corresponding position in the adjacency matrix to zero;

[0095] Step 5: Repeat Steps 1 to 4 above until the diagram is displayed. There are no loops in the output, and the final executable topology is output.

[0096] S5: Structure-Aware Regularization and Composite Optimization

[0097] Furthermore, such as Figure 3 As shown, in order to maintain the stability of the kernel structure during online training and prevent the model from degenerating into a disordered structure, this embodiment introduces a structure-aware loss based on the final executable topology. By mathematically constraining the "nuclear-nuclear" and "nuclear-electron" connection strengths to be significantly higher than the "electron-electron" connection strength, a hierarchical structure is solidified in the potential space, resulting in a loss of structure perception. The following three implementation methods are included:

[0098] Implementation Method 1: Optimal Implementation Based on Max-Margin Loss

[0099] Furthermore, based on the generated adjacency matrix Calculate the average activation intensity of the three regions:

[0100]

[0101] in, This represents the average connection strength between core nodes; This represents the average connection strength between nuclear nodes and electron nodes; This represents the average connection strength between electronic nodes.

[0102] Furthermore, in this embodiment, it is required that and ,in It is a preset boundary value (e.g., 0.2). The gradient backpropagation of this loss function will suppress the formation of isolated small groups between electronic nodes, forcing information to be exchanged through the "core", thereby ensuring the connectivity and robustness of the topology.

[0103] Implementation Method 2: Alternative Implementation Based on KL Divergence

[0104] In another feasible implementation, the system predefines an "ideal hierarchical distribution matrix". The value corresponding to the core region is set to 1 (or a high probability value), and the value corresponding to the electron-electron region is set to 0 (or a low probability value). This relates to the spatial edge probability in step S41. The current probability adjacency matrix is ​​constructed With the ideal matrix Minimize the Kullback-Leibler divergence:

[0105]

[0106] In this embodiment, the generated topological distribution is driven to converge toward the ideal nuclear-electronic architecture by minimizing the KL divergence.

[0107] Implementation Method 3: An Alternative Implementation Based on Contrastive Learning

[0108] In another feasible implementation, the system employs a contrastive learning paradigm, defining connections between core nodes as "positive pairs" and connections between electron nodes as "negative pairs." In the embedding space, positive pairs are brought closer together and negative pairs are pushed further apart through an InfoNCE Loss or similar objective function, thereby implicitly strengthening the hierarchical structure.

[0109] Furthermore, this application embodiment has undergone comprehensive optimization, constructing a composite objective function that includes a task accuracy reward and a communication cost penalty. The system employs the Proximal Policy Optimization (PPO) algorithm for end-to-end fine-tuning, and its reward function formula is as follows:

[0110]

[0111] in, This is a sparsity penalty based on edge density.

[0112] Furthermore, based on the reward function, the final loss function is calculated:

[0113]

[0114] S6: Online Evolution Mechanism for Core-Electron Architecture

[0115] Furthermore, the system of this invention also possesses long-term adaptive evolution capabilities by maintaining a "successful topology log library" to record high-scoring collaborative structures in online inference, and setting a reorganization cycle (e.g., every...). Statistical analysis is performed on the successful topology log database (either every call or every 24 hours), including:

[0116] Promotion mechanism: If a certain electronic agent is detected If an agent's activation frequency exceeds a preset threshold and its average accuracy in participating tasks is significantly higher than the baseline, the system will automatically "promote" it to a core agent and update it. Set up the collection and reinitialize its connection weights;

[0117] Demotion mechanism: Conversely, if a certain nuclear agent... If the usage frequency or contribution level of an agent is consistently below a threshold, the system will "downgrade" it to an electronic intelligent agent, releasing the video memory resources it has been occupying for a long time.

[0118] Furthermore, in the embodiments of this application, the dynamic evolution mechanism that combines promotion and demotion ensures that the system can adapt to data distribution drift in business scenarios.

[0119] In one exemplary embodiment, a budget-controllable multi-agent cooperative topology generation system based on a core-electronic hierarchical architecture is provided, comprising:

[0120] The offline learning module is used to construct and initialize the dual-channel probability map. After iterative training and convergence on the training set, it calculates the global importance score of each agent and performs cluster analysis to divide them into a set of highly stable kernels and a pool of electrons to be excited.

[0121] The complexity assessment module is used to evaluate the task complexity after the division of each agent into online reasoning stages. It receives natural language queries input by the user and evaluates the task complexity by calculating information dispersion and semantic reasoning depth.

[0122] The topology generation module is used to complete budget mapping based on the natural language query, the information dispersion, and the semantic reasoning depth, and obtain a task complexity score; it calculates the context affinity between the candidate agents in the electron pool and the current task through a gating network, selects the activation set, and forms an active agent set together with the core agent; and it optimizes the graph structure and memory through edge probability calculation, KV cache reuse, and DAG repair algorithms, and outputs an executable topology structure.

[0123] The topology execution module is used to introduce structure-aware loss based on the executable topology, strengthen the "core-core" and "core-electron" connections, weaken the "electron-electron" connections, and use the PPO algorithm for end-to-end fine-tuning to solidify the stability of the hierarchical structure.

[0124] An online learning module is used to build an online evolution mechanism for the nuclear-electronic architecture: establish a successful topology log library, record high-scoring collaborative structures in online inference, and analyze the log library regularly.

[0125] Through the above detailed implementation method description, the present invention constructs a complete, closed-loop multi-agent topology generation scheme, covering the full-link technical details from low-level initialization, offline feature extraction, online complex reasoning to backpropagation optimization.

[0126] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A budget-controllable multi-agent cooperative topology generation method based on a core-electronic hierarchical architecture, characterized in that, Includes the following steps: A dual-channel probability map is constructed and initialized. After iterative training and convergence on the training set, the global importance score of each agent is calculated and cluster analysis is performed to divide them into a set of highly stable nuclei and a pool of electrons to be excited. After the division of each intelligent agent is completed, the online reasoning stage is entered, where natural language queries input by the user are received, and the task complexity is evaluated by calculating the information dispersion and semantic reasoning depth. Based on the natural language query, the information dispersion, and the semantic reasoning depth, a budget mapping is completed, and a task complexity score is obtained. The context affinity between candidate agents in the electron pool and the current task is calculated using a gating network. An activation set is selected and, together with the core agent, forms an active agent set. Based on the active agent set, graph structure optimization and memory optimization are achieved through edge probability calculation, KV cache reuse and DAG repair algorithm, and an executable topology structure is output. Based on the executable topology, a structure-aware loss is introduced to strengthen the "core-core" and "core-electron" connections, weaken the "electron-electron" connections, and use the PPO algorithm for end-to-end fine-tuning to solidify the stability of the hierarchical structure. An online evolution mechanism is constructed for the aforementioned core-electronic architecture: a successful topology log library is established to record high-scoring collaborative structures in online inference, and the log library is analyzed regularly.

2. The method for budget-controllable multi-agent cooperative topology generation based on a core-electronic hierarchical architecture according to claim 1, characterized in that, When initializing the dual-channel probability graph, a Logits parameter matrix corresponding to spatial and temporal connections is constructed and randomly filled with a Gaussian distribution with a mean of 0 and a variance of 0.02, so that the graph is in a "soft fully connected" state.

3. A budget-controllable multi-agent cooperative topology generation method based on a core-electronic hierarchical architecture as described in claim 1 or 2, characterized in that, During the iteration of the training set, the following steps are performed for each batch of data: Sampling: Using the Gumbel-Sigmoid reparameterization technique or Bernoulli sampling, a binary temporary adjacency matrix is ​​generated based on the activation function; Execution and Evaluation: Perform multi-agent dialogue based on the adjacency matrix and obtain task rewards; Parameter update: The REINFORCE algorithm is used to update the learnable edge weight parameter matrix, strengthen the weights of high-value connections, and suppress invalid connections.

4. The method for budget-controllable multi-agent cooperative topology generation based on a core-electronic hierarchical architecture according to claim 3, characterized in that, The calculation of the information dispersion includes two parts: semantic divergence and entity density. The semantic divergence sub-item is obtained by splitting the query clauses and calculating the average cosine distance between each clause and the embedding vector of the whole sentence. The larger the distance, the more divergent the semantic topic of the query. The entity density sub-item uses regular expression matching to count the density of keywords within the query.

5. A budget-controllable multi-agent cooperative topology generation method based on a core-electronic hierarchical architecture as described in claim 1 or 4, characterized in that, When calculating the semantic reasoning depth, the query input is a large language model, the output representations of the first and last layer Transformers are extracted, and the large language model is judged to have performed deep thinking by calculating the representation drift.

6. The method for budget-controllable multi-agent cooperative topology generation based on a core-electronic hierarchical architecture according to claim 5, characterized in that, When performing the budget mapping, resource-aware dynamic truncation logic is introduced to monitor the current hardware load status in real time to determine the final budget.

7. The method for budget-controllable multi-agent cooperative topology generation based on a core-electronic hierarchical architecture according to claim 1, characterized in that, The edge probability calculation includes spatial edge probability and temporal edge probability; Regarding the time edge probability, if the generator predicts the existence of a time edge, the current agent needs to backtrack to the memory of the previous agent. The system reuses the Key-Value Cache through the global context memory pool to avoid repeated encoding and improve inference speed. The spatial edge probabilities are sampled to generate a preliminary graph. To ensure that the spatial graph is acyclic, the following steps are performed on the preliminary graph: a. Perform a depth-first search and maintain a recursive stack to detect backward edges; b. If a loop is detected, query the set of probability values ​​for each edge in the loop; c. Identify the edge with the lowest probability; d. Forcefully remove the edge with the lowest probability, that is, set the corresponding position in the adjacency matrix to zero; e repeats from a to d until there are no loops in the graph, and outputs the final executable topology.

8. A budget-controllable multi-agent cooperative topology generation method based on a core-electronic hierarchical architecture as described in claim 1 or 7, characterized in that, The three implementation methods of the structure-aware loss include: the optimization method based on maximum edge loss, the alternative KL divergence method, and the contrastive learning method. The preferred method based on maximum edge loss calculates the average connection strength between nodes based on the adjacency matrix, uses gradient backpropagation to suppress the isolation of electronic nodes, forces information to flow through the core node, and ensures the connectivity and robustness of the topology. The alternative KL divergence method: by minimizing the divergence between the generated probability adjacency matrix and the ideal hierarchical distribution matrix of "high probability in the core region and low probability in the electron-electron region", the topology is made to converge to the core-electron architecture. The contrastive learning method sets the connections between core nodes as positive sample pairs and the connections between electronic nodes as negative sample pairs. By using an objective function, the distance between positive sample pairs is brought closer and the distance between negative sample pairs is pushed further apart in the embedding space, thereby strengthening the hierarchical structure.

9. The method for budget-controllable multi-agent cooperative topology generation based on a core-electronic hierarchical architecture according to claim 8, characterized in that, The online evolution mechanism for the nuclear-electronic architecture includes a promotion mechanism and a demotion mechanism. The promotion mechanism is as follows: when the activation frequency of an electronic agent exceeds a preset threshold and the average accuracy of a task is higher than the baseline, the system will automatically promote it to a core agent, update the set, and reinitialize the connection weights. The degradation mechanism involves downgrading core agents with long-term usage frequency or contribution levels below a threshold to electronic agents and releasing their memory resources, thereby adapting to the data distribution drift in business scenarios.

10. A budget-controllable multi-agent cooperative topology generation system based on a core-electronic hierarchical architecture, characterized in that, include: The offline learning module is used to construct and initialize the dual-channel probability map. After iterative training and convergence on the training set, it calculates the global importance score of each agent and performs cluster analysis to divide them into a set of highly stable kernels and a pool of electrons to be excited. The complexity assessment module is used to evaluate the task complexity after the division of each agent into online reasoning stages. It receives natural language queries input by the user and evaluates the task complexity by calculating information dispersion and semantic reasoning depth. The topology generation module is used to complete budget mapping based on the natural language query, the information dispersion, and the semantic reasoning depth, and obtain a task complexity score; it calculates the context affinity between the candidate agents in the electron pool and the current task through a gating network, selects the activation set, and forms an active agent set together with the core agent; and it optimizes the graph structure and memory through edge probability calculation, KV cache reuse, and DAG repair algorithms, and outputs an executable topology structure. The topology execution module is used to introduce structure-aware loss based on the executable topology, strengthen the "core-core" and "core-electron" connections, weaken the "electron-electron" connections, and use the PPO algorithm for end-to-end fine-tuning to solidify the stability of the hierarchical structure. An online learning module is used to build an online evolution mechanism for the nuclear-electronic architecture: establish a successful topology log library, record high-scoring collaborative structures in online inference, and analyze the log library regularly.