arXiv:2608.23849cs.LGAug 2026

Manuscript Offprint

arXiv:2608.23849

FlowNeg: GFlowNet-Guided Diverse Hard Negative Sampling for Knowledge Graph Embedding

Ibne Farabi Shihab, Naoshin Anzum Hridi, Joyanta Jyoti Mondal

Abstract

Negative sampling determines whether a knowledge graph embedding (KGE) model learns from informative counterexamples or wastes updates on implausible corruptions. Uniform negatives are diverse but easy, whereas hard-negative miners concentrate on few entities and collide more with held-out positives. We introduce FlowNeg, a context-conditioned hierarchical generative flow network that amortizes reward-proportional sampling without normalizing a composite reward over the entity set: given a positive triple and corruption side, it selects a type, then an entity. Its terminal reward combines bounded model-based hardness with a training-only structural score for held-out-positive collision, over a relation-specific type-compatible support. We derive the reward, specialize standard trajectory balance, and bound multiplicatively how residual imbalance perturbs terminal and mode probability. Across a descriptive five-seed grid of five architectures and five benchmarks, FlowNeg has higher mean MRR than EMU and than IF-NS in 24 of 25 cells (+0.0172 and +0.0160 on average). A separate 15-seed FB15k-237/RotatE control fixing negative count, diagnostic budget, and compute gives FlowNeg 0.359±0.0010.359 \pm 0.001 MRR against 0.346±0.0020.346 \pm 0.002 for EMU, with near-uniform fixed-partition diversity, high gradient informativeness, and low collision. The evidence supports mode-covering negative generation without treating structural similarity as an open-world truth oracle.

1 Introduction

A knowledge graph records observed facts as triples (h,r,t)(h, r, t) but rarely records explicit falsehoods. Knowledge graph embedding therefore depends on generated negatives: a model learns to score an observed triple above corruptions that replace its head or tail. Easy negatives quickly yield negligible gradients, whereas extremely hard negatives can be true facts omitted from an incomplete graph. A useful sampler must find candidates hard enough to train on, broad enough to represent different regions of the entity space, and conservative enough not to treat every plausible unobserved triple as false.

Current approaches occupy different parts of this trade-off. Uniform corruption (Bordes et al., 2013) covers the entity set but becomes uninformative as training progresses (Yang et al., 2024). Self-adversarial weighting (Sun et al., 2019), caches (Zhang et al., 2019), structural pools (Ahrabian et al., 2020), and influence-based selection (Cai et al., 2025) improve hardness, yet their probability mass can narrow around candidates the model already prefers. Adversarial and mutation-based generators (Cai and Wang, 2018; Takamoto et al., 2025) likewise target difficulty without explicitly preserving several high-value regions or discounting likely contamination. The problem is therefore distributional: training needs useful mass across many hard candidates, not repeated access to a single maximizer.

Generative flow networks (GFlowNets) suit this distributional objective: given a non-negative reward, a well-trained GFlowNet targets terminal probability proportional to reward (Bengio et al., 2021; Malkin et al., 2022), so raising one candidate's reward need not drive every other informative candidate to zero probability. Constructing this target directly would require repeatedly normalizing the composite reward over the entity set. FlowNeg instead amortizes it from sampled terminal rewards and a learned context-dependent normalizer, using a hierarchical policy that selects a relation-compatible type and then an entity within it. The terminal reward is

R(e^∣x)=aθ(e^∣x)×(1−c^HPC(e^∣x))c(e^,r,s),\begin{align*}R(\hat{e}\mid\boldsymbol{x})&=a_{\theta}(\hat{e}\mid\boldsymbol{x})\\&\quad\times(1-\widehat{c}_{\mathrm{HPC}}(\hat{e}\mid\boldsymbol{x}))c(\hat{e},r,s),\end{align*}

(1)

where x=(h,r,t,s)x = (h, r, t, s) is the positive triple with corruption side s; the first two factors encode bounded hardness and structural collision risk, while c restricts the terminal support to role-compatible types rather than reweighting candidates within it. Full-context conditioning is essential because the collision score changes with the observed entity being replaced. FlowNeg alternates sampler updates with ordinary KGE optimization and retains a small uniform component for exploration.

The paper makes three connected contributions. Methodologically, it turns negative selection into context-conditioned reward-proportional generation with a common proposal interface for embedding models and SimKGC (Wang et al., 2022). Analytically, it derives Equation (1) as a conditional open-world surrogate, separates exact trajectory balance from its approximate-balance implication, and limits the coverage interpretation to a declared fixed partition. Empirically, it separates a descriptive five-seed grid, a 15-seed matched-k mechanism study, and a pre-specified 15-seed FlowNeg–Uniform analysis, exposing two small counterexamples while showing that the controlled gain over EMU persists at equal negative count and equal wall-clock checkpoints.

References (23)