SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2206.02416 · 2022

Embrace the Gap: VAEs Perform Independent Mechanism Analysis

arXiv · PDF · Open in the Atlas

Code that ran

11 of 15 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 10 have no contract verdict; 1 failure of our instrument; 4 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/2206.02416.json · badge: /api/ran/2206.02416.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
rpatrik96/ima-vae canonical (classifier label)
classifier basis not recorded on the link
11 ran · 4 no recorded run
FunctionStatusWhere it lives
amari_distance Ran
ran on a synthesized input
rpatrik96/ima-vae/ima_vae/metrics/amari.py
code served (permissive licence) · get_code("119ad9c491e1ed7f")
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

torch.manual_seed(0)

# Create small square matrices for W and A
# The function expects (n_features, n_features) shaped tensors
# Looking at the code, it does P = W @ A and then accesses P.shape[1]
# and uses .abs(), .permute(0, 2, 1) which suggests it may expect batched tensors
# But the signature says shape (n_features, n_features)
# However, the permute(0, 2, 1) indicates batch dimension is present
# Let's create 3D tensors: (batch, n_features, n_features)

n_features = 4
batch_size = 2

W = torch.randn(batch_size, n_features, n_features)
A = torch.randn(batch_size, n_features, n_features)

ARGS = {
    "W": W,
    "A": A,
}
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
batch_jacobian Ran
ran on a synthesized input
rpatrik96/ima-vae/ima_vae/utils.py
code served (permissive licence) · get_code("ebde3b734314d2fc")
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 3, dtype family float, shape (2, 3, 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
from torch.autograd import functional

torch.manual_seed(0)

# Define a simple function that takes a batch of inputs and produces outputs
# The function needs to work with functional.jacobian
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        # x shape: (batch_size, 4)
        # output shape: (batch_size, 3)
        return self.linear(x)

# Create the model
model = SimpleModel()

# Define the function to compute jacobian for
# This function takes input x and returns output
def func(x):
    return model(x)

# Create input tensor: batch_size=2, input_dim=4
x = torch.randn(2, 4, requires_grad=True)

# Define arguments dictionary
ARGS = {
    'func': func,
    'x': x,
    'create_graph': False
}
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 3, dtype family float, shape (2, 3, 4) — shape (2, 3, 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
cima_kl_diagonality Ran
ran on a synthesized input
rpatrik96/ima-vae/ima_vae/metrics/cima.py
code served (permissive licence) · get_code("78c1fa7888a78cf5")
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 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 numpy as np

torch.manual_seed(0)

# Create a small jacobian matrix
# The function uses: jacobian.T @ jacobian, lib.diag(), lib.linalg.slogdet()
# So we need a 2D tensor that supports these operations
jacobian = torch.randn(4, 3)

ARGS = {
    "jacobian": jacobian
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, 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
col_norms Ran
ran on a synthesized input
rpatrik96/ima-vae/ima_vae/metrics/conformal.py
code served (permissive licence) · get_code("f7a92cf3d1031256")
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 (3,) 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 jacobian tensor
# jacobian should be a 2D tensor where we compute column-wise L2 norms
# Shape: (rows=4, cols=3) to have distinct dimensions
jacobian = torch.randn(4, 3)

ARGS = {
    "jacobian": jacobian
}
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 (3,) — shape (3,) 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
conformal_contrast Ran
ran on a synthesized input
rpatrik96/ima-vae/ima_vae/metrics/conformal.py
code served (permissive licence) · get_code("b7ad76ea349de2d9")
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 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

torch.manual_seed(0)

# Create a small jacobian tensor
# The function computes JJ_T which is (n, n), then uses .diag() and .abs()
# So we need a square or rectangular matrix. Let's use a small 4x3 jacobian
jacobian = torch.randn(4, 3)

ARGS = {
    "jacobian": jacobian
}
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 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
frobenius_diagonality Ran
ran on a synthesized input
rpatrik96/ima-vae/ima_vae/metrics/conformal.py
code served (permissive licence) · get_code("0335cbb982e4e9cc")
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 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

torch.manual_seed(0)

# Create a small correlation-like matrix
# The function expects a square matrix and computes diagonality
# A correlation matrix should be symmetric and have 1s on the diagonal
matrix = torch.tensor([
    [1.0, 0.2, 0.1, 0.3],
    [0.2, 1.0, 0.4, 0.15],
    [0.1, 0.4, 1.0, 0.25],
    [0.3, 0.15, 0.25, 1.0]
], dtype=torch.float32)

ARGS = {
    "matrix": matrix
}
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 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_interp_name Ran
ran on a synthesized input
rpatrik96/ima-vae/ima_vae/utils.py
code served (permissive licence) · get_code("acc74785b01233e3")
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

class Args:
    def __init__(self):
        self.shape = 128
        self.angle = 45
        self.diag = "True"
        self.seed = 42
        self.beta = 0.5

ARGS = {"args": Args()}
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 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_save_name Ran
ran on a synthesized input
rpatrik96/ima-vae/ima_vae/utils.py
code served (permissive licence) · get_code("1f48aaf39a559c76")
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

class Args:
    def __init__(self):
        self.dset = "cifar10"
        self.shape = 32.5
        self.angle = 45.7
        self.diag = True
        self.seed = 42
        self.beta = 0.95

ARGS = {
    'args': Args()
}
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_sprites_models Ran
ran on a synthesized input
rpatrik96/ima-vae/ima_vae/models/nets.py
code served (permissive licence) · get_code("9672393a0bfcc23e")
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 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)

ARGS = {
    "z_dim": 32,
    "post_dim": 64,
    "n_channels": 3,
}
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 tuple, ndim 2, 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
get_synth_models Ran
ran on a synthesized input
rpatrik96/ima-vae/ima_vae/models/nets.py
code served (permissive licence) · get_code("8c5b57d3b395a183")
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 torch
import torch.nn as nn

torch.manual_seed(0)

ARGS = {
    'data_dim': 4,
    'latent_dim': 3,
    'hidden_dim': 8,
    'post_dim': 5,
    'n_layers': 2,
    'activation': 'lrelu',
    'device': 'cpu',
    'slope': 0.2,
    'encoder_extra_layers': 0,
    'encoder_extra_width': 0,
}
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 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
make_cost_matrix Ran
ran; our contract draft was wrong, not the code
rpatrik96/ima-vae/ima_vae/metrics/mcc.py
code served (permissive licence) · get_code("ff5945eb18d03970")
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 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

torch.manual_seed(0)

# Define a simple inversion function that converts profit to cost
def inversion_function(value):
    """Convert a profit value to a cost value by negating it."""
    return -value

# Create a small profit matrix (2x3 for distinct dimensions)
profit_matrix = [
    [10, 20, 30],
    [40, 50, 60]
]

ARGS = {
    "profit_matrix": profit_matrix,
    "inversion_function": inversion_function
}
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 2, 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
compute_mig_with_discrete_factors Not yet run
unverified (harvested, no recorded run)
rpatrik96/ima-vae/ima_vae/metrics/mig.py
code served (permissive licence) · get_code("048ffc98e750b58a")
How it ran

no invocation recorded.

correlation Not yet run
unverified (harvested, no recorded run)
rpatrik96/ima-vae/ima_vae/metrics/mcc.py
code served (permissive licence) · get_code("0152ff71b8ba45fe")
How it ran

no invocation recorded.

get_prediction_score Not yet run
unverified (harvested, no recorded run)
rpatrik96/ima-vae/ima_vae/metrics/mig.py
code served (permissive licence) · get_code("5cae75030ada9571")
How it ran

no invocation recorded.

mutual_information Not yet run
unverified (harvested, no recorded run)
rpatrik96/ima-vae/ima_vae/metrics/mig.py
code served (permissive licence) · get_code("3ffdfd80343c4173")
How it ran

no invocation recorded.

Also present in other papers' code

Of 15 samples lifted from this paper's linked repositories, 15 carry a function identity and 0 do not. Of the 15 distinct functions with an identity, 2 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 2 later) and 13 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
make_cost_matrix 8 other papers
1 dated earlier, 7 later · 2 only as an assembly brick
2007.10930 (2020-07)
Towards Nonlinear Disentanglement in Natural Data with Temporal Sparse Coding
2210.13647 (2022-10)
Temporally Disentangled Representation Learning
2310.15709 (2023-10)
Causal Representation Learning Made Identifiable by Grouping of Observational Variables
and 5 more not named here
correlation 1 other paper
1 later
2311.18048 (2023-11)
An Interventional Perspective on Identifiability in Gaussian LTI Systems with Independent Component Analysis

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

Variational autoencoders (VAEs) are a popular framework for modeling complex data distributions; they can be efficiently trained via variational inference by maximizing the evidence lower bound (ELBO), at the expense of a gap to the exact (log-)marginal likelihood. While VAEs are commonly used for representation learning, it is unclear why ELBO maximization would yield useful representations, since unregularized maximum likelihood estimation cannot invert the data-generating process. Yet, VAEs often succeed at this task. We seek to elucidate this apparent paradox by studying nonlinear VAEs in the limit of near-deterministic decoders. We first prove that, in this regime, the optimal encoder approximately inverts the decoder -- a commonly used but unproven conjecture -- which we refer to as {\em self-consistency}. Leveraging self-consistency, we show that the ELBO converges to a regularized log-likelihood. This allows VAEs to perform what has recently been termed independent mechanism analysis (IMA): it adds an inductive bias towards decoders with column-orthogonal Jacobians, which helps recovering the true latent factors. The gap between ELBO and log-likelihood is therefore welcome, since it bears unanticipated benefits for nonlinear representation learning. In experiments on synthetic and image data, we show that VAEs uncover the true latent factors when the data generating process satisfies the IMA assumption.

For agents

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

get_harvested_code_for_paper("2206.02416")
get_code_for_paper("2206.02416")
have("2206.02416")

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

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

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

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

Connect an agent — have() is free.