---
title: "An LLM-enhanced Agent-based Simulation Tool for Information Propagation"
authors:
  - "Yuxuan Hu"
  - "Gemju Sherpa"
  - "Lan Zhang"
  - "Weihua Li"
  - "Quan Bai"
  - "Yijun Wang"
  - "Xiaodan Wang"
doi: "10.24963/ijcai.2024/1007"
url: "https://ijcai.org/proceedings/2024/1007"
pdf: "https://ijcai.org/proceedings/2024/1007.pdf"
venue: "Proceedings of the Thirty-Third International Joint Conference on Artificial Intelligence"
year: 2024
pages: "8679-8682"
track: "Demo Track"
keywords:
  - "Agent-based and Multi-agent Systems: MAS: Agent communication"
  - "Agent-based and Multi-agent Systems: MAS: Agent societies"
  - "Agent-based and Multi-agent Systems: MAS: Agent-based simulation and emergence"
  - "Agent-based and Multi-agent Systems: MAS: Agent theories and models"
---

# An LLM-enhanced Agent-based Simulation Tool for Information Propagation

Yuxuan Hu, Gemju Sherpa, Lan Zhang, Weihua Li, Quan Bai, Yijun Wang, Xiaodan Wang

*Proceedings of the Thirty-Third International Joint Conference on Artificial Intelligence*, pages 8679-8682. DOI: [10.24963/ijcai.2024/1007](https://doi.org/10.24963/ijcai.2024/1007)

## Abstract

Influence diffusion models are used for simulating information propagation in social networks. While most existing influence diffusion models are probabilistic, the emergence of Large Language Model (LLM) sheds light on the language-level inferences and interactions of user agents. This paper presents an LLM-enhanced Agent-based Influence Diffusion model (LAID), and a web-based visualization tool, LAIDSim, for simulating the information propagation in social networks.

## Full text

## 1 Introduction

Information propagation describes how pieces of information, such as news, ideas, opinions, and advertisements, spread through social networks [Gomez-Rodriguez et al., 2013; Wu et al., 2019]. Simulating this phenomenon aids in understanding how information diffuses through these networks. Influence diffusion models [Kempe et al., 2003], extensively used to simulate information propagation, follow a 'contagion' pattern based on the network structure [GomezRodriguez et al., 2013], where influence spreads from one node to another through connecting edges. Agent-based modeling (ABM) [Macal, 2016] has been applied to simulate influence diffusion. By leveraging the advantages of ABM [Li et al., 2023; Li et al., 2016; Hu et al., 2019], the diffusion process is driven and captured by the behaviors of individual agents, allowing for a more accurate representation of the complex and dynamic nature of information diffusion.

Most existing influence diffusion models are probabilitybased, which presents several challenges. Firstly, the content of information plays a critical role in individuals' decisionmaking behaviors, but is often ignored by most probabilitybased models. Although some topic-aware influence diffusion models [Chen et al., 2015] consider how tagged content impacts these probabilistic models, they are typically constrained to predefined topics [Chen et al., 2023]. Secondly, probability-based models, including agent-based models, neglect individuals' ability to alter information [Wang et al., 2023]. Specifically, the content of a piece of received information can be altered according to an individual's prior knowledge or interests.

In recent years, the emergence of Large Language Models (LLMs) has shed light on filling some of the above gaps [Gao et al., 2023]. In this paper, we present an LLM-enhanced agent-based influence diffusion model, named LAID, along with a software simulation tool, named LAIDSim 12 for information propagation simulations. LAID is developed based on the conventional Independent Cascade model [Kempe et al., 2003], while leveraging ABM [Li et al., 2023] to capture the personal traits and individual behaviors of social network users. In LAID, users are represented as autonomous agents with distinctive profiles and complex social behaviors. Information content is considered a crucial factor influencing user agents' decision-making behaviors, specifically whether to be influenced by received messages. We particularly emphasize information alteration [Wang et al., 2023] as a key feature in the propagation process, referring to the ability of user agents to modify the content of initially spread information during peer-to-peer propagation. LLMs are utilized to realize this feature, serving as the 'brain' of user agents. The LLM generates the content of an influence message based on the user agent's profile and the content of its received message, facilitating further propagation to its neighbors.

LAIDSim is implemented based on the ABM framework Melodie [Yu and Hou, 2023]. This tool enables end-users to simulate information propagation with self-defined scenarios, visualize the propagation process over time, and generate analytical results at a global level. To demonstrate the capabilities of LAIDSim, we designed and conducted four scenarios within two experiments. These experiments showcase the advantages of LAID in representing language-level behaviors of social network users and highlight the ability of LAIDSim to simulate information propagation across various application settings.

## 2 The LLM-enhanced Agent-based Influence Diffusion Model

## 2.1 Preliminaries

In LAID, a social network is modelled as is a directed graph G = (V,E,M) with a set of user agents V =

1 https://youtu.be/AaxDqK96RZE

2 https://github.com/shaunahu/LAIDSim

Figure 1: LLM-enhanced Agent-based Influence Diffusion

![Image](https://ijcai.org/proceedings/2024/fulltext/1007/image_000000_f1ba4f37c22bd73de72225a41f5aa80bc4c3a429eeaa6a6f1238177b207dc9f6.png)

{v1, v2, ..., vn}, a set of edges E = {eij|1≤i≤n,1≤j≤n,i̸=j}, and a set of influence messages M = {m1, m2, ..., mx}.

A use agent vi = (ri, Γi) represents a social network user with a profile ri. Γi = Γin i ∪ Γout i is the neighbor set of vi which refers to a collection of user agents who are connected with vi. Notably, Γin i = {vj|eji ∈ E} is the in-neighbors of vi, so that vi receives influence messages from these neighbors. While Γout i = {vj|eij ∈ E} is the out-neighbors of vi, so that vi sends influence messages to these users. An influence message mx = (cx, vi) is a piece of textual information spread from a user agent vi to its neighbors, where cx is the content of the message. Since language representation is not the focus of our study, we used BERT [Devlin et al., 2018], a pre-trained model, to learn user profile embedding ri of a user agent vi based on its textual profile ri, and content embedding ck of an influence message mk based on its content ck .

## 2.2 Overall Framework

Figure 1 shows the overall framework of LAID with an example. The yellow square represents a LLM-enhanced user agent. In the social network, each user agent has its unique user profile, a repository to store received influence messages, and access to an LLM. The diffusion process starts from a user agent with an initial influence message, spreading to its neighbors through network topology. Once an agent receives an influence message from its neighbor, it decides whether to be influenced by the message or not based on the similarities between itself and the sender of the message, as well as the content of the message. If it was influenced, it retrieves its personal profile and the received message, then sends a request to an LLM, asking it to generate a new message for dissemination. The diffusion process continuous until there is no more user agents can be influenced.

## 2.3 Initialisation

We adopted GPT-3.5-turbo to generate user profiles with the following rules: (1) a user profile is a summary of a social network user within 50 words; (2) the ages of these users follow a normalised Gaussian distribution; (3) the genders of these users are evenly distributed, half male and half female. At the beginning of the influence diffusion, k user agents are randomly selected to spread an influence message ms to their neighbors.

## 2.4 Influence Diffusion

Influence diffusion is developed based on the conventional IC model. In the IC model, each user agent has two possible states: active and inactive. An inactive user agent has a single chance to be activated by its active neighbors with an influence probability. The diffusion process stops if there were no more user agents could be influenced.

The influence probability pkij is the probability for a user agent vi to accept an influence message mk from its neighbor vj. This is calculated by the consideration of the content of the message mk and the relationship between two user agents:

<!-- formula-not-decoded -->

In Equation 1, sim(mk, vi) is the cosine similarity between the content embedding ck of mk and the embedding ri of vi. It suggests how the content ck of an influence message mk matches a user agent vi:

<!-- formula-not-decoded -->

Similarly, the similarity between two user agents vi and vj is measured by the cosine similarity between the user profile embeddings ri and rj, where ri and rj are the profiles of vi and vj :

<!-- formula-not-decoded -->

In the influence diffusion process, we identify content influence as a critical factor in individuals accepting an influential message, denoted as sim(mk, vi). The influence parameter α in the proposed diffusion model is a trade-off between these two factors. A higher α indicates that the user agent is more likely to be influenced by social influence rather than content, while a lower α suggests that the user agent is more sensitive to the content of the information but pays little attention to its neighbors' decisions.

Once a user agent is influenced, it accepts the spreading influence message mk and further propagates to its neighbors. Specifically, LLM model is adopted for information alteration. That is, a user agent can alter the content of an existing influence message mk that it received from any of its in-neighbors vj ∈ Γin i , adding or changing words based on its profiles, and further diffuses the altered influence message m′k to its out-neighbors Γout i .

## 2.5 Information Alteration

GPT-3.5 Turbo is used in this stage for user agents to generate altered influence messages based on their profiles and the influence messages they have accepted. To evaluate the changes between two influence messages, we adopted alteration degree [Wang et al., 2023] to measure the extent of information alteration by a user agent.

Table 1: Scenarios with different message contents and application settings

| ID   | Content                                                                                                                                                                                                                                                                                                                                                                                                     | Application Setting   |
|------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------|
| s1   | Meet your local election candidates: [Candidate 1] fo- cuses on education reform and community safety. [Can- didate 2] advocates for sustainable development and en- vironmental initiatives. [Candidate 3] prioritizes small business support and infrastructure improvements. Get informed, attend candidate forums, and choose who aligns with your vision for our community's future. #Lo- calElections | Political election    |
| s2   | Introducing our latest product: The SmartHome Hub! Seamlessly control all your devices, from lights to ther- mostats, in one central hub. Enjoy energy savings, con- venience, and security. Compatible with popular smart home platforms. Upgrade your home today and expe- rience the future of intelligent living. Available now at authorized retailers.                                                | Viral marketing       |
| s3   | Introducing a novel concept: Shared Skill Spaces. A communal area where diverse talents intersect, fostering collaboration and innovation. Unleash creativity, maxi- mize collective expertise, and elevate the potential of our community. Explore Shared Skill Spaces today!                                                                                                                              | Spread new idea       |
| s4   | How are you today?                                                                                                                                                                                                                                                                                                                                                                                          | Daily conversation    |

## 3 Experiments

## 3.1 Experimental Settings

Parameters: We consider seed size k and influence parameter α as two parameters of our proposed model that can be adjusted from the front-end. The seed size k represents the number of initially active user agents. A higher k suggests a quicker diffusion but also entails higher costs. As explained in Subsection 2.4, the influence parameter α potentially impacts the influence probability by controlling the trade-off between social influence and content influence.

Scenarios: We designed four scenarios with varying initial influence message content and application settings for the proposed model to simulate. The initial influence message is also generated by the GPT-3.5-Turbo model. Table 1 lists these scenarios.

Initialization Setup: At the beginning of each scenario simulation, a synthetic network based on Erdos-Renyi model [Erd˝os et al., 2012] is randomly constructed with a size of 20 nodes, and a probability of 0.1 for these nodes to connect to each other.

## 3.2 Experiment 1: Influence Coverage Analysis

This experiment analyses the cumulative number of user agents in two states: active and inactive over a particular time period, i.e., 10 time steps. Figure 2 shows the simulation results. The slight differences of the numbers of active and inactive agents across the four scenarios suggest that user agents possess the capability to respond to information with different contents. In all four scenarios, the diffusion process adheres to a contagion pattern, indicating LAID's capacity to effectively simulate information propagation.

## 3.3 Experiment 2: Information Alteration Analysis

Figure 3 shows the simulation results of four scenarios monitored from time step 1. It can be seen that all four scenarios have been slightly altered at the first time step compared to the initial influence message. S4 shows the most significant alteration. This is because the initial influence message in S4

![Image](https://ijcai.org/proceedings/2024/fulltext/1007/image_000001_e094db4b737f8506f9c9ebef03ed64247e91de6772e4787f5243c3e5545f32c9.png)

![Image](https://ijcai.org/proceedings/2024/fulltext/1007/image_000002_412d5a46e070592ec30587b9bcf0c7ef01aedd74393358dd5ea15b95d2294a4d.png)

Figure 2: Influence coverage of different scenarios

![Image](https://ijcai.org/proceedings/2024/fulltext/1007/image_000003_b2f6bb1d4b422aedb27716ff078ff2ed89d8594313c2748d8b29000f47abccab.png)

![Image](https://ijcai.org/proceedings/2024/fulltext/1007/image_000004_e5b945fc647ee3c0220b515fcce4b1e3aed916b16a2ca66ed950cf193c2aeedf.png)

Figure 3: Information alteration of different scenarios

![Image](https://ijcai.org/proceedings/2024/fulltext/1007/image_000005_6c853a9a9c2eb2decd08f76e2b77e5ecdd74e38659617a613e98e78c121cf34b.png)

is an 'open' question. The alteration degree scenarios s2 to s4 decreases, implying that user agents generate information with a similar pattern to their received influence messages. The degree of alteration converges after a few time steps, indicating that the diffusion process stops, and no more user agents can be influenced to generate new influence messages.

## 4 Conclusion

In this paper, we presented an LLM-enhanced agent-based simulation tool, LAIDSim, for simulating information propagation in social networks, based on our proposed diffusion model LAID. We showcased the interpretability of the proposed model across four scenarios by demonstrating language-level interaction and inference of user agents. In the future, we plan to extend our work by improving the user agent model with more comprehensive user behaviors.

## Contribution Statement

The first two authors contributed equally to this work and should be considered as joint first authors.

## References

1. [Chen et al., 2015] Shuo Chen, Ju Fan, Guoliang Li, Jianhua Feng, Kian-lee Tan, and Jinhui Tang. Online topic-aware influence maximization. Proceedings of the VLDB Endow- ment, 8(6):666-677, 2015.
2. [Chen et al., 2023] Hsi-Wen Chen, De-Nian Yang, Wang- Chien Lee, Philip S Yu, and Ming-Syan Chen. Cminet: a graph learning framework for content-aware multi-channel influence diffusion. In Proceedings of the ACM Web Con- ference 2023, pages 545-555, 2023.
3. [Devlin et al., 2018] Jacob Devlin, Ming-Wei Chang, Ken- ton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understand- ing. arXiv preprint arXiv:1810.04805, 2018.
4. [Erdős et al., 2012] László Erdős, Antti Knowles, Horng- Tzer Yau, and Jun Yin. Spectral statistics of erdős-rényi graphs ii: Eigenvalue spacing and the extreme eigenvalues. Communications in Mathematical Physics, 314(3):587- 640, 2012.
5. [Gao et al., 2023] Chen Gao, Xiaochong Lan, Zhihong Lu, Jinzhu Mao, Jinghua Piao, Huandong Wang, Depeng Jin, and Yong Li. S 3 : Social-network simulation system with large language model-empowered agents. arXiv preprint arXiv:2307.14984, 2023.
6. [Gomez-Rodriguez et al., 2013] Manuel Gomez-Rodriguez, Jure Leskovec, and Bernhard Schölkopf. Modeling infor- mation propagation with survival theory. In International conference on machine learning, pages 666-674. PMLR, 2013.
7. [Hu et al., 2019] Yuxuan Hu, Quan Bai, and Weihua Li. Context-aware influence diffusion in online social net- works. In Knowledge Management and Acquisition for Intelligent Systems: 16th Pacific Rim Knowledge Acqui- sition Workshop, PKAW 2019, Cuvu, Fiji, August 26-27, 2019, Proceedings 16, pages 153-162. Springer, 2019.
8. [Kempe et al., 2003] David Kempe, Jon Kleinberg, and Éva Tardos. Maximizing the spread of influence through a so- cial network. In Proceedings of the ninth ACM SIGKDD international conference on Knowledge discovery and data mining, pages 137-146, 2003.
9. [Li et al., 2016] Weihua Li, Quan Bai, and Minjie Zhang. Agent-based influence propagation in social networks. In 2016 IEEE International Conference on Agents (ICA), pages 51-56, 2016.
10. [Li et al., 2023] Weihua Li, Yuxuan Hu, Chenting Jiang, Shiqing Wu, Quan Bai, and Edmund Lai. Abem: An adap- tive agent-based evolutionary approach for influence max- imization in dynamic social networks. Applied Soft Com- puting, 136:110062, 2023.
11. [Macal, 2016] Charles M Macal. Everything you need to know about agent-based modelling and simulation. Jour- nal of Simulation, 10:144-156, 2016.
12. [Wang et al., 2023] Guan Wang, Weihua Li, Quan Bai, and Edmund MK Lai. Maximizing social influence with minimum information alteration. IEEE Transactions on Emerging Topics in Computing, 2023.
13. [Wu et al., 2019] Le Wu, Peijie Sun, Yanjie Fu, Richang Hong, Xiting Wang, and Meng Wang. A neural influence diffusion model for social recommendation. In Proceed- ings of the 42nd international ACM SIGIR conference on research and development in information retrieval, pages 235-244, 2019.
14. [Yu and Hou, 2023] Songmin Yu and Zhanyi Hou. Melodie: Agent-based modeling in python. Journal of Open Source Software, 8(83):5100, 2023.
