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

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

14 Feb 2020ICLR 2020 1arXiv:2002.05969archive 2025-07-28

Hongyu Ren, Weihua Hu, Jure Leskovec

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 (∧) and existential quantifiers (∃). Handling queries with logical disjunctions (∨) remains an open problem. Here we propose query2box, an embedding-based framework for reasoning over arbitrary queries with ∧, ∨, and ∃ 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 ∧, ∨, ∃ 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.

PaperPDFConference PDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2002.05969")

Code

Syntology Ran 30 of 41 code samples harvested from 6 repositories linked to this paper; 11 have no recorded run. Of those that ran: 1 ran · honoured contract; 11 ran · our draft was wrong; 1 ran · fixture could not drive it; 17 ran with no contract checked.

By repository: official repository: 8 samples from 1 repository, 7 ran; community (archive-listed): 33 samples from 5 repositories, 23 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

hyren/query2box officialpytorch report
Blidge/KGReasoning mentioned on GitHubpytorch report
Jacfger/simple-stuffs mentioned on GitHubpytorch report
LHY-24/KG-Compilation mentioned on GitHubpytorch report
francoisluus/KGReasoning mentioned on GitHubpytorch report
hkust-knowcomp/efo-1-qa-benchmark mentioned on GitHubpytorchMIT report
kjh9503/caqr mentioned on GitHubpytorch report
pminervini/kgreasoning mentioned on GitHubpytorch report
snap-stanford/KGReasoning mentioned on GitHubpytorchMIT report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

41 samples harvested; 30 ran; 1 honoured the contract we drafted; 11 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran · honoured contract
11ran · our draft was wrong
1ran · fixture could not drive it
17ran
11unverified

Licence: 2 of the 41 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 6 repositories linked to this paper, official or community; each sample names its own and says which. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

Attention hyren/query2box/codes/model.py official repository ran MIT (permissive) · 2575bb19d82fba6d · report
AttentionSet hyren/query2box/codes/model.py official repository ran MIT (permissive) · e519b1988ee37a5a · report
CenterSet hyren/query2box/codes/model.py official repository ran MIT (permissive) · e6cd914f1f66ce76 · report
InductiveOffsetSet hyren/query2box/codes/model.py official repository ran MIT (permissive) · 23039ea2b760df60 · report
MeanSet hyren/query2box/codes/model.py official repository ran MIT (permissive) · c14351660e82d6b2 · report
MinSet hyren/query2box/codes/model.py official repository ran MIT (permissive) · 060a24b37fb8ba59 · report
OffsetSet hyren/query2box/codes/model.py official repository ran MIT (permissive) · 11bb0cf115a0240f · report
Query2box hyren/query2box/codes/model.py official repository unverified MIT (permissive) · 5cf4606d614eb571 · report
BetaIntersection francoisluus/KGReasoning/models.py community (archive-listed) ran MIT (permissive) · 956e9a56d057daa5 · report
BetaProjection francoisluus/KGReasoning/models.py community (archive-listed) ran MIT (permissive) · c16d861762f8696c · report
BoxEstimator Jacfger/simple-stuffs/fol/estimator_box.py community (archive-listed) ran MIT (permissive) · 2a211e2e73b1cbde · report
BoxOffsetIntersection francoisluus/KGReasoning/models.py community (archive-listed) ran MIT (permissive) · 47268ecee02ceb4f · report
BoxOffsetIntersection Jacfger/simple-stuffs/fol/estimator_box.py community (archive-listed) ran MIT (permissive) · c839f4122028b419 · report
CenterIntersection francoisluus/KGReasoning/models.py community (archive-listed) ran MIT (permissive) · a2ccec473702f3c7 · report
CenterIntersection Jacfger/simple-stuffs/fol/estimator_box.py community (archive-listed) ran MIT (permissive) · 5c301bc69f133009 · report
Identity kjh9503/caqr/CaQR/betae/models.py community (archive-listed) ran · honoured contract fingerprinted no licence file found · pointer only · f44985272d18127a · report
LogicIntersection francoisluus/KGReasoning/models.py community (archive-listed) ran MIT (permissive) · 47248dd2646c39bd · report
LogicProjection francoisluus/KGReasoning/models.py community (archive-listed) ran MIT (permissive) · 25d6c06688daacdd · report
SizePredict francoisluus/KGReasoning/models.py community (archive-listed) ran MIT (permissive) · 2a2b3c074a6a00b5 · report
find_optimal_batch Jacfger/simple-stuffs/fol/estimator_box.py community (archive-listed) ran · fixture could not drive it MIT (permissive) · d8b0a4e3912306de · report
flatten_structure Blidge/KGReasoning/models.py community (archive-listed) ran · our draft was wrong MIT (permissive) · d7c6b03fd8f6a3bc · report
inclusion_sampling Jacfger/simple-stuffs/fol/estimator_box.py community (archive-listed) ran · our draft was wrong MIT (permissive) · c423c8497887b2c3 · report
order_bounds francoisluus/KGReasoning/models.py community (archive-listed) ran · our draft was wrong fingerprinted MIT (permissive) · 6df8d7def6d8b856 · report
query_2p Blidge/KGReasoning/models.py community (archive-listed) ran · our draft was wrong MIT (permissive) · c347b52e0b2d0f36 · report
query_3i Blidge/KGReasoning/models.py community (archive-listed) ran · our draft was wrong MIT (permissive) · 52f5e28fee4638ab · report
query_3p Blidge/KGReasoning/models.py community (archive-listed) ran · our draft was wrong MIT (permissive) · 805d2b1bc7c0dc90 · report
query_pi Blidge/KGReasoning/models.py community (archive-listed) ran · our draft was wrong MIT (permissive) · 51a131fbee1009cf · report
query_to_atoms Blidge/KGReasoning/models.py community (archive-listed) ran · our draft was wrong MIT (permissive) · bc5f262d753a9eb4 · report
query_up_dnf Blidge/KGReasoning/models.py community (archive-listed) ran · our draft was wrong MIT (permissive) · 02f4d333d76fc417 · report
score_candidates Blidge/KGReasoning/models.py community (archive-listed) ran · our draft was wrong MIT (permissive) · b97e0b8fe06b9171 · report
valclamp francoisluus/KGReasoning/models.py community (archive-listed) ran · our draft was wrong MIT (permissive) · 51d9d0e0413cd046 · report
AppFOQEstimator Jacfger/simple-stuffs/fol/estimator_box.py community (archive-listed) unverified MIT (permissive) · b8322293c1e3a4ac · report
CQD Blidge/KGReasoning/models.py community (archive-listed) unverified MIT (permissive) · 9b8c70940dfe67a9 · report
KGReasoning francoisluus/KGReasoning/models.py community (archive-listed) unverified MIT (permissive) · 87b741616782eced · report
KGReasoning Blidge/KGReasoning/models.py community (archive-listed) unverified MIT (permissive) · 61e00b75af63ddec · report
KGReasoning LHY-24/KG-Compilation/src/models.py community (archive-listed) unverified no licence file found · pointer only · 823b93b900c73ef8 · report
N3 Blidge/KGReasoning/models.py community (archive-listed) unverified MIT (permissive) · 13dc0495d6916564 · report
query_1p Blidge/KGReasoning/models.py community (archive-listed) unverified MIT (permissive) · 38511adc942a62d6 · report
query_2i Blidge/KGReasoning/models.py community (archive-listed) unverified MIT (permissive) · b821d97259813ae4 · report
query_2u_dnf Blidge/KGReasoning/models.py community (archive-listed) unverified MIT (permissive) · c5eb44c00d8b7df8 · report
query_ip Blidge/KGReasoning/models.py community (archive-listed) unverified MIT (permissive) · 2493b517068163e8 · report

Tasks

Complex Query AnsweringKnowledge Graphs

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Complex Query Answering FB15k Q2B MRR 1p 0.68 #5 of 9 Archive leaderboard report
Complex Query Answering FB15k Q2B MRR 2i 0.551 #5 of 9 Archive leaderboard report
Complex Query Answering FB15k Q2B MRR 2p 0.21 #5 of 9 Archive leaderboard report
Complex Query Answering FB15k Q2B MRR 2u 0.351 #5 of 9 Archive leaderboard report
Complex Query Answering FB15k Q2B MRR 3i 0.665 #5 of 9 Archive leaderboard report
Complex Query Answering FB15k Q2B MRR 3p 0.142 #5 of 9 Archive leaderboard report
Complex Query Answering FB15k Q2B MRR ip 0.261 #5 of 9 Archive leaderboard report
Complex Query Answering FB15k Q2B MRR pi 0.394 #5 of 9 Archive leaderboard report
Complex Query Answering FB15k Q2B MRR up 0.167 #5 of 9 Archive leaderboard report
Complex Query Answering FB15k-237 Q2B MRR 1p 0.406 #4 of 9 Archive leaderboard report
Complex Query Answering FB15k-237 Q2B MRR 2i 0.295 #4 of 9 Archive leaderboard report
Complex Query Answering FB15k-237 Q2B MRR 2p 0.094 #4 of 9 Archive leaderboard report
Complex Query Answering FB15k-237 Q2B MRR 2u 0.113 #4 of 9 Archive leaderboard report
Complex Query Answering FB15k-237 Q2B MRR 3i 0.423 #4 of 9 Archive leaderboard report
Complex Query Answering FB15k-237 Q2B MRR 3p 0.068 #4 of 9 Archive leaderboard report
Complex Query Answering FB15k-237 Q2B MRR ip 0.126 #4 of 9 Archive leaderboard report
Complex Query Answering FB15k-237 Q2B MRR pi 0.212 #4 of 9 Archive leaderboard report
Complex Query Answering FB15k-237 Q2B MRR up 0.076 #4 of 9 Archive leaderboard report
Complex Query Answering NELL-995 Q2B MRR 1p 0.422 #6 of 6 Archive leaderboard report
Complex Query Answering NELL-995 Q2B MRR 2i 0.333 #6 of 6 Archive leaderboard report
Complex Query Answering NELL-995 Q2B MRR 2p 0.140 #6 of 6 Archive leaderboard report
Complex Query Answering NELL-995 Q2B MRR 2u 0.113 #6 of 6 Archive leaderboard report
Complex Query Answering NELL-995 Q2B MRR 3i 0.445 #6 of 6 Archive leaderboard report
Complex Query Answering NELL-995 Q2B MRR 3p 0.112 #6 of 6 Archive leaderboard report
Complex Query Answering NELL-995 Q2B MRR ip 0.168 #6 of 6 Archive leaderboard report
Complex Query Answering NELL-995 Q2B MRR pi 0.224 #6 of 6 Archive leaderboard report
Complex Query Answering NELL-995 Q2B MRR up 0.1103 #6 of 6 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections