高级检索

    基于对比学习的图结构规则学习算法

    Graph Structure Rule Learning via Contrastive Learning

    • 摘要: 知识图谱推理因其能够有效缓解知识图谱中的数据不完整问题而受到广泛关注。现有方法多依赖于嵌入模型或链式规则,但在可解释性与表达能力方面仍存在明显局限。一方面,基于闭合路径的规则学习仅能建模线性链式依赖,难以捕捉图结构中存在的多路径交互与层次化语义关系;另一方面,基于统计指标的传统方法通常采用“穷举+验证”策略,不仅在大规模图谱中面临高昂计算成本,也难以充分挖掘规则间的深层语义关联,从而制约了推理性能的进一步提升。为此,本文提出一种基于对比学习的图结构规则学习算法 CGRL(Contrastive Graph Rule Learning),以同时提升推理的表达能力与可解释性。CGRL 通过三重机制实现高效规则学习:首先,采用自适应聚类策略为节点生成软标签,引入类别语义以增强规则泛化能力;其次,设计多跳邻域采样方法构建语义子图,并生成高质量正负规则样本;最后,利用基于 Transformer 的编码器学习规则表示,并通过对比学习将规则对映射至统一向量空间以优化语义一致性判别。在六个公开知识图谱补全任务上的实验结果表明,CGRL 取得了显著性能提升。在复杂场景下,其MRR 指标平均提升 8.74\%,Hit@1 指标平均提升 16.265\%,显著优于现有基线方法,验证了其在学习高质量图结构规则与提升推理效果方面的有效性。

       

      Abstract: Knowledge graph reasoning has attracted extensive attention because of its ability to alleviate the inherent incompleteness of knowledge graphs. However, existing approaches still face significant limitations in both expressiveness and interpretability. Embedding-based approaches often focus on chain-based rules instead of graph-structured rules, while traditional rule-mining techniques rely heavily on the “enumeration–verification” paradigm, which is computationally expensive on large-scale graphs and struggles to capture deep semantic correlations among rules. To address these challenges, we propose CGRL (Contrastive Graph Rule Learning), a novel framework for learning graph-structured rules through contrastive learning. CGRL enhances rule learning through a threefold mechanism. First, it applies an adaptive clustering strategy to generate soft type labels for entities, introducing semantic priors that improve rule generalization. Second, it designs a multi-hop neighborhood sampling method to construct semantic subgraphs and to generate high-quality positive and negative rule instances. Third, it employs a Transformer-based encoder and a contrastive learning objective to map rule pairs into a unified embedding space, thereby jointly capturing structural dependencies and semantic consistency. Extensive experiments on six public knowledge graph completion benchmarks demonstrate that CGRL achieves substantial improvements over state-of-the-art baselines. On the more complex datasets, CGRL yields average gains of 8.74% in MRR and 16.27% in Hit@1, confirming its effectiveness in discovering high-quality graph-structured rules and significantly enhancing reasoning performance.

       

    /

    返回文章
    返回