t-closeness

On this page 7

t-closeness is a privacy model for anonymized datasets that requires the distribution of a sensitive attribute within every equivalence class to stay within a distance t of that attribute’s distribution in the whole table. In privacy engineering, it is a refinement of k-anonymity and l-diversity designed to stop attackers from learning too much about an individual simply by locating the group of records that person belongs to.

The model was introduced in 2007 by Ninghui Li, Tiancheng Li and Suresh Venkatasubramanian. Its core idea is that a release is safe only if knowing someone’s group reveals little more than knowing the population as a whole, which limits attribute disclosure rather than only identity disclosure.

How the t-closeness requirement is defined

A table is first generalized or suppressed so that records sharing the same quasi-identifier values, such as age range, postal code prefix and gender, form equivalence classes. The model then compares two probability distributions for the sensitive attribute: the global distribution P across the full table and the local distribution Q inside each class.

The release satisfies the model when the distance D(P, Q) is less than or equal to t for every class. A smaller threshold means stronger protection, because each group must look more like the population. The original proposal measures distance with the Earth Mover’s Distance (EMD), which captures how much probability mass must move, and how far, to turn one distribution into the other.

The parameters involved in the definition are summarized below.

ElementMeaningTypical setting
Quasi-identifiersAttributes linkable to external dataAge, postal code, gender, dates
Sensitive attributeValue the attacker wants to learnDiagnosis, salary, credit score
Equivalence classRecords indistinguishable on quasi-identifiersCreated by generalization
Distance measureGap between class and table distributionEarth Mover’s Distance
Threshold tMaximum allowed distanceOften 0.1 to 0.3 on a 0 to 1 scale
Core elements of the t-closeness definition

Measuring distance between distributions

The choice of distance function decides what kind of leakage counts. For a categorical attribute without order, such as an unordered list of diseases, EMD with equal ground distance reduces to half the sum of absolute probability differences, which is the total variation distance. For numeric or ordered attributes, such as salary bands, EMD uses ordered distance, so a class concentrated at one end of the scale is penalized more than one spread across neighboring values.

Hierarchical attributes can use a generalization tree as the ground distance, so that grouping two related diagnoses costs less than grouping unrelated ones. Some later work replaced EMD with Kullback-Leibler divergence or other measures, but each choice changes the meaning of t, so thresholds are not comparable across measures.

Attribute typeGround distanceEffect on protection
Unordered categoricalEqual distance between valuesLimits skew in value frequencies
Ordered numericNormalized rank differencePrevents clustering at extremes
Hierarchical categoricalDistance in a taxonomy treeTreats related values as closer
Distance choices by attribute type

Relationship to k-anonymity and l-diversity

The model forms the third step in a well-known progression of syntactic privacy models. k-anonymity hides each person among at least k records, but a class whose members all share one diagnosis still reveals that diagnosis, which is the homogeneity attack. l-diversity requires at least l well-represented sensitive values per class, yet it remains vulnerable to skewness attacks and similarity attacks.

In a skewness attack, a class that is 50 percent positive for a rare disease satisfies 2-diversity, but it raises an attacker’s belief sharply if the population rate is 1 percent. In a similarity attack, a class may contain diverse but semantically similar values, such as three different stomach conditions, which still disclose that the person has a stomach illness. Distribution closeness addresses both problems directly.

ModelGuaranteeMain remaining weakness
k-anonymityAt least k records per classHomogeneity and background knowledge
l-diversityAt least l distinct sensitive valuesSkewness and similarity attacks
t-closenessClass distribution close to globalHigh utility loss, no formal composition
Differential privacyBounded influence of any one recordNoise reduces accuracy
Comparison of related privacy models

Applying the model to a data release

Practitioners apply the model with anonymization tools that search a generalization lattice for the least distorting transformation satisfying all constraints. A typical workflow first classifies attributes, then sets k, l and t together, runs the search, and finally measures utility loss with metrics such as discernibility, information loss or the accuracy of downstream models.

Choosing t is a policy decision, not a purely technical one. The table below illustrates how different release contexts usually influence the setting.

Release contextSuggested strictnessReason
Public open dataLow t, around 0.1Unknown attackers with rich background data
Controlled research accessModerate t, around 0.2Contracts and access controls add protection
Internal analyticsHigher t, around 0.3Trusted recipients, utility matters more
Highly skewed sensitive dataCombine with suppressionRare values otherwise force heavy generalization
Choosing a threshold for different release contexts

Limitations and common mistakes

The strongest criticism concerns utility. Forcing every class to mirror the global distribution can require coarse generalization that erases correlations between quasi-identifiers and the sensitive attribute, which are often exactly what analysts want to study. The model also protects one sensitive attribute at a time; handling several sensitive columns together multiplies the constraints.

  • Treating t as a universal constant. Its meaning depends on the distance measure and the attribute scale.
  • Ignoring background knowledge. Attackers with auxiliary data may still infer values beyond the model’s assumptions.
  • Assuming composition is safe. Several releases of the same population can be combined to re-identify people.
  • Skipping risk assessment. Passing a syntactic test does not replace a documented re-identification risk analysis.

For these reasons, many teams now treat the model as one control within a broader de-identification strategy, often alongside differential privacy for aggregate statistics and strict access governance for record-level data.

The simple explanation

Imagine a hospital shares patient records after hiding names and blurring details such as exact age and address. People end up in small groups that look alike. If one group is made up mostly of cancer patients, anyone who knows a neighbor belongs to that group can guess the diagnosis.

This model prevents that guess. It requires every group to have roughly the same mix of diagnoses as the whole hospital. Finding someone’s group then tells you almost nothing new about that person. The trade-off is that the data becomes blurrier and less detailed for research.

How it is used in practice

A regional health authority plans to publish a dataset of 40,000 hospital discharges for academic researchers. The quasi-identifiers are age, sex, three-digit postal code and admission month, and the sensitive attribute is the primary diagnosis group. An initial 5-anonymous version passes review, yet the privacy team finds classes where over 60 percent of patients share a psychiatric diagnosis, compared with 8 percent overall.

The team applies a threshold of 0.15 using Earth Mover’s Distance over a diagnosis taxonomy. The anonymization tool widens age bands to ten years, merges admission months into quarters and suppresses about 2 percent of records with rare combinations. Every class now mirrors the regional diagnosis mix closely.

Researchers can still study seasonal admission trends and age patterns, while the authority documents a substantially reduced attribute disclosure risk in its release assessment.