cs.CLApr 14, 2026

Learning Chain Of Thoughts Prompts for Predicting Entities, Relations, and even Literals on Knowledge Graphs

Authors: Alkid Baci, Luke Friedrichs, Caglar Demir, N'Dah Jean Kouagou, Axel-Cyrille Ngonga Ngomo

Organizations: Department of Computer Science Paderborn University Warburger Str. 100, 33098 Paderborn, Germany

Abstract

Knowledge graph embedding (KGE) models perform well on link prediction but struggle with unseen entities, relations, and especially literals, limiting their use in dynamic, heterogeneous graphs. In contrast, pretrained large language models (LLMs) generalize effectively through prompting. We reformulate link prediction as a prompt learning problem and introduce RALP, which learns string-based chain-of-thought (CoT) prompts as scoring functions for triples. Using Bayesian Optimization through MIPRO algorithm, RALP identifies effective prompts from fewer than 30 training examples without gradient access. At inference, RALP predicts missing entities, relations or whole triples and assigns confidence scores based on the learned prompt. We evaluate on transductive, numerical, and OWL instance retrieval benchmarks. RALP improves state-of-the-art KGE models by over 5% MRR across datasets and enhances generalization via high-quality inferred triples. On OWL reasoning tasks with complex class expressions (e.g., ∃hasChild.Female\exists hasChild.Female, ≥5  hasChild.Female\geq 5 \; hasChild.Female), it achieves over 88% Jaccard similarity. These results highlight prompt-based LLM reasoning as a flexible alternative to embedding-based methods. We release our implementation, training, and evaluation pipeline as open source: https://github.com/dice-group/RALP .

Figures & tables

Explore similar work

CardsList
  1. RADAR: Reasoning as Discrimination with Aligned Representations for LLM-based Knowledge Graph Reasoning

    Feb 25, 2026Bo Xue, Yuan Jin, Luoyi Fu +2Graph ReasoningKG Completion

  2. Predicate Importance Estimation and Decoupled Rationale-Score Distillation for Entity Alignment

    Jun 22, 2026Keunha Kim, Yoonjin Jang, Hyeon-gu Lee +2KG EmbeddingKnowledge Graphs

  3. Code-on-Graph: Iterative Programmatic Reasoning via Large Language Models on Knowledge Graphs

    Jun 2, 2026Weiwei Ding, Zixuan Li, Long Bai +7LLM GroundingLLM Reasoning with Graphs