SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2310.05805 · 2023

Boosted Control Functions: Distribution generalization and invariance in confounded models

arXiv · PDF · Open in the Atlas

Code that ran

9 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; 2 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 7 failures 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/2310.05805.json · badge: /api/ran/2310.05805.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
nicolagnecco/bcf-numerical-experiments canonical (classifier label)
classifier basis: census
9 ran · 1 no recorded run
FunctionStatusWhere it lives
center_y Ran
ran, honoured the contract we drafted
nicolagnecco/bcf-numerical-experiments/python/src/bcf/boosted_control_function_mlp.py
code served (permissive licence) · get_code("4f3dfb032d98a9a8")
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, 1) 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 numpy array for y
y = np.array([[1.5], [2.5], [3.5], [4.5]])

# Create a float value for mu
mu = 2.0

# Define the arguments dictionary
ARGS = {
    "y": y,
    "mu": mu
}
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, 1) — shape (4, 1) 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
create_dataframe Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
nicolagnecco/bcf-numerical-experiments/python/main/experiment_app_identifiability.py
code served (permissive licence) · get_code("257e796d20d29b93")
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 numpy as np
import pandas as pd

# Set random seed for reproducibility
np.random.seed(0)

# Create small numpy arrays with distinct shapes
X = np.random.randn(2, 4)  # 2 samples, 4 features
y = np.random.randn(2)      # 2 target values
y_hat = np.random.randn(2)  # 2 predictions

# Parameters
env = "test_env"
model = "test_model"
int_par = 0.5
col_names = ["feat_0", "feat_1", "feat_2", "feat_3", "y", "y_hat"]

# Construct ARGS dict
ARGS = {
    "X": X,
    "y": y,
    "y_hat": y_hat,
    "env": env,
    "model": model,
    "int_par": int_par,
    "col_names": col_names
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, 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
cross_validate_rrr Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
nicolagnecco/bcf-numerical-experiments/python/src/bcf/reduced_rank_regression.py
code served (permissive licence) · get_code("35bc00b26bbed6d6")
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 RRR. 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 numpy as np

# Set random seeds for reproducibility
np.random.seed(0)

# Create small sample datasets
# X: target matrix (n_samples, n_targets) - shape (6, 3)
n_samples = 6
n_targets = 3
n_features = 4

X = np.random.randn(n_samples, n_targets).astype(np.float64)

# Z: input/instrumental variables matrix (n_samples, n_features) - shape (6, 4)
Z = np.random.randn(n_samples, n_features).astype(np.float64)

# alphas: array of regularization parameters to search over
alphas = np.array([0.5, 1.0, 1.5, 2.0])

ARGS = {
    'X': X,
    'Z': Z,
    'alphas': alphas
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type RRR — a RRR output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a RRR 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
filter_methods Ran
ran; our contract draft was wrong, not the code
nicolagnecco/bcf-numerical-experiments/python/main/experiment_app_identifiability.py
code served (permissive licence) · get_code("7d5b60df9a016dfc")
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 2, 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 torch.nn as nn

torch.manual_seed(0)

# Build a small methods list - this should be a list of tuples (a, b)
# where 'a' is a string identifier and 'b' is some value
methods = [
    ("method_1", "value_1"),
    ("method_2", "value_2"),
    ("method_3", "value_3"),
    ("method_4", "value_4"),
]

# Test case 1: selected_methods as 'all'
ARGS = {
    "methods": methods,
    "selected_methods": 'all'
}
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 2, 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
param_groups_no_bias_decay Ran
ran; our contract draft was wrong, not the code
nicolagnecco/bcf-numerical-experiments/python/src/bcf/mlp.py
code served (permissive licence) · get_code("f49d7199ac08f101")
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 torch.nn as nn

torch.manual_seed(0)

class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 3)
        self.linear2 = nn.Linear(3, 2)
        self.bias_param = nn.Parameter(torch.randn(2))
    
    def forward(self, x):
        x = self.linear1(x)
        x = self.linear2(x)
        return x

module = SimpleModel()

wd = 0.01

ARGS = {
    'module': module,
    'wd': wd
}
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
predict_fx_only Ran
ran; our contract draft was wrong, not the code
nicolagnecco/bcf-numerical-experiments/python/src/bcf/mlp.py
code served (permissive licence) · get_code("e2e03d70705d5828")
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 (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
import torch.nn as nn
import numpy as np

torch.manual_seed(0)

# Define the MLP class
class MLP(nn.Module):
    def __init__(self, in_dim, out_dim=1, hidden=(128, 64), activation=nn.ReLU, dropout=0.0):
        super().__init__()
        layers = []
        d = in_dim
        for h in hidden:
            layers += [nn.Linear(d, h), activation()]
            if dropout > 0:
                layers.append(nn.Dropout(dropout))
            d = h
        layers += [nn.Linear(d, out_dim)]
        self.net = nn.Sequential(*layers)

    def forward(self, x):
        return self.net(x)

# Create a small MLP instance with input_dim=4, output_dim=1
fx = MLP(in_dim=4, out_dim=1, hidden=(8,), activation=nn.ReLU, dropout=0.0)

# Create a small input tensor (batch_size=2, input_dim=4)
X = torch.randn(2, 4)

# Define ARGS dict with all parameters for predict_fx_only
ARGS = {
    'fx': fx,
    'X': X,
    'y_mean': 0.0,
    'device': 'cpu'
}
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 (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
seed_from_string Ran
ran, honoured the contract we drafted
nicolagnecco/bcf-numerical-experiments/python/main/experiment_app_identifiability.py
code served (permissive licence) · get_code("a992cc7da77ebf77")
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 hashlib

def seed_from_string(s: str, offset: int=0) -> int:
    h = hashlib.sha1(s.encode()).digest()[:4]
    return int.from_bytes(h, 'big') + offset & 2147483647

ARGS = {
    "s": "test_string_for_seeding",
    "offset": 42
}
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
split_X_and_Z Ran
ran; our contract draft was wrong, not the code
nicolagnecco/bcf-numerical-experiments/python/src/bcf/helpers.py
code served (permissive licence) · get_code("5f18ab8c408a29cd")
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. 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 numpy as np

# Create a sample concatenated [X, Z] matrix
# Let's say we have 5 samples, 3 endogenous variables (X_original), and 2 exogenous variables (Z)
n_samples = 5
n_endogenous = 3
n_exogenous = 2

# Concatenate X and Z: shape (n_samples, n_endogenous + n_exogenous)
X_concatenated = np.random.randn(n_samples, n_endogenous + n_exogenous)

ARGS = {
    "X": X_concatenated,
    "n_exog": n_exogenous,
}
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 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
split_cont_cat Ran
ran; our contract draft was wrong, not the code
nicolagnecco/bcf-numerical-experiments/python/src/bcf/helpers.py
code served (permissive licence) · get_code("efdd4637109ea2d7")
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 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 numpy as np

# Create a small dataset with 5 samples and 4 features
X = np.array([
    [1.5, 'a', 2.3, 'x'],
    [2.1, 'b', 3.1, 'y'],
    [1.8, 'c', 2.9, 'z'],
    [2.5, 'd', 3.5, 'w'],
    [1.9, 'e', 2.7, 'v']
], dtype=object)

# Convert numeric columns to float, keep categorical as is
X_numeric = np.zeros((5, 4), dtype=object)
X_numeric[:, 0] = np.array([1.5, 2.1, 1.8, 2.5, 1.9], dtype=float)
X_numeric[:, 1] = np.array(['a', 'b', 'c', 'd', 'e'])
X_numeric[:, 2] = np.array([2.3, 3.1, 2.9, 3.5, 2.7], dtype=float)
X_numeric[:, 3] = np.array(['x', 'y', 'z', 'w', 'v'])

# Create a continuous mask: True for continuous features (cols 0, 2), False for categorical (cols 1, 3)
continuous_mask = np.array([True, False, True, False])

ARGS = {
    'continuous_mask': continuous_mask,
    'X': X_numeric
}
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 tuple, ndim 3, 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
predict_full Not yet run
unverified (harvested, no recorded run)
nicolagnecco/bcf-numerical-experiments/python/src/bcf/mlp.py
code served (permissive licence) · get_code("72cf4e0f4c2736b3")
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

Modern machine learning methods and the availability of large-scale data have significantly advanced our ability to predict target quantities from large sets of covariates. However, these methods often struggle under distributional shifts, particularly in the presence of hidden confounding. While the impact of hidden confounding is well-studied in causal effect estimation, e.g., instrumental variables, its implications for prediction tasks under shifting distributions remain underexplored. This work addresses this gap by introducing a strong notion of invariance that, unlike existing weaker notions, allows for distribution generalization even in the presence of nonlinear, non-identifiable structural functions. Central to this framework is the Boosted Control Function (BCF), a novel, identifiable target of inference that satisfies the proposed strong invariance notion and is provably worst-case optimal under distributional shifts. The theoretical foundation of our work lies in Simultaneous Equation Models for Distribution Generalization (SIMDGs), which bridge machine learning with econometrics by describing data-generating processes under distributional shifts. To put these insights into practice, we propose the ControlTwicing algorithm to estimate the BCF using nonparametric machine-learning techniques and study its generalization performance on synthetic and real-world datasets compared to robust and empirical risk minimization approaches.

For agents

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

get_harvested_code_for_paper("2310.05805")
get_code_for_paper("2310.05805")
have("2310.05805")

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

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

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

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

Connect an agent — have() is free.