Pairwise Causality Guided Transformers for Event Sequences
Authors: Xiao Shou
Debarun Bhattacharjya
Tian Gao
Dharmashankar Subramanian
Oktie Hassanzadeh
Kristin Bennett
Venue: NeurIPS 2023 poster (2023)
Keywords: temporal event sequences
causal inference
transformer
causal knowledge graph
TL;DR: We establish a new framework for causal inference in temporal event sequences in the transformer architecture to incorporate pairwise causal knowledge in the training.

Abstract: Although pairwise causal relations have been extensively studied in observational longitudinal analyses across many disciplines, incorporating knowledge of causal pairs into deep learning models for temporal event sequences remains largely unexplored. In this paper, we propose a novel approach for enhancing the performance of transformer-based models in multivariate event sequences by injecting pairwise qualitative causal knowledge such as `event Z amplifies future occurrences of event Y'. We establish a new framework for causal inference in temporal event sequences using a transformer architecture, providing a theoretical justification for our approach, and show how to obtain unbiased estimates of the proposed measure. Experimental results demonstrate that our approach outperforms several state-of-the-art models in terms of prediction accuracy by effectively leveraging knowledge about causal pairs. 
We also consider a unique application where we extract knowledge around sequences of societal events by generating them from a large language model, and demonstrate how a causal knowledge graph can help with event prediction in such sequences. 
Overall, our framework offers a practical means of improving the performance of transformer-based models in multivariate event sequences by explicitly exploiting pairwise causal information.

Pairwise Causality Guided Transformers for Event Sequences
Xiao Shou RPI xshou01@gmail.co
Debarun Bhattacharjya
Tian Gao IBM Research tgao@us ibm. com
IBM Research debarunblus 1bm. com
Dharmashankar Subramanian
Oktie Hassanzadeh
Kristin Bennett RPI bennekerpi.cm edu
IBM Rescarch dharmash@us. ibm. com
IBM Research
hassanzadeh@us. i ibm. com
Abstract
Although pairwise causal relations have been extensively studied in observational longitudinal analyses across many disciplines, incorporating knowledge of causal pairs into deep learning models for temporal event sequences remains largely unex- plored. In this paper, we propose novel approach for enhancing the performance of transformer- qualitative causal knowledge such as 'event Z. amplifies future occurrences of event Y'. We establish new framework for causal inference in temporal event sequences using a transformer architecture, providing theoretical justification for our approach, and show how to obtain unbiased estimates of the proposed measure. Experimental results demonstrate that our approach outperforms several state-of-the-art models in terms prediction accuracy by effectively leveraging knowledge about causal pairs. We also consider unique application where we extract knowledge around sequences of socictal events by generating them from a large language model, and demonstrate how causal knowledge graph can help with event prediction in such sequences. Overall, our framework offers a practical means of improving the performance of transformer -aaoeded-----dddd-d- models in multivariate event sequences by explicitly exploiting pairwise causal information.
models in multivariate event sequences by injecting pairwise
Introduction
Multivariate event sequences are datasets where different types of events occur sequentially, without meaningful time stamps. They can be viewed categorical time series datasets where exactly one event from a known set of event types occurs at any position datasets abound in various fields, including the social sciences, healtheare, finance, advertising, and engineering. Mining patterns from event sequences often provides meaningful insights for prediction, detection and analysis [I] for example, analysis of such sequences is performed to study patterns of medication use or disease progression healthcare, and to understand stock price prediction and fraud detection in finance. Modeling events is of interest in numerous fields besides data mining; for instance, there has been a surge of interest over the last several years around modeling time-stamped event streams in machine learning, c.g. 2 natural language processing, e.g. 6).
sequence. Applications of such
as well as in leveraging events for various tasks in
The field of machine learning has broadly experienced substantial attention around augmenting existing data with various forms of background knowledge, an area that some have referred to as informed machine learning [7]. A body of prior work has shown how incorporating various forms of domain knowledge could potentially aid deep learning models in performing better, more efficiently,
37th Conference on Neural Information Processing Systems (NcurIPS 2023).

---

and more reliably 8 especially when the amount of available data is low. Such knowledge could also help make the models more interpretable and easier understand, which is often important in critical real-world applications such as healthcare [9] A commonly explored direction is one where physical rules are injected to control model prediction in physics regulated systems [[Q] Knowledge augmentation is also being pursued in the setting of pretrained large language models []. There have been some recent related forays for machine learning of event models, such as through leveraging temporal logical rules [12] and data-dependent knowledge measures [I3]. A recent study considers injecting qualitative structural statements in score-based learning systems for
temporal point processes, which results in closed form and interpretable score- soore-based loss [14]
In this paper, we address an important setting that brings together aspects of knowledge injection with modeling event sequences: how to effectively augment domain knowledge while learning multivariate event sequences using neural models. Specifically, we consider background knowledge of the form of qualitative statements such as: 'event type Z. amplifies (or inhibits) event type Y'. Such statements embed the notion of pairwise causality and can be better paraphrased as 'oceurrences of event type make future occurrences of event type Y more (or less) likely'. Such causal knowledge can oftentimes or learned from data.
be acquired directly from causal knowledge graphs [15 16 17
Integrating pairwise causal statements into learning neural models for temporal event sequences poses at least two major technical challenges that need to be suitably tackled:
1. Causal inference usually entails examining both the factual outcome well as the counterfac- tual outcome for a binary treatment. Since we consider a specific type of non-i.i.d. temporal setting where events occur sequentially, one cannot directly apply the standard potential outcome framework [19] without appropriate definitions that account for the sequential nature of the data.
2. Pairwise causal statements about event types reflect a type-to-type global property that may or may not have been inferred from instance-level data. It is relatively straightforward to use such information through additional regularization terms for loss functions to learn typical parametric models; this is because the (learned) parameters of such models are global and stationary. and thus any deviations from the statement can be penalized. However, neural event sequence model such an autoregressive transformer captures the dynamics of event instances, thus requiring different approach for injecting type-level knowledge.
Contributions. In this paper, we incorporate causal knowledge augmentation into the modeling of temporal event sequences. Specifically, we propose pairwise causality guided learning in transformers that suitably addresses the afore- mentioned challenges. Our contributions are as follows: 1) We formulate the problem of incorporating pairwise causal knowledge into neural autoregressive models the context of temporal event sequences, proposing suitable definitions for formal causal inference investigation. 2) We provide theoretical justification for our procedure, particularly to combat the issue of time confounding and to achieve representational balance. 3) We conduct a detailed empirical evaluation demonstrating superior predictive performance as compared to state-of-lun the-art basclines on synthetic datasets as well as real-world benchmarks. 4) We explore a novel application involving large language model generated event sequences, illustrating both how causal knowledge graph could aid in event prediction, as well as how one could potentially build event models through knowledge injection without relying on existing event sequences.
2 Related Work
Our work is interdisciplinary in nature, touching upon topics such as event sequence modeling, causal inference, neural networks, and natural language processing. We briefly review closely related work across some of these topies.
Markov Models. Markov models have been widely deployed over several decades for analyzing temporal event sequences. Besides the classic kthhorder Markov models where the probability of the next state depends solely on the previous l positions in the sequence, other variations include (but are not limited to) hidden Markov models 20), models incorporating linear combinations [21], variable order Markov models 22), summary Markov models 23), etc. While such models have advantages around interpretability and low data requirements, they are often unable to capture long-range and potentially complex historical dependencies, unlike neural sequence models.

---

4
B
D
A
B
Figure 1:
An illustrative event sequence over labels (A, B, C, interest. An example of event labels from healthcare is as follows: A: Emergency visit, B: Cardiac event, Medication refill, D: Allergy diagnosis, E: Anxiety diagnosis.
E} where event pair A and B are of
Neural Sequence Models. RNNs are a class of neural networks that process sequences of inputs. In RNN, the output each time step depends not only on the current input but also the previous output. Variants of RNNs such as Long Short-Term Memory (LSTM) and Gated Recurrent Units (GRU) have been shown to be effective various applications, including natural language processing. speech recognition, and time-series analysis. State-of-the-re sequence models involve the use of attention-based transformers. Current research focuses on making more reliable predictions from factual associations, for example in large language models (24), and on equipping such transformer- based models with arithmetic, commonsense or symbolic reasoning 25] The importance of causal reasoning for natural language understanding has also recently emerged (26]
Event Models. Event sequences are a popular source of data for numerous data mining algo- rithms 1
27 28 There is also long line of research around modeling time-stamped streams using temporal point processes [29] that become popular in machine learning. Graphical event models (GEMs), also known local independence graphs,
family of graphical models that represent temporal point processes [30 2 GEMs capture the conditional independence structure of the continuous- time dynamics of event processes and are closely related to the notion of Granger- A recent Bayesian approach uses a score- score-based framework for injecting qualitative statements while learning sub-family of parametric GEMs (14). Our work here differs in that we model event sequences without time-stamp information, and inject pairwise causal knowledge into transformer models, which known to be more flexible and therefore better than typical parametric models at tasks such as event prediction 34
causality 31 32 33
Sequential Treatment Effect Estimation. Substantial research has been conducted on time-varying treatment estimation for longitudinal observation data [35] 36]. and many of the state-of-the-aa approaches leverage neural models [37] Some prominent examples over the last couple of years include recurrent marginal structural networks (38), counterfactual recurrent networks [39], G- Nets [40] and causal transformers 41 In addition, some recent work has studied causal inference for temporal process data 44 43 by leveraging time information from event stream datasets. This line of work does not consider injecting pairwise causal knowledge into neural temporal event sequence models.
provide an excellent survey of work done the intersection of causal inference and NLP. There is also a body of work on the extraction of causal relations from natural language descriptions [4). Causal knowledge derived from text either through inference or extraction can be used for the injection of pairwise causal knowledge into event models.
Causality in NLP. Feder et al. 44
3 Causal Event Pairs in Event Sequences
In this section, we first introduce basic notation and terminology and then motivate how one can incorporate pairwise causal knowledge in neural autoregressive models such attention based transformers for temporal event sequences.
3.1 Event Sequences &
Dynamics
Consider multivariate event sequence dataset D which consists of K sequences: indexed by k each sequence takes the form of Dx [, where event label (or type) I at position in the

---

sequence is from discrete label set, 4 E C. The total number of events and event types are denoted N and M respectively, i.c. N = R=1 Ns and M |C]. Let h; {4}}=z denote the history of past events up to Consider the following example in a typical event sequence:
Example Figure 7 shows an example event sequence with 5 event labels, C (A, Consider the 3 causal pairs (A, B), (B, C), (A, C) potentially provided by domain expert. B causes the probability of future occurrences of A to increase, denoted as B 7 A. Another "competing" event C' causes the probability of future occurrences of A to decrease, i.e. C > A. Event C also excites B, i.e. C / B. Note that it can be challenging to determine the inftuence of how one event affects another in observational temporal event sequence.
Example D entails pairwise qualitative statements for sequential events occurring over time, and therefore requires us to establish some formal tools; we turn to causal inference and the potential outcome framework [9] in particular to address this issue. We formulate treatment, covariate and outcome models for any event sequence D2 as follows. Note that we abuse notation slightly and sometimes use lower case (e.g. y. 2) for event labels to indicate that they also be viewed as instances of random variables.
Definition Formulation of Causal Event Pair: For pair of event labels (z,9). the binary treatment variable Z; at time is whether or not label z occurs at position i, i.e. 4 = or 1 & 2. For specific Z₁ at time the corresponding covariates are historical occurrences of event labels including 2 i.e. hi-1- The outcome is the probability of occurrence of y (at least once) in the next window w given the treatment and covariates, i.e., p(]( ([(())"" 14, h4-1) 1 p(l++1 * y. l++2 # p(lit1 # y, U,1422 # V...., l.. F h)ha) for E (1,2,3.... W]
V.....la+ * y/l, hz-1)
where W < Nv-
In the above definition, I [v)) is indicator function for occurrence of y (at least once) within the next window w from position i. Many other choices of outcome models are possible. For instance, one could choose the next arrival time of Y, however we may not observe Y at all in finite time horizon. The benefit of our definition is that one can easily compute the probability of Y in the next window w. The simplest setting is when the window where w > 1, the same principle holds and we discuss this variation in Section 4.3 propensity score as follows.
1, which we will use default. For cases We define the
Definition 2 Under Definition valid propensity score is defined as p(4+1 2//2)).
It is challenging directly compute the propensity score under the raw history vector h; due to the varying length of history. Furthermore, such history can be of high dimension for large Nu. A possible approach is to compute the propensity score in its latent representation. A neural autoregressive model with parameters is trained to maximizes its log likelihood and we thus obtain its propensity score po- (1, = 2) at each time instance i with sample/batch size B:
B
N
0" BrgmarsEB-plue
Σ
Po(1e4114a))
Transformer for Event Sequences. Consider autoregressive transformer G which takes an event (sub)sequence and outputs a sequence of categorical probability distribution: H + V. An event (sub)sequence If is first embedded into X via position embedding. The two major components of a self attention layer are attention layers (Attn) and position-wis feed-forward networks (FFN) via residual connection. We show the h- attention with upper triangular attention mask M so that only future events attend to the past in our setting:
Attn(X) = X Σ
(o((W) R
T x + M),
(2)
1=1
FFN(X) Attn(X) + W2- ReLU (tt b, + b
where W W K W V and W are query, key, value and output matrix the tth head with appropriate dimension. the softmax operation.

---

Theorem 2 Under Definition I an autoregressive transform G outputs a valid propensity score, i.e., p((++1 = =//h,) A valid propensity score computed by using only past history.
Proof Sketch. The only operations that are not point-wise are in the attention module. Let X W w X and A - o[( k X)² ( @ M. Thus for each head i, (XA)i Σx X Akj- Notice masked attention Á is upper triangular, Σx X1 Σnsソ X1AA Hence only past history is involved for predicting the next treatment assignment 1 =
Theorem Under Definition ! an autoregressive transformer G with L. blocks generates a full Ng. - for each layer = (,, I.}.
spectrum of balancing scores at each instance {1,...,Ns
Proof Sketch: The proof follows Proposition 4 from [46] and Theorem I above as Transformer G with L blocks can be viewed sequence of compositions, i.c. G := (fL fz 11o-....ff fi o fo (H)),
where fo is the position embedding, fi is ATTN followed by FFN, and a is the softmax operation.
Proposed Framework
We propose an approach inject pairwise causal knowledge, referring to our model pairwise- causality transformer for event sequences (PC-TES). More precisely, we assume that such causal pair knowledge holds for the average case, i.e., average, for every sequence k, event type Z decreases/increases the probability of future occurrences of event type Y. Formally, this impacts the difference [[P([+++ 1 = y)14 =| E[p(4++1 y/4 # =] for arbitrary position in the sequence. We make the following assumption regarding measured confounding in temporal sequences, which is not uncommon in sequential treatment and precision medicine (39
This aspect also frequently
appears in economic event sequences (23] and diabetic patient activities [7]. While such confounding terms can be trivially handled by identifying other parental states in typical parametric models (see e.g. [14), it is not straightforward for neural models.
Assumption An observational multivariate event sequence under the above framework involves time-varying confounding, i.e for a causal pair (Y, Z), history not only affects the occurrence of future events Y but also affects the occurrences of Z.
This assumption holds for Example
[ - the effect of B on A is not only confounded by C' but also any past history; it also implies that any causal pair YZ has potential history confounding long as Z and Y are not process independent (30.. In Example I occurrences B in the past affect both the occurrences of outcome A and B. In addition, occurrences of C in history on the other hand affect the occurrences of A and B. The effect of C on the occurrences of are thus confounded by past histories involving B or C itself and needs to be adjusted. A full qualitative statement in case becomes 'on average, for each sequence k event type Z decreases/increases the probability of future occurrences of event type Y while holding history constant'. The additional three standard assumptions of consistency, sequential ignorability, and sequential overlap can be made similarly to time series observational data [48] 36 identify the potential counterfactual outcomes in our setting (see Appendix for further details).
4.1 Inverse Probability Weighting in Event Sequences
We define 2 relevant terms with respect to the statement 'Z reduces the occurrence of Y via inverse probability weighting. Without loss of generality, consider a window w 1.
Definition For an event sequence k, the instance-level effect (ILE) at position is the difference between potential probabilities of Y at + for occurrence and nonoccurence of Z at i.e. p(1++1 = y/h4-1.4 = 2) - p(l++1 = y1h,-1,44 2).
Definition 4 For an event sequence k, the sequence-leve effect (SLE) is averaged over all positions of ILEs, i.e. - Σr= (p(1++ 1 = 2) - p(1++ =
y| -
# 2)).
For an observational temporal event sequence, we impose inverse probability weighting to adjust for 1
time confounding: + = n Σ ( (1 p0u=1=y/h==1dd
p((==((,;-1)
5

---

Theorem 4 Under Definition 1. Assumption and the consistency, sequential ignorability, and sequential overlap assumptions, given a learned transformer model G. our inverse probability weighted sequence-level effect (SLEE) under G is an unbiased estimator of the true effect [[ = - = y)[4 # #2.
Proof Sketch; can be rewritten as カ- 1-==1pp
(1==2) n-1 Ei=l (1z22)p' (1:2))p"(1111 (1:1 where
1-p'(l=3 (1,22)
stands for conditioning on the historical representation obtained from G, i.c. H, and Hi-1 respec-
tively for numerator and denominator. Thus can show each IE (4==))pp (1==))p((11=0))
E[P(4++1
("(1==z)
y) 2 and E (f+="))p" (141=w) E[ =) using the law of iterated expectation where 1-p" (l, m2)
the subscripts Z, = 0 and Z, = are for each stratum.
In practice, if the number of event types is large, causing p" (4, = 2) to be small, we can use standardized stable inverse probability to avoid numerically instability, similar to 42 for temporal
event sequences: f = - -==1 ((0))t6-==
(1=p())))( 1. ((.a)),-)))
where p(=)
p(l, p(,==/A,-1)
is a prior belief of probability of occurring in the sequence k.
4.2 Incompatibility Framework
Our injected statements are qualitative, and the ground truth effect is usually unknown even for domain experts. Hence we only determine whether it deviates from the statement in practice. To do so, adopt incompatibility framework [49 [4] where qualitative knowledge is injected as a loss term. For the statement '2 inhibits Y' for a sequence k, our proposed combined loss is:
2 2)p (l++1 =v) p²14+ 2)
1(4 2) (1++1 1) ).0)
Ltot =
p (4) + a max
n
- p² (4 =x=
For the statement 'Z amplifies Y' for a sequence k, the loss is:
+ 2)p (l,+1 (1e =)=
1(4 = 2)p² (1++1
1) ),0)
Liot Σ p² (4)) max
p²(4
1=1
provides trade-off between two loss terms. Like many penalty constraint optimization approaches, when a - oo, the optimal solution tends to satisfy the pairwise causal knowledge constraint; when - 0, it is domain-knowledge- freee An advantage of such an incompatibility framework is that it is linearly additive, and therefore more statements can easily incorporated as additional loss terms.
4.3 Outcome Model with Window w >
While the outcome model for the probability of occurrence of y in the very next position (w 1) can be easily computed for an autoregressive model, the task of computing this probability for w. > 1 windows becomes combinatorial in nature. To illustrate this, note that the quantity p(4+1 y, 442 # W...., y/h²) can be computed (sequentially) as 1 - Ih p(h++ * y114++-11) for w = 1. Some efficient estimation techniques are available from recent work for probabilistic querying [50] for larger w. Consider the selection of window w for the outcome in an event sequence of length n. The problem in this case is relevant to the following probabilistic query the probability of not observing any event Y within the next w events. Thus the (worst case) computational cost is ((([) - 1)= for the largest window n 1 in our setting, according Definition small compared to sequence length for the sake of practicality. ILE and SLE with respect to the statement 'Z reduces the occurrence of Y for sequence k be defined similarly for window w > 1 and can be expressed as p( (I 14 = 2) - [b * 2) and = =) - pp((v)) h4-1, # 2)), respectively.
p(I())) 1h
In this paper, we assume that w relative
Σnn" (p((()))

---

Correspondingly, for a statement such as 'Z inhibits Y" and 'Z amplifies Y' for sequence k. our proposed combined loss for w can be expressed respectively as
Liot Σ p" (1:) + max( 1 ==1
n-2 1(4 =)(1= p111+1 + u)p (l+t2 # v))
10144= =
1(4 2) - -p" (li+1 + v)p" (li+2 + w)l) (5)
1 p² (0 =
ni Σ p²(4) + max(
1 n-2
1 114 z) p1111 + u)v" (lit2 + v))
Liot
11 2
1-p"(1; =2)
i=1
1(4 = =) - 1p011-p'(p p1i+1 1 ulp (li+2 (142 ) )))) (6)
pr =
We perform some ablation experiments the choice of (i.e. = 2) in (sub)section 5.4
5
Experiments
We implement our approach using a transformer architecture [51] and test the performance of our model on synthetic datasets as well real-world datasets on the task of event prediction. We also explore a unique application where event concepts are generated from a large language model. Further details around implementation and training can be found in the Appendix.
5.1 Synthetic Experiments
Datasets. We run experiments on generated synthetic datasets to verify the learning capabilities and validity of our approach. We simulate event sequence data using a binary summary Markov model (BSuMM), which assumes that the probability of an event label's occurrence at any position in sequence depends whether not labels from its influencing set have occurred in some recent look-back period [23). Here we consider simple event sequences involving BSuMM dynamics over event labels, denoted A, B, C. D and E. For each experiment, we generated 5 samples of datasets where each dataset was split into train/dev/test sets (60/20/20)%. We first used BSuMM to simulate 50 event sequences over the event labels, each of length 100, where only two interactions occur: B excites A and B inhibits itself. We incorporated the ground truth causal pair as (B, A), with B / A. This makes up experiments for Synth-1 and Synth-2 where the look-backs (windows) used for generation are 2 and 4 respectively. Similarly, we generated another 2 sets of 50 sequences over the 5 event labels, each of length 100, with interactions as shown in Figure these are the Synth-3 and Synth-4 datasets. Here we only consider the causal pair (C. B) with ground truth C / B as injected knowledge. In the Appendix, we show results for when other causal pairs are injected (one at time) as knowledge.
Baselines and Metric. We consider 5 baselines to compare against our model. BSuMM and OS- uMM are two types of parametric summary Markov models that have been used for event prediction and influencing set identification 23 Another common parametric model for event sequences is the k-th order Markov chain (kMC); for this baseline, we show the best performing version over à E {1, 2,3,4, We also consider a recent state-of-the-art transformer model Probabilistic Attention to influence (PAIN) that uses attention-to-ing to-i--lueeeffeeee techniques for modeling temporal event sequences 34 Lastly, we include a vanilla transformer for event sequences (TES) [1 as a direct comparison to our proposed PC-TES with {100, 10, 1, 0.1, 0.01, 0.001). We evaluate model performance using the metric loglikelihood (LL) on the test subset, which is equivalent to a logarithmic scoring rule for the task of predicting the next event label given the history [52). Further details such as syper-parametee chosen based on the validation set are discussed in the Appendix.
Our model PC-TES outperforms others by incorporating one pairwise statement. is worth noting that the neural models considered here predict better than non-neural models by significant margin, even with relatively small datasets.
Results. Results of the synthetic experiments are shown in Table ]
7

---

Table 1: Next event prediction loglikelihood on 4 synthetic datasets.
Dataset
BSuMM
OSuMM
kMC
PAIN
TES
PC-TES
Synth-1 -382.82(4.67)
-373.85(6.37)
364.60(6.47)
-141,06(5.11)
-107.812285)
-107.19(3.01)
Symth 1371.13(6.36)
-370.66(5.12)
330.37(7.45)
-137.94(8,42)
-114.01(231)
-111.89(1.52)
Symth-3 -358.25(7.23) 359.678(12330))
-378.97(5.64)
-131.20(12.9)
-119.99(2.29)
-113,58(3,81)
Symth-4 -363.36(6.93)
-361.82(5.45)
-371.7566355)
-134.09(13.39)
-113.95(3.05)
-113.15(3.66)
5.2 Real Applications
Datasets, Baselines and Metric. We perform experiments on the following real-world applica- tions from various domains shown in 2 referring the reader to dataset details in the Appendix. Diabetes contains meals, exercise activity, insulin dosage, and changes in blood glucose measure- ments for a group 65 diabetes patients [53]. We incorporated the single statement 'insulin intake decreases blood glucose' into our objective, which agreed with the assessments mentioned in [47]. Defi contains user trading events including borrow, repay, deposit, redeem, liquidation and swap from the Aave website, aave.com. The sole qualitative statement in this study is: "borrowing increases the probability of liquidation' [33]. Linkedin contains user-level omployment-relatte events for Linkedln users. We included all 10 event types as self-exciting, according prior work [54] (23). which provided qualitative statements. Beigebooks consists of a series economic topics derived from documents issued by the Federal Reserve Board regarding the economic state of affairs in the US. We incorporated 8 causal statements about economic topics, such as "vehicle sale robust' increases 'dealer inventory increase'. All datasets were split into train-dev-test sets (60/20/20)% for fair evaluation, where ayper-paramettrs were chosen using train-dev sets and evaluation was performed on the test sets. We consider the same baselines and evaluation metric.
Table 2: Dataset summary: # of event labels (M), # of sequences (K) and # of events (N).
Dataset
M
N
BeigeBooks
15
260
2370
Diabetes
13
65
20210
LinkedIn
10
1000
2212
Defi
6
500
17258
LLM-Generated Event Sequences
50
243
1398
Table 3: Next event prediction loglikelihood 4 real-world applications.
Dataset
BSuMM
OSuMM kMC
PAIN
TES
PC-TES
Diabetes
-658.61
-577.76
-656.19
-466.36
-373.27
-370.64
Defi
-1172.49
-1152.84
-1155.60
-129.49
-126.56
-120.54
Linkedin
-114.14
-115.05
-111.39
-25.32
-22.48
-21.71
Beigebooks
-40.21
-0..22
-46.99
-21.077
-10.27
-10.04
Results. Results on the 4 real-world benchmarks shown in Table Overall, model PC-TES outperforms others by incorporating pairwise statements. We highlight again that results of neural models are substantially better than their non-neural counterparts. The highest performance boost by PC-TES occurs on Defi where the relative gain is around 5% compared to a vanilla transformer model TES, validating the practicality of our approach for incorporating domain knowledge.
5.3 LLM-Generated Event Sequences
Motivation. We explore use case of event prediction where we have partial causal knowledge about the events, along with powerful generative large language models (LLMs)) to generate event sequences. It is challenging to use LLMs to generate event sequences, since depending on the choice of parameters (e.g.. temperature which controls the stochasticity of the generation process), one able to either generate large number of very noisy sequences or small number of high-quality sequences. noisy collection will typically result in much lower precision in downstream application, while small collection will result in loss of recall. Here explore solution that leverages small but

---

school shooting
shortage
economic crisis
flood
shooting
procsssion
homicide financial crisis
aircraft crash
impeachment
tsunami
Protest
volcanic
euption
earthquake
Infectious disease
disease outbreak
soca issue
rgime change
conflict
disprdrr
d dassee
demonstrrtioo
aopident
coup
état mass
murder
ammrriigg.commniinn cww.unicalleeeee..mmmmomoooo..ee diseese
murder
epidemic
conflit
massecre
crime
attack
Figure 2: Causal knowledge graph of Wikidata event concepts.
(demonstration, regime, change, coup d'état, looting, civil disorder] limpeachment, statutory_ reçime change, coup coup_d d'état, civil disorder) learthquake, tsunami, disaster, leoting, conflict] [erson, exp' osien, mass_ mas__murder, crime] [school [school_shooting shootting eivil_disordd disorde,,,, riot, social social_issue] [attack, mass murder, riot, civil disorder, war, regime change] [energy_ crisis, shortage, economic crisis, civil disorder, protest]
Figure 3: Examples of LLM-generated event concept sequences.
high-quality set of generated sequences along with an incomplete source of knowledge to produce high-accuracy prediction model.
Dataset. For this application, we use an LLM (flan-t5-xxl (11B)) to create sequences of event concepts from Wikidata (55). These are high-level concepts (classes) in Wikidata that represent newsworthy event types. We gather these types by querying Wikidata for concepts that had links Wikinews articles and belonged to subclass the occurrence class, indicating that they are newsworthy event classes. We compile the common top-level classes of these concepts, which yielded 50 event-related Wikidata classes. Some of these have causal relations (e.g., has has_cause or has efctt) either directly (e.g., earthquake causes tsunami) or through their instances (an carthquake event causing a tsunami event). Using these relations, we build a causal knowledge graph, depicted in Figure 2 The pairs in this network are used for knowledge injection.
To generate event sequences, first create prompt that restricted the output the 50 event concept labels and asked for the next event concept in sequence in the form of a question: "What usually happens after X?" for an input event concept X. For subsequent events, we remove the already- concepts from the vocabulary and use the generated event concept to ask the next question in similar way. We repeat the questions until we reach a pre-defined maximum sequence length, or if the LLM fails to generate an in-vocabulary response in & number of attempts. For the experiments in this paper, we use random number between and as the maximum sequence length and the number of LLM generation attempts. We repeat this sequence generation procedure 5 times for each our 50 event scquences, which resulted 243 sequences (with 7 failed generation attempts). Figure shows examples of the generated event sequences.
for
Results. Table demonstrates how 3 neural models perform prediction on the LLM generated dataset, with and without representative pairwise causal relations in different domains, from as natural disaster to social activities. We demonstrate that with our approach, without any pretraining, we can boost predictive performance by 3-4% as compared to a transformer event model. This shows the effectiveness of our approach building event models with limited or no event sequences, using LLMs in conjunction with knowledge injection.

---

5,4 Ablation on Window for Outcome
We perform ablation experiments with window size in Table (w 2) on the synthetic simulations generated by the two different graphs from section [.1 and Diabetes dataset. Overall, results from 2 do differ significantly from w 1, yet consistent improvements over TES are still observed.
Table 4: Next event prediction on LLM generated event sequences.
Table 5:
Next event prediction on synthetic datasets with window w
Causal Pair
LL
Dutaset LL
None (PAIN)
-33.10
Synth-1 -115,04(2.06)
Synth-2 -113.27(2.50) J
None (TES)
-28.29
Synth-3 -107.65(3.33) J
impeachment / protest (PC-TES)
-28.19
Symth-4 -111.38(2.78)
tsunami / carthquake (PC-TES)
-27.48
Diahetes -370.60
shooting protest PP-TEE)
-28.10
infectious disease epidemic (PC-TES)
-28.21
murder / riot (PC-TES)
-27.81
All pairs above (PC-TES)
-27.37
Conclusion
In this paper, we addressed the under-explored of incorporating pairwise causal relations into deep learning models for temporal event sequences. We proposed novel approach that injects qualitative causal knowledge into transformer-based models and demonstrated significant enhancement in performance. Our established framework for causal inference in temporal event sequences provides theoretical justification that ensures unbiased estimation the proposed measure. Through extensive experimentation, we validate the superior performance of our proposed approach over several state- of-the-art models on probabilistic prediction task. By effectively leveraging knowledge about causal pairs, our approach showcases its ability to capture the intricate relationships between events and make enhanced predictions multivariate event sequences. Furthermore, we introduce a unique application where we leverage large language model to generate sequences of societal events. By demonstrating how a causal knowledge graph can used for event prediction within such sequences, highlight the practical implications of our framework. In summary, work offers promising direction for improving the performance transformer bassed models in multivariate event sequences by explicitly incorporating pairwise causal information.
Broader Impact and Limitations
Our approach is centered around event sequences that may span considerable length of time and involve potentially repeated instances of all event types. We operate under the assumption that the influence of past events are confounding, while ensuring robustness against confounding factors through strong ignorability. However, we advise caution when employing causal pairs, incorrect causal knowledge may potential lead to incorrect conclusions. We highlight that the availability of knowledge that consistent with the ground truth in general is crucial performance in models that involve knowledge augmentation.
Acknowledgments and Disclosure of Funding
This work was supported by the Rensselaer-IBM AI Research Collaboration (http://airc.rp .et.iidurrr.eeuu.. part of the IBM AI Horizons Network (http://ibm.biz)) bit.bbbm.iii/AAHoozooonn. We express our gratitude the anonymous reviewers and meta-reviewer for their valuable feedback, which contributed to improving the quality of our work.
10

---

References
[1] Heikki Mannila, Hannu Toivonen, and A Inkeri Verkamo. Discovery of frequent episodes in event sequences. Data Mining and Knowledge Discovery, 1:259-289, 1997.
[2] Asela Gunawardana and Chris Meek. Universal models of multivariate temporal point processes. In Proceedings of Artificial Intelligence and Statistics, pages 556-563. PMLR, 2016.
[3] Debarun Bhattachariya, Dharmashankar Subramanian, and Tian Gao. Proximal graphical event models, Advances in Neural Information Processing Systems, 31, 2018.
[4] Nan Du, Hanjun Dai, Rakshit Trivedi, Utkarsh Upadhyay, Manuel Gomez Rodriguz and Le Song. Recurrent marked temporal point processes: Embedding event history vector. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pages 1555-1564, 2016.
[5] Xinya Du, Zixuan Zhang, Sha Li, Pengfei Yu, Hongwei Wang. Tuan Lai, Xudong Lin, Ziqi Wang, Iris Liu, Ben Zhou, Haoyang Wen, Manling Li, Darryl Hannan, Jie Lei, Hyounghun Kim, Rotem Dror, Haoyu Wang, Michael Regan, Qi Zeng, Qing Lyu, Charles Yu, Carl Edwards, Xiaomeng Jin, Yizhu Jiao, Ghazaleh Kazeminejad, Zhenhailong Wang, Chris Callison-Buree Mohit Bansal, Carl Vondrick, Jiawei Han, Dan Roth, Shih-Fu Chang. Martha Palmer, and Heng Ji. RESIN-11: Schema-guides -uided Event Prediction for Newsworthy Scenarios. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies: System Demonstrations, pages 54-63, Hybrid: Seattle, Washington + Online, July 2022. Association for Computational Linguistics.
[6] Michael Regan, Jena D. Hwang, Keisuke Sakaguchi, and James Pustejovsky. Causal schema induction for knowledge discovery. CoRR, 2ttx/2333.13383 2023.
[7] Laura von Rueden, Sebastian Mayer. Katharina Beckh, Bogdan Georgiev, Sven Giesselbach. Raoul Heese, Birgit Kirsch, Julius Pfrommer, Annika Pick, Rajkumar Ramamurthy, Michal Walczak, Jochen Garcke, Christian Bauckhage, and Jannis Schuecker. Informed machine learning A taxonomy and survey of integrating knowledge into learning systems. IEEE Transactions on Knowledge and Data Engineering, 35(1):614 633, 2023.
[8] Tirtharaj Dash, Sharad Chitlangia, Aditya Ahuja, and Ashwin Srinivasan. A review of some techniques for inclusion of domain-knowledge into deep neural networks. Scientific Reports, 12(1):1-15, 2022.
[9] Changehang Yin, Rongjian Zhao, Buyue Qian, Xin Lv, and Ping Zhang. Domain knowledge guided deep learning with electronic health records. In 2019 IEEE International Conference on Data Mining (ICDM), pages 738-747. IEEE, 2019.
[10] Sungyong Seo, Sercan Arik, Jinsung Yoon, Xiang Zhang, Kihyuk Sohn, and Tomas Pfister. Con- trolling neural networks with rule representations. Advances in Neural Information Processing Systems, 34:1 19111196-11222 12207, 2021.
[11] Xiaokai Wei, Shen Wang, Dejiao Zhang, Parminder Bhatia, and Andrew Amold. Knowledge en- hanced pretrained language models: A comprehensive survey, arXiv preprint arXiv:2110.0844 2021.
[12] Shuang Li, Lu Wang, Ruizhi Zhang, Xiaofu Chang, Xuqin Liu, Yao Xie, Yuan Qi, and Le Song. Temporal logic point processes. In International Conference on Machine Learning, pages 5990-6000. PMLR, 2020.
[13] Yizhou Zhang, Karishma Sharma, and Yan Liu. VigDet: Knowledge informed neural temporal point process for coordination detection on social media. In Advances in Neural Information Processing Systems (NeurIPS), pages 3218-3231, 2021.
[14] Debarun Bhattacharjya, Tian Gao, Dharmashankar Subramanian, and Xiao Shou. Score-based learning of graphical event models with background knowledge augmentation. Proceedings of the AAAI Conference Artificial Intelligence, 2023.

---

[15] Maarten Sap, Ronan Le Bras, Emily Allaway, Chandra Bhagavatula, Nicholas Lourie, Hannah Rashkin, Brendan Roof, Noah Smith, and Yejin Choi. ATOMIC: An atlas of machine com- monsense for if-then reasoning. Proceedings of the AAAI Conference on Artificial Intelligence, pages 3027-3035, 2019.
[16] Stefan Heindorf, Yan Scholten, Henning Wachsmuth, Axel-Cyrille Ngonga Ngomo, and Martin Potthast. CauseNet: Towards causality graph extracted from the Web. In Proceedings of the International Conference on Information and Knowledge Management (CIKM), 2020.
[17] Oktie Hassanzadeh. Building a knowledge graph of events and consequences using Wiki- data. In Proceedings of the 2nd Wikidata Workshop (Wikidata 2021) co-located with the 20th International Semantic Web Conference (ISWC 2021), 2021.
[18] Sola Shirai, Aamod Khatiwada, Debarun Bhattachariya. and Oktie Hassanzadeh. Rule-based link prediction over event-related causal knowledge Wikidata. In International Semantic Web Conference, 2022.
[19] Donald B Rubin. Causal inference using potential outcomes: Design, modeling, decisions. Journal of the American Statistical Association, 100(469):322-333 2005.
[20] Lawrence R Rabiner. A tutorial on hidden Markov models and selected applications speech recognition. Proceedings of the IEEE, (7(2):257-26,, 1989.
[21] Adrian E Raftery. A model for high-order Markov chains. Journal of the Royal Statistical Society, Series B, 17733)528-533) 1985.
[22] Ron Begleiter, Ran EI- Vaniv, and Golan Yona. On prediction using variable order Markoy models. Journal of Artificial Intelligence Research, 22:385 421, 2004.
[23] Debarun Bhattachariya, Saurabh Sihag, Oktie Hassanzadeh, and Liza Bialik. Summary Markoy models for event sequences. In Proceedings of the International Joint Conference Artificial Intelligence, pages 4836 4842, 2022.
[24] Kevin Meng, David Bau, Alex Andonian, and Yonatan Belinkov. Locating and editing factual associations in gpt. In Advances in Neural Information Processing Systems, 2022.
[25] Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, Ed Chi, Quoe Le, and Denny Zhou. Chain of thought prompting elicits reasoning in large language models. arXiv preprint arXiv:2201.11905 2022.
[26] Amir Feder, Katherine A Keith, Emaad Manzoor, Reid Pryzant, Dhanya Sridhar, Zach Wood- Doughty, Jacob Eisenstein, Justin Grimmer, Roi Reichart, Margaret E Roberts, et al. Causal inference in natural language processing: Estimation, prediction. interpretation and beyond. Transactions of the Association for Computational Linguistics, 10:1 10:1138-111 1158, 2022.
[27] Gary M Weiss and Haym Hirsh. Learning to predict rare events in event sequences. In Proceedings of the Fourth International Conference on Knowledge Discovery and Data Mining (KDD), pages 359-363, 1998.
[28] Benjamin Letham, Cynthia Rudin, and David Madigan. Sequential event prediction. Machine Learning, 93(2-3):357- 2013.
[29] Daryl J Daley and David Vere-Jones. An Introduction the Theory of Point Processes: Elementary Theory of Point Processes. Springer, 2003.
[30] Vanessa Didelez. Graphical models for marked point processes based on local independence. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 70(1 70(1):245-22 -224442 2008.
[31] Hongteng Xu, Mehrdad Farajtabar, and Hongyuan Zha. Learning Granger causality for Hawkes processes. In Proceedings of the International Conference on Machine Learning, pages 1717- 1726. PMLR, 2016.
12

---

[32] Wei Zhang, Thomas Panum, Somesh Jha, Prasad Chalasani, and David Page. CAUSE: Learning Granger causality from event sequences using attribution methods. In International Conference on Machine Learning, pages 1 1125--11255. PMLR, 2020.
[33] Xiao Shou, Tian Gao, Dharmashankar Subramanian, Debarun Bhattachariya, and Kristin P. Bennett. Influence-aware attention for multivariate temporal point processes. 2nd Conference on Causul Learning and Reasoning. PMLR, 2023.
[34] Xiao Shou, Debarun Bhattachariya, Tian Gao, Dharmashankar Subramanian, Oktie Hassan- zadeh, and Kristin P. Bennett. Probabilistic coautiionto-influnnne neural models for event sequences. In Proceedings of the International Conference on Machine Learning (ICML), 2023.
[35] James M Robins, Miguel Angel Hernan, and Babette Brumback. Marginal structural models and causal inference in epidemiology. Epidemiology, pages 550-560, 2000.
[36] James M Robins and Miguel A Hernán. Estimation of the causal effects of time-varying exposures, Longitudinal Data Analysis, 553:599, 2009.
[37] Shishir Rao, Mohammad Mamouei, Gholamreza Salimi-Khorshie Khorshidi, Yikuan Li, Rema Ramakr- ishnan, Abdelaali Hassaine. Dexter Canoy, and Kazem Rahimi. Targeted- behrt: Deep learning for observational causal inference on longitudinal electronic health records. IEEE Transactions on Neural Networks and Learning Systems, 2022.
[38] Bryan Lim. Forecasting treatment responses over time using recurrent marginal structural networks. Advances in neural information processing systems, 31, 2018.
[39] Ioana Bica, Ahmed M Alaa, James Jordon, and Mihaela van der Schaar. Estimating counter- factual treatment outcomes over time through adversarially balanced representations, arXiv preprint arXiv:2002.04088 2020.
[40] Rui Li, Zach Shahn, Jun Li, Mingyu Lu, Prithwish Chakraborty, Daby Sow, Mohamed Ghalwash, and Li-wei H Lehman. G-net: A deep learning approach to g-computation for counterfactual outcome prediction under dynamic treatment regimes. arXiv preprint arXiv:2003. 10551, 2020.
[41] Valentyn Melnychuk, Dennis Frauen, and Stefan Feuerriegel. Causal transformer for estimating counterfactual outcomes. In International Conference on Machine Learning, pages 15293- 15329. PMLR, 2022.
[42] Tian Gao, Dharmashankar Subramanian, Debarun Bhattacharjya, Xiao Shou. Nicholas Mattei, and Kristin P. Bennett. Causal inference for event pairs in multivariate point processes. Advances in Neural Information Processing Systems, 34, 2021.
[43] Yizhou Zhang, Defu Cao, and Yan Liu. Counterfactual neural temporal point process for esti- mating causal influence of misinformation on social media. In Advances in Neural Information Processing Systems, 2022.
[44] Amir Feder, Katherine A. Keith, Emaad Manzoor, Reid Pryzant, Dhanya Sridhar, Zach Wood- Doughty, Jacob Eisenstein. Justin Grimmer, Roi Reichart, Margaret E. Roberts, Brandon M. Stewart, Victor Veitch, and Diyi Yang. Causal inference in natural language processing: Estima- tion, prediction, interpretation and beyond. Transactions of the Association for Computational Linguistics, 10:1 138-1111 11 1158, 2022.
[45] Jie Yang. Soyeon Caren Han, and Josiah Poon. survey on extraction of causal relations from natural language text. Knowledge and Information Systems, 64(5): 161-1186, 2022.
[46] Oscar Clivio, Fabian Falck, Brieuc Lehmann, George Deligiannidis, and Chris Holmes. Neural score matching for high-dimensional causal inference. In International Conference on Artificial Intelligence and Statistics, pages 7076-7110 PMLR, 2022.
[47] Saurav Acharya. Causal Modeling and Prediction over Event Streams. The University of Vermont and State Agricultural College, 2014.
[48] Donald Rubin. Bayesian inference for causal effects: The role of randomization. The Annals of Statistics, pages 34-58, 1978.
13

---

[49] Frank Wittig and Anthony Jameson. Exploiting qualitative knowledge in the learning of conditional probabilities of Bayesian networks. Proceedings the Conference on Uncertainty in Artificial Intelligence (UAT), 2000.
[50] Alex Boyd, Sam Showalter, Stephan Mandt, and Padhraic Smyth. Predictive querying for autoregressive neural sequence models. arXiv preprint arXiv:2210.0646, 2022.
[51] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. Advances in Neural Information Processing Systems, 30, 2017.
[52] Christopher M Bishop. Pattern Recognition and Machine Learning. Springer, 2006.
[53] Andrew Frank and Arthur Asuncion. UCI machine learning repository, 2010.
[54] Hongteng Xu, Dixin Luo, and Hongyuan Zha. Learning Hawkes processes from short doubly- censored event sequences. Proceedings of the International Conference on Machine Learning (ICML), pages 3831-3840, 2017.
[55] Denny Vrandecic and Markus Krötzsch. Wikidata: A free collaborative knowledge base. Communications of ACM, 57(10):78-88 85, 2014.
14


Reviews:
[{"review_id": "zX8jQGfZgw", "reviewer": "Reviewer_fbyg", "summary": "The paper proposes to use pairwise event causality pairs to improve the performance of transformer-based models, based on the intuition that causal knowledge encodes useful information like “event Z amplifies future occurrences of event Y”. Experiments demonstrate the performance of the proposed method.", "questions": "1.\tAbout assumption 1. What do you mean by “time confounding”? Is there any definition that is more mathematically precise, like a variable T that affects the probability of the p(Z,Y)?\n2.\tHow many “correct” pairs can you obtain, considering the so called “causal event pairs“？This seems to be important since it is what the whole method is based on.\n3.\tAbout thm 4. It seems to be a trivial one since the “bias” of the estimator directly follow the estimator under IPW. Is there anything missing?\n4.\tSome theoretical analysis about the window w and the length can also be presented so that your method’s theoretical performance is more clear to the readers.\n", "limitations": "Yes", "rating": 5, "confidence": 2, "soundness": 1, "presentation": 4, "contribution": 3, "strengths": "1.\tThe intuition of causality helps event sequence prediction makes sense.\n2.\tThe experimental evaluation covers many aspects of the methods.\n", "weaknesses": "1.\tThe statements of some assumptions are not precise enough, \n2.\tSome theoretical aspects of the method are not clear to me.\n", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "We thank the reviewer for the valuable comments. We will work towards further improving the general clarity of the paper. \nWe address the reviewer's specific questions below. \n\n**Time Confounding and Assumption 1.**\nTime confounding in our context is analogous to time-varying confounding in treatment effect estimation in a traditional time series setting. Mathematically, time confounding means that for any instance $i$,  the covariates under Definition 1, history $h_i$ = {$l_1$,$l_2$,...,$l_i$} affects both the probability of future occurrence of treatment event $p(l_{i+1}=z|h_i)$ and that of future occurrence of outcome event (at least once) in the next window $w$ given the treatment and covariates, i.e., $ p( I(y)^w_{i+1} |l_{i+1}, h_i)$. For window $w=1$, this outcome is  $p(l_{i+2}=y|h_{i+1})$. Denoting the treatment as $Z$ at $i+1$ and outcome as $Y$ at $i+2$, the generation mechanism follows the causal graph which visually captures the time-varying confounding\n$h_i \\rightarrow Z $, $h_i \\rightarrow Y$, $Z \\rightarrow Y$. \n\n\n**Number of \"Correct\" Pairs.**\nThe causal pairs are determined by domain experts or through other sources of background knowledge. In our experiments, we  incorporated a single pair for the synthetic event sequence datasets, and multiple pairwise information for the LLM-generated event sequence datasets. In practice, our model is capable of incorporating as many pairs as possible; this will naturally depend on the application at hand. \n\n\n**Thm 4 and Bias.**\nIn response to the reviewer's comment, we appreciate his/her attention to Theorem 4, which states the unbiasedness of our estimator. We agree that the unbiasedness of the estimator directly follows from the use of inverse probability weighting (IPW) in our model specifically for event sequences.\n\nHowever, we would like to highlight the significance of Theorem 4 in the context of our paper. While it may seem straightforward that the \"bias\" of the estimator follows the estimator under IPW, it is crucial to formally establish the unbiasedness property through a well-defined theorem. This theorem serves as a formal proof of the statistical property of our proposed estimator, giving confidence to readers and researchers about its validity and correctness.\n\nFurthermore, Theorem 4 also provides theoretical insights into the working mechanism of our model, demonstrating that incorporating causal event papers into the modeling of event sequences with transformers, along with the use of IPW, indeed results in an unbiased estimator.\n\nIn summary, Theorem 4 may appear intuitive given the use of IPW, but its inclusion in the paper is necessary to provide a formal proof of the unbiasedness property and to reinforce the credibility of our proposed method. We will make sure to clarify the importance of Theorem 4 and its contribution to the paper in the revised version to address the reviewer's concern adequately.\n\n\n**Theoretical Analysis on Window and Length.**\nWe discuss the computational aspect of the selection of window $w$ for the outcome in an event sequence of length $n$. The outcome according to Definition 1 is the probability of occurrence of $y$ (at least once) in the next window $w$ given the treatment and covariates. In our paper as well as in the Appendix, we showed empirical results from selecting two appropriate window sizes -- $w=1$ and $w=2$, respectively. While choosing larger windows might be feasible, the selection of smaller sizes $w=1$ and $w=2$ is preferred for computational efficiency. The window selection in this case is relevant to the following probabilistic query: \"the probability of not observing any event $Y$ in next $w$ events\" (see ref 50 for further details). Thus the (worst case) computational cost is $\\mathcal{O}((|\\mathcal{L}|-1)^{n-2})$ for the largest window $w=n-2$ in our setting, according to Definition 1. Our empirical evaluation of the incompatibility loss is a function of $w$; we note that we could potential marginalize $w$ to obtain the factual and counterfactual outcome and thus the treatment effect and incompatibility loss. This could be a potential direction for future research. "}, {"review_id": "OiK6ywMSzx", "reviewer": "Reviewer_Bmuq", "summary": "This paper focuses on the multivariate event sequences, where different types of events occur sequentially. The authors present an approach that leverages pairwise qualitative causal knowledge to enhance the performance of transformer-based models in handling multivariate event sequences. Specifically, the authors formulate the occurrence of events as causal inferences and show how to obtain unbiased estimates theoretically. The proposed method is validated in both synthetic and real-world datasets.", "questions": "\tLine 95: The word \"of\" is duplicated. One instance should be removed.\n\tThe ablation study was only performed on synthetic datasets. Why was not it conducted on real-world datasets?\n", "limitations": "Limitations are discussed in the Section Broader Impact and Limitation.", "rating": 5, "confidence": 4, "soundness": 3, "presentation": 2, "contribution": 3, "strengths": "\tThe authors have conducted extensive experiments, both in synthetic datasets and real-world datasets to validate their approach.\n\tThe utilization of the LLM for generating event sequences is an interesting idea.\n\tThe related work is well cited and discussed in the paper.\n", "weaknesses": "\tThe proposed theory appears to be a straightforward adaptation based on the existing theory of causal inference and inverse probability weighting. The incompatibility framework introduced in this paper primarily focuses on the design of the loss function, which consists of two terms. The first term aims to maximize the likelihood, while the second term serves as an unbiased estimator. However, the second term has already been introduced in previous works, as acknowledged by the authors. The main theoretical contribution of this paper seems to be formulating the causal inferences in the context of multivariate event sequences, as presented in Definition 1. However, the formulation provided in Definition 1 appears to be a straightforward and expected outcome, lacking significant novelty.\n\tThe improvement of the proposed method PC-TES seems marginal compared to the TES.\n\tSome of the mathematical expressions in the paper do not make sense. Here are the specific expressions that require attention: Line 165, Equation (2): In the right-hand side of Equation (2), the triangular attention mask $\\mathbb{M}$ appears outside the softmax function, resulting in an unnormalized result. In my opinion, it should be $\\sigma[(W^i_K X )^T (W^i_Q X) \\odot \\mathbb{M} ]$；Line 172: Please check the right hand side of the equation, I think it should be $\\sum_{k \\leq j} \\tilde{X_{ik}} \\tilde{X_{kj}$\n\tThe writing in this paper requires significant improvement. Many expressions, including words and mathematical equations, are confusing. Here are the specific points that need attention: Line 140, Definition 1: Definition 1 is quite confusing, and it would be helpful if the authors provide a concrete definition of $h_i$. If I understand correctly, $h_i \\triangleq {l_1, l_2, …, l_{i – 1}, l_i}$； Line 152, Definition 2: The authors should introduce the concept of propensity score and provide an intuitive explanation. It may be beneficial to move Assumption 1 before Definition 2 and present a causal graph. If I understand correctly, the causal graph should be: $h_i \\rightarrow Z$, $h_i \\rightarrow Y$, $Z \\rightarrow Y$. The propensity score acts as a mediator between $h_i$ and $Z$.\n", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "We thank the reviewer for the valuable comments and respond to specific questions and comments below.\n\n\n**Novelty of Proposed Approach.**\nWe argue that our theory is not  a straightforward adaptation; rather, it is based on a careful formulation and design of  mainstream transformer networks under the framework of causal inference. To arrive at formal results such as the unbiased estimator of Theorem 4, we carefully formulated the problem of causal pair injection in event sequences through precise definitions under the particular setting, and cautiously made some assumption regarding time-varying confounding. \nWe are not aware of prior work around applying causal inference in our setting.\nFurthermore, we note that the second term in the loss is not introduced in  previous work. Prior approaches (such as ref 14 in our paper) only suggests adding penalty for deviation based on incompatibility for event sequences with timestamps as modeled by temporal point processes. \n\n**Performance Improvement.** The proposed PC-TES consistently improves over TES in all experiments and in some cases the improvement is statistically significant. For the synthetic datasets in Table 1, this improvement over TES can go as high as 5.3\\% relative to the prediction of TES on synth-3. A two sample t-test with unequal variance shows that the two sample means are statistically different from each other (with p-value of 0.016), which implies the significance of the improvement. For real-world datasets, PC-TES consistently improves by up to 4.8\\% on Defi dataset, relative to TES. For LLM generated event sequences, such improvement is 3.3\\%, when using 5 event pairs in Table 3. All results firmly indicate the superior performance of our approach.\n\n\n**Mathematical Expressions.**\nWe make the following clarifications about mathematical expressions:\n\n\n*Line 165, upper triangular attention mask.* In Line 165, the triangular attention mask $\\mathbb{M}$ needs to appear outside the softmax function. The goal is to ensure only future events are allowed to attend to past history and past event are not allowed to gain information from future instances via attention. On the contrary, including triangular attention mask $\\mathbb{M}$ in the softmax operation will result in the computed term not being triangular due to the \"softness\" of the softmax. This will violate our definition of propensity in the transformer and thus violate Theorem 2. \n\n*Line 172, masked attention.* Our expression is equivalent to the suggested one, $\\sum_{k \\leq j} \\tilde{X_{ik}} \\tilde{X_{kj}}$. Note we only need to sum up to the diagonal entry $(j,j)$ from the masked attention matrix $\\tilde{A}$. We will change this to $\\sum_{k \\leq j} \\tilde{X_{ik}} \\tilde{X_{kj}}$ to be more mathematically precise. \n\n\n*Line 152, Definition 2 and Assumption 1.* We present Definition 2 first (and then Assumption 1) because the notion of a propensity score is itself a key quantity of interest in causal inference and the potential outcome framework in particular. In an ideal setting where covariates $h_i$ do not affect the outcome or treatment, we would not need to adjust for them. More commonly however, this is not the case. \n\nAssumption 1 is of practical importance and thus our goal is to tackle this problem using the propensity score as the \"mediator\" between $h_i$ and $Z$. We will consider moving Assumption 1 before Definition 2 and present the causal graph according to the reviewer: $h_i \\rightarrow Z, h_i \\rightarrow Y, Z \\rightarrow Y$ where $h_i \\triangleq$ {$l_1$, $l_2$, …, $l_{i – 1}$, $l_i$}.\n\n\n**Line 95, repetition of the word \"of\".**\nWe thank the reviewer for spotting the typo and will remove the duplicate word.\n\n\n**Ablation.**\nWe only considered synthetic experiments for ablation studies due to space limitations and also because they are more easily controlled.\nWe thank the reviewer for the suggestion and will also include some ablation experiments on real-world datasets in our revised manuscript. "}, {"review_id": "zroT5c70NY", "reviewer": "Reviewer_WQuf", "summary": "The paper proposes a method to incorporate additional background information into transformers that is pairwise causal i.e. event Z affects event Y. They do this for temporal event sequence data where the data is non-stationary and this casual relationship can be confounded by additional events.  ", "questions": "The authors use a upper triangular mask in the self attention block to ensure that only future events attend to the past and past event cannot attend to the future. How does this compare to just using RNN style architectures? Self attention has the benefit of allowing everything to attend to everything and is useful in scenarios where there are global relationships or the relationships are not well understood by humans and cannot be “built in” to the architecture a priori e.g. words in a sentence. However, for sequential events or other “time series” like data, local relationships should dominate and there would be some understanding of the relationships between events?\n\nIn Theorem 4, the true effect should be -E(P(l_i+1=y|l_i \\neq z) ? This is what’s stated in Line 184 and the subsequent proof sketch also suggests as much.  \n\nWhat is p*(l_i) in equations 3 and 4? How is the injected qualitative knowledge any different from a regularization term?\n", "limitations": "Yes", "rating": 7, "confidence": 3, "soundness": 3, "presentation": 3, "contribution": 3, "strengths": "The paper is well written and seems to be sufficiently novel although I do not have the broadest knowledge of this area.", "weaknesses": "No notable weaknesses.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "We thank the reviewer for the valuable comments and respond to specific questions below.\n\n**RNN vs. Transformer.**\nOur setting is general to neural network architectures for (event) sequences. To this end, RNN style architectures fit our framework. We choose transformer-based models for practical reasons; for instance, in epidemiology and healthcare, event interactions commonly involve long dependency (i.e. chronic disease). The popular transformer-based models capture long-range dependency, allow efficient parallelization during training, and generalize to a few interesting theoretical insights, e.g. Theorem 3. \nWe will include some ablation experiments with RNNs or variants in the revised manuscript to explore the locality effect.  \n\n**Theorem 4, True Effect.**\nThe true effect should be $\\mathbb{E}(P(l_i+1=y|l_i = z))-\\mathbb{E}(P(l_i+1=y|l_i \\neq z))$. Thank you for spotting the typo.\n\n\n**$p^{*}(l_{i})$ in Equations 3 and 4.**\n$p^*(l_i)$ is the probability of observing $i-th$ event with label $l_i$ conditioned on history $h_{i-1}$ modeled by the transformer model/architecture. Specifically, Equation (2) provides a sequence level overview for a generic sequence {$l_1$,$l_2$,...,$l_{n-1}$,$l_n$} of matrix computation involved in transformers. Thus for the $i-th$ event, we can find the associated $i-th$ column in the embedding matrix $\\mathbf{X} \\in \\mathbb{R}^{d \\times n}$. $\\mathbf{X}$ is composed of position embedding and type embedding. The position embedding matrix $\\mathbf{P} \\in \\mathbb{R}^{ d \\times n} $ (ref 51 in our paper) is achieved through:\n\n $$ \\mathbf{P}_{j,i} =\n      \\text{cos} (i/10000^{\\frac{j-1}{d}}) \\text{if $j$ is odd}\n$$ \n$$ \\quad \\quad =   \\text{sin} (i/10000^{\\frac{j}{d}})  \\text{if  $j$ is even} $$\n\nwhere $i$ is the position and $d$ is the dimension of encoding.  Type embedding are through the product of a trainable embedding matrix $\\mathbf{U} \\in \\mathbb{R}^{d \\times |\\mathcal{L}|}$ and one hot encoded vector $\\mathbf{e_i} \\in \\\\{0,1\\\\}^{|\\mathcal{L}|}$ for $l_i$, i.e. $\\mathbf{X} = (\\mathbf{U}\\mathbf{E}+\\mathbf{P})^T$ where   $\\mathbf{E} =[\\mathbf{e_1},\\mathbf{e_2},...,\\mathbf{e_n}]$. Let the output from $B$-block of transformer according to Equation 2 be $\\mathbf{H} \\in \\mathbb{R}^{d \\times n}$. Then $p^*(l_{i} =m)$  where $m \\in \\mathcal{L}$  is modeled by a multinomial distribution and be expressed as the following:\n\n$$\np^{*}(l_{i} = m ) = \n\\frac{exp(\\mathbf{W}(m,:) ^{\\intercal} \\mathbf{H} (:,i) +\\mathbf{b}(m) )}{\\sum_m exp(\\mathbf{W}(m,:) ^{\\intercal} \\mathbf{H}(:,i) +\\mathbf{b}(m))}\n$$\n\nwhere $\\mathbf{W}(m,:)$ is the $m-{th}$ row of the corresponding trainable weight matrix, $\\mathbf{H}(:,i)$ is the $i-{th}$ column and  $\\mathbf{b}(m)$ is $m-{th}$ entry of the corresponding bias term.  \n\n**Injected Qualitative Knowledge vs. Regularization Term.**\nInjected qualitative knowledge can be viewed as a carefully designed regularization term in our setting. This is perhaps most effective when the number of sequences are small, say on the scale of a few tens to a few hundreds."}, {"review_id": "x3PdQl1ta7", "reviewer": "Reviewer_vJUR", "summary": "The paper considers incorporating qualitative pairwise-casual relations into transformer based models for capturing temporal event sequences.  The unbiassed estimation of the proposed measure, is ensured with theoretical justification. The experiments are conducted on both synthetic data, and several real event sequences, to demonstrate the superior performance of the proposed model in capturing multivariate event observations, compared with related methods.", "questions": "I have asked some key questions that significantly affect my fully digesting this paper, in the <Weaknesses>.", "limitations": "To me, causal inference and causal discovery using temporal event sequences, is a really big and complicated topic. I would see more thorough discussion and justification, regarding more complicated scenarios, although the authors provide some suggestions.", "rating": 5, "confidence": 3, "soundness": 3, "presentation": 1, "contribution": 2, "strengths": "- To me, it seems to be the first attempt to consider incorporating pairwise causal relations into a neural autoregressive model, although some previous work have considered modelling event sequences by inducing logic rule into temporal point processes.\n\n- To me, it seems quite important to provide theoretical justifications regarding the unbiassed estimation of the proposed measure.", "weaknesses": "- L19: To me, it should be, \"without\" -> \"with\"\nSome notations such as time (positions in a sequence), seem to be confusing!\n- L125: I would consider $i$ refer to the indices of the events in a sequence. Hence, I would prefer to use $i$ to denote $i$-th event, while use $t_i$ to denote the corresponding timestamp.  After reading Fig.1, I am still confused by the notations, as I cannot understand what kind of event sequences you are modelling, e.g., equally-spaced events or irregularly-spaced events. I would consider the most real events including the several real-world data used in your experiments, are irregularly-spaced. Thus, I am curious how do you express an event occurring at continuous-valued time, using only $l_i$. Suppose the data is equally-spaced, it is redundant to introduce $N_k$. \n- L19: I cannot fully understand how the sample/batch size B affects the calculation of the propensity score in Eq. 1 as there is no variable with subscript $j$.\n- L160: It is a bit weird to suddenly start to introduce transformer based event sequence models. A subtitle could be added.\n- For Sec.5, it would be better to use past verbs.", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "We thank the reviewer for the valuable comments and address the key questions below. Importantly, we wish to clarify some misunderstandings that will hopefully clarify matters.\n\n**Clarification about \"Without\" or \"With\" in L19.** It should indeed be \"without\" , as we have written. Our approach focuses on event sequences \"without\" meaningful timestamps. There are many applications, for instance, many well-known natural language processing (NLP)  approaches for extracting events and event sequences from textual corpora (such as ref 34 in our paper). It is easier to extract sequences and often impossible to obtain timestamps for events from text, since they are typically not mentioned in the source corpora. For some of the real-world datasets in the experiments, we assume that the timestamps are either not provided or too noisy to be useful.\n\n**Equally-spaced Events vs. Irregularly-spaced Events in L125.** We clarify the confusion here. We are modeling sequences where we only know the position of the events in the sequence, not the timestamps. Such event sequences can be considered as univariate categorical time series data. Our approach thus does not require modeling the event at continuous-valued time. \nThe introduction of $N_k$ is irrelevant to equally-spacing of events; rather it represents the number of events in the $k-th$ sequence due to varying lengths of event sequences. \n\n**Batch Size and Eq.1 in L159.**\nSubscript $j$ represents sequence $j$ from the sampled batch with number of sequences $|B|$ (the cardinality of $B$, $|B|$ is the upper index in Eq.1). \n\n\n**Introduction of Transformer in L160.** In the paragraph just above L160 on the introduction of transformers, we have introduced neural autoregressive models. Transformer is a prominent neural autoregressive model. We can add a subtitle to make the transition more smooth in the revised version.\n\n**Tense in Section 5.**\nWe will modify the content in Section 5 to past tense in the revised version.\n\n\n**Limitations and Discussion.**\nWe note that we discussed limitations in the main paper; we also included more discussion around causal inference in Appendix (see \"Causal Inference Assumptions\"). \n\nWe hope we have clarified several aspects and resolved misunderstandings such as the nature of the data and scope of work. We request the reviewer to consider increasing the score if he/she feels the clarifications have helped re-evaluate the work suitably. "}, {"review_id": "kKE8Va9Mf5", "reviewer": "Reviewer_vaYz", "summary": "The paper addresses the limited exploration of incorporating causal knowledge into deep learning models for temporal event sequences. The authors propose a novel approach to enhance the performance of transformer-based models in multivariate event sequences by injecting pairwise qualitative causal knowledge. They establish a framework for causal inference using a transformer architecture and provide theoretical justification for their approach. Experimental results demonstrate that their approach outperforms existing models by effectively leveraging knowledge about causal pairs, leading to improved prediction accuracy", "questions": "See the Weaknesses section.", "limitations": "\"Broader Impact and Limitations\" section provided at the end of the manuscript.", "rating": 6, "confidence": 2, "soundness": 3, "presentation": 2, "contribution": 3, "strengths": "- The paper investigates a very relevant and important topic: incorporating causal knowledge into transformers. The proposed approach represents a valid contribution to this domain.\n- The experimental section shows that the proposed approach outperforms all the baselines (both neural and non-neural), although in some cases by a small margin.\n ", "weaknesses": "- I find that the structure of the write-up could be improved. Sections 3 and 4 are quite technical and while being well-written, I find that the core contribution of the paper is somewhat hidden and not clearly presented. For example, I would have emphasized more the training details, including the proposed loss function\n- The impact of the choice of the $\\alpha$ value is not discussed. \n", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "We thank the reviewer for the valuable comments and respond to specific questions below. \n\n\n**Training Details.** We have included more training details in Section 3 of the Appendix (see \"Model Implementation and Training\"). Due to space limitations, we could not include the details around implementation and training in the main paper. We will try to make some edits in this regard and also make our core contributions clearer by incorporating a summary of our methods in Section 4 in the revised manuscript. \n\n\n\n**Trade-off for $\\alpha$.** The $\\alpha$ value performs a trade-off between loglikelihood and the incompatibility term in Equations 3 and 4.\nLike many penalty constraint optimization approaches: when $\\alpha \\rightarrow \\infty$, it pushes the optimal solution to satisfy the pairwise causal knowledge constraint; when $\\alpha \\rightarrow 0$, it is domain-knowledge-free. In our experiments, we select the best $\\alpha$ value based on the one which has the largest next event prediction loglikelihood on the validation subset.\nThe selected values range from 0.001 - 10 in various datasets, which are included in Table 2 of the Appendix. "}]

Author rebuttal:

Meta-review: This paper is concerned with finding causality from temporal even sequences in the transformer architecture and proposes a method to incorporate additional background information into transformers that is qualitative pairwise causal relations. The authors show how to find unbiased estimates of the proposed measure and the proposed method is validated on both synthetic and real-world datasets. The idea is interesting and seems to have the potential to inspire new approaches of dealing with causal event sequences with population deep learning tools.
Decision: Accept (poster)