HaS (Hide and Seek) is an on-device privacy model providing a complete pipeline from entity recognition to anonymization and restoration.
📦 0.6B parameters, Q8_0 quantization, 639 MB
🔒 Data never leaves device — local inference, no network required
🌍 8 languages natively supported: Chinese, English, Portuguese, French, Spanish, German, Korean, Japanese
⚡ Apple M4 benchmark: prefill 1,600–2,800 tok/s, generation 96–120 tok/s
1. Core Capabilities
Traditional anonymization (regex, Presidio, etc.) only does pattern matching. HaS is an on-device Agentic privacy pipeline — a set of composable atomic capabilities that solve multi-turn consistency, reversible restoration, and post-anonymization data usability.
Capability
Description
3-Level Semantic Tags
Instead of [REDACTED], produces tags like <Amount[1].ContractAmount.NumberSymbol> — LLMs understand "this is a contract amount", preserving data usability
Coreference Resolution
"CloudGenius Inc.", "CloudGenius", "云创智能" → all unified as <Organization[1].Company.Name>. Different forms, same ID
Multi-turn Consistency
Carries historical mapping dictionaries for incremental anonymization. Entity IDs stay consistent across turns. Same mechanism supports recursive chunking for long documents
Reversible Restoration
Anonymized text can be processed by cloud LLMs (translation, rewriting, etc.), then Seek restores the tags back to original values
Open-set Entity Types
Trained on ~70,000 entity types. Users can freely specify any type name without being limited to predefined categories
Public/Private Distinction
"Industrial and Commercial Bank of China" preserved, "Li Hong 138-xxxx" anonymized — only redacts what should be redacted
2. Six Atomic Capabilities
#
Capability
Description
1
NER
Recognize named entities of specified types
2
Hide_with
Anonymize using an existing mapping dictionary (maintains cross-text consistency)
3
Hide_without
First-time anonymization (no mapping, model generates tags autonomously)
4
Pair
Extract mapping relationships from original and anonymized text pairs
5
Split
Split composite tags into atomic single-entity mappings
Tags use a <EntityType[ID].Category.Attribute> three-level structure:
<Address[1].City.CityName> ← identifies this as a city name
<Address[2].StreetAddress.FullAddress> ← identifies this as a detailed address
<Amount[1].ContractAmount.NumberSymbol> ← identifies this as a contract amount
<Phone[1].Mobile.FullNumber> ← identifies this as a mobile number
Comparison with traditional approaches:
Traditional
HaS 3-Level Tag
[ADDRESS]
<Address[1].City.CityName>
[ADDRESS]
<Address[2].StreetAddress.FullAddress>
[MONEY]
<Amount[1].ContractAmount.NumberSymbol>
Coreference Resolution
The same entity often appears in multiple forms. HaS automatically recognizes they refer to the same object and unifies them under one ID:
Original forms Unified tag
─────────────────── ───────────────────────
CloudGenius Inc. → <Organization[1].Company.Name>
CloudGenius → <Organization[1].Company.Name>
云创智能 → <Organization[1].Company.Name>
CG → <Organization[1].Company.Name>
This ensures anonymized text remains logically coherent — LLMs seeing multiple <Organization[1]> know it's the same company. Critical for multi-turn conversations and long document chunking: entity IDs remain globally consistent across turns and chunks.
The 6 atomic capabilities can be composed into various privacy pipelines:
Scenario
Description
Capabilities Used
Redacted Sharing
Auto-anonymize files, emails, code before sending; retain mapping for restoration
Hide → Pair
Privacy Scanning
Scan files/directories, list all sensitive entities, assess exposure risk
NER
Privacy Knowledge Base
Anonymize documents before ingestion; restore query results via mapping
Hide → Pair (write), Seek (read)
Log Redaction
Batch-anonymize ops logs before handing to support teams
Hide → Pair
Secure Cloud Chat
Anonymize text before sending to cloud LLM; restore LLM responses
NER → Hide → Pair → Seek
AI Memory Privacy
Store Agent long-term memory in anonymized form; restore on demand
Hide → Pair (store), Seek (recall)
6. Prompt Templates
⚠️ Templates must match character-for-character — the model was trained on these exact templates. Any deviation may degrade output quality.
NER
Recognize the following entity types in the text.
Specified types:{types_json_array}
<text>{text}</text>
Hide_with (with mapping)
Turn 1: Same as NER template
Turn 2:
Replace the above-mentioned entity types in the text according to the existing mapping pairs:{mapping_json}
Hide_without (without mapping)
Turn 1: Same as NER template
Turn 2 (fixed text, no variables):
Replace the above-mentioned entity types in the text.
Pair
<original>{original_text}</original>
<anonymized>{anonymized_text}</anonymized>
Extract the mapping from anonymized entities to original entities.
Split
Split each composite anonymized key into atomic keys.
Composite mapping:
{composite_mapping_json_array}
Seek
The mapping from anonymized entities to original entities:
{mapping_json}
Restore the original text based on the above mapping:
{text_with_tags}
7. Speed Benchmarks
Test platform: Apple M4, Q8_0 model, llama-server recommended settings
HaS ships with a CLI tool has-text that orchestrates model capabilities with programmatic tools into ready-to-use commands (scan, hide, seek). The following are end-to-end CLI times:
scan = Model-NER
hide = Model-NER → Model-Hide → Tool-Pair → Tool-Mapping Merge (with self-check; Model-Split called for composite tags)