SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2403.01749 · ICML · 2024

Differentially Private Synthetic Data via Foundation Model APIs 2: Text

Bo Li, Arturs Backurs, Da Yu, Huishuai Zhang, Sivakanth Gopi, Yin Lee, Chulin Xie, Harsha Nori, Huseyin Inan, Sergey Yekhanin, Haotian Jiang, Zinan Lin

arXiv · PDF · Open in the Atlas

Code that ran

6 of 11 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, 1 violated it and 1 has no contract verdict; 3 failures of our instrument; 5 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/2403.01749.json · badge: /api/ran/2403.01749.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
AI-secure/aug-pe canonical (classifier label)
classifier basis: census
6 ran · 4 no recorded run
ai-secure/aug-pe community
Papers with Code archive
0 ran · 1 no recorded run
FunctionStatusWhere it lives
calculate_fid Ran
ran, honoured the contract we drafted
AI-secure/aug-pe/metric.py
code served (permissive licence) · get_code("fb7941cb1fafb89d")
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

np.random.seed(0)

# Create two small batches of activations
# act1 and act2 should be 2D arrays where:
# - axis 0 is the batch dimension
# - axis 1 is the feature dimension
# Using small distinct sizes: batch=2, features=4

act1 = np.random.randn(2, 4).astype(np.float32)
act2 = np.random.randn(2, 4).astype(np.float32)

ARGS = {
    "act1": act1,
    "act2": act2,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — 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
load_embeddings Ran
ran; our contract draft was wrong, not the code
AI-secure/aug-pe/dpsda/logging.py
code served (permissive licence) · get_code("2404f2b745222315")
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
import tempfile
import os

# Create a temporary directory and a valid .npz file
temp_dir = tempfile.mkdtemp()
temp_path = os.path.join(temp_dir, "test_embeddings.npz")

# Create sample data
embeddings = np.random.randn(2, 4).astype(np.float32)
additional_info = np.array([1, 2])

# Save as .npz file
np.savez(temp_path, embeddings=embeddings, additional_info=additional_info)

ARGS = {
    "path": temp_path
}
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
log_samples Ran
ran on a synthesized input
AI-secure/aug-pe/dpsda/logging.py
code served (permissive licence) · get_code("55f14b1415459c51")
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 os
import tempfile
import torch
import numpy as np

# Create a temporary directory for output
temp_dir = tempfile.mkdtemp()

# Construct samples - list of text sequences
samples = [
    "This is a sample text sequence",
    "Another example of a text sample"
]

# Construct additional_info - list of labels/metadata
# First case: with 'pubmed' indicator
additional_info_pubmed = [
    "pubmed",
    "pubmed"
]

# Second case: with tab-separated labels
additional_info_labels = [
    "label_a\tlabel_b",
    "label_x\tlabel_y"
]

# Use the pubmed version for this example
additional_info = additional_info_pubmed

# The folder where samples.csv will be written
folder = temp_dir

ARGS = {
    "samples": samples,
    "additional_info": additional_info,
    "folder": folder
}
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
sample_dataset Ran
ran; our contract draft was wrong, not the code
AI-secure/aug-pe/dpsda/data_loader.py
code served (permissive licence) · get_code("db19b32cf584c992")
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 datasets import Dataset

# Create a small mock dataset with the expected structure
def create_mock_dataset(data_name='openreview', num_samples=100):
    if data_name == 'openreview':
        data = {
            'label1': [
                'Area: Social Aspects of Machine Learning (eg, AI safety, fairness, privacy, interpretability, human-AI interaction, ethics)'
                if i % 3 == 0
                else 'Area: Other'
                for i in range(num_samples)
            ],
            'label2': [
                'Recommendation: 8: accept, good paper' if i % 3 == 0 else 'Recommendation: 3: reject'
                for i in range(num_samples)
            ],
            'text': [f'sample text {i}' for i in range(num_samples)]
        }
    elif data_name == 'pubmed':
        data = {
            'label1': [f'label_{i % 5}' for i in range(num_samples)],
            'text': [f'pubmed text {i}' for i in range(num_samples)]
        }
    elif data_name == 'yelp':
        data = {
            'label1': ['Business Category: Restaurants' if i % 2 == 0 else 'Business Category: Other' for i in range(num_samples)],
            'label2': ['Review Stars: 5.0' if i % 2 == 0 else 'Review Stars: 3.0' for i in range(num_samples)],
            'text': [f'yelp text {i}' for i in range(num_samples)]
        }
    else:
        data = {
            'label1': [f'label_{i % 5}' for i in range(num_samples)],
            'text': [f'text {i}' for i in range(num_samples)]
        }
    
    return Dataset.from_dict(data)

# Create dataset dict with train split
train_dataset = create_mock_dataset('openreview', num_samples=100)
dataset = {'train': train_dataset}

ARGS = {
    'data_name': 'openreview',
    'dataset': dataset,
    'label_column_name': 'label1',
    'sample_size': 20,
    'subsample_one_class': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
datasets, 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
str2bool Ran
ran, violated the contract we drafted
AI-secure/aug-pe/dpsda/arg_utils.py
code served (permissive licence) · get_code("7c508037b40522af")
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) 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 argparse

def str2bool(v):
    if isinstance(v, bool):
        return v
    if v.lower() in ('yes', 'true', 't', 'y', '1'):
        return True
    elif v.lower() in ('no', 'false', 'f', 'n', '0'):
        return False
    else:
        raise argparse.ArgumentTypeError('Boolean value expected.')

# Test cases for str2bool
ARGS = {
    'v': 'true'  # string input that should convert to boolean
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 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
timeout Ran
ran; our contract draft was wrong, not the code
AI-secure/aug-pe/apis/utils.py
code served (permissive licence) · get_code("0b978e0d687562ae")
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 signal

# The timeout decorator takes one parameter: sec (seconds)
# We need to provide a valid integer value for the timeout duration

ARGS = {
    'sec': 5
}
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
calculate_all_metrics Not yet run
unverified (harvested, no recorded run)
AI-secure/aug-pe/metric.py
code served (permissive licence) · get_code("0a476b02add6c207")
How it ran

no invocation recorded.

dp_nn_histogram Not yet run
unverified (harvested, no recorded run)
ai-secure/aug-pe/dpsda/dp_counter.py
code served (permissive licence) · get_code("c65344585c2872db")
How it ran

no invocation recorded.

get_subcategories Not yet run
unverified (harvested, no recorded run)
AI-secure/aug-pe/apis/utils.py
code served (permissive licence) · get_code("7a4ed6749d9abfcf")
How it ran

no invocation recorded.

load_data Not yet run
unverified (harvested, no recorded run)
AI-secure/aug-pe/dpsda/data_loader.py
code served (permissive licence) · get_code("e313afc9b63d7994")
How it ran

no invocation recorded.

load_dataset_with_special Not yet run
unverified (harvested, no recorded run)
AI-secure/aug-pe/dpsda/data_loader.py
code served (permissive licence) · get_code("393870d61a0df0c0")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 1 the same month, 2 later) and 9 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
str2bool 175 other papers
113 dated earlier, 4 the same month, 57 later, 1 same year, order not determinable · 2 only as an assembly brick
1406.6247 (2014-06)
Recurrent Models of Visual Attention
1603.09382 (2016-03)
Deep Networks with Stochastic Depth
1710.10196 (2017-10)
Progressive Growing of GANs for Improved Quality, Stability, and Variation
and 172 more not named here
timeout 2 other papers
1 dated earlier, 1 later
2312.00027 (2023-12)
Stealthy and Persistent Unalignment on Large Language Models via Backdoor Injections
2406.00045 (2024-06)
Personalized Steering of Large Language Models: Versatile Steering Vectors Through Bi-directional Preference Optimization

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

Text data has become extremely valuable due to the emergence of machine learning algorithms that learn from it. A lot of high-quality text data generated in the real world is private and therefore cannot be shared or used freely due to privacy concerns. Generating synthetic replicas of private text data with a formal privacy guarantee, i.e., differential privacy (DP), offers a promising and scalable solution. However, existing methods necessitate DP finetuning of large language models (LLMs) on private data to generate DP synthetic data. This approach is not viable for proprietary LLMs (e.g., GPT-3.5) and also demands considerable computational resources for open-source LLMs. Lin et al. ( 2024) recently introduced the Private Evolution (PE) algorithm to generate DP synthetic images with only API access to diffusion models. In this work, we propose an augmented PE algorithm, named AUG-PE, that applies to the complex setting of text. We use API access to an LLM and generate DP synthetic text without any model training. We conduct comprehensive experiments on three benchmark datasets. Our results demonstrate that AUG-PE produces DP synthetic text that yields competitive utility with the SOTA DP finetuning baselines. This underscores the feasibility of relying solely on API access of LLMs to produce high-quality DP synthetic texts, thereby facilitating more accessible routes to privacy-preserving LLM applications. Our code and data are available at https://github.com/AI-secure/aug-pe.

For agents

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

get_harvested_code_for_paper("2403.01749")
get_code_for_paper("2403.01749")
have("2403.01749")

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

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

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

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

Connect an agent — have() is free.