arXiv:2608.30652cs.AI2026-08

为知识图谱嵌入提供模块化负采样框架,支持静态、动态和模式感知采样。

PyKEEN-NSX: A Modular Framework for Static, Dynamic and Schema-Aware Negative Sampling in PyKEEN

论文配图:PyKEEN-NSX: A Modular Framework for Static, Dynamic and Schema-Aware Negative Sampling in PyKEEN
图 1 · 摘自论文原文
  • 将负样本候选池生成与选择策略解耦,实现模块化设计
  • 在4个数据集上发现负样本数量常不足,依赖随机补充
  • 兼容现有PyKEEN流程,可灵活集成多种高级采样方法

嵌入方法因在知识图谱的链接预测和三元组分类任务中具备良好可扩展性而受到关注。嵌入模型依赖正负样本对进行训练,但知识图谱通常仅包含正向断言,负样本需通过负采样策略人工生成,从简单的随机扰动到利用结构、语义或嵌入信息的复杂方法不等。然而,先进负采样器的设计与实现仍具挑战性,因多数主流知识图谱嵌入(KGE)库仅支持基础策略,缺乏统一的开发框架。为此,我们提出PyKEEN-NSX,作为流行KGE框架PyKEEN的扩展,提供一种模块化的负采样工程抽象。该架构将基于显式上下文的候选负样本池生成与选择策略分离,支持在统一框架内开发静态、模式感知和动态采样方法。基于此抽象,我们实现了六个负采样器,并保持与现有PyKEEN工作流和管道完全兼容。作为概念验证,我们在四个数据集上研究负样本可用性,发现受限候选池经常低于所需负样本数量,导致编码标准在很大程度上被随机补全取代。

原文摘要 · Abstract (English)

Embedding methods have become popular due to their scalability on link prediction and/or triple classification tasks on Knowledge Graphs (KGs). Embedding models are trained relying on both positive and negative samples of triples. However, since KGs generally contain only positive assertions, negative samples are artificially generated through negative sampling strategies, ranging from simple random corruption to more sophisticated approaches that exploit structural, semantic, or embedding information. The design and implementation of advanced negative samplers remains challenging, as most popular Knowledge Graph Embedding (KGE) libraries provide support only for basic strategies and lack a unified framework for developing more advanced and customized solutions. To address this gap, we introduce PyKEEN-NSX, an extension of PyKEEN, the popular KGE framework, that provides a modular engineered abstraction for negative sampling. The proposed architecture separates the generation of candidate negative pools, conditioned on an explicit context, from the selection strategy, enabling the development and integration of static, schema-aware and dynamic approaches within a consistent framework. Based on this abstraction, we implement six negative samplers, while remaining fully compatible with existing PyKEEN workflows and pipelines. As a proof of concept, we study negative availability across four datasets, showing that constrained pools frequently fall below the requested number of negatives, so that the encoded criterion is to a large extent replaced by the random fallback that supplements them.

知识图谱负采样嵌入PyKEEN

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