/ Модель

Характеристики

Лицензия
Apache 2.0
Архитектура
egemma-pii-secrets-tagger · dense
Базовая модель
embeddinggemma-2
Опубликована
8 ноя 2026

egemma-pii-secrets

Разметка токеновТекст → label11 профессий

Компактная модель разметки текста для поиска персональных данных и секретов перед их редактированием и безопасной передачей.

631скачиваний за 30 дней1лайквеса обновлены8 ноя 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

egemma-pii-secrets — компактная модель разметки токенов, разработанная Аной (@okami.mom) и её агентом bunny. Это дообучение текстовой части google/embeddinggemma-2 от Google: для каждого токена модель предсказывает один из 27 тегов, отмечая PERSON, EMAIL, PHONE, ADDRESS, GOV_ID, FINANCIAL, DATE_OF_BIRTH, IP_ADDRESS и различные виды секретов. Модель предназначена для поиска персональных данных и учётных секретов в текстах перед их передачей или публикацией: например, в расшифровках работы агентов, логах, конфигурациях, обращениях в поддержку и чатах. Она может запускаться локально на CPU, CUDA или Apple Metal. Лицензия — Apache-2.0.

Модель предлагает фрагменты для редактирования и рассчитана на совместное использование с правилами regex из trace_rules.py, точной проверкой известных системе секретов и предварительным просмотром результатов человеком или проверяющей моделью. Сама модель принимает текст и выдаёт метки фрагментов; изображения, аудио и бинарные данные напрямую не обрабатывает. Основной язык — английский; в обучающих данных также присутствовали французский, немецкий, испанский, итальянский, нидерландский и шведский.

Возможны пропуски и лишние срабатывания, особенно на коротких или необычно записанных секретах, именах и данных в длинных формах; оценки уверенности ненадёжны для выбора порога. Данные обучения в основном синтетические, поэтому качество на реальных текстах следует проверять отдельно. Модель не гарантирует обнаружение всех секретов и не является сертификацией соответствия требованиям приватности. Часть обнаружения IP-адресов, учётных данных и других шаблонов находится в отдельных правилах, а не в весах модели.

Сценарии применения

  • поиск персональных данных в расшифровках работы ИИ-агентов
  • обнаружение паролей и токенов в логах и конфигурациях
  • выявление адресов электронной почты и телефонов в обращениях поддержки
  • подготовка чатов к передаче с предварительным просмотром фрагментов для редактирования
  • разметка чувствительных данных в текстовых документах

Ограничения

Модель может пропускать секреты и персональные данные или ошибочно отмечать похожие на них строки; оценки уверенности ненадёжны, а на длинных формах качество слабее. Для практического применения рекомендуется сочетать веса с правилами и проверкой результата человеком; модель не обеспечивает гарантию безопасности или соответствия нормативам.

Для каких профессий подходит11

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Также подходит для

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

egemma-pii-secrets

Model Card for egemma-pii-secrets

A small model that finds secrets and personal data in text so they can be redacted, built to export agent transcripts safely for post-training. It's a fine-tune of the text half of google/embeddinggemma-2, runs locally (CPU, CUDA, Apple Metal), and is meant to be used together with its regex rules and a preview step before anything is shared.

Model Details

Model Description

egemma-pii-secrets is a token classifier: for every token it predicts one of 27 tags, either O (nothing) or the beginning B- or inside I- of 13 labels: PERSON, EMAIL, PHONE, ADDRESS, GOV_ID, FINANCIAL, DATE_OF_BIRTH, IP_ADDRESS, SENSITIVE, SECRET_TOKEN, SECRET_PASSWORD, SECRET_CONNECTION, and SECRET_PRIVATE_KEY.

Around the model, trace_rules.py adds regex rules for IPs, usernames in paths, credential fields, connection strings and database URLs, private keys and known key prefixes, a base64 decoder that checks encoded text for secrets, and a veto that never redacts provably public shapes (data URIs, public keys, digests).

  • Base Model: google/embeddinggemma-2 by Google, Apache-2.0. Only the text half is used without the vision tower
  • Developed By: Ana (@okami.mom on bluesky) and my agent, bunny (Claude Opus 5.5 mainly)
  • Model type: Token classification (span tagging) for redaction
  • Language: English, with some French, German, Spanish, Italian, Dutch, and Swedish in the training data
  • License: Apache-2.0

Training procedure (summary):

Fine-tuned from the base encoder in bf16 with AdamW (head learning rate 10× the encoder's), in three stages: a 0.6-epoch run from the base model (learning rate 1e-4, batch 32); a 0.4-epoch run (learning rate 2e-5) that adds a knowledge-distillation term, KL(teacher ‖ student), against the stage-one model so newly added data doesn't erase what it already learned; and a final 0.4-epoch run the same way with LLM-written look-alikes (secret-shaped strings that aren't secrets), the stage-two model as teacher.

Uses

Direct Use

Tagging personal data and secrets in text so they can be redacted before the text is shared, such as agent transcripts, tool outputs, logs, configs, support tickets, and chat. The model proposes spans so they will need further approval from either a person or a reviewer LLM. This model is meant to run locally and is small enough to run on a laptop CPU or GPU, or on Apple silicon with Metal.

Downstream Use

The tagging layer in albedo’s planned /trace export, which runs: rules → this model → an exact match on secrets the harness already knows → post-processing by a ZDR LLM or local model owned by the user → a preview the user approves. A planned screenshot redactor would run it over OCR text and re-render or box the flagged words.

Out-of-Scope Use

  • An unattended guarantee: it misses some secrets and some PII (see Limitations). Don't publish its output without review.
  • Compliance certification (GDPR, HIPAA, PCI). It can help a process; it is not one.
  • Images, audio, or binary/encrypted/compressed data directly. Opaque base64 blobs are listed for review by the rules, not decoded by the model.
  • Mostly non-English text.
  • Searching other people's data for credentials to use. It's a detector for protecting your own data before you share it.

Bias, Risks, and Limitations

  • Misses happen. Hardest cases: passwords written as ordinary words or phrases, very short test values ("k"), secrets in unusual contexts, and sometimes half a name (in "Jane Doe" only "Jane" is tagged). A miss can be partial: only part of a token covered. Secret spans are widened to the whole token to limit this.
  • Over-redaction. It still flags some strings that only look secret: on the CredDetX test set, the model with the rules' veto wrongly flags 16% of labelled look-alikes (20% with the full rules, partly by design: placeholders in credential fields and database URLs are redacted by policy).
  • Confidence scores aren't reliable for thresholding. Probabilities are bimodal and confidently wrong in both directions (CredDetX dev: 123 of 803 real secrets scored below 0.1, and 167 of 1,648 look-alikes at 0.99 or above; requiring 0.9 drops fully covered secrets from 630 to 552 while cutting flagged look-alikes from 503 to 305). Raising a threshold loses real secrets about as fast as it removes false flags.
  • Long documents and forms are the weakest case. On RedactionBench (real forms, logs, files) the model alone fully covers 69% of mandatory spans. Most misses are 1–5 character fragments (IP octets and date parts, which the rules handle in practice), but names in unusual casing and short location details (state codes, apartment numbers) inside forms are real misses.
  • Mostly synthetic training data. Much of the data is generated or LLM-written; real text can look different. Real-world performance should be checked on your own data.
  • Language. English-centered; some French, German, Spanish, Italian, Dutch and Swedish.
  • Policy choices are baked in. Placeholders in credential fields (password: changeme) are treated as secrets; dates, ages, URLs without credentials, and customer/employee/device ids are not tagged; organizations are not tagged.
  • The rules are not in the weights. IP addresses, usernames in paths, the base64 decode step and the veto live in trace_rules.py. Using the weights alone gives different (lower) results.

Recommendations

Use the model together with trace_rules.py, add exact-match redaction for any secrets your system already knows, and always show the user what will be shared before it is. Treat flagged spans as proposals.

How to Get Started with the Model

Use the code below to get started with the model.

# files: redact.py, trace_rules.py, labels.json, tokenizer/, encoder/, head.safetensors, onnx/tagger.int8.onnx
from redact import Redactor

r = Redactor()   # picks CUDA/ROCm, then Apple Metal, then int8 ONNX on CPU; or Redactor(backend="onnx")
clean, spans = r.redact('export OPENAI_API_KEY="sk-proj-..." # ask Priya Natarajan (priya@corp.example)')
print(clean)     # export OPENAI_API_KEY="[secret_token]" # ask [person] ([email])
for s in spans:
    print(s["start"], s["end"], s["label"])

Show people the redacted text before it's shared; treat the spans as proposals.

Training Details

Training Data

No private data or user transcripts are in the released weights.

sourcelicensewhat it contributed
nvidia/Nemotron-PIICC-BY-4.0PII spans in many document types
gretelai/gretel-pii-masking-en-v1Apache-2.0PII (offsets recovered by exact match)
gretelai/synthetic_pii_finance_multilingualApache-2.0PII in long financial documents, several languages
urchade/synthetic-pii-ner-mistral-v1Apache-2.0PII in short texts
ildpil/text-anonymization-benchmark (TAB)MITdirect identifiers in ECHR rulings (names, codes); other mentions ignored
beki/privyMITPII inside JSON, SQL, HTML and XML payloads
apartejs/aparte-secrets-dataODC-BYsecrets in chat, configs, HTTP and JSON; secret labels only
nyuuzyou/gliner2.5-PII-code-en-data (training splits)CC0 / CC-BYPII and secrets in code
gitleaks rule setMITprovider token formats used to generate realistic keys (183 providers; 28 held back for testing)
our generators (Ana & bunny), in nekomimi-llc/egemma-pii-secrets-syntheticCC0-1.0connection strings, national IDs, IBANs, phones in CSV/JSON/logs, placeholder names, look-alikes (hashes, ids, data URIs, public keys)
LLM-written examples (Ana & bunny), in nekomimi-llc/egemma-pii-secrets-syntheticCC0-1.0Claude Haiku: secrets hidden in casual context; Claude Haiku + GPT-6-luna: look-alikes written from shape descriptions, checked by Claude Sonnet

Changes to the training data

We mapped every source's labels to our 13 labels (some fine labels dropped by policy: dates, ages, URLs, customer/employee/device ids, organizations), recovered character offsets by exact match where a source gave only strings, sampled subsets, and removed any text that also appears in a test set. Nothing was re-published from these sources; please get them from their authors.

Benchmarks and evaluation data

Thanks to the authors of the sets we evaluated and selected checkpoints on. None of the splits listed here was trained on (for gretel, gretel finance, privy and gliner, we trained only on their separate training splits, listed above).

setlicensehow we used it
CobuildX-AI/CredDetXCC-BY-4.0test split: frozen secrets test, run once; dev split: development
apartejs/aparte-secrets-goldODC-BYchat-fresh and gold: frozen secrets tests
nyuuzyou/gliner2.5-PII-code-en-dataCC0 / CC-BYcode benchmark split: frozen test
RedactionBench/RedactionBenchCC-BY-4.0frozen PII test
nutrientdocs/DocPII-redaction-benchmarkMITfrozen PII test (offsets recovered by exact match)
ildpil/text-anonymization-benchmarkMITTAB test + dev splits: frozen PII test
gretelai/gretel-pii-masking-en-v1, gretelai/synthetic_pii_finance_multilingual, beki/privyApache-2.0 / Apache-2.0 / MITtheir test splits: in-distribution PII tests
sinceaihq/safeprompt-benchCC-BY-4.0checkpoint selection (one half) and reporting (other half) during development

Training Procedure

Preprocessing

Every source is mapped to the 13 labels. Fine labels we chose not to tag (dates, ages, URLs, customer/employee/device ids) become "nothing". Sources that only label secrets (aparte, LLM-written rows) don't teach "not PII" on their untagged tokens: those tokens are only taught "not a secret", so names in them aren't learned as harmless. Everything is deduplicated by text hash against every test set.

Training Hyperparameters

  • Training regime: bf16 mixed precision
  • AdamW (fused), weight decay 0.01, encoder learning rate 1e-4 (stage 1) / 2e-5 (later stages), head 10× the encoder's
  • 5% linear warmup, then linear decay; gradient clipping at 1.0
  • Batch 32 windows of 512 tokens (stride 128); token-embedding table frozen
  • Later stages add KL(teacher ‖ student) with weight 1.0, the previous stage as teacher

Speeds, Sizes, Times

About 230 windows/s on one RTX PRO 6000 Blackwell (~15 minutes per stage). Encoder ~1.1 GB in fp32, ~520 MB in fp16. On an Apple M4 (Mac mini), with the rules: ~9.0 KB of text per second with Metal fp16, ~6.2 KB/s on CPU in fp32 PyTorch, ~5.6 KB/s with the int8 ONNX model on CPU. Metal fp16 gives exactly the fp32 spans; int8 matches fp32 on 96.8% of test rows (1 of 149 held-out secrets lost). int8 ONNX is 273 MB and needs no PyTorch; on an M4 it is not faster than PyTorch on CPU.

Evaluation

Results (frozen tests, each run once)

None of these sets was used for training, checkpoint selection or tuning. Test texts were removed from training by hash. "Fully covered" means every character of a gold span is redacted; a partial hit counts as a miss.

Secrets

test setn secretsmodel + vetomodel + rules + vetolook-alikes wrongly flagged (model+veto / +rules)
CredDetX test (7,176 labelled look-alikes)3,21387.8%97.8%16.2% / 20.4%
aparte chat-fresh (written after the set's own cutoff)39698.2%98.2%not labelled
aparte gold75698.3%98.4%not labelled
gliner code benchmark462100%100%not labelled

Part of the flags on CredDetX are deliberate: placeholders and obviously-fake keys in credential fields, and database URLs without passwords, are redacted by policy but labelled as look-alikes there.

PII (model alone, gold spans fully covered)

test setn spansfully covered
gretel-pii-masking test17,19099.1%
privy test2,27199.5%
TAB (ECHR rulings) test2,75297.3%
gretel finance multilingual test15,41091.1%
DocPII8,69380.1%
RedactionBench, mandatory spans16,99368.5%
RedactionBench, contextual spans36,29332.8%

gretel, privy, TAB and gfin test splits come from the same sources as training data (in-distribution). RedactionBench and DocPII are out-of-distribution; RedactionBench (real forms with fine-grained spans) is the weakest and the best guide to unfamiliar documents. These PII numbers are the model alone; IPs and usernames in /trace come from rules.

Environmental Impact

  • Hardware Type: NVIDIA RTX 5070 (local), NVIDIA RTX PRO 6000 Blackwell (Google Colab G4)
  • Hours used: RTX 5070: ~13 h of training (from the training logs) plus an estimated ~4 h of evaluation; RTX PRO 6000: ~2.6 h
  • Cloud Provider: Google Colab for the RTX PRO 6000; the RTX 5070 is a home machine on Dominion Energy's grid (Virginia)
  • Compute Region: Colab runtimes in US East, the Netherlands and Singapore; local in Virginia, USA
  • Carbon Emitted: about 1.3–1.9 kg CO₂e in total, roughly a 3–5 mile drive in a gasoline car. Local: ~4–6 kWh × 0.27 kg CO₂e/kWh (EPA eGRID 2023, SERC Virginia/Carolina) ≈ 1–1.6 kg. Colab: ≈ 0.33 kg (ML CO₂ Impact calculator, scaled to hours and measured power). Emissions only; provider offsets not subtracted.

Technical Specifications

Model Architecture and Objective

  • Encoder: the text encoder of google/embeddinggemma-2, 24 transformer layers (sliding-window and full attention), ~271M parameters, hidden size 512 projected to 768. The 134M-parameter token-embedding table is kept frozen in training; the vision tower isn't used.
  • Head: one linear layer (768→27) applied to every token's output vector; the highest of the 27 scores is the token's tag (O, or B-/I- of 13 labels). Consecutive B- and I- tags are joined into character spans, and secret spans are widened to the whole token around them.
  • Input handling: text is split into chunks of 512 tokens that overlap by 128 tokens, so a span on a window edge is seen whole by the next window.
  • Objective: per-token cross-entropy over the 27 tags. For sources that only label secrets, untagged tokens are trained only toward "not a secret" (a marginal loss over all non-secret tags) rather than toward O. Later stages add KL(teacher ‖ student) with weight 1.0, the previous stage as teacher.

Compute Infrastructure

Main training stages on Google Colab (one NVIDIA RTX PRO 6000 Blackwell, 96 GB, ~15 minutes per stage). Earlier experimental runs, the stages that used private data, and all evaluation on a home machine with an NVIDIA RTX 5070 (12 GB) and RTX 4060 (8 GB).

Hardware

For inference: about 1.1 GB of weights in fp32, ~540 MB in fp16, and a 273 MB int8 ONNX file for CPU. Runs on a laptop CPU (int8 ONNX), NVIDIA GPUs (CUDA), AMD GPUs (PyTorch ROCm builds, untested) and Apple silicon (Metal). Speeds are under Speeds, Sizes, Times.

Software

  • Training: PyTorch 2.11 (CUDA 12.8) locally and 2.14 (CUDA 13.0) on Colab, Hugging Face Transformers 5.20.1, safetensors.
  • Inference: Transformers with EmbeddingGemma 2 support (5.20.1 or newer) and PyTorch, or onnxruntime for the int8 CPU model; redact.py picks CUDA/ROCm, then Metal, then int8 ONNX on CPU.
  • Rules: trace_rules.py uses only the Python standard library.

Contact

Ana — ana@nekomimi.pet

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм

Нельзя запустить

Не удалось определить, чем загружать веса модели (нет library_name и architectures).

Ревизия весов
98eba7d

0 моделей