Work

Causyx: deterministic, rewindable what-if simulation with language-model agents

Year: 2026
Type: preprint
Abstract: Insurers increasingly want to test a decision, such as a price change, a catastrophe response or a customer campaign, in simulation before making it. For that to be useful in a regulated business, a simulation must give the same answer every time it is asked, must let an analyst go back to any point and change one thing, and must keep any language-model component from silently changing the result. This paper describes Causyx, a Rust engine of 26,326 lines (20,451 excluding blank lines and comments) in 11 crates, built around those three requirements: seeded per-agent randomness and ordered resolution of parallel decisions; a timeline of snapshots with rewind, fork-with-intervention and replay; and a bounded advisory layer in which a language model may only suggest actions, every suggestion passes a validator, and responses are cached by hash so a run can be replayed exactly. The engine's 400 automated tests all pass (0 failures), including same-seed runs of up to 5,000 steps and single- versus multi-thread comparisons. To measure the design end to end we built a small browser version that follows the engine's main design rules. Across 1,000 seeds, all 61,000 weekly states were rebuilt bit for bit, all 60,000 no-change branches matched the main timeline, the same digest of every state was produced in Node and in a Chromium browser, and sharing random numbers between a branch and the main line reduced the spread of measured what-if effects by 1.44 to 2.30 times. Back-testing against real insurance history is future work. Files: the paper (PDF, licensed CC BY 4.0) and causyx_paper_supplement.zip, which holds the experiment and measurement scripts, their saved outputs and the exact browser engine used (code licensed GNU AGPL-3.0). Live demo: https://vivekmitra.com/causyx.html
Author: Mitra, Vivek
Language: English
Open Access status: green
OpenAlex ID: W7238396027
Cites:
Cited by:
Related to: