SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2407.11770 · 2024

Robust Utility-Preserving Text Anonymization Based on Large Language Models

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; 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/2407.11770.json · badge: /api/ran/2407.11770.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
ukplab/arxiv2024-rupta canonical (classifier label)
classifier basis: census
5 ran · 1 no recorded run
FunctionStatusWhere it lives
get_label_list Ran
ran; our contract draft was wrong, not the code
ukplab/arxiv2024-rupta/run_classification.py
code served (permissive licence) · get_code("adb7541f2edf078e")
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
from datasets import Dataset

torch.manual_seed(0)

# Create a mock dataset with multi-label structure
# The function accesses raw_dataset[split]['label']
# and either calls .unique() or iterates through lists

# Option 1: Create a dataset that has multi-label (list) structure
label_data_multi = {
    'label': [
        [0, 1],
        [1, 2],
        [0, 2, 3]
    ],
    'text': ['sample1', 'sample2', 'sample3']
}

# Option 2: Create a dataset that has single-label structure
label_data_single = {
    'label': [0, 1, 2, 0, 1],
    'text': ['sample1', 'sample2', 'sample3', 'sample4', 'sample5']
}

# Build a dict-like object that mimics the raw_dataset structure
class MockDataset(dict):
    def __init__(self, data_dict):
        super().__init__(data_dict)
    
    def unique(self, key):
        """Return unique values from a column"""
        values = self[key]
        return sorted(list(set(values)))

# Create train and test splits
train_split_multi = MockDataset(label_data_multi)
train_split_single = MockDataset(label_data_single)

raw_dataset_multi = {
    'train': train_split_multi,
    'test': MockDataset({'label': [[3, 4], [4]], 'text': ['test1', 'test2']})
}

raw_dataset_single = {
    'train': train_split_single,
    'test': MockDataset({'label': [3, 4], 'text': ['test1', 'test2']})
}

# Test with multi-label dataset
ARGS = {
    'raw_dataset': raw_dataset_multi,
    'split': 'train'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
datasets, 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
make_printv Ran
ran; our contract draft was wrong, not the code
ukplab/arxiv2024-rupta/utils.py
code served (permissive licence) · get_code("b2c53dc3cc9993aa")
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 torch

torch.manual_seed(0)

ARGS = {
    'verbose': True
}
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 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
message_to_str Ran
ran; our contract draft was wrong, not the code
ukplab/arxiv2024-rupta/generators/model.py
code served (permissive licence) · get_code("a067a230397d97aa")
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 str. 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 dataclasses
from typing import Literal

MessageRole = Literal['system', 'user', 'assistant']

@dataclasses.dataclass()
class Message:
    role: MessageRole
    content: str

def message_to_str(message: Message) -> str:
    return f'{message.role}: {message.content}'

# Create a valid Message instance
test_message = Message(
    role='user',
    content='Hello, how are you?'
)

ARGS = {
    'message': test_message
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
messages_to_str Ran
ran; our contract draft was wrong, not the code
ukplab/arxiv2024-rupta/generators/model.py
code served (permissive licence) · get_code("4e0f76b9ec8bd13a")
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 str. 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 dataclasses
from typing import List, Literal

MessageRole = Literal['system', 'user', 'assistant']

@dataclasses.dataclass()
class Message:
    role: MessageRole
    content: str

def message_to_str(message: Message) -> str:
    return f'{message.role}: {message.content}'

def messages_to_str(messages: List[Message]) -> str:
    return '\n'.join([message_to_str(message) for message in messages])

# Construct valid arguments
messages = [
    Message(role='system', content='You are a helpful assistant.'),
    Message(role='user', content='What is 2+2?'),
    Message(role='assistant', content='The answer is 4.')
]

ARGS = {
    'messages': messages
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
read_jsonl_gz Ran
ran; our contract draft was wrong, not the code
ukplab/arxiv2024-rupta/utils.py
code served (permissive licence) · get_code("ff9702cd987f980c")
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 gzip
import json
import tempfile
import os

# Create a temporary jsonl.gz file with sample data
temp_dir = tempfile.mkdtemp()
temp_file_path = os.path.join(temp_dir, "test_data.jsonl.gz")

sample_data = [
    {"id": 1, "text": "hello world"},
    {"id": 2, "text": "foo bar"},
    {"id": 3, "text": "test data"}
]

with gzip.open(temp_file_path, 'wt') as f:
    for item in sample_data:
        f.write(json.dumps(item) + '\n')

ARGS = {
    "path": temp_file_path
}
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 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
gpt_completion Not yet run
unverified (harvested, no recorded run)
ukplab/arxiv2024-rupta/generators/model.py
code served (permissive licence) · get_code("c03cf619c848cd7c")
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, 5 are also present in other papers whose code we hold (5 with at least one paper dated earlier, 0 the same month, 3 later) and 1 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
get_label_list 5 other papers
3 dated earlier, 2 later
2106.09685 (2021-06)
LoRA: Low-Rank Adaptation of Large Language Models
2403.11009 (2024-03)
DIALECTBENCH: A NLP Benchmark for Dialects, Varieties, and Closely-Related Languages
2405.00467 (2024-05)
Harnessing the Power of Multiple Minds: Lessons Learned from LLM Routing
and 2 more not named here
message_to_str 4 other papers
3 dated earlier, 1 later
2310.04406 (2023-10)
Language Agent Tree Search Unifies Reasoning Acting and Planning in Language Models
2402.16906 (2024-02)
Debug like a Human: A Large Language Model Debugger via Verifying Runtime Execution Step-by-step
2404.02183 (2024-04)
Self-Organized Agents: A LLM Multi-Agent Framework toward Ultra Large-Scale Code Generation and Optimization
and 1 more not named here
messages_to_str 4 other papers
3 dated earlier, 1 later
2310.04406 (2023-10)
Language Agent Tree Search Unifies Reasoning Acting and Planning in Language Models
2402.16906 (2024-02)
Debug like a Human: A Large Language Model Debugger via Verifying Runtime Execution Step-by-step
2404.02183 (2024-04)
Self-Organized Agents: A LLM Multi-Agent Framework toward Ultra Large-Scale Code Generation and Optimization
and 1 more not named here
make_printv 1 other paper
1 dated earlier
2404.02183 (2024-04)
Self-Organized Agents: A LLM Multi-Agent Framework toward Ultra Large-Scale Code Generation and Optimization
read_jsonl_gz 1 other paper
1 dated earlier
2404.02183 (2024-04)
Self-Organized Agents: A LLM Multi-Agent Framework toward Ultra Large-Scale Code Generation and 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-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

Anonymizing text that contains sensitive information is crucial for a wide range of applications. Existing techniques face the emerging challenges of the re-identification ability of large language models (LLMs), which have shown advanced capability in memorizing detailed information and reasoning over dispersed pieces of patterns to draw conclusions. When defending against LLM-based re-identification, anonymization could jeopardize the utility of the resulting anonymized data in downstream tasks. In general, the interaction between anonymization and data utility requires a deeper understanding within the context of LLMs. In this paper, we propose a framework composed of three key LLM-based components: a privacy evaluator, a utility evaluator, and an optimization component, which work collaboratively to perform anonymization. Extensive experiments demonstrate that the proposed model outperforms existing baselines, showing robustness in reducing the risk of re-identification while preserving greater data utility in downstream tasks. We provide detailed studies on these core modules. To consider large-scale and real-time applications, we investigate the distillation of the anonymization capabilities into lightweight models. All of our code and datasets will be made publicly available at https://github.com/UKPLab/acl2025-rupta.

For agents

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

get_harvested_code_for_paper("2407.11770")
get_code_for_paper("2407.11770")
have("2407.11770")

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

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

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

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

Connect an agent — have() is free.