ElectionSim: Massive Population Election Simulation Powered by Large Language Model Driven Agents

Xinnong Zhang, Jiayu Lin, Libo Sun, Weihong Qi, Yihang Yang, Yue Chen, Hanjia Lyu, Xinyi Mou, Siming Chen, Jiebo Luo, Xuanjing Huang, Shiping Tang, Zhongyu WeiarXiv 2024 · DOI

Introduction

Traditional election forecasting has long relied on static polling or rule-based Agent-Based Modeling (ABM). While ABM offers a dynamic approach, it often utilizes simplified logic that fails to capture the nuanced backgrounds and motivations of individual voters. Conversely, while Large Language Models (LLMs) excel at mimicking human personas, scaling them to simulate millions of distinct individuals while maintaining demographic accuracy presents a significant engineering challenge.

This research introduces ElectionSim, a framework designed to bridge this gap by leveraging LLM agents to simulate massive voter populations. The system addresses three core challenges: achieving high accuracy in individual-level simulations, ensuring the simulated population mirrors real-world demographics, and evaluating these simulations beyond simple win/loss outcomes.

Methodology

The ElectionSim pipeline creates a "digital twin" of the U.S. electorate through a multi-stage process:

  1. Voter Pool Construction: Researchers curated a pool of approximately one million distinct users from a dataset of 171 million tweets from 2020, using Jaccard similarity to filter out non-human actors.
  2. Demographic Tagging: To overcome the lack of census data on social media, a "teacher-student" approach was employed. High-end models (GPT-4o, Claude 3.5) annotated a subset of users, which was then used to fine-tune a Longformer model to classify the entire pool across five dimensions: Gender, Age, Race, Ideology, and Partisanship.
  3. Iterative Proportional Fitting (IPF): To correct for the inherent sampling bias of social media (e.g., younger, more active users), the team applied IPF. This statistical technique adjusts agent weights to match the joint distribution of real-world U.S. Census and American National Election Studies (ANES) data.
  4. Agent Intelligence Levels: The framework tested three simulation baselines: random sampling, demographic guidance (basic tags), and User Experience Alignment, which provides the LLM with an agent's actual social media history to create a more authentic persona.

Key Insights and Ideas

A primary finding of the study is that personas outperform profiles. Providing an LLM with a user's actual post history significantly improved performance compared to simple demographic labels, as the history provides the underlying rationale for a vote.

To maintain temporal integrity and avoid data leakage, the authors strictly filtered out any social media content published after November 2020. Furthermore, the study demonstrated that GPT-4o-mini offers an optimal balance of cost and accuracy, making million-agent simulations financially viable for large-scale research.

Results and Evaluation

The framework was evaluated using the PPE (Poll-based Presidential Election) Benchmark, which adapts 2020 ANES surveys into 49 questions across 24 policy topics. The best-performing models achieved a Micro-F1 score of 0.812, indicating that agents reflect consistent political logic rather than random guessing.

In a retrospective simulation of the 2020 election, ElectionSim correctly predicted the winner in 47 out of 51 states (including D.C.). Its performance in high-stakes areas was equally robust, accurately predicting outcomes in 12 out of 15 critical battleground states.

Limitations and Future Work

Despite its success, the model exhibited a slight overestimation of the Democratic vote share, suggesting potential inherent biases in underlying LLMs or residual skews in social media data. Additionally, while overall accuracy was high, the model struggled to perfectly capture the opinions of smaller minority groups (lower Macro-F1 scores). Future research will aim for higher geographic granularity at the county level and deeper agent reasoning capabilities.

Summary updated

BibTeX
@misc{zhang2024electionsim,
  author = {Xinnong Zhang and Jiayu Lin and Libo Sun and Weihong Qi and Yihang Yang and Yue Chen and Hanjia Lyu and Xinyi Mou and Siming Chen and Jiebo Luo and Xuanjing Huang and Shiping Tang and Zhongyu Wei},
  title = {{ElectionSim: Massive Population Election Simulation Powered by Large Language Model Driven Agents}},
  year = {2024},
  eprint = {2410.20746},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2410.20746},
}
Figure