Generated output can repeat sensitive source records; a synthetic label is not a privacy guarantee.
Synthetic-data privacy: copies, nearest neighbors and disclosure
Start with the threat model
Name who receives the data, what auxiliary facts they might know and what disclosure would harm a person or organization. Exact copies are easy to find, but a near copy with a changed ID can still reveal sensitive attributes. Very rare combinations may be identifying even when names are removed. Threat modeling determines which checks and access controls are relevant.
Run several checks
Compare generated rows with training records for exact duplicates and task-appropriate near neighbors. Inspect rare combinations, memorized free text and subgroup disclosure. Measure utility separately so privacy controls are not justified by a useless output. A distance threshold alone is not proof of safety: the metric may miss semantic similarity or external linkage through quasi-identifiers.
Know the guarantee boundary
A formally private training procedure can offer a stated bound under defined assumptions and accounting; an ordinary generator with filters cannot claim that bound. Even with a formal guarantee, released samples may be unsuitable for a particular use or may contain harmful patterns. Preserve restricted training inputs, generator versions, audit outcomes and approval records. Release gates should fail closed when a check has not run.
Check a disguised copy
Take a sensitive training receipt, change only its generated receipt ID and append it to an otherwise plausible release. An exact full-row comparison misses the copy, while a comparison on stable content fields catches it. Then test an unusual merchant-date-total combination. Document what each check detects and which linkage risks remain outside the test.
Implementation
def duplicate_content_keys(training_rows, generated_rows):
keys = {tuple(row[field] for field in ("merchant", "day", "total_cents"))
for row in training_rows}
return [row["synthetic_id"] for row in generated_rows
if tuple(row[field] for field in ("merchant", "day", "total_cents")) in keys]Performance and operating cost
Hashing T training keys and checking G generated rows costs O(T + G) expected time, O(T + D) space for D matches. Near-neighbor checks can cost much more and depend heavily on the similarity definition.
Common Mistakes
- Do not call de-identified or generated data automatically private.
- Do not rely on exact full-row equality alone.
- Do not claim a formal privacy guarantee without a mechanism and accounted parameters.
