Skip to main content
Back

OMNIA Recovers Missing AI Knowledge Graph Facts With 23-Point F1 Gain

A two-stage pipeline clusters entities by relational context, filters candidates with embeddings, then uses an LLM to validate missing knowledge graph triples.

Pro

  • OMNIA is a two-stage pipeline for completing knowledge graphs built by LLMs, using only the internal graph.
  • It clusters head entities sharing the same (relation, tail) pairs to generate candidate missing triples.
  • Candidates are filtered with a TransE embedding model and validated by Mistral-7B via zero-shot, few-shot, or RAG prompts.
  • F1-score gains reach 23 points on CoDEx-M, 12 on FB15k-237, and 10 on WN18RR over strong baselines.
  • On a CoDEx-M sample, OMNIA generates 1,400x fewer candidates than exhaustive search, in 10 minutes vs 2 hours.
  • Code is available at github.com/fieng94/OMNIA; struggles on very sparse graphs.

Knowledge graphs built by large language models tend to leak facts. The model reads a sentence, extracts a couple of triples, and quietly drops the rest. A new method called OMNIA tries to plug those holes without going back to the source text, using only what is already in the graph plus an LLM as a semantic judge at the end.

The paper reports F1-score gains of up to 23 percentage points over strong embedding baselines on standard knowledge graph completion benchmarks, and the authors have released the code on GitHub. The core idea is simple enough to describe in a sentence: entities that share the same (relation, tail) pairs probably behave the same way, so use that regularity to propose the triples the extractor missed.

The hole in LLM-generated graphs

Knowledge graphs store facts as triples of the form (head, relation, tail), for example (Probiotics, Prevents, Covid-19 infection). Automatic construction of KGs, especially with LLMs, often produces incomplete or noisy outputs, and existing completion methods pick one side of a tradeoff. Traditional embedding models like TransE or ComplEx capture graph structure but ignore the meaning of entity names. LLM-based approaches understand the semantics but typically need external text corpora and lose the structural signal already present in the graph.

The authors motivate the problem with a COVID-19 KG built from the COVID-Fact dataset using GPT-4. From a sentence about the FDA approving chloroquine for COVID-19 treatment, the extractor produced triples like (remdesivir, inhibits, 2019-ncov) and (chloroquine, inhibits, 2019-ncov), but silently dropped (chloroquine, treats, sars-cov-2), even though the source text clearly entails it.

COVID-19 knowledge graph showing extracted triples and a missing triple between chloroquine and SARS-CoV-2

Clusters, embeddings, and an LLM referee

OMNIA runs in two stages. The first generates candidate missing triples by exploiting structural regularities. The second validates those candidates, first cheaply with an embedding model, then expensively with an LLM.

The clustering step is deliberately unfancy. For every triple (h, r, t) in the graph, OMNIA uses the pair (r, t) as a dictionary key and appends h to the corresponding bucket. Every head entity that appears with the same relation and the same tail lands in the same cluster. Then, within each cluster, every head is combined with every (relation, tail) pair observed for its cluster-mates. If chloroquine and remdesivir both appear as heads for (inhibits, 2019-ncov), and remdesivir also participates in (treats, sars-cov-2), then (chloroquine, treats, sars-cov-2) becomes a candidate.

OMNIA pipeline diagram from input knowledge graph through clustering, candidate generation, embedding filtering, and LLM validation

This is nowhere near exhaustive, and that is the point. On a CoDEx-M sample, an exhaustive head times relation times tail enumeration would produce nearly 13 billion candidate triples and require roughly 2.6 terabytes of RAM across 10 processes for about two hours of runtime. OMNIA generates around 9 million candidates on the same sample, roughly 1,400 times fewer, in about 10 minutes on a single process with 8 GB of RAM, while still recovering 70.65 percent of the known missing triples.

The validation stage has two filters. First, a TransE model trained on the observed graph scores each candidate by how close h + r sits to t in embedding space, and candidates above a distance threshold are dropped. On CoDEx-M this cuts the candidate set by 71 percent. Second, the surviving candidates are handed to Mistral-7B as a triple classifier under one of three prompting regimes:

  • Zero-shot: the model sees only the candidate triple or its sentence form.
  • Few-shot / in-context: the prompt includes related triples that share a head, relation, or tail.
  • Retrieval-augmented generation: semantically similar triples are pulled from a FAISS index over MPNet embeddings and injected as context.

Each candidate can be presented as a raw triple or rewritten into a natural language sentence by the LLM. The authors note that without an explicit prompt telling it otherwise, the model rewrites 8 percent of invalid triples into grammatically valid sentences, quietly fixing the fact it was supposed to judge.

What the numbers say

OMNIA was tested on CoDEx-M, FB15k-237, WN18RR, and a private Socio-Economic KG generated by an LLM. Ground truth was simulated by removing 20 percent of triples at random and treating them as the missing set. Baselines include TransE, DistMult, ComplEx, RotatE, KG-BERT, and the LLM-based MuKDC.

MethodFB15k-237CoDEx-MWN18RRSocio-Economic
TransE0.740.680.680.72
DistMult0.670.670.770.74
KG-BERT0.570.540.620.73
MuKDC (LLM)0.190.270.230.22
OMNIA (RAG, triples)0.860.840.870.58
OMNIA (RAG, sentences)0.850.910.720.68

The RAG variant consistently wins on the dense encyclopedic and lexical graphs. Sentence-based prompting beats triple-based on CoDEx-M and Socio-Economic, but triple-based wins on WN18RR because its entity identifiers look like theophrastaceae.n.01, which confuses the sentence rewriter. Top-k for RAG peaks between 2 and 4 retrieved neighbors, then drops sharply as more context dilutes the signal.

Where it breaks

The Socio-Economic dataset is the interesting failure. It is sparse, with 33,563 entities and 17,175 relations spread across only 64,417 triples. Because OMNIA relies on multiple head entities sharing the same (relation, tail) key, sparse graphs give it very little to cluster. Candidate recall on that dataset drops to 9.6 percent, versus 97 percent on the full CoDEx-M. When the authors densified a subset so each entity and relation appears at least three times, recovery jumped from 9.6 percent to 30 percent.

Compute cost is the other tradeoff. Traditional embedding baselines train and score in under a minute on 50,000 triples. OMNIA is meaningfully slower because LLM inference dominates, though the paper notes candidate generation is offline and the LLM validation step trivially parallelizes across machines.

Why this matters if you build KGs

Most KG completion work still assumes a clean, closed-world benchmark like FB15k-237. Real pipelines that use GPT-4 or Claude to extract triples from documents produce graphs that look nothing like those benchmarks, with implicit facts scattered across the source that never made it into a triple. OMNIA is a practical recipe for that setting: cluster to bound the search space, use a cheap embedding filter to prune, and reserve the LLM for the small subset of candidates where semantics actually matters. It also avoids re-reading the source corpus, which is often unavailable or too expensive to reprocess.

The design is modular by construction. The TransE filter can be swapped for any embedding model, and Mistral-7B can be replaced by any instruction-tuned LLM. For anyone maintaining a domain-specific KG built by extraction from text, that decoupling is probably more valuable than the specific F1 numbers.