HyperAIHyperAI

Command Palette

Search for a command to run...

5 months ago

Query2box: Reasoning over Knowledge Graphs in Vector Space using Box Embeddings

Hongyu Ren; Weihua Hu; Jure Leskovec

Query2box: Reasoning over Knowledge Graphs in Vector Space using Box Embeddings

Abstract

Answering complex logical queries on large-scale incomplete knowledge graphs (KGs) is a fundamental yet challenging task. Recently, a promising approach to this problem has been to embed KG entities as well as the query into a vector space such that entities that answer the query are embedded close to the query. However, prior work models queries as single points in the vector space, which is problematic because a complex query represents a potentially large set of its answer entities, but it is unclear how such a set can be represented as a single point. Furthermore, prior work can only handle queries that use conjunctions ($\wedge$) and existential quantifiers ($\exists$). Handling queries with logical disjunctions ($\vee$) remains an open problem. Here we propose query2box, an embedding-based framework for reasoning over arbitrary queries with $\wedge$, $\vee$, and $\exists$ operators in massive and incomplete KGs. Our main insight is that queries can be embedded as boxes (i.e., hyper-rectangles), where a set of points inside the box corresponds to a set of answer entities of the query. We show that conjunctions can be naturally represented as intersections of boxes and also prove a negative result that handling disjunctions would require embedding with dimension proportional to the number of KG entities. However, we show that by transforming queries into a Disjunctive Normal Form, query2box is capable of handling arbitrary logical queries with $\wedge$, $\vee$, $\exists$ in a scalable manner. We demonstrate the effectiveness of query2box on three large KGs and show that query2box achieves up to 25% relative improvement over the state of the art.

Code Repositories

snap-stanford/KGReasoning
pytorch
Mentioned in GitHub
pminervini/kgreasoning
pytorch
Mentioned in GitHub
Blidge/KGReasoning
pytorch
Mentioned in GitHub
francoisluus/KGReasoning
pytorch
Mentioned in GitHub
kjh9503/caqr
pytorch
Mentioned in GitHub
hkust-knowcomp/efo-1-qa-benchmark
pytorch
Mentioned in GitHub
Jacfger/simple-stuffs
pytorch
Mentioned in GitHub
hyren/query2box
Official
pytorch
LHY-24/KG-Compilation
pytorch
Mentioned in GitHub

Benchmarks

BenchmarkMethodologyMetrics
complex-query-answering-on-fb15kQ2B
MRR 1p: 0.68
MRR 2i: 0.551
MRR 2p: 0.21
MRR 2u: 0.351
MRR 3i: 0.665
MRR 3p: 0.142
MRR ip: 0.261
MRR pi: 0.394
MRR up: 0.167
complex-query-answering-on-fb15k-237Q2B
MRR 1p: 0.406
MRR 2i: 0.295
MRR 2p: 0.094
MRR 2u: 0.113
MRR 3i: 0.423
MRR 3p: 0.068
MRR ip: 0.126
MRR pi: 0.212
MRR up: 0.076
complex-query-answering-on-nell-995Q2B
MRR 1p: 0.422
MRR 2i: 0.333
MRR 2p: 0.140
MRR 2u: 0.113
MRR 3i: 0.445
MRR 3p: 0.112
MRR ip: 0.168
MRR pi: 0.224
MRR up: 0.1103

Build AI with AI

From idea to launch — accelerate your AI development with free AI co-coding, out-of-the-box environment and best price of GPUs.

AI Co-coding
Ready-to-use GPUs
Best Pricing
Get Started

Hyper Newsletters

Subscribe to our latest updates
We will deliver the latest updates of the week to your inbox at nine o'clock every Monday morning
Powered by MailChimp
Query2box: Reasoning over Knowledge Graphs in Vector Space using Box Embeddings | Papers | HyperAI