SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2309.12545 · 2023

Provably Robust and Plausible Counterfactual Explanations for Neural Networks via Robust Optimisation

arXiv · PDF · Open in the Atlas

Code that ran

6 of 9 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 0 have no contract verdict; 4 failures of our instrument; 3 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/2309.12545.json · badge: /api/ran/2309.12545.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
junqi-jiang/proplace canonical (classifier label)
classifier basis: census
6 ran · 3 no recorded run
FunctionStatusWhere it lives
build_dataset_feature_types Ran
ran; our contract draft was wrong, not the code
junqi-jiang/proplace/proplace/inn.py
code served (permissive licence) · get_code("62d5bd4827abfc4d")
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 dict. 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 enum

class DataType(enum.Enum):
    DISCRETE = 0
    ORDINAL = 1
    CONTINUOUS_REAL = 2

def build_dataset_feature_types(columns, ordinal, discrete, continuous):
    feature_types = dict()
    for feat in ordinal.keys():
        feature_types[columns.index(feat)] = DataType.ORDINAL
    for feat in discrete.keys():
        feature_types[columns.index(feat)] = DataType.DISCRETE
    for feat in continuous:
        feature_types[columns.index(feat)] = DataType.CONTINUOUS_REAL
    return feature_types

# Setup code
columns = ['feature_a', 'feature_b', 'feature_c', 'feature_d']
ordinal = {'feature_a': [1, 2, 3], 'feature_c': [0, 1]}
discrete = {'feature_b': ['cat', 'dog']}
continuous = ['feature_d']

ARGS = {
    'columns': columns,
    'ordinal': ordinal,
    'discrete': discrete,
    'continuous': continuous
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
build_inn_nodes Ran
ran; our contract draft was wrong, not the code
junqi-jiang/proplace/proplace/inn.py
code served (permissive licence) · get_code("838c0bb8bc93ddad")
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 dict. 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
from sklearn.neural_network import MLPClassifier

torch.manual_seed(0)

# Create a simple MLPClassifier with specific configuration
clf = MLPClassifier(
    hidden_layer_sizes=(8, 6),
    max_iter=1,
    random_state=0
)

# Fit it with dummy data to set n_features_in_
X_dummy = np.random.randn(5, 4)  # 5 samples, 4 features
y_dummy = np.array([0, 1, 0, 1, 0])
clf.fit(X_dummy, y_dummy)

# Set num_layers to match the network structure
# Input layer (4 features) + 2 hidden layers + output layer (1) = 4 layers
num_layers = 4

ARGS = {
    "clf": clf,
    "num_layers": num_layers
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
l2_projection Ran
ran; our contract draft was wrong, not the code
junqi-jiang/proplace/rbr/rbr_loss.py
code served (permissive licence) · get_code("1f82f506abe66066")
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)

# x: a tensor that will be projected onto an L2-ball
# The function computes norm along the last axis, so we need a 2D tensor
# Shape: (batch_size, feature_dim)
x = torch.randn(2, 4)

# radius: scalar or tensor specifying the L2-ball radius
# The function uses torch.max(radius, norm), so it should be broadcastable
radius = torch.tensor(1.0)

ARGS = {
    "x": x,
    "radius": radius,
}
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
normalised_l1 Ran
ran, honoured the contract we drafted
junqi-jiang/proplace/experiments/exputils.py
code served (permissive licence) · get_code("ac9e3779a4a1c0ff")
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 float32, ndim 0, 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 numpy as np

# Create two numpy arrays with shape (batch_size, features)
# Using distinct sizes: batch_size=2, features=4
xp = np.array([
    [1.0, 2.0, 3.0, 4.0],
    [5.0, 6.0, 7.0, 8.0]
], dtype=np.float32)

x = np.array([
    [1.5, 2.5, 2.5, 3.5],
    [5.5, 5.5, 7.5, 8.5]
], dtype=np.float32)

ARGS = {
    "xp": xp,
    "x": x,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float32, ndim 0, dtype family float — no output shape is stated: observe_signature.py could not observe it (read:RecursionError)
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
power10floor Ran
ran, honoured the contract we drafted
junqi-jiang/proplace/rbr/rbr.py
code served (permissive licence) · get_code("e96dcd507f52e146")
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 math

def power10floor(x):
    return 10 ** math.floor(math.log10(x))

# The function takes a single parameter x and computes 10^floor(log10(x))
# x should be a positive number (since log10 requires x > 0)

ARGS = {
    "x": 42.7
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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
reconstruct_encoding_constraints Ran
ran; our contract draft was wrong, not the code
junqi-jiang/proplace/rbr/rbr.py
code served (permissive licence) · get_code("15e5371ad7238d2a")
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)

# x should be a tensor that supports cloning and indexing
# cat_pos should be a list/sequence of positions (indices)
x = torch.randn(2, 4, requires_grad=True)

# cat_pos should be a list of positions to apply clamping and rounding
cat_pos = [0, 1]

ARGS = {
    "x": x,
    "cat_pos": cat_pos,
}
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
build_inn_weights_biases Not yet run
unverified (harvested, no recorded run)
junqi-jiang/proplace/proplace/inn.py
code served (permissive licence) · get_code("b0a08223420c22e3")
How it ran

no invocation recorded.

generate_recourse Not yet run
unverified (harvested, no recorded run)
junqi-jiang/proplace/rbr/rbr.py
code served (permissive licence) · get_code("825a984775be3e19")
How it ran

no invocation recorded.

train_clf Not yet run
unverified (harvested, no recorded run)
junqi-jiang/proplace/proplace/clfutils.py
code served (permissive licence) · get_code("1010d65049c03d26")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 8 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 8 later) and 1 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
build_dataset_feature_types 1 other paper
1 later
2404.13736 (2024-04)
Interval Abstractions for Robust Counterfactual Explanations
build_inn_nodes 1 other paper
1 later
2404.13736 (2024-04)
Interval Abstractions for Robust Counterfactual Explanations
build_inn_weights_biases 1 other paper
1 later
2404.13736 (2024-04)
Interval Abstractions for Robust Counterfactual Explanations
generate_recourse 1 other paper
1 later
2404.13736 (2024-04)
Interval Abstractions for Robust Counterfactual Explanations
l2_projection 1 other paper
1 later
2404.13736 (2024-04)
Interval Abstractions for Robust Counterfactual Explanations
normalised_l1 1 other paper
1 later
2404.13736 (2024-04)
Interval Abstractions for Robust Counterfactual Explanations
power10floor 1 other paper
1 later
2404.13736 (2024-04)
Interval Abstractions for Robust Counterfactual Explanations
reconstruct_encoding_constraints 1 other paper
1 later
2404.13736 (2024-04)
Interval Abstractions for Robust Counterfactual Explanations

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 (CEs) have received increasing interest as a major methodology for explaining neural network classifiers. Usually, CEs for an input-output pair are defined as data points with minimum distance to the input that are classified with a different label than the output. To tackle the established problem that CEs are easily invalidated when model parameters are updated (e.g. retrained), studies have proposed ways to certify the robustness of CEs under model parameter changes bounded by a norm ball. However, existing methods targeting this form of robustness are not sound or complete, and they may generate implausible CEs, i.e., outliers wrt the training dataset. In fact, no existing method simultaneously optimises for closeness and plausibility while preserving robustness guarantees. In this work, we propose Provably RObust and PLAusible Counterfactual Explanations (PROPLACE), a method leveraging on robust optimisation techniques to address the aforementioned limitations in the literature. We formulate an iterative algorithm to compute provably robust CEs and prove its convergence, soundness and completeness. Through a comparative experiment involving six baselines, five of which target robustness, we show that PROPLACE achieves state-of-the-art performances against metrics on three evaluation aspects.

For agents

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

get_harvested_code_for_paper("2309.12545")
get_code_for_paper("2309.12545")
have("2309.12545")

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

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

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

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

Connect an agent — have() is free.