SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2201.05773 · 2022

Automated causal inference in application to randomized controlled clinical trials

arXiv · PDF · Open in the Atlas

Code that ran

11 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 11 have no contract verdict; 0 failures of our instrument; 0 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/2201.05773.json · badge: /api/ran/2201.05773.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
ctplab/autoci canonical (classifier label)
classifier basis not recorded on the link
11 ran · 0 no recorded run
FunctionStatusWhere it lives
all_but Ran
ran on a synthesized input
ctplab/autoci/src/utils.py
code served (permissive licence) · get_code("6be10124363931d5")
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 int; 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

ARGS = {
    'k': 2,
    'p': 5
}
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 list, ndim 1, dtype family int — 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
cox_ph_loss Ran
ran on a synthesized input
ctplab/autoci/HOUDINI/Library/Loss.py
code served (permissive licence) · get_code("f466e31d7990fd15")
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 1, dtype family float, shape (2,) 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
from torch import Tensor

torch.manual_seed(0)

# Create small tensors for testing cox_ph_loss
batch_size = 2

# log_h: output of neural network, shape (batch_size,)
log_h = torch.randn(batch_size)

# event_dur: ground-truth labels with shape (batch_size, 2)
# First column is events (0 or 1), second column is durations
events = torch.tensor([1.0, 0.0])
durations = torch.tensor([5.0, 3.0])
event_dur = torch.stack([events, durations], dim=1)

ARGS = {
    'log_h': log_h,
    'event_dur': event_dur,
    'reduction': 'none',
    'eps': 1e-07
}
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 1, dtype family float, shape (2,) — shape (2,) 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
cox_ph_loss_sorted Ran
ran on a synthesized input
ctplab/autoci/HOUDINI/Library/Loss.py
code served (permissive licence) · get_code("8f5d41c86a676839")
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 1, dtype family float, shape (2,) 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
from torch import Tensor

torch.manual_seed(0)

# Create small tensors for the function
batch_size = 2
log_h = torch.randn(batch_size, requires_grad=True)
events = torch.tensor([1.0, 0.0])

ARGS = {
    'log_h': log_h,
    'events': events,
    'reduction': 'none',
    'eps': 1e-07
}
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 1, dtype family float, shape (2,) — shape (2,) 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
icp_lganm Ran
ran on a synthesized input
ctplab/autoci/src/icp.py
code served (permissive licence) · get_code("3393f304d002fdba")
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, 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 numpy as np
import scipy.stats

class Data:
    def __init__(self, n_env, targets):
        self.n_env = n_env
        self.targets = targets

# Create sample data
np.random.seed(0)

# Create residuals array
res = np.random.randn(20)

# Create data object with 2 environments
target_1 = np.random.randn(8)
target_2 = np.random.randn(12)
data = Data(n_env=2, targets=[target_1, target_2])

method = 'icp'

ARGS = {
    'res': res,
    'data': data,
    'method': method
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple 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
intersection Ran
ran on a synthesized input
ctplab/autoci/src/policy.py
code served (permissive licence) · get_code("815ccd61f5b92483")
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 set. 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.

# Construct valid arguments for the intersection function
# The function takes a collection of sets and returns their intersection

# Test with a simple list of sets
ARGS = {
    "sets": [
        {1, 2, 3, 4},
        {2, 3, 4, 5},
        {2, 3, 4, 6}
    ]
}
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 set — a set output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a set 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
matrix_block Ran
ran on a synthesized input
ctplab/autoci/src/utils.py
code served (permissive licence) · get_code("82b5dd7e40155ed2")
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 ndarray, ndim 2, dtype family int, shape (3, 2) 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 numpy as np

np.random.seed(0)

# Create a test matrix with distinct dimensions (5 rows, 4 columns)
M = np.arange(20).reshape(5, 4)

# Define row and column indices to extract
rows = [0, 2, 4]
cols = [1, 3]

ARGS = {
    "M": M,
    "rows": rows,
    "cols": cols,
}
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 ndarray, ndim 2, dtype family int, shape (3, 2) — shape (3, 2) 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
pp_cat Ran
ran on a synthesized input
ctplab/autoci/HOUDINI/Library/Op.py
code served (permissive licence) · get_code("d8cbcc7a90f679b2")
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 function. 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)

def _list_to_tensor(input: torch.autograd.Variable, chunk: int=1, spl_dim: int=1, cat_dim: int=0) -> torch.autograd.Variable:
    """Convert a pseudo list (tensor) with Batch x Env x Feat to a 
    tensor with (Batch * Env) x Feat, such conversion is more efficient for 
    the follow-up computation with the tensor as input.

    Args:
        input: pytorch tensor with Batch x Env x Feat
        chunk: the size along the splitted dim for each element in the
            intermediate list, mostly = 1
        spl_dim: the dim along which the split operation performs
        cat_dim: the dim along which the cat operation performs

    Returns:
        pytorch tensor with (Batch * Env) x Feat

    """
    input_list = torch.split(input, chunk, dim=spl_dim)
    output = torch.cat(input_list, dim=cat_dim).squeeze(dim=1)
    return output

def pp_cat(fn):
    def ret(x):
        interm, iarg = fn(x)
        out = _list_to_tensor(interm)
        return (out, iarg)
    return ret


# Create a simple function that returns a tensor and an argument
def sample_fn(x):
    # Returns a tensor with shape (Batch=2, Env=3, Feat=4) and an argument
    batch_size = 2
    env_size = 3
    feat_size = 4
    tensor = torch.randn(batch_size, env_size, feat_size)
    arg_value = 42
    return tensor, arg_value


ARGS = {
    "fn": sample_fn
}
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
pp_compose Ran
ran on a synthesized input
ctplab/autoci/HOUDINI/Library/Op.py
code served (permissive licence) · get_code("03f0bf18507cd46b")
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 function. 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)

# pp_compose takes two functions g and f
# It returns a lambda that applies f then g to input x
# So we need callables that can be composed

def f(x):
    """First function in composition"""
    return x * 2

def g(x):
    """Second function in composition"""
    return x + 1

ARGS = {
    "g": g,
    "f": f,
}
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
pp_repeat Ran
ran on a synthesized input
ctplab/autoci/HOUDINI/Library/Op.py
code served (permissive licence) · get_code("ad539a23dc1c9d69")
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 function. 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)

# pp_repeat takes:
# - num: an integer specifying how many times to repeat
# - fn: a function that takes x and returns a transformed x

# Create a simple function that transforms tensors
def transform_fn(x):
    # A simple function that adds 1 to the input
    return x + 1

# Create arguments
num = 3
fn = transform_fn

ARGS = {
    "num": num,
    "fn": fn
}
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
process_results Ran
ran on a synthesized input
ctplab/autoci/src/evaluation.py
code served (permissive licence) · get_code("23947e4fdf54d3ca")
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 3, 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

torch.manual_seed(0)

# Construct unprocessed results as a flat list
# The function expects: unprocessed[i * G * R + G * r : i * G * R + G * (r + 1)]
# to return G items for policy i, run r
# So unprocessed should have P * R * G items total

P = 2  # number of policies
R = 3  # number of runs
G = 4  # number of graphs/SCMs/test cases

# Create unprocessed as a flat list with P*R*G items
# Each item is a simple dict representing a result
unprocessed = []
for idx in range(P * R * G):
    unprocessed.append({
        "policy_idx": idx // (R * G),
        "run_idx": (idx // G) % R,
        "graph_idx": idx % G,
        "value": np.random.rand()
    })

ARGS = {
    "unprocessed": unprocessed,
    "P": P,
    "R": R,
    "G": G
}
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 3, 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
sampling_matrix Ran
ran on a synthesized input
ctplab/autoci/src/utils.py
code served (permissive licence) · get_code("e66b388430814dbd")
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 ndarray, ndim 2, dtype family float, shape (4, 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 numpy as np

# Create a small weighted adjacency matrix for a DAG
# Using a 4x4 matrix that represents a directed acyclic graph
# The matrix should be strictly lower triangular (or have a topological ordering)
# to ensure it represents a valid DAG

np.random.seed(0)

# Create a strictly lower triangular matrix to ensure it's a DAG
# This guarantees (I - W.T) is invertible
W = np.array([
    [0.0, 0.0, 0.0, 0.0],
    [0.2, 0.0, 0.0, 0.0],
    [0.1, 0.3, 0.0, 0.0],
    [0.15, 0.25, 0.1, 0.0]
], dtype=np.float64)

ARGS = {
    "W": W
}
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 ndarray, ndim 2, dtype family float, shape (4, 4) — shape (4, 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

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, 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 11 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-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

Randomized controlled trials (RCTs) are considered as the gold standard for testing causal hypotheses in the clinical domain. However, the investigation of prognostic variables of patient outcome in a hypothesized cause-effect route is not feasible using standard statistical methods. Here, we propose a new automated causal inference method (AutoCI) built upon the invariant causal prediction (ICP) framework for the causal re-interpretation of clinical trial data. Compared to existing methods, we show that the proposed AutoCI allows to efficiently determine the causal variables with a clear differentiation on two real-world RCTs of endometrial cancer patients with mature outcome and extensive clinicopathological and molecular data. This is achieved via suppressing the causal probability of non-causal variables by a wide margin. In ablation studies, we further demonstrate that the assignment of causal probabilities by AutoCI remain consistent in the presence of confounders. In conclusion, these results confirm the robustness and feasibility of AutoCI for future applications in real-world clinical analysis.

For agents

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

get_harvested_code_for_paper("2201.05773")
get_code_for_paper("2201.05773")
have("2201.05773")

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

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

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

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

Connect an agent — have() is free.