Large-scale multi-agent collaborative reasoning method and social network simulation system
By adopting the method of information entropy grouping and graph attention network driven in large-scale social network simulators, dynamically classify agents and introduce bias design, the problems of simplification of interaction logic, large computing power overhead and insufficient simulation accuracy in multi-agent collaborative reasoning are solved, and efficient and accurate social behavior simulation is achieved.
Patent Information
- Application Number
- CN202511086731.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-05
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2045-08-05
AI Technical Summary
In the existing large-scale social network simulator, the multi-agent collaborative reasoning method has problems such as simplification of interactive logic, large computing power overhead and insufficient simulation accuracy, making it difficult to effectively simulate complex social behaviors.
Adaptive grouping method based on information entropy is adopted to dynamically classify agents into core and conventional agents, use graph attention networks to drive conventional agents in parallel, combine large language models to drive core agents for interaction, and introduce bias design to simulate individual cognitive bias.
A proxy interaction mechanism that is more in line with social laws is realized, computing power overhead is reduced, simulation accuracy and efficiency are improved, and complex behaviors in real social networks can be better simulated.
Smart Images

Figure CN120579647A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer software technology, and in particular to a large-scale multi-agent collaborative reasoning method and a social network simulation system. Background Art
[0002] The application of multi-agent systems in large-scale social network simulators is gaining increasing attention. Large-scale social network simulators are scientific instruments used to study the complex patterns of human social behavior. They can simulate the complex interactions and reasoning processes found in real society, such as the spread of events.
[0003] For large-scale social network simulators, achieving efficient collaborative reasoning among multiple agents is a core challenge. Taking the simulation of social network event propagation as an example, "collaborative reasoning" can be understood as the process by which each agent updates its social strategy and position as public opinion evolves, thereby simulating the course of events and analyzing complex social behavior. Complex social network simulations involve the collaborative cooperation and group evolution of a large number of agents based on a large language model (LLM). The high complexity of the system makes efficient collaborative reasoning among agents difficult.
[0004] Due to the need to expand the scale of intelligent agents in large-scale social network simulators, existing collaborative reasoning methods are as follows: (1) Random Sampling Strategy: There is a technical problem of oversimplification of interaction logic modeling. At simulation scales of 10 to 100, some existing technologies use a random sampling strategy when designing large language model agent interactions. That is, a large language model agent randomly selects a specified number of other agents and communicates with them one by one. This is a preliminary strategy for large-scale work. In order to increase the simulation scale, it oversimplifies the interaction logic of humans in the real world. Subsequent work needs to design an agent interaction mechanism that is more in line with social laws.
[0005] (2) Large-scale parallel reasoning framework: There is a technical problem of high computing power overhead. At the scale of 10,000 to 1 million, the OASIS simulator achieves efficient parallel reasoning through asynchronous information channels and GPU reasoning managers; and in order to improve the reasoning rate of intelligent agents, the SocioVerse simulator uses vllm technology to deploy the Qwen2.5 model, 72b-Instruct model, and Llama3-70b-Instruct model on 8 NVIDIA RTX 4090 GPUs for parallel reasoning. However, the OASIS simulator has too much computing power overhead. The simulation of one million intelligent agents requires parallel computing of 27 A100s, and a round of time step simulation (traversing all intelligent agents) takes 18 hours. The SocioVerse simulator work has not yet clearly mentioned the total number of intelligent agents and the running time of a single round of simulation, but based on the computing power configuration in its paper, it is speculated that the reasoning time cost at the scale of 10 million intelligent agents is still relatively high. With the need to expand the scale of simulators in collaborative reasoning, real-time and long-term calls to large-scale language model agents (such as thousands or tens of thousands) for interaction will lead to huge computing power overhead, thus restricting further improvements in simulation scale and performance.
[0006] (3) Hybrid framework strategy: Simulation accuracy needs to be improved. At the simulation scale of hundreds to thousands, the HiSim framework proposes a hybrid strategy for dynamic simulation of social platform events. This hybrid strategy divides users into a small number of core users and a large number of regular users based on the number of fans. The core agent's situational reasoning is driven by a large language model, and the regular agent's situational reasoning is driven by an "agent-based model" (ABM). The ABM that drives the regular agent here refers to a simple mathematical model defined based on social science laws, including the HK model and the Lorenz model. Its computational complexity is low and can accelerate the reasoning of social situations. However, due to the simple operation logic of the ABM used and the serial structure of the operation logic, the simulation accuracy of most regular agents needs to be improved. At the same time, the large language model that drives the core agent is affected by the pre-training data and still shows a factual tendency for the simulated social events, making it difficult to simulate the subjective bias of individuals in real social networks. Therefore, the simulation accuracy of the existing hybrid framework needs to be improved. Summary of the Invention
[0007] To solve the above technical problems, the present invention provides a large-scale multi-agent collaborative reasoning method and a social network simulation system.
[0008] In order to solve the above technical problems, the present invention adopts the following technical solutions: In a first aspect, the present invention provides a large-scale multi-agent collaborative reasoning method, comprising: Use agents to simulate users in a social network, assign character portraits to all agents, and construct the agent social network topology; Iterate the following steps at each time step until the situation deduction of the event to be simulated is completed: Calculate the entropy of the stance values of all agents in the previous time step; sort them in descending order of entropy, select the agents with the previously set ratio as the core agents for the next time step, and the remaining agents as regular agents; Conventional agents are driven in parallel by a graph attention situational deduction model based on a graph attention network. By aggregating the static and dynamic features of neighboring agents, the stance value of each agent at the next time step is recursively predicted. The core agent is driven by a large language model, generates stance text based on character profiles and bias design, and interacts with other core agents based on stance text. It retrieves event-related content based on the previous round of tweets on social networks and updates the social network tweet context. The bias design simulates cognitive biases through customized bias prompt words. The core agent's stance text is mapped into stance values through a scorer based on a large language model, and the current core agent's stance value predicted by the graph attention situation deduction model is replaced.
[0009] In one embodiment, simulating users in a social network through agents, assigning character portraits to all agents, and constructing an agent social network topology specifically includes: A sampling method based on real macro-distribution is used to construct character portraits, which include name, initial stance value towards the event, age, gender, nationality, occupation, personality, and hobbies.
[0010] In one embodiment, the agent further includes a memory module and a reasoning module; the memory module is used to store the tweet environment of the social network; the core agent sends tweets or interacts with other core agents through the reasoning module.
[0011] In one embodiment, calculating the entropy of the stance values of all agents at the previous time step specifically includes: Based on the social network topology, calculate the time steps of each agent in the previous time step. The entropy value of the attitude value of the event: ; is the i-th agent at the previous time step The entropy value of the stance value of the event, each agent at the previous time step The entropy value set , is the total number of agents, ; Indicates that at the previous time step Middle, position value The frequency of appearance in the position values of the neighboring agents of the i-th agent; Indicates that at the previous time step Middle, position value The number of times it appears in the position values of the neighboring agents of the i-th agent; , is the neighbor agent of the i-th agent at the previous time step The set of position values, express The cardinality of Indicates the neighboring agent of the i-th agent at the previous time step A vector of position values, It is an operation that groups the elements in a vector into a set.
[0012] In one embodiment, the conventional agent is driven in parallel by a graph attention situational deduction model based on a graph attention network. The static and dynamic features of neighboring agents are aggregated to recursively predict the position value of each agent at the next time step, specifically including: Based on the predicted stance values of the agent at each historical time step, the individual situation characteristics and neighbor situation characteristics are calculated in parallel, and the dynamic characteristics of the agent are constructed; The embedding of the character portrait corresponding to the intelligent agent is used as the static feature of the intelligent agent. The static feature and the dynamic feature are respectively passed through the multi-layer perceptron and then spliced to obtain the final situation feature; The final state features of the agent and the information of neighboring agents are input into the graph attention network composed of two layers of graph attention convolution layers. By performing attention-based aggregation on the features of neighboring agents, the stance value of each agent in the next time step is predicted.
[0013] In one embodiment, the method of calculating the individual situation characteristics and neighbor situation characteristics in parallel based on the stance value predicted by the agent at each historical time step, and constructing the dynamic characteristics of the agent, specifically includes: The last time step of the i-th agent The individual situation vector is recorded as ; Represents the last time step of the i-th agent The position value, , , is the total number of agents, Represents the transpose of the matrix; constructs the group situation matrix ; Construct the local neighborhood situation matrix for each agent: ; in, is the local neighborhood situation matrix of the ith agent, Represents the set of neighboring agents of the i-th agent. The local neighbor situation matrix of each agent is filled based on the number of the maximum neighbor agents, and the filled local neighbor situation matrix is spliced into the global neighbor situation matrix ; ; for The corresponding filled local neighborhood situation matrix; Represents an operation that stacks the input matrix into a new matrix along a new dimension; Based on the group situation matrix Calculate the previous time step The previous agent's own state mean , Situation Standard Deviation , situation maximum , situation minimum and the latest situation value , and obtain the individual situation feature matrix of the agent group : ; Based on the neighbor situation feature matrix And the corresponding mask matrix Calculate the average of the neighboring states of each agent , Neighborhood Status Standard Deviation , the Pearson correlation coefficient matrix between the agent's own situation and the neighbor's situation and echo chamber effect scores , get the neighbor situation feature matrix of the agent group : ; The individual situation feature matrix and the neighbor situation feature matrix are spliced together to obtain the dynamic feature matrix : ; Represents a splicing operation.
[0014] In one embodiment, the embedding of the character portrait corresponding to the agent is used as the static feature of the agent, and the static feature and the dynamic feature are respectively passed through a multi-layer perceptron and spliced to obtain the final situation feature, which specifically includes: The character portrait text corresponding to the intelligent agent is passed through The encoder of the model obtains the static feature matrix of the agent ; Use two multi-layer perceptrons to perform nonlinear modeling on the dynamic feature matrix and the static feature matrix in turn: ; ; in, The previous time step The dynamic feature matrix of is the learnable weight matrix, is a learnable bias term, is the activation function; represents the dynamic feature embedding matrix, represents the static feature embedding matrix; right and Splice and get the last time step of the agent group The final situation feature matrix : ; Represents a splicing operation.
[0015] In one embodiment, the final state features of the agent and the information of neighboring agents are input into a graph attention network composed of two layers of graph attention convolutional layers. By performing attention-based aggregation on the neighboring agent features, the stance value of each agent at the next time step is predicted, specifically including: The neighbor agent information is the adjacency matrix obtained based on the agent social network topology; the first graph attention convolution layer of the graph attention network calculates the normalized attention score of the agent's effective neighbors for the agent through a multi-head masked attention mechanism and a neighboring edge mask obtained based on the adjacency matrix: The final situation characteristics of each agent are divided into Parts: ; represents the final state characteristics of the i-th agent, express The kth part of Calculate the jth neighbor agent of the ith agent for the ith agent in the Attention scores under attention heads , : Through the shared learnable weight matrix ,Will 、 Mapped to query space and key space respectively: ; ; express The corresponding query vector, express The corresponding key vector; then the query and key interaction is realized through the splicing operation, and the shared learnable weight , realize the importance evaluation of neighbor agents: ; ; Represents a splicing operation, represents the activation function, represents the softmax function, express The corresponding normalized attention score; Calculate all neighboring agents of the ith agent for the ith agent in The normalized attention scores under each attention head are weighted and concatenated as follows to aggregate the features of neighboring agents: ; in, Indicates concatenating the outputs of each attention head. is the set of all neighboring agents of the i-th agent; represents the embedded representation of the aggregated neighbor features of the i-th agent output by the first layer of graph attention convolutional layer; The second graph attention convolution layer of the graph attention network uses the same process as the first graph attention convolution layer, but only uses single-head attention. As the input of the second-layer graph attention convolutional layer, the position value of each agent at the next time step is inferred: ; ; represents the normalized attention score of the jth neighbor agent of the ith agent for the ith agent output by the second-layer graph attention convolutional layer, represents the learnable weight matrix in the second-layer graph attention convolutional layer, represents the embedded representation of the i-th agent after aggregating neighbor features output by the second-layer graph attention convolution layer, is the activation function, Next time step for the i-th agent The position value.
[0016] In one embodiment, the training process of the graph attention situation inference model includes: Overall loss function of the graph attention situation inference model for: ; 、 is the weight parameter; individual state error The prediction vector composed of the position values of each agent at each time step is used to measure the graph attention situation deduction model The corresponding position numerical label vector The mean square error between: ; in, , is the total number of agents, represents the L2 norm; Global situation error Used to measure the position values of all users at each time step predicted by the graph attention situation inference model The mean , and the corresponding position numerical label The mean The mean square error of: .
[0017] In a second aspect, the present invention provides a social network simulation system, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method of any one embodiment of the first aspect when executing the computer program.
[0018] Compared with the prior art, the beneficial technical effects of the present invention are: 1. Aiming at the simple and static agent interaction logic in current collaborative reasoning methods, this paper provides an adaptive grouping method based on information entropy, which dynamically classifies agents into "core-conventional" categories, and more effectively simulates an agent interaction mechanism that conforms to social laws.
[0019] 2. This paper addresses the computational overhead of current collaborative reasoning methods by providing a hierarchical reasoning method that integrates a large language model with a graph attention network. A small number of core agents in the upper layer are driven by the large language model and communicate with each other by generating position text. Simultaneously, a trainable graph attention situational inference model is designed to drive a large number of conventional agents in the lower layer. This model utilizes a parallel computing framework to directly recursively predict the agent's position value rather than generating textual information. This significantly reduces the computational overhead of social network simulations and accelerates the recursive inference of the evolution of social events.
[0020] 3. To address the simulation accuracy issues of existing hybrid frameworks for social network simulation, this paper proposes a trainable, modular, and fine-grained graph attention situational inference model to drive the numerical position inference of conventional intelligent agents in parallel. Compared with traditional sociological models, this model is more efficient, clearer, and more scalable. Furthermore, a bias design for simulated events is introduced into the core intelligent agent driven by a large language model to simulate individual cognitive biases in the real world, effectively overcoming the factual bias caused by pre-trained data in traditional large language models. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 is a flow chart of a method in an embodiment of the present invention; Figure 2 This is a general framework diagram based on dynamic hierarchical collaboration in an embodiment of the present invention; Figure 3 This is a design diagram of the key modules of the core intelligent agent in an embodiment of the present invention; Figure 4 This is a modular design diagram of the graph attention situation deduction model in an embodiment of the present invention; Figure 5 Schematic diagram of the training scheme of the graph attention situation deduction model in an embodiment of the present invention. DETAILED DESCRIPTION
[0022] A preferred embodiment of the present invention will be described in detail below with reference to the accompanying drawings.
[0023] like Figure 1 As shown, the present invention provides a large-scale multi-agent collaborative reasoning method, comprising the following steps: S1, simulates users in the social network through intelligent agents, assigns character portraits to all intelligent agents, and constructs the intelligent agent social network topology; S2, iterate the following steps at each time step until the situation deduction of the event to be simulated is completed: S21, calculate the entropy of the stance values of all agents in the previous time step; sort them in descending order of entropy value, select the agents with the previously set ratio as the core agents in the next time step, and the remaining agents are regular agents; S22, conventional agents are driven in parallel using a graph attention situational deduction model based on a graph attention network. By aggregating the static and dynamic features of neighboring agents, the stance value of each agent at the next time step is recursively predicted. S23: The core agent is driven by a large language model, generates position text based on character portraits and bias design, and interacts with other core agents based on position text. It retrieves event-related content based on the previous round of tweets on the social network and updates the social network tweet environment. The bias design simulates cognitive biases by customizing bias prompt words. S24, maps the core agent's stance text into stance values through a scorer based on a large language model, and replaces the current core agent's stance value predicted by the graph attention situation deduction model.
[0024] Based on the existing hybrid framework strategy, this paper proposes a dynamic agent grouping strategy based on information entropy to simulate the dynamics of opinion leaders in social networks; this paper designs a graph attention situational inference model based on graph attention network to model the complex group interaction mechanism in which the position numerical information of conventional agents is affected by neighboring agents; at the same time, based on the existing large language model core agent modeling, individual bias design is introduced to better simulate individual cognitive biases in real social networks.
[0025] like Figure 2 As shown, the overall architecture of the present invention has three core features - dynamics, stratification and collaboration, which simulate and recursively deduce the evolution of social events. In terms of dynamics, the present invention proposes an agent adaptive grouping strategy based on information entropy, which is used to simulate the dynamic speaking mechanism of opinion leaders in social networks under information games, so as to optimize the technical problem of over-simplification of agent interaction logic modeling in existing collaborative reasoning methods. From sociological theory, we know that opinion leaders are not concentrated in specific groups or classes, but are evenly distributed in any group and class in society; at the same time, opinion leaders often play the role of "middlemen" in the communication process, are exposed to a wider range of media information, and reintegrate and disseminate it to other audiences. Therefore, the agent adaptive grouping strategy based on information entropy can better model and reflect the dynamics of opinion leaders.
[0026] In terms of hierarchical nature, the present invention proposes an agent hierarchical reasoning that integrates graph attention networks and large language models to drive conventional and core agents respectively, thereby taking into account the technical requirements of optimizing computing power overhead and improving simulation accuracy. Specifically, in order to reduce the call of large-scale language models and optimize the simulation accuracy of traditional sociological models, the present invention designs a trainable graph attention situation deduction model. This model can dynamically calculate and integrate a large number of historical position data of conventional agents, and realize recursive prediction of position numerical information through the graph attention weights between agent nodes. At the same time, in order to deal with the problem of "factual tendency" in the large language model that drives the core agent, a "bias design" for simulated events is introduced in the core agent to characterize individual cognitive biases and improve the simulation accuracy of the system.
[0027] In terms of collaboration, the present invention implements a communication strategy between intelligent agents based on the existing hybrid framework, enabling intelligent agents to share information and deduce event situations.
[0028] The following is a detailed introduction to the technical solution of the present invention in several parts.
[0029] 1. Adaptive grouping strategy of intelligent agents based on information entropy.
[0030] In order to obtain the agent grouping for the next time step, the present invention calculates the entropy value of each agent's attitude towards the simulated event at the previous time step t based on the existing social network topology. , which together constitute the entropy set of the intelligent agent group , is the total number of agents, the agent index set , .in, , is the set of position values of the neighboring agents of the ith agent at the previous time step t, express cardinality. It is an operation that converts a vector into a set and deletes duplicate elements in the input vector. If the i-th agent has 4 neighboring agents, and the corresponding stance values are -1, -0.5, 0.5, and -0.5, then the vector composed of the four stance values is , is the set {-1, -0.5, 0.5}.
[0031] at the same time, , Refers to the value of a certain position in the previous time step t The number of times it appears in the stance values of the i-th agent’s neighboring agents, That is, it indicates the corresponding frequency. Then, it is sorted in descending order based on the entropy value. The function selects a small number of agents with the largest entropy as the next time step The core agent below: , and the rest of the agents are regular agents: ,in, and Indicates the next time step The index set of core agents and ordinary agents is shown in Figure 2. In a preferred embodiment, 1% of the agents are selected as core agents.
[0032] 2. Deep reasoning of the core intelligent agent driven by a large language model.
[0033] This invention uses a large language model to drive core agents for deep reasoning. Dynamically grouped core agents are treated as opinion leaders and driven by the large language model to generate positional text information. Based on the previous round of tweet context, the agent retrieves relevant content using character profiles and a memory module, and updates the tweet context through the reasoning module. In addition to the social behaviors of tweeting, commenting, and forwarding, the reasoning module also incorporates event-specific biases to simulate individual cognitive biases. The updated tweet context is then written into the agent's memory module for subsequent retrieval and reasoning.
[0034] For individual agents, character profiles need to be initialized, and individual components (memory module, reasoning module) need to be designed. For the agent environment, a social network topology needs to be constructed for multiple agents to determine their position and text interaction neighbors in the environment. At the same time, environmental component design is required (tweet page construction, news delivery). Therefore, the following describes the core agent from the perspectives of character profiles, individual components, social network topology, and environmental component design. Figure 3 .
[0035] 2.1, Intelligent agent character portrait design.
[0036] The significance of constructing character profiles lies in initializing a multi-dimensional representation of social characteristics for each agent, enabling anthropomorphic cognitive characteristics in the agent's reasoning process during simulation, thereby enabling highly reliable situational deduction at the micro level. When simulating a social network of large-scale agents, it is difficult to obtain complete personal information data of real users. Therefore, the character profile construction in this invention utilizes a sampling method based on real-world macro-distributions (such as sociological statistics and X-platforms). By designing a controllable sampling set, diverse character profile construction is achieved. In the simulation of a specific event, each agent's character profile includes the following eight dimensions. In practical applications, the number of dimensions in the character profile can be increased or decreased as needed. The specific sampling set design for each dimension is shown in Table 1.
[0037] Table 1 Character portrait sampling set design
[0038] After sampling these dimensional information, the information is consolidated into a single sentence, which serves as the agent's character profile. This sampling method, based on real-world macro-distributions, effectively aligns the characteristics of users on real social networking platforms, making the agent's simulated behavior more credible.
[0039] 2.2, Individual component design.
[0040] The individual component is based on the memory module and reasoning module in existing social network simulation work, introduces event-oriented bias design, simulates individual cognitive biases in real social networks, effectively overcomes the factual bias problem caused by pre-training data in traditional large language models, and makes the simulation process more aligned with the cognition and game mechanism of real individuals in social scenarios, so as to enhance the diversity of multi-agent interactions.
[0041] In a preferred embodiment, the bias prompt words can be designed as follows: Please express your personal biased opinion on this matter based on the information you receive. You will only change your opinion if the evidence and news become convincing. When you hear a viewpoint that differs from your own, choose the one potential point of conflict that most concerns you and express your biased opinion based on it: Educational conflict: [Fill in according to specific events]; Gender conflict: [Fill in according to the specific incident]; Family background conflict: [Fill in according to specific events]; Media ethics: [Fill in according to the specific event].
[0042] Biased design can better simulate the cognitive bias of individuals in social networks towards events.
[0043] 2.3, social network topology.
[0044] To enable information dissemination between agents, a social network topology is constructed as the basic structure for communication. Based on this social network topology, the core agent can perceive text messages from neighboring agents in a simulated tweet environment and interact with them through the behavioral space in the inference module, effectively simulating social events.
[0045] Since real social networks have the characteristics of community clustering and short average node distance, the present invention constructs a scale-free network based on the degree distribution probability of the nodes when constructing the topology, so that the degree of the nodes in the final constructed graph approximately follows the power law distribution. ,in is the degree value, is a fitting positive real number. In short, the degree of most nodes is small, while the degree of a few nodes is large.
[0046] 2.4, Environmental component design.
[0047] The environment component simulates the page structure of a social networking platform. Through a controllable configuration file that updates with the simulation content, the core agent perceives rich textual information at each simulation time step. Drawing on existing social networking simulation systems, the environment components include time, news delivery, followed tweets, and message notifications. Time displays the simulated social platform time; news delivery simulates the dynamic display of a news recommendation system; followed tweets represent the latest posts by neighboring agents, simulating the dynamic tweets that users follow on the social platform; and message notifications represent forwarding or commenting on messages by neighboring agents.
[0048] The news delivery system innovatively adopts a positive and negative news delivery strategy. In existing research, news delivery typically involves inputting a single piece of news into a simulated environment at a specific time step. This approach fails to fully reflect the multi-source and multifaceted nature of news in real social networks. Therefore, this paper introduces a positive and negative news delivery strategy into the news delivery design. This strategy involves simultaneously inputting positive and negative news about an event at a specific time step, allowing agents to personalize their perception and selection based on their individual characteristics, thereby better simulating the real-world information dissemination and decision-making process.
[0049] 3. Parallel reasoning of conventional agents accelerated by graph attention.
[0050] This paper designs a graph attention situational inference model based on a graph attention network to drive conventional agents and accelerate reasoning in parallel. For dynamically grouped conventional agents, this paper designs a trainable, modular, and fine-grained graph attention situational inference model to recursively predict their positional numerical information. The entire process is efficiently executed within a parallel computing framework. The model primarily comprises a dynamic computation module, a feature construction module, and a graph attention network. This model aims to model the complex group interaction mechanisms between conventional agents and their neighboring agents based on static and dynamic features (individual situational features and neighbor situational features). This model optimizes the use of traditional sociological situational update models in existing hybrid frameworks, thereby improving the performance of multi-agents in social network simulation scenarios.
[0051] 3.1,Graph attention situation deduction model design.
[0052] like Figure 4 As shown in the figure, the graph attention situation inference model adopts an autoregressive design. When inferring the stance values of each agent at different time steps, the stance values output at the historical time step will be used as the basis for calculating the stance values at the next time step, achieving recursive prediction. The graph attention situation inference model consists of three modules: Dynamic calculation module: Based on the position values of each agent inferred from historical time steps, the dynamic characteristics of each agent (neighborhood situation characteristics and individual situation characteristics) are calculated in parallel to achieve dynamic update of input.
[0053] Feature construction module: The static features (embedded character portraits) and dynamic features (outputs of the dynamic calculation module) of each intelligent agent are respectively passed through a multi-layer perceptron and spliced together to construct the final situational features of the intelligent agent.
[0054] Graph Attention Network (GAT): It consists of two layers of graph attention convolutional layers. The input is the final state features of each agent and the information of neighboring agents. By performing attention-based aggregation on the features of neighboring agents, the position value of each agent at the next time step is predicted.
[0055] 3.1.1, Dynamic calculation module.
[0056] A) Situation matrix initialization.
[0057] In order to parallelize the calculation of the dynamic characteristics of each agent at different time steps, it is necessary to first construct the individual situation feature matrix and the neighbor situation feature matrix of all agent groups.
[0058] The total number of agents is , agent index collection , the set of historical time steps The dynamic calculation module has accumulated the data received by each agent at time step And the stance value of the previous time step. The individual situation vector of each agent is recorded as ,in First, construct the group situation matrix : ; in, In addition, for each agent, a local neighbor situation matrix is constructed : .
[0059] in, Represents the set of neighbor agents of the i-th agent. Since the number of neighbors between agents may be different, the present invention is based on the maximum number of neighbors. The local neighborhood situation matrix of each agent is padded and the matrix shape is unified to facilitate parallel tensor calculations: ; Then the filled local neighbor situation matrix Splicing into the global neighbor situation matrix : ; Global Neighborhood Situation Matrix There is a corresponding mask matrix , used to indicate Whether each location is a real neighbor (1 indicates that a neighbor exists, 0 indicates a filler item) is an important prerequisite for the subsequent calculation of neighbor situation characteristics.
[0060] B) Calculation of individual situation feature matrix.
[0061] Based on the above initialization matrix, the following describes the parallel calculation method of the dynamic characteristics of the intelligent agent. On the one hand, the parallel calculation of the previous time step The individual situation feature matrix of the agent , including the previous time step The previous agent's own state mean , Situation Standard Deviation , situation maximum , situation minimum and the latest situation value There are five statistical features in total, each of which is an n-dimensional vector: .
[0062] exist Medium, trend mean Used to reflect the overall attitude trend of the agent towards the event: ; in, Indicates the shape A vector of all 1s.
[0063] Situation standard deviation A measure of the volatility of its position, defined as follows, ; in, The shape is ; represents the stance value of the i-th agent at time step k, represents the mean value of the i-th agent up to time step t.
[0064] Situational maximum and the situation minimum Provides information about the limits of the position: ; .
[0065] At the same time, the latest situation value Represents current state information, helping to capture sudden changes and anomalies in short-term positions: .
[0066] C) Calculation of neighbor situation feature matrix.
[0067] Parallel calculation of the previous time step Neighbor situation feature matrix of the agent , in order to better capture the interaction relationship and community influence between agents. Neighborhood status features include the last time step Previously, the average of the neighboring states of each agent , Neighborhood state standard deviation , the Pearson correlation coefficient matrix between the agent's own situation and the neighboring community's situation, and the echo chamber effect score There are four statistical features in total, each of which is an n-dimensional vector: ; Among them, the neighborhood stance mean reflects the overall stance trend of the neighborhood community.
[0068] Based on the global neighbor situation matrix initialized in the previous text And the corresponding mask matrix , calculate the neighborhood situation mean as follows: ; Represents the position value of the jth neighbor agent of the i-th agent at time step k; the local neighbor situation matrix of the i-th agent When filling, if the jth neighbor agent is a filler, then . Represents the mask value of the i-th agent and the j-th neighbor agent; the local neighbor situation matrix of the i-th agent When filling, if the jth neighbor agent is a filler, then .
[0069] Based on the above formula, when considering each neighboring agent of the i-th agent, its situation mean is as follows: .
[0070] At the same time, the standard deviation of the neighbor situation reflects the fluctuation of the neighbor community’s stance. To facilitate calculation, first transform the global neighbor situation matrix Flattened to ,in , is the flattened global neighbor situation matrix. Then, calculate the deviation value and the standard deviation of the neighbor situation : ; ; in, The shape is .
[0071] The Pearson correlation coefficient reflects the strength and direction of the long-term linear dependence between an agent and its neighboring agents. As shown below, we first express the Pearson correlation coefficient between the agent and each neighboring agent, and then obtain the Pearson correlation coefficient matrix : ; ; is the Pearson correlation coefficient between the ith agent and its jth neighbor agent, represents the average value of the stance of the jth neighboring agent of the i-th agent as of time step t.
[0072] Calculating the echo chamber score , used to quantify the intensity of the group's bias towards an event. The higher the score, the more concentrated and extreme the group's opinions are. The calculation is as follows: ; represents the Pearson correlation coefficient between the ith agent and its neighboring agents as of time step t, represents the standard deviation of the neighborhood situation of the i-th agent as of time step t.
[0073] The above features provide key neighbor information for the graph attention network, enabling the model to more accurately infer the agent's situation.
[0074] The individual situation feature matrix and the neighbor situation feature matrix are spliced together to form the overall dynamic feature matrix : .
[0075] 3.1.2, Feature construction module.
[0076] The present invention Model encoder , obtain the static features of the agent, that is, the high-dimensional text embedding of the static character portrait that reflects its basic social attributes. for The hidden layer dimensions of the model's encoder, in a preferred embodiment, The model uses the bert_base_uncased model, and its hidden layer dimension is 768.
[0077] ; A text describing the character of the agent; Represents the preprocessing operations before inputting into the BERT model, including word segmentation and encoding.
[0078] In order to capture the complex and high-order relationship dynamics between the features of intelligent agents, two multi-layer perceptrons (MLPs) are used to perform nonlinear modeling of dynamic features and static features in sequence to obtain more meaningful latent representations. Finally, the two latent representations are spliced to realize the model's fusion perception of dynamic and static features.
[0079] ; ; ; in, is the learnable weight matrix, is a learnable bias term, is the feature dimension of the final splicing, is the activation function, Thus, the present invention has obtained the final situation characteristics of the intelligent group .
[0080] 3.1.3, Graph Attention Network.
[0081] The input of the graph attention network includes not only the final state features of the above-mentioned intelligent agent , and also includes the adjacency matrix of the agent , that is, the number of directed edges between all agents. The definition is as follows, ; in, Represents a directed connection relationship between agents. Its two rows store the node indexes of the followed (information source) and the follower (information receiver), respectively, simulating the direction of information propagation in social networks; is the total number of adjacent edges, that is, the number of directed edges between all agents.
[0082] The graph attention network primarily consists of two graph attention convolutional layers. The first graph attention convolutional layer uses a multi-head masked attention mechanism. Through this multi-head attention mechanism and edge masking, it calculates the normalized attention scores of an agent's effective neighbors towards that agent. The multi-head masked attention mechanism is explained below.
[0083] For the previous time step In terms of , . Take the i-th agent and its j-th neighbor agent ( ) as an example, assuming that there are Attention heads, the final situation characteristics of each agent are divided into Parts, there are ,in , , , for The feature dimension of Attention heads can be used to calculate the The neighboring agents are responsible for the i-th agent in the Attention scores under attention heads . Through the shared learnable weight matrix , the final situation feature of the jth neighboring agent of the i-th agent is part 、 Mapping to query space and key space.
[0084] ; Represents the output dimension of each attention head, and then realizes the interaction between query and key through splicing operation.
[0085] Through shared learnable weights , implements the neighbor importance evaluation, i.e. the scoring function parameter (different from the value in Transformer). Then, select The function is used as an activation function to retain the negative interval gradient and alleviate the gradient vanishing problem when the node feature difference is small. Note that the attention score here is only calculated for valid neighbors, that is, masked attention is performed: ; Then, The function normalizes the weights and obtains Neighbor agent for the i-th agent in the Attention scores under attention heads : .
[0086] Similarly, calculate the corresponding neighbors of the i-th agent The head attention score aggregates neighbor features through the following weighting and concatenation: ; in, Indicates concatenating the outputs of each attention head.
[0087] The second layer of the graph attention convolution layer of the graph attention network is similar to the above, but only uses single-head attention and is activated by the function Keep the inference position value at (-1, 1), ; ; Among them, -1 represents an extremely negative attitude towards the event, and +1 represents an extremely positive attitude towards the event. Finally, the attitude value of each agent at the next time step is inferred : ; Based on the above process, the GPU parallel computing framework is used to perform recursive reasoning on the agent's stance value.
[0088] 3.2, Model training scheme design.
[0089] The design of the aforementioned graph-attention situational inference model, through the introduction of a dynamic computation module, a feature construction module, and a graph-attention network, enables recursive reasoning about the situation of conventional agents in successive time steps. Specifically, the graph-attention situational inference model simply inputs the position values of each agent at the first time step. Based on the dynamic historical situation, the graph-attention situational inference model continuously constructs situational feature inputs for the next time step, achieving recursive regression prediction for a population of conventional agents.
[0090] However, this model relies on supervised learning and requires a large number of real users' historical tweets on specific events as training data. The training process faces the following three main challenges: (1) Inconsistent observation space: In the data sets of different events, the number of participating users varies greatly. The graph attention situation inference model faces inconsistent observation spaces for each event.
[0091] (2) Situation sample discontinuity: The graph attention situation inference model aims to infer the situation of each agent at continuous time steps. However, in the data set of actual events, the speeches of users with quantifiable position values are often discontinuous, and there is switching between participating users in different events, which leads to temporal discontinuity in the training samples.
[0092] (3) Objective function design: The objective function not only needs to guide the graph attention situation deduction model to infer the overall situation mean at the macro level, but also needs to take into account the micro-position value at the individual level.
[0093] In order to effectively address the above three challenges, the following main ideas of the graph attention situation deduction model training scheme are proposed, such as Figure 4 shown.
[0094] A) Observation Space Clustering Based on User Embedding Crawling real users’ social account descriptions under different events, and embedding them through text encoding technology, Then, the users are clustered into 1,000 categories in the vector space. This method not only achieves consistency in the observation space under different events, but also protects user privacy and avoids overfitting of the model to specific real users.
[0095] B) Situation sample construction based on interpolation For datasets of different social network events, this paper sets a total simulation time step of 30, with each time step corresponding to several days in reality. When training the graph attention situation inference model, only user situation samples within the first 10 time steps of each event dataset are selected as model training samples. User sentiment samples refer to user ratings of specific tweet content. Their values range from -1 to +1, where -1 indicates an extremely negative stance toward an event and +1 indicates an extremely positive stance. For cases where sentiment labels are missing at some time steps, an interpolation strategy is used to complete user sentiment samples to ensure consistency within the training sample. Specifically, each interpolation consists of two values: 50% is obtained using linear interpolation, and 50% is sampled from a normal distribution based on the global sentiment distribution.
[0096] C) Objective function design like Figure 5 As shown, to achieve the model's situational reasoning capabilities at both the macro and micro levels, the objective function must simultaneously guide the graph attention situational inference model to fit both the individual user's stance values (at the micro level) and the overall situation mean (at the macro level). Therefore, the loss function designed in this invention consists of two parts: individual situation error and global situation error. Specifically, the individual state error measurement graph is a prediction vector composed of the position values of each agent at each time step predicted by the attention state deduction model The corresponding position numerical label vector Mean Squared Error (MSE) between: ; In the above formula, , the number of virtual users used for training , Represents the L2 norm of the vector. At the same time, the global situation error measures the position values of all users at each time step predicted by the attention situation deduction model. The mean , and the corresponding position numerical label The mean The mean square error is: ; in, .
[0097] Overall loss function as follows: .
[0098] In order to avoid the graph attention situation inference model from simply converging the predicted values of all individuals to the global mean, resulting in the lack of generalization of individual predictions, the weights are taken during the training process. 、 , to strengthen the learning of local features.
[0099] It should be noted that all situation samples in the graph attention situation inference model are used as training data, and no separate validation and test sets are set. This is because the main function of the graph attention situation inference model is to be embedded in the subsequent overall framework. Its training purpose is not to evaluate its performance independently, but to support the testing of macro-situation indicators of the overall framework.
[0100] This paper utilizes existing hybrid framework heterogeneous communication methods to align the information of heterogeneous agents. Core agents communicate via stance text. To align the stance values of conventional agents, a scorer based on a large language model is used to map the generated stance text to a stance value between [-1, 1], where -1 represents an extremely negative stance towards the simulated event and +1 represents an extremely positive stance towards the simulated event. This scored value is then mirrored and merged with the predicted stance values of the agents in the graph attention situational inference model, enabling heterogeneous communication between agents.
[0101] In general, the present invention uses a large language model framework and a graph attention situational inference model to form an overall framework, collaboratively completing situational inference. The overall framework relies on information generated by the agent (including static feature embedding, dynamic situation updates, and generated network topology), rather than real user data. During the inference process, the initial input of the graph attention model includes: agent static features (text embedding vectors of character portraits), the agent's initial stance value, and the agent's network topology. Based on this initial input, the graph attention situational inference model recursively predicts the stance value of the conventional agent at each time step and receives influence from the core agent driven by the large language model during the inference process.
[0102] The terms used herein are only for describing specific embodiments and are not intended to limit the present invention. The terms "comprise", "include", etc. used herein indicate the presence of the features, steps, operations and / or components, but do not exclude the presence or addition of one or more other features, steps, operations or components.
[0103] It should be understood that although the steps in the flowcharts of the accompanying drawings are shown in sequence as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least some of the steps in the flowcharts of the accompanying drawings may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times. The order of execution of these steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a portion of the steps or stages in other steps.
[0104] In one embodiment, the present invention provides a computer system (social network simulation system), which may be a server. The computer system includes a processor, memory, and a network interface connected via a system bus. The processor of the computer system provides computing and control capabilities. The memory of the computer system includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operating system and computer program stored in the non-volatile storage medium. The database of the computer system stores data used in the above-described method. The network interface of the computer system is used to communicate with an external terminal via a network connection. When executed by the processor, the computer program implements the above-described method.
[0105] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0106] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above and that the invention can be embodied in other specific forms without departing from the spirit or essential characteristics of the invention. Therefore, the embodiments should be considered in all respects as illustrative and non-limiting, and the scope of the invention is defined by the appended claims rather than the foregoing description. It is intended that all variations within the meaning and range of equivalents of the claims be embraced herein, and any reference signs in the claims should not be construed as limiting the claims to which they relate.
[0107] In addition, it should be understood that although this specification is described in terms of implementation methods, not every implementation method contains only one independent technical solution. This narrative method of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment can also be appropriately combined to form other implementation methods that can be understood by those skilled in the art.
Claims
1. A large-scale multi-agent collaborative reasoning method, characterized by: include: Use agents to simulate users in a social network, assign character portraits to all agents, and construct the agent social network topology; Iterate the following steps at each time step until the situation deduction of the event to be simulated is completed: Calculate the entropy of the stance values of all agents in the previous time step; sort them in descending order of entropy, select the agents with the previously set ratio as the core agents for the next time step, and the remaining agents as regular agents; Conventional agents are driven in parallel by a graph attention situational deduction model based on a graph attention network. By aggregating the static and dynamic features of neighboring agents, the stance value of each agent at the next time step is recursively predicted. The core agent is driven by a large language model, generates position text based on character portraits and bias design, and interacts with other core agents based on position text; Retrieve event-related content based on the previous round of social network tweet context and update the social network tweet context; the bias design simulates cognitive bias by customizing bias prompt words; The core agent's stance text is mapped into stance values through a scorer based on a large language model, and the current core agent's stance value predicted by the graph attention situation deduction model is replaced.
2. The large-scale multi-agent collaborative reasoning method according to claim 1 is characterized in that: The method of simulating users in a social network through agents, assigning character portraits to all agents, and constructing an agent social network topology specifically includes: A sampling method based on real macro-distribution is used to construct character portraits, which include name, initial stance value towards the event, age, gender, nationality, occupation, personality, and hobbies.
3. The large-scale multi-agent collaborative reasoning method according to claim 1 is characterized in that: The intelligent agent also includes a memory module and a reasoning module; the memory module is used to store the tweet environment of the social network; the core intelligent agent sends tweets or interacts with other core intelligent agents through the reasoning module.
4. The large-scale multi-agent collaborative reasoning method according to claim 1 is characterized in that: The calculation of the entropy of the stance values of all agents at the previous time step specifically includes: Based on the social network topology, calculate the time steps of each agent in the previous time step. The entropy value of the attitude value of the event: ; is the i-th agent at the previous time step The entropy value of the stance value of the event, each agent at the previous time step The entropy value set , is the total number of agents, ; Indicates that at the previous time step Middle, position value The frequency of appearance in the position values of the neighboring agents of the i-th agent; Indicates that at the previous time step Middle, position value The number of times it appears in the position values of the neighboring agents of the i-th agent; , is the neighbor agent of the i-th agent at the previous time step The set of position values, express The cardinality of Indicates the neighboring agent of the i-th agent at the previous time step A vector of position values, It is an operation that groups the elements in a vector into a set.
5. The large-scale multi-agent collaborative reasoning method according to claim 1 is characterized in that: The conventional agent is driven in parallel by a graph attention situation deduction model based on a graph attention network. By aggregating the static and dynamic features of neighboring agents, the stance value of each agent at the next time step is recursively predicted. Specifically, the following steps are performed: Based on the predicted stance values of the agent at each historical time step, the individual situation characteristics and neighbor situation characteristics are calculated in parallel, and the dynamic characteristics of the agent are constructed; The embedding of the character portrait corresponding to the intelligent agent is used as the static feature of the intelligent agent. The static feature and the dynamic feature are respectively passed through the multi-layer perceptron and then spliced to obtain the final situation feature; The final state features of the agent and the information of neighboring agents are input into the graph attention network composed of two layers of graph attention convolution layers. By performing attention-based aggregation on the features of neighboring agents, the stance value of each agent in the next time step is predicted.
6. The large-scale multi-agent collaborative reasoning method according to claim 5 is characterized in that: The method of calculating the individual situation characteristics and neighbor situation characteristics based on the predicted stance values of each historical time step of the agent in parallel and constructing the dynamic characteristics of the agent specifically includes: The last time step of the i-th agent The individual situation vector is recorded as ; Represents the last time step of the i-th agent The position value, , , is the total number of agents, Represents the transpose of the matrix; constructs the group situation matrix ; Construct the local neighborhood situation matrix for each agent: ; in, is the local neighborhood situation matrix of the ith agent, Represents the set of neighboring agents of the i-th agent. The local neighbor situation matrix of each agent is filled based on the number of the maximum neighbor agents, and the filled local neighbor situation matrix is spliced into the global neighbor situation matrix ; ; for The corresponding filled local neighborhood situation matrix; Represents an operation that stacks the input matrix into a new matrix along a new dimension; Based on the group situation matrix Calculate the previous time step The previous agent's own state mean , Situation Standard Deviation , situation maximum , situation minimum and the latest situation value , and obtain the individual situation feature matrix of the agent group : ; Based on the neighbor situation feature matrix And the corresponding mask matrix Calculate the average of the neighboring states of each agent , Neighborhood Status Standard Deviation , the Pearson correlation coefficient matrix between the agent's own situation and the neighbor's situation and echo chamber effect scores , get the neighbor situation feature matrix of the agent group : ; The individual situation feature matrix and the neighbor situation feature matrix are spliced together to obtain the dynamic feature matrix : ; Represents a splicing operation.
7. The large-scale multi-agent collaborative reasoning method according to claim 5 is characterized in that: The embedding of the character portrait corresponding to the intelligent agent is used as the static feature of the intelligent agent, and the static feature and the dynamic feature are respectively passed through the multi-layer perceptron and spliced to obtain the final situation feature, which specifically includes: The character portrait text corresponding to the intelligent agent is passed through The encoder of the model obtains the static feature matrix of the agent ; Use two multi-layer perceptrons to perform nonlinear modeling on the dynamic feature matrix and the static feature matrix in turn: ; ; in, The previous time step The dynamic feature matrix of is the learnable weight matrix, is a learnable bias term, is the activation function; represents the dynamic feature embedding matrix, represents the static feature embedding matrix; right and Splice and get the last time step of the agent group The final situation feature matrix : ; Represents a splicing operation.
8. The large-scale multi-agent collaborative reasoning method according to claim 5, characterized in that: The final state features of the agent and the information of neighboring agents are input into the graph attention network composed of two layers of graph attention convolution layers. By performing attention-based aggregation on the features of neighboring agents, the stance value of each agent in the next time step is predicted. Specifically, The neighbor agent information is the adjacency matrix obtained based on the agent social network topology; the first graph attention convolution layer of the graph attention network calculates the normalized attention score of the agent's effective neighbors for the agent through a multi-head masked attention mechanism and a neighboring edge mask obtained based on the adjacency matrix: The final situation characteristics of each agent are divided into Parts: ; represents the final state characteristics of the i-th agent, express The kth part of Calculate the jth neighbor agent of the ith agent for the ith agent in the Attention scores under attention heads , : Through the shared learnable weight matrix ,Will 、 Mapped to query space and key space respectively: ; ; express The corresponding query vector, express The corresponding key vector; then the query and key interaction is realized through the splicing operation, and the shared learnable weight , realize the importance evaluation of neighbor agents: ; ; Represents a splicing operation, represents the activation function, represents the softmax function, express The corresponding normalized attention score; Calculate all neighboring agents of the ith agent for the ith agent in The normalized attention scores under each attention head are weighted and concatenated as follows to aggregate the features of neighboring agents: ; in, Indicates concatenating the outputs of each attention head. is the set of all neighboring agents of the i-th agent; represents the embedded representation of the aggregated neighbor features of the i-th agent output by the first layer of graph attention convolutional layer; The second graph attention convolution layer of the graph attention network uses the same process as the first graph attention convolution layer, but only uses single-head attention. As the input of the second-layer graph attention convolutional layer, the position value of each agent at the next time step is inferred: ; ; represents the normalized attention score of the jth neighbor agent of the ith agent for the ith agent output by the second-layer graph attention convolutional layer, represents the learnable weight matrix in the second-layer graph attention convolutional layer, represents the embedded representation of the i-th agent after aggregating neighbor features output by the second-layer graph attention convolution layer, is the activation function, Next time step for the i-th agent The position value.
9. The large-scale multi-agent collaborative reasoning method according to claim 5, characterized in that: The training process of the graph attention situation deduction model includes: Overall loss function of the graph attention situation inference model for: ; 、 is the weight parameter; individual state error The prediction vector composed of the position values of each agent at each time step is used to measure the graph attention situation deduction model The corresponding position numerical label vector The mean square error between: ; in, , is the total number of agents, represents the L2 norm; Global situation error Used to measure the position values of all users at each time step predicted by the graph attention situation inference model The mean , and the corresponding position numerical label The mean The mean square error of: 。 10. A social network simulation system, comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 9 are implemented.
Citation Information
Patent Citations
Multi-dimensional information fusion user standing detection method based on graph attention network
CN116245110A
Social simulation method, device and equipment based on large model agent
CN118887029A
Intelligent strategy deduction method and device for machine self-game
CN119886856A
System and method for inputting text into electronic devices
US20140297267A1
Cited By
Multi-agent-driven e-commerce dispute judgment method and system
CN121860647A
Social simulator cognitive intervention method and system
CN121998631A
