Reasoning over knowledge graphs (KGs) with first-order logic (FOL) queries is challenging due to the inherent incompleteness of real-world KGs and the compositional complexity of logical query structures. Most existing methods rely on embedding entities and relations into continuous geometric spaces and answer queries via differentiable set operations. While effective for simple query patterns, these approaches often struggle to generalize to complex queries involving multiple operators, deeper reasoning chains, or heterogeneous KG schemas. We propose ROG (Reasoning Over knowledge Graphs with large language models), an ensemble-style framework that combines query-aware KG neighborhood retrieval with large language model (LLM)-based chain-of-thought reasoning. ROG decomposes complex FOL queries into sequences of simpler sub-queries, retrieves compact, query-relevant subgraphs as contextual evidence, and performs step-by-step logical inference using an LLM, avoiding the need for task-specific embedding optimization. Experiments on standard KG reasoning benchmarks demonstrate that ROG consistently outperforms strong embedding-based baselines in terms of mean reciprocal rank (MRR), with particularly notable gains on high-complexity query types. These results suggest that integrating structured KG retrieval with LLM-driven logical reasoning offers a robust and effective alternative for complex KG reasoning tasks.
翻译:在现实世界知识图谱固有的不完整性及逻辑查询结构组合复杂性的双重挑战下,基于一阶逻辑的知识图谱推理任务面临显著困难。现有方法大多通过将实体与关系嵌入连续几何空间,并借助可微集合运算进行查询应答。此类方法虽对简单查询模式有效,但在处理涉及多重运算符、深层推理链或异构知识图谱结构的复杂查询时,其泛化能力往往受限。本文提出ROG框架——一种集成式推理系统,通过融合查询感知的知识图谱邻域检索与大语言模型驱动的思维链推理机制,实现对复杂一阶逻辑查询的分解式处理。该框架将复杂查询解构为简单子查询序列,检索紧凑的查询相关子图作为上下文证据,并利用大语言模型进行逐步逻辑推演,从而规避了任务特定嵌入优化的需求。在标准知识图谱推理基准测试上的实验表明,ROG在平均倒数排名指标上持续优于基于嵌入的强基线方法,且在高度复杂查询类型上取得尤为显著的性能提升。这些结果证明:将结构化知识图谱检索与大语言模型驱动的逻辑推理相结合,为复杂知识图谱推理任务提供了稳健而有效的替代方案。