Manuscript Offprint
arXiv:2610.22800Veil-Then-Reveal: Protecting PII Privacy via Reversible Pseudo-Anonymization in Zero-Trust User--LLM Interaction
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original. This text is shared under the same licence.
Abstract
Large language models (LLMs) increasingly process sensitive documents and personal information, yet sending prompts containing personally identifiable information (PII) to remote providers exposes data subjects and organizations to risks from logging, retention, model training, and unintended disclosure. Existing anonymization methods often mask or remove PII, while conventional encryption eliminates the lexical and structural cues needed for effective LLM processing. We present Veil-then-Reveal (VTR), a user-side PII pseudo-anonymization framework for privacy-preserving LLM interaction under a zero-trust threat model. VTR treats remote LLM providers as untrusted and sends only pseudo-anonymized prompts, keeping plaintext PII on the user. VTR first detects PII and replaces it with realistic, same-type, invocabulary surrogates before prompts leave the user's device, preserving their linguistic and structural properties. It combines format-preserving encryption (FPE) for structured PII, such as phone and credit-card numbers, with a keyed-hash dictionary and secure vault for semantic PII, such as names, locations, and organizations. Session-specific mappings provide cross-session unlinkability, while user-side restoration reversibly replaces surrogates with their original values in LLM responses. We further introduce a rank-class FPE strategy for dates that preserves format and ambiguity while reducing cipher evaluations. Evaluation on three datasets containing 11,322 annotated PII instances achieves 97.9% detection recall, 95.2% protection of detected values, and 99.9% round trip; 100% of echoed surrogates end-to-end round-trip restoration.
1 Introduction
Large language models (LLMs) increasingly process sensitive documents containing personally identifiable information (PII). Sending raw PII to remote LLM providers creates substantial privacy risks: prompts may be logged, retained, exposed through model outputs, or exploited to recover sensitive information (Das et al., 2025; Cheng et al., 2026). Recent incidents further demonstrate that even widely deployed LLM services can expose user data (OpenAI, 2023). These risks motivate a fundamental question: how can users leverage remote LLMs without revealing their raw PII?
Existing defenses largely rely on redaction or anonymization, but removing PII can destroy context-critical information needed for accurate inference (Asthana et al., 2025). Simple pseudonymization can also leave indirect identifiers that enable re-identification (Boutet et al., 2025), while masking alone does not prevent sensitive information from resurfacing through retrieval or memory mechanisms (Ma et al., 2026). Recent approaches such as PrivacyRestore (Zeng et al., 2025) and SecureGate (Shaaban and Elmahallawy, 2026) explore reversible or selective protection, but introduce additional model-side mechanisms, training, or communication overhead.
We present Veil-then-Reveal (VTR), a user-side PII pseudo-anonymization framework that enables user-LLM interaction under a zero-trust threat model. Instead of deleting sensitive values, VTR first detects PII and then replaces each instance locally with realistic, same-type surrogates, allowing the remote LLM to operate on structurally and semantically meaningful text while never receiving the original PII. VTR integrates Format-Preserving Encryption (FPE) for structured identifiers with keyed semantic substitution for contextual entities. Original PII values and mappings remain exclusively on the user, enabling exact restoration after inference and session-specific unlinkability.
A key novelty is our rank-class FPE for dates. Unlike digit-wise encryption, which can produce invalid dates or destroy inherent date ambiguity, rank-class FPE encrypts a date within the set of legal interpretations admitted by its rendering. This preserves both syntactic validity and ambiguity while reducing the encryption overhead by 410–730×. In summary, our key contributions are:
• We propose VTR, a reversible, user-side pseudo-anonymization framework that keeps raw PII outside the boundary of a remote LLM while preserving useful prompt context and model utility.
• We develop a hybrid protection design combining FPE with keyed semantic token substitution, using user-only mappings and session-specific surrogates to provide cross-session unlinkability.
• We propose rank-class FPE for dates, retaining valid formatting and temporal ambiguity while markedly reducing encryption cost and improving valid-date generation from 0.3% to 88.4%.
• We evaluate VTR on three datasets containing four corpora, including 10,000 ai4privacy documents with 11,322 annotated PII instances across 8 PII types, achieving 97.9% detection recall, 95.2% protection of detected values, and 99.9% exact round-trip restoration. The results show that residual exposure is governed by detection recall rather than transformation failures.
PII Detection and Text Anonymization. PII protection typically begins with entity detection and masking. Savkin et al. (Savkin et al., 2025) show that generic NER models often miss PII-specific contexts, while RECAP (Rajgarhia et al., 2025) improves recall by combining regex and LLM-based detection. Undetected PII remains exposed, making detection recall a fundamental privacy limitation. Conventional anonymization, however, masks or removes PII, disrupting linguistic structure and preventing exact recovery. DP-based approaches such as CUSTEXT (Chen et al., 2023a) provide formal privacy guarantees via token perturbation but may reduce utility and lack exact restoration.
Cryptographic Sanitization. FPE, such as NIST FF3-1, protects structured values while preserving their format and length. PR€εMPT (Chowdhury et al., 2025) combines FPE for fixed-format PII with metric-DP transformations for semantic attributes. However, such approaches do not provide a unified mechanism for context-dependent entities such as names and locations or exact end-to-end restoration. Our approach similarly uses FPE for structured PII formats (e.g., SSNs, phone numbers, credit cards, etc.), while introducing rank-class FPE for dates to preserve valid calendar interpretations with fewer cryptographic operations.
User-Side and Zero-Trust Protection. User-side approaches keep sensitive data from reaching untrusted cloud services. Gim et al. (Gim et al., 2024) use trusted execution and multi-party decoding, while PII SHIELD (Holschneider and LeeYouk, 2026) performs local LLM-based anonymization with decoy interactions. Chen et al. (Chen et al., 2023b) use local models to replace private entities and restore them in cloud responses. These approaches demonstrate the value of on-device protection but may introduce computational overhead or dependence on learned models. In contrast, our approach uses deterministic keyed mappings and FPE for lightweight, exact user-side restoration without trusted hardware or learned recovery.
3 Threat Model
We consider a user running VTR locally and interacting with a remote cloud LLM. Before transmission, VTR replaces detected PII with surrogates, so the LLM never receives the original values.
Attacker model. We assume an honest-but-curious remote LLM provider that performs inference correctly but may inspect, log, retain, analyze, and correlate inputs and outputs across sessions, possibly using auxiliary information. The provider knows the design and public parameters of VTR but cannot access user-side secret keys, surrogate mappings, or the restoration vault, compromise the user, or modify inference.
Security objectives. We target three properties: (i) PII confidentiality: detected original PII remains unrecoverable from observed surrogates; (ii) cross-session unlinkability: the same underlying PII in different sessions is not directly linkable; and (iii) user-side reversibility: the user can restore original PII from surrogates returned by the LLM.
Scope and assumptions. Guarantees apply only to detected PII; undetected PII may remain exposed, and VTR does not prevent contextual or seman-tic inference. We assume an uncompromised user device and inaccessible user-side keys, mappings, and restoration state.
4 Methodology
We design VTR around a simple principle: sensitive information should never leave the user's device in plaintext. VTR locally detects PII, replaces it with realistic surrogates, and sends only the pseudonymized prompt to the untrusted cloud LLM. The response is deterministically restored on-device, completing a reversible round trip without exposing the original PII or its mappings. As shown in Fig. 1, VTR comprises three components: local PII detection, two-mechanism surrogate generation, and on-device restoration.
4.1 PII Detection and Protection
Given a user prompt x, VTR identifies PII entities with a detector D before the prompt is sent to the untrusted LLM M:
where is the number of detected PII entities, denotes the text span corresponding to the -th PII entity, and specify its beginning and ending offsets in the prompt, respectively, and denotes its PII type. Each detected entity is assigned to one of two protection methods based on its PII type: syntactic protection or semantic protection (see Section 4.2).
Before transformation, VTR establishes session-specific key material on the user's device. A master key is generated locally and never leaves the device. For each session, VTR derives a session key from using the session identifier sid as session-specific context with the HMAC-based Key Derivation Function (HKDF) (Krawczyk and Eronen, 2010):
Binding the derived key to the session identifier ensures that the same PII value can produce different protected representations across different sessions, thereby preventing straightforward cross-session linkability. To further enforce key separation, VTR derives specific keys from using distinct labels for the syntactic and semantic mechanisms:
Thus, the two protection methods use independent session keys, ensuring cross-session unlinkability.
4.2 PII-Aware Surrogate Pseudonymization
After PII detection and type-based assignment, VTR replaces each detected entity with a session-specific surrogate while preserving information needed for downstream model reasoning. It uses two complementary protection mechanisms: a syntactic mechanism for structured-format PII, such as , and a semantic mechanism for PII that requires preserving its type and linguistic plausibility, such as .
4.2.1 Syntactic PII protection Method
For , a surrogate must (a) remain valid for its type, (b) preserve the original format layout, and (c) be reversible using only the syntactic key (Section 4.3). VTR provides two keyed mechanisms: Encipherment, which independently applies FPE to each PII; and Translation, used for dates when temporal relations must be preserved.
- Encipherment Mechanism: We use FF1 standardized in NIST SP 800-38G (Dworkin, 2001), denoting encryption under with type-specific tweak by for domain separation. We use two regimes depending on whether every digit string of the required length is valid; dates require dedicated handling. For direct identifiers such as SSNs, phone numbers, and card numbers, let extract the digits and preserve the non-digit layout. The surrogate is
where inserts the enciphered digits into their original positions, preserving punctuation, spacing, and grouping while transforming the underlying value. Note that a leading telephone country code is copied unchanged. Appendix E provides examples for each syntactic PII type, with Table 16 detailing the encipherment steps.
For dates, validity depends on the calendar semantics rather than the digit sequence alone. For a four-digit year, digit strings are possible, but only 73,049 represent valid dates within VTR's supported range (1900–2099), so direct digit encipherment can produce invalid dates. We therefore use rank-then-encipher (Bellare et al., 2010). Let be the valid values compatible with the representation of v, and let

Figure 1: Overview of VTR’s protection framework using an example prompt. Real PII is shown in red and surrogates in blue; orange solid frames denote syntactic handling and purple dashed frames semantic handling. (1) A local detector D identifies and routes PII in prompt x, and VTR derives the required keys; (2) Syntactic values are encrypted under (or date-shifted by a document-level offset), while semantic values are replaced with same-kind surrogates under and stored in vault V (Sections 4.2.1–4.2.2). Only the sanitized prompt , containing the generated surrogates, reaches the remote untrusted model M; (3) Syntactic surrogates in reply are inverted under , while semantic surrogates are restored from V, yielding the final response y (Section 4.3).
be a bijective ranking. The surrogate is
which is valid by construction. FF1 operates at the smallest decimal width satisfying ; outputs are re-enciphered until they fall within the valid domain (cyclic walk). The valid set is derived from the input Value and never stored. VTR supports five date representations:
-
Fixed-layout dates: For dates such as 1985-07-24, VTR parses and ranks the date within its valid calendar domain, then renders the surrogate in the original layout, preserving field order, widths, and separators.
-
Ambiguous numeric dates: For dates such as 10/03/1976 that admit multiple interpretations, VTR ranks them within their ambiguity class
thereby preserving the interpretations supported by the input without assuming a locale.
-
Textual dates: For dates such as Feb 4th, 1909, VTR canonicalizes the date to an unambiguous format, ranks, and enciphers it, then renders the surrogate in the original textual style.
-
Timestamps: For timestamps such as 1902-08-21T22:37:28.285Z, VTR transforms the date and time-of-day components using separate tweaks while preserving separators, fractional precision, and time zone.
-
Partial dates: For incomplete dates such as 20th September, VTR declines the entity because it lacks a complete calendar date suitable for rank-based encipherment.
Detailed examples are provided in Appendix E.
- Translation Mechanism: While independent date encipherment preserves privacy and enables stateless restoration, it breaks temporal relations such as order, duration, and tense. Since these relations depend on date pairs, VTR instead provides document-level translation as an alternative.
Let be the number of days in the specified range, map dates bijectively to , and for dates in document . Let , be a document-specific tweak derived from the document identifier, and be an HMAC-based pseudorandom function under . Given a system-wide displacement bound , VTR deterministically selects a single admissible offset
(6)
where excludes recognizable shifts, such as those preserving weekdays or seasons. Since and the candidate sequence are plaintext-independent, depends only on and need not be stored. The same offset is applied to every date:
with the original layout retained during rendering. Translation is a bijection on , preserving validity, reversibility, and format. Applying the same offset to all dates preserves their relative order and duration unless a date crosses the supported-range boundary (Appendix C). Thus, encipherment independently permutes dates, whereas translation applies a common keyed rotation. Details and acceptance rates of offsets are given in Appendix C.2.
Importantly, translation alone does not preserve tense, since the present remains fixed. VTR therefore supports two variants:
• SHIFT-CAPPED: restricts the offset to values that keep all dates on their original side of :
(8)
and samples from . This preserves tense but makes the shift plaintext-dependent and requires storing the offset.
• SHIFT-TODAY: keeps Eqs. (6)–(7) unchanged and shifts the stated present by the same offset, . Hence , preserving tense without limiting the displacement or storing . This assumes that evaluates temporal relations relative to the prompt-stated present (Gao et al., 2025).
Thus, translation trades independent encipherment for document-level temporal consistency and is used when such relations matter. Table 15 in Appendix C.4 compares SHIFT, SHIFT-CAPPED, and SHIFT-TODAY in preserving order, duration, tense.
4.2.2 Semantic PII Protection Mechanism
For , character-level encipherment can destroy an entity's linguistic identity. VTR rather replaces each value with a plausible surrogate of the same semantic type, preserving its class and relevant attributes. Each value is normalized to by collapsing whitespace and lower-casing, mapping formatting variants to exact canonical value.
Pools and Selection. For each semantic bucket b, VTR maintains a curated pool of type-consistent values. Pools are constructed from Faker-Library-generated locale data over fifteen Latin-script locales (Faraglia and contributors, 2026), with deterministic ordering (Appendix F). Persons use locale-and gender-consistent given-name and surname pools to maintain plausible name combinations; locations use city names, organizations use company names, and e-mails combine independently selected names and domains. Given the canonical value , VTR deterministically selects a surrogate using HMAC under the semantic session key :
where r is a candidate index. Attribute-bearing buckets use independent instances of the same construction under attribute-specific labels. Because is session-specific, the same value maps to different surrogates across sessions, while determinism preserves consistency within a session.
Collision resolution. Distinct values must remain distinguishable. If the selected has already been assigned to another value, VTR increments and re-evaluates Eq. (9) until an unused candidate is obtained. For the -th distinct value, the first candidate is rejected with probability at most , which is small for VTR's large pools.
Vault. Unlike the syntactic mechanism, semantic substitution is not reversible from the key alone because HMAC is one-way. VTR therefore maintains a session-local vault,
together with a reverse index from to for repeated values and collision tracking. The vault remains on-device and is erased when the session ends; restoration is described in Section 4.3.
Thus, the semantic mechanism trades stateless syntactic encipherment for plausible, type-consistent surrogates and session-local state. Table 18 in Appendix F provides a worked example of canonicalization, keyed surrogate selection, collision handling, and cross-session variation.
4.3 On-Device PII Restoration
After surrogate generation, VTR replaces each detected PII entity in the prompt with its surrogate, producing sanitized prompt sent to the untrusted model . The returned response is restored locally before being shown to the user. For each surrogate , VTR applies the inverse of its generation mechanism:
where reverses the corresponding syntactic transformation and V is the session-local semantic vault. For directly enciphered values, restoration decrypts the digit string and refills the original template; for ranked domains, it decrypts the rank and un-ranks it within the recomputed valid domain. For translated dates, is re-derived from and and removed from the cyclic day line:
Since translation is a bijective rotation, it preserves model-computed dates relative to their surrogates.
All restoration state remains on-device: , , and the semantic vault V are never exposed to M and are discarded at session termination. Thus, the remote LLM sees only surrogate-bearing text, while VTR restores the response locally.
5 Performance Evaluation
5.1 Experimental Setup
Datasets. We evaluate VTR on four corpora: ai4privacy (Ai4Privacy, 2023), PUPA (Siyan et al., 2025), WildChat (Zhao et al., 2024), and ShareGPT (anon8231489123, 2023); details appear in Appendix G.1.
Models. We evaluate three untrusted models from different vendors: Llama-3.2-3B (Grattafiori et al., 2024), Gemma-2-2B (Team et al., 2024), and Phi-3.5-mini (Abdin et al., 2024), each evaluated under identical environment and cryptographic parameters (Appendix G.5).
Baselines. We compare VTR with eleven state-of-the-art protection schemes, grouped by their trust boundary (Appendix G.3). Entity substitution includes Prεεmpt (Chowdhury et al., 2025), Rescriber (Zhou et al., 2025), and Hide-and-Seek (HaS) (Chen et al., 2023b); local rewrite includes PAPILLON (Siyan et al., 2025), Staab et al.'s adversarial anonymizer (Staab et al.), and SEAL (Kim et al., 2026); and DP includes SanText+ (Yue et al., 2021), CusText (Chen et al., 2023a), DP-MLM (Meisenbacher et al., 2024), DP-Prompt (Utpala et al., 2023), and InferDPT (Tong et al., 2025).
Evaluation metrics. We evaluate 4 aspects of VTR: detection, transformation, privacy at the trust boundary, and end-to-end restoration. For detection, we report Recall and Missed. For transformation, we measure Protected, Round trip, Valid, and Collisions, while date-specific evaluation includes Ambiguity kept, Cipher calls, and translation consistency. To assess what crosses the trust boundary, we measure Leaked, Leak-free, Retained, Perplexity (PPL), Unchanged, Words changed, and Local generations. Finally, end-to-end performance is evaluated using Echoed, Restored, Untrusted answer, Local answer, Value back, and Restored by. Metric definitions are provided in Appendix G.4.
5.2 Main Results: VTR vs. Baselines
Privacy–utility trade-off. On all 664 PUPA rows (Table 1), VTR reduces Leaked from 95.1% to 27.0% (3.5×) while retaining 95% of the request without requiring a user-side LLM query to restore the generated response. Among entity-substitution methods, VTR matches Rescriber at 27.0% leakage and improves over Prεεmpt, which leaks 2.4× more while leaving several contextual PII types unprotected. HaS lowers leakage further to 19.8%, but retains only 86% of the request and requires about two Local generations per request. Other methods achieve lower leakage by retaining substantially less context: 62% (Staab et al.), 38% (PAPILLON), 27% (DP-Prompt), 15% (DP-MLM), 13% (SEAL), and 5% (InferDPT). At their published ε, SanText+ and CusText also leak 1.9× and 2.0× more than VTR. Thus, VTR offers a strong privacy–utility trade-off, combining 27.0% leakage with 95% retention and no local generation, while preserving realistic, same-type surrogates.
PII Leakage by Data Type. Table 3 extends Table 1 with per-type results on 1,000 ai4privacy documents. VTR leaks 2.9% of values while retaining 99.1% of the request; Rescriber, operating on the same entities, is comparable at 2.8% leakage and 98.0% retention. Six baselines leak more: HaS 1.8×, with its hider leaving 24.2% of SSN and 23.8% of CARD values; PAPILLON 4.4×; Prεεmpt 13×, with no mechanism for three types; and SanText+, DP-Prompt, and CusText 15–22×. The four methods with lower leakage substantially reduce Retained: Staab et al. to 76.7%, SEAL to 15.3%, DP-MLM to 9.1%, and InferDPT to 1.8%. Prompt perplexity. Under Llama-3.2-3B, VTR sends text at 1.20× the unprotected prompt's perplexity, slightly above entity-substitution methods.
| Category | Method | Privacy | Utility | Prompt Edit | Cost | Restoration | |||
|---|---|---|---|---|---|---|---|---|---|
| Leaked↓(PII values) | Leak-free↑(Prompts) | Retained↑(Words) | PPL (×) | Unchanged↑(Prompts) | Changed↓(Words) | Local queries↓(Number) | Restored by | ||
| Unprotected | 95.1 | 3.8 | 100 | 1.00 | 100 | 0.0 | 0 | - | |
| Entity Substitute | Rescriber | 27.0 | 64.8 | 93 | 1.00 | 11.7 | 10.6 | 0 | map |
| HaS | 19.8 | 69.3 | 86 | 1.02 | 12.5 | 18.4 | 1.9 | model | |
| Prεempt | 63.8 | 25.5 | 99 | 1.00 | 3.1 | 0 | key, map | ||
| VTR | 27.0 | 64.6 | 95 | 1.20 | 11.9 | 9.4 | 0 | key, vault | |
| Local rewrite | PAPILLON | 21.7 | 60.5 | 38 | 0.47 | 0.0 | 78.6 | 2.0 | model |
| Staab et al. | 6.5 | 90.5 | 62 | 0.81 | 0.3 | 43.9 | 6.0 | not restored | |
| SEAL | 0.2 | 99.4 | 13 | 0.76 | 0.0 | 86.0 | 6.0 | not restored | |
| DP-based | SanText+ ε=3 | 51.5 | 37.7 | 84 | 8.53 | 0.6 | 38.1 | 0 | not restored |
| CusText ε=3 | 55.0 | 32.1 | 45 | 38.9 | 2.3 | 71.7 | 0 | not restored | |
| DP-MLM ε=25 | 4.4 | 91.1 | 15 | 30.2 | 0.0 | 64.1 | 0 | not restored | |
| DP-Prompt ε=53.4 | 23.2 | 61.1 | 27 | 3.21 | 1.1 | 79.5 | 0 | not restored | |
| InferDPT ε=3 | 0.4 | 98.9 | 5 | 344.4 | 0.0 | 98.5 | 1.0 | model | |
Table 1: Trust-boundary leakage, utility, prompt edits, and restoration cost on 664 PUPA rows using Llama-3.2-3B. Arrows indicate the direction; values are in % except PPL and cost, reported as a ratio and count, respectively. Prεempt has no mechanism for locations, organizations or e-mail addresses: it sends of prompts unchanged, and 329 of these 347 still expose PII verbatim, whereas VTR, given the same detected entities, edits 268 of them.
| Metric | Method | Syntactic types | Semantic types | Aggregate | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| SSN | PHONE | CARD | DATE | PERSON | LOC | ORG | DATE | Syntactic | Semantic | All | |||
| Detected entities (#) | 475 | 644 | 1,014 | 1,147 | 4,589 | 2,642 | 2,602 | 887 | 2,405 | 3,280 | 13,125 | 16,405 | |
| Protected | Prεempt | 100 | 99.2 | 100 | 93.2 | 100 | n/a | n/a | n/a | 0.1 | 97.5 | 35.0 | 47.5 |
| Rescriber | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | |
| VTR | 100 | 99.4 | 100 | 100 | 100 | 100 | 100 | 100 | 67.2 | 99.9 | 94.0 | 95.2 | |
| VTR-w/o FPE | 100 | 100 | 100 | 100 | 99.7 | 100 | 99.0 | 100 | 67.0 | 100 | 93.6 | 94.9 | |
| Round trip | Prεempt | 100 | 100 | 100 | 100 | 72.9 | n/a | n/a | n/a | 100 | 100 | 72.9 | 84.0 |
| Rescriber | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | |
| VTR | 100 | 100 | 100 | 100 | 100 | 100 | 99.2 | 100 | 99.8 | 100 | 99.8 | 99.9 | |
| VTR-w/o FPE | 100 | 100 | 100 | 100 | 100 | 100 | 99.2 | 100 | 99.8 | 100 | 99.8 | 99.9 | |
| Valid | Prεempt | 48.4 | 13.1 | 7.2 | 0.3 | 98.8 | n/a | n/a | n/a | 0.0 | 12.2 | 98.8 | 63.2 |
| Rescriber | 0.0 | 0.0 | 9.8 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 3.0 | 0.0 | 0.6 | |
| VTR | 48.0 | 13.3 | 8.5 | 88.4 | 100 | 100 | 100 | 92.3 | 0.1 | 43.1 | 86.4 | 77.3 | |
| VTR-w/o FPE | 46.9 | 16.8 | 9.3 | 65.9 | 100 | 100 | 100 | 88.2 | 0.1 | 36.0 | 86.0 | 75.5 | |
| Collisions | Prεempt | 0 | 0 | 0 | 0 | 875 | n/a | n/a | n/a | 0 | 0 | 875 | 875 |
| Rescriber | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
| VTR | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
| VTR-w/o FPE | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |
Table 2: Transformation performance across personal-data types on 10,000 ai4privacy documents.
(1.00–1.02) but far below DP methods: (DP-Prompt), (SanText+), (DP-MLM), (CusText), and (InferDPT). Prεempt and Rescriber remain at 1.00 because the former leaves 52.3% of prompts unchanged, while the latter's predictable placeholders reduce perplexity. In contrast, VTR changes fewer words than Rescriber (9.4% vs. 10.6%) but raises perplexity because its surrogates are key-selected rather than context-predicted. PAPILLON (0.47), SEAL (0.76), and Staab et al. (0.81) fall below 1.00 by rewriting and discarding 62%, 87%, and 38% of the prompt, respectively. Thus, perplexity deviations reflect rewriting or obfuscation; VTR remains near the original while retaining 95% of the prompt.
Surrogate prompt quality. Table 2 compares VTR with VTR w/o FPE, Prεempt, and Rescriber on the same detected entities. Dates are split into DATE (1,147 ciphered dates) and DATE FALLBACK (2,405 dates, times, ages, and relative expressions), with digit-containing values vaulted. VTR protects at least 99.4% of every type except DATE FALLBACK (67.2%), similar to VTR w/o FPE (67.0%). Prεempt protects 47.5% overall, lacking mechanisms for locations, organizations, and emails. VTR round-trips 99.9% of protected entities without collisions, versus 72.9% of names for Prεempt, which reuses 875 surrogates across names. Valid surrogates reach 77.3% for VTR, versus 75.5%, 63.2%, and 0.6% for VTR w/o FPE, Prεempt, and Rescriber. FPE drives this gain: DATE validity is 88.4%, versus 65.9% without FPE and 0.3% for Prεempt. Thus, VTR achieves high type validity, 99.9% round-trip restoration, and zero collisions.
Restoration across models. Table 4 traces each value through three untrusted models. Stored-state
| Method gold entities (#) | Leaked (% values) | Retained (% words) | Value back (%) | Restored by | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| PERSON 462 | LOC 183 | ORG 65 | EMAIL 84 | SSN 33 | PHONE 67 | CARD 63 | DATE 149 | All 1,106 | |||||
| Unprotected | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 100 | 38.4 | - | |
| Preempt | 8.2 | 98.9 | 75.4 | 100 | 3.0 | 9.0 | 1.6 | 33.6 | 37.1 | 99.9 | 39.5 | key, map | |
| Rescriber | 3.0 | 4.9 | 1.5 | 0.0 | 3.0 | 9.0 | 0.0 | 0.0 | 2.8 | 98.0 | 47.0 | map | |
| HaS | 3.2 | 3.8 | 1.5 | 0.0 | 24.2 | 13.4 | 23.8 | 2.0 | 5.2 | 96.5 | 42.6 | model | |
| VTR | 3.2 | 4.9 | 1.5 | 0.0 | 3.0 | 9.0 | 0.0 | 0.0 | 2.9 | 99.1 | 38.2 | key, vault | |
| PAPILLON | 4.5 | 43.7 | 20.0 | 3.6 | 0.0 | 7.5 | 4.8 | 12.1 | 12.9 | 52.2 | 26.0 | model | |
| Staab et al. | 2.6 | 0.0 | 3.1 | 0.0 | 3.0 | 0.0 | 0.0 | 4.0 | 1.9 | 76.7 | 1.0 | not restored | |
| SEAL | 0.2 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.1 | 15.3 | 0.0 | not restored | |
| SanText+ ε=3 | 78.6 | 62.3 | 21.5 | 0.0 | 3.0 | 0.0 | 0.0 | 15.4 | 46.6 | 89.1 | 22.1 | not restored | |
| CusText ε=3 | 80.1 | 49.2 | 10.8 | 100 | 81.8 | 41.8 | 15.9 | 70.5 | 65.2 | 31.8 | 21.0 | not restored | |
| DP-MLM ε=25 | 3.9 | 2.2 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 2.0 | 9.1 | 1.1 | not restored | |
| DP-Prompt ε=53.4 | 49.8 | 48.6 | 40.0 | 32.1 | 42.4 | 29.9 | 36.5 | 42.3 | 44.5 | 44.5 | 20.6 | not restored | |
| InferDPT ε=3 | 0.4 | 0.5 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.3 | 1.8 | 57.9 | model | |
Table 3: Leaked, per personal-data type, VTR and every baseline on the same 1,000 ai4privacy documents, Llama-3.2-3B as the untrusted model.
| Method | Llama-3.2-3B | Gemma-2-2B | Phi-3.5-mini | ||||
|---|---|---|---|---|---|---|---|
| n(#) | Echoed % (#) | Restored (%) | Echoed % (#) | Restored (%) | Echoed % (#) | Restored (%) | |
| VTR | 863 | 42.2 (364) | 100 | 48.7 (420) | 100 | 79.7 (688) | 100 |
| VTR-w/o FPE | 862 | 38.5 (332) | 100 | 46.5 (401) | 100 | 75.5 (651) | 100 |
| Preempt | 442 | 34.6 (153) | 100 | 42.1 (186) | 100 | 79.4 (351) | 100 |
| Rescriber | 912 | 48.2 (440) | 100 | 43.0 (392) | 100 | 69.3 (632) | 100 |
Table 4: End-to-end restoration on ai4privacy using 500 prompts and three remote untrusted LLMs.
| Scheme | Ambiguity kept (%) | Cipher calls (#) | |
|---|---|---|---|
| ai4privacy628 dates | walk | 37.8 | 1,072 |
| rank | 54.8 | 1.7 | |
| rank-class (VTR) | 100 | 2.6 | |
| WildChat328 dates | walk | 96.9 | 1,022 |
| rank | 95.5 | 7.7 | |
| rank-class (VTR) | 100 | 1.4 | |
| ShareGPT879 dates | walk | 86.8 | 1,060 |
| rank | 92.8 | 42.1 | |
| rank-class (VTR) | 100 | 1.8 |
Table 5: Date encipherment schemes under FF1. The corpora contain 628, 328, and 879 dates, respectively.
methods restore all echoed surrogates correctly (100.0%), making recovery dependent on Echoed: VTR recovers 42.2%, 48.7%, and 79.7% on Llama, Gemma, and Phi, respectively. Its Echoed rate varies 1.9× across models, versus at most 1.4× for competitors, indicating that recovery is primarily limited by the model's tendency to repeat values. Local-regeneration results appear in Appendix A.3, with additional value-recovery results in Appendix A.1, Tables 3 and 7.
5.3 Ablation Study
Choice of Date scheme. Table 5 compares VTR's rank-class scheme with walk and rank. Rank-class preserves 100.0% of ambiguity across all corpora, vs. 37.8–96.9% for walk and 54.8–95.5% for rank.
| Scheme | Temporal consistency (%) | Date concealment | |||
|---|---|---|---|---|---|
| Order | Tense | Computed date | Shifted (days) | Unshifted (#) | |
| Unprotected | 100 | 73.2 | 100 | 0 | 97 |
| Encipherment | 53.6 | 24.7 | 0.0 | 11,242 | 0 |
| Translation | |||||
| SHIFT | 100 | 5.2 | 97.9 | 2,224 | 0 |
| SHIFT-CAPPED | 97.9 | 75.3 | 94.8 | 34 | 11 |
| SHIFT-TODAY | 100 | 77.3 | 97.9 | 2,224 | 0 |
Table 6: End-to-end date translation on 97 ShareGPT files (two dates) using Llama-3.2-3B (remote LLM).
It also requires 1.4–2.6 cipher calls per date, 410–730× fewer than walk; rank require 23× more calls on ShareGPT. Thus, rank-class preserves date format and ambiguity with 2 cipher calls per date. VTR vs. alternatives: Date translation. Table 6 evaluates date translation on 97 ShareGPT documents. Encipherment shifts dates by 11,242 days, yielding only 53.6% Order, 24.7% Tense, and 0.0% Computed date. SHIFT restores Order and Computed date (100.0%, 97.9%) but reduces Tense to 5.2%. SHIFT-CAPPED raises Tense to 75.3%, while SHIFT-TODAY matches the unprotected prompt (100.0%, 77.3%, 97.9%). Thus, shifting the stated present preserves temporal relations without sacrificing concealment. Additional NER detector results are in Section B.2.
6 Conclusion
We presented VTR, a user-side PII pseudo-anonymization framework for zero-trust LLM interaction. Combining FPE and keyed semantic surrogates with local restoration, VTR protects plaintext PII while preserving linguistic cues. Across three datasets with 11,322 PII instances, VTR achieves 97.9% detection recall, 95.2% protection, and 100% restoration of echoed surrogates.
Limitations
VTR has some limitations. First, its protection depends on PII detection recall: although our detector achieves high recall, implicit, ambiguous, and domain-specific PII may require additional detection mechanisms. Second, VTR relies on the remote LLM preserving surrogate values in its response; values that are omitted, modified, or paraphrased cannot be restored exactly. Third, semantic surrogates preserve entity type and linguistic form but may not preserve every fine-grained contextual relationship, which can affect task-specific applications. Finally, our evaluation focuses on text-based LLM interaction and does not cover multimodal inputs, tool calls, or long-term conversational state, where additional privacy and restoration considerations may arise.
References
Marah Abdin, Jyoti Aneja, et al. 2024. Phi-3 technical report: A highly capable language model locally on your phone. Preprint, arXiv:2404.14219.
Divyansh Agarwal, Alexander R Fabbri, Ben Risher, Philippe Laban, Shafiq Joty, and Chien-Sheng Wu. 2024. Prompt leakage effect and defense strategies for multi-turn llm interactions. arXiv preprint arXiv:2404.16251.
Ai4Privacy. 2023. PII-Masking-200k: A Dataset for Removing Personally Identifiable Information from Text. https://huggingface.co/datasets/ai4privacy/pii-masking-200k. Accessed: 2026-07-08.
anon8231489123. 2023. ShareGPT Vicuna Unfiltered Dataset. Hugging Face. Accessed: July 8, 2026.
Shubhi Asthana, Ruchi Mahindru, Bing Zhang, and Jorge Sanz. 2025. Adaptive pii mitigation framework for large language models. arXiv preprint arXiv:2501.12465.
Mihir Bellare, Phillip Rogaway, and Terence Spies. 2010. The ffx mode of operation for format-preserving encryption. NIST submission, 20(19):1–18.
John Black and Phillip Rogaway. 2002. Ciphers with arbitrary finite domains. In Cryptographers' track at the RSA conference, pages 114–130. Springer.
Antoine Boutet, Lucas Magnana, and Juliette Sénéchal. 2025. Towards the anonymization of the language modeling. arXiv preprint arXiv:2501.02407.
Sai Chen, Fengran Mo, Yanhao Wang, Cen Chen, Jian-Yun Nie, Chengyu Wang, and Jamie Cui. 2023a. A
customized text sanitization mechanism with differential privacy. In Findings of the Association for Computational Linguistics: ACL 2023, pages 5747–5758.
Yu Chen, Tingxin Li, Huiming Liu, and Yang Yu. 2023b. Hide and seek (has): A lightweight framework for prompt privacy protection. arXiv preprint arXiv:2309.03057.
Shuai Cheng, Haitao Xu, Shu Meng, Shuai Hao, Chuan Yue, and Zhao Li. 2026. The privacy paradox of llms: User perceptions and the reality of pii leakage. In Proceedings of the 2026 CHI Conference on Human Factors in Computing Systems, pages 1–25.
Amrita Roy Chowdhury, David Glukhov, Divyam Anshumaan, Prasad Chalasani, Nicolas Papernot, Somesh Jha, and Mihir Bellare. 2025. Preempt: Sanitizing sensitive prompts for LLMs. arXiv preprint arXiv:2504.05147.
Badhan Chandra Das, M Hadi Amini, and Yanzhao Wu. 2025. Security and privacy challenges of large language models: A survey. ACM Computing Surveys, 57(6):1–39.
Morris Dworkin. 2001. Recommendation for block cipher modes of operation. NIST special publication, 800:38B.
Laura Evans, Jack W London, and Matvey B Palchuk. 2023. The detection of date shifting in real-world data. Applied Clinical Informatics, 14(04):763–771.
Daniele Faraglia and contributors. 2026. Faker: A python package that generates fake data. https://github.com/joke2k/faker. Accessed: June 8, 2026.
Xin Gao, Ruiyi Zhang, Daniel Du, Saurabh Mahindra, Sai Ashish Somayajula, and Pengtao Xie. 2025. Can prompts rewind time for llms? evaluating the effectiveness of prompted knowledge cutoffs. In Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing, pages 20788–20799.
In Gim, Caihua Li, and Lin Zhong. 2024. Confidential prompting: Protecting user prompts from cloud llm providers. arXiv e-prints, pages arXiv–2409.
Aaron Grattafori, Abhimanyu Dubey, et al. 2024. The llama 3 herd of models. Preprint, arXiv:2407.21783.
Max Holschneider and Saetbyeol LeeYouk. 2026. Pii shield: A browser-level overlay for user-controlled personal identifiable information (pii) management in ai interactions. arXiv preprint arXiv:2603.24895.
Kyuyoung Kim, Hyunjun Jeon, and Jinwoo Shin. 2026. Self-refining language model anonymizers via adversarial distillation. Advances in Neural Information Processing Systems, 38:165629–165659.
Hugo Krawczyk and Pasi Eronen. 2010. Hmac-based extract-and-expand key derivation function (hkdf). Technical report.
Bo Ma, Jinsong Wu, and Weiqi Yan. 2026. Bodhipromptshield: Pre-inference prompt mediation for suppressing privacy propagation in llm/vlm agents. arXiv preprint arXiv:2604.05793.
Stephen Meisenbacher, Maulik Chevli, Juraj Vladika, and Florian Matthes. 2024. Dp-mlm: Differentially private text rewriting using masked language models. In Findings of the Association for Computational Linguistics: ACL 2024, pages 9314–9328.
Niloofar Mireshghallah and Tianshi Li. 2025. Position: Privacy is not just memorization! arXiv preprint arXiv:2510.01645.
OpenAI. 2023. March 20 chatgpt outage: Here’s what happened. [Online]. Accessed: Jul. 8, 2026.
Harshit Rajgarhia, Suryam Gupta, Asif Shaik, Gulipalli Praveen Kumar, Y Santhoshraj, Sanka Nithya Tanvy Nishitha, and Abhishek Mukherji. 2025. An evaluation study of hybrid methods for multilingual pii detection. arXiv preprint arXiv:2510.07551.
Maksim Savkin, Timur Ionov, and Vasily Konovalov. 2025. Spy: Enhancing privacy with synthetic pii detection dataset. In Proceedings of the 2025 Conference of the Nations of the Americas Chapter of the Association for Computational Linguistics: Human Language Technologies (Volume 4: Student Research Workshop), pages 236–246.
Mohamed Shaaban and Mohamed Elmahallawy. 2026. Securegate: Learning when to reveal pii safely via token-gated dual-adapters for federated llms. In Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 42593–42610.
Li Siyan, Vethavikashini Chithrra Raghuram, Omar Khattab, Julia Hirschberg, and Zhou Yu. 2025. Papillon: Privacy preservation from internet-based and local language model ensembles. In Proceedings of the 2025 Conference of the Nations of the Americas Chapter of the Association for Computational Linguistics: Human Language Technologies (Volume 1: Long Papers), pages 3371–3390.
Robin Staab, Mark Vero, Mislav Balunović, and Martin Vechev. Large language models are advanced anonymizers (2025). URL https://arxiv.org/abs/2402.13846.
Gemma Team, Thomas Mesnard, Cassidy Hardin, Robert Dadashi, Surya Bhupatiraju, Shreya Pathak, Laurent Sifre, Morgane Rivière, Mihir Sanjay Kale, Juliette Love, et al. 2024. Gemma: Open models based on gemini research and technology. arXiv preprint arXiv:2403.08295.
Meng Tong, Kejiang Chen, Jie Zhang, Yuang Qi, Weiming Zhang, Nenghai Yu, Tianwei Zhang, and Zhikun Zhang. 2025. Inferdpt: Privacy-preserving inference for closed-box large language models. IEEE Transactions on Dependable and Secure Computing, 22(5):4625–4640.
Saiteja Utpala, Sara Hooker, and Pin-Yu Chen. 2023. Locally differentially private document generation using zero shot prompting. In Findings of the Association for Computational Linguistics: EMNLP 2023, pages 8442–8457.
Xiang Yue, Minxin Du, Tianhao Wang, Yaliang Li, Huan Sun, and Sherman SM Chow. 2021. Differential privacy for text analytics via natural text sanitization. In Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021, pages 3853–3866.
Ziqian Zeng, Jianwei Wang, Junyao Yang, Zhengdong Lu, Haoran Li, Huiping Zhuang, and Cen Chen. 2025. Privacyrestore: Privacy-preserving inference in large language models via privacy removal and restoration. In Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 10821–10855.
Wenting Zhao, Xiang Ren, Jack Hessel, Claire Cardie, Yejin Choi, and Yuntian Deng. 2024. Wildchat: 1m chatgpt interaction logs in the wild. In International Conference on Learning Representations, volume 2024, pages 34590–34605.
Jijie Zhou, Eryue Xu, Yaoyao Wu, and Tianshi Li. 2025. Rescriber: Smaller-llm-powered user-led data minimization for llm-based chatbots. In Proceedings of the 2025 CHI Conference on Human Factors in Computing Systems, pages 1–28.
Appendix
A Additional Results
A.1 Value recovery: VTR vs. baselines
Table 7 shows the values returned to the user. VTR recovers 38.2% of values, matching the unprotected prompt (38.4%) despite leaking no values; Prεεmpt and Rescriber recover 39.5% and 47.0%, respectively, as models more often echo their placeholders (Table 4). InferDPT (57.9%) and HaS (42.6%) exceed the unprotected prompt because their local models access the original prompt, while PAPILLON recovers 30.5%. SanText+, CusText, and DP-Prompt recover only values leaked in the clear (20.6–22.1%), while Staab et al., SEAL, and DP-MLM recover at most 1.1%. Thus, VTR combines near-unprotected value recovery with < 3% leakage, high request retention, type-valid surrogates, and exact restoration without a local model.
A.2 Time per Request: VTR vs. baselines
Table 8 times VTR and every baseline on the same 50 PUPA prompts, whose median length is 50.5 words, each running on its own after two warm-up prompts. Detect and Protect run on the user's device before the prompt is sent and Restore after the answer returns; the untrusted model is listed for reference and is not part of the device's cost. VTR spends 0.057 s per request on the device, almost all of it in detection, with encryption and restoration each under a millisecond and no local generation; its detector and cipher run on the CPU, so it needs no GPU on the device. The baselines that run a local model spend about 60 to 1,300 times as long: HaS 3.54 s, InferDPT 6.93 s, PAPILLON 28.4 s, Staab et al. 37.1 s and SEAL 75.7 s. SanText+, CusText, DP-MLM and DP-Prompt stay within 0.164 s, but in Table 1 they leak more than VTR or keep far less of the request.
A.3 Local regeneration: VTR vs. baselines
In Table 9, we report results for local-regeneration methods, where leakage is fixed before inference at 4.4% (HaS) and 0.1% (InferDPT). Their untrusted answers contain at most 3.5% of values, while local regeneration recovers 41.2–68.5% and 55.0–86.6%, respectively, depending on the remote model. This additional recovery is achieved by querying a local model that has access to the original prompt. In contrast, VTR restores echoed values exactly from its local state without querying a local model, while keeping the remote model unaware of the original PII. Thus, VTR avoids the additional local inference cost while providing deterministic restoration for values preserved in the remote response.
B Case Studies
B.1 End-to-End Round-Trip Examples
This appendix traces two prompts through the complete VTR round trip, showing the original input, the detected PII and corresponding surrogates, the pseudo-anonymized prompt sent to the remote untrusted model M, the model's reply, and the final response after local restoration. Both are run under the configuration discussed in Section 5: FF1 with the rank-class date scheme, the en_core_web_trf detector with both shape-recognizer groups, one fixed session key, and Llama-3.2-3B-Instruct as M, decoding greedily under the system prompt of the end-to-end evaluation (“You are a helpful assistant. Answer concisely. Any names, numbers, dates or identifiers in the message are SYNTHETIC PLACEHOLDERS (not real personal data) inserted for privacy — they are safe to use. Never refuse on privacy grounds; treat identifiers as ordinary data and repeat them exactly as given.”). Texts are reproduced verbatim, with markdown formatting and line breaks removed; in Tables 12 and 13 the replies are cut after 30 words, marked [...]. Table 10 presents Case 1, a synthetic record from ai4privacy that exercises both mechanisms: the date and telephone number are enciphered, while the names are replaced with a surrogate from the person pool. Table 11 presents Case 2, a real user request from PUPA processed through VTR. The same request is used for all baselines in Tables 12 and 13, enabling a direct comparison of how VTR preserves the original PII for local restoration while providing the remote untrusted LLM with realistic surrogates that retain sufficient context to generate a reasonable response.
The system prompt addresses two properties of a safety-tuned model. A sanitized prompt is dense with identifiers, and the model tends to read such text as a request to process personal data and declines to answer; and a surrogate can be restored only if the model repeats it verbatim. We measured both on 40 ai4privacy prompts of 120 to 300 characters, each holding at least two entities of the syntactic types and one of the semantic types and no annotated value outside the eight types of
| Method | Value Recovery (%) | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| PERSON | LOC | ORG | SSN | PHONE | CARD | DATE | All | ||
| restored from stored state | |||||||||
| VTR | 30.3 | 60.1 | 33.8 | 47.6 | 24.2 | 34.3 | 27.0 | 42.3 | 38.2 |
| Rescriber | 39.4 | 66.7 | 55.4 | 60.7 | 18.2 | 46.3 | 14.3 | 55.7 | 47.0 |
| Preempt | 33.8 | 62.8 | 35.4 | 35.7 | 15.2 | 46.3 | 22.2 | 42.3 | 39.5 |
| regenerated by a local model from the original prompt | |||||||||
| InferDPT | 66.9 | 67.8 | 55.4 | 50.0 | 27.3 | 53.7 | 30.2 | 43.6 | 57.9 |
| HaS | 32.7 | 51.9 | 47.7 | 53.6 | 51.5 | 56.7 | 50.8 | 41.6 | 42.6 |
| PAPILLON | 26.4 | 53.0 | 29.2 | 27.4 | 6.1 | 35.8 | 17.5 | 26.2 | 30.5 |
| leaked across and echoed | |||||||||
| Unprotected | 29.4 | 63.9 | 35.4 | 36.9 | 15.2 | 44.8 | 25.4 | 45.0 | 38.4 |
| CusText | 22.5 | 26.2 | 4.6 | 29.8 | 12.1 | 17.9 | 0.0 | 24.2 | 21.0 |
| DP-Prompt | 20.1 | 36.6 | 16.9 | 11.9 | 9.1 | 11.9 | 7.9 | 20.8 | 20.6 |
| SanText+ | 28.6 | 48.1 | 13.8 | 0.0 | 0.0 | 0.0 | 0.0 | 10.1 | 22.1 |
| nothing crosses, nothing returns | |||||||||
| Staab et al. | 0.9 | 0.0 | 1.5 | 0.0 | 0.0 | 0.0 | 0.0 | 4.0 | 1.0 |
| DP-MLM | 1.7 | 2.2 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 1.1 |
| SEAL | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
Table 7: Value recovery by personal-data type for VTR and baselines on the same 1,000 ai4privacy documents using Llama-3.2-3B as the remote LLM.
| Category | Method | Before sending | Untrusted model (s) | After Restore (s) | On device median (mean) (s) | Local generations (#) | |
|---|---|---|---|---|---|---|---|
| Detect (s) | Protect (s) | ||||||
| Unprotected | - | - | 4.43 | - | 0 | 0 | |
| Entity Substitute | Preempt | 0.058 | <0.001 | 3.33 | <0.001 | 0.059 (0.130) | 0 |
| Rescriber, our detector | 0.053 | <0.001 | 3.13 | <0.001 | 0.053 (0.122) | 0 | |
| Rescriber, own detector | 0.114 | <0.001 | 1.59 | <0.001 | 0.114 (0.385) | 1.1 | |
| HaS | 0.057 | 1.000 | 3.10 | 1.77 | 3.54 (5.78) | 1.9 | |
| VTR | 0.057 | <0.001 | 3.40 | <0.001 | 0.057 (0.125) | 0 | |
| Local rewrite | PAPILLON | - | 17.7 | 4.85 | 17.8 | 28.4 (27.8) | 2.0 |
| Staab et al. | - | 37.1 | 0.726 | - | 37.1 (39.3) | 6.0 | |
| SEAL | - | 75.7 | 0.974 | - | 75.7 (79.6) | 6.0 | |
| DP-based | SanText+ | - | 0.039 | 2.27 | - | 0.039 (0.069) | 0 |
| CusText | - | 0.001 | 2.62 | - | 0.001 (0.002) | 0 | |
| DP-MLM | - | 0.053 | 2.31 | - | 0.053 (0.248) | 0 | |
| DP-Prompt | - | 0.164 | 1.72 | - | 0.164 (0.545) | 0 | |
| InferDPT | - | 0.003 | 2.37 | 6.92 | 6.93 (5.97) | 1.0 | |
Table 8: Time per request on 50 PUPA prompts, median over the prompts.
| Method | Llama-3.2-3B | Gemma-2-2B | Phi-3.5-mini | |||||
|---|---|---|---|---|---|---|---|---|
| n (#) | Leaked % (#) | Untrusted % (#) | Local % (#) | Untrusted % (#) | Local % (#) | Untrusted % (#) | Local % (#) | |
| HaS | 912 | 4.4 (40) | 1.0 (9) | 41.2 (376) | 2.2 (20) | 45.8 (418) | 3.5 (32) | 68.5 (625) |
| InferDPT | 912 | 0.1 (1) | 0.1 (1) | 55.0 (502) | 0.2 (2) | 73.2 (668) | 0.2 (2) | 86.6 (790) |
Table 9: End-to-end restoration through local-model regeneration on the ai4privacy dataset using 500 prompts and three untrusted models. “Leaked” denotes the percentage of prompts exposing PII to the untrusted model, while “Untrusted” and “Local” denote restoration from the untrusted and locally regenerated answers, respectively.
Section 4.1. Under the plain instruction You are a helpful assistant, the model refuses 22/40 sanitized prompts and repeats 31/137 of their surro- gates; under the system prompt above, the refusals fall to 16/40 and the repeated surrogates rise to 52/137. The unprotected prompts, which carry
Case 1: A synthetic record with a date and telephone number (syntactic and semantic mechanisms)
| Input | Reminder for Richmond Bowie Deckow: Your primary check-up is due by 01/05/1994. Kindly contact us on 079 229 1265 to schedule an appointment. |
|---|---|
| Entities and surrogates | PERSON Richmond Bowie Deckow → Samantha Leonard (semantic); DATE 01/05/1994 → 08/10/1962 (syntactic); PHONE 079 229 1265 → 826 334 6183 (syntactic) |
| Sent to M | Reminder for Samantha Leonard: Your primary check-up is due by 08/10/1962. Kindly contact us on 826 334 6183 to schedule an appointment. |
| Reply of M | I've noted the reminder for Samantha Leonard's primary check-up, scheduled for 08/10/1962. I will make a note to contact her on 826 334 6183 to schedule an appointment. |
| Restored answer | I've noted the reminder for Richmond Bowie Deckow's primary check-up, scheduled for 01/05/1994. I will make a note to contact her on 079 229 1265 to schedule an appointment. |
Table 10: Case 1 (ai4privacy, row 8426). Real values are shown in red and surrogates in blue. The model echoes all three surrogates, which are restored exactly; the date preserves its ambiguity and the phone number its grouping. The date 01/05/1994 admits a day-first and a month-first reading, and its surrogate 08/10/1962 admits both as well (Eq. (6)); the telephone number keeps its grouping (Eq. (3)); the name is drawn from the person pool. The model echoes all three surrogates, and each is restored exactly. The given name Richmond is in neither gendered list, so the bucket falls back to a keyed choice and yields a female surrogate; the pronoun her that the model chose for it survives restoration.
Case 2: A real user request through VTR (same request used for all baselines in Tables 12 and 13)
| Input | From the list of following programs: BIDA from CMU, Machine Learning from Columbia University, Data Science from JHU, AI from JHU, and MBA from JHU, which are the best compliment programs if I want to study for 2 Masters programs and to become a technical leader at the Boeing Company? |
|---|---|
| Entities and surrogates | ORGANIZATION CMU → Dawson-Hale; ORGANIZATION Columbia University → Franklin, Hooper and Nunez; ORGANIZATION JHU → Rivera, Thomas and Arroyo (3 occurrences, one surrogate); ORGANIZATION the Boeing Company → Lopez-Melton. |
| Sent to M | From the list of following programs: BIDA from Dawson-Hale, Machine Learning from Franklin, Hooper and Nunez, Data Science from Rivera, Thomas and Arroyo, AI from Rivera, Thomas and Arroyo, and MBA from Rivera, Thomas and Arroyo, which are the best compliment programs if I want to study for 2 Masters programs and to become a technical leader at Lopez-Melton? |
| Reply of M | To become a technical leader at Lopez-Melton, I recommend combining programs that complement each other in terms of skills and knowledge. Considering your goal, I suggest pairing BIDA from Dawson-Hale with Machine Learning from Franklin, Hooper and Nunez. BIDA (Business Intelligence and Data Analysis) will provide a solid foundation in business acumen, data analysis, and decision-making, which are essential for a technical leader role. Machine Learning from Franklin, Hooper and Nunez will equip you with advanced technical skills in machine learning, data science, and artificial intelligence, which are highly valued in the industry. This combination will give you a well-rounded skillset, allowing you to effectively lead technical teams and make data-driven decisions at Lopez-Melton. |
| Restored answer | To become a technical leader at the Boeing Company, I recommend combining programs that complement each other in terms of skills and knowledge. Considering your goal, I suggest pairing BIDA from CMU with Machine Learning from Columbia University. BIDA (Business Intelligence and Data Analysis) will provide a solid foundation in business acumen, data analysis, and decision-making, which are essential for a technical leader role. Machine Learning from Columbia University will equip you with advanced technical skills in machine learning, data science, and artificial intelligence, which are highly valued in the industry. This combination will give you a well-rounded skillset, allowing you to effectively lead technical teams and make data-driven decisions at the Boeing Company. |
Table 11: Case 2 (PUPA, row 158) through VTR. Four organizations are replaced by semantic surrogates; repeated JHU occurrences share one surrogate. The reply echoes three surrogates, which are restored exactly.
the real values, show that the effect is specific to sanitized text: under the plain instruction they are refused 19/40 times and 40/137 of their values are repeated, so sanitization alone makes the model less cooperative, whereas under the system prompt they are refused 18/40 times with 49/137 values repeated, level with the sanitized prompts. The system prompt therefore removes a penalty that
| Method | Sent to M | Leaked in sent | Reply of M (first 30 words) | Returned to the user (first 30 words) |
|---|---|---|---|---|
| Unprotected Unprotected prompt | From the list of following programs: BIDA from CMU, Machine Learning from Columbia University, Data Science from JHU, AI from JHU, and MBA from JHU, which are the best compliment programs if I want to study for 2 Masters programs and to become a technical leader at the Boeing Company? | 4/4 | To become a technical leader at Boeing, you'll want to focus on programs that complement each other in terms of technical skills and industry relevance. Considering the options, I recommend [...] | the reply, unchanged |
| Per-entity substitution | ||||
| VTR | From the list of following programs: BIDA from Dawson-Hale, Machine Learning from Franklin, Hooper and Nunez, Data Science from Rivera, Thomas and Arroyo, AI from Rivera, Thomas and Arroyo, and MBA from Rivera, Thomas and Arroyo, which are the best compliment programs if I want to study for 2 Masters programs and to become a technical leader at Lopez-Melton? | 0/4 | To become a technical leader at Lopez-Melton, I recommend combining programs that complement each other in terms of skills and knowledge. Considering your goal, I suggest pairing BIDA from Dawson-Hale [...] | To become a technical leader at the Boeing Company, I recommend combining programs that complement each other in terms of skills and knowledge. Considering your goal, I suggest pairing BIDA [...] |
| Preempt | From the list of following programs: BIDA from CMU, Machine Learning from Columbia University, Data Science from JHU, AI from JHU, and MBA from JHU, which are the best compliment programs if I want to study for 2 Masters programs and to become a technical leader at the Boeing Company? | 4/4 | To become a technical leader at Boeing, you'll want to focus on programs that complement each other in terms of technical skills and industry relevance. Considering the options, I recommend [...] | To become a technical leader at Boeing, you'll want to focus on programs that complement each other in terms of technical skills and industry relevance. Considering the options, I recommend [...] |
| Rescriber | From the list of following programs: BIDA from [AFFILIATION1], Machine Learning from [AFFILIATION2], Data Science from [AFFILIATION3], AI from [AFFILIATION3], and MBA from [AFFILIATION3], which are the best compliment programs if I want to study for 2 Masters programs and to become a technical leader at [AFFILIATION4]? | 0/4 | To become a technical leader at [AFFILIATION4], I would recommend combining BIDA from [AFFILIATION1] with either Machine Learning from [AFFILIATION2] or Data Science from [AFFILIATION3]. Both Machine Learning and Data [...] | To become a technical leader at the Boeing Company, I would recommend combining BIDA from CMU with either Machine Learning from Columbia University or Data Science from JHU. Both Machine [...] |
| HaS | From the list of following programs: IBM from Harvard, Machine Learning from Stanford University, Data Science from MIT, AI from MIT, and MBA from MIT, which are the best compliment programs if I want to study for 2 Masters programs and to become a technical leader at the SpaceX Company? | 0/4 | To become a technical leader at SpaceX, you'll want to focus on programs that combine technical skills with business acumen. Based on your options, I recommend the following combinations: 1. [...] | 为了成为波音公司的技术领导者,我建议学习以下两门课程: |
Table 12: Case 2 through the control and the per-entity substitution methods. Sent to M: the text that crossed the trust boundary, verbatim. Leaked in sent: gold units of the row that survive verbatim in that text, the only text M receives; a partial mention, such as Boeing for the unit the Boeing Company, is shown in red but not counted. Reply of M: what the untrusted model returned. Returned to the user: the answer after the method puts values back on the device, from the session key and vault for VTR, from its pools and mapping for Preempt, from its dictionary for Rescriber, and by its local seek model for HaS. Real values in this last column were restored after the reply and never crossed the boundary. Real organization names in red, VTR's surrogates in blue. HaS's released seek model was trained on a translation task: from the reply it writes a single Chinese sentence, To become a technical leader at Boeing, I recommend studying the following two courses, and the recommendations that follow in the reply are lost.
sanitization would otherwise impose rather than giving the sanitized prompt an advantage over the original. It is applied identically to every method and to the unprotected control. The refusals that remain, between 16/40 and 19/40 under either input, stem from the content of the requests themselves.
B.2 Detector Choice
Table 14 shows that shape recognizers improve numeric and date Recall, reaching 95.6% on SSN, PHONE, and CARD with trf, while semantic Recall depends on the spaCy model (84.4%–97.9%). Together, they reduce Missed by 31%, 64%, and 79% for sm, lg, and trf, respectively. The VTR configuration reaches 97.9% Recall, missing only 240 of 11,322 entities, versus 1,941 for Rescriber and 2,677 for HaS. Thus, detector choice changes Missed by and largely determines how much PII remains exposed.
C Analysis of Date Translation
This appendix provides additional details on the translation mechanism introduced in Section 4.2.1, including the motivating failure (Appendix C.1), parameter settings (Appendix C.2), admissible-offset construction (Appendix C.3), the offsets used in the worked example (Appendix C.4), and behavior at range boundaries and for model-computed dates (Appendix C.5).
| Method | Sent to | Leaked in sent | Reply of (first 30 words) | Returned to the user (first 30 words) |
|---|---|---|---|---|
| Local rewriting PAPILLON | I am interested in studying for two Master's programs and becoming a technical leader at Boeing. Can you recommend the best complement programs from the list of provided options? | 0/4 | To become a technical leader at Boeing, it's essential to have a strong foundation in engineering and business. Based on the provided options, here are some complementary Master's program recommendations: [...] | To become a technical leader at Boeing, consider combining Master's programs in Aerospace Engineering, Business Administration, Systems Engineering, Engineering Management, or Supply Chain Management. Research each program thoroughly to find [...] |
| Staab et al. | From the list of following programs: a technical program from a top university, a Machine Learning program from a prestigious university, a Data Science program from a well-known university, an AI program from a reputable university, and an MBA program from a respected university, which are the best compliment programs if I want to study for 2 Masters programs and to become a technical leader at a major aerospace company? | 0/4 | Based on the requirements, I would recommend the following combinations: 1. Technical Program + AI Program: Technical Program (e.g., from Stanford University) for a strong foundation in engineering and technical [...] | the reply, unchanged |
| SEAL | From a selection of options at different organizations, which are the best combinations for someone looking to take on a leadership position in a large group? | 0/4 | Based on various studies and research, here are some of the best combinations for someone looking to take on a leadership position in a large group: 1. Bachelor's degree in [...] | the reply, unchanged |
| Differential privacy | ||||
| SanText+ () | From the lists of following programs: glint from CMU Int Machine Systems from Columbia University Suicide EMAIL Science from JHU, AI from JHU insufficiently and MBA from JHU, specifically are the Best compliment vital if I want to study for 2 Masters programs and to become a technical leader AT the Boeing Company evident | 4/4 | To become a technical leader at Boeing, you'll want to focus on programs that complement each other and provide a strong foundation in technical leadership, business acumen, and industry-specific knowledge. [...] | the reply, unchanged |
| CusText () | am part meaning ONE Following programs: BIDA written CMU, machine Learning Made San University, data biology When JHU, dis Written JHU, AND TESOL according JHU, recently were ONE Best melody Programme give isn't Can Can study In 9 specialization program All let become another SKILLS Leadership Time the Sachs Company? | 2/4 | It seems like you're trying to ask about a program or course that you're interested in. You're referring to the following programs: 1. BIDA (Business Intelligence and Data Analytics) from [...] | the reply, unchanged |
| DP-MLM () | From the options of receiving scenarios: Dna from Nan, Computer Johnson from Ivan University, Market Scientist from Pegasus, Als from Se, and 2007 from Employment, which are the largest available periods if I are to interpret for 2 Md studies and to becoming a formal career at the Shuttle Factory? | 0/4 | To determine the largest available periods, I'll assume you're referring to the number of months. Dna from Nan: 12 months Computer Johnson from Ivan University: 4 years (48 months) Market [...] | the reply, unchanged |
| DP-Prompt () | If you want to continue your education and aim to become a technical leader at the Boeing Company, which program should you choose? | 1/4 | To become a technical leader at Boeing, I would recommend pursuing a Master's degree in a field such as: 1. Aerospace Engineering 2. Systems Engineering 3. Management Science and Engineering [...] | the reply, unchanged |
| InferDPT () | peri neither LOT fin assuming Excellent Plate spray discretion Resolver Pattern dynamics marijuana DA interpret is tune person not excitement invisible laundry conditional a talk dal fade Over 655 LAND tot Being puzzle motion boy LINK Han Committee | 0/4 | It appears to be a jumbled collection of words. I'll try to break it down and provide a possible interpretation: "peri" might be related to "peril" or "period" "LOT fin" [...] | Assuming a lotus pattern, I need to exercise discretion as a resolver in a dynamic system, but I'm not excited about the situation, and I'm dealing with invisible laundry that's [...] |
Table 13: Case 2 through the local-rewriting and differential-privacy methods, with the columns of Table 12. PAPILLON and InferDPT write the answer returned to the user with a local model, from the original request and the reply of ; the other methods return the reply unchanged.
C.1 Failure of Independent Date Encipherment
A ShareGPT prompt describes an article written on 12 August 2014 and updated on 6 January 2017, 878 days later. When the two dates are enciphered independently under the same session key using Eq. (5), they become 30 December 1981 and 4 March 1909: their separation increases to 26,599 days and their chronological order is reversed. The resulting prompt therefore states that the article was updated seventy-two years before it was written. This failure arises because per-date encipherment preserves the format of each value but not the temporal relationships between values. Our translation mechanism instead applies a common document-level offset, allowing relative temporal
| Detector | Recall (%) | MISSED(#) | ||||
|---|---|---|---|---|---|---|
| NUM. | DATE | SEM. | All | |||
| No shape recognizers | sm | 77.0 | 84.9 | 84.4 | 83.4 | 1,875 |
| md | 79.0 | 85.9 | 88.3 | 86.6 | 1,516 | |
| lg | 56.0 | 86.4 | 94.6 | 87.9 | 1,369 | |
| trf | 42.9 | 98.1 | 97.9 | 90.0 | 1,131 | |
| Both shape groups | sm | 97.9 | 99.9 | 84.4 | 88.5 | 1,301 |
| md | 97.6 | 99.9 | 88.3 | 91.2 | 994 | |
| lg | 97.2 | 99.8 | 94.6 | 95.7 | 489 | |
| trf (VTR) | 95.6 | 99.9 | 97.9 | 97.9 | 240 | |
| Specific Detector | Rescriber | 95.7 | 85.2 | 79.8 | 82.9 | 1,941 |
| HaS | 2.8 | 96.4 | 87.3 | 76.4 | 2,677 | |
Table 14: Detection on ai4privacy using 10,000 documents with 11,322 annotated entities. NUM. denotes the combined SSN, PHONE, and CARD types.
structure to be preserved while displacing the original dates.
C.2 Parameters
Translation operates over the calendar days from 1900-01-01 to 2099-12-31 and uses two parameters.
Bound S. S bounds the absolute displacement and controls the trade-off between concealment and temporal plausibility. Larger values provide greater displacement from the original date, whereas smaller values keep translated dates closer to their original positions. We use S = 4000 days, approximately eleven years, yielding candidate offsets in .
Guard g. g specifies the minimum distance between an offset and the nearest whole-year displacement. It prevents a translation from remaining too close to the original date's position within the calendar year. We use g = 15 days, requiring an accepted offset to differ by at least fifteen days from any whole-year displacement.
Pseudorandom function. in Eq. (6) is HMAC-SHA256 truncated to 64 bits. Reducing its output modulo introduces a bias below per candidate, which we neglect.
C.3 Admissible Offsets
The admissible set in Eq. (6) is
where and denotes the distance from to the nearest multiple of . The first condition excludes offsets that preserve the weekday, including , while the second excludes offsets that remain close to a whole-year displacement. These constraints remove two forms of calendar structure that can reveal systematic date shifts (Evans et al., 2023). We illustrate them using the visit date 2026-07-30, a Thursday and the 211th day of the year.
Weekday. An offset divisible by 7 preserves the weekday of every date. For example, adding 7 days maps 2026-07-30 to 2026-08-06, while adding 3500 days maps it to 2036-02-28; both dates are Thursdays. Because events such as clinical visits are not uniformly distributed across weekdays, preserving the weekday distribution can expose the underlying shift. Excluding multiples of 7 therefore removes this structure and reduces the candidate space by approximately a factor of seven.
Season. An offset close to a whole number of years preserves a date's approximate position within the year and can therefore retain seasonal patterns. For example, adding 365 days maps 2026-07-30 to 2027-07-30, while adding 730 days maps it to 2028-07-29; both correspond to day 211 of their respective years. Adding 380 days yields 2027-08-14, which is within 15 days of a whole-year displacement, whereas 381 days exceeds the guard. Excluding such offsets disrupts seasonal signatures, such as the concentration of respiratory visits during winter.
Acceptance rate. Among integer offsets, one in seven is divisible by 7, so the weekday constraint retains a fraction 6/7 of candidates. Over any Y-day interval, approximately 2g offsets lie within g days of a whole-year displacement, so the season constraint retains a fraction . Approximating the two constraints as independent gives . Exhaustive enumeration of all 8001 offsets in gives 6858 offsets passing the weekday constraint, 7376 passing the season constraint, and 6322 satisfying both, for an empirical acceptance rate of 0.790. Thus, the first accepted draw has index for approximately 79% of documents, with expected draw index .
C.4 Offsets of the Worked Example
For the document of Table 15 the candidate interval is .
SHIFT and SHIFT-TODAY. The first draw gives , hence , nine years and 41 days. It is neither a multiple of 7 nor within g of a whole
| SHIFT | SHIFT-CAPPED | SHIFT-TODAY | |
|---|---|---|---|
| offset (days) | -3,328 | -27 | -3,328 |
| birth 1958-04-12 | 1949-03-02 | 1958-03-16 | 1949-03-02 |
| visit 2026-07-30 | 2017-06-19 | 2026-07-03 | 2017-06-19 |
| follow-up 2026-09-15 | 2017-08-05 | 2026-08-19 | 2017-08-05 |
| present stated to | 2026-08-13 | 2026-08-13 | 2017-07-03 |
| order, duration | ✓ | ✓ | ✓ |
| follow-up still pending | × | ✓ | ✓ |
| smallest date movement | 3,328 d | 27 d | 3,328 d |
Table 15: SHIFT and its two tense remedies on one clinical document, under one session key, with the true present at 2026-08-13. All three preserve order and duration. SHIFT moves the follow-up into the past; SHIFT-CAPPED keeps its tense but confines the offset to 27 days; SHIFT-TODAY keeps both by moving the stated present with the data.
year, so and , which moves the visit to a Monday and from day 211 to day 170 of its year. Both methods use this offset, and SHIFT-TODAY also states the present as days = 2017-07-03.
SHIFT-CAPPED. The latest past date is the visit, 14 days before , and the earliest future date is the follow-up, 33 days after it, so Eq. (8) gives . Of its 46 offsets, 16 are admissible, since the guard removes every and the weekday test the multiples of 7; the first admissible draw is -27.
The smallest displacement any date receives is therefore 3,328 days under SHIFT and SHIFT-TODAY, and 27 days under SHIFT-CAPPED.
C.5 Wrap-Around and Computed Dates
Wrap-around. The modulus in Eq. (7) guarantees a valid surrogate and an exact inverse for every document. A date whose shifted day number leaves , however, wraps to the far end of the range and loses its order and distance relative to the other dates of the document, though not its restoration. No date wraps when for all i; since , this holds whenever every date lies at least S days inside the range, between 1910-12-15 and 2089-01-17. The synthetic ai4privacy corpus draws dates from the whole range, and two of the fourteen dates in its multi-date documents, from 1902 and 1907, fall outside this interval: an offset that carries them past 1900-01-01 wraps them into the 2090s, where they restore exactly but lose their relations to the rest of the document.
Computed dates. Because a rotation commutes with addition, the inverse also carries back dates the model computed rather than copied. If returns a date days after the surrogate , Eq. (12) yields
whenever the result does not wrap, which is days after the real date. On the document of Table 15, thirty days after the surrogate visit is 2017-07-19, which inverts to 2026-08-29, thirty days after the real visit. The inverse of Eq. (5) maps the same 2017-07-19 to 1973-09-30, since a permutation preserves neither order nor distance.
D Privacy Guarantee
We state the privacy guarantee of VTR as a game in which an adversary must tell apart the sanitized versions of two prompts that agree on a leakage function: the information that surrogates reveal by design, which is what keeps them useful to the model.
Setting. The adversary A is the honest-but-curious provider of Section 3. It sees every sanitized prompt and knows the design of VTR, but not , the session keys or the vault. Its replies are computed from what it has seen, so they add nothing to its view, and restoration is local. We treat the detector as a black box: the guarantee covers the PII entities it returns. VTR relies on three cryptographic primitives: HKDF derives its keys, FF1 enciphers syntactic values, and HMAC-SHA256 selects semantic surrogates and translation offsets. Each keyed use has its own key: keys FF1 and the translation offsets, and the semantic hash (Eq. (3)).
Leakage. For the prompts X of one session, consists of (i) the text outside the transformed PII entities, including PII the detector missed, and the position and type of each entity; (ii) the format each surrogate keeps, such as the template of an identifier, the layout and ambiguity class of a date, and the gender and token count of a name; (iii) which entities of the session are the same value; and (iv) under translation, the differences between the dates of each document. L contains nothing that relates values in different sessions.
Privacy game. In the game of Figure 2, A opens sessions and, for each prompt, submits two candidates with the same leakage. A secret random bit , drawn once at the start, decides which candidate is sanitized: A always receives the sanitized , and at the end outputs a guess . It may choose each pair after seeing earlier answers, as a provider steering a conversation could. denotes one run of the game, which outputs 1 when , and is the probability of this over the keys, b and the coins of A. Since guessing at random already wins with probability 1/2, the advantage rescales it so that 0 means no better than guessing and 1 a certain win:
A small advantage means that sanitized prompts reveal nothing about the PII beyond ; in particular, A recovers a protected value no better than it could from alone.
INITIALIZE: K_{\text{master}} \xleftarrow{\} \{0,1\}^{\kappa}; b \xleftarrow{\} \{0,1\}
NEWSESSION: open session s with a fresh , , an empty vault and empty transcripts ,
SANITIZE( ):
if : return
append to and to
return , updating
FINALIZE( ): return
Figure 2: The privacy game .
Theorem 1. If VTR enciphers dates rather than translating them, then for every adversary A that opens sessions,
where , and are the best advantages, in about the time of A, in telling HKDF, FF1 and HMAC-SHA256 under a random key from their ideal versions: a random function for HKDF and HMAC-SHA256, and an independent random permutation per tweak and width for FF1.
Proof sketch. We compare the real game with an ideal game in which the cryptography is replaced by truly random objects.
Step 1: from real to ideal. In every session, replace the keys derived by HKDF with random keys, FF1 with a random permutation for each tweak and width, and HMAC with a random function. These primitives are designed so that no efficient adversary can tell them from these ideal versions. If a replacement changed how often A wins, A could be used to do exactly that, so each replacement changes the chance that A wins by at most the corresponding advantage, which is negligible for secure primitives. Each session has its own keys, so the replacement is made session by session, which gives the factor .
Step 2: the ideal game reveals only L. In the ideal game a surrogate is chosen by chance rather than computed from the real value, so it carries no information about it. A random permutation sends each new value to a fresh random output, so an enciphered surrogate is a random value in the format of the original, repeated only when the value repeats; cycle walking keeps this true for dates (Black and Rogaway, 2002). For example, 479-13-8850 and 123-45-6789 both become a random nine-digit number in the layout --___-. A random function selects a pool entry for each new value, so a semantic surrogate is a random unused entry of its bucket, again repeated only when the value repeats: Marie Curie and Anna Novak both become a random female two-token name. What carries over is therefore only what L contains: the text around the PII, the format of each value, and which values repeat.
Conclusion. The two candidates have the same , so in the ideal game their sanitized versions have the same distribution and A wins with probability exactly 1/2. By Step 1, A therefore wins the real game with probability at most 1/2 plus the total cost of the replacements. Since the advantage is , it is at most twice that cost, which is the bound.
Corollary 1 (Unlinkability). Replacing a value in one session by another value of the same type and format that appears nowhere else in that session leaves L unchanged, so A cannot tell whether two sessions mention the same person with advantage above the bound of Theorem 1.
The corollary rests on the per-session key: under one long-lived key, a value would receive the same surrogate in every session.
Date translation. Translation moves every date of a document by the same secret offset of at most days (Eq. (6)). It therefore reveals the gaps between the dates of a document, which lets the model reason about intervals, and hides only where the document lies on the calendar: each real date lies within days of its surrogate (about years for ), all positions in that range being equally likely. The admissible set of Eq. (13) adds one clue: since no offset is a multiple of 7 or near a whole number of years, a real date never falls on its surrogate’s weekday or within g days of its day of the year. Each further document about the same timeline adds evidence. Tense-preserving variants reveal more: SHIFT-TODAY states the shifted present , so a provider that knows the real date recovers and every date. Encipherment is therefore the default, and translation is used only when intervals between dates matter.
E Examples of the Syntactic Mechanism
Table 16 traces the syntactic mechanism of Section 4.2.1 on one value of each kind under a single session key: the template and digit string of direct encipherment, and the rank, domain size and cipher calls of rank-then-encipher for each date representation, and two dates the cipher declines, which the semantic mechanism replaces.
Examples on how Encipherment Mechanism encrypt the PIIThe identifier 479-13-8850 splits into the template --___ and the digit string 479138850; FF1 maps the digits to 790880367, and refilling the template yields 790-88-0367. The grouped card number 4012-8888-8888-1881 and its bare form 4012888888881881 share the digit string 4012888888881881, so both encipher to the same digits 2836715022441866 and differ only in the template that refills them. For telephone numbers a leading country code is excluded from and copied verbatim: +1-202-555-0173 keeps the +1, enciphers 2025550173 to 5371444801, and refills as +1-537-144-4801, staying in its country and layout.
Examples of Date Encipherment
• Fixed-layout dates. For a three-part date with a four-digit year, VTR parses and ranks the date within its valid calendar domain, then renders the surrogate using the original field order, widths, and separators. For example, 1985-07-24 becomes 1946-10-01, while 12/05/2001 may become 08/17/1974, preserving the MM/DD/YYYY layout. Similarly, 31-01-2020 can be transformed to another valid DD-MM-YYYY date without changing the representation.
• Ambiguous numeric dates. For dates that admit multiple interpretations, VTR ranks the value within its ambiguity class rather than assuming a locale. For example, 10/03/1976, which can represent either 10 March or 3 October, becomes 06/07/2033, which remains valid under both interpretations. A day-first-only date such as 25/12/1999 can become 23/02/1916, preserving its day-first interpretation. Likewise, an unambiguous year-first representation such as 1976/03/10 remains within the corresponding YMD class after transformation.
• Textual dates. For dates written using month names, VTR canonicalizes the date before rank-based encipherment and renders the surrogate in the original textual style. For example, February 4, 1909 becomes October 31, 1966, while Feb 4th, 1909 becomes Oct 31st, 1966. Similarly, September 12, 1987 can become March 28, 2014, and 12 September 1987 can be rendered as another valid date while retaining the original day-month-year textual ordering.
• Timestamps. For timestamps, VTR independently transforms the date and time-of-day components using separate domains and tweaks while preserving the timestamp structure. For example, 1902-08-21T22:37:28.285Z becomes 2012-10-10T10:06:55.270Z. A timestamp without fractional seconds, such as 2024-06-15T14:32:10Z, retains the same precision, while 2023-11-02T08:15:42.50+00:00 preserves both its fractional precision and time-zone offset.
• Dates the cipher declines. A fragment with no full calendar date to rank, such as 20th September (two digits) or 1/20 (three), has no layout with a four-digit year to parse and too few digits to encipher directly, and neither has a time of day or an age that the detector labels as a date, such as 18:13 or 53 years old. The syntactic mechanism declines each such string and hands it to the semantic mechanism (Section 4.2.2), which issues a surrogate from the session vault. A partial date keeps its shape and stays a valid day and month: 20th September may become 10th October and 1/20 may become 9/29. Any other string keeps its letters and separators while each digit is replaced under the session key, so 18:13 may become 40:63, which hides the value but is not a valid time. Each surrogate is restored by vault lookup. An expression with no digit, such as next week, has nothing to replace and is sent unchanged.
| Input | Decomposition | Rank ρ / n | FF1 output (walks) | Surrogate |
|---|---|---|---|---|
| Direct encipherment of the digit string | ||||
| 479-13-8850 | π ____-____-____, δ 479138850 | — | 790880367 | 790-88-0367 |
| 4012-8888-8888-1881 | δ 4012888888881881 | — | 2836715022441866 | 2836-7150-2244-1866 |
| 4012888888881881 | same δ, no separators | — | 2836715022441866 | 2836715022441866 |
| +1-202-555-0173 | +1 kept, δ 2025550173 | — | 5371444801 | +1-537-144-4801 |
| Rank-then-encipher over the valid domain | ||||
| 1985-07-24 | layout 4×2×2, class YMD | 31,250 / 73,049 | 17,074 (1) | 1946-10-01 |
| 10/03/1976 | layout 2×2×4, class BOTH | 11,054 / 28,800 | 19,218 (6) | 06/07/2033 |
| 25/12/1999 | layout 2×2×4, class DMY | 22,058 / 44,249 | 3,660 (3) | 23/02/1916 |
| February 4, 1909 | canonical 1909-02-04, all days | 3,321 / 73,049 | 24,409 (1) | October 31, 1966 |
| Feb 4th, 1909 | canonical 1909-02-04, all days | 3,321 / 73,049 | 24,409 (1) | Oct 31st, 1966 |
| 1902-08-21T22:37:28.285Z (same instant) | date part, all days | 962 / 73,049 | 41,190 (3) | 2012-10-10 |
| time part, ms of day | 81,448,285 / 86,400,000 | 36,415,270 (1) | T10:06:55.270Z | |
| Declined by the cipher, replaced from the vault | ||||
| 20th September | no four-digit year; 2 digits | — | declined | 28th December (vault) |
| 18:13 | time of day; 4 digits | — | declined | 48:01 (vault) |
Table 16: Worked examples of the syntactic mechanism under FF1, one session key. and are the template and digit string of Eq. (3); and the rank and domain size of Eq. (5); walks the cipher calls until the output landed inside the domain; (vault) a declined value the semantic mechanism replaces.
F Examples of the Semantic Mechanism
The semantic pools of Section 4.2.2 are built from the locale data providers of the Faker library (Faraglia and contributors, 2026), version 40.38.0. Each locale provider ships lists of male given names, female given names, surnames and, for some locales, cities, compiled from public sources; the United States lists, for instance, derive from Social Security Administration given-name tables and Census surname counts. Table 17 lists the fifteen Latin-script locales we draw from and the number of entries each contributes. The three name lists are kept per locale, so that a surrogate person draws given name and surname from one locale, and are also merged into global pools in which a name occurring in several locales is counted once; the merged pools are used for e-mail addresses. Cities are not kept per locale: the city lists of all locales are merged into a single pool of 21,396 entries, of which 16,529 come from the Italian list and 169 from a curated list of world cities. The company pool holds 5,392 distinct names generated from company-name patterns over the surname lists with a fixed seed, and the e-mail domain pool holds 15 common providers. Table 18 lists the surrogates that these pools yield for six values under one session key.
G Experimental Setup Details
G.1 Datasets
We evaluate VTR on four datasets covering synthetic, real-world, and benchmark-specific text:
| Locale | Language / region | Male names | Female names | Surnames |
|---|---|---|---|---|
| cs_CZ | Czech / Czechia | 127 | 137 | 200 |
| da_DK | Danish / Denmark | 244 | 252 | 91 |
| de_DE | German / Germany | 999 | 1,003 | 404 |
| en_GB | English / United Kingdom | 182 | 182 | 500 |
| en_US | English / United States | 322 | 381 | 1,000 |
| es_ES | Spanish / Spain | 473 | 478 | 1,085 |
| fi_FI | Finnish / Finland | 199 | 199 | 400 |
| fr_FR | French / France | 88 | 127 | 400 |
| hu_HU | Hungarian / Hungary | 100 | 100 | 100 |
| it_IT | Italian / Italy | 273 | 185 | 1,164 |
| nl_NL | Dutch / Netherlands | 251 | 251 | 1,070 |
| no_NO | Norwegian / Norway | 100 | 100 | 101 |
| pt_BR | Portuguese / Brazil | 142 | 140 | 102 |
| ro_RO | Romanian / Romania | 265 | 362 | 39 |
| sv_SE | Swedish / Sweden | 500 | 500 | 500 |
| merged, duplicates removed | 2,969 | 2,750 | 6,337 | |
Table 17: Locales feeding the semantic pools and the given names and surnames each contributes. The city pool (21,396), company pool (5,392) and e-mail domain pool (15) are merged across locales.
-
ai4privacy (Ai4Privacy, 2023). Template-generated text with gold PII annotations. Among the three general-purpose corpora, it is the only annotated dataset, so we use it to evaluate detection recall and per-entity protection.
-
WildChat (Zhao et al., 2024). Raw user-assistant conversations collected from real-world interactions. It evaluates whether results observed on template-generated text transfer to naturally occurring prompts.
-
ShareGPT (anon8231489123, 2023). User-shared conversations from real-world interactions. Together with WildChat, it tests generalization to naturally occurring prompts while introducing different selection biases, as users
| Type | Input v | Surrogate ß |
|---|---|---|
| PERSON | Marie Curie | Ágnes Orosz |
| PERSON | MARIE CURIE | Ágnes Orosz |
| PERSON | Pierre Curie | Carlo Krogh |
| PERSON | Marie | Taru |
| LOC | Paris | Paesana |
| ORG | Sorbonne University | Hamilton-Williams |
| marie.curie@sorbonne.fr | piersanti.madden@proton.me |
Table 18: Semantic surrogates issued under one session key. A re-cased repetition shares its surrogate; under a second session key Marie Curie becomes Lucie Musil.
are less likely to share conversations containing their own personal data.
- PUPA (Siyan et al., 2025). The benchmark introduced with PAPILLON, containing 664 WildChat turns annotated with gold personal-data units. We use PUPA to evaluate privacy–utility trade-offs consistently across all compared systems.
G.2 Detector Configuration
Unless stated otherwise, the detector uses the transformer sequence model (en_core_web_trf) with both shape-recognizer groups enabled. The analyzer in Section 4.1 combines one spaCy model with validating recognizers for credit-card numbers (Luhn), SSNs, telephone numbers, and e-mail addresses. We add two independently toggleable groups of shape recognizers to capture surface forms that the sequence model may miss on multilocale text. Unlike the validating recognizers, these are regular-expression patterns that match surface form alone and perform no validation: card patterns match any digit sequence of the required length regardless of Luhn validity, while the eleven-digit identifier pattern matches any sequence of that length. Each pattern is assigned a confidence score in [0, 1], shown beside it in Table 19, which the analyzer uses in two ways. First, matches below a threshold are discarded; we set this threshold to 0.4, which admits all eight patterns, so increasing it prunes patterns from the bottom, with the year-less numeric date pattern (0.45) removed first. Second, when two recognizers return the same entity, the lower-scoring match is discarded, while an entity contained within another is discarded regardless of score. The scores are therefore relative: a pattern without separators, which may match ordinary numbers, receives a lower score than one whose punctuation makes false matches less likely.
| entity | pattern | score |
|---|---|---|
| Identifier shapes | ||
| CARD | 0.50 | |
| CARD | 0.60 | |
| SSN | 0.60 | |
| SSN | 0.50 | |
| SSN | 0.60 | |
| PHONE | \+ \d[\d .-\]{8,16}\d | 0.55 |
| Date shapes | ||
| DATE | 0.60 | |
| DATE | 0.45 | |
Table 19: The shape recognizers, as registered with the analyzer. MONTH abbreviates the alternation over full and three-letter month names.
G.3 Baselines
We provide additional details on the baselines spanning entity substitution, local prompt rewriting, and differential-privacy-based protection. These categories differ in whether they operate on detected entities, rewrite the prompt more broadly, or perturb its content to provide privacy.
- Entity substitution. These methods explicitly identify personal-data entities and replace them with encrypted values, typed placeholders, or surrogates before sending the request to the remote model.
-
Preempt (Chowdhury et al., 2025). It enciphers detected entities with FPE. It natively supports names; for numeric entity types, we apply its FPE primitive to the entities detected by our detector.
-
Rescriber (Zhou et al., 2025). It replaces entities with typed placeholders such as [NAME1], selected by a prompted 8B detector, and restores them using a per-conversation dictionary.
-
HaS (Chen et al., 2023b). It uses a fine-tuned local model to hide entities and a second local model to restore them in the response.
For these methods, the entity-level transformation is applied to the same entities detected by our detector, allowing us to isolate differences in transformation and restoration rather than detection coverage.
- Local rewrite. These methods protect personal information by rewriting the request with a trusted local model rather than replacing individual detected entities.
- PAPILLON (Siyan et al., 2025). It uses a trusted local model to rewrite the request; we reproduce
it using the authors’ released pipeline and optimized prompts.
• Staab et al. (Staab et al.). The adversarial anonymizer alternates between an inference model that predicts personal attributes and a rewriter that modifies the prompt to defeat those predictions.
• SEAL (Kim et al., 2026). It distills this adversarial loop into a single local 8B model, which we train using the authors’ recipe because pretrained weights are not released.
None of these methods sends per-entity surrogates or relies on an explicit PII detector; instead, the local model rewrites the request as a whole.
- Differential privacy. These methods provide formal or approximate privacy by perturbing tokens, embeddings, or the entire prompt rather than targeting PII entities explicitly.
• SanText+ (Yue et al., 2021) & CusText (Chen et al., 2023a). replace tokens using metric local differential privacy over an embedding space.
• DP-MLM (Meisenbacher et al., 2024). It resamples each word from a masked language model conditioned on its context.
• DP-Prompt (Utpala et al., 2023). It regenerates the entire document, with the sampling temperature determined by .
• InferDPT (Tong et al., 2025). It perturbs the prompt and uses a local extraction model to recover information from the generated response.
None of these methods uses an explicit PII detector; instead, each operates on the input at the token level or rewrites the full prompt. We evaluate each method at its reported operating point: for SanText+, CusText, and InferDPT, for DP-MLM, and for DP-Prompt, corresponding to its central sampling temperature. For DP-MLM and DP-Prompt, is calibrated using token-level sensitivity, so its numerical value is not directly comparable across mechanisms.
Baseline handling. We follow each baseline's intended usage while adapting its inputs and preprocessing to our evaluation setting. SanText+ and CusText require corpus-specific fitting: SanText+ derives its vocabulary and sensitive-word set from the fitting corpus, while CusText derives the candidate substitution set for each word. For the ai4privacy experiments (Tables 3 and 7), we fit both methods on ai4privacy rather than PUPA. Preempt's name-encryption mechanism is designed to process multiple names jointly; when applied once per name, it maps most names to the same surrogate. Therefore, for all ai4privacy experiments (Tables 2, 4, 3, and 7), we first pass all distinct names detected in the corpus in groups of at most 200 and reuse the resulting surrogates across prompts. For PUPA (Table 1), we instead run Preempt once per prompt, following its per-request usage; this changes the surrogate assigned to a name across prompts but does not affect which original values are exposed.
G.4 Evaluation Metrics
Each metric is reported using the corresponding name of its table column. Throughout the tables, (%) denotes a percentage, (×) a ratio to the unprotected prompt, (#) a count, and % (#) a percentage followed by its count.
• Detection Recall. is the fraction of annotated entities for which the detector returns an overlapping entity.
• Missed. is the number of annotated entities for which the detector returns no overlapping entity. Unless protected by another mechanism, these entities are sent to M verbatim.
Trust boundary metric categories. Every method is evaluated on the text that reaches M using the following metrics:
• Leaked. is the fraction of PII values that appear verbatim in the text sent to M.
• Leak-free. is the fraction of prompts containing no PII values verbatim in the text sent to M.
• Retained. is the fraction of the request’s content words that remain in the text sent to M. Leaked and Retained should be considered together because discarding more content can reduce leakage at the cost of utility.
• Unchanged. is the fraction of prompts sent to M exactly as written by the user.
• Words changed. is the mean fraction of words whose form or position differs in the transmitted text; unlike Retained, it counts reordered words as changed.
• Perplexity (PPL). is the median, across prompts, of the transmitted text’s perplexity divided by that of the unprotected prompt. A value below one indicates more predictable text, not necessarily greater utility.
• Local queries. is the number of queries to a local model required per request.
Transformation. Transformation metrics are computed on detected entities using the following measures:
• Protected. is the fraction of detected entities replaced by the method. A replacement that differs from the original only in case or spacing is not considered protected.
• Round trip. is the fraction of protected entities that are restored exactly to their original values.
• Valid. is the fraction of protected entities whose surrogates are valid instances of the corresponding entity type.
• Collisions. is the number of distinct original values assigned the same surrogate, which prevents unambiguous restoration.
Detected dates are reported in two columns: DATE contains dates handled by the cipher, while DATE FALLBACK contains the remaining dates, which VTR stores in the session vault when they contain a digit. All methods are evaluated on both sets. A cell marked n/a indicates that the method provides no mechanism for that entity type.
Date schemes. Each date scheme is evaluated on dates containing at least six digits, which all three schemes can encipher: annotated dates from ai4privacy and dates matched by date patterns in WildChat and ShareGPT using the following measures:
• Ambiguity kept. is the fraction of dates that parse as calendar dates for which the surrogate preserves exactly the same field-order interpretations as the original.
• Cipher calls. is the mean number of cipher invocations required per date and is independent of machine speed.
Date translation. Each ShareGPT document contributes its first two distinct dates that are at least two days apart, together with a stated present halfway between them. The untrusted model answers three questions under each scheme. The following measures are used:
• Order. is the fraction of documents in which the model identifies the surrogate corresponding to the earlier original date as earlier.
• Tense. is the fraction of documents in which the model correctly identifies both dates as past or future relative to the stated present.
• Computed date. is the fraction of documents in which the date given as seven days after the second date, after applying the scheme’s inverse, equals the original second date plus seven days.
• Moved. is the median, across documents, of the smaller absolute movement in days between the two original dates and their corresponding surrogates, while Unmoved is the number of documents in which neither date changes.
End to end. End-to-end metrics evaluate whether surrogate values returned by the untrusted model can be restored locally and whether original values are ultimately recovered. The following measures are used:
• Echoed. is the fraction of surrogates that the untrusted model returns verbatim in its answer.
• Restored. is the fraction of echoed surrogates that are restored exactly to their original values.
• Untrusted answer. is the fraction of values present in the untrusted model’s answer, while Local answer is the fraction present in the answer regenerated by a local model.
• Value recovery. is the fraction of entities whose original value appears in the final answer, regardless of how the value is recovered.
• Restored by. identifies the mechanism used to recover the original value: a session key without stored state, locally stored state such as a session vault or surrogate-to-value map, or a local model that rewrites the answer. A method may use multiple mechanisms for different entity types; not restored denotes a type for which the method provides no recovery mechanism.
G.5 Environment and Cryptographic Parameters
Computing environment. All experiments were conducted on a single workstation running Ubuntu 24.04.1 LTS with an Intel Core i9-14900K CPU (24 cores, 32 threads), 125 GB RAM, and an NVIDIA RTX PRO 6000 Blackwell GPU with 96 GB memory (driver 575.57, CUDA 12.8). The implementation uses Python 3.12.4, PyTorch 2.10.0, and Transformers 4.57.6 for language-model inference; Presidio Analyzer 2.2.364 and spaCy 3.8.16 with the en_core_web_trf 3.8.0 model for PII detection; and cryptography 48.0.1 for the AES, HKDF, and HMAC primitives.
Cryptographic parameters. Each experimental run uses a 256-bit master key, from which 256-bit session keys are derived using HKDF-SHA256. FF1 uses AES-256 with ten Feistel rounds and radix 10, while the semantic mechanism uses HMAC-SHA256 for keyed hashing.