Lune

NeurIPS2024Top-tier venue

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 Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

10 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Towards Graph Foundation Models: Training on Knowledge Graphs Enables Transferability to General Graphs cites Composition-based Multi-Relational Graph Convolutional Networks
  • Flock: A Knowledge Graph Foundation Model via Learning on Random Walks cites Composition-based Multi-Relational Graph Convolutional Networks
  • An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale cites Language Models are Few-Shot Learners
  • HYPER: A Foundation Model for Inductive Link Prediction with Knowledge Hypergraphs cites Composition-based Multi-Relational Graph Convolutional Networks
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers10

  1. HYPER: A Foundation Model for Inductive Link Prediction with Knowledge HypergraphsXingyue Huang, Mikhail Galkin, Michael M. Bronstein, Ismail Ilkan CeylanICLR 2026 · 12 citations
  2. 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
  3. Flock: A Knowledge Graph Foundation Model via Learning on Random WalksJinwoo Kim, Xingyue Huang, Krzysztof Olejniczak, Kyungbin Min et al.ICLR 2026 · 8 citations
  4. 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
  5. Towards Graph Foundation Models: Training on Knowledge Graphs Enables Transferability to General GraphsKai Wang, Siqiang Luo, Caihua Shan, Yifei ShenNeurIPS 2025 · 5 citations

Builds on37

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
  2. 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
  3. Strategies for Pre-training Graph Neural NetworksWeihua Hu, Bowen Liu, Joseph Gomes, Marinka Zitnik et al.ICLR 2020 · 1,744 citations
  4. Self-Supervised Graph Transformer on Large-Scale Molecular DataYu Rong, Yatao Bian, Tingyang Xu, Weiyang Xie et al.NeurIPS 2020 · 1,113 citations
  5. Composition-based Multi-Relational Graph Convolutional NetworksShikhar Vashishth, Soumya Sanyal, Vikram Nitin, Partha P. TalukdarICLR 2020 · 1,105 citations

Related papers

  1. Towards Foundation Models for Knowledge Graph ReasoningMikhail Galkin, Xinyu Yuan, Hesham Mostafa, Jian Tang et al.ICLR 2024 · 95 citations
  2. 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
  3. A Foundation Model for Zero-shot Logical Query ReasoningMichael Galkin, Jincheng Zhou, Bruno Ribeiro, Jian Tang et al.NeurIPS 2024 · 20 citations
  4. PRODIGY: Enabling In-context Learning Over GraphsQian Huang, Hongyu Ren, Peng Chen, Gregor Krzmanc et al.NeurIPS 2023 · 131 citations
  5. Modality-free Graph In-context AlignmentWei Zhuo, Siqiang LuoICLR 2026 · 2 citations
Dusk over the sea between two cliffs drawn in fine vertical lines