DH 2026

Daejeon, July 27–31

Thu, July 3011:00–12:30S093204-205
Long Paper

Simulating the Unlived Past: Agent-Based Modeling for Causal Exploration in Tang–Song Literary History

Yao Song
Academy of Chinese, History, Religion, and Philosophy, Hong Kong Baptist University, Hong Kong S.A.R. (China) · yaosong@hkbu.edu.hk
Wanjing Jiang
School of Xiangshan Film, Ningbo, University of Finance & Economics, Ningbo, China. · wanjing0103@naver.com

Abstract:

Traditional digital humanities projects have largely emphasized the preservation, digitization, and visualization of historical records, providing powerful tools for descriptive analysis but limited means for investigating the structural drivers of cultural change. This paper proposes a shift from descriptive mapping to generative computational modeling. Using a high-resolution dataset of 334 Tang and Song dynasty authors comprising over 16 million biographical, social, and spatiotemporal records, we develop an agent-based modeling framework that represents the literary field as a complex adaptive system. Historical actors are encoded as autonomous agents whose behaviors are calibrated from documented biographical trajectories, creating a reproducible computational environment for testing the sensitivity of literary evolution to major historical disruptions. Using the An Lushan Rebellion as a case study, we demonstrate how agent-based simulation can support causal exploration of the relationship between sociopolitical upheaval and thematic transformation in poetic production.

1. Introduction: From Mapping to Modeling

The computational study of literary history has made significant progress through large-scale visualization and network analysis. Foundational work in Graphs, Maps, Trees demonstrated how mapping authors, texts, and circulation patterns can reveal the spatial organization of cultural history. In the case of Chinese literary studies, digital projects have confirmed major transitions such as the shift of literary centers from the Yellow River basin to the Yangtze delta. Yet these approaches remain primarily descriptive: they show where and when transformations occurred, but they offer limited means to evaluate the structural conditions that produced them.

This paper proposes an agent-based computational framework for exploring historical causality in literary evolution. Rather than reconstructing alternative histories as speculative narratives, we model literary history as a dynamic system whose sensitivity to historical disruptions can be systematically tested. By constructing a bottom-up simulation of the Tang–Song literary world, we examine how changes in political stability, transportation networks, and social connectivity may alter large-scale cultural trajectories (Barabási, 2016). This approach follows the logic of Generative Social Science, in which explanation is pursued by reproducing historically plausible macro-patterns from explicitly defined micro-level interactions.

2. Theoretical Framework: Literary History as a Complex Adaptive System

We conceptualize the Tang–Song literary world as a complex adaptive system rather than a static textual archive. This framework integrates three complementary intellectual traditions.

First, we extend Franco Moretti’s distant reading paradigm by moving from static corpus analysis toward dynamic interaction modeling. Literary production is not treated solely as textual output but as the emergent consequence of social mobility, institutional affiliation, and historical contingency (Moretti, 2013).

Second, we draw on Cliodynamics, particularly the work of Peter Turchin, which models long-term historical change through measurable demographic and sociopolitical processes. While cliodynamics has primarily focused on state formation and social conflict, we adapt its analytical logic to the domain of cultural production (Turchin, 2008).

Third, and most critically, we apply Complex Adaptive Systems theory to literary sociology. In this perspective, literary schools and stylistic movements are emergent outcomes of repeated interactions among individual actors rather than categories imposed retrospectively by historians. Macro-level transformations, such as the rise of Song lyric culture, are therefore modeled as system-level phenomena arising from local decisions, mobility patterns, and network reconfiguration (Epstein, 2006).

This framework allows us not to predict “what would have happened,” but to assess the relative structural importance of specific historical shocks by observing how model outputs change under controlled parameter perturbations.

3. Data Foundation: Historical Grounding and Validation

The model is grounded in a structured historical dataset compiled from the Tang and Song Literature Chronicle, which integrates approximately 16 million biographical, spatial, and relational records derived from 334 canonical authors. The dataset includes 98,849 dated creative works (poems, lyrics, and essays), each linked to specific locations and historical time points. In addition, reconstructed travel trajectories and social interactions provide a temporally evolving network of literary exchange (Wang, 2021).

These data serve three distinct functions. First, they initialize agent attributes, including birth cohort, place of origin, social status, and documented mobility patterns. Second, they provide empirical constraints for parameter calibration, such as average travel frequency, known co-presence events, and institutional career trajectories. Third, they establish the historical baseline against which simulation outputs are validated.

Validation proceeds in two stages. The model must first reproduce observable macro-patterns in the historical record, including geographic distribution of authors, clustering of literary production, and thematic diffusion across regions. Only after achieving acceptable correspondence with known historical patterns are perturbation experiments introduced to assess the sensitivity of literary evolution to major disruptions.

4. Computational Framework and Model Design

The core of our methodology is the Agent-Based Model (ABM) built in Python using the Mesa framework. The simulation environment represents the geography of China (618–1279 AD) as a graph of nodes (cities/prefectures) and edges (travel routes).

Model parameters are calibrated using historically documented mobility frequencies, co-presence events, and career trajectories extracted from the source corpus, allowing the simulation to reproduce baseline macro-patterns before perturbation experiments are introduced.

4.1 Agent Properties

Each agent (representing a poet) is assigned a vector of internal states:

Mobility Motivation: A variable determined by career stage (e.g., "seeking office," "exiled," "retired").

Social Capital: A measure of network centrality that influences the agent's ability to disseminate work.

Affective State: Modeled on the PAD (Pleasure, Arousal, Dominance) emotional state model, influenced by external events (war, famine) and personal status.

4.2 Interaction Rules

Agents execute a decision loop at each time step (representing one month).

Movement: Agents move between nodes based on a gravity model calibrated by historical travel costs. High-status agents move toward the capital (Changan/Kaifeng) unless "exile" status is triggered.

Production: The probability and thematic orientation of creative output are modeled as probabilistic functions of the agent’s affective state, social context, and location. For example, high-arousal negative conditions increase the likelihood of themes associated with sorrow, displacement, and political reflection, while positive conditions increase themes associated with heroic or expansive expression.

Network Diffusion: If two agents co-locate, they form a "tie." The strength of this tie decays over time unless reinforced by subsequent co-location or "epistolary exchange" (simulated based on distance).

5. Sensitivity Analysis under Historical Perturbation

The primary innovation of this project is the introduction of controlled historical perturbations into the simulation environment. These perturbations involve modifying event parameters, mobility constraints, or network conditions to assess deviations from the validated baseline scenario. The purpose is not to construct fictional histories, but to evaluate the relative sensitivity of literary evolution to major sociopolitical disruptions.

6. Case Study and Preliminary Results

To demonstrate the efficacy of this method, we present the results of a specific experiment: "The Non-Occurrence of the An Lushan Rebellion."

6.1 Structural Sensitivity Test: The An Lushan Rebellion

In the actual historical record (and our Baseline Simulation), the years 755–763 AD show a massive spike in author mobility (due to displacement) and a sharp phase transition in literary themes (Bol, 1992). The semantic analysis of poems from this period shows a 400% increase in vocabulary related to "grief," "separation," and "state affairs," marking the transition from the romanticism of the High Tang to the realism of the Mid-Tang. The baseline model reproduces observed historical mobility distributions, regional clustering of literary activity, and broad thematic shifts with statistically significant correspondence to the archival record.

6.2 Historical Perturbation Scenario

In the experimental run, we suppressed the "Rebellion Event" node. The agents Du Fu and Li Bai, along with hundreds of minor poets, were not forced to flee the capitals.

Mobility Result: The dispersion of the literary elite into the Sichuan and Jiangnan regions was delayed by approximately 40 years across repeated simulation runs, with variation depending on network decay parameters. The cultural centralization of Changan remained high for three additional decades.

Thematic Result: The simulation showed that without the exogenous shock of the rebellion, the "High Tang" stylistic markers (romanticism, nature imagery) decayed much slower. The emergent "Realist" turn associated with Du Fu's later work appeared in the simulation but was significantly weaker and more localized.

Network Result: Interestingly, the counterfactual run resulted in a lower global clustering coefficient in the social network. The historical rebellion paradoxically strengthened the literary network by forcing disparate poets into shared exile routes, creating tight-knit "refugee" clusters that facilitated intense stylistic exchange.

6.3 Model Limitations and Sources of Uncertainty

The present model necessarily simplifies historical reality. Social ties are represented through observable co-presence and documented correspondence, which may underrepresent informal or undocumented relationships. The focus on canonical authors introduces elite bias, while thematic categories rely on computational proxies that cannot fully capture literary nuance. Accordingly, the simulation should be interpreted as a tool for exploring structural sensitivity rather than reconstructing definitive historical alternatives.

7. Discussion and Future Work

These preliminary results suggest that the An Lushan Rebellion was not merely a thematic interlude but a structural necessity for the rapid dissemination of the Mid-Tang literary style. By physically displacing the network, the war acted as a mixer that accelerated cultural evolution.

This pilot demonstrates that ABM can serve as a rigorous method for testing historical hypotheses. Our next phase involves refining the "Creativity Function" using Large Language Models (LLMs) to generate synthetic poetry based on agent states, allowing for a semantic analysis of the unwritten literature of these counterfactual timelines. We invite collaboration from historians to refine the behavioral rules and help us calibrate the "physics" of this simulated society.

Funding

This paper is supported by Digital Humanities Pilot Grant, FASS, HKBU.

References
  1. Barabási, A. L. (2016). Network Science. Cambridge University Press.
  2. Bol, P. K. (1992). “This Culture of Ours”: Intellectual Transitions in T’ang and Sung China. Stanford University Press.
  3. Epstein, J. M. (2006). Generative Social Science: Studies in Agent-Based Computational Modeling. Princeton University Press.
  4. Moretti, F. (2005). Graphs, Maps, Trees: Abstract Models for a Literary History. Verso.
  5. Song, Y. (2026). A Comprehensive Digital Corpus of Song Ci Poetry for Computational Analysis. Journal of Open Humanities Data, 12(1).
  6. Turchin, P. (2008). Historical Dynamics: Why States Rise and Fall. Princeton University Press.
  7. Wang, Z. (2021). The Tang and Song Literature Chronicle. Sichuan University Press.