KGPFN: Unlocking the Potential of Knowledge Graph Foundation Model via In-Context Learning
cs.AI
Submitted: 2026-05-14
Updated: 2026-10-02
Code: https://github.com/HKUST-KnowComp/KGPFN
License: http://creativecommons.org/licenses/by/4.0/
The gist: Knowledge graph (KG) foundation models aim to generalize to graphs with unseen entities and relations by learning transferable relational structure.
Terminology
Abstract
Knowledge graph (KG) foundation models aim to generalize to graphs with unseen entities and relations by learning transferable relational structure. Most existing methods, however, focus on relation-level universality, leaving in-context learning, the other pillar of foundation models, largely unexplored for KG reasoning. Context in KGs is structured and heterogeneous: accurate prediction requires conditioning both on the local neighborhood of the query entities and on global context that summarizes how the query relation behaves across many instances. We propose KGPFN, a KG foundation model built on a Prior-Data Fitted Network (PFN) that combines transferable relational representations with inference-time in-context learning over structured context. KGPFN learns relation representations by message passing on relation graphs and extracts multi-scale local context from the intermediate head representations of a multi-layer NBFNet. It then builds relation-specific global context from positive and negative examples of the query relation, together with their local structural representations, and aggregates this context with feature-level and sample-level attention. Through multi-graph pretraining, KGPFN learns to combine structural representations with labeled contextual evidence without inference-time parameter updates. On 57 knowledge graphs, KGPFN achieves the best average MRR both without and with fine-tuning, and context sensitivity analyses highlight the value of negative context examples. Our code is available at https://github.com/HKUST-KnowComp/KGPFN.
Sources
- Top Ten Challenges Towards Agentic Neural Graph Databases
- GraphPFN: A Prior-Data Fitted Graph Foundation Model
- An Open Challenge for Inductive Link Prediction on Knowledge Graphs
- Towards Foundation Models for Knowledge Graph Reasoning
- Controllable Logical Hypothesis Generation for Abductive Reasoning in Knowledge Graphs
- TabPFN-2.5: Advancing the State of the Art in Tabular Foundation Models
- Knowledge Transfer for Out-of-Knowledge-Base Entities: A Graph Neural Network Approach
- TabPFN: A Transformer That Solves Small Tabular Classification Problems in a Second
- How Expressive are Knowledge Graph Foundation Models?
- NGDBench: Towards Neural Graph Data Management
- TFMLinker: Universal Link Predictor by Graph In-Context Learning with Tabular Foundation Models
- DeepSeek-V3 Technical Report
- GPT-4 Technical Report
- TabICL: A Tabular Foundation Model for In-Context Learning on Large Data
- TabICLv2: A better, faster, scalable, and open tabular foundation model
- Query2box: Reasoning over Knowledge Graphs in Vector Space using Box Embeddings
- Neural Graph Reasoning: Complex Logical Query Answering Meets Graph Databases
- LLaMA: Open and Efficient Foundation Language Models
- Relational In-Context Learning via Synthetic Pre-training with Structural Prior
- NGDB-Zoo: Towards Efficient and Scalable Neural Graph Databases Training
Related papers
- MAVEN-T: Reinforced Heterogeneous Distillation for Real-Time Multi-Agent Trajectory Prediction
- Model Discovery Agent: LLM-assisted Bayesian experiment design for data-efficient discovery of mechanistic world models
- Agents' Last Exam
- The Clinician's Veto: Navigating Trust, Liability, and Uncertainty in Autonomous AI Prescribing
- MindHelper: Closed-Loop Embodied Mental-State Reasoning for Precision Intervention
- Incumbent Advantage: Brand Bias and Cognitive Manipulation Dynamics in LLM Recommendation Systems