How Airbnb De-identifies Text Before It Reaches ML Models
Airbnb trains machine learning models on transaction information, and before that data reaches a model, personally identifiable information is removed and replaced with simulated values that look realistic. The engineering team has published a detailed account of how they built this pipeline, starting from the open-source library Presidio and extending it to meet production requirements at scale.
The first major decision was architectural: Presidio ships as a Python package, and each consumer imports it in-process rather than calling a separate service. Raw personal data is de-identified inside the calling process, so no intermediate service holds it and the data flow stays simple. This also removes a central bottleneck, since jobs run independently wherever compute is available. The tradeoff is distribution — the library only protects data if every pipeline calls it, on the current version, with a compliant configuration. Airbnb addresses this by shipping the library as a reusable step in their shared ML workflow orchestrator. A team supplies only its data schema, marking which columns carry personal data; the privacy engineering team owns the recognizers, operators, language handling, and runtime environment. The resulting dataset is tagged as de-identified, and that tag follows the data into the model registry, where it is designed to gate deployment to production.
Within the system, two stages handle the work. The Analyzer finds spans that look like personal data and labels each with an entity type and confidence score. The Anonymizer decides what replaces each span. For detection, Airbnb uses three kinds of recognizers. Pattern-based recognizers rely on regex plus context words; NER-based recognizers depend on a model. Presidio's default NLP engine is spaCy, which Airbnb kept for most entity types but replaced for PERSON and LOCATION. The problem was specific: spaCy's generic NER tags any location it sees — cities, landmarks, neighborhoods — while the detail that identifies a person is a street address with a house number. On Airbnb's benchmark, those broad tags never resolved to the full address span. They replaced spaCy with GLiNER, a zero-shot NER model that takes an entity description at inference time, allowing them to ask specifically for a street address rather than any place name. Precision improved for both entity types. GLiNER2 is wired into the evaluation harness as a candidate, but adoption happens only when the benchmark shows a gain.
A subtler problem involved pattern recognizers and context words. Presidio's stock context matching is single-token, so declaring "gift card" as context never fires, while "card" alone fires just as readily next to a credit card number. Airbnb extended the enhancer with a phrase pass — an ordered contiguous multi-word match in the tokens before a candidate, scored above a single-word hit — so the recognizer whose specific phrase appears wins the span.
On the anonymization side, Airbnb uses the faker library to generate realistic fake values rather than placeholder tokens. This matters for downstream utility: a model training on de-identified text should still see content that reads like the original. Placeholder tokens signal that something was removed, and that signal is itself a pattern a model might learn, resulting in mis-training. Two properties must hold simultaneously for the fakes. Across separate runs, de-identifying the same input must produce different fake values, so the fakes themselves are designed not to become a fingerprint tying two de-identified outputs back to each other. Within a single run, the same real value must always map to the same fake, or the dataset stops being internally coherent — the same person mentioned twice in one record needs the same fake name both times. A globally shared random state cannot satisfy both constraints, so each fake is seeded from the real value plus a secret unique to the run. They do not store a real-to-fake mapping.
Sources:airbnb.tech