Table of Contents
Fetching ...

Law in Silico: Simulating Legal Society with LLM-Based Agents

Yiding Wang, Yuxuan Chen, Fanxu Meng, Xifan Chen, Xiaolei Yang, Muhan Zhang

TL;DR

The paper tackles the challenge of studying legal systems without costly real-world experiments by introducing Law in Silico, an LLM-based framework for simulating legal societies. It combines hierarchical agent modeling, scenario-based decision-making, and a dynamic legal system to capture how macro societal factors influence individual behavior and how micro-level interactions drive legal evolution. Through macro-level experiments across multiple countries, it shows that simulated crime rates align with real-world data and reveal the impact of deterrence and underreporting. Micro-level simulations further demonstrate the importance of transparent, effective institutions in protecting vulnerable groups, while highlighting cat-and-mouse dynamics between regulation and exploitation. Overall, the work provides a scalable virtual laboratory for legal theory testing, policy design, and administrative planning with practical implications for law design and governance.

Abstract

Since real-world legal experiments are often costly or infeasible, simulating legal societies with Artificial Intelligence (AI) systems provides an effective alternative for verifying and developing legal theory, as well as supporting legal administration. Large Language Models (LLMs), with their world knowledge and role-playing capabilities, are strong candidates to serve as the foundation for legal society simulation. However, the application of LLMs to simulate legal systems remains underexplored. In this work, we introduce Law in Silico, an LLM-based agent framework for simulating legal scenarios with individual decision-making and institutional mechanisms of legislation, adjudication, and enforcement. Our experiments, which compare simulated crime rates with real-world data, demonstrate that LLM-based agents can largely reproduce macro-level crime trends and provide insights that align with real-world observations. At the same time, micro-level simulations reveal that a well-functioning, transparent, and adaptive legal system offers better protection of the rights of vulnerable individuals.

Law in Silico: Simulating Legal Society with LLM-Based Agents

TL;DR

The paper tackles the challenge of studying legal systems without costly real-world experiments by introducing Law in Silico, an LLM-based framework for simulating legal societies. It combines hierarchical agent modeling, scenario-based decision-making, and a dynamic legal system to capture how macro societal factors influence individual behavior and how micro-level interactions drive legal evolution. Through macro-level experiments across multiple countries, it shows that simulated crime rates align with real-world data and reveal the impact of deterrence and underreporting. Micro-level simulations further demonstrate the importance of transparent, effective institutions in protecting vulnerable groups, while highlighting cat-and-mouse dynamics between regulation and exploitation. Overall, the work provides a scalable virtual laboratory for legal theory testing, policy design, and administrative planning with practical implications for law design and governance.

Abstract

Since real-world legal experiments are often costly or infeasible, simulating legal societies with Artificial Intelligence (AI) systems provides an effective alternative for verifying and developing legal theory, as well as supporting legal administration. Large Language Models (LLMs), with their world knowledge and role-playing capabilities, are strong candidates to serve as the foundation for legal society simulation. However, the application of LLMs to simulate legal systems remains underexplored. In this work, we introduce Law in Silico, an LLM-based agent framework for simulating legal scenarios with individual decision-making and institutional mechanisms of legislation, adjudication, and enforcement. Our experiments, which compare simulated crime rates with real-world data, demonstrate that LLM-based agents can largely reproduce macro-level crime trends and provide insights that align with real-world observations. At the same time, micro-level simulations reveal that a well-functioning, transparent, and adaptive legal system offers better protection of the rights of vulnerable individuals.

Paper Structure

This paper contains 51 sections, 7 figures, 32 tables, 2 algorithms.

Figures (7)

  • Figure 1: Overview of the Law in Silico framework. The left sub-figure represents the macro-level simulation, where broad societal data and legal regulations collectively inform agent behaviors. The right sub-figure illustrates the micro-level simulation, which focuses on multi-turn interactions between individual agents, moderated by an LLM-powered Game Master, to simulate legal judgements and institutional dynamics.
  • Figure 2: Experiments conducted with the Qwen2.5-72B-Instruct model showed crime rates across punishment impression levels for prostitution, theft, and assault (Country A). Gray dashed lines indicate the baseline rate without punishment impression. Purple bars represent the simulated crime rates that are closest to the baseline (agents are not provided with a punishment impression).
  • Figure 3: Welfare over time in the Micro-Level Simulation experiments. The solid lines represent the mean welfare, and the shaded areas represent $\pm1$ standard deviation around the mean.
  • Figure 4: Experiments conducted with the Qwen2.5-72B-Instruct model showing crime rates across punishment impression levels for prostitution, theft, and assault (Country B).
  • Figure 5: Experiments conducted with the Qwen2.5-72B-Instruct model showing crime rates across punishment impression levels for prostitution, theft, and assault (Country C).
  • ...and 2 more figures