Official implementation of this paper "Emergence of human-like polarization among large language model agents"
python == 3.8.11
numpy == 1.23.5
scipy == 1.10.1
scikit-learn == 1.2.2
matplotlib == 3.7.1
seaborn == 0.12.2
jupyter notebook == 6.4.8
openai==0.28.0
Fill in:
- OpenAI-API key
- LLM Model for simulation
Define keywords for experiment prompts:
- environment: Field of Conversation
- topic: Topic to discuss
- S_m2: Extreme negative standpoint
- S_m1: Moderate negative standpoint
- S_0: Neutral standpoint
- S_m2: Extreme positive standpoint
- S_m1: Moderate positive standpoint
- S_m2_e: Explaination of S_m2
- S_m1_e: Explaination of S_m1
- S_0_e: Explaination of S_0
- S_p1_e: Explaination of S_p1
- S_p2_e: Explaination of S_p2
- side_s_0: Negative agent discription
- side_e_0: Neutral agent discription
- side_b_0: Positive agent discription
Define experimental settings:
- datasource: Path to network for initialization
- num_epoch: Epoch number to simulate
- starting_epoch: Which epoch to continue simulation (0 for new simulation)
- side_init: The initialize standpoint distribution of agents
- abb: Output path for experimental result
For a network with 4000 relationships, 1000 agents, expected time will be approximately 6-7 hours using gpt3.5-turbo with a tier 5 openai api account.
Run the demo with cmd python run.py
This project is licensed under the MIT License - see the LICENSE file for details.