A Prompt-Based Knowledge Graph Foundation Model for Universal In-Context Reasoning
Yuanning Cui, Zequn Sun, Wei Hu
Abstract
Extensive knowledge graphs (KGs) have been constructed to facilitate knowledge-driven tasks across various scenarios. However, existing work usually develops separate reasoning models for different KGs, lacking the ability to generalize and transfer knowledge across diverse KGs and reasoning settings. In this paper, we propose a prompt-based KG foundation model via in-context learning, namely KG-ICL, to achieve a universal reasoning ability. Specifically, we introduce a prompt graph centered with a query-related example fact as context to understand the query relation. To encode prompt graphs with the generalization ability to unseen entities and relations in queries, we first propose a unified tokenizer that maps entities and relations in prompt graphs to predefined tokens. Then, we propose two message passing neural networks to perform prompt encoding and KG reasoning, respectively. We conduct evaluation on 43 different KGs in both transductive and inductive settings. Results indicate that the proposed KG-ICL outperforms baselines on most datasets, showcasing its outstanding generalization and universal reasoning capabilities. The source code is accessible on GitHub: https://github.com/nju-websoft/KG-ICL.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext f857ddcf-c593-4eb3-8396-2512bef6de27Cited by top-tier papers10
- HYPER: A Foundation Model for Inductive Link Prediction with Knowledge HypergraphsXingyue Huang, Mikhail Galkin, Michael M. Bronstein, Ismail Ilkan CeylanICLR 2026 · 12 citations
- Deliberation on Priors: Trustworthy Reasoning of Large Language Models on Knowledge GraphsJie Ma, Ning Qu, Zhitao Gao, Rui Xing et al.NeurIPS 2025 · 9 citations
- Flock: A Knowledge Graph Foundation Model via Learning on Random WalksJinwoo Kim, Xingyue Huang, Krzysztof Olejniczak, Kyungbin Min et al.ICLR 2026 · 8 citations
- Can Knowledge-Graph-based Retrieval Augmented Generation Really Retrieve What You Need?Junchi Yu, Yujie Liu, Jindong Gu, Philip H. S. Torr et al.NeurIPS 2025 · 8 citations
- Towards Graph Foundation Models: Training on Knowledge Graphs Enables Transferability to General GraphsKai Wang, Siqiang Luo, Caihua Shan, Yifei ShenNeurIPS 2025 · 5 citations
Builds on36
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
- An Image is Worth 16x16 Words: Transformers for Image Recognition at ScaleAlexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn et al.ICLR 2021 · 21,477 citations
- Strategies for Pre-training Graph Neural NetworksWeihua Hu, Bowen Liu, Joseph Gomes, Marinka Zitnik et al.ICLR 2020 · 1,744 citations
- Self-Supervised Graph Transformer on Large-Scale Molecular DataYu Rong, Yatao Bian, Tingyang Xu, Weiyang Xie et al.NeurIPS 2020 · 1,113 citations
- Composition-based Multi-Relational Graph Convolutional NetworksShikhar Vashishth, Soumya Sanyal, Vikram Nitin, Partha P. TalukdarICLR 2020 · 1,105 citations
Related papers
- Towards Foundation Models for Knowledge Graph ReasoningMikhail Galkin, Xinyu Yuan, Hesham Mostafa, Jian Tang et al.ICLR 2024 · 95 citations
- Knowledge Reasoning Language Model: Unifying Knowledge and Language for Inductive Knowledge Graph ReasoningXingrui Zhuo, Jiapu Wang, Gongqing Wu, Zhongyuan Wang et al.ICLR 2026 · 2 citations
- A Foundation Model for Zero-shot Logical Query ReasoningMichael Galkin, Jincheng Zhou, Bruno Ribeiro, Jian Tang et al.NeurIPS 2024 · 20 citations
- PRODIGY: Enabling In-context Learning Over GraphsQian Huang, Hongyu Ren, Peng Chen, Gregor Krzmanc et al.NeurIPS 2023 · 131 citations
- Modality-free Graph In-context AlignmentWei Zhuo, Siqiang LuoICLR 2026 · 2 citations
