SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2409.02772 · 2024

Unifying Causal Representation Learning with the Invariance Principle

arXiv · PDF · Open in the Atlas

Code that ran

8 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; 3 honoured the contract we drafted, 1 violated it and 0 have no contract verdict; 4 failures of our instrument; 3 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/2409.02772.json · badge: /api/ran/2409.02772.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
causallearningai/istant canonical (classifier label)
classifier basis: census
8 ran · 3 no recorded run
FunctionStatusWhere it lives
calculate_fid Ran
ran, honoured the contract we drafted
causallearningai/istant/src/fid.py
code served (permissive licence) · get_code("96b4601bba4ef6a5")
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 float64, 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

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

# Create two sets of sample vectors for FID calculation
# vectors1: 10 samples, 8-dimensional feature vectors
vectors1 = np.random.randn(10, 8).astype(np.float32)

# vectors2: 10 samples, 8-dimensional feature vectors
vectors2 = np.random.randn(10, 8).astype(np.float32)

ARGS = {
    "vectors1": vectors1,
    "vectors2": vectors2,
}
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 float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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
calculate_statistics Ran
ran; our contract draft was wrong, not the code
causallearningai/istant/src/fid.py
code served (permissive licence) · get_code("f2bff88ef89ab53a")
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 small batch of vectors with distinct dimensions
# 5 vectors, each of dimension 4
vectors = np.array([
    [1.0, 2.0, 3.0, 4.0],
    [2.0, 3.0, 4.0, 5.0],
    [3.0, 4.0, 5.0, 6.0],
    [4.0, 5.0, 6.0, 7.0],
    [5.0, 6.0, 7.0, 8.0]
], dtype=np.float32)

ARGS = {
    "vectors": vectors
}
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
encoder Ran
ran; our contract draft was wrong, not the code
causallearningai/istant/src/model.py
code served (permissive licence) · get_code("75adcf725fb50672")
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
import torch.nn as nn

torch.manual_seed(0)

# Create a minimal mock processor
class MockProcessor:
    def __call__(self, images=None, return_tensors=None):
        # Return a mock inputs object with a .to() method
        batch_size = images.shape[0] if isinstance(images, torch.Tensor) else 2
        mock_inputs = {
            'pixel_values': torch.randn(batch_size, 3, 8, 8)
        }
        return MockInputs(mock_inputs)

class MockInputs:
    def __init__(self, data):
        self.data = data
    
    def to(self, device):
        result = {}
        for k, v in self.data.items():
            if isinstance(v, torch.Tensor):
                result[k] = v.to(device)
            else:
                result[k] = v
        return MockInputsOnDevice(result)

class MockInputsOnDevice:
    def __init__(self, data):
        self.data = data
    
    def __getitem__(self, key):
        return self.data[key]
    
    def keys(self):
        return self.data.keys()

# Create a minimal mock model
class MockModel(nn.Module):
    def __init__(self, model_name):
        super().__init__()
        self.config = type('Config', (), {'_name_or_path': model_name})()
        self.linear = nn.Linear(3, 4)
    
    def __call__(self, **kwargs):
        # Extract pixel_values from inputs
        pixel_values = kwargs.get('pixel_values', torch.randn(2, 3, 8, 8))
        batch_size = pixel_values.shape[0]
        
        # For ViT/DINO/SigLIP: return hidden_states with shape [batch, seq_len, hidden_dim]
        # seq_len includes class token at position 0
        if 'vit' in self.config._name_or_path or 'dino' in self.config._name_or_path or 'siglip' in self.config._name_or_path:
            hidden_state = torch.randn(batch_size, 5, 4)  # [batch, seq_len=5, hidden_dim=4]
        # For ResNet: return hidden_states with shape [batch, channels, height, width]
        elif 'resnet' in self.config._name_or_path:
            hidden_state = torch.randn(batch_size, 4, 3, 3)  # [batch, channels=4, h=3, w=3]
        
        return type('Output', (), {'hidden_states': [hidden_state]})()

# Create arguments
x = torch.randn(2, 3, 8, 8)  # batch_size=2, channels=3, height=8, width=8
model = MockModel('vit-base')
processor = MockProcessor()
device = 'cpu'
token = 'class'

ARGS = {
    'x': x,
    'model': model,
    'processor': processor,
    'device': device,
    'token': token
}
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
get_metric Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
causallearningai/istant/src/utils.py
code served (permissive licence) · get_code("b22d0f8ac28b9717")
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 float, ndim 0, dtype family float, 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 torch.nn as nn

torch.manual_seed(0)

# Create small tensors for Y and Y_hat
# Y: ground truth labels (binary classification)
# Y_hat: predicted labels
Y = torch.tensor([0, 1, 1, 0], dtype=torch.long)
Y_hat = torch.tensor([0, 1, 0, 0], dtype=torch.long)

ARGS = {
    'Y': Y,
    'Y_hat': Y_hat,
    'metric': 'accuracy'
}
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 float, ndim 0, dtype family float, 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
get_outcome Ran
ran, honoured the contract we drafted
causallearningai/istant/src/data.py
code served (permissive licence) · get_code("243c2a0c24691da1")
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, 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

torch.manual_seed(0)

# Create a small dataset dict with 'outcome' key
# The function accesses dataset['outcome'] and indexes it with [:, 0], [:, 1]
# so it needs to be a 2D tensor (or array-like)
# Using shape (2, 2) for a batch of 2 samples with 2 outcome dimensions
outcome_tensor = torch.tensor([
    [1.0, 0.0],
    [0.0, 1.0]
], dtype=torch.float32)

dataset = {
    'outcome': outcome_tensor
}

ARGS = {
    'dataset': dataset,
    'task': '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 Tensor, ndim 2, dtype family float, shape (2, 2) — shape (2, 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
get_split Ran
ran, violated the contract we drafted
causallearningai/istant/src/data.py
code served (permissive licence) · get_code("a1679135216baa49")
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 (8,) 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)

# The function accesses dataset['experiment'] and dataset['position']
# These need to be tensors that support comparison operations
# We'll create a dict with these keys containing small tensors

dataset = {
    'experiment': torch.tensor([0, 1, 2, 3, 4, 0, 1, 2], dtype=torch.long),
    'position': torch.tensor([1, 2, 3, 4, 9, 8, 5, 6], dtype=torch.long)
}

ARGS = {
    'dataset': dataset,
    'split_criteria': 'experiment'
}
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 (8,) — shape (8,) 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
get_time_components Ran
ran, honoured the contract we drafted
causallearningai/istant/src/utils.py
code served (permissive licence) · get_code("1bdfca2ab7c22eb3")
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 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 torch
import numpy as np

def get_time_components(total_seconds):
    days = total_seconds // (24 * 3600)
    total_seconds %= 24 * 3600
    hours = total_seconds // 3600
    total_seconds %= 3600
    minutes = total_seconds // 60
    total_seconds %= 60
    seconds = total_seconds
    return (int(days), int(hours), int(minutes), int(seconds))

# The function takes a single parameter: total_seconds (a number representing seconds)
# It performs integer division and modulo operations on it
# We need to provide a valid numeric value

ARGS = {
    "total_seconds": 90061
}
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 tuple, ndim 1, dtype family int — 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
get_time_string Ran
ran; our contract draft was wrong, not the code
causallearningai/istant/src/utils.py
code served (permissive licence) · get_code("ed2fd1174688e992")
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 str. 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

torch.manual_seed(0)

# The function get_time_string takes one parameter: total_seconds
# Looking at the function body:
# - total_seconds is used in arithmetic operations (// and %)
# - It should be a numeric value representing total seconds

# Test with a reasonably large number of seconds to demonstrate the function
# Let's use 93784 seconds which is more than a day
total_seconds = 93784

ARGS = {
    'total_seconds': total_seconds
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
get_covariates Not yet run
unverified (harvested, no recorded run)
causallearningai/istant/src/data.py
code served (permissive licence) · get_code("9d89e0f19971138e")
How it ran

no invocation recorded.

get_embeddings Not yet run
unverified (harvested, no recorded run)
causallearningai/istant/src/model.py
code served (permissive licence) · get_code("c2c6795c770350e2")
How it ran

no invocation recorded.

get_model Not yet run
unverified (harvested, no recorded run)
causallearningai/istant/src/model.py
code served (permissive licence) · get_code("1b2f75878327a8d3")
How it ran

no invocation recorded.

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

Causal representation learning (CRL) aims at recovering latent causal variables from high-dimensional observations to solve causal downstream tasks, such as predicting the effect of new interventions or more robust classification. A plethora of methods have been developed, each tackling carefully crafted problem settings that lead to different types of identifiability. These different settings are widely assumed to be important because they are often linked to different rungs of Pearl's causal hierarchy, even though this correspondence is not always exact. This work shows that instead of strictly conforming to this hierarchical mapping, many causal representation learning approaches methodologically align their representations with inherent data symmetries. Identification of causal variables is guided by invariance principles that are not necessarily causal. This result allows us to unify many existing approaches in a single method that can mix and match different assumptions, including non-causal ones, based on the invariance relevant to the problem at hand. It also significantly benefits applicability, which we demonstrate by improving treatment effect estimation on real-world high-dimensional ecological data. Overall, this paper clarifies the role of causal assumptions in the discovery of causal variables and shifts the focus to preserving data symmetries.

For agents

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

get_harvested_code_for_paper("2409.02772")
get_code_for_paper("2409.02772")
have("2409.02772")

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

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

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

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

Connect an agent — have() is free.