Causality by Abstraction: Symbolic Rule Learning in Multivariate Timeseries with Large Language Models Preetom Biswas, Giulia Pedrielli, K. Selçuk Candan Abstract 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 the same or closely matching 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) we verify the efficacy of the ruleset through input reconstruction; (2) we conduct ablation studies evaluating the causal encoding of the ruleset; and (3) we perform generalization tests of the extracted rules across unseen output trajectories with varying phase dynamics. The code is available here . keywords Causal inference, Timeseries analysis, Rule-Based Explanations, Large Language Models (LLMs), Closed-Loop Learning. 1 Introduction and Related Literature Many scientific and engineering domains rely on high-fidelity physics-based simulators that model complex dynamical systems such as epidemic spread, climate projections, and autonomous driving testing. These simulators can accurately generate output timeseries from given inputs, yet they are typically treated as black boxes due to the inner complexity. While they reproduce dynamics, they do not provide transparent explanations of how qualitative behaviors in the output arise from patterns in the input. Timeseries data exacerbate such challenges due to temporal dependencies, delayed effects, high-dimensionality, and feedback loops, further complicating the characterization of causal dependency. Approaches such as Granger causality ( 10 ) , conditional independence methods ( 6 ; 19 ) , and Structural Equation Models ( 18 ) identify statistical dependencies over the complete simulation horizon. While insightful, these methods typically quantify aggregate influence rather than providing explicit relations between specific input trends and delayed qualitative output behaviors. These challenges are further complicated when both inputs and outputs are multivariate timeseries produced by a simulator whose structural equations are inaccessible (or intractable). More recently, Large Language Models (LLMs) have gained prominence in this field due to their pattern recognition, explainable abstraction, and high reasoning capabilities. The attention mechanism in transformers-based LLMs can capture long-range dependencies and complex sequential patterns present in timeseries data ( 1 ; 9 ) . LLM architectures have accelerated timeseries forecasting by managing larger, more complex datasets and capturing non-linearities and dependencies directly from historical data ( 14 ; 12 ; 13 ) . For example, 20 combined numerical timeseries and text-based news inputs with chain-of-thought reasoning to connect events with temporal shifts. Also relevant, ( 11 ) introduce a framework that reprograms LLMs for timeseries forecasting by mapping timeseries into text-based representations, allowing few-shot and zero-shot prompting without modifying the pre-trained model. Other contributions have explored the construction of causal graphs to predict multi-variate timeseries progression ( 17 ) . Despite such significant strides, few studies have proposed methodologies that attempt identifying generalized, explainable causal relations, especially between multi-variate timeseries inputs and outputs. In this paper, we propose ruleXplain , a framework that leverages LLMs to infer generalizable, symbolic causal relations between multivariate input and output timeseries with delayed effects. Inspired by in-context learning (ICL) ( 5 ) , our approach avoids fine-tuning by providing the LLM with a relevant set of input trajectories, i.e., diverse counterfactual inputs that yield similar output behaviors in a simulator. The LLM is prompted to synthesize a formal ruleset using a constrained symbolic language that captures conjunctions of input trends over time windows and their delayed implications on output phases (e.g., peak onset or plateau formation). These rules are iteratively refined in a closed-loop process: the LLM generates new input configurations based on the extracted rules, the simulator evaluates the resulting outputs, and the ruleset is adjusted to correct inconsistencies or refine the temporal window associated with each phase. The LLM is instructed to provide symbolic justifications for its decisions, akin to chain-of-thought prompting, but grounded in a formal logical schema. Finally, we evaluate the inference and generalizability of the extracted rules by testing their ability to generate plausible inputs for unseen output trajectories with distinct phase dynamics, validating the causal structure encoding capabilities of ruleXplain . To demonstrate the framework, we use timeseries generated from the epidemiological simulator PySIRTEM ( 4 ) , studying the relationship between testing rates and daily infection trends, and the EnergyPlus simulator ( 7 ) , inferring causation between temperature and solar irradiance inputs and electricity consumption for a Supermarket System. Importantly, ruleXplain only uses raw numerical input-output timeseries without any specific semantics associated with epidemics, governing domain-specific dynamics, or underlying system information. Contributions. ruleXplain introduces a symbolic and phase-aware framework for explainable causal inference in black-box timeseries systems. Specifically: (C1) Symbolic framing of delayed causal inference: We formalize timeseries causal inference as a symbolic rule identification task, introducing a constrained rule language with temporal operators and delay semantics. This shifts the focus from traditional forecasting or graph reconstruction toward interpretable, phase-based reasoning. (C2) Domain-agnostic extraction from black-box simulators: Our method infers interpretable causal abstractions without access to simulator equations or domain priors. It treats multivariate input-output timeseries purely as abstract signals, enabling general-purpose causal rule extraction across black-box systems. (C3) LLM-in-the-loop rule synthesis: We propose a novel prompting and refinement strategy that uses LLMs to generate, verify, and iteratively improve formal rulesets using a closed-loop process grounded in simulation feedback. (C4) Generalization via input reconstruction: We validate inference ability by reconstructing inputs for unseen output trajectories with distinct qualitative dynamics. 2 Methodology Fig. 1 summarizes the ruleXplain pipeline. Figure 1 : ruleXplain method overview key modules and interactions. Executing the simulation for a given input, we obtain a baseline output trajectory Y_{\mbox{\tiny{base}}} . A learning module then generates diverse multivariate input timeseries that fit Y_{\mbox{\tiny{base}}} . These diverse input-output pairs form the basis for extracting causal structure (Sec. 2.1 ). To reduce redundancy, we apply dimensionality reduction and clustering to select representative input-output trajectories (Sec. 2.2 ). The resulting cluster centroids are used as context for the LLM, which generates a symbolic ruleset \mathcal{R} capturing temporal input trends and their delayed effects on output phases (Sec. 2.3 ). Next, the LLM generates new input timeseries consistent with \mathcal{R} , which are evaluated through the simulator to produce an output Y^{\prime} . The validity of \mathcal{R} is assessed by comparing Y^{\prime} with Y_{\mbox{\tiny{base}}} . If the deviation exceeds a threshold \epsilon , the mismatch is used as feedback to refine \mathcal{R} in a closed-loop manner. This iterative process enforces the logical constraints until the ruleset \mathcal{R} yields inputs that produce output trajectories within acceptable deviation from Y_{\mbox{\tiny{base}}} (Sec. 2.3 ). 2.1 Input Timeseries Learning Module Given a Baseline Output trajectory Y_{\mbox{\tiny{base}}} of length T , the goal of the learning module is to construct diverse inputs (as multivariate time series) \mathbf{X}_{t} that would result in similar output Y_{\mbox{\tiny{sim}}}\approx Y_{\mbox{\tiny{base}}} . We sequentially generate a set of N diverse input time series, \mathcal{A}_{N}=\left\{\mathbf{X}^{p}_{t}\right\}_{p=1}^{N} that minimize deviation from the baseline output while maintaining diversity among previously discovered solutions. Here, each component of the input is a time series, i.e., X_{j}=\left\{x_{j,1},x_{j,2},\ldots,x_{j,T}\right\} for each component j=1,\ldots,J .For each iteration p=1,\ldots,N , we solve: \displaystyle P_{\mbox{\tiny{LEARN}}}(p):\min_{\mathbf{X}^{p}}\quad \displaystyle L_{\mbox{\tiny{out}}}(Y_{\mbox{\tiny{sim}}}(\mathbf{X}^{p}),Y_{\mbox{\tiny{base}}})-\lambda_{\mbox{\tiny{arch}}}D_{\mbox{\tiny{arch}}}(\mathbf{X}^{p},\mathcal{A}_{p-1}) (1) s.t. \displaystyle\ell_{j,t}\leq x^{p}_{j,t}\leq u_{j,t},\quad\forall j=1\ldots,J\;\mbox{and}\;t\in\{1,\dots,T\}. In problem P_{\mbox{\tiny{LEARN}}}(p) , we have: \displaystyle L_{\mbox{\tiny{out}}}(\cdot) \displaystyle=\frac{1}{T}\sum_{t=1}^{T}\left(Y_{\mbox{\tiny{sim}},t}(\mathbf{X}^{p}_{t})-Y_{\mbox{\tiny{base}},t}\right)^{2};\quad D_{\mbox{\tiny{arch}}}(\cdot)=\frac{1}{|\mathcal{A}_{p-1}|}\sum_{\ell=1}^{|\mathcal{A}_{p-1}|}d^{\ell}, \displaystyle\mbox{where: }\quad d^{\ell} \displaystyle=\sum_{j=1}^{J}\left\{\frac{1}{T}\sum_{t=1}^{T}\left|\frac{x^{p}_{j,t}-x^{\ell}_{j,t}}{x^{\ell}_{j,t}}\right|\right\}. Solving P_{\mbox{\tiny{LEARN}}}(p) sequentially for p=1,\ldots,N yields a set of diverse input time series \left\{(\mathbf{X}^{p}_{t})^{T}_{t=1}\right\}_{p=1}^{N} that produce a similar baseline trajectory Y_{\mbox{\tiny{base}}} (the cost L_{\mbox{\tiny{out}}} ). To enforce diversity, we maintain an archive \mathcal{A} of previously generated solutions. At iteration p , the archive \mathcal{A}_{p-1} contains all time series \left\{(\mathbf{X}^{i}_{t})^{T}_{t=1}\right\}_{i=1}^{p-1} , with \mathcal{A}_{0}=\emptyset , and the newly obtained solution is added after each iteration. The diversity term D_{\mbox{\tiny{arch}}} quantifies the sum of the average difference between the candidate input (\mathbf{X}^{p}_{t}) and each archived input across all time steps and input components, weighted by \lambda_{\mbox{\tiny{arch}}} which is chosen by the user to balance diversity. To incrementally solve P_{\mbox{\tiny{LEARN}}}\left(p\right),p=1,\ldots,N we employed the Tree-structured Parzen Estimator (TPE) algorithm ( 21 ) in the Optuna environment ( 2 ) . 2.2 Dimensionality Reduction and Clustering To form the training set for the explanation generation step, we apply dimensionality reduction and clustering on the set of timeseries resulting from the learning step (Sec. 2.1 ), \{\left(\mathbf{X}^{p}_{t}\right)^{T}_{t=1}\}^{N}_{p=1} . Specifically, we employ the Uniform Manifold Approximation and Projection (UMAP) ( 15 ) technique to represent the data points in a 2-D space embedding and partition into clusters through K -Means clustering, from which a single centroid representative \left(\mathbf{X}^{c}_{t}\right)^{T}_{t=1} is selected per cluster. The resulting input-output pairs \{\left(\mathbf{X}^{c}_{t}\right)^{T}_{t=1},Y_{\mbox{\tiny{sim}}}^{c})\} serve as the training context for the LLM during explanation generation (Sec. 2.3 ). This reduction step preserves diversity while eliminating redundant examples that could bias the learned ruleset toward over-specific patterns. Implementation details are provided in Appendix A.3 . 2.3 LLM-based Explanation Generation The explanation generation component of the proposed ruleXplain consists of two steps: (i) initial ruleset elicitation based on the cluster-derived context and (ii) closed-loop rule refinement process. The specific LLM used in this work is the OpenAI gpt4.1 ( 16 ) . The complete procedure is also summarized in Table 1 . Initial Explanation Inference. This step receives as input the centroids resulting from the clustering (Sec. 2.2 ), namely \left(\left(\mathbf{X}^{p}_{t}\right)^{T}_{t=1},Y_{\mbox{\tiny{sim}}}^{c}\right) , which we refer to as the context , for generating the initial set of explainable symbolic rules that characterize the relationship between input and output timeseries. Notably, we avoid providing ruleXplain with prior knowledge of the underlying system dynamics (e.g., epidemics-specific transmission dynamics) and domain-specific notations. Instead, variables are presented purely as abstract timeseries data without any explicit reference to their physical meaning and/or regulating equations, conveying only the existence of a causal relationship. Since Y_{\mbox{\tiny{sim}}}^{c}\approx Y_{\mbox{\tiny{base}}} , we will represent the contexts with \{\left(\mathbf{X}^{c}_{t}\right)^{T}_{t=1},Y_{\mbox{\tiny{base}}})\} . Along with the aforementioned context, through prompting, we further guide the LLM to infer a causal ruleset by stating the following general properties: (i) direct/inverse trend between \left(\mathbf{X}^{c}_{t}\right)^{T}_{t=1} and Y , without providing an indication of proportionality, (ii) delayed effect (temporal lag) between the input (cause) and the output series (effect) and, (iii) explicit constraints on structure, format, and vocabulary to ensure reproducibility and consistency (Sec. 2.3 ). The specific prompt to generate the initial set of rules is listed in Appendix C . Closed-loop Rule Refinement. Given the initial ruleset, the closed-loop refinement pipeline iterates until an acceptable set of rules is obtained, i.e., when the input sequence generated from the ruleset yields an output Y_{\mbox{\tiny{sim}}} sufficiently similar to the baseline output. Without loss of generality, we say that two time series are similar when the distance measure L_{\mbox{\tiny{out}}}(Y_{\mbox{\tiny{sim}}},Y_{\mbox{\tiny{base}}}) is bounded by a user selected positive \epsilon . The refinement iterates through three key steps: i) Input set generation using the initial ruleset . Given the cluster-derived context, we prompt the LLM to generate a unique input timeseries \mathbf{X}^{\prime}=(\mathbf{x}_{1}^{\prime},\dots,\mathbf{x}_{T}^{\prime}) that differs from the cluster-derived inputs ( \left\{\left(\mathbf{X}^{c}_{t}\right)^{T}_{t=1}\right\}^{C}_{c=1} ) but remains strictly consistent with the initial ruleset. We prompt the LLM to identify the different phases, predefined by a schema, and generate the input configurations accordingly. Moreover, the LLM is instructed to justify the generated input values to prevent misalignment with the previously inferred relationships. ii) Evaluation of the new input. The generated input timeseries are evaluated by executing the simulator, obtaining the corresponding output trace Y^{\prime} . All other simulator hyperparameters remain unmodified. iii) Ruleset refinement. The new input-output pair \left\{\left(\mathbf{X}^{\prime}_{t}\right)^{T}_{t=1},Y^{\prime}\right\} is then returned to the LLM model along with the baseline Y_{\mbox{\tiny{base}}} to quantify the deviation L_{\mbox{\tiny{out}}}(Y_{\mbox{\tiny{sim}}},Y_{\mbox{\tiny{base}}}) . The LLM also retains the cluster contexts and prior iteration results. By evaluating the \left\{\left(\mathbf{X}^{\prime}_{t}\right)^{T}_{t=1},Y^{\prime}\right\} and Y_{\mbox{\tiny{base}}} , the LLM identifies inaccurate symbolic rules and generates a modified (refined) ruleset. Additional qualitative constraints (such as “ Y^{\prime} displays weaker resurgence than Y_{\mbox{\tiny{base}}} ”, and “the inputs should not oscillate”) are provided as constraints to guide ruleset refinement. The rationale behind iterative refinement with progressive constraints, instead of offering all the constraints initially, is to reduce reasoning load and avoid overwhelming the model. At this stage of ruleXplain development, the constraints are added manually based on observed deviations in Y_{\mbox{\tiny{base}}} and Y^{\prime} . Formal Representation of Extracted Rules To formalize the structure of the extracted rules, we adopt a symbolic and temporal logic-based notation to describe causal dependencies between trends in the input timeseries and phases of the output. Each rule is represented as a temporal implication of the form: \Box_{[t_{1},t_{2}]}\left(\textsf{Trend}_{h}(X_{h})\land\textsf{Trend}_{j}(X_{j})\right)\rightarrow\Diamond_{[t_{3},t_{4}]}\textsf{Phase}(Y) (2) where h and j are two particular dimensions of the input timeseries. Here: • \textsf{Trend}_{\cdot}(X_{\cdot}) is a unary predicate applied to an input series over interval [t_{1},t_{2}] , drawn from a fixed vocabulary \mathcal{T} (e.g., Low , SharpSpike , HighStable ). • \textsf{Phase}(Y) is a qualitative output behavior over [t_{3},t_{4}] , drawn from a vocabulary \mathcal{P} (e.g., InitialGrowth , PeakFormation ). • \Box and \Diamond denote persistent and eventual satisfaction of input and output properties over their respective intervals. • Rules may include explicit delay constraints: t_{3}>t_{2} . • The delay \delta=t_{3}-t_{2} captures the temporal lag between cause and effect. As an illustrative example, consider the rule: \Box_{[t_{1},t_{2}]}\left(\textsf{SlowRise}(X_{h})\land\textsf{Low}(X_{j})\right)\rightarrow\Diamond_{[t_{3},t_{4}]}\textsf{PeakFormation}(Y) (3) This rule states that if X_{h} slowly rises and X_{j} remains low over a time window [t_{1},t_{2}] , then a peak in Y will occur in the delayed interval [t_{3},t_{4}] . The ruleset \mathcal{R} is composed of multiple such formulas, one per output phase, and provides an interpretable symbolic explanation of the causal dynamics. Table 1 : Stepwise process for Causal Rules Inference through LLM. Procedure: Explanation Generation and Refinement Step 1: Initialize. Extract an initial ruleset R_{0} derived from Cluster-derived context [\left(\mathbf{X}^{c}_{t}\right)^{T}_{t=1},Y_{base}]_{c=1}^{C} pairs. Step 2: Generate Inputs. Use R_{i} and [\left(\mathbf{X}^{c}_{t}\right)^{T}_{t=1},Y_{base}]_{c=1}^{C} to prompt novel input sequences \left(\mathbf{X}^{(i)}_{t}\right)^{T}_{t=1}) that approximately reproduce the baseline trajectory Y_{\text{base}} . Step 3: Simulate & Evaluate. Run the simulator and compute deviation \Delta^{(i)} using the loss L_{\mbox{\tiny{out}}} calculated from Y^{(i)} and Y_{base} . Step 4: Update Rules. If \Delta^{(i)}>\epsilon , update R_{i} based on observed mismatches and added constraints to get R_{i+1} . Step 5: Repeat. Continue Steps 2–4 until \Delta^{(i)}\leq\epsilon or the maximum number of iterations is reached, yielding the refined ruleset R_{\mbox{\tiny{final}}} . Please note that [\left(\mathbf{X}^{c}_{t}\right)^{T}_{t=1},Y_{base}]_{c=1}^{C} remain unchanged across iterations. 3 Numerical Experiments In this section, through set of validation experiments, we address three questions: Q1. Do the rules generated within ruleXplain lead to increasingly more accurate and explainable timeseries? Q2. How much does the ruleset or context impact the quality of the generated input timeseries? Q3. Is the ruleset generalizable to any baseline timeseries? 3.1 Simulation Environments To demonstrate ruleXplain , we use different two simulation environments: • PySIRTEM ( 4 ) . For this epidemic simulator, the relevant input-output pair for the causal analysis is \{\left(\mathbf{X}^{p}_{t}\right)^{T}_{t=1},Y\}\equiv\{(X_{s,t},X_{a,t}),Y\} , where X_{s} and X_{a} denote the symptomatic and asymptomatic testing-rate, respectively, and Y denotes the daily infected cases over T=100 days. The input trajectories vary weekly, consistent with the simulator assumptions. • EnergyPlus ( 7 ) . For this building energy simulator, the relevant input–output pair is {(X_{d},X_{g}),Y} , where X_{d} denotes Dry Bulb Temperature ( {}^{o}C ), X_{g} denotes solar input, i.e., the global horizontal irradiance ( Wh/m^{2} ), and Y denotes building electricity usage ( J ) for a supermarket setting. Inputs vary hourly and horizon is T=100 hours. In our experiments, we treat the simulator as a black box: its internal equations and parameters remain fixed and are not used by ruleXplain . A detailed description of the PySIRTEM and EnergyPlus model dynamics is provided in Appendix A.1 - A.2 . 3.2 Q1: Evaluation of Ruleset-Generated Input Timeseries To address Q1, we apply ruleXplain to extract symbolic rules describing the relationship between multivariate input time series and the target output trajectory. For each simulation environment, we first select a baseline output time series Y_{\text{base}} over a fixed horizon ( T=100 ). For PySIRTEM , we used the daily infection data from March 22 to June 30, 2020 ( 8 ) and for EnergyPlus, the electricity consumption for a supermarket setup in Miami, FL from Jan 1 to Jan 5, 1997. From the baseline output, we solved P_{\mbox{\tiny{LEARN}}}(p) for p=1,\ldots,N=20 obtaining a preliminary set \mathcal{A} with |\mathcal{A}|=20 top performing input timeseries \left\{(X^{\ell}_{s},X^{\ell}_{a})\right\}^{|\mathcal{A}|}_{\ell=1} ranked by distance measure from the baseline, L_{out} . The centroid timeseries \left\{(\mathbf{X}^{c}_{t})^{T}_{t=1}\right\}^{C}_{c=1} , obtained from U-MAP projection and K-Means clustering, were used as input to the simulators ( PySIRTEM and EnergyPlus) to produce the Y_{\mbox{\tiny{sim}}}\approx Y_{\mbox{\tiny{base}}} . Given the clusters (context) \left\{(\mathbf{X}^{c}_{t})^{T}_{t=1},Y_{\mbox{\tiny{base}}}\right\} , we can then execute the procedure detailed in Sec. 2.3 , where we infer the formal rulesets \mathcal{R}_{\mbox{\tiny{final}}} for both PySIRTEM and EnergyPlus (complete rulesets are reported in Appendix B , Table 2 - 3 ). Fig. 2 - 3 shows the input–output trajectories resulting from the final ruleset \mathcal{R}_{\mbox{\tiny{final}}} produced by ruleXplain , for both PySIRTEM and EnergyPlus respectively, along with centroid context timeseries. The close temporal and magnitude alignment of the simulated Y_{\mbox{\tiny{final}}} and Y_{\mbox{\tiny{base}}} is indicative of the accuracy and effectiveness of \mathcal{R}_{\mbox{\tiny{final}}} in explaining the inherent (and unknown) dynamics emerging from the principled simulation. In particular, for EnergyPlus, the periodic structure of the output signal is also effectively reflected through the inferred input patterns. Across all our experiments we consistently observed lower errors as a function of the ruleXplain iterates, thus supporting convergence of the proposed approach (numerical evidence is reported in Appendix B , Fig. 8 ). Figure 2 : Timeseries X_{s} , X_{a} , and Y generated using \mathcal{R}_{final} for PySIRTEM . Figure 3 : Timeseries X_{d} , X_{g} , and Y generated using \mathcal{R}_{final} for EnergyPlus. 3.3 Q2: Impact of Ruleset and Cluster-Derived Context We examine how much causal information is encoded in the causal ruleset and the cluster-derived context by using them to generate input timeseries corresponding to a fixed target output Y_{\mbox{\tiny{base}}} in our PySIRTEM experiment. Specifically, we evaluate three scenarios: (S1) no ruleset and no clustering context , (S2) ruleset only , and (S3) ruleset with clustering context . This comparative setup allows us to isolate and quantify the contribution of \mathcal{R}_{\mbox{\tiny{final}}} and contextual examples to the accuracy and novelty of the generated inputs. The specific prompts for each experiment are listed in the Appendix C.2 . Fig. 4 - 5 display a clear progressive improvement from S1 to S2. The no-guidance (S1) scenario produces outputs with the least accuracy, which is significantly increased with \mathcal{R}_{\mbox{\tiny{final}}} (S2). Adding clustering context (S3) yields mixed effects, reporting slight improvement for PySIRTEM , but less flexible to baseline trends for EnergyPlus. This suggests potential overfitting to the examples rather than improved adherence to the baseline and ruleset. The progression, particularly the major gain from S1 to S2, corroborate the encoding ability of causal information in the ruleXplain -generated ruleset, while addition of context in downstream tasks could overbias the model. Across all scenarios, the timing of key phases (e.g. peak and decline) are aligned with Y_{\mbox{\tiny{base}}} . We conjecture it to be due to the underlying physics of system: specific parameters govern certain qualitative properties. For example, in PySIRTEM , infection rate is the primary driver of the disease progression which is kept constant to infer causal dependency between decidable human-regulated testing rates and corresponding infection case trends. Similarly, in EnergyPlus, we isolate the influence of observable weather inputs (e.g., temperature) on facility-level electricity consumption. In both cases, our focus was to generate interpretable insights that can support decision makers. Figure 4 : Causal Encoding Comparison of \mathcal{R}_{\mbox{\tiny{final}}} through scenarios S1-S3 for PySIRTEM . Figure 5 : Causal Encoding Comparison of \mathcal{R}_{\mbox{\tiny{final}}} through scenarios S1-S3 for EnergyPlus. 3.4 Q3: Results Generalizability Across Baselines We assess whether the ruleset \mathcal{R}_{\mbox{\tiny{final}}} inferred from a specific baseline Y_{\mbox{\tiny{base}}} timeseries and cluster-derived contexts \left((X_{s}^{c},X_{a}^{c}),Y^{c}_{\mbox{\tiny{sim}}}\right) , if utilized to construct input timeseries for a different Y^{\prime}_{\mbox{\tiny{base}}} , produce a timeseries Y^{\prime}_{\mbox{\tiny{final}}}\approx Y^{\prime}_{\mbox{\tiny{base}}} . Due to space limitation, we perform this experiment only for our PySIRTEM setup where we varied testing and infection rates to produce two Y_{\mbox{\tiny{base}}} patterns with the following properties: i) Y^{1}_{\mbox{\tiny{base}}} with prominent phase changes that are easily mapped by the symbolic ruleset, but differing in timing (i.e., prolonged low initial phase, sharp peak no resurgence). ii) Y^{2}_{\mbox{\tiny{base}}} with less distinct, non-prominent phase dynamics that cannot be directly mapped to the ruleset (i.e. prolonged low initial phase, mild growth, slight dip, and late high resurgence). For each baseline, we perform two experiments: (E1) We provide the LLM with the ruleset but no clustering context (see Sec. 3.3 ). The objective is to assess whether the ruleset inferred from another baseline alone can generate inputs \left(X_{a},X_{s}\right) with acceptable accuracy for the new baselines Y^{i}_{\mbox{\tiny{base}}},i=1,2 . (E2) We modify the ruleset by inverting and replacing a subset of causal relationships, producing an inaccurate ruleset \mathcal{R}_{\mbox{\tiny{incorrect}}} , (provided in Appendix C , Table 4 ). We then examine how rule inaccuracies affect input generation and the alignment between Y_{\mbox{\tiny{incorrect}}} and Y_{\mbox{\tiny{base}}} . Fig. 6 demonstrates the ability of the \mathcal{R}_{\mbox{\tiny{final}}} -induced inputs to infer trajectories that produce accurate outputs under both prominent and non-prominent phase dynamics (Fig. 6 ). In both cases, inputs generated under \mathcal{R}_{\mbox{\tiny{final}}} capture the progression of Y_{\mbox{\tiny{base}}} with reasonable accuracy. In contrast, under the modified ruleset \mathcal{R}_{\mbox{\tiny{incorrect}}} we observe substantially greater misalignment—both temporally and in magnitude—between Y_{\mbox{\tiny{incorrect}}} and Y_{\mbox{\tiny{base}}} . This supports the importance of a well-defined, structured ruleset for improved input generation. Figure 6 : Input Inference for an alternate (left) Y^{1}_{\mbox{\tiny{base}}} with Prominent Phase Changes (right) Y^{2}_{\mbox{\tiny{base}}} with Non-Prominent Phase Changes. E1 results are in the left subplot, E2 in the right subplot for each. Discussion and limitations. While our evaluations demonstrate that the extracted rules are syntactically valid, semantically consistent, and effective in generating novel inputs given outputs, we acknowledge several limitations. First, our framework does not aim to recover the “ground-truth” generative rules of the simulator, instead constructing symbolic rules within a constrained logical grammar that provide valid and reusable causal explanations for observed trajectories. As such, traditional accuracy-based comparisons against latent mechanistic models are not applicable. Secondly, we do not benchmark against existing symbolic rule learners or interpretable predictors (e.g., shapelet-based classifiers or symbolic regression), as our objective is not prediction or classification, but symbolic abstraction of delayed causal relations in high-dimensional temporal simulations. 4 Conclusions and Future Work We presented ruleXplain , a symbolic rule learning framework for causal abstraction in multivariate timeseries data. Unlike traditional forecasting or structural inference methods, ruleXplain constructs formal causal rules expressed in a constrained, human-interpretable symbolic language with explicit temporal and delay semantics. This structure enables LLMs to generate reusable explanations that link input trends to output phase behaviors without relying on domain-specific knowledge or direct simulator access. We demonstrate the approach across two distinct models and domains: an epidemic simulator mapping human-regulated testing rates to infection counts, and a building energy simulator mapping weather variables to electricity usage. Despite their differences in signal characteristics, periodicity, and causal structure, ruleXplain successfully extracts reusable symbolic rules that capture the governing temporal relationships. The closed-loop synthesis-and-verification process ensures rules are refined through simulation feedback, enabling robust alignment between symbolic explanations and system dynamics. We demonstrate the framework ability to generalize rules across diverse input trajectories and regenerate semantically consistent counterfactual inputs. The ruleset structured form makes it suitable for applications in counterfactual reasoning, treatment effect analysis, and simulation auditing. Future work will explore adaptive clustering for more informative reference trajectories, fine-tuning LLMs for improved rule refinement, and agentic approaches to autonomously introduce logical constraints scalably and systematically. We also aim to develop hybrid evaluation metrics that balance fidelity, simplicity, and semantic alignment to benchmark symbolic causal frameworks like ruleXplain against emerging alternatives. Appendix A Experimental Setup and Methodological Details A.1 PySIRTEM Epidemic Simulator PySIRTEM ( 4 ) is an extended Susceptible-Expected-Infected-Recovered (SEIR) model that uses Delay Differential Equations (DDEs) with compartments that represent, in addition to the original SEIR ones, health processes such as hospitalization, immunity, and testing. A complete list of transition parameters can be found in ( 3 ) . Without loss of generality, this work uses PySIRTEM as the basis to show the proposed explanation-generation approach. In fact, ruleXplain is independent from PySIRTEM , but a simulator is needed in the evaluation loop (see Fig. 1 ). With PySIRTEM as base simulator, to demonstrate ruleXplain , we focus on generating explanations for two timeseries, the symptomatic testing rate ( X_{s}=\Phi_{s}=\left(x_{s,1},x_{s,2},x_{s,3},\dots x_{s,T}\right) ) and the asymptomatic testing rate ( X_{a}=\Phi_{a}=\left(x_{a,1},x_{a,2},x_{a,3},\dots x_{a,T}\right) ), where x_{s,t} and x_{a,t} represent the daily ratio of the symptomatic and asymptomatic population tested against the total population for day t , respectively. The pair \left\{\left(X_{s},X_{a}\right)\right\}_{t} can be modeled as a discrete time timeseries. These timeseries are important to understand the daily infected population (output timeseries) and they can be implemented as decisions (e.g., from the local government). Following the PySIRTEM notation and the modeling introduced in 4 , the following holds: \displaystyle Y_{t} \displaystyle=I_{t}=r\cdot\big(PS_{t}+PA_{t}+IA_{t}+ATN_{t}\big)+IS_{t}+STN_{t}. (4) In eqn. ( 4 ), PS and PA are the pre-symptomatic and pre-asymptomatic population, IS and IA are the symptomatic and asymptomatic infected population, and ATN and STN are Asymptomatic and Symptomatic population who test negative (by error), respectively. The quantity r is the ratio between transmission rates for the asymptomatic against symptomatic population. PS,PA,IS,IA,STN, and ATN are represented in PySIRTEM as compartments and they are directly affected by the timeseries X_{s} and X_{a} . In this work, we treat PySIRTEM as a black box system keeping all hyperparameters constant except the timeseries X_{s} and X_{a} , which ruleXplain will produce as a prediction and explanation for the output timeseries Y_{t} . Namely, the relevant input-output pair for the causal inference analysis step of ruleXplain are \left\{(X_{s},X_{a}),Y\right\} where X_{s} and X_{s} are daily testing rates timeseries (symptomatic and asymptomatic, respectively) and Y is the list of corresponding daily number of currently infected individuals. In this paper, we consider a simulation horizon of T=100 days, i.e., t=1,2,\ldots,T , and to maintain the assumptions in PySIRTEM original work, we allow the timeseries for the test rates to only vary weekly, i.e., we impose the test rates to be stepwise constant functions. ruleXplain uses the PySIRTEM module in two ways: (i) as a learning module (step 1 in Fig. 1 ) to derive the baseline current daily infected cases I_{base} from historical data, and secondly as a simulator (step 6 in Fig. 1 ) to evaluate the effects of the timeseries inputs (\Phi_{s},\Phi_{a}) . In this work, we refer to \Phi_{s},\Phi_{a}, and I as X_{s},X_{a}, and Y respectively to avoid domain-specific notations. A.2 EnergyPlus Building Energy Simulator EnergyPlus ( 7 ) is a physics-based building energy simulation tool that models building thermal dynamics, HVAC operation, internal loads, and environmental interactions using heat balance equations and system-level energy models. The simulator takes as input a building configuration file (IDF: Input Data File ) and a weather file (EPW: EnergyPlus Weather file ). The IDF file specifies the building geometry, dimensions, geological location, materials, HVAC systems, occupancy schedules, and other internal parameters. The IDF also contains the specifications for the run period, variables of interest, and frequency of reporting. The EPW file provides temporal weather data including dry-bulb temperature, solar radiation, humidity, wind speed, and other meteorological variables. EnergyPlus can operate at any temporal resolution. In our experiments, we use hourly simulation outputs. EnergyPlus can model a wide range of outputs, including zone temperatures, heating and cooling loads, HVAC energy consumption, and total building electricity usage. Without loss of generality, we use EnergyPlus as a second simulation environment to demonstrate the domain-independence of ruleXplain . Similar to PySIRTEM , ruleXplain treats EnergyPlus strictly as a black-box forward simulator within the evaluation loop (see Fig. 1 ). For the experiments in this work, we use the Supermarket reference building IDF model provided within the standard EnergyPlus example files. As weather input, we use the file USA_VA_Sterling-Washington_Dulles.Intl.AP.epw from the official EnergyPlus weather database. The simulation horizon is set to 100 consecutive hours and the baseline data is from Jan 1 to Jan 5, 1997. The relevant input–output pair for the causal analysis step of ruleXplain is \left\{(X_{d},X_{g}),Y\right\}, where: • X_{d} denotes outdoor dry-bulb temperature (in ∘ C), • X_{g} denotes global horizontal irradiance (in Wh/m 2 ), • Y denotes total building electricity consumption (in J). Outdoor dry-bulb temperature represents ambient air temperature affecting heat transfer across the building and Global horizontal irradiance measures the total solar radiation incident on a horizontal surface, influencing solar heat gains through windows and building surfaces. Both variables directly affect cooling loads and HVAC operation and impact electricity consumption which is our output variable of interest. In this work, we observe temperature and irradiance as multivariate input trajectories X_{t} , while keeping all building physical properties and HVAC parameters fixed. The simulator maps these environmental inputs to hourly electricity consumption Y . ruleXplain uses the EnergyPlus module analogously to the epidemic case: (i) to generate a baseline electricity consumption trajectory Y_{\text{base}} under reference weather conditions, and (ii) to evaluate candidate multivariate input trajectories during rule refinement. As before, we abstract the domain-specific notation and refer to temperature, irradiance, and electricity consumption as X_{d} , X_{g} , and Y , respectively, to maintain consistency across domains. A.3 Dimensionality Reduction and Clustering To reduce redundancy and extract representative data points that will form the training set for the explanation generation step (Sec. 2.3 ), we apply dimensionality reduction and clustering on the set of timeseries resulting from the input timeseries learning step (Sec. 2.1 ), \{\left(X_{s}^{p},X_{a}^{p}\right)\}^{N}_{p=1} . Dimensionality reduction. As each candidate comprises of two daily timeseries vectors, X_{s}=\left(x_{s,1},x_{s,2},\dots x_{s,T}\right) and X_{a}=\left(x_{a,1},x_{a,2},\dots,x_{a,T}\right) , the input space is 2T -dimensional. Because of the high-dimensionality and non-linearity of the input space, we first reduce the dimensionality considering only the weekly changing points (this is not necessary to the application of the framework), and, on the reduced dimensionality timeseries, we employ the Uniform Manifold Approximation and Projection (UMAP) ( 15 ) technique to represent the data points in a 2-D space embedding for clustering. UMAP facilitates visual confirmation of cluster separability by constructing a high-dimensional topological representation of the data and then optimizing a low-dimensional graph to be as structurally similar as possible through cross-entropy minimization. Unlike other linear (Principle Component Analysis or PCA) and non-linear techniques (t-distributed Stochastic Neighbor Embedding or t-SNE), UMAP preserves both local and global structure with competitive accuracy ( 15 ) . Clustering the reduced-dimensionality timeseries. Upon reduction to a 2-D input space, we employ a K -Means clustering to identify distinct input timeseries “trends”. We choose K -Means clustering due to its simplicity and efficiency in detecting separable clusters. The input timeseries corresponding with the centroids of each cluster are represented by \left(X_{s}^{c},X_{a}^{c}\right) . As all \left(X_{s}^{c},X_{a}^{c}\right) result in output trends identical to Y_{base} , we denote the input-output pairs of each clusters as \left((X_{s}^{c},X_{a}^{c}),Y_{base}\right) for simplicity. The primary purpose of clustering in ruleXplain is to elect a single representative data point from each solution cluster as inducing timeseries within the training set during the LLM phase (see Sec. 2.3 ). We argue that such data reduction can help in the training context emphasizing diversity, removing redundant examples that may result into overly “engineered” explanations (rulesets \mathcal{R} ), while removing the influence of individual cluster size or density. Since all the input pairs generate the same output trajectory ( Y_{\mbox{\tiny{base}}} ), we argue that a diverse training set facilitates the LLM task to extrapolate the implicit, causal relation between the variables. Figure 7 : Clustering of the initial solution pool \left\{(X^{p}_{s},X^{p}_{a})\right\}_{p} from solving P_{\mbox{\tiny{LEARN}}}(p) for PySIRTEM setup. Appendix B Extended Results and Analysis In this section, we report the final extracted ruleset after the closed-loop refinement process of ruleXplain for both PySIRTEM (Table. 2 ) and EnergyPlus (Table 3 ). Table 2 : Causal rules extracted from timeseries examples and context for PySIRTEM Setup. Rule ID Input Window X_{s} Trend X_{a} Trend Output Window Y Phase Symbolic Rule R1 [0, 14] Low SlowRise [15, 29] InitialGrowth \Box_{[0,14]}(\mathrm{Low}(X_{s})\wedge\mathrm{SlowRise}(X_{a}))\rightarrow\Diamond_{[15,29]}\mathrm{InitialGrowth}(Y) R2 [14, 28] Moderate SlowRise [29, 43] PeakFormation \Box_{[14,28]}(\mathrm{Moderate}(X_{s})\wedge\mathrm{SlowRise}(X_{a}))\rightarrow\Diamond_{[29,43]}\mathrm{PeakFormation}(Y) R3 [28, 42] SharpSpike Low [43, 57] PostPeak \Box_{[28,42]}(\mathrm{SharpSpike}(X_{s})\wedge\mathrm{Low}(X_{a}))\rightarrow\Diamond_{[43,57]}\mathrm{PostPeak}(Y) R4 [42, 56] DipThenRise Low [57, 71] Decline \Box_{[42,56]}(\mathrm{DipThenRise}(X_{s})\wedge\mathrm{Low}(X_{a}))\rightarrow\Diamond_{[57,71]}\mathrm{Decline}(Y) R5 [56, 70] SlowRise HighStable [71, 85] Resurgence \Box_{[56,70]}(\mathrm{SlowRise}(X_{s})\wedge\mathrm{HighStable}(X_{a}))\rightarrow\Diamond_{[71,85]}\mathrm{Resurgence}(Y) R6 [70, 100] Moderate SlowRise [85, 100] PeakFormation \Box_{[70,100]}(\mathrm{Moderate}(X_{s})\wedge\mathrm{SlowRise}(X_{a}))\rightarrow\Diamond_{[85,100]}\mathrm{PeakFormation}(Y) Table 3 : Causal rules extracted from timeseries examples and context for EnergyPlus Setup. Rule ID Input Window X_{t,1} Trend X_{t,2} Trend Output Window Y Phase Symbolic Rule R1 [0, 9] Low Low [0, 8] Decline \Box_{[0,9]}(\mathrm{Low}(X_{t,1})\wedge\mathrm{Low}(X_{t,2}))\rightarrow\Diamond_{[0,8]}\mathrm{Decline}(Y) R2 [9, 18] SlowRise SharpSpike [9, 17] InitialGrowth \Box_{[9,18]}(\mathrm{SlowRise}(X_{t,1})\wedge\mathrm{SharpSpike}(X_{t,2}))\rightarrow\Diamond_{[9,17]}\mathrm{InitialGrowth}(Y) R3 [18, 21] DipThenRise LowModerate [18, 20] PostPeak \Box_{[18,21]}(\mathrm{DipThenRise}(X_{t,1})\wedge\mathrm{LowModerate}(X_{t,2}))\rightarrow\Diamond_{[18,20]}\mathrm{PostPeak}(Y) R4 [21, 30] Low Low [21, 29] Decline \Box_{[21,30]}(\mathrm{Low}(X_{t,1})\wedge\mathrm{Low}(X_{t,2}))\rightarrow\Diamond_{[21,29]}\mathrm{Decline}(Y) R5 [30, 42] Moderate HighStable [30, 41] PeakFormation \Box_{[30,42]}(\mathrm{Moderate}(X_{t,1})\wedge\mathrm{HighStable}(X_{t,2}))\rightarrow\Diamond_{[30,41]}\mathrm{PeakFormation}(Y) R6 [42, 48] DipThenRise LowModerate [42, 47] PostPeak \Box_{[42,48]}(\mathrm{DipThenRise}(X_{t,1})\wedge\mathrm{LowModerate}(X_{t,2}))\rightarrow\Diamond_{[42,47]}\mathrm{PostPeak}(Y) R7 [48, 54] Low Low [48, 53] Decline \Box_{[48,54]}(\mathrm{Low}(X_{t,1})\wedge\mathrm{Low}(X_{t,2}))\rightarrow\Diamond_{[48,53]}\mathrm{Decline}(Y) R8 [54, 66] Moderate HighStable [54, 65] PeakFormation \Box_{[54,66]}(\mathrm{Moderate}(X_{t,1})\wedge\mathrm{HighStable}(X_{t,2}))\rightarrow\Diamond_{[54,65]}\mathrm{PeakFormation}(Y) R9 [66, 72] DipThenRise LowModerate [66, 71] PostPeak \Box_{[66,72]}(\mathrm{DipThenRise}(X_{t,1})\wedge\mathrm{LowModerate}(X_{t,2}))\rightarrow\Diamond_{[66,71]}\mathrm{PostPeak}(Y) R10 [72, 78] Low Low [72, 77] Decline \Box_{[72,78]}(\mathrm{Low}(X_{t,1})\wedge\mathrm{Low}(X_{t,2}))\rightarrow\Diamond_{[72,77]}\mathrm{Decline}(Y) R11 [78, 90] SlowRise HighStable [78, 89] Resurgence \Box_{[78,90]}(\mathrm{SlowRise}(X_{t,1})\wedge\mathrm{HighStable}(X_{t,2}))\rightarrow\Diamond_{[78,89]}\mathrm{Resurgence}(Y) R12 [90, 96] DipThenRise LowModerate [90, 95] PostPeak \Box_{[90,96]}(\mathrm{DipThenRise}(X_{t,1})\wedge\mathrm{LowModerate}(X_{t,2}))\rightarrow\Diamond_{[90,95]}\mathrm{PostPeak}(Y) R13 [96, 102] Low Low [96, 100] Decline \Box_{[96,102]}(\mathrm{Low}(X_{t,1})\wedge\mathrm{Low}(X_{t,2}))\rightarrow\Diamond_{[96,100]}\mathrm{Decline}(Y) Figure 8 reports the iterative reconstruction loss produced by the closed-loop pipeline. At each iteration, a symbolic ruleset is extracted or refined, the LLM is prompted to generate input trajectories consistent with the rules, and the simulator is executed to obtain Y_{\text{sim}} . The output loss L_{\text{out}}(Y_{\text{sim}},Y_{\text{base}}) —measured as Mean Squared and Normalized Mean Squared Difference—is then computed. The decreasing trend observed for both (a) PySIRTEM and (b) EnergyPlus demonstrates that successive rule refinements generate inputs whose simulated outputs progressively align with the baseline trajectory, highlighting the effectiveness of the iterative refinement–verification process. Figure 8 : ruleXplain input timeseries produced Mean Squared Difference across iterations for (left) PySIRTEM (right) EnergyPlus Appendix C Detailed Prompts for LLM The codebase used during the course of this work can be found here . C.1 ruleXplain Framework Prompts The following prompts are used during ruleXplain ’s LLM-based Explanation Generation (Sec. 2.3 ): 1. Initial Explanation Inference Prompt . This prompt provides the LLM with cluster-derived contexts and asks to generate an interpretable, formal ruleset describing input-output relations (Fig. 9 ). 2. Input set generation using ruleset. This prompt instructs the LLM to use the provided ruleset and cluster-derived context to generate a novel input series (Fig. 10 ). 3. Ruleset refinement prompt. This provides the LLM with the simulated output Y^{\prime} resulting from the generated (X_{s}^{\prime},X_{a}^{\prime}) and Y_{base} along with the previously available contexts. The LLM is then asked to assess the deviations of Y^{\prime} and Y_{base} and refine the ruleset (Fig. 11 ). Goal: Generate initial causal rules R_{0} from clustering context Prompt: You are given several input-output examples from a timeseries simulation model. Each example consists of a multivariate input timeseries X_{t} and a univariate daily output timeseries Y . The input X_{t} is defined over a time interval length \{\Delta\} . If Y spans 100 days, then X_{t} will contain \lceil 100/\Delta\rceil interval values. The relationship between inputs and outputs is be {direct/inverse} and may include temporal lag/delay effects. Your goal is to observe the input-output relationships from the examples and extract symbolic causal rules of the form: “If trends in selected components of X_{t} persist over a given time interval, then the output Y will exhibit a specific phase after a delay.” Please divide the baseline output into specific output phases listed below in order of timing and infer the multivariate input trends that are responsible. Each output phase should be unique (no duplicate entries in the output column), and the rules should provide input and corresponding output trend behavior for the total time window (i.e., all input windows should concatenate to cover from T=0 to T=100 ). Input time windows must be multiples of \Delta . Fill in the table below with symbolic causal rules. Each rule should specify: • Input Trend Window: the time interval where a specific trend in selected components of X_{t} is observed. • Trend Description: qualitative trends over that window. • Output Phase Window: the time interval where a specific phase in Y occurs, as a delayed effect of the input. • Phase Description: the qualitative behavior of Y . • Symbolic Rule: a formal statement capturing this as a logical implication. Use the vocabulary: • Trends: Low, Moderate, HighStable, SharpSpike, SlowRise, DipThenRise, LowModerate • Output Phases: InitialGrowth, PeakFormation, PostPeak, Decline, Resurgence Below is the list of example input-output points and Baseline Expected Output: —- Example 0 —— X_{t,1} : [0.018, 0.14, … K values], X_{t,2} : [0.06, 0.23, … K values], Y : [15, 12, … T values] —- Example 1 —— X_{t,1} : [0.025, 0.083, … K values], X_{t,2} : [0.05, 0.19, … K values], Y : [15, 12, … T values] { Insert More … } ———————— Baseline Y : [15, 12, … T values] Table format: Rule ID Input Trend Window X_{s} Trend X_{a} Trend Output Phase Window Y Phase Symbolic Rule R1 [0, 15] Low SlowRise [0, 20] PeakFormation \Box_{[0,15]}(\text{Low}(X_{s})\land\text{SlowRise}(X_{a}))\rightarrow\Diamond_{[0,20]}\text{PeakFormation}(Y) R2 [15, 30] Low Low [20, 35] InitialGrowth \Box_{[15,30]}(\text{Low}(X_{s})\land\text{Low}(X_{a}))\rightarrow\Diamond_{[20,35]}\text{InitialGrowth}(Y) Make sure to use the table format shown above. Do not use domain-specific terminology; instead, describe timeseries patterns using abstract trend labels. Ensure the symbolic rule column uses the logical form: \Box_{[t1,t2]}(\text{Trend}(X_{t,i})\land\text{Trend}(X_{t,j})\land\dots)\rightarrow\Diamond_{[t3,t4]}\text{Phase}(Y) Ensure: • All time windows are valid. • Input windows are multiples of \Delta . • Output phases are unique and cover the full timeline. • The symbolic rule strictly follows the required logical template. • Only abstract trend labels are used. Figure 9 : Prompt for generating the initial ruleset. Goal: Novel input set (X_{s}^{\prime},X_{a}^{\prime}) generation using ruleset \mathcal{R}_{i} Prompt: You are given several input-output examples from a timeseries simulation model and a causal ruleset describing input trends and their corresponding output effects. Each example consists of: • A multivariate input timeseries X_{t} defined over interval length \Delta • A daily output timeseries Y All example inputs generate the same output Y . The relationship between inputs and outputs is direct and may include temporal lag/delay effects. The baseline output Y spans 100 days. The input X_{t} is defined over interval length \{\Delta\} , so X_{t} contains \lceil 100/\Delta\rceil interval values. Input constraints: • All X_{t,1} values must lie in the range { Insert Range } • All X_{t,2} values must lie in the range { Insert Range } You must use the provided ruleset to generate a novel multivariate input sequence X_{t} that is different from all example inputs but produces an output Y that closely follows the baseline Y trend. Instructions: 1. Analyze the baseline Y trend and the provided ruleset. 2. Divide the baseline Y into output phases. 3. For each output phase: • Identify the corresponding rule in the ruleset. • Determine the required input trends. 4. Generate a new multivariate input sequence X_{t} : • Length must match the number of intervals determined by \Delta . • Trends must be consistent with the ruleset. • The full timeline must be covered. • The trend pattern must differ from all previous example inputs. • All input values must satisfy the specified bounds. 5. For each output phase, briefly justify your input choices for the corresponding input intervals, referencing: • The applied rule • The delayed and direct relationship between inputs and output Below is the list of example input-output points and Baseline Expected Output: { Insert Clustering Context … } ———————— Baseline Y : {Baseline Output} Rules Table: <\textit{Insert Ruleset in Markdown format}> Required Output Format: 1. Generated Input Series: Provide the full multivariate input sequence: - X_{t,1} : [v_{1},v_{2},\dots,v_{K}] , X_{t,2} : [v_{1},v_{2},\dots,v_{K}] , \dots 2. Phase-wise Justification: For each output phase, provide: Output Phase: PhaseName, Output Window: [t_{3},t_{4}] , Applied Rule: RuleID, Required Input Trend Window: [t_{1},t_{2}] , Assigned Input Trends: X_{t,i} : Trend Justification: Brief explanation referencing the rule and the delayed/direct or inverse relationship. Ensure: • The generated input trends differ structurally from all example inputs. • Input intervals are multiples of \Delta . • The ruleset is followed consistently. • The entire timeline is covered. • All input values lie within the specified range. • The resulting Y closely follows the baseline Y . Figure 10 : Prompt for Novel Input series generation using inferred ruleset \mathcal{R}_{i} . Goal: Ruleset Refinement by evaluating Y^{\prime} (generated from (X_{s}^{\prime},X_{a}^{\prime}) and Y_{base} Prompt: You previously generated a multivariate input series X_{t}^{\prime} using a causal ruleset, simulated the system, and obtained an output Y^{\prime} . The simulated output Y^{\prime} does not closely match the Baseline Y . The relationship between inputs and output is {direct/inverse} and delayed. This is critical and must guide your diagnosis and rule updates. Generated Input: X_{t}^{\prime} : Your generated weekly input timeseries: { Insert X_{t,sim} } corresponding Y^{\prime} : { Insert Y_{sim} } ———————— Baseline Y : { Insert Y_{base} } Previous Rules Table: <\textit{Insert Ruleset in Markdown Format}> — Instructions: 1. Divide the Baseline Y into distinct output phases in chronological order. 2. Compare Y^{\prime} with Baseline Y and identify mismatches, including: Timing shifts, magnitude differences, shape differences (peaks, valleys, slopes), and phase misalignment. 3. Diagnose which input trends in X_{t}^{\prime} caused the mismatch, considering whether they were too high or too low, too early or too late, too sharp or too flat, not sustained long enough, or incorrectly capturing the direct or delayed relationship. 4. Update the ruleset to better guide future input generation. Constraints for Updated Rules: Each output phase must be unique. Input windows must be multiples of \Delta . Input windows must concatenate to cover the full timeline ( T=0 to T=100 ). Use only abstract trend labels. Do not use domain-specific terminology. When appropriate, refine only the input variable most responsible for a mismatch. Allowed Vocabulary: Input Trends: Low, Moderate, HighStable, SharpSpike, SlowRise, DipThenRise, LowModerate Output Phases: InitialGrowth, PeakFormation, PostPeak, Decline, Resurgence Required Output Format: Return the updated rules in following Markdown table format: Rule ID Input Trend Window X_{s} Trend X_{a} Trend Output Phase Window Y Phase Symbolic Rule R1 [t1,t2] Low SlowRise [t3,t4] PeakFormation \Box_{[t1,t2]}(\text{Low}(X_{t,1})\land\text{SlowRise}(X_{t,2}))\rightarrow\Diamond_{[t3,t4]}\text{PeakFormation}(Y) Symbolic Rule Format: Each rule must follow: \Box_{[t1,t2]}(\text{Trend}(X_{t,i})\land\text{Trend}(X_{t,j})\land\dots)\rightarrow\Diamond_{[t3,t4]}\text{Phase}(Y) Ensure: Rules better explain the mismatch between Y^{\prime} and Baseline Y . The direct and delayed relationship must be properly encoded. The updated rules should improve future alignment with Baseline Y . Figure 11 : Prompt for Ruleset Refinement. C.2 Validation Experiment Prompts The following prompts have been used to validate ruleXplain : 1. (S1) Executing LLM with no rules and no cluster-derived context (Sec. 3.3 ). we provide the LLM with only the target output Y_{\mbox{\tiny{base}}} , existence of causal dependency between inputs and outputs, and the valid input ranges. The LLM is further instructed to avoid any domain specific knowledge (Fig 12 ). 2. (E2) Input generation with inaccurate ruleset. We modify the ruleset by inverting and replacing a subset of the input-output timeseries relationships. This produces an inaccurate ruleset \mathcal{R}_{\mbox{\tiny{incorrect}}} (Table 4 ), and we want to observe how the inaccuracy of rules affects the generation of the input timeseries and, consequently, the alignment between Y_{\mbox{\tiny{incorrect}}} and Y_{\mbox{\tiny{base}}} . We use the inaccurate ruleset in the same prompt as Fig. 10 . Goal: Novel Input Generation without Rules or Context Prompt: You are given a system that takes as input a multivariate timeseries parameters X_{t} defined over interval length \Delta , and produces a daily output timeseries Y . If Y spans {T} days, each input sequence contains \lceil\{T\}/\{\Delta\}\rceil values. Given a target output trajectory Y over {T} days and the valid range for each input parameter, your task is to infer a pair of input sequences that could plausibly generate the same output. Input constraints: • All X_{t,1} values must lie within \{\textit{Insert Range}_{1}\} • All X_{t,2} values must lie within \{\textit{Insert Range}_{2}\} \{\textit{Insert More}\} Do not provide code. Infer the input values directly from the given output pattern. Do not use any domain-specific knowledge; treat the inputs and outputs as abstract functional relationships. Required Output Format: Provide the full multivariate input sequences explicitly: X_{t,1}=[v_{1},v_{2},\dots,v_{K}],\hskip 8.50012ptX_{t,2}=[v_{1},v_{2},\dots,v_{K}]. Figure 12 : Prompt for Input Generation with no rules + no clustering context Table 4 : Inaccurate Causal Rules used for Input Generation for Generalizability Experiment for PySIRTEM Rule ID Input Window X_{t,1} Trend X_{t,2} Trend Output Window Y Phase Symbolic Rule R1 [0, 14] SharpSpike Low [15, 29] InitialGrowth \Box_{[0,14]}(\mathrm{SharpSpike}(X_{s})\wedge\mathrm{Low}(X_{a}))\rightarrow\Diamond_{[15,29]}\mathrm{InitialGrowth}(Y) R2 [14, 28] HighStable HighStable [29, 43] PeakFormation \Box_{[14,28]}(\mathrm{HighStable}(X_{s})\wedge\mathrm{HighStable}(X_{a}))\rightarrow\Diamond_{[29,43]}\mathrm{PeakFormation}(Y) R3 [28, 42] Low DipThenRise [43, 57] PostPeak \Box_{[28,42]}(\mathrm{Low}(X_{s})\wedge\mathrm{DipThenRise}(X_{a}))\rightarrow\Diamond_{[43,57]}\mathrm{PostPeak}(Y) R4 [42, 56] SharpSpike HighStable [57, 71] Decline \Box_{[42,56]}(\mathrm{SharpSpike}(X_{s})\wedge\mathrm{HighStable}(X_{a}))\rightarrow\Diamond_{[57,71]}\mathrm{Decline}(Y) R5 [56, 70] Moderate Low [71, 85] Resurgence \Box_{[56,70]}(\mathrm{Moderate}(X_{s})\wedge\mathrm{Low}(X_{a}))\rightarrow\Diamond_{[71,85]}\mathrm{Resurgence}(Y) R6 [70, 100] HighStable HighStable [85, 100] PeakFormation \Box_{[70,100]}(\mathrm{HighStable}(X_{s})\wedge\mathrm{HighStable}(X_{a}))\rightarrow\Diamond_{[85,100]}\mathrm{PeakFormation}(Y)