YuLan-OneSim: Towards the Next Generation of Social Simulator with Large Language Models

Lei Wang, Heyang Gao, Xiaohe Bo, Xu Chen, Ji-Rong Wen · OpenReview

TL;DR

YuLan-OneSim is a next-generation social simulator powered by Large Language Models (LLMs) that enables code-free, natural language scenario construction and scales up to 100,000 agents. By introducing an autonomous "AI Social Researcher," the platform closes the social science loop by automatically designing experiments, running massive distributed simulations, and writing comprehensive academic reports.

What Problem Does This Paper Address?

Traditional social science relies heavily on Agent-Based Modeling (ABM) to simulate complex human behaviors. However, classical ABMs use rigid, hand-crafted heuristic rules that fail to capture the nuances of human cognition and language-mediated interactions.

While recent attempts have integrated LLMs into social simulations, they suffer from four major bottlenecks:

  1. High Programming Barriers: Social scientists often lack the software engineering expertise required to program complex agent environments.
  2. Poor Scalability: Most existing LLM simulators handle fewer than 1,000 agents due to computational constraints, making population-level dynamics impossible to study.
  3. Static Behavior: Simulators typically cannot ingest feedback to dynamically correct agent hallucinations or biases.
  4. Fragmented Workflows: The research process—from ideation to simulation setup, data analysis, and paper writing—remains highly manual and disjointed.

YuLan-OneSim addresses these limitations by creating an end-to-end, scalable, and evolvable simulation ecosystem.

Table 1: Comparison between YuLan-OneSim and previous works. In the "# Agents" column, we present the number of agents as reported in the original papers’ experiments. In the "# Environments (Env)" column, "-" means that the simulator does not provide environments for the agents to take actions, for example, the simulator is purely based on conversations. The symbol ⃝indicates that while SOTOPIA-S4 allows users to configure simulation scenarios using natural language, it leverages user inputs as LLM prompts instead of converting them into executable simulation code. We use different colors to represent various stages in the field of LLM agent based social simulation.

Methods

The architecture of YuLan-OneSim is divided into four core subsystems:

  1. Scenario Auto-Construction Subsystem: Users describe their desired simulation in natural language. The system formalizes this into a standardized ODD (Overview, Design Concepts, and Details) protocol, builds an intermediate behavior graph at the agent-type level, and uses breadth-first search (BFS) to guide an LLM in generating clean, modular executable code.
  2. Simulation Subsystem: To support up to 100,000 agents, the authors abandoned rigid, step-by-step execution loops in favor of an asynchronous, event-driven reactive framework (an event bus). This is paired with a Master-Worker distributed architecture featuring topology-aware agent allocation and peer-to-peer (P2P) communication to minimize cross-node latency.
  3. Feedback-Driven Evolving Subsystem: Utilizing a Verifier-Reasoner-Refiner-Tuner ($VR^2T$) multi-agent framework, the system automatically evaluates simulation logs against predefined metrics, explains errors, generates corrected responses, and fine-tunes the backbone LLMs via Supervised Fine-Tuning (SFT) or Reinforcement Learning (RL).
  4. AI Social Researcher Subsystem: An autonomous pipeline driven by collaborative agents (Inspiration, Evaluation, ODD-generation, Data Analysis, and Report Writing agents) that takes a research topic and handles everything up to generating a final LaTeX technical report.

Datasets

While YuLan-OneSim is a simulation framework rather than a static dataset, the authors introduced a Default Scenario Repository containing 50 pre-defined simulation scenarios spanning 8 domains: Economics, Sociology, Politics, Psychology, Organization, Demographics, Law, and Communication.

For evaluation, the authors utilized:

  • Axelrod’s Cultural Dissemination Model: Scaled up to 100,000 agents to test scalability and theoretical alignment.
  • Empirical Brazilian Real Estate Market Data (2020): Used to validate how well the simulator fits real-world multimodal economic distributions.

Key Insights and Ideas

  • Graph-Guided Code Generation: Directly prompting an LLM to write a massive simulation codebase often results in syntax or logical failures. Abstracting the logic into a human-editable behavior graph first allows the LLM to generate code incrementally and accurately.
  • The Asynchronous Advantage: Real-world human interactions are rarely perfectly synchronized. By moving to an asynchronous event bus, the simulator naturally mirrors concurrent social activities while unlocking massive parallel computing throughput.
  • The "Social Science Gym": Because real-world social data is frequently restricted due to privacy and ethical constraints, an evolvable simulator acts as a sandbox where human or system feedback can continuously align LLMs to realistic human behaviors.

Key Results

  • Generation Efficiency: The auto-construction subsystem generates code at an average speed of 50 tokens per second—over 14 times faster than an average human programmer.
  • High-Fidelity Code: The generated behavior graphs and simulation code scored 4.82/5 and 4.20/5 respectively on human evaluation metrics.
  • Massive Scalability: Using Qwen2.5-7B-Instruct across 8 A100 GPUs, the simulator successfully ran a 100,000-agent simulation, processing over 294,000 interaction events per round with a throughput of 49.41 events per second.
  • Theoretical & Real-World Alignment: The simulator successfully replicated Axelrod’s twin phenomena of local convergence and global polarization. It also closely matched empirical real-world rental price distributions in Brazil.

Limitations and Future Work

Despite its strengths, the authors note that the auto-construction subsystem still makes occasional logical slips, such as value access errors or type-check oversights. Furthermore, while the AI Social Researcher excels at structural organization (scoring 4.00/5), its generated reports scored lower on deep analytical insight (3.25/5) and practical utility (3.00/5), occasionally describing data rather than synthesizing novel social theories.

Future work will focus on incorporating more robust social science theories to regularize agent behavior and integrating spatial and multi-modal information into the virtual environments.

Summary updated

BibTeX
@misc{wang2025yulan,
  author = {Lei Wang and Heyang Gao and Xiaohe Bo and Xu Chen and Ji-Rong Wen},
  title = {{YuLan-OneSim: Towards the Next Generation of Social Simulator with Large Language Models}},
  year = {2025},
  eprint = {2505.07581},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2505.07581},
}
Figure