SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2305.17667 · IJCAI · 2023

Choose your Data Wisely: A Framework for Semantic Counterfactuals

Giorgos Stamou, Giorgos Filandrianos, Konstantinos Thomas, Edmund Dervakos

arXiv · PDF · Open in the Atlas

Code that ran

4 of 10 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 4 have no contract verdict; 0 failures of our instrument; 6 no recorded run), measured 2026-11-23; 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/2305.17667.json · badge: /api/ran/2305.17667.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
geofila/Semantic-Counterfactuals canonical (classifier label)
classifier basis: census
4 ran · 6 no recorded run
FunctionStatusWhere it lives
default_addition_cost Ran
ran on a synthesized input
geofila/Semantic-Counterfactuals/app/cece/refine.py
code served (permissive licence) · get_code("618ba52a2dd85c2c")
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 numpy as np

torch.manual_seed(0)

# The function default_addition_cost takes an object and returns len(obj)
# So we need to pass an object that has a __len__ method

# Create a simple object with a length
obj = [1, 2, 3, 4, 5]

ARGS = {
    "obj": obj
}
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 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
default_obj_distance Ran
ran on a synthesized input
geofila/Semantic-Counterfactuals/app/cece/refine.py
code served (permissive licence) · get_code("a3ebc56f7f874cef")
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

class SetLikeObject:
    def __init__(self, elements):
        self.elements = set(elements)
    
    def intersection(self, other):
        result_elements = self.elements & other.elements
        return SetLikeObject(result_elements)
    
    def __sub__(self, other):
        result_elements = self.elements - other.elements
        return SetLikeObject(result_elements)
    
    def __len__(self):
        return len(self.elements)

obj1 = SetLikeObject([1, 2, 3, 4, 5])
obj2 = SetLikeObject([3, 4, 5, 6, 7])

ARGS = {
    "obj1": obj1,
    "obj2": obj2
}
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
default_removal_cost Ran
ran on a synthesized input
geofila/Semantic-Counterfactuals/app/cece/refine.py
code served (permissive licence) · get_code("8705fba37f270b79")
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 numpy as np

torch.manual_seed(0)

# The function default_removal_cost(obj) returns len(obj)
# So obj must be something that supports the len() function
# This could be a list, tuple, string, tensor, etc.

# Create a simple object with a length
test_obj = [1, 2, 3, 4, 5]

ARGS = {
    "obj": test_obj
}
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 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_maximum_path Ran
ran on a synthesized input
geofila/Semantic-Counterfactuals/app/cece/wordnet.py
code served (permissive licence) · get_code("06d74383cb9e3feb")
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
import numpy as np

class PathNode:
    """Stand-in class representing a node in a path"""
    def __init__(self, node_id):
        self.node_id = node_id
    
    def name(self):
        return f"node_{self.node_id}"

# Create several paths of varying lengths
path1 = [PathNode(1), PathNode(2), PathNode(3)]
path2 = [PathNode(10), PathNode(11), PathNode(12), PathNode(13), PathNode(14)]
path3 = [PathNode(20), PathNode(21)]

paths = [path1, path2, path3]

ARGS = {
    "paths": paths
}
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 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
add_cost Not yet run
unverified (harvested, no recorded run)
geofila/Semantic-Counterfactuals/app/cece/graph.py
code served (permissive licence) · get_code("211758dc41460b9d")
How it ran

no invocation recorded.

connect_list_to_wordnet Not yet run
unverified (harvested, no recorded run)
geofila/Semantic-Counterfactuals/app/cece/wordnet.py
code served (permissive licence) · get_code("5830fa4c39f354ac")
How it ran

no invocation recorded.

connect_term_to_wordnet Not yet run
unverified (harvested, no recorded run)
geofila/Semantic-Counterfactuals/app/cece/wordnet.py
code served (permissive licence) · get_code("a4c9c3f8cebe8754")
How it ran

no invocation recorded.

createMSQ Not yet run
unverified (harvested, no recorded run)
geofila/Semantic-Counterfactuals/app/cece/xDataset.py
code served (permissive licence) · get_code("ebd389719c881c7a")
How it ran

no invocation recorded.

node_transition_cost Not yet run
unverified (harvested, no recorded run)
geofila/Semantic-Counterfactuals/app/cece/graph.py
code served (permissive licence) · get_code("da9660a63f8e1518")
How it ran

no invocation recorded.

remove_cost Not yet run
unverified (harvested, no recorded run)
geofila/Semantic-Counterfactuals/app/cece/graph.py
code served (permissive licence) · get_code("61142016e4a73d66")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 10 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.

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

Repositories linked to this paper

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

Abstract

Counterfactual explanations have been argued to be one of the most intuitive forms of explanation. They are typically defined as a minimal set of edits on a given data sample that, when applied, changes the output of a model on that sample. However, a minimal set of edits is not always clear and understandable to an end-user, as it could, for instance, constitute an adversarial example (which is indistinguishable from the original data sample to an end-user). Instead, there are recent ideas that the notion of minimality in the context of counterfactuals should refer to the semantics of the data sample, and not to the feature space. In this work, we build on these ideas, and propose a framework that provides counterfactual explanations in terms of knowledge graphs. We provide an algorithm for computing such explanations (given some assumptions about the underlying knowledge), and quantitatively evaluate the framework with a user study.

For agents

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

get_harvested_code_for_paper("2305.17667")
get_code_for_paper("2305.17667")
have("2305.17667")

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

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

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

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

Connect an agent — have() is free.