SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1811.11926 · 2018

Autoconj: Recognizing and Exploiting Conjugacy Without a Domain-Specific Language

arXiv · PDF · Open in the Atlas

Code that ran

16 of 26 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 15 have no contract verdict; 0 failures of our instrument; 10 no recorded run), measured 2026-11-23; 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/1811.11926.json · badge: /api/ran/1811.11926.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
google-research/autoconj canonical (classifier label)
classifier basis: census
16 ran · 10 no recorded run
FunctionStatusWhere it lives
diag Ran
ran on a synthesized input
google-research/autoconj/autoconj/pgm.py
code served (permissive licence) · get_code("fc8eb89a1ef2be49")
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 autograd.numpy as np

# Create a small test value for the diag function
# The function uses value.shape[-1] to get the last dimension
# It performs einsum with patterns involving the last dimension
# Creating a value with shape (..., n) where n is the last dimension

# Simple 1D case
value_1d = np.array([1.0, 2.0, 3.0, 4.0])

# Also test with batched case (2D)
value_2d = np.array([[1.0, 2.0, 3.0, 4.0],
                     [5.0, 6.0, 7.0, 8.0]])

# The function works with any shape ending in a dimension
# Let's use the 1D case as it's the simplest valid input
value = value_1d

ARGS = {
    'value': value
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
autograd — 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
dirichlet_gen_log_prob Ran
ran on a synthesized input
google-research/autoconj/autoconj/log_probs.py
code served (permissive licence) · get_code("3f14981d1896eed5")
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 float64, ndim 0, 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 autograd.numpy as np
from autograd.scipy import special

# Create small valid inputs for dirichlet_gen_log_prob
# x: should be a probability distribution (sums to 1 along last dim)
# alpha: concentration parameters (positive values)

# Create x with shape (2, 4) - batch of 2, dimension 4
x_data = np.array([
    [0.1, 0.2, 0.3, 0.4],
    [0.25, 0.25, 0.25, 0.25]
])

# Create alpha with shape (2, 4) - concentration parameters (must be positive)
alpha_data = np.array([
    [1.5, 2.0, 1.8, 2.2],
    [1.0, 1.5, 1.2, 1.3]
])

ARGS = {
    "x": x_data,
    "alpha": alpha_data,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
autograd — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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
find_distribution Ran
ran on a synthesized input
google-research/autoconj/autoconj/exponential_families.py
code served (permissive licence) · get_code("bca42d1ba8b67d66")
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 torch
from collections import namedtuple

torch.manual_seed(0)

# Define a minimal stats node class
StatsNode = namedtuple('StatsNode', ['value', 'type'])

# Define a minimal stats matcher class
class StatsMatcher:
    def __init__(self, matcher_fn, preds_list, update_fn):
        self.matcher = matcher_fn
        self.preds = preds_list
        self.update_suffstat = update_fn

# Define a minimal suffstat class
SuffStat = namedtuple('SuffStat', ['params', 'stats'])

# Define a minimal distribution definition class
class DistbnDefn:
    def __init__(self, support, suffstat_cls, matchers, check_fn, make_normalizer_fn, distribution_fn):
        self.support = support
        self.suffstat_cls = suffstat_cls
        self.matchers = matchers
        self.check = check_fn
        self.make_log_normalizer = make_normalizer_fn
        self.distribution = distribution_fn

# Create minimal matcher that will match nodes
def simple_matcher(node):
    if isinstance(node, StatsNode):
        return {'node_val': node.value}
    return None

def simple_pred(**kwargs):
    return True

def simple_update_suffstat(suffstat, bindings, node):
    # Return updated suffstat
    return SuffStat(params={'matched': True}, stats={'value': bindings.get('node_val')})

def simple_check(suffstat):
    return True

def simple_normalizer(suffstat):
    return lambda x: torch.tensor([0.0])

def simple_distribution(x):
    return torch.tensor([1.0])

# Create a matcher
matcher = StatsMatcher(
    matcher_fn=simple_matcher,
    preds_list=[simple_pred],
    update_fn=simple_update_suffstat
)

# Create a distribution definition
distbn = DistbnDefn(
    support='real',
    suffstat_cls=SuffStat,
    matchers=[matcher],
    check_fn=simple_check,
    make_normalizer_fn=simple_normalizer,
    distribution_fn=simple_distribution
)

# Create stats nodes to search over
stats_nodes = [
    StatsNode(value=torch.tensor([1.0, 2.0, 3.0, 4.0]), type='gaussian'),
    StatsNode(value=torch.tensor([5.0, 6.0, 7.0, 8.0]), type='gaussian')
]

support = 'real'

ARGS = {
    'stats_nodes': stats_nodes,
    'support': support
}
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 — 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
find_distributions Ran
ran on a synthesized input
google-research/autoconj/autoconj/exponential_families.py
code served (permissive licence) · get_code("9620be7a00d2457b")
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 zip. 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.

from collections import namedtuple

torch_imported = False
try:
    import torch
    torch_imported = True
except ImportError:
    pass

# Define a simple matcher class
Matcher = namedtuple('Matcher', ['matcher', 'preds', 'update_suffstat'])

# Define a simple stats matcher
StatsMatcher = namedtuple('StatsMatcher', ['matcher', 'preds', 'update_suffstat'])

# Create a simple suffstat namedtuple
SimpleSuffStat = namedtuple('SimpleSuffStat', ['param1', 'param2'])

# Create a distribution definition
DistributionDefn = namedtuple('DistributionDefn', ['support', 'suffstat_cls', 'matchers', 'check', 'make_log_normalizer', 'distribution'])

# Simple matcher function that returns bindings
def simple_matcher(node):
    return {'value': node}

# Simple predicate that always returns True
def simple_pred(**kwargs):
    return True

# Simple update function that returns updated suffstat
def simple_update_suffstat(suffstat, bindings, node):
    return suffstat._replace(param1={**suffstat.param1, 'node': node})

# Create a stats matcher
stats_matcher = StatsMatcher(
    matcher=simple_matcher,
    preds=[simple_pred],
    update_suffstat=simple_update_suffstat
)

# Create a check function
def check_func(suffstat):
    return True

# Create a log normalizer function
def make_log_normalizer_func(suffstat_nodes):
    return lambda x: 0.0

# Create a distribution function
def distribution_func(*args, **kwargs):
    return 'normal'

# Create a distribution definition
distbn_defn = DistributionDefn(
    support='real',
    suffstat_cls=SimpleSuffStat,
    matchers=[stats_matcher],
    check=check_func,
    make_log_normalizer=make_log_normalizer_func,
    distribution=distribution_func
)

# Add to the global list
import sys
current_module = sys.modules[__name__]
current_module.distbn_defns = [distbn_defn]

# Create test data
all_stats_nodes = [
    ['node1', 'node2'],
    ['node3', 'node4']
]

supports = ['real', 'real']

ARGS = {
    'all_stats_nodes': all_stats_nodes,
    'supports': supports
}
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 zip — a zip output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a zip 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
identity Ran
ran, honoured the contract we drafted
google-research/autoconj/autoconj/matchers.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from dholzmueller/universal_double_descent, is pointer only (licence: NONE) · get_code("9910e2fc297f8665")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from dholzmueller/universal_double_descent, and GitHub detected no licence in that repository 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.

interceptable Ran
ran on a synthesized input
google-research/autoconj/autoconj/pplham.py
code served (permissive licence) · get_code("4ddc35d0438d85d4")
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 function. 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 functools
import threading

# Setup the interceptor stack and related functions
class _InterceptorStack(threading.local):
    """A thread-local stack of interceptors."""

    def __init__(self):
        super(_InterceptorStack, self).__init__()
        self.stack = [lambda f, *args, **kwargs: f(*args, **kwargs)]

_interceptor_stack = _InterceptorStack()

def get_interceptor():
    """Returns the top-most (last) interceptor on the thread's stack."""
    return _interceptor_stack.stack[-1]

def interceptable(func):
    """Decorator that wraps `func` so that its execution is intercepted."""
    @functools.wraps(func)
    def func_wrapped(*args, **kwargs):
        return get_interceptor()(func, *args, **kwargs)
    return func_wrapped

# Create a simple test function to decorate
def sample_function(x, y):
    """Simple function that will be decorated."""
    return x + y

# Build ARGS for the interceptable function
ARGS = {
    "func": sample_function
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
is_array_literal Ran
ran on a synthesized input
google-research/autoconj/autoconj/patterns.py
code served (permissive licence) · get_code("025020121b5bd6b8")
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 bool, 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 autograd.numpy as np

# The function is_array_literal checks if x is an instance of np.ndarray
# It takes a single parameter 'x' and returns True if it's a numpy array, False otherwise

# Create a valid numpy array to pass
x_array = np.array([1, 2, 3, 4])

ARGS = {
    "x": x_array
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
autograd — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type bool, 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
is_constant Ran
ran on a synthesized input
google-research/autoconj/autoconj/rewrites.py
code served (permissive licence) · get_code("1fe11a44758a1081")
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 bool, 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 autograd.numpy as np
from autograd import elementwise_grad

torch.manual_seed(0)

# The function is_constant checks if x is NOT boxed by autograd.tracer
# A "boxed" value is one that autograd is tracking for differentiation
# We need to provide both boxed and unboxed values to test the function

# Create an unboxed (constant) value - a plain numpy array or Python number
constant_value = np.array([1.0, 2.0, 3.0, 4.0])

# Create a boxed value - one being tracked by autograd
tracked_value = np.array([1.0, 2.0, 3.0, 4.0])
# To create a boxed value, we wrap it in a way autograd tracks it
def dummy_func(x):
    return np.sum(x)

grad_func = elementwise_grad(dummy_func)
# After calling grad_func, values inside become boxed during execution

# For the test, we can pass a simple constant (unboxed)
x_constant = 5.0

ARGS = {
    "x": x_constant
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
autograd, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type bool, 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
is_empty_seq Ran
ran on a synthesized input
google-research/autoconj/autoconj/matchers.py
code served (permissive licence) · get_code("8983bb7ba182edd4")
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 bool, 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)

def is_seq(x):
    return isinstance(x, (tuple, list))

def is_empty_seq(x):
    return is_seq(x) and (not bool(x))

# Test cases for is_empty_seq
# The function takes one parameter: x
# It checks if x is a sequence (tuple or list) AND if it's empty

ARGS = {
    "x": []
}
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 bool, 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
is_seq Ran
ran on a synthesized input
google-research/autoconj/autoconj/matchers.py
code served (permissive licence) · get_code("7b9bf90edf87a32b")
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 bool, 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
from typing import Union, Tuple, List

torch.manual_seed(0)

# The function is_seq checks if x is a tuple or list
# It takes a single parameter 'x' which can be any object

# Test with various types to ensure the function works correctly

ARGS = {
    "x": [1, 2, 3]  # A list - should return True
}
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 bool, 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
make_factor_graph Ran
ran on a synthesized input
google-research/autoconj/autoconj/graph_util.py
code served (permissive licence) · get_code("a1c40e227c2af45f")
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 defaultdict. 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.

from collections import defaultdict

# The function takes a list of tuples where each tuple represents a factor
# (a collection of nodes). It builds a bipartite graph representation.
# Let's create a simple factor graph with a few factors.

# Example factors - each factor is a tuple of node identifiers
# We can use integers or strings as node identifiers
factors = [
    (0, 1, 2),      # factor 1 connects nodes 0, 1, 2
    (1, 3),         # factor 2 connects nodes 1, 3
    (2, 3, 4),      # factor 3 connects nodes 2, 3, 4
]

ARGS = {
    'factors': factors
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type defaultdict — a defaultdict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a defaultdict 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
make_log_joint_fn Ran
ran on a synthesized input
google-research/autoconj/autoconj/pplham.py
code served (permissive licence) · get_code("611a2db65fa8e846")
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 function. 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
import inspect

def model(X):
    """Simple test model that uses random variables."""
    # This model simulates a simple probabilistic program
    # It would normally use ph.norm.rvs calls
    beta = np.random.normal(loc=0., scale=0.1, size=X.shape[1])
    loc = np.einsum('ij,j->i', X, beta)
    y = np.random.normal(loc=loc, scale=1.)
    return y

ARGS = {
    'model': model
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, six — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
make_tree_normal_log_normalizer Ran
ran on a synthesized input
google-research/autoconj/autoconj/pgm.py
code served (permissive licence) · get_code("d22860046eb90f2e")
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 function. 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 autograd.numpy as np
from collections import namedtuple

# Define a stand-in natural parameter class with the required fields
NatParam = namedtuple('NatParam', ['xi_xjtrs', 'xi_times_xjs', 'xi_xitrs', 'xi_squareds', 'xis'])

def logdet(A):
    """Compute log determinant"""
    s = np.linalg.svd(A, compute_uv=False)
    return np.sum(np.log(np.abs(s) + 1e-10))

# Create a small elimination order with 3 nodes
elim_order = [0, 1, 2]

# Create natural parameters with proper structure
# xi_xjtrs: joint factors mapping (node_i, node_j) -> matrix
# xi_times_xjs: mapping node -> vector
# xi_xitrs: mapping (node,) -> matrix
# xi_squareds: mapping node -> vector
# xis: mapping (node,) -> vector

natparam = NatParam(
    xi_xjtrs={(0, 1): np.array([[1.0, 0.2], [0.2, 1.0]]), (1, 2): np.array([[1.0, 0.1], [0.1, 1.0]])},
    xi_times_xjs={0: np.array([0.5, 0.3]), 1: np.array([0.4, 0.2]), 2: np.array([0.6, 0.1])},
    xi_xitrs={(0,): np.array([[2.0, 0.1], [0.1, 2.0]]), (1,): np.array([[1.8, 0.0], [0.0, 1.8]]), (2,): np.array([[2.2, 0.05], [0.05, 2.2]])},
    xi_squareds={0: np.array([0.1, 0.05]), 1: np.array([0.08, 0.06]), 2: np.array([0.12, 0.04])},
    xis={(0,): np.array([0.3, 0.2]), (1,): np.array([0.25, 0.15]), (2,): np.array([0.35, 0.1])}
)

ARGS = {
    'elim_order': elim_order
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
autograd — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
maybe_add Ran
ran on a synthesized input
google-research/autoconj/autoconj/rewrites.py
code served (permissive licence) · get_code("4edacc4b7ca610a9")
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 (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 functools
import autograd.numpy as np
import autograd.tracer as ag_tracer

def is_constant(x):
    return not ag_tracer.isbox(x)

def _is_constant_val(x, val):
    return is_constant(x) and np.all(x == val)

_is_constant_zero = functools.partial(_is_constant_val, val=0.0)

def add_n(x, y):
    return x + y

def maybe_add(x, y):
    if _is_constant_zero(x) and np.shape(y) == np.broadcast(x, y).shape:
        return y
    if _is_constant_zero(y) and np.shape(x) == np.broadcast(x, y).shape:
        return x
    return add_n(x, y)

# Setup: Create small constant arrays for testing
x_val = np.array(0.0)
y_val = np.array([[1.0, 2.0, 3.0, 4.0],
                  [5.0, 6.0, 7.0, 8.0]])

ARGS = {
    "x": x_val,
    "y": y_val
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
autograd — 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 (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
maybe_multiply Ran
ran on a synthesized input
google-research/autoconj/autoconj/rewrites.py
code served (permissive licence) · get_code("bbaa27290efb46d6")
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 (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 functools
import autograd.numpy as np
import autograd.tracer as ag_tracer

# Define ARGS for the maybe_multiply function
# The function takes two parameters: x and y

# Test case 1: Regular arrays that should be multiplied
x_val = np.array([[1.0, 2.0], [3.0, 4.0]])
y_val = np.array([[5.0, 6.0], [7.0, 8.0]])

ARGS = {
    'x': x_val,
    'y': y_val
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
autograd — 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 (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
multinomial_gen_log_prob Ran
ran on a synthesized input
google-research/autoconj/autoconj/log_probs.py
code served (permissive licence) · get_code("428b0cf043265d10")
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 float64, ndim 0, 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 autograd.numpy as np

# Set seed for reproducibility
np.random.seed(0)

# Construct arguments for multinomial_gen_log_prob
# x: observed counts (must be integers, shape matches p)
# n: number of trials (function only supports n=1)
# p: probability vector (must sum to 1)

x = np.array([0, 1, 0, 0])  # observed counts for 4 categories
n = 1  # number of trials (required to be 1)
p = np.array([0.1, 0.6, 0.2, 0.1])  # probabilities (sums to 1)

ARGS = {
    "x": x,
    "n": n,
    "p": p
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
autograd — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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
categorical_gen_log_prob Not yet run
unverified (harvested, no recorded run)
google-research/autoconj/autoconj/log_probs.py
code served (permissive licence) · get_code("c705fdeedd76a185")
How it ran

no invocation recorded.

cavi Not yet run
unverified (harvested, no recorded run)
google-research/autoconj/autoconj/meanfield.py
code served (permissive licence) · get_code("da702c67e99ec146")
How it ran

no invocation recorded.

convert_to_info_form Not yet run
unverified (harvested, no recorded run)
google-research/autoconj/autoconj/pgm.py
code served (permissive licence) · get_code("9b4aad47e027d8f8")
How it ran

no invocation recorded.

dot Not yet run
unverified (harvested, no recorded run)
google-research/autoconj/autoconj/meanfield.py
code served (permissive licence) · get_code("e70563afc1400104")
How it ran

no invocation recorded.

elbo Not yet run
unverified (harvested, no recorded run)
google-research/autoconj/autoconj/meanfield.py
code served (permissive licence) · get_code("05bcfc1a14861dd4")
How it ran

no invocation recorded.

find_chain Not yet run
unverified (harvested, no recorded run)
google-research/autoconj/autoconj/graph_util.py
code served (permissive licence) · get_code("e36d3b08dba13eda")
How it ran

no invocation recorded.

is_array_node Not yet run
unverified (harvested, no recorded run)
google-research/autoconj/autoconj/patterns.py
code served (permissive licence) · get_code("ecbebdfffeb10669")
How it ran

no invocation recorded.

is_node Not yet run
unverified (harvested, no recorded run)
google-research/autoconj/autoconj/patterns.py
code served (permissive licence) · get_code("5d69c1b7affd2f80")
How it ran

no invocation recorded.

make_matcher Not yet run
unverified (harvested, no recorded run)
google-research/autoconj/autoconj/exponential_families.py
code served (permissive licence) · get_code("da5a5c0bcb37542f")
How it ran

no invocation recorded.

simplify_sweep Not yet run
unverified (harvested, no recorded run)
google-research/autoconj/autoconj/canonicalize.py
code served (permissive licence) · get_code("ba4df33433a8f507")
How it ran

no invocation recorded.

Also present in other papers' code

Of 26 samples lifted from this paper's linked repositories, 26 carry a function identity and 0 do not. Of the 26 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 25 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
identity 69 other papers
4 dated earlier, 65 later · 5 only as an assembly brick
1706.07296 (2017-06)
A Minimal Developmental Model Can Increase Evolvability in Soft Robots
1802.09419 (2018-02)
Stochastic Hyperparameter Optimization through Hypernetworks
1804.06055 (2018-04)
Co-occurrence Feature Learning from Skeleton Data for Action Recognition and Detection with Hierarchical Aggregation
and 66 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-23.

Repositories linked to this paper

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

Abstract

Deriving conditional and marginal distributions using conjugacy relationships can be time consuming and error prone. In this paper, we propose a strategy for automating such derivations. Unlike previous systems which focus on relationships between pairs of random variables, our system (which we call Autoconj) operates directly on Python functions that compute log-joint distribution functions. Autoconj provides support for conjugacy-exploiting algorithms in any Python embedded PPL. This paves the way for accelerating development of novel inference algorithms and structure-exploiting modeling strategies.

For agents

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

get_harvested_code_for_paper("1811.11926")
get_code_for_paper("1811.11926")
have("1811.11926")

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

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

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

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

Connect an agent — have() is free.