Abstract
Causal discovery is essential for scientific advancement, yet traditional covariance-based methods require vast observational data. While Large Language Models (LLMs) offer a knowledge-based alternative, their massive scale is computationally prohibitive. This paper introduces "KG Structure as Prompt," a method that enhances Small Language Models (SLMs) by injecting structural information from Knowledge Graphs (KGs). Our results demonstrate that SLMs with fewer than 1 billion parameters can outperform models like GPT-3.5 in specialized biomedical causal discovery tasks.
Introduction
Determining whether one variable causes another—causal discovery—is a fundamental scientific challenge. Recent shifts toward knowledge-based causal discovery leverage the internal reasoning of language models. However, Small Language Models (SLMs) often lack the specialized domain knowledge found in their larger counterparts. To bridge this gap, we propose using the inherent structure of Knowledge Graphs to provide the necessary context for SLMs to reason about complex causal relationships without increasing model size.
Methodology: KG Structure as Prompt
The core of our approach is transforming Knowledge Graph (KG) structures into natural language prompts. Instead of relying solely on the model's internal weights, we provide "graph context" derived from external KGs like Wikidata or Hetionet.
We explore three types of structural information:
- Neighbor Nodes (NN): Immediate neighbors of the variables in question.
- Common Neighbor Nodes (CNN): Shared connections between variables, indicating a potential relationship.
- Metapaths (MP): Multi-hop chains of interactions (e.g., Gene A → Protein B → Disease C).
This graph context is combined with standard textual context and fed into various SLM architectures, including RoBERTa (Masked Language Model), Bloomz (Causal Language Model), and T5 (Seq2Seq).
Experimental Setup
We evaluated our method across four datasets: GENEC (a novel gene-gene causality dataset), DDI (drug-drug interactions), COMAGC (gene-disease causality), and SEMEVAL-2010 Task 8 (general open-domain causal relations). We utilized Wikidata for general knowledge and Hetionet for specialized biomedical relations.
Key Results and Insights
Our experiments yielded several significant findings:
- Efficiency over Scale: SLMs (125M to 560M parameters) using KG prompts consistently outperformed GPT-3.5-turbo (175B+ parameters) in few-shot settings.
- Metapaths as High-Signal Evidence: In biomedical domains, metapaths proved to be the most powerful predictors, offering latent evidence often missing from plain text.
- Performance Gains: Integrating KG structure resulted in F1 score improvements of up to 15.1 points on biomedical datasets compared to models without KG information.
- Architectural Superiority: Masked Language Models like RoBERTa generally performed best due to their bidirectional nature, allowing them to better weigh the relationship between textual and graph contexts.
Conclusion and Future Work
"KG Structure as Prompt" demonstrates that external structural knowledge can compensate for a lack of model parameters. While effective, challenges remain regarding the computational cost of multi-hop queries and the limited context windows of SLMs. Future research will focus on expanding this approach from pairwise discovery to identifying entire causal directed acyclic graphs (DAGs).
Summary updated