Insights · Research

What is a semantic twin?

A semantic twin is a fictional stand-in for personal data that keeps what an AI task needs, so the model can reason with it, then swaps back in the answer.

Published
Reading time
10 min read
By
Saskia Russell, Founder's Associate

A semantic twin is a fictional stand-in for a piece of personal data: it keeps the context an AI task needs and changes who the data is about. Using customer data with AI while meeting privacy regulation is often treated as a contradiction. Nakato offers a way to use AI without exposing the sensitive information itself. It makes semantic twins through a process called Reversible Semantic Pseudonymisation (RSP): it finds the personal data, swaps each value for its twin, and restores the originals in the answer. Your real data never has to leave your environment.

Large language models (LLMs) work on context: they read the relationships between words to produce an accurate answer. With personally identifiable information (PII), that context is exactly what is sensitive, and it is also what makes PII so hard to detect. Once raw data enters a public AI model it cannot be withdrawn, so Nakato sits between your private data and the model, giving it twins built to keep meaning rather than just structure.

How semantic twinning works

First, PII and sensitive details are detected, and their context and meaning (the semantics) evaluated. The task is evaluated too: what it actually needs, its rules and limitations, not just its surface-level structure. Identifying this context means synthetic data with equivalent value, but different details, can be generated. Information is stripped of its identifiable features and a twin produced (the pseudonymisation). This twin behaves like real data and is fed to the third-party LLM. Nakato then reverses the process exactly, restoring the original data in the response it feeds back to you (the reversal). Personal data remains secure, intact and untouched by external eyes.

Semantic twinning is the most context-aware of the five levels of pseudonymisation, and How it works walks one record through each step.

Why redaction and tokenisation lose the context

Our method solves a problem earlier approaches have struggled with: preserving context without exposing detail. Redaction and tokenisation protect privacy, but they remove that vital context along the way. Redaction simply blocks out any identifiers, while tokenisation substitutes sensitive data with random characters.

Say we were dealing with a healthcare question about Sarah Chen, aged 68, with stage 3 kidney disease. Redaction would obscure Sarah’s name, her age and the detail of her disease, leaving the model a sentence with gaps where the facts were. The LLM has no context to process, so it cannot produce a useful answer.

Tokenisation poses a similar but slightly different problem. Her age would be replaced with a random string of letters and numbers, giving the model a value with no real-world meaning. The token carries no clinical significance, so a response tailored to her care cannot be generated. Removing context removes the LLM’s ability to reason. You can see one prompt under each method in how masking, tokenisation and pseudonymisation change an LLM prompt, and the table below sets the main approaches side by side.

What each approach hands an AI model, and whether the answer can be turned back into real terms.
Approach What the model receives What the model can still use Can the answer be mapped back?
Redaction or masking The text with each sensitive value deleted or blanked out The words around the gaps, but not how people, places and amounts relate No: the values are gone
Tokenisation or type labels A label in place of each value, saying only that it was a person or a place That a value was a person or a place, and which mentions are the same one Yes, through a lookup table
Random fake values A realistic value of the same type, chosen without regard to context A natural sentence, but facts that may no longer fit together Only if the swaps are logged
Synthetic dataset A dataset generated in advance to resemble the real one Overall patterns, but not your actual records No: its records describe no real person
Semantic twin A realistic value chosen to keep what the task needs, made at query time The context the task depends on, such as age band, region or scale Yes: every swap is recorded locally and reversed

What a semantic twin does instead

Applied to Sarah Chen’s record, RSP does not block out her name, age and diagnosis, or replace them with meaningless filler. It produces details that are equivalent: her age stays similar, her diagnosis and its stage stay the same, and anything that identifies her is changed. A twin is generated: Grace Lin, aged 70, with stage 3 kidney disease. This is sent to the LLM, so it can use the relevant clinical details to produce a usable response. Nakato then reverses the details and maps the answer back onto Sarah’s identity, inside your own environment.

Three things make the twin more than a fake value: it fits its context, it stays consistent everywhere Sarah appears in the request, and every swap is recorded so it can be reversed. Masking, tokenisation and semantic pseudonymisation compares the methods in more depth.

Sarah Chen’s record and its twin

Field Original stays with you Twin what the model sees Preserved
Patient Sarah Chen Grace Lin gender, name origin
Age 68 70 age band
Diagnosis Stage 3 kidney disease Stage 3 kidney disease unchanged: the task needs it
A synthetic example: Sarah Chen is not a real patient. The diagnosis is left as it is, because the task needs it and it identifies no one on its own.

How a semantic twin is measured

We judge a semantic twin’s success on two measures: utility and privacy. Utility, or downstream utility, measures how correct the AI’s response is after pseudonymisation and reversal, compared with the answer it would have given on the raw data. Because context is preserved, the model can reason with the twin much as it would with the original, and its answers can feed further tasks in a way that redacted data cannot.

Privacy is measured by how accurately the system detects sensitive data, and by how much can be reconstructed after the process has been reversed: the leak rate under active extraction attack, the share of cases in which a deliberate attempt to recover the original values succeeds. Nakato’s results on both measures, beside placeholder masking, tokenisation, GLiNER and Microsoft Presidio on the same test cases, are on the benchmarks page, with how each was measured. You can run a similar check on your own data by comparing answers from a de-identified copy with the original.

Sitting between your sensitive data and any third-party AI, Nakato replaces every identifying detail it finds before anything is sent, and holds back anything it is not sure about rather than letting it through (the confidence gate). It is designed so the model has no reasonable means of identifying your customers.

Is a semantic twin anonymous data?

No. Semantic twinning is pseudonymisation, not anonymisation, and the difference matters. Under the UK GDPR and the EU GDPR, pseudonymised data can no longer be linked to a person without additional information that is kept separately and protected. With Nakato, that additional information is the record of swaps, and it stays in your environment. For you, the data is still personal data, and your obligations still apply.

What can change is the position of whoever receives only the twins. In EDPS v SRB (C-413/23 P, 4 September 2025), the Court of Justice of the EU held that pseudonymised data is not necessarily personal data for every recipient: it depends on whether that recipient has means reasonably likely to be used to identify anyone. The European Data Protection Board’s Guidelines 01/2025 on Pseudonymisation call the environment where that link must be prevented the pseudonymisation domain. The AI model works inside it and sees only twins; the record that reverses them stays outside it, with you.

The GDPR defines pseudonymisation in Article 4(5):

“‘pseudonymisation’ means the processing of personal data in such a manner that the personal data can no longer be attributed to a specific data subject without the use of additional information, provided that such additional information is kept separately and is subject to technical and organisational measures to ensure that the personal data are not attributed to an identified or identifiable natural person”

General Data Protection Regulation, Regulation (EU) 2016/679, Article 4(5)

Keeping the model from identifying anyone is a design aim, not a guarantee of anonymity, and it does not replace your own assessment: a twin can still carry some risk of re-identification if the details it keeps are rare enough. If you share record-level data, work out who could recognise someone in it before you choose your tools. Anonymisation vs pseudonymisation explains how the law draws the line in the UK, the EU and the US, and a committee asked to approve twinned data for an LLM will want the evidence set out in getting pseudonymised data approved for an LLM.

Keeping both privacy and utility

Compliance is becoming harder. Instead of choosing to sacrifice privacy or utility, we offer a way to keep both at once. Nakato is the layer between your company and AI. We don’t mask the data; we transform it, so the model never sees the sensitive details.

The honest answer

When a semantic twin is not the right tool

The honest answer: semantic twins are for work that needs real context and has to stay reversible. They are the wrong choice when:

  • You need data that is truly anonymous, such as a dataset you will publish or hand over for good. A twin is reversible by design and its record stays with you, so the data stays personal data in your hands.
  • The task depends on the real identity. Screening a customer against a sanctions list, or checking a named person's credit file, needs the real name, not a twin.
  • You need a fully cloud-hosted service. Nakato currently runs inside your own cloud account or on your own servers, not as hosted software.
  • You are a technology company with the team to build and maintain your own layer. You may not need one from us.

Twins also do not remove the need to test. No detector finds everything, and even large language models miss some names, so check detection on your own documents. A layer also protects only the traffic routed through it, so test every route a prompt can take. How can teams safely send customer data to an LLM? sets out the rest, and the customer-data AI release checklist covers what to sign off before you go live.

Questions

Questions about semantic twins

Is a semantic twin the same as a digital twin?

No. A digital twin is a model of a real thing, such as a machine, a building or a patient, kept in step with it so you can study the original. A semantic twin is deliberately not the person: it keeps the meaning a task needs and breaks the link to who it is about. Other privacy products also use the word twin, usually for synthetic data made in advance; a semantic twin is made for a specific task, at the moment of the query, and reversed in the answer.

Is semantic twinning the same as synthetic data?

Not quite. Synthetic data usually means a whole dataset generated in advance to resemble the real one. A semantic twin replaces individual values inside your real records, at the moment of each query, and is reversed in the answer, so the result is about your actual customers.

What does the AI model actually see?

Only the twins and the task. The original values, and the record of which twin stands in for which original, stay inside your environment.

Does a semantic twin change the AI's answer?

It is designed not to. Because the twin keeps the context the task needs, the model can reason with it as it would with the original. How close the results come is measured as downstream utility on the benchmarks page; results vary with the kind of document and how Nakato is configured.

Can a semantic twin be traced back to the real person?

By you, yes: that is what makes it reversible, and the record of swaps stays in your environment. By the model, it is designed not to be: Nakato aims to leave the model with no reasonable means of identifying anyone. Rare details can still carry some risk, which is one reason pseudonymised data is treated as personal data.

What happens when Nakato is not sure something is personal data?

It holds the value back. Anything detected with less than 95% confidence is not passed through to the model, so a doubtful value is never sent as it is. This is the confidence gate.

Does it work for indirect identifiers, not just names?

Yes. An indirect identifier names no one on its own but can identify someone in combination with other details, such as a date of birth with a postcode. Nakato reads for meaning rather than matching patterns, so it twins these too. They are harder to spot than names, for reasons set out in our piece on why detection is hard.

What kinds of data can be twinned?

Text, voice recordings and images, across more than 50 types of personal data, including indirect identifiers. Nakato works with any AI model you call through an API.

Sources

  1. General Data Protection Regulation, Article 4(5)

    European Parliament and Council of the EU, 27 April 2016

    The legal definition of pseudonymisation

  2. Guidelines 01/2025 on Pseudonymisation

    European Data Protection Board, 16 January 2025

    The pseudonymisation domain

  3. EDPS v SRB, Case C-413/23 P

    Court of Justice of the European Union, 4 September 2025

    Whether pseudonymised data is personal data for each recipient

Written by

Saskia Russell

Founder's Associate

Saskia Russell is Founder's Associate at Nakato. She writes about how organisations can use sensitive customer data with AI models: what the law says, how the methods compare, and what is required to get a project moving.

More insights

All insights

  1. Research ·

    How good are LLMs at PII detection?

    Recent benchmarks show LLMs miss many rare or ambiguous names and over-flag others. They work best alongside string-matching and classifiers.

    4 min read

  2. Research ·

    The 5 levels of pseudonymisation

    Pseudonymisation runs from blanket redaction to semantic twinning. Each level keeps more of what the data means, and asks more of the model.

    4 min read

  3. Research ·

    What makes PII detection so hard?

    Names are easy for people to spot, but none of the features that mark them out in English belongs to names alone. Reliable detection needs context.

    5 min read