SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2310.02423 · ICLR · 2024

Delta-AI: Local objectives for amortized inference in sparse graphical models

Yoshua Bengio, Dinghuai Zhang, Guillaume Lajoie, Chen Sun, Hae Lee, Nikolay Malkin, Jean-Pierre Falet, Dragos Secrieru, Thomas Jiralerspong

arXiv · PDF · Open in the Atlas

Code that ran

3 of 4 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, 0 violated it and 0 have no contract verdict; 2 failures of our instrument; 1 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/2310.02423.json · badge: /api/ran/2310.02423.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
gfnorg/delta-ai canonical (classifier label)
classifier basis: classifier_2025
3 ran · 0 no recorded run
GFNOrg/Delta-AI canonical (classifier label)
classifier basis: census
0 ran · 1 no recorded run
FunctionStatusWhere it lives
get_ilist_and_set_dags Ran
ran; our contract draft was wrong, not the code
gfnorg/delta-ai/mnist/main_delta.py
code served (permissive licence) · get_code("b289c9e306fa90d2")
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) and returned Tensor, ndim 1, dtype family int, shape (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)

class MockPGM(nn.Module):
    def __init__(self):
        super().__init__()
    
    def sample_and_set_subdags(self, ilist):
        pass
    
    def sample_and_set_fulldag(self, batchsz):
        pass

class Args:
    def __init__(self):
        self.alg = 'fixed'
        self.n_nodes = 4
        self.device = 'cpu'
        self.sampling_dag = 'partial'
        self.n_subdags_per_node = 1
        self.n_fulldags_per_batch = 2
        self.repeat_nodes = 1

pgm = MockPGM()
p_ilist_F = torch.softmax(torch.randn(8), dim=0)

args = Args()

ARGS = {
    'args': args,
    'pgm': pgm,
    'p_ilist_F': p_ilist_F
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 int, shape (4,) — shape (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
sleep Ran
ran, honoured the contract we drafted
gfnorg/delta-ai/mnist/main_delta.py
code served (permissive licence) · get_code("41f18a3e1b770458")
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) 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 torch.nn as nn

torch.manual_seed(0)

class MockModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def sampleV(self, batchsz, mode, temp=1, epsilon=0):
        # Returns samples of shape (batchsz, 3)
        return torch.randn(batchsz, 3)
    
    def probV(self, V, mode, log=False):
        # Takes V of shape (batchsz, 3) and returns probabilities
        # Returns shape (batchsz,)
        batchsz = V.shape[0]
        if log:
            return torch.randn(batchsz)
        else:
            return torch.rand(batchsz)

class MockArgs:
    def __init__(self):
        self.batchsz = 2

p = MockModel()
q = MockModel()
args = MockArgs()

ARGS = {
    'args': args,
    'q': q,
    'p': p
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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
train_p Ran
ran; our contract draft was wrong, not the code
gfnorg/delta-ai/mnist/main_delta.py
code served (permissive licence) · get_code("ce83daa38b7bd537")
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) and returned dict. 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)

# Create a minimal args object with required attributes
class Args:
    def __init__(self):
        self.q_objective = 'gibbs'  # or 'other' to test the else branch
        self.xdim = 4
        self.batchsz = 2
        self.sampling_dag = None

args = Args()

# Create X_batch: (batch_size, xdim)
X_batch = torch.randn(2, 4)

# Create q model with required methods
class QModel(nn.Module):
    def __init__(self, xdim):
        super().__init__()
        self.xdim = xdim
        self.linear = nn.Linear(xdim + 3, 1)
    
    def get_gibbs_from_data(self, V_gibbs, start_idx):
        # Returns sampled V_q of same shape as V_gibbs
        return torch.randn_like(V_gibbs)
    
    def sampleV(self, batchsz, sampling_dag, temp, epsilon, X):
        # Returns V_q of shape (batchsz, xdim + latent_dim)
        return torch.randn(batchsz, self.xdim + 3)

q = QModel(xdim=4)

# Create p model with required methods
class PModel(nn.Module):
    def __init__(self, vdim):
        super().__init__()
        self.vdim = vdim
        self.linear = nn.Linear(vdim, 1)
    
    def probV(self, V, sampling_dag, log=False):
        # Returns log probabilities of shape (batch_size,)
        logprobs = self.linear(V).squeeze(-1)
        return logprobs

p = PModel(vdim=7)  # xdim + latent_dim = 4 + 3

# Create optimizer
optimizer_p = torch.optim.Adam(p.parameters(), lr=0.001)

# Create V_gibbs and p_gibbs for gibbs objective
V_gibbs = torch.zeros(2, 7)  # (batch_size, xdim + latent_dim)
p_gibbs = torch.rand(2, 3)   # (batch_size, latent_dim)

ARGS = {
    'args': args,
    'X_batch': X_batch,
    'q': q,
    'p': p,
    'optimizer_p': optimizer_p,
    'V_gibbs': V_gibbs,
    'p_gibbs': p_gibbs,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
load_mnist Not yet run
unverified (harvested, no recorded run)
GFNOrg/Delta-AI/mnist/data.py
code served (permissive licence) · get_code("1005ab6934ffad36")
How it ran

no invocation recorded.

Also present in other papers' code

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

We present a new algorithm for amortized inference in sparse probabilistic graphical models (PGMs), which we call Δ-amortized inference (Δ-AI). Our approach is based on the observation that when the sampling of variables in a PGM is seen as a sequence of actions taken by an agent, sparsity of the PGM enables local credit assignment in the agent's policy learning objective. This yields a local constraint that can be turned into a local loss in the style of generative flow networks (GFlowNets) that enables off-policy training but avoids the need to instantiate all the random variables for each parameter update, thus speeding up training considerably. The Δ-AI objective matches the conditional distribution of a variable given its Markov blanket in a tractable learned sampler, which has the structure of a Bayesian network, with the same conditional distribution under the target PGM. As such, the trained sampler recovers marginals and conditional distributions of interest and enables inference of partial subsets of variables. We illustrate Δ-AI's effectiveness for sampling from synthetic PGMs and training latent variable models with sparse factor structure. Code: https://github.com/GFNOrg/Delta-AI. * Equal contribution. † CIFAR AI Chair. ⋄ CIFAR Senior Fellow.

For agents

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

get_harvested_code_for_paper("2310.02423")
get_code_for_paper("2310.02423")
have("2310.02423")

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

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

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

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

Connect an agent — have() is free.