SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2401.14535 · ICML · 2024

CaRiNG: Learning Temporal Causal Representation under Non-Invertible Generation Process

Kun Zhang, Xiangchen Song, Weiran Yao, Yuewen Sun, Xiao Liu, Guangyi Chen, Yifan Shen, Zhenhao Chen

arXiv · PDF · Open in the Atlas

Code that ran

8 of 10 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (5 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 5 have no contract verdict; 2 failures of our instrument; 2 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/2401.14535.json · badge: /api/ran/2401.14535.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
sanshuiii/caring canonical (classifier label)
classifier basis: classifier_2025
5 ran · 1 no recorded run
sanshuiii/CaRiNG canonical (classifier label)
classifier basis: census
3 ran · 1 no recorded run
FunctionStatusWhere it lives
BetaVAE_MLP Ran
ran on a synthesized input · constructed an object; no result was computed
sanshuiii/caring/caring/modules/stationary.py
code served (permissive licence) · get_code("d4fd240849acc2b3")
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 an instance of its own class, BetaVAE_MLP: the run constructed the object and did not call it, so no result was computed. 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
from torch.nn import functional as F
import torch.nn.init as init
from torch.autograd import Variable

torch.manual_seed(0)

# The function uses BetaVAE_MLP, which is a model that takes:
# - input_dim: dimension of input features
# - z_dim: dimension of latent space
# - decoder_side_truez, decoder_side_hatz, decoder_side_truex: decoder side configuration
# - encoder_side_truez, encoder_side_truex: encoder side configuration
# - hidden_dim: hidden dimension for MLP layers

# The forward method expects:
# - x: input tensor of shape (batch_size, length, input_dim)
# - y: auxiliary tensor of shape (batch_size, length, some_dim)
# - return_z: boolean flag

# Create the model instance
model = nn.Sequential(
    nn.Linear(10, 8),
    nn.ReLU()
)

# Small tensors for testing
batch_size = 2
length = 5
input_dim = 3
z_dim = 4

# Input tensor: (batch_size, length, input_dim)
x = torch.randn(batch_size, length, input_dim)

# Auxiliary tensor for y: (batch_size, length, input_dim) - same as x dimension
y = torch.randn(batch_size, length, input_dim)

ARGS = {
    "input_dim": input_dim,
    "z_dim": z_dim,
    "decoder_side_truez": 0,
    "decoder_side_hatz": 0,
    "decoder_side_truex": 0,
    "encoder_side_truez": 0,
    "encoder_side_truex": 0,
    "hidden_dim": 64,
}
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 BetaVAE_MLP — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a BetaVAE_MLP 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
Inference Ran
ran on a synthesized input · constructed an object; no result was computed
sanshuiii/caring/caring/modules/stationary.py
code served (permissive licence) · get_code("773460f058b3b35c")
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 an instance of its own class, Inference: the run constructed the object and did not call it, so no result was computed. 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)

# Define ARGS dict with all parameters for Inference.__init__
ARGS = {
    'lag': 3,
    'z_dim': 4,
    'num_layers': 2,
    'hidden_dim': 8
}

# Verify the module can be instantiated and run forward pass
if __name__ == "__main__":
    model = nn.Module.Inference(**ARGS)
    
    # Create sample input: batch_size=2, feature dimension needs to match forward logic
    # forward expects x with shape [batch, lag*z_dim + 2*hidden_dim]
    lag = ARGS['lag']
    z_dim = ARGS['z_dim']
    hidden_dim = ARGS['hidden_dim']
    
    input_dim = lag * z_dim + 2 * hidden_dim
    x = torch.randn(2, input_dim)
    
    output = model(x)
    print(f"Input shape: {x.shape}")
    print(f"Output shape: {output.shape}")
    print(f"Expected output shape: [2, {z_dim * 2}]")
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 Inference — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Inference 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
MLPDecoder Ran
ran on a synthesized input · constructed an object; no result was computed
sanshuiii/caring/caring/modules/stationary.py
code served (permissive licence) · get_code("d6c09b008d2e8fe3")
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 an instance of its own class, MLPDecoder: the run constructed the object and did not call it, so no result was computed. 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)

ARGS = {
    "latent_size": 4,
    "num_layers": 3,
    "hidden_dim": 64,
}
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 MLPDecoder — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a MLPDecoder 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
MLPEncoder Ran
ran on a synthesized input · constructed an object; no result was computed
sanshuiii/caring/caring/modules/stationary.py
code served (permissive licence) · get_code("bfc5af9d3691e10d")
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 an instance of its own class, MLPEncoder: the run constructed the object and did not call it, so no result was computed. 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)

# MLPEncoder takes latent_size, num_layers, and hidden_dim as parameters
# latent_size: int, the input/output feature dimension
# num_layers: int, number of layers in the MLP
# hidden_dim: int, hidden dimension size

ARGS = {
    "latent_size": 4,
    "num_layers": 3,
    "hidden_dim": 64,
}
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 MLPEncoder — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a MLPEncoder 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
NPTransitionPrior Ran
ran on a synthesized input · constructed an object; no result was computed
sanshuiii/caring/caring/modules/stationary.py
code served (permissive licence) · get_code("bdecb548777436c9")
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 an instance of its own class, NPTransitionPrior: the run constructed the object and did not call it, so no result was computed. 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)

# Define the function's class dependencies (already provided in the function)
class NLayerLeakyMLP(nn.Module):
    def __init__(self, in_features, out_features, num_layers, hidden_dim=64, bias=True):
        super().__init__()
        layers = []
        for l in range(num_layers):
            if l == 0:
                layers.append(nn.Linear(in_features, hidden_dim))
                layers.append(nn.LeakyReLU(0.2))
            else:
                layers.append(nn.Linear(hidden_dim, hidden_dim))
                layers.append(nn.LeakyReLU(0.2))
        layers.append(nn.Linear(hidden_dim, out_features))
        self.net = nn.Sequential(*layers)

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

# Construct arguments for NPTransitionPrior.__init__
lags = 2
latent_size = 4
num_layers = 2
hidden_dim = 32

ARGS = {
    'lags': lags,
    'latent_size': latent_size,
    'num_layers': num_layers,
    'hidden_dim': hidden_dim,
}
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 NPTransitionPrior — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a NPTransitionPrior 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
concat_x_byx Ran
ran; our contract draft was wrong, not the code
sanshuiii/CaRiNG/caring/datasets/checker.py
code served (permissive licence) · get_code("af54234bb8d55554")
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 small test arrays
# x should have shape (batch, time, features)
# y should have shape (batch, time, output_features)
batch_size = 2
time_steps = 5
input_features = 3
output_features = 4

x = np.random.randn(batch_size, time_steps, input_features).astype(np.float32)
y = np.random.randn(batch_size, time_steps, output_features).astype(np.float32)

lag = 2

ARGS = {
    "x": x,
    "y": y,
    "lag": lag
}
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
concat_x_byy Ran
ran; our contract draft was wrong, not the code
sanshuiii/CaRiNG/caring/datasets/checker.py
code served (permissive licence) · get_code("819cc462002cb6c0")
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 small test arrays with distinct dimensions
# x: (batch=2, time=5, features=4)
# y: (batch=2, time=5, features=3)
x = np.random.randn(2, 5, 4).astype(np.float32)
y = np.random.randn(2, 5, 3).astype(np.float32)
lag = 2

ARGS = {
    "x": x,
    "y": y,
    "lag": lag,
}
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
reparametrize Ran
ran, honoured the contract we drafted
sanshuiii/CaRiNG/caring/modules/components/beta.py
code served (permissive licence) · get_code("863fc64cd51264f0")
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
from torch.autograd import Variable

torch.manual_seed(0)

# The function reparametrize expects:
# - mu: a tensor (used with arithmetic operations and passed to std.data.new)
# - logvar: a tensor (used with .div(2).exp() and .data.new and .size())

# Create small tensors for mu and logvar
# logvar should be a log variance tensor
mu = torch.randn(2, 4)
logvar = torch.randn(2, 4)

ARGS = {
    "mu": mu,
    "logvar": logvar,
}
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
StationaryProcess Not yet run
unverified (harvested, no recorded run)
sanshuiii/caring/caring/modules/stationary.py
code served (permissive licence) · get_code("bec6363e2390b390")
How it ran

no invocation recorded.

check_lag_byx Not yet run
unverified (harvested, no recorded run)
sanshuiii/CaRiNG/caring/datasets/checker.py
code served (permissive licence) · get_code("efb4053bab2aa8c2")
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, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 1 later) and 9 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
reparametrize
brick of this paper's assembly: helper
10 other papers
7 dated earlier, 3 later · 2 only as an assembly brick
2105.14203 (2021-05)
Understanding Instance-based Interpretability of Variational Auto-Encoders
2111.02338 (2021-11)
Drop, Swap, and Generate: A Self-Supervised Approach for Generating Neural Activity
2210.13647 (2022-10)
Temporally Disentangled Representation Learning
and 7 more not named here

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

Identifying the underlying time-delayed latent causal processes in sequential data is vital for grasping temporal dynamics and making downstream reasoning. While some recent methods can robustly identify these latent causal variables, they rely on strict assumptions about the invertible generation process from latent variables to observed data. However, these assumptions are often hard to satisfy in real-world applications containing information loss. For instance, the visual perception process translates a 3D space into 2D images, or the phenomenon of persistence of vision incorporates historical data into current perceptions. To address this challenge, we establish an identifiability theory that allows for the recovery of independent latent components even when they come from a nonlinear and non-invertible mix. Using this theory as a foundation, we propose a principled approach, CaRiNG, to learn the Causal Representation of Non-invertible Generative temporal data with identifiability guarantees. Specifically, we utilize temporal context to recover lost latent information and apply the conditions in our theory to guide the training process. Through experiments conducted on synthetic datasets, we validate that our CaRiNG method reliably identifies the causal process, even when the generation process is non-invertible. Moreover, we demonstrate that our approach considerably improves temporal understanding and reasoning in practical applications. Code can be accessed through https: //github.com/sanshuiii/CaRiNG.

For agents

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

get_harvested_code_for_paper("2401.14535")
get_code_for_paper("2401.14535")
have("2401.14535")

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

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

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

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

Connect an agent — have() is free.