Causality by Abstraction: Symbolic Rule Learning in Multivariate Timeseries with Large Language Models
Inferring causal relations in timeseries data with delayed effects is a fundamental challenge, especially when the underlying system exhibits complex dynamics that cannot be captured by simple functional mappings. Traditional approaches often fail to produce generalized and interpretable explanations, as multiple distinct input trajectories may yield nearly indistinguishable outputs. In this work, we present ruleXplain, a framework that leverages Large Language Models (LLMs) to extract formal explanations for input-output relations in simulation-driven dynamical systems. Our method introduces a constrained symbolic rule language with temporal operators and delay semantics, enabling LLMs to generate verifiable causal rules through structured prompting. ruleXplain relies on the availability of a principled model (e.g., a simulator) that maps multivariate input time series to output time series. Within ruleXplain, the simulator is used to generate diverse counterfactual input trajectories that yield similar target output, serving as candidate explanations. Such counterfactual inputs are clustered and provided as context to the LLM, which is tasked with the generation of symbolic rules encoding the joint temporal trends responsible for the patterns observable in the output times series. A closed-loop refinement process ensures rule consistency and semantic validity. We validate the framework using the PySIRTEM epidemic simulator, mapping testing rate inputs to daily infection counts; and the EnergyPlus building energy simulator, observing temperature and solar irradiance inputs to electricity needs. For validation, we perform three classes of experiments: (1) the efficacy of the ruleset through input reconstruction; (2) ablation studies evaluating the causal encoding of the ruleset; and (3) generalization tests of the extracted rules across unseen output trends with varying phase dynamics.
💡 Research Summary
**
The paper introduces ruleXplain, a novel framework that leverages large language models (LLMs) to extract formal, symbolic causal rules from black‑box simulators that map multivariate input time‑series to output time‑series. Traditional causal inference methods (e.g., Granger causality, conditional independence tests, structural equation modeling) typically quantify aggregate influence but do not provide explicit, interpretable relationships between specific input trends and delayed output behaviors, especially when the underlying dynamics are highly nonlinear and involve phase transitions. ruleXplain addresses this gap by treating the simulator as a “ground‑truth generator” and using it to produce diverse counterfactual inputs that reproduce a given baseline output trajectory.
The pipeline consists of four main stages:
-
Diverse Counterfactual Generation – Given a baseline output (Y_{base}), an optimization problem (P_{LEARN}(p)) is solved repeatedly to find input series (X^{(p)}) that yield outputs (Y_{sim}) close to (Y_{base}) while maximizing diversity with respect to previously discovered inputs. The loss term (L_{out}) measures output deviation, and a diversity term (D_{arch}) penalizes similarity to the archive. The authors employ the Tree‑structured Parzen Estimator (TPE) via Optuna to solve this problem efficiently.
-
Dimensionality Reduction & Clustering – The resulting set of input‑output pairs is embedded into 2‑D space using UMAP and then clustered with K‑Means. One centroid per cluster is selected as a representative example, drastically reducing redundancy while preserving the breadth of possible explanations.
-
LLM‑Based Rule Synthesis and Closed‑Loop Refinement – The selected centroids and their corresponding outputs are fed to GPT‑4.1 with a carefully crafted prompt that (i) enforces a constrained symbolic language (temporal logic with operators □ for “always” and ♢ for “eventually”), (ii) requires explicit delay semantics, and (iii) limits vocabulary to predefined trend and phase tokens. The LLM outputs rules of the form:
\
Comments & Academic Discussion
Loading comments...
Leave a Comment