Papers › Query2box: Reasoning over Knowledge Graphs in Vector Space using Box Embeddings
Query2box: Reasoning over Knowledge Graphs in Vector Space using Box Embeddings
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.
In Syntology View this paper on Syntology, its page in Syntology's graph. That page adds which of its functions are also present in other papers' code Syntology holds, with dates, and its dated run record as JSON and a README badge. It also lists the repositories linked to the paper, the abstract and the calls for agents.
Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.
For agents, on Syntology's MCP service (how to connect):
get_harvested_code_for_paper(arxiv_id="2002.05969")get_code(code_sha256="…")with a sample'scode_sha256from the list belowget_citation_path(paper_1="2002.05969", paper_2="…")with another paper's arXiv id or titleget_concepts_for_paper(arxiv_id="2002.05969")
Code
Syntology 41 code samples harvested from 6 repositories linked to this paper: 30 ran (of which 13 constructed an object rather than computing a result; 18 with no instrument failure: 1 honoured, 0 violated, 17 with no contract checked; 12 where Syntology's instrument failed) · 11 unverified. Where Syntology's instrument failed: 11 where our contract draft was wrong; 1 where the contract check could not run; failures of Syntology's instrument, not of the code.
By repository: official repository: 8 samples from 1 repository, 7 ran (7 with no instrument failure; 0 where Syntology's instrument failed); community (archive-listed): 33 samples from 5 repositories, 23 ran (11 with no instrument failure; 12 where Syntology's instrument failed). The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.
No sample is linked to this paper from 2 of its repositories that Syntology harvested for other papers:
- hkust-knowcomp/efo-1-qa-benchmark, community (archive-listed): harvested for another paper, listed under the repository
- snap-stanford/KGReasoning, community (archive-listed): harvested for another paper, listed under the repository
Levels written between 2026-09-22 and 2026-09-24 (UTC): the dates Syntology's graph wrote each sample's verification level, not when the code executed. 1 of the 30 samples that ran has no recorded date.
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.
A paper named beside a repository with no sample linked to this paper is shown with that paper's own run record, not this paper's: “ran” means executed on a synthesized input, not that the code is correct, and “where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Papers are listed in arXiv-id order, at most three per repository.
Code Syntology ran Syntology
41 samples harvested: 30 ran (of which 13 constructed an object rather than computing a result; 18 with no instrument failure: 1 honoured, 0 violated, 17 with no contract checked; 12 where Syntology's instrument failed) · 11 unverified. “Where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Syntology's record for this page has not changed since , the first build that kept a record date for it; when this build read Syntology's graph is in the build record. That date is not when the samples ran.
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; the list below is grouped by repository, each group headed by its name and what it is to the paper. “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. A line beginning “fixture:” under a sample that ran gives the arguments Syntology's fixture called the sample with, each as name:type/rank/element kind (? where none was recorded), and the type of what the fixture's run returned, exactly as the harness recorded them; the arguments and the returned type were recorded by two separate runs of the same fixture. No output value is shown, and a returned type says nothing about whether the output was right. “Level recorded” gives the UTC date when Syntology's graph wrote the sample's verification level, not when the code executed; where the level was written before Syntology's graph kept that date, the row says “level recorded, date not recorded”. For 5 samples that ran, the graph records a signature this page does not show: for a class the fixture built without calling, the harness called the object with inputs it made up itself, so the recorded signature is the harness's probe, not the fixture's arguments. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself. “Our draft was wrong” and “the contract check could not run” are failures of Syntology's instrument, not of the code: the sample ran on Syntology's synthesized input, and then the drafted contract did not describe it, or the check itself raised an error (RAISES), lacked a dependency (DEP_MISSING) or ran out of time (TIMEOUT); hover the label for which. A metamorphic tier, where shown, is evidence of the output's shape, not that the sample implements the method.
Each sample ends with its code_sha256. A sample's code_sha256 is Syntology's identity for that exact code. It is printed in full (16 hexadecimal characters for every sample in this build), and get_code(code_sha256="…") takes it exactly as printed. An agent calls it on Syntology's MCP service (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 are grouped by repository: a repository marked official first, then by how directly the repository is tied to the paper, then in the archive's order; never by how many ran. 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 six 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; the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar); this paper's copy was not located, so its licence is not recorded; or this paper's copy is cleared, but the stored copy of the same code that Syntology serves is not. 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.
A function or class name links to its page when the name occurs in the harvested code of at least 5 papers; the name is a string, not an identity. A census tag appears when Syntology's census ran implementations with that name on one shared input per bucket: it gives how many were compared, from how many papers, and how many distinct outputs they produced, and names this sample's bucket when this sample was one of them.
census: 13 implementations from 12 papers, 10 distinct outputs across 4 buckets, one shared input per bucket codes/model.py ran MIT (permissive) ·
2575bb19d82fba6d · report
fixture: returned Attention · level recorded 2026-09-22 e519b1988ee37a5a · report
fixture: returned AttentionSet · level recorded 2026-09-22 e6cd914f1f66ce76 · report
fixture: returned CenterSet · level recorded 2026-09-22 23039ea2b760df60 · report
fixture: returned InductiveOffsetSet · level recorded 2026-09-22 c14351660e82d6b2 · report
fixture: signature embeds1:Tensor/2/float, embeds1_o:Tensor/2/float, embeds2:Tensor/2/float, embeds2_o:Tensor/2/float, embeds3:list/1/empty, embeds3_o:list/1/empty · returned Tensor · level recorded 2026-09-24 060a24b37fb8ba59 · report
fixture: signature embeds1:Tensor/2/float, embeds1_o:Tensor/2/float, embeds2:Tensor/2/float, embeds2_o:Tensor/2/float, embeds3:Tensor/2/float, embeds3_o:Tensor/2/float · returned Tensor · level recorded 2026-09-24 11bb0cf115a0240f · report
fixture: returned OffsetSet · level recorded 2026-09-22 d7c6b03fd8f6a3bc · report
fixture: signature query_structure:list/1/str · returned list · level recorded 2026-09-22 c347b52e0b2d0f36 · report
fixture: signature entity_embeddings:callable/0/?, predicate_embeddings:callable/0/?, queries:Tensor/2/int, scoring_function:callable/0/?, k:int/0/int, t_norm:callable/0/? · returned Tensor · level recorded 2026-09-22 52f5e28fee4638ab · report
fixture: signature entity_embeddings:callable/0/?, predicate_embeddings:callable/0/?, queries:Tensor/2/int, scoring_function:callable/0/?, t_norm:callable/0/? · returned Tensor · level recorded 2026-09-22 805d2b1bc7c0dc90 · report
fixture: signature entity_embeddings:callable/0/?, predicate_embeddings:callable/0/?, queries:Tensor/2/int, scoring_function:callable/0/?, k:int/0/int, t_norm:callable/0/? · returned Tensor · level recorded 2026-09-22 51a131fbee1009cf · report
fixture: signature entity_embeddings:callable/0/?, predicate_embeddings:callable/0/?, queries:Tensor/2/int, scoring_function:callable/0/?, k:int/0/int, t_norm:callable/0/? · returned Tensor · level recorded 2026-09-22 bc5f262d753a9eb4 · report
fixture: signature query_structure:list/1/list, flat_ids:Tensor/2/int · returned tuple · level recorded 2026-09-22 02f4d333d76fc417 · report
fixture: signature entity_embeddings:callable/0/?, predicate_embeddings:callable/0/?, queries:Tensor/2/int, scoring_function:callable/0/?, k:int/0/int, t_norm:callable/0/?, t_conorm:callable/0/? · returned Tensor · level recorded 2026-09-22 b97e0b8fe06b9171 · report
fixture: signature s_emb:Tensor/2/float, p_emb:Tensor/2/float, candidates_emb:Tensor/2/float, k:int/0/int, entity_embeddings:callable/0/?, scoring_function:callable/0/? · returned tuple · level recorded 2026-09-22 2a211e2e73b1cbde · report
fixture: returned BoxEstimator · level recorded 2026-09-22 c839f4122028b419 · report
fixture: returned BoxOffsetIntersection · level recorded 2026-09-22 5c301bc69f133009 · report
fixture: signature embeddings:Tensor/2/float · returned Tensor · level recorded 2026-09-24 d8b0a4e3912306de · report
fixture: signature answer_emb:Tensor/2/float, query_dist:Tensor/2/float, compute_logit:callable/0/?, union:bool/0/bool · returned int · level recorded 2026-09-22 c423c8497887b2c3 · report
fixture: signature answer_set:list/1/list, negative_size:int/0/int, entity_num:int/0/int, k:int/0/int, base_num:int/0/int · returned tuple · level recorded 2026-09-22 823b93b900c73ef8 · report
956e9a56d057daa5 · report
fixture: returned BetaIntersection · level recorded 2026-09-22 c16d861762f8696c · report
fixture: returned BetaProjection · level recorded 2026-09-22 47268ecee02ceb4f · report
fixture: signature embeddings:Tensor/2/float · returned Tensor · level recorded 2026-09-24 a2ccec473702f3c7 · report
fixture: returned CenterIntersection · level recorded 2026-09-22 47248dd2646c39bd · report
fixture: returned LogicIntersection · level recorded 2026-09-22 25d6c06688daacdd · report
fixture: returned LogicProjection · level recorded 2026-09-22 2a2b3c074a6a00b5 · report
fixture: returned SizePredict · level recorded 2026-09-22 6df8d7def6d8b856 · report
fixture: signature embedding:Tensor/2/float · returned Tensor · level recorded 2026-09-22 51d9d0e0413cd046 · report
fixture: signature x:Tensor/2/float, a:int/0/int, b:int/0/int, lo:int/0/int, hi:int/0/int · returned Tensor · level recorded 2026-09-22 census: 10 implementations from 13 papers, 4 distinct outputs across 4 buckets, one shared input per bucket this sample: bucket 1 of 4, arg 1: rank 2, kind float, dtype float32 CaQR/betae/models.py ran · honoured contract fingerprinted no licence file found · pointer only ·
f44985272d18127a · report
fixture: signature x:Tensor/2/float · returned Tensor · level recorded, date not recorded Method as code Syntology
What Syntology's graph records as this paper's claimed method, lifted into code: each assembly names its bricks (functions and classes), each with its own role and its own verification level. An assembly is not a check that the code implements the method correctly or reproduces the paper's results. Levels are each brick's own verification level in Syntology's graph (level 0: no recorded run), listed brick by brick and never combined into one level; “ran” means the brick executed on a synthesized input, not that its output is correct, and the instrument figure counts failures of Syntology's instrument, not of the code. Where a model read the code against the paper's claim, each assembly's label verdict is one model's judgement, kept in this page's JSON twin; it is not calibrated, so no card prints it. Siblings are assemblies lifted from this paper in the same batch for the same method: alternative readings kept side by side; none replaces or supersedes another.
5 assemblies on this paper: 5 harvested, 0 generated, listed in 1 groups (siblings lifted in one batch form one group).
5 sibling assemblies for QUERY2BOX (harvested), lifted in the same batch on 2026-09-09: alternative readings kept side by side; none replaces or supersedes another.
harvested Assembly for QUERY2BOX (graph method: QUERY2BOX). 12 bricks; individually on a fixture: 11 ran (of which 7 constructed an object rather than computing a result; 9 with no instrument failure: 1 honoured, 0 violated, 8 with no contract checked; 2 where Syntology's instrument failed) · 1 unverified. The assembly has not been run end-to-end.
one of 5 siblings
- KGReasoning entry · level 0 · unverified ·
87b741616782eced - BetaIntersection model · level 1 · ran ·
956e9a56d057daa5 - BetaProjection model · level 1 · ran ·
c16d861762f8696c - BoxOffsetIntersection model · level 1 · ran ·
47268ecee02ceb4f - CenterIntersection model · level 1 · ran ·
a2ccec473702f3c7 - Identity helper · level 1 · ran · honoured contract ·
f44985272d18127a - LogicIntersection model · level 1 · ran ·
47248dd2646c39bd - LogicProjection model · level 1 · ran ·
25d6c06688daacdd - Regularizer helper · level 1 · ran ·
4dd767dfdd3cd11d - SizePredict model · level 1 · ran ·
2a2b3c074a6a00b5 - order_bounds helper · level 1 · ran · our draft was wrong ·
6df8d7def6d8b856 - valclamp helper · level 1 · ran · our draft was wrong ·
51d9d0e0413cd046
harvested Assembly for QUERY2BOX (graph method: QUERY2BOX). 21 bricks; individually on a fixture: 14 ran (of which 3 constructed an object rather than computing a result; 6 with no instrument failure: 1 honoured, 0 violated, 5 with no contract checked; 8 where Syntology's instrument failed) · 7 unverified. The assembly has not been run end-to-end.
one of 5 siblings
- KGReasoning entry · level 0 · unverified ·
61e00b75af63ddec - BetaIntersection model · level 1 · ran ·
15f1515d95ce51d1 - BetaProjection model · level 1 · ran ·
c16d861762f8696c - BoxOffsetIntersection model · level 1 · ran ·
47268ecee02ceb4f - CQD helper · level 0 · unverified ·
9b8c70940dfe67a9 - CenterIntersection model · level 1 · ran ·
a2ccec473702f3c7 - Identity helper · level 1 · ran · honoured contract ·
f44985272d18127a - Regularizer helper · level 1 · ran ·
4dd767dfdd3cd11d - N3 helper · level 0 · unverified ·
13dc0495d6916564 - query_1p helper · level 0 · unverified ·
38511adc942a62d6 - query_2i helper · level 0 · unverified ·
b821d97259813ae4 - query_2p helper · level 1 · ran · our draft was wrong ·
c347b52e0b2d0f36 - query_2u_dnf helper · level 0 · unverified ·
c5eb44c00d8b7df8 - query_3i helper · level 1 · ran · our draft was wrong ·
52f5e28fee4638ab - query_3p helper · level 1 · ran · our draft was wrong ·
805d2b1bc7c0dc90 - query_ip helper · level 0 · unverified ·
2493b517068163e8 - query_pi helper · level 1 · ran · our draft was wrong ·
51a131fbee1009cf - query_to_atoms helper · level 1 · ran · our draft was wrong ·
bc5f262d753a9eb4 - query_up_dnf helper · level 1 · ran · our draft was wrong ·
02f4d333d76fc417 - score_candidates helper · level 1 · ran · our draft was wrong ·
b97e0b8fe06b9171 - flatten_structure helper · level 1 · ran · our draft was wrong ·
d7c6b03fd8f6a3bc
harvested Assembly for QUERY2BOX (graph method: QUERY2BOX). 9 bricks; individually on a fixture: 8 ran (of which 5 constructed an object rather than computing a result; 8 with no instrument failure: 1 honoured, 0 violated, 7 with no contract checked; 0 where Syntology's instrument failed) · 1 unverified. The assembly has not been run end-to-end.
one of 5 siblings
- Query2box entry · level 0 · unverified ·
5cf4606d614eb571 - AttentionSet model · level 1 · ran ·
e519b1988ee37a5a - CenterSet model · level 1 · ran ·
e6cd914f1f66ce76 - Identity helper · level 1 · ran · honoured contract ·
f44985272d18127a - InductiveOffsetSet helper · level 1 · ran ·
23039ea2b760df60 - MeanSet helper · level 1 · ran ·
c14351660e82d6b2 - MinSet helper · level 1 · ran ·
060a24b37fb8ba59 - OffsetSet model · level 1 · ran ·
11bb0cf115a0240f - Attention model · level 1 · ran ·
2575bb19d82fba6d
harvested Assembly for QUERY2BOX (graph method: QUERY2BOX). 7 bricks; individually on a fixture: 6 ran (of which 2 constructed an object rather than computing a result; 4 with no instrument failure: 1 honoured, 0 violated, 3 with no contract checked; 2 where Syntology's instrument failed) · 1 unverified. The assembly has not been run end-to-end.
one of 5 siblings
- BoxEstimator entry · level 1 · ran ·
2a211e2e73b1cbde - AppFOQEstimator helper · level 0 · unverified ·
b8322293c1e3a4ac - BoxOffsetIntersection model · level 1 · ran ·
c839f4122028b419 - CenterIntersection model · level 1 · ran ·
5c301bc69f133009 - find_optimal_batch helper · level 1 · ran; the contract check could not run (RAISES) ·
d8b0a4e3912306de - identity helper · level 1 · ran · honoured contract ·
9910e2fc297f8665 - inclusion_sampling helper · level 1 · ran · our draft was wrong ·
c423c8497887b2c3
harvested Assembly for QUERY2BOX (graph method: QUERY2BOX). 7 bricks; individually on a fixture: 6 ran (of which 3 constructed an object rather than computing a result; 6 with no instrument failure: 1 honoured, 0 violated, 5 with no contract checked; 0 where Syntology's instrument failed) · 1 unverified. The assembly has not been run end-to-end.
one of 5 siblings
- KGReasoning entry · level 0 · unverified ·
823b93b900c73ef8 - BetaIntersection model · level 1 · ran ·
15f1515d95ce51d1 - BetaProjection model · level 1 · ran ·
c16d861762f8696c - BoxOffsetIntersection model · level 1 · ran ·
47268ecee02ceb4f - CenterIntersection model · level 1 · ran ·
a2ccec473702f3c7 - Identity helper · level 1 · ran · honoured contract ·
f44985272d18127a - Regularizer helper · level 1 · ran ·
4dd767dfdd3cd11d
Each brick ends with its code_sha256, Syntology's identity for that exact code; click one to copy the get_code call that returns it. For agents, on Syntology's MCP service: assembly(arxiv_id="2002.05969") returns these assemblies with each brick's role and wiring (how to connect).
Tasks
Results from the paper archive 2025-07-28
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