Course contentsShow
← Data Science
Lesson 1897 of 2,14544. Data Ethics and PrivacyFree lesson

L-Diversity and T-Closeness

Explore advanced privacy models that address weaknesses in k-anonymity through diversity and distribution requirements.

L-Diversity and T-Closeness

What you'll learn: How L-Diversity and T-Closeness strengthen anonymization by requiring diversity and similar distributions in sensitive attributes, fixing weaknesses in k-anonymity.


Why K-Anonymity Isn't Enough

You've learned that k-anonymity groups records so each person is indistinguishable from at least k-1 others. But what if everyone in a group shares the same sensitive attribute? Imagine a hospital dataset where 5 patients are k-anonymous, but all 5 have "diabetes." An attacker learns someone's diagnosis without breaking k-anonymity!

L-Diversity: Requiring Variety

L-Diversity addresses this by requiring that each equivalence class (group of indistinguishable records) contains at least L well-represented values for sensitive attributes.

Analogy: Think of a witness lineup. K-anonymity ensures enough people stand together, but L-diversity ensures they don't all wear the same distinctive jacket.

For example, if L=3, a group must have at least 3 different diagnoses (like "diabetes," "flu," "broken arm") represented meaningfully—not just one person with flu among 99 with diabetes.

T-Closeness: Matching Distributions

T-Closeness goes further: the distribution of sensitive attributes in each group must be close to the overall distribution in the dataset (within threshold T).

Analogy: If 10% of the population has diabetes, each anonymized group should also have roughly 10% diabetes cases—not 90%.

This prevents attackers from inferring information by noticing that certain groups have skewed attribute distributions compared to the general population.

When to Use What

  • K-anonymity: Basic re-identification protection
  • L-Diversity: When homogeneity attacks are a risk
  • T-Closeness: When distribution-based inference attacks are possible

Key Takeaway: L-Diversity requires diverse sensitive values within each group, while T-Closeness ensures those values follow similar distributions to the overall dataset—both patch critical vulnerabilities in k-anonymity alone.