SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2608.04930 · 2026

SVI-DAG: A Structured Variational Inference Approach to Bayesian Causal Discovery

Shrenik Zinage

arXiv · PDF · Open in the Atlas

Code that ran

7 of 8 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; 1 honoured the contract we drafted, 1 violated it and 0 have no contract verdict; 5 failures of our instrument; 1 no recorded run), measured 2026-11-24; 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/2608.04930.json · badge: /api/ran/2608.04930.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
shrenikvz/SVI-DAG canonical (classifier label)
classifier basis: census
7 ran · 1 no recorded run
FunctionStatusWhere it lives
adam_init Ran
ran; our contract draft was wrong, not the code
shrenikvz/SVI-DAG/other_algorithms/codes_jax/vi-dp-dag/src/jax_utils.py
code served (permissive licence) · get_code("0e491eb2d8af7812")
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 AdamState. 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 jax
import jax.numpy as jnp

# Create sample params - a pytree of jax arrays
params = {
    'layer1': jnp.ones((4, 3)),
    'layer2': jnp.ones((3, 2)),
    'bias': jnp.ones((2,))
}

ARGS = {
    'params': params
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type AdamState — a AdamState output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a AdamState 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
apply_linear_sequential Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
shrenikvz/SVI-DAG/other_algorithms/codes_jax/vi-dp-dag/src/architectures/linear_sequential.py
code served (permissive licence) · get_code("781c526eb6b4b44c")
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 ArrayImpl, ndim 2, dtype family float, shape (2, 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 jax.numpy as jnp
import jax
import torch

torch.manual_seed(0)

# Construct params: list of dicts with 'weight' and 'bias' keys
# Each dict represents a layer with weight and bias parameters
# Using distinct sizes: input=4, hidden1=6, hidden2=5, output=3

params = [
    {
        'weight': jnp.array([[1.0, 2.0, 3.0, 4.0],
                             [5.0, 6.0, 7.0, 8.0],
                             [9.0, 10.0, 11.0, 12.0],
                             [13.0, 14.0, 15.0, 16.0],
                             [17.0, 18.0, 19.0, 20.0],
                             [21.0, 22.0, 23.0, 24.0]]),
        'bias': jnp.array([0.1, 0.2, 0.3, 0.4, 0.5, 0.6])
    },
    {
        'weight': jnp.array([[1.0, 2.0, 3.0, 4.0, 5.0, 6.0],
                             [7.0, 8.0, 9.0, 10.0, 11.0, 12.0],
                             [13.0, 14.0, 15.0, 16.0, 17.0, 18.0],
                             [19.0, 20.0, 21.0, 22.0, 23.0, 24.0],
                             [25.0, 26.0, 27.0, 28.0, 29.0, 30.0]]),
        'bias': jnp.array([0.1, 0.2, 0.3, 0.4, 0.5])
    },
    {
        'weight': jnp.array([[1.0, 2.0, 3.0, 4.0, 5.0],
                             [6.0, 7.0, 8.0, 9.0, 10.0],
                             [11.0, 12.0, 13.0, 14.0, 15.0]]),
        'bias': jnp.array([0.1, 0.2, 0.3])
    }
]

# Construct inputs: batch of 2, flattened to 4 dimensions
inputs = jnp.array([[1.0, 2.0, 3.0, 4.0],
                     [5.0, 6.0, 7.0, 8.0]])

ARGS = {
    'params': params,
    'inputs': inputs
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, ndim 2, dtype family float, shape (2, 3) — shape (2, 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
apply_parallel_linear_sequential Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
shrenikvz/SVI-DAG/other_algorithms/codes_jax/vi-dp-dag/src/architectures/parallel_linear_sequential.py
code served (permissive licence) · get_code("8ccd4ee64d678c6c")
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 ArrayImpl, 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 jax
import jax.numpy as jnp
import numpy as np

# Create a small neural network with 2 layers
# Layer 1: input_dim=4 -> hidden_dim=3
# Layer 2: hidden_dim=3 -> output_dim=2

params = [
    {
        'weight': jnp.array(np.random.randn(3, 4).astype(np.float32)),  # shape (3, 4)
        'bias': jnp.array(np.random.randn(3).astype(np.float32))       # shape (3,)
    },
    {
        'weight': jnp.array(np.random.randn(2, 3).astype(np.float32)),  # shape (2, 3)
        'bias': jnp.array(np.random.randn(2).astype(np.float32))       # shape (2,)
    }
]

# Create input batch: shape (batch_size=2, input_dim=4)
inputs = jnp.array(np.random.randn(2, 4).astype(np.float32))

ARGS = {
    'params': params,
    'inputs': inputs
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, 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
dagify Ran
ran, violated the contract we drafted
shrenikvz/SVI-DAG/other_algorithms/codes_jax/bcd/dag_utils.py
code served (permissive licence) · get_code("05dcb29c3a3282a5")
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, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
import networkx as nx

# Create a weight matrix that may contain cycles
# Start with a matrix that could have cycles
W = np.array([
    [0.0, 0.5, 0.2, 0.0],
    [0.1, 0.0, 0.3, 0.4],
    [0.0, 0.2, 0.0, 0.1],
    [0.6, 0.0, 0.05, 0.0]
], dtype=np.float64)

ARGS = {
    "W": W
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
networkx, 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, 4) — shape (4, 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
process_sachs Ran
ran, honoured the contract we drafted
shrenikvz/SVI-DAG/other_algorithms/codes_jax/bcd/dag_utils.py
code served (permissive licence) · get_code("6f8e813435eda4e1")
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 (10, 5) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
import jax.random as rnd
import tempfile
import csv
import os

# Create a temporary CSV file with sample data
temp_dir = tempfile.mkdtemp()
csv_path = os.path.join(temp_dir, 'sachs_observational.csv')

# Write sample data to CSV
with open(csv_path, 'w', newline='') as f:
    writer = csv.writer(f)
    # Header row
    writer.writerow(['col1', 'col2', 'col3', 'col4', 'col5'])
    # Data rows
    for i in range(10):
        writer.writerow([str(float(i + j)) for j in range(5)])

# Monkey-patch the function to use our temp directory
import sys
original_cwd = os.getcwd()
os.chdir(temp_dir)

# Create the data directory structure
os.makedirs('./data', exist_ok=True)
with open('./data/sachs_observational.csv', 'w', newline='') as f:
    writer = csv.writer(f)
    # Header row
    writer.writerow(['col1', 'col2', 'col3', 'col4', 'col5'])
    # Data rows
    for i in range(10):
        writer.writerow([str(float(i + j)) for j in range(5)])

# Create a JAX random key
rng_key = rnd.PRNGKey(42)

ARGS = {
    'center': True,
    'print_labels': False,
    'normalize': False,
    'n_data': None,
    'rng_key': None
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax, 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 (10, 5) — shape (10, 5) 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
torch_linear_bias_init Ran
ran; our contract draft was wrong, not the code
shrenikvz/SVI-DAG/other_algorithms/codes_jax/vi-dp-dag/src/jax_utils.py
code served (permissive licence) · get_code("285b19fd2aa70cf0")
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 ArrayImpl, ndim 3, dtype family float, shape (2, 4, 5) 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 jax
import jax.numpy as jnp

# Set up a random key for JAX
key = jax.random.PRNGKey(42)

# Define arguments for torch_linear_bias_init
ARGS = {
    "key": key,
    "out_dim": 5,
    "in_dim": 3,
    "prefix_shape": (2, 4),
    "dtype": jnp.float32,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, ndim 3, dtype family float, shape (2, 4, 5) — shape (2, 4, 5) 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
torch_linear_weight_init Ran
ran; our contract draft was wrong, not the code
shrenikvz/SVI-DAG/other_algorithms/codes_jax/vi-dp-dag/src/jax_utils.py
code served (permissive licence) · get_code("b27910ffaf73a038")
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 ArrayImpl, ndim 2, dtype family float, shape (8, 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 jax
import jax.numpy as jnp

# Create a JAX random key
key = jax.random.PRNGKey(0)

# Define dimensions
out_dim = 8
in_dim = 4

# Optional: specify dtype
dtype = jnp.float32

# Construct the arguments dict
ARGS = {
    "key": key,
    "out_dim": out_dim,
    "in_dim": in_dim,
    "dtype": dtype,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, ndim 2, dtype family float, shape (8, 4) — shape (8, 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
count_accuracy Not yet run
unverified (harvested, no recorded run)
shrenikvz/SVI-DAG/other_algorithms/codes_jax/bcd/dag_utils.py
code served (permissive licence) · get_code("3ca759c07395c735")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 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 8 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-24.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Bayesian causal discovery seeks to determine the posterior distribution of causal theories, which are interpreted as directed acyclic graphs (DAGs) that explain the observed data. The resulting posterior allows systematic reasoning regarding epistemic uncertainty within these theories. Nonetheless, finding such graphs is difficult due to identifiability problems and limited observational data. Furthermore, precisely approximating posterior over graphs is challenging given vast range of potential DAGs. Recent Bayesian approaches have addressed some of these challenges, yet they remain limited as they fail to encode dependencies between edges, and lack principled ways to incorporate domain knowledge as inductive biases during the search process. To overcome these limitations, we propose SVI-DAG, a structured variational inference approach to Bayesian causal discovery using observational data and prior beliefs that uses normalizing flows to model dependencies between edges, supporting expressive and multimodal posterior learning over DAGs. To mitigate mode seeking behaviour in evidence lower bound optimization and promote mode coverage, we use stein variational gradient descent to update the node potentials using a kernel in acyclicity space. We evaluate SVI-DAG against 5 state-of-the-art Bayesian DAG learning methods and demonstrate competitive performance in terms of both accuracy and uncertainty quantification. The code is available at https://github.com/shrenikvz/SVI-DAG. * This work was conducted while the author was a PhD student at Purdue University. 2 The Markov equivalence class is the set of DAGs that encode the same conditional independencies.

For agents

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

get_harvested_code_for_paper("2608.04930")
get_code_for_paper("2608.04930")
have("2608.04930")

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

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

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

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

Connect an agent — have() is free.