CASSANDRA: Programmatic and Probabilistic Learning and Inference for Stochastic World Modeling
Panagiotis Lymperopoulos, Abhiramon Rajasekharan, Ian Berlot-Attwell, Stéphane Aroca-Ouellette, Kaheer Suleman · 2026
Read CASSANDRA: Programmatic and Probabilistic Learning and Inference for Stochastic World Modeling by Panagiotis Lymperopoulos, Abhiramon Rajasekharan, Ian Berlot-Attwell, Stéphane Aroca-Ouellette, Kaheer Suleman (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2601-18620.txt.
Introduction
Panagiotis Lymperopoulos and four colleagues build CASSANDRA, a tool that learns a model of a world from few facts so an agent can plan in it. Real plans, in shops or firms, hinge on rich cause chains that are hard to learn from data alone. The world is too wide and the facts too thin. But much is known in words about how such worlds work.
CASSANDRA taps that word lore. It asks a large text model to draft light rules for how acts change the world. Chance is kept in the rules, so plans can weigh risk. Light rules built from lore could plan well where a pure data model would starve. The work points to plans that mix book lore with hard facts. Such plans could serve firms that must act on thin data.
Catalog record
| CREATOR | Panagiotis Lymperopoulos, Abhiramon Rajasekharan, Ian Berlot-Attwell, Stéphane Aroca-Ouellette, Kaheer Suleman |
|---|---|
| YEAR | 2026 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 94 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2601-18620
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
CASSANDRA: Programmatic and Probabilistic Learning and Inference for Stochastic World Modeling Panagiotis Lymperopoulos, Abhiramon Rajasekharan, Ian Berlot-Attwell, Stéphane Aroca-Ouellette, Kaheer Suleman Abstract Building world models is essential for planning in real-world domains such as businesses. Since such domains have rich semantics, we can leverage world knowledge to effectively model complex action effects and causal relationships from limited data. In this work, we propose CASSANDRA, a neurosymbolic world modeling approach that leverages an LLM as a knowledge prior to construct lightweight transition models for planning. CASSANDRA integrates two components: (1) LLM-synthesized code to model deterministic features, and (2) LLM-guided structure learning of a probabilistic graphical model to capture causal relationships among stochastic variables. We evaluate CASSANDRA in (i) a small-scale coffee-shop simulator and (ii) a complex theme park business simulator, where we demonstrate significant improvements in transition prediction and planning over baselines. 1 Introduction Figure 1: Overview of the CASSANDRA architecture. Deterministic dynamics are modeled by LLM-generated code, which is optimized by an evolutionary algorithm using observed trajectories (top). Stochastic dynamics are modeled by a probabilistic graphical model, designed through simulated annealing structure search with an LLM prior and observed transitions (bottom). Effective planning over extended horizons requires an internal model of the environment Richens et al. 2025 . However, developing such a world model for real-world environments is challenging, as these domains often contain both deterministic and stochastic dynamics. Consider an agent for a pizza business deciding whether to purchase a better oven. This action has deterministic effects: paying for the new oven and reduction in pizza preparation time. It also has cascading stochastic effects: faster preparation may improve customer satisfaction and demand, which in turn affects sales and revenue. An accurate world model must therefore capture both deterministic and stochastic consequences of actions from limited data—a capability that many existing benchmarks overlook Hafner 2021 ; Chollet 2019 ; Jansen et al. 2024 . Recent advances in large language models (LLMs) have led to their application in world modeling from limited data, but existing approaches still fall short in domains with mixed dynamics. Using pre-trained LLMs directly as zero-shot world models Hao et al. 2023 fails on two fronts: (i) they are ill-suited for the precise symbolic computation (e.g., arithmetic) required to model deterministic variables Bai et al. 2025 ; Wang et al. 2024 , and (ii) such models often do not capture domain-specific data distributions Schoenegger and Park 2023 . Code world models Tang et al. 2025 ; Dainese et al. 2024 address the symbolic computation issue by executing LLM-written code, which is more lightweight and sample-efficient. However, existing methods focus on deterministic environments and lack a principled mechanism for fitting models to stochastic real-world data Tang et al. 2025 . To address these limitations, we introduce CASSANDRA (Combining A Symbolic and Stochastic Architecture for Non-deterministic Domains), a dual-stream neurosymbolic framework that integrates a symbolic code component for deterministic dynamics with a probabilistic graphical model for stochastic uncertainty. As shown in Figure 1 , our approach leverages a natural language description to initialize both the programmatic model and the graphical structure. Both components are then refined using observed trajectories. We compare CASSANDRA against baselines including WALL-E Zhou et al. 2024 , WorldCoder Tang et al. 2025 , and targeted ablations that isolate the impact of code refinement (deterministic component) and causal structure learning (stochastic component). We evaluate each world model on transition prediction and downstream planning performance when integrated with an agent in two business simulators with non-trivial stochastic dynamics: CoffeeShopSimulator and Mini Amusement Parks (MAPs) Aroca-Ouellette et al. 2025 . Our main contributions are: (1) CASSANDRA, a novel dual-stream world modeling framework that integrates deterministic and stochastic components initialized from natural language; (2) a hybrid refinement methodology that improves the two components using observed trajectories; and (3) extensive experiments showing that CASSANDRA significantly improves transition prediction and planning over baselines. 2 Related Work Recent work leverages large language models (LLMs) to improve the sample efficiency of learning world models Zhao et al. 2023 . A common approach uses an LLM directly as a world model for next-state prediction, often combined with planning methods such as Monte Carlo Tree Search Hao et al. 2023 . However, LLM world models struggle with domain-specific transition dynamics requiring arithmetic or symbolic precision Wang et al. 2024 , and they are unreliable for verifying action preconditions and effects Xie et al. 2024 . WALL-E Zhou et al. 2024 partially addresses this by learning code-based precondition rules, but still relies on LLM state prediction. This is unreliable since untuned LLMs are weak at probabilistic forecasting Schoenegger and Park 2023 , and fine-tuning remains data-hungry Xiang et al. 2023 . In addition, repeated LLM calls impose high inference costs and latency for planning. A complementary direction is code world models , which use LLM-generated programs to model transition dynamics. These models are lightweight and can be more sample-efficient. WorldCoder Tang et al. 2025 generates a code world model through environment interaction, but assumes deterministic environments and refines a monolithic program. In contrast, CASSANDRA uses targeted code refinement based on the transition prediction error. Other related systems include Visual Predicator Liang et al. 2025 , which learns action preconditions and effects but focuses on visual domains, and AlphaEvolve Novikov et al. 2025 , which evolves code via refinement but doesn’t address stochastic dynamics. For probabilistic settings, PoE Piriyakulkij et al. 2025 and OneLife Khan et al. 2025 learn probabilistic code world models, but are limited to categorical distributions over code fragments and remain untested in complex stochastic environments. Probabilistic program induction has also been explored Curtis et al. 2025 , though existing approaches struggle to fit rich distributions and are mainly demonstrated in simple domains. Finally, LLMs can contribute causal priors for stochastic modeling. Prior work shows LLMs support causal reasoning Ma 2024 ; Jiralerspong et al. 2024 ; Ban et al. 2025 and language-guided causal discovery Choi et al. 2022 ; Requeima et al. 2024 . To our knowledge, CASSANDRA is the first framework to explicitly leverage LLM-based causal discovery in world modeling. 3 Methodology Our goal is to learn an expressive, hybrid world model of an environment from environment documentation and observed trajectories. 3.1 Framework Overview We model the environment as a Semantically-Rich Partially Observable Markov Decision Process (SR-POMDP) defined by (\mathcal{O},\mathcal{S},\mathcal{A},\mathcal{P},\mathcal{R},\gamma,\mathcal{L}) , where \mathcal{O} is the observation space, \mathcal{S} the state space, \mathcal{A} the action space, \mathcal{P} the transition function, \mathcal{R} the reward function, \gamma the discount factor, and \mathcal{L} is a text corpus containing semantic descriptions of the observation variables and environment dynamics. At each time step t , the observation is a vector consisting of deterministic and stochastic components, (\mathbf{s}_{t},\mathbf{x}_{t}) . We express both the ground-truth transition distribution \mathcal{P} and reward function \mathcal{R} in terms of these observables, and include the reward r_{t} as an additional stochastic observable. We also observe an action a_{t-1} and action validity \sigma_{t-1} , which captures whether the action can be executed in the corresponding state. We assume \sigma_{t-1} is deterministically computed. Finally, we learn a world model from a dataset of observed transitions \mathcal{D}=\{(\mathbf{s}_{t-1},\mathbf{x}_{t-1},a_{t-1},\sigma_{t-1},\mathbf{s}_{t},\mathbf{x}_{t})_{i}\}_{i=1}^{N} . By separating deterministic from stochastic variables, we can factorize the transition probability as follows: p(\mathbf{x}_{t},\mathbf{s}_{t}|\mathbf{s}_{t-1},\mathbf{x}_{t-1},a_{t-1})=\\ p(\mathbf{x}_{t}|\mathbf{x}_{t-1},a_{t-1},\mathbf{s}_{t},\mathbf{s}_{t-1})p(\mathbf{s}_{t}|\mathbf{s}_{t-1},\mathbf{x}_{t-1},a_{t-1}). (1) This separation enables