With the Causality Analysis function, Hellixia allows you to retrieve domain knowledge from ChatGPT about a potential causal relationship between two nodes.
The Causal Structural Priors function extends this concept to more than two nodes.
We illustrate the Causal Structural Priors workflow with the well-known "Visit Asia" example from the domain of lung diseases.
We have a synthetic dataset from this domain, which has already been imported into BayesiaLab.
So, our starting point is an unconnected network, as shown in the following screenshot.
For instance, the node Smoking has an associated Node Comment that says, "The patient is a regular smoker."
Our objective is to find the causal relationships between risk factors, conditions, symptoms, and diagnostic imaging.
However, we know that machine learning alone cannot discover the true causal structure of this domain.
We begin with machine learning the associations between all nodes anyway and use the Unsupervised EQ learning algorithm for that purpose.
This newly-learned Bayesian network features directed arcs, but they can clearly not be interpreted as causal, e.g., Smoking could not possibly be a cause of Age.
Applying the Genetic Grid layout highlights the implausibility of the arc directions.
Select Main Menu > View > Layout > Genetic Grid Layout > Top-Down Repartition
.
In the past, we would have had to use any available domain knowledge from experts to correct the arc directions.
With Hellixia, however, we can tap into the domain knowledge available via ChatGPT.
So, select all arcs and then select Main Menu > Hellixia > Causal Structural Priors
.
In the Causal Structural Priors window, you need to specify a number of items:
Under Completion Model, choose a model for which you have a subscription, e.g., GPT_35 or GPT_4.
You can specify a General Context of the problem domain. In this example, "Lung Diseases" would be appropriate.
Under Subject of the Query, check all fields that contain information regarding the subject matter. We have information in the Node Name and the Node Comment in the example.
Clicking OK starts the search for causal relationships via ChatGPT. The progress bar at the bottom of the Graph Panel shows the search status.
A chime marks the completion of the search.
This table displays the causal arc directions obtained from ChatGPT in the three left columns.
The reason for the arc orientation is provided in the Explanation column.
Clicking Preview opens a window showing a simplified view of the causal arc directions proposed by ChatGPT.
Now, there are two ways to proceed, as illustrated in the following workflows 1 and 2.
In addition to the descriptive and self-explanatory node names, Comments are associated with each node, as indicated by the information icon .
Note that the algorithm keeps searching for a better layout until you stop the process by clicking the red buttonto the left of the Progress Bar.
Furthermore, the Structural Priors icon appears in the bottom-right corner of the Graph Panel.
To view the Structural Priors obtained from ChatGPT, you can click on the Structural Priors icon or select Graph Panel Contextual Menu > Edit Structural Priors
.
The final column, Check, indicates whether the causal direction matches the current orientation or not .
Clicking Export produces a so-called Structural Prior Dictionary, which is a text file containing all arc attributes, i.e.,
Start and End of arc
Structural Prior for each arc
Arc Comment, which, in this context, contains the Explanation for the causal directions as obtained from ChatGPT.
We can now use this Structural Prior Dictionary as an Arc Dictionary and replace the original, machine-learned arcs with the ChatGPT-informed causal arcs.
First, select Graph Panel Contextual Menu > Delete All Arcs
to remove all existing arcs.
Then, select Main Menu > Data > Associate Dictionary > Arc >Arcs
.
The network now features the causal arc directions as obtained from ChatGPT.
With the final arc directions now in place, we should arrange the nodes into a more intuitive layout, i.e., positioning parent nodes above child nodes.
Select Main Menu > View > Layout > Genetic Grid Layout > Top-Down Repartition
.
The network now displays the correct causal order of nodes and arcs.
In Workflow 1, we exported a Structural Prior Dictionary, including the Causal Structural Priors, and then imported this dictionary as an Arc Dictionary to create a causal network with these priors.
In this Workflow 2, we will immediately utilize the Causal Structural Priors to machine-learning a new network without the export/import step.
However, these new Causal Structural Priors have not been used for updating the arc directions in the network.
Select Main Menu > Learning > Unsupervised Structural Learning > Taboo
.
Like Arc Constraints, Structural Priors, Temporal Indices, and Filtered States, Causal Structural Priors impose constraints on learning. As a result, EQ-based algorithms are not available under those conditions.
This newly learned network now reflects the causal order obtained from ChatGPT.
With the final arc directions in place, we should arrange the nodes into a more intuitive layout, i.e., positioning parent nodes above child nodes.
Select Main Menu > View > Layout > Genetic Grid Layout > Top-Down Repartition
.
Note that the algorithm keeps searching for a better layout until you stop the process by clicking the red buttonto the left of the Progress Bar.
Clicking the Show Arc Comment button in the Toolbar displays the comments on the arcs. The Arc Comments show the explanations for the causal directions retrieved from ChatGPT.
So, our starting point is the machine-learned network, for which Hellixia has already obtained the Causal Structural Priors. The Structural Prior icon indicates that Structural Priors are associated with the network.
Note that the algorithm keeps searching for a better layout until you stop the process by clicking the red buttonto the left of the Progress Bar.