SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2004.01571 · 2020

Tree-AMP: Compositional Inference with Tree Approximate Message Passing

arXiv · PDF · Open in the Atlas

Code that ran

10 of 14 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; 0 failures of our instrument; 4 no recorded run), measured 2026-11-21; 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/2004.01571.json · badge: /api/ran/2004.01571.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
sphinxteam/tramp canonical (classifier label)
classifier basis: census
10 ran · 4 no recorded run
FunctionStatusWhere it lives
filter_message Ran
ran on a synthesized input
sphinxteam/tramp/tramp/base.py
code served (permissive licence) · get_code("32183ac4e957fd3a")
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 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 numpy as np

torch.manual_seed(0)

# The function expects:
# - message: an iterable of tuples (source, target, data)
#   where data is a dict with a 'direction' key
# - direction: a value to filter by

# Construct sample message data
message = [
    (0, 1, {'direction': 'forward', 'value': 10}),
    (1, 2, {'direction': 'backward', 'value': 20}),
    (2, 3, {'direction': 'forward', 'value': 30}),
    (3, 4, {'direction': 'backward', 'value': 40}),
]

direction = 'forward'

ARGS = {
    'message': message,
    'direction': direction,
}
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 float — 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
format_latex_message Ran
ran on a synthesized input
sphinxteam/tramp/tramp/algos/display_mp.py
code served (permissive licence) · get_code("7368970d82bab301")
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 Source:
    def __init__(self, name):
        self.name = name
    
    def math(self):
        return f"${self.name}$"
    
    def __hash__(self):
        return hash(self.name)
    
    def __eq__(self, other):
        return isinstance(other, Source) and self.name == other.name

class Target:
    def __init__(self, name):
        self.name = name
    
    def math(self):
        return f"${self.name}$"
    
    def __hash__(self):
        return hash(self.name)
    
    def __eq__(self, other):
        return isinstance(other, Target) and self.name == other.name

# Create source and target objects
source1 = Source("x")
source2 = Source("y")
target1 = Target("z")
target2 = Target("w")

# Construct message as list of tuples: (source, target, data_dict)
# The function expects data['direction'] to be either 'fwd' or 'bwd'
message = [
    (source1, target1, {'direction': 'bwd'}),
    (source2, target1, {'direction': 'bwd'}),
    (source1, target2, {'direction': 'fwd'}),
    (source2, target2, {'direction': 'fwd'}),
]

ARGS = {
    'message': message,
    'comment': 'test_comment'
}
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_size Ran
ran on a synthesized input
sphinxteam/tramp/tramp/algos/message_passing.py
code served (permissive licence) · get_code("0ba6c9834d12997b")
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 int, ndim 0, dtype family int, 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 numpy as np

# Test case 1: 1D array
x_1d = np.array([1, 2, 3, 4, 5])

# Test case 2: 2D array
x_2d = np.array([[1, 2, 3], [4, 5, 6]])

# Test case 3: scalar
x_scalar = np.array(42)

# Test case 4: 3D array
x_3d = np.array([[[1, 2], [3, 4]], [[5, 6], [7, 8]]])

# Using the 1D case as the primary test
ARGS = {
    "x": x_1d
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, 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
info_arrow Ran
ran on a synthesized input
sphinxteam/tramp/tramp/algos/message_passing.py
code served (permissive licence) · get_code("0f9d55b87b2d7615")
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 numpy as np

class Source:
    def __init__(self, id_val):
        self.id = id_val

class Target:
    def __init__(self, id_val):
        self.id = id_val

source = Source("node_A")
target = Target("node_B")

data = {
    'direction': 'fwd',
    'a': 0.42,
    'b': np.array([1.0, 2.0, 3.0, 4.0]),
    'custom_key': 'some_value'
}

keys = ['a', 'b_size', 'custom_key']

ARGS = {
    'source': source,
    'target': target,
    'data': data,
    'keys': keys
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — 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
info_message Ran
ran on a synthesized input
sphinxteam/tramp/tramp/algos/message_passing.py
code served (permissive licence) · get_code("6a0f6af1d561bc9b")
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 numpy as np

class MockNode:
    def __init__(self, node_id):
        self.id = node_id

# Create mock source and target nodes
source = MockNode('node_0')
target = MockNode('node_1')

# Create sample data with required fields
data = {
    'direction': 'fwd',
    'a': 0.42567,
    'b': np.array([1.0, 2.0, 3.0]),
    'n_iter': 5
}

# Create a message as a list of (source, target, data) tuples
message = [
    (source, target, data),
    (target, source, {
        'direction': 'bwd',
        'a': 0.89123,
        'b': np.array([[1.0, 2.0], [3.0, 4.0], [5.0, 6.0]]),
        'n_iter': 3
    })
]

ARGS = {
    'message': message,
    'keys': ['a', 'n_iter', 'b_size']
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — 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
inv Ran
ran on a synthesized input
sphinxteam/tramp/tramp/base.py
code served (permissive licence) · get_code("ebcc038403b3f966")
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 1, dtype family float, 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 numpy as np

# The function inv(v) takes a single parameter v and applies np.maximum and division
# It expects v to be array-like (numpy array or similar)
# We'll create a small numpy array with some values

v = np.array([0.5, 2.0, 1e-25, 3.14])

ARGS = {
    "v": v
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, 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
mean_squared_error Ran
ran on a synthesized input
sphinxteam/tramp/tramp/algos/metrics.py
code served (permissive licence) · get_code("6fa3577eafb07bed")
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 numpy as np

# Create small numpy arrays for true and predicted values
x_true = np.array([[1.0, 2.0, 3.0, 4.0],
                   [5.0, 6.0, 7.0, 8.0]])

x_pred = np.array([[1.1, 2.1, 2.9, 4.1],
                   [5.0, 6.2, 6.8, 8.1]])

ARGS = {
    "x_true": x_true,
    "x_pred": x_pred
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — 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
norm Ran
ran on a synthesized input
sphinxteam/tramp/tramp/algos/callbacks.py
code served (permissive licence) · get_code("2d20a2ebdf5d1e00")
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 numpy as np

# The function norm(x) takes a single parameter x
# It computes: np.sqrt(np.mean(x ** 2))
# This expects x to be a numpy array or array-like that supports ** and mean operations

# Create a small numpy array
x = np.array([[1.0, 2.0, 3.0, 4.0],
              [5.0, 6.0, 7.0, 8.0]])

ARGS = {
    'x': x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — 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
sign_symmetric_mse Ran
ran on a synthesized input
sphinxteam/tramp/tramp/algos/metrics.py
code served (permissive licence) · get_code("3f4cd6ca44e02ee3")
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 numpy as np
import torch

torch.manual_seed(0)

# The function takes two parameters: x_true and x_pred
# Both are used in arithmetic operations (subtraction, addition, squaring)
# and passed to np.mean(), so they should be numpy arrays or array-like

# Create small numpy arrays with distinct shapes for testing
x_true = np.array([[1.0, 2.0, 3.0, 4.0],
                   [5.0, 6.0, 7.0, 8.0]])

x_pred = np.array([[1.1, 2.1, 2.9, 4.2],
                   [4.9, 6.1, 7.1, 7.9]])

ARGS = {
    "x_true": x_true,
    "x_pred": x_pred
}
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 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
to_list Ran
ran on a synthesized input
sphinxteam/tramp/tramp/models/base_model.py
code served (permissive licence) · get_code("af14d7277a84f3eb")
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 3, 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 numpy as np

torch.manual_seed(0)

# The function to_list takes a single parameter X
# It checks if X is a tuple, and if not, wraps it in a tuple
# Then converts to a list
# X can be any type - let's test with a few different types

# Test case 1: Pass a tensor (not a tuple)
tensor_input = torch.randn(2, 4)

ARGS = {
    'X': tensor_input
}
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 3, dtype family float — 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
committee Not yet run
unverified (harvested, no recorded run)
sphinxteam/tramp/tramp/models/committee_model.py
code served (permissive licence) · get_code("dae9b1a31eafc693")
How it ran

no invocation recorded.

phase_symmetric_mse Not yet run
unverified (harvested, no recorded run)
sphinxteam/tramp/tramp/algos/metrics.py
code served (permissive licence) · get_code("7f30b3f7b657b287")
How it ran

no invocation recorded.

sgn_committee Not yet run
unverified (harvested, no recorded run)
sphinxteam/tramp/tramp/models/committee_model.py
code served (permissive licence) · get_code("309a079584ee14c3")
How it ran

no invocation recorded.

soft_committee Not yet run
unverified (harvested, no recorded run)
sphinxteam/tramp/tramp/models/committee_model.py
code served (permissive licence) · get_code("4090d9a67e7f49cf")
How it ran

no invocation recorded.

Also present in other papers' code

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

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 introduce Tree-AMP, standing for Tree Approximate Message Passing, a python package for compositional inference in high-dimensional tree-structured models. The package provides a unifying framework to study several approximate message passing algorithms previously derived for a variety of machine learning tasks such as generalized linear models, inference in multi-layer networks, matrix factorization, and reconstruction using non-separable penalties. For some models, the asymptotic performance of the algorithm can be theoretically predicted by the state evolution, and the measurements entropy estimated by the free entropy formalism. The implementation is modular by design: each module, which implements a factor, can be composed at will with other modules to solve complex inference tasks. The user only needs to declare the factor graph of the model: the inference algorithm, state evolution and entropy estimation are fully automated.

For agents

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

get_harvested_code_for_paper("2004.01571")
get_code_for_paper("2004.01571")
have("2004.01571")

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

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

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

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

Connect an agent — have() is free.