SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2007.06168 · ICML · 2020

Model Fusion with Kullback-Leibler Divergence

Mikhail Yurochkin, Soumya Ghosh, Sebastian Claici, Justin Solomon

arXiv · PDF · Open in the Atlas

Code that ran

5 of 10 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; 4 failures of our instrument; 5 no recorded run), measured 2026-11-22; 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/2007.06168.json · badge: /api/ran/2007.06168.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
IBM/KL-fusion marked official in Papers with Code
Papers with Code archive
5 ran · 5 no recorded run
FunctionStatusWhere it lives
gaus_to_weights Ran
ran; our contract draft was wrong, not the code
IBM/KL-fusion/src/fusion.py
code served (permissive licence) · get_code("27ee35f765434356")
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 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 numpy as np
from copy import deepcopy

# Construct valid arguments for gaus_to_weights

# The function expects:
# - priors: a list of dicts, each with 'mu' and 'Sigma' keys
# - biases: a dict with 'mu' and 'Sigma' keys
# - n_classes: int (default 10)

# From the function body:
# - gaus_means = np.array([e['mu'] for e in priors]) creates shape (num_priors, feature_dim)
# - gaus_covs = np.array([e['Sigma'] for e in priors]) creates shape (num_priors, feature_dim)
# - gaus_means[:, :-n_classes] slices off last n_classes columns
# - gaus_means[:, -n_classes:] gets last n_classes columns
# - biases['mu'] and biases['Sigma'] are 1D arrays of shape (n_classes,)

n_classes = 10
num_priors = 5
feature_dim = 14  # :-n_classes means 14-10=4 features, then 10 class dims

# Create priors list
priors = []
for i in range(num_priors):
    prior_dict = {
        'mu': np.random.randn(feature_dim),
        'Sigma': np.abs(np.random.randn(feature_dim)) + 0.1  # ensure positive for log
    }
    priors.append(prior_dict)

# Create biases dict
biases = {
    'mu': np.random.randn(n_classes),
    'Sigma': np.abs(np.random.randn(n_classes)) + 0.1  # ensure positive for log
}

ARGS = {
    'priors': priors,
    'biases': biases,
    'n_classes': n_classes
}
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 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
hungarian_match Ran
ran; our contract draft was wrong, not the code
IBM/KL-fusion/src/fusion.py
code served (permissive licence) · get_code("3de1072fa11532cb")
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 float, 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 numpy as np
import ot
from sklearn.metrics.pairwise import euclidean_distances
from scipy.optimize import linear_sum_assignment

# Create small sample data for est_atoms and true_atoms
np.random.seed(0)
true_atoms = np.random.randn(3, 4).astype(np.float32)  # 3 atoms of dimension 4
est_atoms = np.random.randn(2, 4).astype(np.float32)   # 2 atoms of dimension 4

# Define a custom distance function
def custom_dist_fn(atom1, atom2):
    """Custom distance function - L2 norm"""
    return np.linalg.norm(atom1 - atom2)

ARGS = {
    "est_atoms": est_atoms,
    "true_atoms": true_atoms,
    "dist_fn": None,
    "transport": True,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, ot, scipy, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, 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
min_match Ran
ran; our contract draft was wrong, not the code
IBM/KL-fusion/src/fusion.py
code served (permissive licence) · get_code("3b443c9c62d70d45")
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

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

# Create small arrays for est_atoms and true_atoms
est_atoms = np.array([
    [1.0, 2.0, 3.0, 4.0],
    [5.0, 6.0, 7.0, 8.0]
], dtype=np.float64)

true_atoms = np.array([
    [1.1, 2.1, 3.1, 4.1],
    [5.1, 6.1, 7.1, 8.1]
], dtype=np.float64)

# Define a custom distance function (optional parameter)
def custom_dist_fn(atom1, atom2):
    return np.sqrt(np.sum((atom1 - atom2) ** 2))

ARGS = {
    'est_atoms': est_atoms,
    'true_atoms': true_atoms,
    'dist_fn': custom_dist_fn
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn — 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
nonparam_assignment Ran
ran; our contract draft was wrong, not the code
IBM/KL-fusion/src/fusion.py
code served (permissive licence) · get_code("39616290d583ee07")
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. 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

def simple_distance_fn(mu, nu):
    """Simple Euclidean distance between two distributions (represented as arrays)"""
    return np.linalg.norm(np.array(mu) - np.array(nu))

# Create small, simple test data
# priors: list of G=3 prior distributions
priors = [
    np.array([0.5, 0.3, 0.1, 0.1]),
    np.array([0.2, 0.4, 0.2, 0.2]),
    np.array([0.1, 0.1, 0.4, 0.4])
]

# subset_posteriors: list of n=2 datasets, each containing L posterior samples
subset_posteriors = [
    [
        np.array([0.4, 0.3, 0.2, 0.1]),
        np.array([0.3, 0.4, 0.2, 0.1]),
        np.array([0.2, 0.3, 0.3, 0.2])
    ],
    [
        np.array([0.5, 0.2, 0.2, 0.1]),
        np.array([0.1, 0.5, 0.2, 0.2])
    ]
]

ARGS = {
    'priors': priors,
    'subset_posteriors': subset_posteriors,
    'dist_fn': simple_distance_fn,
    'reg': 0.1,
    'verbose': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cvxpy, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list — a list 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
nw_to_gaus Ran
ran, honoured the contract we drafted
IBM/KL-fusion/src/fusion.py
code served (permissive licence) · get_code("ffcf4fd87dcf7638")
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, 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 expects a dict 'nw' with keys 'mu', 'S_inv', and 'kappa'
# It accesses nw['mu'], nw['S_inv'], and nw['kappa']
# and performs division: nw['S_inv'] / nw['kappa']

nw = {
    'mu': torch.randn(2, 4),           # Small tensor: batch=2, dim=4
    'S_inv': torch.randn(2, 4),        # Same shape for element-wise division
    'kappa': torch.tensor(2.5)         # Scalar for broadcasting
}

ARGS = {
    'nw': nw
}
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 tuple, ndim 3, dtype family float — a tuple 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
draw_ellipse Not yet run
unverified (harvested, no recorded run)
IBM/KL-fusion/src/fusion.py
code served (permissive licence) · get_code("b978dc5fb7f058a8")
How it ran

no invocation recorded.

fusion_alternating Not yet run
unverified (harvested, no recorded run)
IBM/KL-fusion/src/fusion.py
code served (permissive licence) · get_code("5a9201d6f4ec47cb")
How it ran

no invocation recorded.

plot_estimation Not yet run
unverified (harvested, no recorded run)
IBM/KL-fusion/src/fusion.py
code served (permissive licence) · get_code("c7912f48583133b4")
How it ran

no invocation recorded.

plot_gmm Not yet run
unverified (harvested, no recorded run)
IBM/KL-fusion/src/fusion.py
code served (permissive licence) · get_code("8f3a529c5cca5e7c")
How it ran

no invocation recorded.

sinkhorn Not yet run
unverified (harvested, no recorded run)
IBM/KL-fusion/src/fusion.py
code served (permissive licence) · get_code("c30e8f6c51130d25")
How it ran

no invocation recorded.

Also present in other papers' code

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

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 propose a method to fuse posterior distributions learned from heterogeneous datasets. Our algorithm relies on a mean field assumption for both the fused model and the individual dataset posteriors and proceeds using a simple assign-andaverage approach. The components of the dataset posteriors are assigned to the proposed global model components by solving a regularized variant of the assignment problem. The global components are then updated based on these assignments by their mean under a KL divergence. For exponential family variational distributions, our formulation leads to an efficient non-parametric algorithm for computing the fused model. Our algorithm is easy to describe and implement, efficient, and competitive with state-of-the-art on motion capture analysis, topic modeling, and federated learning of Bayesian neural networks. 1

For agents

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

get_harvested_code_for_paper("2007.06168")
get_code_for_paper("2007.06168")
have("2007.06168")

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

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

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

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

Connect an agent — have() is free.