Effective negative sampling for knowledge graph embedding (KGE) requires balancing three competing objectives: hardness, diversity, and the risk of sampling unobserved true facts. Uniform sampling provides broad coverage but often generates uninformative negatives, whereas hard-negative mining can reduce diversity and increase false-negative risk. We introduce FlowNeg, a context-conditioned hierarchical generative flow network that first selects a relation-compatible entity type and then samples an entity. FlowNeg learns a reward-proportional sampling distribution that favors challenging negatives while discounting structurally plausible false negatives, without explicitly evaluating rewards over all eligible entities. We theoretically characterize the target distribution under exact trajectory balance and bound deviations under approximate balance. Across 15 paired seeds with shared type support and equal search budgets, FlowNeg improves RotatE's mean reciprocal rank (MRR) over typed EMU by 0.0050 on FB15k-237 and 0.0030 on WN18RR, while comparisons with DANS-KGC and CoDiSS adaptations remain inconclusive. On both benchmarks, the paired 95\% confidence intervals for MRR differences between trajectory balance and each of maximum-entropy reinforcement learning and weighted likelihood included zero. On three larger knowledge graphs, FlowNeg achieves higher MRR than EMU within a 24-hour budget, at the cost of lower throughput and increased GPU memory usage.
翻译:暂无翻译