SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2111.02275 · NeurIPS · 2021

Causal-BALD: Deep Bayesian Active Learning of Outcomes to Infer Treatment-Effects from Observational Data

Yarin Gal, Uri Shalit, Panagiotis Tigas, Andrew Jesson, Joost Van Amersfoort, Andreas Kirsch

arXiv · PDF · Open in the Atlas

Code that ran

10 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; 4 honoured the contract we drafted, 3 violated it and 2 have no contract verdict; 1 failure of our instrument; 1 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/2111.02275.json · badge: /api/ran/2111.02275.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
anndvision/causal-bald community (classifier label)
classifier basis: plan_row
6 ran · 0 no recorded run
OATML/causal-bald reimplementation (classifier label)
classifier basis: classifier_2025
2 ran · 1 no recorded run
oatml/causal-bald community
Papers with Code archive
1 ran · 0 no recorded run
uqhwen2/MACAL community
Papers with Code archive
1 ran · 0 no recorded run
FunctionStatusWhere it lives
initial_values_for_GP Ran
ran on a synthesized input
anndvision/causal-bald/causal_bald/library/modules/gaussian_process.py
code served (permissive licence) · get_code("9c197f35ac258581")
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. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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)

# Create a minimal feature extractor that takes input and outputs features
class SimpleFeatureExtractor(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(7, 5)  # Input 7 (from X[:-1]), output 5 features
    
    def forward(self, x):
        return self.linear(x)

# Create a minimal dataset
class SimpleDataset:
    def __init__(self, size=50):
        self.size = size
    
    def __len__(self):
        return self.size
    
    def __getitem__(self, idx):
        # Return (X, y) where X has shape [8] (7 + 1, since we slice [:-1])
        x = torch.randn(8)
        y = torch.randn(1)
        return (x, y)

# Build the arguments
train_dataset = SimpleDataset(size=50)
feature_extractor = SimpleFeatureExtractor()
n_inducing_points = 10
device = 'cpu'

ARGS = {
    'train_dataset': train_dataset,
    'feature_extractor': feature_extractor,
    'n_inducing_points': n_inducing_points,
    'device': device
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
sklearn, 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
mu Ran
ran, violated the contract we drafted
OATML/causal-bald/causal_bald/library/acquisitions.py
code served (permissive licence) · get_code("fe199cc2a1fe1289")
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 ndarray, ndim 1, dtype family float, shape (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
import torch

torch.manual_seed(0)

# Create mu_0: needs .var(0) method, so it should be a numpy array or similar
# The function calls .var(0) on it, so it needs to support variance calculation
mu_0 = np.random.randn(2, 4)  # batch_size=2, dim=4

# Create mu_1: also needs .var(0) method
mu_1 = np.random.randn(2, 4)  # batch_size=2, dim=4

# Create t: a scalar value between 0 and 1 (interpolation parameter)
t = 0.3

# Create pt: based on the function signature, pt is a parameter but not used in the body
# It's included in the function signature but never referenced, so we provide a dummy value
pt = None

# Create temperature: a positive scalar for scaling
temperature = 1.0

ARGS = {
    "mu_0": mu_0,
    "mu_1": mu_1,
    "t": t,
    "pt": pt,
    "temperature": temperature,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, scipy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (4,) — shape (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
mu Ran
ran, violated the contract we drafted
anndvision/causal-bald/causal_bald/library/acquisitions.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from uqhwen2/MACAL, is pointer only (licence: NONE) · get_code("db1200b166ffcce8")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from uqhwen2/MACAL, 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.

random Ran
ran, honoured the contract we drafted
OATML/causal-bald/causal_bald/library/acquisitions.py
code served (permissive licence) · get_code("d1d75b1a3ca1e0b9")
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 ndarray, 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 numpy as np
from scipy import stats

# Construct valid arguments for the random function
mu_0 = np.array([1.0, 2.0, 3.0, 4.0])
mu_1 = np.array([5.0, 6.0, 7.0, 8.0])
t = np.array([[0.1, 0.2, 0.3, 0.4],
              [0.5, 0.6, 0.7, 0.8]])
pt = np.array([[0.9, 0.1],
               [0.2, 0.8]])
temperature = 1.0

ARGS = {
    "mu_0": mu_0,
    "mu_1": mu_1,
    "t": t,
    "pt": pt,
    "temperature": temperature
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, scipy — 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 (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
random Ran
ran, honoured the contract we drafted
anndvision/causal-bald/causal_bald/library/acquisitions.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from uqhwen2/MACAL, is pointer only (licence: NONE) · get_code("19f07f2e51d71313")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from uqhwen2/MACAL, 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.

rho Ran
ran, violated the contract we drafted
oatml/causal-bald/causal_bald/library/acquisitions.py
code served (permissive licence) · get_code("98223c6a69bee7ac")
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 1, dtype family float, shape (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
import torch

torch.manual_seed(0)

# Create small numpy arrays for mu_0 and mu_1
# These need to support .var(0) operation
# Shape: (batch_size, feature_dim) = (2, 4)
mu_0 = np.random.randn(2, 4).astype(np.float32)
mu_1 = np.random.randn(2, 4).astype(np.float32)

# t: scalar value between 0 and 1
t = 0.5

# pt: not used in the function body, but required as parameter
pt = None

# temperature: scalar positive value for scaling
temperature = 1.0

ARGS = {
    "mu_0": mu_0,
    "mu_1": mu_1,
    "t": t,
    "pt": pt,
    "temperature": temperature
}
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 ndarray, ndim 1, dtype family float, shape (4,) — shape (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
spectral_norm_conv Ran
ran on a synthesized input
anndvision/causal-bald/causal_bald/library/modules/spectral_norm.py
code served (permissive licence) · get_code("f6e0eda4b68fa6a0")
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 Conv2d. 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)

# Create a Conv2d module with appropriate dimensions
# The module needs: stride, padding, _parameters, _forward_pre_hooks, _register_state_dict_hook, _register_load_state_dict_pre_hook
module = nn.Conv2d(in_channels=3, out_channels=16, kernel_size=3, stride=(1, 1), padding=(1, 1))

# Define the input dimensions (C, H, W) for the input_dim parameter
input_dim = (3, 32, 32)

# Create ARGS dict with all parameters for spectral_norm_conv
ARGS = {
    'module': module,
    'coeff': 2.0,
    'input_dim': input_dim,
    'n_power_iterations': 1,
    'name': 'weight',
    'eps': 1e-12
}
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 Conv2d — a Conv2d output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Conv2d 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
spectral_norm_fc Ran
ran; our contract draft was wrong, not the code
anndvision/causal-bald/causal_bald/library/modules/spectral_norm.py
code served (permissive licence) · get_code("767be7eb2459660b")
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
from torch import nn

torch.manual_seed(0)

# Create a simple Linear module to apply spectral norm to
module = nn.Linear(in_features=20, out_features=40, bias=True)

# Define arguments for spectral_norm_fc
ARGS = {
    'module': module,
    'coeff': 2.0,
    'n_power_iterations': 1,
    'name': 'weight',
    'eps': 1e-12,
    'dim': None
}
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
sundin Ran
ran, honoured the contract we drafted
uqhwen2/MACAL/causal_bald/library/acquisitions.py
pointer only (licence: NONE) · get_code("795b86a26881a522")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, uqhwen2/MACAL 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.

tau Ran
ran, honoured the contract we drafted
anndvision/causal-bald/causal_bald/library/acquisitions.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from uqhwen2/MACAL, is pointer only (licence: NONE) · get_code("e548c9e01ad0d415")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from uqhwen2/MACAL, 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.

tau Not yet run
unverified (harvested, no recorded run)
OATML/causal-bald/causal_bald/library/acquisitions.py
code served (permissive licence) · get_code("af286d3b9d8e49d2")
How it ran

no invocation recorded. this sample carries JSON test cases instead of a setup block; get_reference_implementation serves them with the level they back.

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 8 distinct functions with an identity, 4 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 4 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
spectral_norm_fc 3 other papers
3 later
2204.10022 (2022-04)
Scalable Sensitivity and Uncertainty Analysis for Causal-Effect Estimates of Continuous-Valued Interventions
2305.04933 (2023-05)
Uncertainty Quantification in Machine Learning for Engineering Design and Health Prognostics: A Tutorial
2410.03446 (2024-10)
On Uncertainty In Natural Language Processing
mu
brick of this paper's assembly: metric
1 other paper
1 later
2302.08981 (2023-02)
Black-Box Batch Active Learning for Regression
random 1 other paper
1 later
2302.08981 (2023-02)
Black-Box Batch Active Learning for Regression
tau
brick of this paper's assembly: helper, metric
1 other paper
1 later
2302.08981 (2023-02)
Black-Box Batch Active Learning for Regression

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

Estimating personalized treatment effects from high-dimensional observational data is essential in situations where experimental designs are infeasible, unethical, or expensive. Existing approaches rely on fitting deep models on outcomes observed for treated and control populations. However, when measuring individual outcomes is costly, as is the case of a tumor biopsy, a sample-efficient strategy for acquiring each result is required. Deep Bayesian active learning provides a framework for efficient data acquisition by selecting points with high uncertainty. However, existing methods bias training data acquisition towards regions of non-overlapping support between the treated and control populations. These are not sample-efficient because the treatment effect is not identifiable in such regions. We introduce causal, Bayesian acquisition functions grounded in information theory that bias data acquisition towards regions with overlapping support to maximize sample efficiency for learning personalized treatment effects. We demonstrate the performance of the proposed acquisition strategies on synthetic and semi-synthetic datasets IHDP and CMNIST and their extensions, which aim to simulate common dataset biases and pathologies.

For agents

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

get_harvested_code_for_paper("2111.02275")
get_code_for_paper("2111.02275")
have("2111.02275")

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

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

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

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

Connect an agent — have() is free.