SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2211.11540 · 2022

A Framework for Auditable Synthetic Data Generation

arXiv · PDF · Open in the Atlas

Code that ran

5 of 8 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 5 have no contract verdict; 0 failures of our instrument; 3 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2211.11540.json · badge: /api/ran/2211.11540.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
alan-turing-institute/sdg-auditing canonical (classifier label)
classifier basis not recorded on the link
5 ran · 3 no recorded run
FunctionStatusWhere it lives
get_count_matrix Ran
ran on a synthesized input
alan-turing-institute/sdg-auditing/raw_ipf.py
code served (permissive licence) · get_code("01a319dbf93f7023")
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 3, dtype family int, shape (3, 2, 3) 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

# Construct small but valid arguments for get_count_matrix

# X: numpy array with shape (features, individuals)
# Each row represents a feature, each column represents an individual
# Values should be indices into the category representation of each feature
X = np.array([
    [0, 1, 0, 2],  # feature 0: 4 individuals, values in range [0, 2]
    [1, 0, 1, 1],  # feature 1: 4 individuals, values in range [0, 1]
    [0, 0, 1, 2]   # feature 2: 4 individuals, values in range [0, 2]
], dtype=np.uint16)

# metadata: list of dicts, one per feature
# Each dict must have a 'representation' key with a list/collection of categories
metadata = [
    {
        'representation': ['cat_a', 'cat_b', 'cat_c']  # feature 0 has 3 categories
    },
    {
        'representation': ['cat_x', 'cat_y']  # feature 1 has 2 categories
    },
    {
        'representation': ['cat_p', 'cat_q', 'cat_r']  # feature 2 has 3 categories
    }
]

ARGS = {
    'X': X,
    'metadata': metadata
}
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 3, dtype family int, shape (3, 2, 3) — shape (3, 2, 3) 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
load_data Ran
ran on a synthesized input
alan-turing-institute/sdg-auditing/utils.py
code served (permissive licence) · get_code("d1236cc35fd91c25")
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 DataFrame. 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 pandas as pd
import tempfile
import os

# Create temporary CSV files for testing
temp_dir = tempfile.mkdtemp()

# Create main.csv with sample data
main_data = pd.DataFrame({
    'Person ID': ['1', '2', '3'],
    'Name': ['Alice', 'Bob', 'Charlie'],
    'Age': ['25', '30', '35']
})
main_csv_path = os.path.join(temp_dir, 'main.csv')
main_data.to_csv(main_csv_path, index=False)

# Create main_train.csv with sample data
train_data = pd.DataFrame({
    'Name': ['Alice', 'Bob'],
    'Age': ['25', '30']
})
train_csv_path = os.path.join(temp_dir, 'main_train.csv')
train_data.to_csv(train_csv_path, index=False)

# Create main_test.csv with sample data
test_data = pd.DataFrame({
    'Name': ['Charlie', 'Diana'],
    'Age': ['35', '40']
})
test_csv_path = os.path.join(temp_dir, 'main_test.csv')
test_data.to_csv(test_csv_path, index=False)

# Change to temp directory so load_data can find the files
os.chdir(temp_dir)

ARGS = {
    'train': True,
    'test': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataFrame — a DataFrame output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataFrame output the recorded ndim 2 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
refactor_linear_combination Ran
ran on a synthesized input
alan-turing-institute/sdg-auditing/auditing.py
code served (permissive licence) · get_code("d9490bcb443413fb")
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 AddedFunctions. 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 collections

class Function:
    def __call__(self, x):
        abstract

    def __add__(self, function):
        return AddedFunctions(self, function)

    def __sub__(self, function):
        return AddedFunctions(self, MultipliedFunction(function, -1))

    def __mul__(self, factor):
        return MultipliedFunction(self, factor)

    def __rmul__(self, factor):
        return self.__mul__(factor)

    def __repr__(self):
        return str(self)

    def __str__(self):
        return 'F'

class AddedFunctions(Function):
    def __init__(self, *functions):
        self.functions = functions

    def __call__(self, x):
        y = [f(x) for f in self.functions]
        return np.sum(y, axis=0)

    def __str__(self):
        return '(' + '+'.join([str(f) for f in self.functions]) + ')'

class MultipliedFunction(Function):
    def __init__(self, function, a):
        self.function = function
        self.a = a

    def __call__(self, x):
        y = self.function(x)
        return self.a * y

    def __str__(self):
        return f'{self.a:.2e}*{str(self.function)}'

class ConstantFunction(Function):
    def __init__(self, value):
        self.value = value

    def __call__(self, x):
        x = np.array(x)
        return np.full(x.shape[0], self.value)

    def __str__(self):
        return str(self.value)

class SimpleFunction(Function):
    def __init__(self, name):
        self.name = name
    
    def __call__(self, x):
        x = np.array(x)
        return np.ones(x.shape[0]) * 2.0
    
    def __str__(self):
        return self.name

def split_linear_combination(large_function, tol=1e-16):
    factors = collections.defaultdict(lambda: 0)
    L = [(large_function, 1)]
    while L:
        f, scale = L.pop()
        if isinstance(f, AddedFunctions):
            for g in f.functions:
                L.append((g, scale))
        elif isinstance(f, MultipliedFunction):
            L.append((f.function, f.a * scale))
        else:
            factors[f] = factors[f] + scale
    zero_factors = []
    for f, a in factors.items():
        if np.abs(a) < tol:
            zero_factors.append(f)
    for f in zero_factors:
        del factors[f]
    return factors

def refactor_linear_combination(large_function, tol=1e-16):
    factors = split_linear_combination(large_function, tol)
    if len(factors) == 0:
        return ConstantFunction(0)
    multiply = lambda f, a: MultipliedFunction(f, a) if np.abs(a - 1) > 1e-10 else f
    if len(factors) > 1:
        return AddedFunctions(*[multiply(f, a) for f, a in factors.items()])
    else:
        f, a = list(factors.items())[0]
        return multiply(f, a)

f1 = SimpleFunction('f1')
f2 = SimpleFunction('f2')
combined = 2.5 * f1 + 1.3 * f2

ARGS = {
    'large_function': combined,
    'tol': 1e-16
}
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 AddedFunctions — a AddedFunctions output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a AddedFunctions 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
sinkhorn_tensor Ran
ran on a synthesized input
alan-turing-institute/sdg-auditing/raw_ipf.py
code served (permissive licence) · get_code("6ff912bc65da4b55")
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 3, dtype family float, shape (2, 3, 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
import string

# Construct a valid initial_tensor
# Shape (2, 3, 4) for a 3D probability tensor
initial_tensor = np.array([
    [[0.1, 0.2, 0.15, 0.05],
     [0.05, 0.1, 0.08, 0.12],
     [0.08, 0.06, 0.07, 0.11]],
    [[0.12, 0.09, 0.1, 0.06],
     [0.11, 0.08, 0.09, 0.07],
     [0.09, 0.1, 0.08, 0.09]]
])

# Normalize to be a valid probability tensor
initial_tensor = initial_tensor / initial_tensor.sum()

# Construct marginals as list of [indices, values] pairs
# For a 3D tensor with shape (2, 3, 4), we can have marginals over different axes
# First marginal: sum over axes (1, 2), resulting in shape (2,)
marginal_0 = initial_tensor.sum(axis=(1, 2))

# Second marginal: sum over axes (0, 2), resulting in shape (3,)
marginal_1 = initial_tensor.sum(axis=(0, 2))

# Third marginal: sum over axes (0, 1), resulting in shape (4,)
marginal_2 = initial_tensor.sum(axis=(0, 1))

marginals = [
    [[0], marginal_0],
    [[1], marginal_1],
    [[2], marginal_2]
]

ARGS = {
    "initial_tensor": initial_tensor,
    "marginals": marginals,
    "max_iterations": 100.0,
    "iter_tolerance": 1e-4,
    "eps": 1e-5
}
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 3, dtype family float, shape (2, 3, 4) — shape (2, 3, 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
split_linear_combination Ran
ran on a synthesized input
alan-turing-institute/sdg-auditing/auditing.py
code served (permissive licence) · get_code("89709a5623910d2f")
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.

import numpy as np
import collections

class Function:
    def __call__(self, x):
        raise NotImplementedError
    
    def __add__(self, function):
        return AddedFunctions(self, function)
    
    def __sub__(self, function):
        return AddedFunctions(self, MultipliedFunction(function, -1))
    
    def __mul__(self, factor):
        return MultipliedFunction(self, factor)
    
    def __rmul__(self, factor):
        return self.__mul__(factor)
    
    def __repr__(self):
        return str(self)
    
    def __str__(self):
        return 'F'

class AddedFunctions(Function):
    def __init__(self, *functions):
        self.functions = functions
    
    def __call__(self, x):
        y = [f(x) for f in self.functions]
        return np.sum(y, axis=0)
    
    def __str__(self):
        return '(' + '+'.join([str(f) for f in self.functions]) + ')'

class MultipliedFunction(Function):
    def __init__(self, function, a):
        self.function = function
        self.a = a
    
    def __call__(self, x):
        y = self.function(x)
        return self.a * y
    
    def __str__(self):
        return f'{self.a:.2e}*{str(self.function)}'

class SimpleFunction(Function):
    """Concrete implementation of Function for testing."""
    def __init__(self, name):
        self.name = name
    
    def __call__(self, x):
        return np.ones_like(x)
    
    def __str__(self):
        return self.name

# Build a complex function structure to decompose
f1 = SimpleFunction('f1')
f2 = SimpleFunction('f2')
f3 = SimpleFunction('f3')

# Create a linear combination: 2*f1 + 3*f2 - f3
large_function = 2 * f1 + 3 * f2 + (-1) * f3

ARGS = {
    'large_function': large_function,
    'tol': 1e-16
}
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 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
get_margin_grids Not yet run
unverified (harvested, no recorded run)
alan-turing-institute/sdg-auditing/raw_ipf.py
code served (permissive licence) · get_code("3c635564d232e68a")
How it ran

no invocation recorded.

gram_schmidt Not yet run
unverified (harvested, no recorded run)
alan-turing-institute/sdg-auditing/auditing.py
code served (permissive licence) · get_code("7a848eb237060cf7")
How it ran

no invocation recorded.

load_synthetic_datasets Not yet run
unverified (harvested, no recorded run)
alan-turing-institute/sdg-auditing/utils.py
code served (permissive licence) · get_code("edc970a0714a753f")
How it ran

no invocation recorded.

Also present in other papers' code

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

Synthetic data has gained significant momentum thanks to sophisticated machine learning tools that enable the synthesis of high-dimensional datasets. However, many generation techniques do not give the data controller control over what statistical patterns are captured, leading to concerns over privacy protection. While synthetic records are not linked to a particular real-world individual, they can reveal information about users indirectly which may be unacceptable for data owners. There is thus a need to empirically verify the privacy of synthetic data -- a particularly challenging task in high-dimensional data. In this paper we present a general framework for synthetic data generation that gives data controllers full control over which statistical properties the synthetic data ought to preserve, what exact information loss is acceptable, and how to quantify it. The benefits of the approach are that (1) one can generate synthetic data that results in high utility for a given task, while (2) empirically validating that only statistics considered safe by the data curator are used to generate the data. We thus show the potential for synthetic data to be an effective means of releasing confidential data safely, while retaining useful information for analysts.

For agents

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

get_harvested_code_for_paper("2211.11540")
get_code_for_paper("2211.11540")
have("2211.11540")

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

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

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

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

Connect an agent — have() is free.