k-Anonymity: Protecting Individual Privacy in Released Data

Research
Introduced by
Latanya Sweeney
Year
2002
Type
Privacy-preserving data transformation
Family
Privacy-preserving analysis

What does it do?

k-Anonymity is a formal privacy model introduced by Latanya Sweeney in 2002 for releasing person-specific data.

It requires that every record in a released table be indistinguishable from at least k−1 other records with respect to a designated set of quasi-identifying attributes, such as age, sex and ZIP code. This limits re-identification by linking the released data to external sources.

The intuition behind the method

Imagine a class photo where you want to publish demographic statistics without revealing who is who. k-Anonymity works like blurring faces until at least k students share the same appearance in every group: even if an adversary knows someone's rough age and neighborhood, they cannot point to a single person. They can only narrow it down to a crowd of at least k individuals on the attributes that were chosen to be protected.

History

Latanya Sweeney introduced k-anonymity in a 2002 paper as a formal model for releasing person-specific data with a guarantee about how indistinguishable each individual is from others in the release. The abstract names Datafly, μ-Argus and k-Similar as real-world systems built on the model. Subsequent research extended the model to address attribute disclosure, and differential privacy was developed as a separate framework with a probabilistic guarantee.

When to use it

Choose k-anonymity when a table of person-level microdata must be released to researchers or the public, and the main threat is re-identification by linking quasi-identifiers to external sources. The method assumes the adversary's background knowledge is limited to the quasi-identifier values available in such external datasets. Do not rely on it when the main concern is disclosure of a sensitive attribute within a group, because a group whose members share one sensitive value reveals that value; l-diversity and t-closeness were proposed for that case. It is also a poor fit when the adversary has richer knowledge than the quasi-identifiers, or when the data are very high-dimensional. If tolerance for statistical noise is higher than tolerance for generalization, differential privacy may be the better choice.

Limitations and considerations

  • Homogeneity: if all records in an equivalence class share the same sensitive value, an adversary learns that value for every member of the class, even though no individual is singled out.
  • Background knowledge: an adversary who knows more about a target than the quasi-identifiers, for example that the person belongs to a particular sub-group, can narrow the candidate set below k.
  • Utility loss: as the number of quasi-identifiers grows, equivalence classes shrink, so reaching class size k can require heavy generalization in high-dimensional tables and degrade analytic value.
  • The parameter k is a count threshold; the model does not estimate the probability that a given record is re-identified.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • The guarantee is combinatorial and checkable: once the release passes the class-size check, every record has at least k−1 other records that cannot be distinguished from it on the chosen quasi-identifiers.
  • Compliance can be verified by counting records in each equivalence class, without cryptographic machinery or noise calibration.
  • Each row still corresponds to one person and the table keeps its attribute layout, so standard tabular analysis remains possible, although values are coarsened or suppressed.
  • The original abstract names Datafly, μ-Argus and k-Similar as real-world systems built on the model to provide privacy protection guarantees, which indicates its relevance to practical disclosure-control work.

Applications

  • Illustrative: a hospital preparing a patient-level extract for research could generalize age, sex and location before sharing it, since these are the attributes an adversary might link to a public register.
  • Illustrative: a statistics office preparing a person-level file for publication could coarsen occupation and regional codes so that rare combinations do not single out individuals.
  • Illustrative: a company publishing salary benchmarks from employee records could generalize job grade, tenure and location so that each published benchmark row covers at least k employees.
  • Illustrative: location traces could be coarsened in space and time so that an individual's trajectory is harder to single out among other users.
  • Illustrative: a school sharing student records with an external analyst could generalize cohort, age and postcode before the data leave the institution.

How it works

How it works

1

The curator first decides which attributes an adversary could combine with external information to single out individuals. These quasi-identifiers (QI), such as birth year, sex and ZIP code, are not identifiers on their own but can identify a person when linked to other data. Attributes treated as sensitive, such as a medical diagnosis, are not part of the QI set. The guarantee holds only with respect to the QI set chosen here, so a relevant attribute left out of it leaves the release exposed.

Formula
QI = \{a_1, a_2, \ldots, a_m\} \subseteq A
2

Records are grouped into equivalence classes: all records that share identical values on every quasi-identifier fall into the same class. The model requires each class to contain at least k records. Classes smaller than k violate the property and must be addressed before release.

Formula
EC_i = \{t \in T : t[QI] = v_i\}
3

To bring small classes up to size k, the curator generalizes values (for example, replacing an exact age of 34 with the range 30–39) or suppresses them. Each attribute has a generalization hierarchy that defines the permitted coarsening steps, and the candidate transformations form a generalization lattice in which each node is a combination of generalization levels, one per quasi-identifier. The height of a node is its distance from the most specific level of representation. Generalization is monotone: if a node satisfies k-anonymity, every more general node also satisfies it, and if a node violates k-anonymity, every more specific node also violates it. Practical algorithms therefore look for a minimally generalized node, one of the lowest height that satisfies k-anonymity after suppressing at most MaxSup tuples. Such nodes are preferred because they keep the most analytic utility, although the minimal generalization is not always unique and choices among transformations are guided by how much information each one loses.

Formula
g: dom(a_j) \rightarrow dom^*(a_j),\quad dom(a_j) \preceq dom^*(a_j)
4

After transformation, the released table T* is checked so that every equivalence class contains at least k records. If any class still falls below k, further generalization or suppression is applied and the check is repeated until the whole table satisfies the property.

Formula
\forall\, EC_i \subseteq T^*:\; |EC_i| \geq k

Common pitfalls

  • k is a policy choice rather than a fixed constant. A small k gives little protection against a well-informed adversary, while a large k can over-generalize the table. The value should follow from an explicit assessment of the adversary the release is meant to resist.
  • The guarantee holds only for the attributes treated as quasi-identifiers. A linkable attribute left out of the QI set, such as one that appears in a public register, makes the release look safer than it is.
  • Overlapping or longitudinal releases can be linked across time. Each release may satisfy k-anonymity on its own while the combination does not, so cross-release linkage needs separate analysis.
  • Treating k-anonymity as sufficient for sensitive data, such as health or financial records, ignores attribute disclosure. Layering l-diversity, t-closeness or differential privacy addresses threats the model does not cover.

Frequently asked questions

How do I choose the value of k?

There is no universal value of k. The choice should follow from the adversary model: how much an attacker could learn from external data, how many quasi-identifiers are involved, and how much generalization the analysis can tolerate. A small k leaves records easy to narrow down if the attacker has rich background information, while a large k usually forces heavier generalization and more information loss. Practitioners often compare the distribution of equivalence class sizes before and after transformation to see what a candidate k would cost, and the final value should be justified in a documented risk assessment.

What is the difference between k-anonymity and differential privacy?

k-Anonymity is a syntactic property of the released table: each record must share its quasi-identifier values with at least k−1 others. It gives no probabilistic bound on what an adversary learns. Differential privacy is a semantic guarantee that limits how much the presence or absence of any one individual can change the output distribution of a mechanism, and it is usually achieved by adding calibrated noise. k-Anonymity keeps records as true rows but coarsens or suppresses their values, whereas differential privacy typically perturbs the results, so the two are not interchangeable.

Can k-anonymity be applied to unstructured or high-dimensional data?

k-Anonymity was designed for structured tabular microdata. In high-dimensional tables with many quasi-identifiers, equivalence classes shrink rapidly, so reaching class size k can force generalization that removes most of the analytic value. For unstructured data such as text or images, or for very high-dimensional feature spaces, other approaches such as differential privacy, federated learning or synthetic data generation are usually considered instead.

Related methods

Sources

  1. Sweeney, L. (2002). k-anonymity: A model for protecting privacy. International Journal of Uncertainty, Fuzziness and Knowledge-Based Systems, 10(5), 557–570.

    Open DOI reference
  2. 2015_Book_DataMining, p. 675