SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2407.00649 · NeurIPS · 2024

Particle Semi-Implicit Variational Inference

Jen Lim, Adam Johansen

arXiv · PDF · Open in the Atlas

Code that ran

4 of 11 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (3 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 3 have no contract verdict; 1 failure of our instrument; 7 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/2407.00649.json · badge: /api/ran/2407.00649.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
jenninglim/pvi canonical (classifier label)
classifier basis: classifier_2025
3 ran · 5 no recorded run
longinYu/SIVISM canonical (classifier label)
classifier basis: census
1 ran · 2 no recorded run
FunctionStatusWhere it lives
PID Ran
ran on a synthesized input · constructed an object; no result was computed
jenninglim/pvi/src/trainers/pvi.py
code served (permissive licence) · get_code("2bbf1397f3429464")
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, PID: 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 jax
import jax.numpy as jnp
import jax.random as jr
import equinox as eqx
from typing import Union

# Define a minimal conditional module that satisfies the interface
class MinimalConditional(eqx.Module):
    d_z: int = 4
    d_x: int = 3
    d_y: int = 2
    
    def __init__(self):
        self.d_z = 4
        self.d_x = 3
        self.d_y = 2
    
    def log_prob(self, x: jax.Array, z: jax.Array, y: jax.Array):
        """
        Compute log probability of x given z and y.
        x: shape (d_x,)
        z: shape (d_z,)
        y: shape (d_y,)
        """
        # Simple implementation: return a scalar log probability
        return jnp.sum(x) + jnp.sum(z) + jnp.sum(y)
    
    def sample(self, key: jax.random.PRNGKey, n_samples: int, z: jax.Array, y: jax.Array):
        """
        Sample from the conditional distribution.
        Returns samples of shape (n_samples, d_x)
        """
        return jr.normal(key, (n_samples, self.d_x))
    
    def get_filter_spec(self):
        """Return filter spec for this module"""
        return jax.tree_util.tree_map(lambda _: False, self)
    
    def apply_updates(self, updates):
        """Apply updates to this module"""
        return self

# Create minimal arguments
key = jr.PRNGKey(0)
conditional = MinimalConditional()
n_particles = 5

ARGS = {
    "key": key,
    "conditional": conditional,
    "n_particles": n_particles,
    "init": None,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
equinox, jax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type PID — 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 PID 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
PIDOpt Ran
ran on a synthesized input · constructed an object; no result was computed
jenninglim/pvi/src/trainers/pvi.py
code served (permissive licence) · get_code("5ee9582619fa14ed")
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, PIDOpt: 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
import optax
from optax._src.base import GradientTransformation, OptState

torch.manual_seed(0)

# Create simple GradientTransformation objects
# GradientTransformation is a NamedTuple with (init, update) callables

def create_simple_optim():
    """Create a minimal GradientTransformation"""
    opt = optax.sgd(learning_rate=0.01)
    return opt

theta_optim = create_simple_optim()
r_optim = create_simple_optim()

# r_precon can be None or any object - keeping it simple as None
# but could also be a small callable or config object if needed
r_precon = None

ARGS = {
    "theta_optim": theta_optim,
    "r_optim": r_optim,
    "r_precon": r_precon,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
optax, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type PIDOpt — the run constructed an instance of its own class and did not call it; no shape 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
PIDParameters Ran
ran on a synthesized input · constructed an object; no result was computed
jenninglim/pvi/src/trainers/pvi.py
code served (permissive licence) · get_code("d3956a1572644a78")
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, PIDParameters: 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 numpy as np
from typing import NamedTuple

torch.manual_seed(0)

class PIDParameters(NamedTuple):
    """
    Hyperparameters for PID.
    """
    fudge: float = 0
    mc_n_samples: int = 250

ARGS = {
    "fudge": 0.1,
    "mc_n_samples": 250
}
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 PIDParameters — 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 PIDParameters output the recorded ndim 1 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
density_estimation Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
longinYu/SIVISM/utils/density_estimation.py
pointer only (licence: NONE); the stored copy get_code serves, from longinyu/ksivi, is pointer only (licence: NONE) · get_code("1f9e355031d1ccd1")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, longinYu/SIVISM when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

ID Not yet run
unverified (harvested, no recorded run)
jenninglim/pvi/src/trainers/pvi.py
code served (permissive licence) · get_code("7451ba00a6821b26")
How it ran

no invocation recorded.

PIDCarry Not yet run
unverified (harvested, no recorded run)
jenninglim/pvi/src/trainers/pvi.py
code served (permissive licence) · get_code("26762bfc7db6f0e4")
How it ran

no invocation recorded.

SGLD_lr Not yet run
unverified (harvested, no recorded run)
longinYu/SIVISM/sgld_lr.py
pointer only (licence: NONE) · get_code("dd340ac35b3291e4")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, longinYu/SIVISM when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

SGLD_toy Not yet run
unverified (harvested, no recorded run)
longinYu/SIVISM/sgld_toyexample.py
pointer only (licence: NONE) · get_code("0e8133c37fe32af2")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, longinYu/SIVISM when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

Target Not yet run
unverified (harvested, no recorded run)
jenninglim/pvi/src/trainers/pvi.py
code served (permissive licence) · get_code("03bec2405a6becc0")
How it ran

no invocation recorded.

de_particle_grad Not yet run
unverified (harvested, no recorded run)
jenninglim/pvi/src/trainers/pvi.py
code served (permissive licence) · get_code("8c022fb203bde4f5")
How it ran

no invocation recorded.

de_particle_step Not yet run
unverified (harvested, no recorded run)
jenninglim/pvi/src/trainers/pvi.py
code served (permissive licence) · get_code("a30f6968ced8a8c9")
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, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 0 later) and 10 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
density_estimation 1 other paper
1 dated earlier
2405.18997 (2024-05)
Kernel Semi-Implicit Variational Inference

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

Semi-implicit variational inference (SIVI) enriches the expressiveness of variational families by utilizing a kernel and a mixing distribution to hierarchically define the variational distribution. Existing SIVI methods parameterize the mixing distribution using implicit distributions, leading to intractable variational densities. As a result, directly maximizing the evidence lower bound (ELBO) is not possible, so they resort to one of the following: optimizing bounds on the ELBO, employing costly inner-loop Markov chain Monte Carlo runs, or solving minimax objectives. In this paper, we propose a novel method for SIVI called Particle Variational Inference (PVI) which employs empirical measures to approximate the optimal mixing distributions characterized as the minimizer of a free energy functional. PVI arises naturally as a particle approximation of a Euclidean-Wasserstein gradient flow and, unlike prior works, it directly optimizes the ELBO whilst making no parametric assumption about the mixing distribution. Our empirical results demonstrate that PVI performs favourably compared to other SIVI methods across various tasks. Moreover, we provide a theoretical analysis of the behaviour of the gradient flow of a related free energy functional: establishing the existence and uniqueness of solutions as well as propagation of chaos results.

For agents

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

get_harvested_code_for_paper("2407.00649")
get_code_for_paper("2407.00649")
have("2407.00649")

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

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

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

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

Connect an agent — have() is free.