SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2405.12203 · NeurIPS · 2024

Accelerating Relative Entropy Coding with Space Partitioning

José Hernández-Lobato, Gergely Flamich, Jiajun He

arXiv · PDF · Open in the Atlas

Code that ran

5 of 6 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 0 have no contract verdict; 5 failures of our instrument; 1 no recorded run), measured 2026-11-23; 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/2405.12203.json · badge: /api/ran/2405.12203.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
cambridge-mlg/RECOMBINER canonical (classifier label)
classifier basis: census
5 ran · 1 no recorded run
FunctionStatusWhere it lives
get_grouping Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
cambridge-mlg/RECOMBINER/prior_model.py
code served (permissive licence) · get_code("f335cee0a404ad60")
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
import numpy as np

torch.manual_seed(0)

# Create small tensors for q_loc, q_scale, prior_loc, prior_scale
# Using distinct dimensions: batch_size=2, param_dim=4
batch_size = 2
param_dim = 4

q_loc = torch.randn(batch_size, param_dim)
q_scale = torch.abs(torch.randn(batch_size, param_dim)) + 0.1  # ensure positive
prior_loc = torch.zeros(batch_size, param_dim)
prior_scale = torch.ones(batch_size, param_dim)

ARGS = {
    "q_loc": q_loc,
    "q_scale": q_scale,
    "prior_loc": prior_loc,
    "prior_scale": prior_scale,
}
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 — 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
get_grouping_by_kl Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
cambridge-mlg/RECOMBINER/prior_model.py
code served (permissive licence) · get_code("b1a8e6d8581a5b41")
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 numpy as np

# Create a small KL divergence array for testing
# The function expects an array of KL divergence values for parameters
kls_bits = np.array([2.5, 3.2, 1.8, 4.1, 2.9, 3.5, 1.2, 2.7], dtype=np.float32)

ARGS = {
    "kls_bits": kls_bits
}
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 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
group_parameters Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
cambridge-mlg/RECOMBINER/prior_model.py
code served (permissive licence) · get_code("76e9fc28161cd183")
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 torch
import numpy as np

torch.manual_seed(0)

# Create simple parameter objects (can be tensors or any object)
param1 = torch.nn.Parameter(torch.randn(2, 4))
param2 = torch.nn.Parameter(torch.randn(3, 4))
param3 = torch.nn.Parameter(torch.randn(4, 4))
param4 = torch.nn.Parameter(torch.randn(5, 4))
param5 = torch.nn.Parameter(torch.randn(6, 4))

# Create lists for the function arguments
parameters = [param1, param2, param3, param4, param5]
weights = [5.0, 8.0, 3.0, 7.0, 2.0]
max_weight = 16

ARGS = {
    "parameters": parameters,
    "weights": weights,
    "max_weight": max_weight
}
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 — 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
map_lpe_to_inr_inputs Ran
ran; our contract draft was wrong, not the code
cambridge-mlg/RECOMBINER/utils.py
code served (permissive licence) · get_code("a2dd4c014dc8e4be")
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 Tensor, ndim 4, dtype family float, shape (3, 2, 64, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Create a minimal upsampling network that takes (batch, channels, *spatial_dims) 
# and outputs upsampled tensor
class SimpleUpsampleNet(nn.Module):
    def __init__(self, latent_dim, upsample_factors, data_dim):
        super().__init__()
        self.latent_dim = latent_dim
        self.upsample_factors = upsample_factors
        self.data_dim = data_dim
        # Simple identity-like network that will be called
        self.conv = nn.Conv2d(latent_dim, latent_dim, 1) if data_dim == 2 else nn.Conv1d(latent_dim, latent_dim, 1)
    
    def forward(self, x):
        # x shape: (batch, channels, *spatial_dims)
        # Apply upsampling by repeating along spatial dimensions
        if self.data_dim == 2:
            # x: (batch, channels, height, width)
            x = self.conv(x)
            # Upsample using interpolate
            x = torch.nn.functional.interpolate(x, scale_factor=self.upsample_factors, mode='nearest')
        elif self.data_dim == 1:
            # x: (batch, channels, length)
            x = self.conv(x)
            x = torch.nn.functional.interpolate(x, scale_factor=self.upsample_factors[0], mode='nearest')
        return x

# Set up parameters for 2D image case (non-patch)
data_dim = 2
latent_dim = 4
sample_size = 2
data_num = 3
pixel_sizes = [8, 8]  # 8x8 pixel grid per patch
upsample_factors = [2, 2]  # upsample by 2x in each dimension
patch = False
patch_nums = [1, 1]  # not used when patch=False

# Compute latent PE dimensions
latent_pe_dims = [pixel_sizes[i] // upsample_factors[i] for i in range(data_dim)]
# latent_pe_dims = [4, 4]

# Create latent_pe tensor with shape (sample_size, data_num, *latent_pe_dims, latent_dim)
latent_pe = torch.randn(sample_size, data_num, *latent_pe_dims, latent_dim)

# Create upsampling network
upsample_net = SimpleUpsampleNet(latent_dim, upsample_factors, data_dim)

ARGS = {
    'upsample_net': upsample_net,
    'latent_pe': latent_pe,
    'latent_dim': latent_dim,
    'pixel_sizes': pixel_sizes,
    'upsample_factors': upsample_factors,
    'patch': patch,
    'patch_nums': patch_nums,
    'data_dim': data_dim,
}
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 Tensor, ndim 4, dtype family float, shape (3, 2, 64, 4) — shape (3, 2, 64, 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
metric Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
cambridge-mlg/RECOMBINER/utils.py
code served (permissive licence) · get_code("9dfabc490a555cab")
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 (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 numpy as np

# Create valid arguments for the metric function
original_cifar = np.random.rand(2, 3, 4, 4).astype(np.float32)
compressed_cifar = np.random.rand(2, 3, 4, 4).astype(np.float32)

original_kodak = np.random.rand(3, 4, 5).astype(np.float32)
compressed_kodak = np.random.rand(3, 4, 5).astype(np.float32)

original_video = np.random.rand(4, 5, 6).astype(np.float32)
compressed_video = np.random.rand(4, 5, 6).astype(np.float32)

original_audio = np.random.rand(2, 100).astype(np.float32)
compressed_audio = np.random.rand(2, 100).astype(np.float32)

original_protein = np.random.rand(2, 10, 8).astype(np.float32)
compressed_protein = np.random.rand(2, 10, 8).astype(np.float32)

# Use cifar dataset as the default test case
ARGS = {
    'original': original_cifar,
    'compressed': compressed_cifar,
    'dataset': 'cifar'
}
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 (2,) — shape (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
map_hierarchical_model_to_int_weights Not yet run
unverified (harvested, no recorded run)
cambridge-mlg/RECOMBINER/utils.py
code served (permissive licence) · get_code("c503503965ccc2a7")
How it ran

no invocation recorded.

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 distinct functions with an identity, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 0 later) and 4 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
map_hierarchical_model_to_int_weights 1 other paper
1 dated earlier
2309.17182 (2023-09)
RECOMBINER: Robust and Enhanced Compression with Bayesian Implicit Neural Representations
map_lpe_to_inr_inputs 1 other paper
1 dated earlier
2309.17182 (2023-09)
RECOMBINER: Robust and Enhanced Compression with Bayesian Implicit Neural Representations

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

Relative entropy coding (REC) algorithms encode a random sample following a target distribution Q, using a coding distribution P shared between the sender and receiver. Sadly, general REC algorithms suffer from prohibitive encoding times, at least on the order of 2 DKLrQ||P s , and faster algorithms are limited to very specific settings. This work addresses this issue by introducing a REC scheme utilizing space partitioning to reduce runtime in practical scenarios. We provide theoretical analyses of our method and demonstrate its effectiveness with both toy examples and practical applications. Notably, our method successfully handles REC tasks with D KL rQ||P s about three times greater than what previous methods can manage, and reduces the bitrate by approximately 5-15% in VAE-based lossless compression on MNIST and INR-based lossy compression on CIFAR-10, compared to previous methods, significantly improving the practicality of REC for neural compression. 1 To avoid notation overload, we will use Q for the posterior, omitting its dependence on X unless needed. 2 Throughout this paper, unless otherwise stated, we use log 2 to calculate the log density ratio, the Kullback-Leibler (KL) divergence DKL, the mutual information I and the Rényi-8 divergence D8. We use upper-case letters (e.g., Q and P ) to represent probability measures and lower-case letters (e.g., q and p) for their densities. 38th Conference on Neural Information Processing Systems (NeurIPS 2024).

For agents

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

get_harvested_code_for_paper("2405.12203")
get_code_for_paper("2405.12203")
have("2405.12203")

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

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

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

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

Connect an agent — have() is free.