SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2023.findings-emnlp.540 · EMNLP Findings · 2023

Open-ended Commonsense Reasoning with Unrestricted Answer Scope

Liang Zhao, Xujiang Zhao, Wei Cheng, Haifeng Chen, Chen Ling, Yanchi Liu, Xuchao Zhang, Mika Oishi, Takao Osaki, Katsushi Matsuda

Open in the Atlas

Code that ran

8 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; 0 honoured the contract we drafted, 0 violated it and 7 have no contract verdict; 1 failure of our instrument; 3 no recorded run), measured 2026-11-24; 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/2023.findings-emnlp.540.json · badge: /api/ran/2023.findings-emnlp.540.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
lingchen0331/KEEP canonical (classifier label)
classifier basis: census
8 ran · 3 no recorded run
FunctionStatusWhere it lives
clean_entities Ran
ran on a synthesized input
lingchen0331/KEEP/data_processing.py
code served (permissive licence) · get_code("e0167fa569d42472")
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 list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim 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

def clean_entities(x):
    x = x.split(']')
    x = [i.replace('[', '').split('|')[0] for i in x if i]
    return x

ARGS = {
    'x': '[entity1|extra][entity2|extra][entity3|extra]'
}
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 list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
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
clean_index Ran
ran on a synthesized input
lingchen0331/KEEP/data_processing.py
code served (permissive licence) · get_code("aad200fa425cbf07")
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 float, ndim 0, dtype family float, 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 numpy as np

def clean_index(x):
    x = x.replace('text:', '')
    return float(x)

# The function takes a single parameter 'x' which is a string
# It replaces 'text:' with empty string and converts to float
# So we need a string that contains 'text:' followed by a numeric value

ARGS = {
    'x': 'text:42.5'
}
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 float, ndim 0, dtype family float, 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
del_pos Ran
ran on a synthesized input
lingchen0331/KEEP/preprocessing/conceptnet.py
code served (permissive licence) · get_code("5f4eefd99c11e698")
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 str. 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

# Create valid arguments for the del_pos function
ARGS = {
    "s": "example/n"
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
generative_score Ran
ran on a synthesized input
lingchen0331/KEEP/knowledge/generate_context.py
code served (permissive licence) · get_code("421a501e2eea93ba")
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 0, dtype family float, 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)

# Stand-in tokenizer that implements encode method
class StandInTokenizer:
    def encode(self, sentence):
        # Return a small list of token IDs
        return [1, 2, 3, 4]

# Minimal model that accepts tensor input and labels, returns loss
class StandInModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.embedding = nn.Embedding(num_embeddings=10, embedding_dim=4)
        self.lm_head = nn.Linear(4, 10)
    
    def forward(self, input_ids, labels=None):
        # input_ids shape: (batch_size, seq_len)
        embeds = self.embedding(input_ids)  # (batch_size, seq_len, 4)
        logits = self.lm_head(embeds)  # (batch_size, seq_len, 10)
        
        if labels is not None:
            # Compute a simple loss
            loss_fn = nn.CrossEntropyLoss()
            # Reshape for loss computation
            loss = loss_fn(logits.view(-1, 10), labels.view(-1))
            return (loss,)
        
        return logits

model = StandInModel()
tokenizer = StandInTokenizer()
sentence = "hello world"
device = "cpu"

ARGS = {
    "model": model,
    "tokenizer": tokenizer,
    "sentence": sentence,
    "device": device
}
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 0, dtype family float, 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
masked_sentence_score Ran
ran on a synthesized input
lingchen0331/KEEP/knowledge/generate_context.py
code served (permissive licence) · get_code("6563f15bf16e6ec2")
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 0, dtype family float, 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)

class MockTokenizer:
    def __init__(self):
        self.mask_token_id = 103
    
    def encode(self, sentence, return_tensors=None):
        # Return a small token sequence [101, 2054, 2003, 102]
        # (CLS, what, is, SEP)
        tokens = torch.tensor([[101, 2054, 2003, 102]])
        return tokens

class MockModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 1)
    
    def forward(self, input_ids, labels=None):
        # Minimal implementation that accepts input_ids and labels
        # Returns an object with a .loss attribute
        batch_size = input_ids.size(0)
        loss_value = torch.tensor(0.5)
        
        class Output:
            def __init__(self, loss):
                self.loss = loss
        
        return Output(loss_value)

model = MockModel()
tokenizer = MockTokenizer()
sentence = "What is this?"
device = "cpu"

ARGS = {
    "model": model,
    "tokenizer": tokenizer,
    "sentence": sentence,
    "device": device
}
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 0, dtype family float, 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
mean_pooling Ran
ran; our contract draft was wrong, not the code
lingchen0331/KEEP/sentence_similarity.py
pointer only (licence: MIT); the stored copy get_code serves, from dengyang17/llm-proactive, is pointer only (licence: NONE) · get_code("77f69af078e09830")
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 dengyang17/llm-proactive, 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.

neighbors_pick Ran
ran on a synthesized input
lingchen0331/KEEP/knowledge/generate_knowledge.py
code served (permissive licence) · get_code("c6797ebff76bbd80")
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 DataFrame. 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 pandas as pd

# Create a simple concept network DataFrame
# The function accesses column [1] (second column by index) and looks for matches with entity
concept_net = pd.DataFrame({
    0: ['concept_1', 'concept_2', 'concept_3', 'concept_4'],
    1: ['dog', 'cat', 'dog', 'bird'],
    2: ['animal', 'animal', 'animal', 'animal']
})

entity = 'dog'

ARGS = {
    'concept_net': concept_net,
    'entity': entity
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataFrame — a DataFrame output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataFrame output the recorded ndim 2 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
question_prompt_generation Ran
ran on a synthesized input
lingchen0331/KEEP/utils.py
code served (permissive licence) · get_code("e3dc83f79810427d")
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 str. 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

torch.manual_seed(0)

# The function takes a query string and returns a modified string
# It simply concatenates the query with ' it is [MASK].'

ARGS = {
    "query": "What is the capital of France?"
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
construct_graph Not yet run
unverified (harvested, no recorded run)
lingchen0331/KEEP/preprocessing/conceptnet.py
code served (permissive licence) · get_code("be8c35c9c1d52b66")
How it ran

no invocation recorded.

glove_init Not yet run
unverified (harvested, no recorded run)
lingchen0331/KEEP/preprocessing/conceptnet.py
code served (permissive licence) · get_code("9dcf00b849de8977")
How it ran

no invocation recorded.

sentence_embeddings Not yet run
unverified (harvested, no recorded run)
lingchen0331/KEEP/sentence_similarity.py
code served (permissive licence) · get_code("4af318cdb30cc405")
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, 4 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 0 the same month, 1 later) and 7 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
mean_pooling 22 other papers
1 dated earlier, 15 later, 6 same year, order not determinable · 1 only as an assembly brick
2206.04624 (2022-06)
Factuality Enhanced Language Models for Open-Ended Text Generation
2302.05698 (2023-02)
Compositional Exemplars for In-context Learning
2306.15895 (2023-06)
Large Language Model as Attributed Training Data Generator: A Tale of Diversity and Bias
and 19 more not named here
del_pos 5 other papers
4 dated earlier, 1 same year, order not determinable
1909.02151 (2019-09)
KagNet: Knowledge-Aware Graph Networks for Commonsense Reasoning
2104.06378 (2021-04)
QA-GNN: Reasoning with Language Models and Knowledge Graphs for Question Answering
2022.findings-naacl.131 (2022 (year only))
Great Truths are Always Simple: A Rather Simple Knowledge Encoder for Enhancing the Commonsense Reasoning Capacity of Pre-Trained Models
and 2 more not named here
construct_graph 4 other papers
3 dated earlier, 1 same year, order not determinable
2104.06378 (2021-04)
QA-GNN: Reasoning with Language Models and Knowledge Graphs for Question Answering
2022.findings-naacl.131 (2022 (year only))
Great Truths are Always Simple: A Rather Simple Knowledge Encoder for Enhancing the Commonsense Reasoning Capacity of Pre-Trained Models
2210.09338 (2022-10)
Deep Bidirectional Language-Knowledge Graph Pretraining
and 1 more not named here
glove_init 4 other papers
3 dated earlier, 1 same year, order not determinable
2104.06378 (2021-04)
QA-GNN: Reasoning with Language Models and Knowledge Graphs for Question Answering
2022.findings-naacl.131 (2022 (year only))
Great Truths are Always Simple: A Rather Simple Knowledge Encoder for Enhancing the Commonsense Reasoning Capacity of Pre-Trained Models
2210.09338 (2022-10)
Deep Bidirectional Language-Knowledge Graph Pretraining
and 1 more not named here

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-24.

Repositories linked to this paper

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

Abstract

Open-ended Commonsense Reasoning is defined as solving a commonsense question without providing 1) a short list of answer candidates and 2) a pre-defined answer scope. Conventional ways of formulating the commonsense question into a question-answering form or utilizing external knowledge to learn retrieval-based methods are less applicable in the open-ended setting due to an inherent challenge. Without pre-defining an answer scope or a few candidates, open-ended commonsense reasoning entails predicting answers by searching over an extremely large searching space. Moreover, most questions require implicit multi-hop reasoning, which presents even more challenges to our problem. In this work, we leverage pre-trained language models to iteratively retrieve reasoning paths on the external knowledge base, which does not require task-specific supervision. The reasoning paths can help to identify the most precise answer to the commonsense question. We conduct experiments on two commonsense benchmark datasets. Compared to other approaches, our proposed method achieves better performance both quantitatively and qualitatively. Our code and data are available at: https: //github.com/lingchen0331/KEEP.

For agents

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

get_harvested_code_for_paper("2023.findings-emnlp.540")
get_code_for_paper("2023.findings-emnlp.540")
have("2023.findings-emnlp.540")

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

curl https://syntology.ai/api/ran/2023.findings-emnlp.540.json

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

[![Syntology run record](https://syntology.ai/api/ran/2023.findings-emnlp.540.svg)](https://syntology.ai/paper/2023.findings-emnlp.540)

Connect an agent — have() is free.