SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2605.01065 · 2026

A Systematic Exploration of Text Decomposition and Budget Distribution in Differentially Private Text Obfuscation

Florian Matthes, Stephen Meisenbacher, Angelo Kleinert

arXiv · PDF · Open in the Atlas

Code that ran

10 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; 9 failures of our instrument; 0 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/2605.01065.json · badge: /api/ran/2605.01065.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
sjmeis/DP-Decompose-Distribute canonical (classifier label)
classifier basis: census
10 ran · 0 no recorded run
FunctionStatusWhere it lives
calculate_class_weights Ran
ran; our contract draft was wrong, not the code
sjmeis/DP-Decompose-Distribute/eval_scripts/adaptive_attacker.py
code served (permissive licence) · get_code("4d2e718dcf30e172")
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 1, dtype family float, shape (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 torch

torch.manual_seed(0)

# Create sample labels - a list of class indices
labels = [0, 1, 0, 2, 1, 0, 2, 2]

# Number of classes
num_classes = 3

# Device to use
device = 'cpu'

ARGS = {
    'labels': labels,
    'num_classes': num_classes,
    'device': device
}
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 1, dtype family float, shape (3,) — shape (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
chunk_document_worker Ran
ran, honoured the contract we drafted
sjmeis/DP-Decompose-Distribute/chunker.py
code served (permissive licence) · get_code("d4e130fdfcc35ecd")
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 1, 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

# Create a minimal chunker class that satisfies the interface used in the function
class MinimalChunker:
    def __init__(self):
        pass
    
    def chunk_text(self, doc_text):
        # Return a simple list of text chunks
        # Split by sentences or words as a basic chunking strategy
        if not doc_text:
            return []
        sentences = doc_text.split('. ')
        return [s.strip() for s in sentences if s.strip()]

# Initialize the global worker_chunker
worker_chunker = MinimalChunker()

# Define test document text
test_doc = "This is the first sentence. This is the second sentence. This is the third sentence."

# Construct ARGS dictionary with all parameters
ARGS = {
    "doc_text": test_doc
}
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 1, 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
focal_loss Ran
ran; our contract draft was wrong, not the code
sjmeis/DP-Decompose-Distribute/eval_scripts/adaptive_attacker.py
code served (permissive licence) · get_code("fd41c5fa76336833")
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 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 torch
import torch.nn.functional as F

torch.manual_seed(0)

# Small batch of logits for 2 samples, 4 classes
logits = torch.randn(2, 4)

# Labels for each sample (class indices)
labels = torch.tensor([0, 2])

# Focal loss parameter (focusing parameter)
gamma = 2.0

# Class weights for balancing (one weight per class)
alpha = torch.tensor([0.25, 0.25, 0.25, 0.25])

ARGS = {
    'logits': logits,
    'labels': labels,
    'gamma': gamma,
    'alpha': alpha
}
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 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
get_chunked_budgets Ran
ran; our contract draft was wrong, not the code
sjmeis/DP-Decompose-Distribute/privatizer.py
code served (permissive licence) · get_code("896218207cdc28d0")
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

# Define a minimal Chunker class that implements chunk_text
class MockChunker:
    def chunk_text(self, text):
        # Returns a list of lists of chunks
        # Each chunk is a string with words separated by underscores
        sentences = text.split('.')
        chunked = []
        for sentence in sentences:
            if sentence.strip():
                words = sentence.strip().split()
                chunks = ['_'.join(words[i:i+2]) for i in range(0, len(words), 2)]
                chunked.append(chunks)
        return chunked

# Define a minimal Distributor class that implements distribute
class MockDistributor:
    def distribute(self, text, epsilon):
        # Returns a list of (word_id, budget) tuples
        words = text.replace('.', '').split()
        word_budgets = []
        for i, word in enumerate(words):
            word_budgets.append((i, 0.1 + epsilon))
        return word_budgets

# Create instances
chunker = MockChunker()
distributor = MockDistributor()

# Create test data
clean_text = "hello world foo bar. baz qux test case."
epsilon = 0.05

ARGS = {
    'clean_text': clean_text,
    'chunker': chunker,
    'distributor': distributor,
    'epsilon': epsilon
}
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
load_ngrams_to_dict Ran
ran; our contract draft was wrong, not the code
sjmeis/DP-Decompose-Distribute/association_measures.py
code served (permissive licence) · get_code("c96f9eceeee904de")
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 tempfile
import os

# Create a temporary file with n-gram data
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.txt', encoding='utf-8')
temp_filepath = temp_file.name

# Write sample n-gram data to the file
# Format: "ngram tokens" count
lines = [
    "hello world 300\n",
    "foo bar baz 500\n",
    "abc def 275\n",
    "test ngram 280\n",
    "python code 600\n",
    "hello! world@ 400\n",  # This will be filtered out by alphanumeric_only
    "single 350\n",
]

for line in lines:
    temp_file.write(line)

temp_file.close()

# Define arguments for the function
ARGS = {
    'filepath': temp_filepath,
    'min_count': 275,
    'alphanumeric_only': True,
}
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 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
load_unigrams Ran
ran; our contract draft was wrong, not the code
sjmeis/DP-Decompose-Distribute/association_measures.py
code served (permissive licence) · get_code("3e515c5b1a8a70f4")
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 tempfile
import os

# Create a temporary file with unigram data
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.txt', encoding='utf-8')
temp_file.write("hello 5\n")
temp_file.write("world 3\n")
temp_file.write("python 7\n")
temp_file.write("test 2\n")
temp_file.close()

filepath = temp_file.name

ARGS = {
    "filepath": filepath
}
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 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
prepare_dataset Ran
ran; our contract draft was wrong, not the code
sjmeis/DP-Decompose-Distribute/eval_scripts/adaptive_attacker.py
code served (permissive licence) · get_code("87cd9dd4f015d968")
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 pandas as pd

# Create a minimal dataframe with author_id column for testing
df_author_id = pd.DataFrame({
    'author_id': [1, 2, 1, 3],
    'privatized_review': ['text one', 'text two', 'text three', 'text four']
})

ARGS = {
    'df': df_author_id,
    'dataset_name': 'test_dataset'
}
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 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
prepare_dataset Ran
ran; our contract draft was wrong, not the code
sjmeis/DP-Decompose-Distribute/eval_scripts/baseline_attacker.py
code served (permissive licence) · get_code("2927da7397153f77")
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 pandas as pd

# Create a minimal DataFrame with author_id column
df = pd.DataFrame({
    'author_id': [1, 2, 1, 3, 2],
    'review': ['This is a great book', 'I loved it', 'Amazing story', 'Not bad', 'Wonderful']
})

ARGS = {
    'df': df,
    'dataset_name': 'test_dataset'
}
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 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
privatize_text Ran
ran; our contract draft was wrong, not the code
sjmeis/DP-Decompose-Distribute/privatizer.py
code served (permissive licence) · get_code("1daa66ecef3d5172")
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 1, 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 torch.nn as nn

torch.manual_seed(0)

# Build a mechanism object with a replace_word method
class MockMechanism(nn.Module):
    def __init__(self):
        super().__init__()
    
    def replace_word(self, word, epsilon):
        # Simple mock: add noise proportional to epsilon
        # Return a modified version of the word
        return f"{word}_privatized_eps{epsilon}"

# Build word_vectors dict mapping words to vectors
word_vectors = {
    "hello": torch.randn(4),
    "world": torch.randn(4),
    "privacy": torch.randn(4),
}

# Build chunked_budgets as list of (chunk, epsilon) tuples
chunked_budgets = [
    ("hello", 0.5),
    ("world", 1.0),
    ("unknown_word", 0.3),  # This word is not in word_vectors
    ("privacy", 0.0),  # epsilon = 0, should not be privatized
]

# Create mechanism instance
mechanism = MockMechanism()

ARGS = {
    "chunked_budgets": chunked_budgets,
    "word_vectors": word_vectors,
    "mechanism": mechanism,
}
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 list, ndim 1, 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
reconstruct_with_template Ran
ran; our contract draft was wrong, not the code
sjmeis/DP-Decompose-Distribute/privatizer.py
code served (permissive licence) · get_code("ca51c7388260b4b4")
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 1, 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

# Analyzing the function:
# - original_tokens: list of strings (tokens that may be alphanumeric or punctuation)
# - privatized_chunks: list of strings (replacement chunks indexed by chunk_idx)
# - all_chunks: list of strings (chunks split by '_' to count words)
# The function reconstructs content by tracking which chunk each word belongs to

# Build test data
original_tokens = [
    "hello",
    ",",
    "world",
    "!",
    "this",
    "is",
    "a",
    "test"
]

# all_chunks: strings that may contain underscores
# Each word in chunk (split by '_') maps to that chunk index
all_chunks = [
    "hello_world",      # chunk 0: 2 words
    "this_is_a",        # chunk 1: 3 words
    "test"              # chunk 2: 1 word
]

# privatized_chunks: replacement versions of the chunks
privatized_chunks = [
    "[REDACTED_CHUNK_0]",
    "[REDACTED_CHUNK_1]",
    "[REDACTED_CHUNK_2]"
]

ARGS = {
    "original_tokens": original_tokens,
    "privatized_chunks": privatized_chunks,
    "all_chunks": all_chunks
}
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 1, 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

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

The goal of differentially private text obfuscation is to obfuscate, or "perturb", input texts with Differential Privacy (DP) guarantees, such that the private output texts are quantifiably indistinguishable from the originals. While perturbation at the word level is intuitive, meaningful text privatization happens on complete documents. Recent research has laid the groundwork for reasoning about privacy budget distribution, namely, how an overall ε budget can be sensibly distributed among the component pieces of a text. We perform a systematic evaluation of multiple text decomposition and budget distribution techniques in the context of DP text obfuscation, testing how different methods for chunking texts can be combined with techniques for allocating ε to these chunks. Our experiments reveal that such design choices are very important, as even with comparable privacy budgets, significantly different results can occur based on which methods are chosen. In this, we provide credible evidence of the feasibility of maximizing empirical trade-offs by optimizing DP obfuscation procedures.

For agents

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

get_harvested_code_for_paper("2605.01065")
get_code_for_paper("2605.01065")
have("2605.01065")

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

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

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

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

Connect an agent — have() is free.