arXiv:2409.12865cs.AI2024-09ICML被引 11

用Transformer重构知识图谱推理,解决路径方法的遗漏与信息压缩问题

KnowFormer: Revisiting Transformers for Knowledge Graph Reasoning

  • 基于查询原型设计注意力机制,实现结构化推理
  • 在跨域和归纳任务上优于主流基线方法
  • 适合需要精准关系推理的AI系统开发者

知识图谱推理在诸多应用中至关重要,近期基于路径的方法取得了显著进展。然而,这些方法受限于消息传递神经网络的缺陷,如路径缺失和信息过压缩。本文重新审视Transformer在知识图谱推理中的应用,提出新方法KnowFormer。该方法从消息传递视角出发,利用Transformer架构进行推理,而非依赖预训练语言模型的文本信息。我们基于知识图谱推理的查询原型定义注意力计算,便于构建与高效优化。为融合结构信息,引入结构感知模块分别计算查询、键和值。此外,提出高效的注意力计算方式以提升可扩展性。实验表明,KnowFormer在跨域与归纳基准测试中均优于主流基线方法。

原文摘要 · Abstract (English)

Knowledge graph reasoning plays a vital role in various applications and has garnered considerable attention. Recently, path-based methods have achieved impressive performance. However, they may face limitations stemming from constraints in message-passing neural networks, such as missing paths and information over-squashing. In this paper, we revisit the application of transformers for knowledge graph reasoning to address the constraints faced by path-based methods and propose a novel method KnowFormer. KnowFormer utilizes a transformer architecture to perform reasoning on knowledge graphs from the message-passing perspective, rather than reasoning by textual information like previous pretrained language model based methods. Specifically, we define the attention computation based on the query prototype of knowledge graph reasoning, facilitating convenient construction and efficient optimization. To incorporate structural information into the self-attention mechanism, we introduce structure-aware modules to calculate query, key, and value respectively. Additionally, we present an efficient attention computation method for better scalability. Experimental results demonstrate the superior performance of KnowFormer compared to prominent baseline methods on both transductive and inductive benchmarks.

知识图谱Transformer推理

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。