Society of Programs: Compiling LLM Behavior into Scalable Social Dynamics
Abstract
Imagine a social simulation in which the same kind of decision is made thousands of times: by different agents, under recurring contexts, and across successive timesteps. Asking an LLM to recompute each decision independently makes population-scale simulation expensive even when much of the induced behavior is reusable. We present Society of Programs (SoP), a hierarchical compiler that turns reference-LLM behavior into reusable social dynamics. SoP first compiles task-relevant behavior into executable prototype programs, then groups agents by the responses of these frozen programs and propagates their states through region-level transition operators, and finally merges consecutive updates whenever the propagation conditions remain unchanged. This changes the computational unit from repeated agent-level inference to reusable computation over programs, populations, and temporal blocks. Across WVS and Reddit social simulations, SoP preserves high fidelity to the Full–LLM reference while reducing redundant inference and propagation. In a multi-round opinion simulation with agents, it reduces LLM calls by approximately and build-plus-deployment time by approximately relative to Full–LLM. The gains arise from behavioral regularities that can be compiled and reused; temporal compression is applied only across stable intervals and required output boundaries.
Then back it, or bet against it.
Related papers
Open the market on this paper to see 7 more related papers.