An Interactive LLM-Powered Multi-Agent Social Media Simulation + Benchmark Builder
SocialSimBench is a platform for simulating social media dynamics using LLM-powered agents. It supports multiple platform modes (Twitter, Reddit, Weibo), multiple network topologies, and a benchmark task pool for studying information diffusion, misinformation/rumor correction, stance evolution, collaboration, and polarization. It also supports dataset-grounded runs via Kaggle import and local file upload, and exports reproducible episode artifacts (config + logs + metrics + plots).
- Select data source: Generated / Kaggle / Upload
- Pick platform mode: Twitter / Reddit / Weibo / Generic
- Pick a task (5 tasks) + tune parameters
- Run simulation (T rounds)
- Inspect: cascade graph + stance trajectories + polarization curve + metrics
- Export: episode bundle (for reproducibility + benchmarking)
- LLM-Powered Agents: agents generate replies/decisions using pluggable LLM backends
- Trust Networks: receiver-to-sender trust weights modulate propagation
- Stance Evolution: 5-level stance system with dynamic updates (normalized for metrics)
- Platform Modes:
- Twitter: rapid spread, shallower cascades
- Reddit: deeper conversational threads
- Weibo: higher virality patterns
- Generic: neutral baseline
| Task | Description | Key Metrics |
|---|---|---|
| Information Diffusion | Track how content spreads through network | Coverage, Cascade Depth, Rβ proxy |
| Rumor Detection | Simulate misinformation spread and correction | Detection Rate/F1, Time-to-Correction |
| Stance Evolution | Model opinion change over time | Stance Changes, Distribution Entropy |
| Multi-Role Collaboration | Heterogeneous agents solving problems | Coordination Efficiency, Information Coverage |
| Group Polarization | Measure opinion clustering | Polarization Index, Echo Chamber Intensity |
- OpenAI: GPT-4o, GPT-4o-mini, GPT-3.5-turbo
- DeepSeek: DeepSeek-chat, DeepSeek-coder
- Anthropic: Claude-3.5-sonnet, Claude-3-haiku
- Mock: Template-based responses for testing (no API needed)
- Kaggle Integration: Import real datasets via API (stored in
datalake/) - Synthetic Generation: BarabΓ‘si-Albert, Watts-Strogatz, ErdΕs-RΓ©nyi networks
- File Upload: CSV/JSON network and content files
GitHub renders math in Markdown using
$...$(inline) and$$...$$(display).
If your viewer does not render math, you can still read the plain-text equivalents below.
Share probability (message from agent
where
Coverage
where
Cascade depth
Polarization (size-weighted between-group variance) (stance normalized to
Plain-text equivalents (for maximum compatibility)
- Share:
P_share = clip_[0,1]( p_base * beta_platform * (alpha * tau[j,i] + (1-alpha) * tau0) ) - Coverage:
|I| / |N| - Depth:
d(m)=0 if no parent else d(parent)+1 - Polarization:
sqrt( sum_c (n_c/N) * (sbar_c - sbar)^2 )
# Clone the repository
git clone https://github.com/LinkLuck/social_simulation.git
cd socialsimbench
# Install dependencies
pip install -r requirements.txt
# Optional: Install LLM backends
pip install openai # For OpenAI/DeepSeek
pip install anthropic # For Anthropic
pip install kaggle # For Kaggle dataset importcd social_simulation
streamlit run app.pyThe application will open in your browser at http://localhost:8501.
-
Configure Network
- Select data source (Generated / Kaggle / Upload)
- Choose network topology and size
- Set platform mode (Twitter / Reddit / Weibo / Generic)
-
Configure LLM
- Select provider (Mock for testing, or real API)
- Enter API key
- Choose model
-
Select Task
- Pick from 5 benchmark tasks
- Configure task-specific parameters (e.g., correction delay for rumor)
-
Run + Analyze
- Run simulation for T rounds
- Inspect cascade/stance/polarization plots
- Export episode artifacts (config/logs/metrics)
from simulation.manager import SimulationManager
from tasks.tasks import GroupPolarizationTask
manager = SimulationManager()
manager.setup(
n_agents=30,
network_type='watts_strogatz',
platform_mode='twitter',
trust_weight=0.7,
seed=42
)
task = GroupPolarizationTask(manager)
task.setup(topic='Climate Policy', n_communities=2)
task.run(n_rounds=10, infection_probability=0.5)
results = task.evaluate()
print(f"Polarization Index: {results['final_polarization']:.3f}")Each run exports an episode bundle (recommended for benchmarking / ablations):
episode_config.json(seed + all params)events.jsonl(message log withorigin_id,parent_id,depth, round)metrics.json(task metrics + per-round traces)plots/(charts + optional interactive graph html)
This supports ablations across LLM backends, platform modes, and intervention schedules without changing evaluation code.
socialsimbench/
βββ social_simulation/
β βββ app.py # Streamlit UI
β βββ config.py # Configuration and enums
β βββ agents/
β β βββ agent.py # Agent + stance updates
β β βββ llm_service.py # Pluggable LLM backends
β βββ simulation/
β β βββ manager.py # Simulation orchestration
β β βββ network.py # Topology generation + communities
β βββ tasks/
β β βββ tasks.py # 5 benchmark tasks
β βββ data/
β β βββ loader.py # Kaggle & file import -> datalake
β βββ visualization/
β β βββ visualizer.py # Charts + cascade graphs
β βββ evaluation/
β βββ metrics.py # Metrics (coverage/depth/polarization)
| Dataset | Type | Use Case |
|---|---|---|
kazanova/sentiment140 |
Content | Sentiment analysis, opinion spread |
clmentbisaillon/fake-and-real-news-dataset |
Content | Rumor detection |
ashwinpathak/facebook-social-network |
Network | Social network topology |
mathurinache/twitter-edge-nodes |
Network | Twitter network structure |
Upload CSV files with:
- Network:
source,targetcolumns (orfrom,to,node1,node2) - Content:
textcolumn (orcontent,tweet,message)
export OPENAI_API_KEY="sk-..."
export DEEPSEEK_API_KEY="sk-..."
export ANTHROPIC_API_KEY="sk-..."
export KAGGLE_USERNAME="your_username"
export KAGGLE_KEY="your_key"| Mode | Share Boost | Description |
|---|---|---|
| 1.2Γ | Rapid, shallow cascades | |
| 0.8Γ | Deep conversation threads | |
| 1.3Γ | Viral spread patterns | |
| Generic | 1.0Γ | Neutral baseline |
SocialSimBench does not redistribute Kaggle datasets. Users must download datasets via Kaggle API and comply with each datasetβs license/terms.
from tasks.tasks import BaseTask
class MyCustomTask(BaseTask):
def setup(self, **kwargs):
pass
def run(self, n_rounds, **kwargs):
for round_num in range(n_rounds):
self.manager.run_round(round_num)
def evaluate(self):
return {"my_metric": 0.0}from agents.llm_service import LLMClient, LLMResponse
class MyLLMClient(LLMClient):
def generate(self, prompt, system_prompt="", **kwargs):
response = my_api_call(prompt)
return LLMResponse(content=response, model="my-model", tokens_used=100)@misc{socialsimbench2026demo,
title={SocialSimBench V3: An Interactive LLM-Powered Multi-Agent Social Media Simulation + Benchmark Builder},
author={Anonymous},
year={2026},
note={ACL 2026 System Demonstrations submission}
}- LLM agents may generate biased or unsafe content; use safe prompts / demo-safe topics.
- Simulation outcomes are not predictions of real-world behavior.
- Respect dataset licenses (especially for Kaggle-imported content).
MIT License.
Thanks for Using Social Simulation Research
