FOUNDATIONAL IN-CONTEXT CAUSAL MODELS

A causal model is trained to generate causal outcome distributions based on a set of context data and a set of query instances. Causal training data is generated by selecting a subset of fields from an initial data table to form the features for the causal model and another subset as the outcomes for different treatments. Treatments are determined based on the selected covariates, enabling causal mechanisms to account for potential dependence of treatment selection on data features while ensuring independence of the outcomes. The causal model may then generate outcome distributions for queries with a given treatment as a histogram of conditional causal outcomes that is trained with a histogram training loss. By training the model with training data having a wide variety of causal mechanisms, the model can effectively determine causal outcomes based on the context for a particular domain without requiring extensive fine-tuning of the causal model.

Skip to: Description  ·  Claims  · Patent History  ·  Patent History
Description
CROSS-REFERENCE TO RELATED APPLICATION

This application claims the priority benefit of U.S. Provisional Application No. 63/811,023, filed May 23, 2025, the contents of which is hereby incorporated by reference in its entirety.

BACKGROUND

This disclosure relates generally to causal modeling and more particularly to causal modeling and training of in-context causal models.

Causal models attempt to predict outcomes for particular treatments (e.g., causal effects subsequent from a particular intervention). These causal effects are notoriously difficult to successfully model and to distinguish causal outcomes from coincidental or co-occurring effects. Usually, modeling approaches are fine-tuned on extensive data for a specific domain, typically in conjunction with human expert design and “intuition” about causal mechanisms. In addition, training data for causal mechanisms is limited, often expensive to obtain, and without careful controls may improperly conflate correlative effects with causal effects. As such, there is a need for developing effective causal training data for a variety of causal relationships as well as effective model architectures and related training approaches to enable a causal model to be applied to many types of data without extensive fine-tuning or expert input.

SUMMARY

This disclosure provides causal models that learn to model a wide variety of different types of causal mechanisms using a context for a particular domain. For a particular domain, rather than fine-tuning the model, the causal model uses a context of examples (features, treatment, outcome) to implicitly determine the relevant causal mechanism for a queried domain without requiring any per-domain tuning. This enables effective training and application of causal mechanisms in new domains with relatively smaller data sets and without extensive training.

As existing causal data sets may only include certain types of causal relationships and are typically expensive to generate, causal data sets are generated from non-causal data in a way that obtains a large variety of causal relationships in the generated training causal data. To generate causal training data, a subset of fields for an initial data set (e.g., a non-causal data set) are selected as covariate features for the causal training data. The covariate features describe each respective data instance in the causal training data (e.g., as an input x) and may represent the features that, in inference, may be known about the data instance. To obtain a corresponding set of treatments, another set of fields is selected to form the outcomes associated with respective treatments, which may be perturbed to vary the original data values. Because real causal data can often only apply a single treatment to a data sample, a “selected treatment” is selected for each data instance based on the covariate features and may include a probabilistic assignment to the possible treatments (e.g., with sampling using a Bernoulli distribution based on the covariate features). For the set of treatments, another set of fields is selected to form the outcomes associated with respective treatments, which may be perturbed to vary the original data values, such that the original field values may represent the mean but may include measurement and other deviation/error in observed outcomes. By generating multiple training data sets in this way with different selected fields across multiple initial data sets, causal training data with multiple different causal mechanisms can be effectively generated.

To model causal effects with a plurality of causal mechanisms, a causal model receives a “context” for the domain including a set of data instances each having a set of covariate features, applied treatments, and associated outcomes. The causal model receives a set of queries and associated treatments for which to determine predicted outcomes. The causal model is a transformer-style model that applies attention across the context to evaluate the queries independently (without attention across the set of queries). Rather than generate a specific outcome, the causal model obtains outcome bins describing the likelihood that the mean outcome for the treatment of the query belongs to that outcome bin, enabling a distribution of conditional outcomes to be generated for the queries. During training, a histogram training loss may be applied with respect to a training outcome for the treatment associated with each query data instance. Using the training data with multiple causation mechanisms, the causal model learns different possible causation relationships and determines an outcome distribution dynamically for an arbitrary domain without fine tuning. That is, during inference, queries for a given domain, including designated treatments, may be evaluated in conjunction with a set of context instances for the domain to obtain a distribution of conditional outcomes for the respective treatments and without requiring fine-tuning on the domain.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates a causal modeling system, according to one or more embodiments.

FIG. 2 shows an example causal model, according to one or more embodiments.

FIG. 3 shows an example of generating causal training data from an initial data table, according to one or more embodiments.

FIG. 4 shows an example method for generating causal training data tables, according to one or more embodiments.

FIG. 5 shows an example dataflow for training a causal model, according to one or

more embodiments.

FIG. 6 shows an example process for training a causal model, according to one or more embodiments.

The figures depict various embodiments of the present invention for purposes of illustration only. One skilled in the art will readily recognize from the following discussion that alternative embodiments of the structures and methods illustrated herein may be employed without departing from the principles of the invention described herein.

DETAILED DESCRIPTION Architecture Overview

FIG. 1 illustrates a causal modeling system 100 according to one or more embodiments. The causal modeling system 100 provides a causal model 140 that aims to estimate a causal outcome for associated treatments applied to one or more data instances (i.e., query data instances) given a set of domain data (e.g., as a context). The causal modeling system 100 generates training data and trains the causal model 140 to represent a plurality of different causal mechanisms, such that the set of domain data for a given query is used by the causal model 140 to estimate the appropriate causal mechanism for evaluating a given set of query data instances and obtain causal outcomes for the query data instances. Additional details of the causal model 140 are discussed below, particularly with respect to FIG. 2.

The causal modeling system 100 includes various computing modules and data stores for training and applying the causal model 140. Particularly, the causal modeling system 100 may generate training data for the causal training data 150 used to train parameters of the causal model 140. A data generation module 130 may generate the training data based on one or more data generation mechanisms (DGMs), such that the causal training data 150 may include training data representing a wide variety of causal mechanisms that may be learned by the causal model 140. A model training module 120 may then use the causal training data 150 to train parameters of the causal model 140 using a model training module 120. Additional details of training data generation processes and training of the causal model 140 are discussed further below, particularly with respect to FIGS. 3-6.

The causal modeling system 100 may also include a causal inference module 110 that uses the (trained) causal model 140 with a set of inference domain data 160 for evaluating one or more query data instances. The causal inference module 110 may receive one or more query data instances in a particular domain for application to the causal model 140 and return the resulting outcome predictions (e.g., as a distribution) to the requesting system or another system for receiving outcome predictions. As discussed further below, the causal model 140 may use a set of domain data to characterize a particular domain for performing causal inference. Each domain defines a specific data set for a particular type of causal inference. For example, one domain may relate to prediction of all-cause mortality based on a certain set of patient characteristics and related treatments, and another domain may relate to prediction of cardiovascular disease (CVD) risk, which may have differing patient characteristics and related treatments.

During inference, the domain data may be obtained from the inference domain data 160 and used to form the context used for a set of queried data instances. In many instances, because the causal model 140 is effectively trained with a wide variety of causal mechanisms, causal inference with the causal model 140 may be performed using the context for a given domain as an input to the model without fine-tuning the causal model 140 with respect to that domain. As such, the causal inference module 110 in some instances may use the same trained causal model 140 for evaluating multiple different domains (e.g., different types of data with different expected causal mechanisms). After training, the causal model 140 may thus be a “foundational” model, such that it may be effectively applied to a variety of additional data sets (e.g., domains) and in many cases require no additional training or fine-tuning for particular inference domains, enabling the causal model 140 be broadly used as-is across many domains. When applying the causal model 140 to a particular domain, the context for that domain informs the application of the causal model 140 to that domain and enables the causal mechanism of that domain to be effectively determined and applied to the queried data.

Although the components of the causal modeling system 100 are shown in FIG. 1 as part of a single computing system, various embodiments may include different components across different individual computing systems (e.g., across a network or other communications channel). For example, the various modules may be located at different computing systems to perform their respective functions. One system may generate causal training data, another system may train the causal model 140, and a further system may perform inference with the trained causal model 140. In some examples, various different distributed devices may perform inference with the causal model 140 and implement components of the causal inference module 110 along with respective inference domain data 160 for particular domains handled by the particular computing system. As the causal model 140 may be effective when applied to many types of domains, the same causal model 140 (i.e., with the same architecture and trained parameters) may be used by various systems using respective inference domain data 160 for different domains.

FIG. 2 shows an example causal model 200, according to one or more embodiments. The causal model 200 receives a set of context data describing the domain as a set of domain data 230 and uses the domain data 230 to evaluate a set of query data instances 220. During training, the causal model 200 effectively learns a variety of different causal mechanisms 210A-C as represented by the different training data sets used to train the causal model 200. Each of the causal mechanisms 210A-C represents a different relationship between data instances and potential outcomes, such that the causal model 200 learns to relate arbitrary domain data to approximations of the underlying causal mechanisms that affect how particular query data instances 220 are affected by particular treatments.

As a causal data model, rather than describe individual data instances with a plurality of features, each data instance is described with a set of covariates and is assigned a treatment that was applied (or prospectively could be applied) to the data instance. For the domain data 230 forming a context for the causal model 200, the treatment for a particular data instance typically describes the treatment applied to the data instance while the treatment for a query data instance 220 indicates the treatment for which a prediction of the causal model 200 is to be determined.

More formally, the causal model 200 attempts to determine an outcome for a data instance described with a set of covariates with respect to a particular treatment. As discussed further below, rather than a single outcome, the causal model 200 generates a treatment outcome distribution 240 for each query data instance 220 that describes the distribution of outcomes for the data instance (as described by its covariates) when the particular associated treatment is applied to the query data instance 220. For example, for a domain relating to CVD risk, the covariates may describe various patient data, such as height, weight, age, blood pressure, laboratory tests, and so forth for a given patient. The treatment may be associated with particular types of treatment modalities that may be applied to the patient, such as a placebo, a medication, a surgical intervention, and so forth. The treatment outcome distribution 240 may provide a numerical evaluation of the outcome likelihoods of various values when the associated treatment is provided to that patient.

The domain data 230 may provide a context for evaluating the queried data instance 220. In the example relating to predicting CVD risk, the domain data 230 includes data instances associated with each of the potential treatments, shown in FIG. 2 as treatment A and treatment B. For example, Treatment A may correspond to a medication and Treatment B may correspond to a surgical intervention. Each of the Treatments are associated with various data instances and associated outcomes. In this example, the data instances correspond to patients treated with the respective treatment who are each described by the respective covariates, and the outcomes correspond to the specific (known) CVD outcome for that patient, such as the amount of time after treatment (if any) that the patient encountered a CVD event. The causal model 200 may thus be used to determine a treatment outcome distribution 240 for particular patients when applying particular treatments.

Thus, the context may be formally described as a set of observations in the domain

D obs = { ( x ( n ) ,   t ( n ) , y ( n ) ) } n = 1 N

in which each data instance n is described by a set of covariates xn, is associated with treatment tn, and resulting outcome yn (conditioned on treatment tn). Given the context in the domain Dobs, the causal model 200 thus aims to determine the treatment outcome distribution 240 as a conditional expected potential outcome (CEPO) described by a posterior predictive distribution (PPD) (together, a CEPO-PPD). Formally, the treatment outcome distribution 240 is thus the distribution qθ(·|x, t, Dobs) given causal model 200 parameters θ, query data instance covariates x, applied treatment t for the query data instance, and context Dobs. The treatment outcome distribution 240 may thus describe the distribution of the expected outcome for the query data instance 220. That is, the likelihood of a particular point (or outcome bin) on the outcome distribution describes the likelihood that the query data instance 220 has the associated outcome of that point (or outcome bin) as an expectation (e.g., as an average or mean).

As also further discussed below (e.g., with respect to FIG. 5), the causal model 200 may model the different regions of the outcome distribution as a plurality of output bins that in some embodiments may each be associated with individual output logits, such that individual portions of the treatment outcome distribution 240 are quantized in the output bins (e.g., as a histogram). As one example, the output range (e.g., from [−1, 1] or [0, 1]) may be represented as 1,024 discrete output bins in one embodiment, such that each output bin represents a corresponding portion of the overall output range. In some embodiments, each output logit is determined by an independent output head (e.g., one or more modeling layers). By treating each output bin individually (e.g., with separate output logits), the discrete regions of the treatment outcome distribution 240 may independently learn respective likelihoods, enabling the treatment outcome distribution 240 to more effectively model complex outcome distributions (e.g., without encouraging the distribution to conform to a Gaussian or other defined distribution type).

The causal model 200 may have various architectures in various embodiments. In one embodiment, the causal model 200 includes one or more attention mechanisms for attending to the context of the domain data 230. In some embodiments, the causal model 200 includes an attention mechanism across the domain data 230 (such that the attention is applied across the various data instances of the different treatments of the domain data) and does not apply attention across the query data instances 220. In this way, the causal model 200 may be configured to process a plurality of query data instances 220 without attention affecting the processing of each. In various embodiments, the causal model 200 is a transformer-style model including token embedding of data instance inputs. In one embodiment, the context is represented as a sequence of row tokens that each encodes the covariates, treatment, and outcome for the respective data instance. To apply the causal model to a set of query data instances, each query data instance may be embedded in a query token that represents the covariates and treatment of the respective query data instance. The context and query data instances may then be processed with attention, self-attention, and multi-layer perceptron (MLP) layers to process the context and query data instances with respective parameters for each layer. In some circumstances, the attention layers may include self-attention within a particular token (e.g., for a particular data instance) and may include attention across the plurality of context tokens. As one example, a projection layer may then be applied to obtain the output distribution for the queried data instances. The causal model 200 may also use asymmetric masking to apply attention to the context without applying attention to the queried data instances. Thus, the attention mechanism may attend to all context tokens, while the query data instance tokens attend only to the context, ensuring that the resulting outcome distributions (for each query data instance) are mutually independent while processing multiple data instances simultaneously.

The treatment outcome distribution 240 for a particular query data instance 220 may be provided to a requesting device (e.g., by the causal inference module 110) or may be used to perform additional evaluation of the query data instance 220. For example, a sample may be taken from the treatment outcome distribution 240 to determine a particular expected outcome for the query data instance 220 that describes the “expected” (e.g., as a mean) outcome for that query data sample. In some embodiments, the treatment outcome distribution 240 may be sampled from multiple times to determine a variance, deviation, or other statistical measure of the expected outcome for the query data instance 220. In some embodiments, the causal model 200 may include stochastic or other randomizing elements, such as different selections of data instances to form the set of domain data 230 or as components in layers of the causal model 200. In these instances, the causal model 200 itself may be executed additional times to obtain differing treatment outcome distributions 240 from which additional statistical measures may be evaluated.

In addition to the CEPO-PPD for one treatment, the treatment outcome distribution 240 may also be used to evaluate additional conditional treatment effects. For example, the same query data instance may be applied to the causal model with different treatments (e.g., T0 and T1) to determine the respective treatment outcome distributions 240 for each treatment. The treatment outcome distributions for the query data instance(s) 220 and the associated treatment outcome distributions 240 for different specified treatments (T0, T1) may then be used to evaluate the expected differences across treatments for a specific query data instance 220 or across query data instances 220, which for binary treatments may be defined as an average treatment effect (ATE) or conditional average treatment effect (CATE).

As such, the causal mechanisms modeled by the causal model 200 may differ from other model approaches in various ways. First, as also discussed below, the causal model 200 may learn a plurality of differing causal mechanisms 210A-C. Each causal mechanism 210A-C represent different ways in which the covariates and treatments may affect the outcome for a data instance. Different causal mechanisms may represent different relationships between varying different covariates and treatments, which may include different types of relationships (e.g., linear, quadratic, exponential, step-functions, etc.) along with different relationship strengths (e.g., high, low, or negligible treatment effects across different treatments), and different effects across different covariates.

In addition, the causal model relates to a causal context that differs from situations in which models receive a set of features for describing each data sample without a treatment; by including the treatment, the causal model learns to contextually capture the different causal interactions that may occur at different regions of the covariate space when associated with the specified treatment. As also discussed below, the treatments are also not obligated to be independent of the covariates, and in many practical cases there may be a correlation between different regions of the covariate space and the frequency that different treatments are present in the context, such that the treatment is not effectively “another feature” for describing each data instance, but describes the particular causal action that conditions the outcome distribution. By training the model on the variety of causal mechanisms and representing a current data set as a context for the particular domain, the causal model 200 may thus effectively determine a causal mechanism for the current domain as a “sample” using the trained parameters from the variety of causal mechanisms.

As such, for the causal model 200 to effectively evaluate causal effects for unseen domains (i.e., characterized only by the domain data 230 and without fine-tuning of the causal model 200), the causal model 200 must be effectively trained with data representing an effective variety of causal mechanisms 210A-C. While some training data sets may exist for natural data or be generated directly from designated causal mechanisms, these approaches may not be optimally effective for modeling the unknown variety of causal mechanisms that may exist in unknown domains. For natural data (e.g., training data from actual experiments having designated treatments), besides the relatively low volume of this data, the resulting data may often include errors and address limited types of data on which experiments were performed, with data quality depending on the various controls for such experiments. Meanwhile, synthetic data sets that may be generated from various causal mechanisms may be reliant on the appropriate selection of causal mechanisms 210. The particular causal mechanisms selected may be incomplete or incorrectly rely on “expected” causal mechanisms for subsequent domains, such that simulated data generated in this way may fail to account for the full scope of potential causal mechanisms that may be present in particular domains, preventing the causal model 200 from properly learning the missing causal mechanisms.

As such, in addition or as an alternative to causal training data obtained in these ways, the causal modeling system 100 (e.g., with data generation module 130) may generate causal training data that represents a wider variety of causal mechanisms to be learned by the causal model 200. This generated data may be obtained by modifying initial data tables to characterize the data with simulated causal mechanisms as discussed below.

FIG. 3 shows an example of generating causal training data from an initial data table 300, according to one or more embodiments. A causal training data table 360 may be generated based on information in an initial data table 300. The causal training data table 360 includes a plurality of training data instances, each of which includes corresponding covariates (x), a treatment (t), and outcomes (y). The initial data table 300 may be a non-causal data table and may also include data tables in which there are no treatments or fields designated as “outcomes.” As such, the initial data table 300 may include a plurality of data instances 305 such as data instances 305A-D with a plurality of fields 310 such as fields 310A-F that are associated with the respective data instances 305. Each data instance 305 may thus be represented as a row in the initial data table 300 and each field 310 may be a column describing values for the corresponding data types of the respective field. The initial data table 300 may be selected from any suitable source of data tables, and may include a natural data table (e.g., describing “real” data) or may be simulated data obtained from various data generative processes. Each of the fields 310 in the initial data table 300 may include various and unknown relationships and other correlation to other fields 310 in the initial data table 300.

To obtain a suitable causal training data table 360, the fields of the initial data table 300 are processed to simulate various types of covariates 330, an applied treatment 340, and potential treatment outcomes 350 for data instances 335 based on the initial data table 300. Initially, a subset of fields 310 in the initial data table 300 may be selected 320 as a set of covariates 330A-C. The number of fields selected may correspond to the number of covariates 330 used in the causal training data table 360 and/or the causal model to be trained with the causal training data table 360. In the example of FIG. 3, the fields 310A, C, E are selected as the covariates 330A-C. The particular fields selected for the covariates 330A-C may be randomly selected from the fields 310 of the initial data table 300 and, during selection, may also be shuffled or otherwise randomly assigned as each of the covariates 330.

Because typical real-world data sets cannot effectively perform counterfactual experiments (e.g., only a single treatment may be applied to a specific patient), each data instance 335 may be assigned one treatment 340 for use in the causal training data. However, to effectively select consistent outcomes, each treatment (e.g., treatment 0 or treatment 1) may be associated with a set of outcomes 350 based on corresponding fields of the initial data table.

For each of the treatments, a field 310 is selected for generating the value of the outcomes 350 of the data instance indicating the outcome for the associated data instance if the corresponding treatment is applied. In the example of FIG. 3, fields 310D and 310F are selected to be used for the treatment outcomes 350A-B. Particularly, the values of field 350D is used to populate values for outcome 350A corresponding to treatment 0 and the values of field 350F is used to populate values for outcome 350B corresponding to treatment 1. In some embodiments, the values of the selected fields 310 in the initial data table 300 may be perturbed or otherwise randomly modified before populating the corresponding outcome 350. This perturbation may include adding random noise to the respective value, which may be a zero-mean noise, such that the overall noise is not expected, on average, to affect the values of the outcomes 350. The type of noise may vary in different embodiments, and can include drawing a value from a Uniform, Gaussian, or Laplace distribution.

The different outcomes 350A-B are associated with different treatments that may be assigned to the respective data instance, such that depending on the selected treatment, a respective outcome 350 is selected as the outcome value for the data instance. The selected values are emphasized in FIG. 3 with heavier line weight. In the example of FIG. 3, data instance 335A has an assigned treatment 340 of t=0, such that the outcome used for the data instance 335A is the associated outcome 350A for t=0 from outcome 350A. Similarly, data instance 335D has an assigned treatment 340 of t=1, such that the outcome used for the data instance 335D is the associated outcome 350A for t=0. For data instances 335B-C that are assigned treatment 340 of t=1, the value for outcome 350B associated with t=1 is used instead. As the outcome values are obtained for articular treatments from fields in the initial data table 300 (here, treatment 0 from field 310D and treatment 1 from field 310F), the values for each data instance 335 having the same assigned treatment are based on the same fields in the initial data table 300, enabling the corresponding relationships between fields to be represented in the causal training data. In addition, the outcomes 350 are independent from the selected covariates 330 and are also independent from the selected treatment 340.

The treatments 340 assigned to the data instances 335A-D may be determined in various ways. In one example, the treatments 340 for the data instances 335 are randomly generated. In many real-world data sets, however, the treatments for data instances may not be independent of the covariates 330; rather, the covariates 330 may have some effect on the selection of the corresponding treatment 340 in many data sets. To simulate this treatment selection in real data sets, the treatment for each data instance 335 may be determined based on the corresponding set of covariates 330. The generated treatments based on the covariates may be a probabilistic assignment of a treatment 340 for each data instance 335A-D based on the co-variates, such that a probability distribution is generated with the covariates 330 and a treatment 340 is sampled from the probability distribution. For example, the covariates 330 may be used to generate a Bernoulli distribution (or another distribution having outcome values corresponding to the number of treatments 340) for each data instance 335, which may be sampled from to obtain corresponding treatments 340. In some embodiments, the probability distribution (e.g., a Bernoulli distribution) may be determined by applying a random function to the covariates and applying a Sigmoid function to map the covariates to the distribution from which a treatment is sampled. The selection of the treatment 340 in one embodiment may thus be described in one embodiment as a sampling from the Bernoulli distribution of a sigmoid of a random function ƒ applied to the covariates X: T~Bernoulli (sigmoid (ƒ(X))). In addition, by using a sampling from a distribution, while the covariates may affect the likely selected treatment 340, the likelihood of sampling each treatment remains positive (i.e., greater than zero), ensuring that different frequencies of treatments may be selected for different regions of the covariate space while preventing any particular treatments from be excluded in the resulting causal data table. As such, different causal training data tables 360 may have different frequencies of each treatment, which may also vary within regions of the covariate space.

Each of the data instances 335 may then be added to a causal training data table 360 using the respective covariates 330, treatment 340, and at least the respective outcome 350 corresponding to the selected treatment 340. In some embodiments, multiple outcomes 350 may be included in the causal training data table 360, such that the selected outcome 350 is determined at a future point. By generating causal training data tables 360 (e.g., a plurality of such causal training data tables 360) for training causal models in this way, with varying selections of covariates, outcomes, and from different initial data tables 300, the overall causal training data set may include causal training data tables 360 capturing a large variety of different causal relationships without requiring completely random selection of treatments and while keeping treatment selection independent of the outcomes 350. Accordingly, any “base table” that may include no causal relationships can be used to generate a variety of effective causal data tables for training a causal model. This approach thus “simulates” a collection of data instances from an underlying data generating process (DGP) and provides strong ignorability by design (e.g., treatment Tis determined solely from X and therefore conditionally independent from potential outcomes 350A-B). In addition, sampling from the distribution (e.g., with a sigmoid function), the treatment frequency satisfies positivity, ensuring the assigned treatments have positive likelihood of each treatment. Though shown here for binary treatments, this approach may similarly be applied to any additional number of discrete treatments.

FIG. 4 shows an example method for generating causal training data tables, according to one or more embodiments. The method shown in FIG. 4 may be performed by a causal modeling system 100, for example via a data generation module 130 and model training module 120. To generate causal data for training the causal model, the system selects 400 an initial data table, which may include a data table of non-causal data (e.g., a tabular data table), synthetically-generated data, and/or non-simulated data (e.g., from a database or prior experimentation results). The initial data table may then be used to generate causal training data as discussed above. In one example, the initial data table may be generated by sampling data from a uniform distribution to obtain the covariates. In an additional embodiment, rather than using a field of the initial data table, the treatment outcomes may be determined by applying a random function to the covariates and adding zero-mean noise.

Particularly, a subset of fields of the initial data table are selected 410 as covariates for the causal training data tables. Then, another subset of fields, exclusive to the subset selected as covariates, is selected 420 as treatment outcomes for respective treatments, such that each treatment may be associated with a selected field from the initial data table. In various embodiments, the selected output fields may also be perturbed 430, for example with zero-mean randomization. Next, a treatment assignment is generated 440 and may be based on sampling from a probability distribution based on the selected covariates as discussed above. Finally, the causal training data table is stored 450 with the selected covariates, treatment assignment, and treatment outcome. Additional causal training data may be generated by re-using the same initial data table and varying the selection 410 of the covariates and the selection 420 of the treatment outcomes. Similarly, the process may be repeated by selecting 400 additional initial data tables to generate a large number of causal training data tables. Each of these causal training data tables may thus represent a different data generating process that can be learned by a causal model, and provides significant variation from one another for the causal mechanisms represented in each. The causal training data tables generated this way, in addition to any further training data, may then be used to train 460 a causal model that learns parameters capturing the large number of data generating processes.

FIG. 5 shows an example dataflow for training a causal model, according to one or more embodiments. This dataflow may be operated by a causal modeling system 100, such as by a model training module 120, to train parameters of a causal model 520. As discussed above, e.g., with respect to FIG. 2, the causal model 520 may receive a set of context data 510 Dobs along with one or more query data instances 515 to be processed by the causal model 520. The causal model 520 applies a plurality of model layers having configurable parameters to the input data points and may include one or more attention layers that include applying attention across the context data instances 510 and masking attention between query data instances 515. Each context data instance 510 is described with corresponding covariates x, a treatment t, and an outcome y conditioned on the particular treatment. The causal model 520 receives covariates x and a treatment t for each query data instance 515 to generate outputs describing the causal outcome distribution 550 for each query data instance that aims to predict the conditioned outcomes for the query data instance given the covariates of the query data instance, treatments, and the context data 510 describing the domain Dobs.

As discussed above, the causal model 520 in some embodiments generates the causal outcome distribution 550 by generating a plurality of output logits 530A-N that represent individual output ranges for the causal model 520. The output logits 530A-N may represent unnormalized values for each output range, such that the output logits 530A-N may be normalized to a total likelihood of 1 by applying a SoftMax layer across the output logits 530A-N to obtain output bins 540A-N that together represent the causal outcome distribution 550. To obtain individual outcome predictions, the causal outcome distribution 550 for a query data instance 515 may be sampled to obtain a conditional outcome expectation.

To train the causal data model 520, a causal training data table 500 is selected and a set of training data instances are selected to form a batch of context data instances 510 and query data instances 515. In situations where the total data instances in the causal training data table 500 is larger than the total input size for the causal model 520 (e.g., the context data instances 510 and query data instances 515), the selected data instances for the training batch may be selected in various ways. For example, in some cases, the total number of data instances available in a causal training data table 500 (e.g., for a particular domain or data-generating process) may exceed the input size of the causal model 520. In one example, the data instances for inclusion in a batch and/or assignment to context data instances 510 or query data instances 515 are randomly selected. In another example, one or more data instances are selected to seed the selection of additional data samples based on similarity of the data instances in the causal training data table 500, where similarity may be measured based on distance of the covariates. In additional embodiments, context data instances 510 may also be selected to have at least a minimum number of data instances associated with each treatment.

The context data instances 510 and query data instances 515 (i.e., the covariates and selected treatment) are provided as inputs to the causal model 520 for obtaining a causal outcome distribution 550 as discussed above. To evaluate the accuracy of the causal outcome distribution 550 and train the model parameters, a histogram training loss 590 is determined that represents the model error as a histogram relative to the causal outcome distribution 550. To generate the histogram training loss 590, a relevant training outcome 570 for the query data instances 515 given the selected treatment t is determined. In some instances, the causal training data table 500 may already include the outcome of the selected treatment. In other instances, the causal training data table 500 may store query training outcomes 560 indicating outcome values for multiple treatments, e.g., as discussed with respect to FIGS. 3-4 and particularly outcomes 350. If necessary, the selected treatment for the query data instance provided as an input with the query data instance 515 to the causal model 520 is used to select the treatment outcome from the query training outcomes 560 as the training outcome 570. That is, the value Y0 may represent an outcome value for a respective query data instance when the treatment is set to 0 and the value Y1 may represent the outcome value when the treatment is set to 1.

In some embodiments, rather than directly using the training outcome 570, and training the causal model to exclusively learn the related output bin, the training outcome 570 is “spread” to additional output bins, enabling additional nearby output bins in the outcome distribution to receive non-zero encouragement. Because the different portions of the causal outcome distribution are obtained by different outputs and output logits 530, a loss that encourages only the output logit 530 associated with the training outcome 570 may unduly encourage the model to learn individual output bins. Because the outputs also represent different expected outcomes, locally distributing the training outcome 570 to additional output bins 540 can be done without affecting the mean expectation. In one embodiment, a Gaussian kernel 575 is applied (e.g., with a small variance) to the training outcome 570 to spread the training outcome value to a training distribution 580 that can be represented in a plurality of bins and compared with the causal outcome distribution 550.

In one embodiment, the Gaussian kernel is integrated over the bins to obtain Gaussian quantized probabilities

P μ t ( x ) Gauss [ ℓ ]

and used to minimize the Histogram Training Loss 590. In some embodiments, Histogram Training Loss is a Causal Data-Prior Loss, such as:

L t ( θ ) := 𝔼 ψ ~ π , D obs ⋃ ( { x } ~ P obs ψ [ - log ⁢ q θ ( μ t ( x ; ψ ) ⁢ ❘ "\[LeftBracketingBar]" x , t , D obs ) ] Equation ⁢ 1

In which: θ are the model parameters,

    • ψ~π is a data-generating process ψ selected from a plurality of data generating processes π learned by the model (i.e., a particular training data set);
    • μt is the conditional treatment outcome for treatment t; and
    • Dobs are the data instances representing the DGP ψ in an input context.

By minimizing the causal data-prior loss, the model qθ learns to map the observational data to the corresponding predictive distribution directly. For each training batch, a DGP is sampled (i.e., a causal training data table is selected or generated) to obtain a DGP ψi~π represented with an observational data set Dobs and a query data instance and provide both the observational data and query to the model. The model outputs a CEPO-PPD as the causal outcome distribution 550, and the model parameters θ are updated to increase the probability assigned to the true CEPO value and distribution through the Gaussian kernel 575. Through stochastic gradient descent, the updated parameters minimizes the data-prior loss and implicitly learns to perform posterior-predictive inference, without ever explicitly computing the posterior.

In one embodiment, the Histogram Training Loss 590 is defined as

HL [ μ _ t ( x ) ⁢ q θ ] = - ∑ ℓ = 1 L P μ _ t ( x ) Gauss [ ℓ ] ⁢ log [ ℓ ] .

This loss is an approximate form of causal data-prior loss, which matches in the limit σ→0 and L→∞. As such, the expected value of the treatment outcome μt(x) is used to generate the histogram training loss for a particular query data instance and train model parameters of the causal model 520 (including, e.g., layers for generating the output logits 530). The model parameters may be updated during training with any appropriate training methodology, such as gradient descent. By treating particular output regions as discretized bins, the output logits may effectively represent different “classes,” such that this approach enables causal outcome distributions 550 that effectively represent non-standard distributions. In addition, by applying a Gaussian kernel 575 to the training outcome 570, the training process can distribute the “likelihood” of the training outcome 570 to nearby “classes” that otherwise may not be effectively accounted for if only the particular output bin were evaluated for the histogram training loss 590.

In some embodiments, a temperature parameter may also be applied to the output logits 530 before applying the SoftMax function to obtain the output bins 540A-N. In some embodiments, the temperature parameters may be calibrated to set to calibrate the likelihood that the causal outcome distribution 550 includes the training outcome 570 for a query. While normally this may be performed with direct CATE calibration, in this instance, the CATE is never observed directly at test-time. Instead, the model training module may calibrate the temperature parameters with a regression calibration for observational data: an observed triple (t, x, y) for the context data instance is covered by the predicted credible interval when y lies inside the model's predicted interval for the CEPO-PPD (i.e., in the causal outcome distribution 550). The temperature parameter may be tuned e.g., based on coverage metrics and using any suitable tuning approach, such as a grid search.

By applying this training approach with varying causal training data tables 500 that represent many different DGPs, the causal model 520 learns to effectively generate a causal outcome distribution 550 for new domains (and can do so without fine-tuning the model on the domain) by using the context data instances 510 to effectively estimate the underlying DGP of the particular input domain and thus perform effectively as a foundational model for many different domains of causal analysis.

FIG. 6 shows an example process for training a causal model, according to one or more embodiments. The process of FIG. 6 may be performed, for example, by a causal modeling system 100 and a model training module 120 as discussed in FIG. 1. Initially, the causal model may have a set of initial parameters that may be randomly or otherwise initialized. For a particular training batch (e.g., a particular round of model parameter updates), the model training module selects a causal training data set 600 that includes a set of training data instances having covariates, treatments, and treatment-conditional outcomes. The causal training data set 600 may be obtained from a stored set of training data, or may be generated, e.g., from a DGP process or from the process as discussed above with respect to FIGS. 3-4.

Particular data instances are selected 610 to form the context and queries for the causal model to be inputs to the model as shown in FIG. 5. In some embodiments, the training data set may be larger (and in some instances, significantly larger) than the number of context and query data instances that may be used as an input to the causal model. For example, the maximum context length in some instances may be 4,096 data instances, while real-world causal data tables may sometimes contain millions of rows of data. To handle these situations, the context may be selected in some instances as a relevant subset for each query. To do so, in some instances a lightweight gradient boosting regressor may be trained on the context that can produce rough CATE estimates for the covariates. This regressor may estimate CATE by regressing the treatment and covariates onto the outcomes and then obtaining a difference between the possible treatment values. The context rows and queries may be sorted by the “weak-CATE” estimated from the weak regressor and the queries may be partitioned into minibatches to select a window of context rows whose weak-CATE range is closest to a particular query batch. As such, the query batches are each used with a “neighborhood” of context data with similar causal effects (according to the weak-CATE estimates).

The model parameters are applied 620 to the context and queries (i.e., each query data instance) to determine the causal outcome distribution for each query conditioned on the associated treatments. Then, the training outcome associated with the query data is determined 630 and used to determine 640 a training distribution for the query data, for example by applying a Gaussian kernel as discussed above. The training distribution is evaluated with the causal outcome distribution to determine 650 a histogram training loss based on the difference between the training distribution (from the labeled outcome) and the causal outcome distribution (determined by the current model parameters). Finally, the parameters of the causal model parameters are trained 660 based on the histogram training loss with a suitable model update process, such as gradient descent. By applying multiple rounds of this training process with batches of using a plurality of different causal training data, the causal model learns to represent a plurality of different data generating processes and can obtain causal treatment effect predictions effectively for new domains based on a context for that domain without requiring fine-tuning.

The foregoing description of the embodiments of the invention has been presented for the purpose of illustration; it is not intended to be exhaustive or to limit the invention to the precise forms disclosed. Persons skilled in the relevant art can appreciate that many modifications and variations are possible in light of the above disclosure.

Some portions of this description describe the embodiments of the invention in terms of algorithms and symbolic representations of operations on information. These algorithmic descriptions and representations are commonly used by those skilled in the data processing arts to convey the substance of their work effectively to others skilled in the art. These operations, while described functionally, computationally, or logically, are understood to be implemented by computer programs or equivalent electrical circuits, microcode, or the like. Furthermore, it has also proven convenient at times, to refer to these arrangements of operations as modules, without loss of generality. The described operations and their associated modules may be embodied in software, firmware, hardware, or any combinations thereof.

Any of the steps, operations, or processes described herein may be performed or implemented with one or more hardware or software modules, alone or in combination with other devices. In one embodiment, a software module is implemented with a computer program product comprising a computer-readable medium containing computer program code, which can be executed by a computer processor for performing any or all of the steps, operations, or processes described.

Embodiments of the invention may also relate to an apparatus for performing the operations herein. This apparatus may be specially constructed for the required purposes, and/or it may comprise a general-purpose computing device selectively activated or reconfigured by a computer program stored in the computer. Such a computer program may be stored in a non-transitory, tangible computer readable storage medium, or any type of media suitable for storing electronic instructions, which may be coupled to a computer system bus. Furthermore, any computing systems referred to in the specification may include a single processor or may be architectures employing multiple processor designs for increased computing capability.

Embodiments of the invention may also relate to a product that is produced by a computing process described herein. Such a product may comprise information resulting from a computing process, where the information is stored on a non-transitory, tangible computer readable storage medium and may include any embodiment of a computer program product or other data combination described herein.

Finally, the language used in the specification has been principally selected for readability and instructional purposes, and it may not have been selected to delineate or circumscribe the inventive subject matter. It is therefore intended that the scope of the invention be limited not by this detailed description, but rather by any claims that issue on an application based hereon. Accordingly, the disclosure of the embodiments of the invention is intended to be illustrative, but not limiting, of the scope of the invention, which is set forth in the following claims.

Claims

1. A system for a causal model trained with a plurality of causal mechanisms, comprising:

a processor that executes instructions; and
a non-transitory computer-readable medium having instructions executable by the processor for: for each of a plurality of training data sets corresponding to a plurality of domains having differing causal mechanisms for outcomes of treatments applied to data instances: identifying a training context for the domain including training data instances for each treatment of a plurality of treatments, each data instance including covariate features and a treatment outcome for the associated treatment; identifying a set of query data instances each having associated covariate features and an associated treatment from the plurality of treatments; applying parameters of a causal model to obtain a causal outcome distribution for each query data instance for the associated treatment, the causal model, including applying one or more attention layers to the domain data instances; and determining a histogram training loss based on a training outcome distribution of the respective query data instances; and training parameters of the causal model based on the histogram training loss of each plurality of training data sets.

2. The system of claim 1, wherein the training outcome distribution is determined based on a Gaussian kernel applied to a training outcome associated with the respective query data instance.

3. The system of claim 1, wherein the causal model is a transformer-style model.

4. The system of claim 1, wherein the instructions are further executable for selecting context data points based on estimates from a gradient boosting regressor of the covariates.

5. The system of claim 1, wherein the causal outcome distribution is determined based on a SoftMax layer applied to output logits of the causal model.

6. The system of claim 1, wherein the instructions are further for applying, after training parameters of the causal model, the causal model to an inference domain without fine-tuning the causal model parameters to the inference domain.

7. The system of claim 1, wherein the instructions are further for:

applying the causal model to a query data point having a first treatment to obtain a first causal outcome distribution;
applying the causal model to the query data point having a second treatment to obtain a second causal outcome distribution; and
determining differential treatment effects of the first treatment and second treatment for the query data point by comparing the first causal outcome distribution to the second causal outcome distribution.

8. A method for a causal model trained with a plurality of causal mechanisms, comprising:

for each of a plurality of training data sets corresponding to a plurality of domains having differing causal mechanisms for outcomes of treatments applied to data instances: identifying a training context for the domain including training data instances for each treatment of a plurality of treatments, each data instance including covariate features and a treatment outcome for the associated treatment; identifying a set of query data instances each having associated covariate features and an associated treatment from the plurality of treatments; applying parameters of a causal model to obtain a causal outcome distribution for each query data instance for the associated treatment, the causal model, including applying one or more attention layers to the domain data instances; and determining a histogram training loss based on a training outcome distribution of the respective query data instances; and training parameters of the causal model based on the histogram training loss of each plurality of training data sets.

9. The method of claim 8, wherein the training outcome distribution is determined based on a Gaussian kernel applied to a training outcome associated with the respective query data instance.

10. The method of claim 8, wherein the causal model is a transformer-style model.

11. The method of claim 8, further comprising selecting context data points based on estimates from a gradient boosting regressor of the covariates.

12. The method of claim 8, wherein the causal outcome distribution is determined based on a SoftMax layer applied to output logits of the causal model.

13. The method of claim 8, wherein the method further applies, after training parameters of the causal model, the causal model to an inference domain without fine-tuning the causal model parameters to the inference domain.

14. The method of claim 8, further comprising:

applying the causal model to a query data point having a first treatment to obtain a first causal outcome distribution;
applying the causal model to the query data point having a second treatment to obtain a second causal outcome distribution; and
determining differential treatment effects of the first treatment and second treatment for the query data point by comparing the first causal outcome distribution to the second causal outcome distribution.

15. A non-transitory computer-readable medium for a causal model trained with a plurality of causal mechanisms, the non-transitory computer-readable medium comprising instructions executable by a processor for:

for each of a plurality of training data sets corresponding to a plurality of domains having differing causal mechanisms for outcomes of treatments applied to data instances: identifying a training context for the domain including training data instances for each treatment of a plurality of treatments, each data instance including covariate features and a treatment outcome for the associated treatment; identifying a set of query data instances each having associated covariate features and an associated treatment from the plurality of treatments; applying parameters of a causal model to obtain a causal outcome distribution for each query data instance for the associated treatment, the causal model, including applying one or more attention layers to the domain data instances; and determining a histogram training loss based on a training outcome distribution of the respective query data instances; and
training parameters of the causal model based on the histogram training loss of each plurality of training data sets.

16. The non-transitory computer-readable medium of claim 15, wherein the training outcome distribution is determined based on a Gaussian kernel applied to a training outcome associated with the respective query data instance.

17. The non-transitory computer-readable medium of claim 15, wherein the causal model is a transformer-style model.

18. The non-transitory computer-readable medium of claim 15, wherein the instructions are further executable for selecting context data points based on estimates from a gradient boosting regressor of the covariates.

19. The non-transitory computer-readable medium of claim 15, wherein the causal outcome distribution is determined based on a SoftMax layer applied to output logits of the causal model.

20. The non-transitory computer-readable medium of claim 15, wherein the instructions are further executable for applying, after training parameters of the causal model, the causal model to an inference domain without fine-tuning the causal model parameters to the inference domain.

Patent History
Publication number: 20260377716
Type: Application
Filed: Mar 3, 2026
Publication Date: Nov 26, 2026
Inventors: Hamidreza Kamkari (TORONTO), Valentin Patrick Marie Thomas (TORONTO), Junwei Ma (TORONTO), Jesse Cole Cresswell (TORONTO)
Application Number: 19/555,684
Classifications
International Classification: G06N 3/08 (20230101); G06N 3/045 (20230101);