SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2109.08925 · NeurIPS · 2021

Benchmarking the Combinatorial Generalizability of Complex Query Answering on Knowledge Graphs

Zihao Wang, Hang Yin, Yangqiu Song

arXiv · PDF · Open in the Atlas

Code that ran

9 of 11 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 2 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 6 failures of our instrument; 2 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2109.08925.json · badge: /api/ran/2109.08925.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
hkust-knowcomp/efo-1-qa-benchmark canonical (classifier label)
classifier basis: census
8 ran · 2 no recorded run
Jacfger/simple-stuffs canonical (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
FunctionStatusWhere it lives
convert_to_arg Ran
ran; our contract draft was wrong, not the code
hkust-knowcomp/efo-1-qa-benchmark/fol/estimator_ConE.py
code served (permissive licence) · get_code("fa8f6d2163c007e7")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

def convert_to_arg(x):
    pi = 3.141592653589793
    y = torch.tanh(2 * x) * pi / 2 + pi / 2
    return y

# Create a small tensor for x parameter
x = torch.randn(2, 4)

ARGS = {
    'x': x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
convert_to_axis Ran
ran; our contract draft was wrong, not the code
hkust-knowcomp/efo-1-qa-benchmark/fol/estimator_ConE.py
code served (permissive licence) · get_code("04df086ab269bc1f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

def convert_to_axis(x):
    y = torch.tanh(x) * 3.141592653589793
    return y

# The function takes a single parameter 'x' which should be a tensor
# It applies tanh and multiplies by pi
x = torch.randn(2, 4)

ARGS = {
    'x': x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
count_query_depth Ran
ran, honoured the contract we drafted
Jacfger/simple-stuffs/formula_generation.py
code served (permissive licence) · get_code("9862c45a5afd5103")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

class Query:
    def __init__(self, op, sub_queries=None, query=None, lquery=None, rquery=None):
        self.__o__ = op
        self.sub_queries = sub_queries or []
        self.query = query
        self.lquery = lquery
        self.rquery = rquery

# Create test queries with different operations
leaf_query = Query('e')

union_query = Query('u', sub_queries=[
    Query('e'),
    Query('e')
])

projection_query = Query('p', query=Query('e'))

negation_query = Query('n', query=Query('e'))

difference_query = Query('d', 
    lquery=Query('e'),
    rquery=Query('e')
)

nested_query = Query('u', sub_queries=[
    Query('p', query=Query('e')),
    Query('n', query=Query('e'))
])

ARGS = {
    'query': nested_query
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
find_optimal_batch Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
hkust-knowcomp/efo-1-qa-benchmark/fol/appfoq.py
code served (permissive licence) · get_code("d8b0a4e3912306de")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Create tiny tensors with distinct dimensions
answer_emb = torch.randn(2, 4)  # batch_size=2, embedding_dim=4
query_dist = torch.randn(3, 5)  # distinct shape for query_dist

# Define a simple compute_logit function that takes batched answer embeddings and query_dist
def compute_logit(batch_answer_emb, query_dist):
    # The function calls this with either:
    # - batch_answer_emb.unsqueeze(0) when union=False (adds 1 dim)
    # - batch_answer_emb.unsqueeze(0).unsqueeze(0) when union=True (adds 2 dims)
    # So batch_answer_emb will have shape (..., 4) and we need to return a logit tensor
    # This simple implementation just returns a scalar logit
    return torch.tensor(1.0)

ARGS = {
    "answer_emb": answer_emb,
    "query_dist": query_dist,
    "compute_logit": compute_logit,
    "union": False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
identity Ran
ran, honoured the contract we drafted
hkust-knowcomp/efo-1-qa-benchmark/fol/estimator_box.py
pointer only (licence: MIT); the stored copy get_code serves, from dholzmueller/universal_double_descent, is pointer only (licence: NONE) · get_code("9910e2fc297f8665")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from dholzmueller/universal_double_descent, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

inclusion_sampling Ran
ran; our contract draft was wrong, not the code
hkust-knowcomp/efo-1-qa-benchmark/fol/appfoq.py
code served (permissive licence) · get_code("7cbefe713c9e3840")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np
import random

torch.manual_seed(0)
random.seed(0)
np.random.seed(0)

# Construct the arguments for inclusion_sampling
answer_set = [
    [1, 2, 3],           # First answer set with 3 entities
    [5, 6, 7, 8],        # Second answer set with 4 entities
]

negative_size = 2
entity_num = 10
k = 1
base_num = 4

ARGS = {
    "answer_set": answer_set,
    "negative_size": negative_size,
    "entity_num": entity_num,
    "k": k,
    "base_num": base_num,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
order_bounds Ran
ran; our contract draft was wrong, not the code
hkust-knowcomp/efo-1-qa-benchmark/fol/estimator_logic.py
code served (permissive licence) · get_code("6df8d7def6d8b856")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Create a small embedding tensor
# Shape: (batch_size=2, embedding_dim=4)
# The function expects the last dimension to be split into lower and upper bounds
embedding = torch.rand(2, 4)

ARGS = {
    "embedding": embedding
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
recursive_getattr Ran
ran on a synthesized input
hkust-knowcomp/efo-1-qa-benchmark/validation.py
code served (permissive licence) · get_code("3ee25729d2bff9f9")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Linear. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

class DummyModule(nn.Module):
    def __init__(self):
        super().__init__()
        self.layer1 = nn.Linear(4, 3)
        self.layer2 = nn.Linear(3, 2)
        self.nested = nn.Module()
        self.nested.deep = nn.Linear(2, 1)

obj = DummyModule()

ARGS = {
    "obj": obj,
    "k": "layer1"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Linear — a Linear output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Linear output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
valclamp Ran
ran; our contract draft was wrong, not the code
hkust-knowcomp/efo-1-qa-benchmark/fol/estimator_logic.py
code served (permissive licence) · get_code("51d9d0e0413cd046")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Create a small tensor input
x = torch.randn(2, 4)

# Define parameters
a = 1
b = 6
lo = 0
hi = 1

# Construct ARGS dictionary with all parameters
ARGS = {
    "x": x,
    "a": a,
    "b": b,
    "lo": lo,
    "hi": hi
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
negative_sampling Not yet run
unverified (harvested, no recorded run)
hkust-knowcomp/efo-1-qa-benchmark/fol/appfoq.py
code served (permissive licence) · get_code("c79e3940bf2965d9")
How it ran

no invocation recorded.

transform_json_query Not yet run
unverified (harvested, no recorded run)
hkust-knowcomp/efo-1-qa-benchmark/transform_beta_data.py
code served (permissive licence) · get_code("56398fd82d294031")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 7 are also present in other papers whose code we hold (7 with at least one paper dated earlier, 0 the same month, 3 later) and 4 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
identity 69 other papers
26 dated earlier, 43 later · 5 only as an assembly brick
1706.07296 (2017-06)
A Minimal Developmental Model Can Increase Evolvability in Soft Robots
1802.09419 (2018-02)
Stochastic Hyperparameter Optimization through Hypernetworks
1804.06055 (2018-04)
Co-occurrence Feature Learning from Skeleton Data for Action Recognition and Detection with Hierarchical Aggregation
and 66 more not named here
convert_to_arg 2 other papers
1 dated earlier, 1 later
2108.02390 (2021-08)
Fuzzy Logic Based Logical Query Answering on Knowledge Graphs
2110.13715 (2021-10)
ConE: Cone Embeddings for Multi-Hop Reasoning over Knowledge Graphs
convert_to_axis 2 other papers
1 dated earlier, 1 later
2108.02390 (2021-08)
Fuzzy Logic Based Logical Query Answering on Knowledge Graphs
2110.13715 (2021-10)
ConE: Cone Embeddings for Multi-Hop Reasoning over Knowledge Graphs
find_optimal_batch 2 other papers
2 dated earlier · 1 only as an assembly brick
2002.05969 (2020-02)
Query2box: Reasoning over Knowledge Graphs in Vector Space using Box Embeddings
2010.11465 (2020-10)
Beta Embeddings for Multi-Hop Logical Reasoning in Knowledge Graphs
inclusion_sampling 2 other papers
2 dated earlier · 1 only as an assembly brick
2002.05969 (2020-02)
Query2box: Reasoning over Knowledge Graphs in Vector Space using Box Embeddings
2010.11465 (2020-10)
Beta Embeddings for Multi-Hop Logical Reasoning in Knowledge Graphs
order_bounds 1 other paper
1 dated earlier
2002.05969 (2020-02)
Query2box: Reasoning over Knowledge Graphs in Vector Space using Box Embeddings
valclamp 1 other paper
1 dated earlier
2002.05969 (2020-02)
Query2box: Reasoning over Knowledge Graphs in Vector Space using Box Embeddings

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Complex Query Answering (CQA) is an important reasoning task on knowledge graphs. Current CQA learning models have been shown to be able to generalize from atomic operators to more complex formulas, which can be regarded as the combinatorial generalizability. In this paper, we present EFO-1-QA, a new dataset to benchmark the combinatorial generalizability of CQA models by including 301 different queries types, which is 20 times larger than existing datasets. Besides, our benchmark, for the first time, provide a benchmark to evaluate and analyze the impact of different operators and normal forms by using (a) 7 choices of the operator systems and (b) 9 forms of complex queries. Specifically, we provide the detailed study of the combinatorial generalizability of two commonly used operators, i.e., projection and intersection, and justify the impact of the forms of queries given the canonical choice of operators. Our code and data can provide an effective pipeline to benchmark CQA models.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2109.08925")
get_code_for_paper("2109.08925")
have("2109.08925")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2109.08925.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2109.08925.svg)](https://syntology.ai/paper/2109.08925)

Connect an agent — have() is free.