Genivara-PII nano
Ultra-lightweight, browser-native model for multilingual PII detection. Runs entirely in the browser via WebAssembly (ONNX Runtime Web); no server calls. 8.2 MB (98.4% smaller than teacher), 26 languages, pooled AUROC 0.9928, median latency 15.28 ms. Knowledge distillation + extreme vocabulary pruning (119,547→20k) + INT8 quantization. Recommended threshold 0.78 (Hybrid Consistency); high-trust config: Recall 0.57, near-zero FPR in natural language.
From the paper
- Compression: 511 MB → 8.2 MB; distillation + vocab pruning + INT8.
- Hybrid Consistency: Post-processing that resolves the "Context Paradox" (context amplifies noise in small models) by gating window scores with per-token baselines.
- Uncertainty Plateau: Outputs cluster near 0.78 for OOV/leetspeak; enables zero-shot obfuscation detection and principled threshold choice.
Model details
- Architecture: 4-layer DistilBERT (hidden 256, 4 heads)
- Vocabulary: 20,000 tokens (pruned from 119,547)
- Format: INT8 ONNX, 8.2 MB
- Context: 64 tokens
- Teacher:
distilbert-base-multilingual-cased (distilled on PII corpus)
Performance (Verified Metrics)
Comparative Accuracy (N=4,337 English subset)
| Model | Precision | Recall | F1 | FPR | Latency (WASM) |
|---|
| Teacher (DistilBERT) | 0.99 (±0.01) | 1.00 (±0.00) | 0.99 (±0.01) | 0.01 (±0.01) | 142.1 ms |
| Genivara-PII (Std) | 1.00 (±0.00) | 0.67 (±0.01) | 0.80 (±0.01) | 0.00 (±0.00) | 15.3 ms |
| MS Presidio v2.2 | 0.64 (±0.01) | 0.88 (±0.01) | 0.74 (±0.01) | 0.40 (±0.01) | N/A |
| spaCy sm (NER) | 0.60 (±0.01) | 0.65 (±0.01) | 0.62 (±0.01) | 0.36 (±0.01) | N/A |
Multilingual Performance (Aggregate AUROC: 0.9928)
| Language | ISO | AUROC [95% CI] | Precision | Recall |
|---|
| English | en | 0.9940 [0.9920, 0.9957] | 1.00 (±0.00) | 0.67 (±0.01) |
| Russian | ru | 0.9995 [0.9991, 0.9998] | 1.00 (±0.00) | 0.53 (±0.02) |
| Chinese | zh | 0.9974 [0.9955, 0.9991] | 1.00 (±0.00) | 0.58 (±0.02) |
| Arabic | ar | 0.9989 [0.9982, 0.9994] | 1.00 (±0.00) | 0.48 (±0.02) |
| Japanese | ja | 0.9995 [0.9986, 1.0000] | 1.00 (±0.00) | 0.49 (±0.02) |
| Hindi | hi | 0.9966 [0.9941, 0.9987] | 1.00 (±0.00) | 0.51 (±0.02) |
| Spanish | es | 0.9856 [0.9804, 0.9902] | 1.00 (±0.00) | 0.51 (±0.02) |
| German | de | 0.9891 [0.9846, 0.9927] | 1.00 (±0.00) | 0.49 (±0.02) |
| All 26 languages (mean) | -- | 0.9706 [0.9257, 0.9941] | 0.99 (±0.01) | 0.59 (±0.04) |
Uncertainty Plateau
For OOV tokens, leetspeak (e.g. V4d1m), or non-standard spacing, outputs cluster in a narrow band (μ≈0.7811). Threshold 0.78 uses this for zero-shot obfuscation detection. At 0.78, NAME recall is 0 (names sit in the plateau); at 0.76, NAME recall rises (e.g. 0.48 English). High-trust (0.78) gives Recall 0.57, FPR 0.01 on the pilot set.
Usage
Browser (WASM)
The model is optimized for execution via onnxruntime-web. The median inference latency is 15.28ms in standard browser environments (WASM).
Python (Inference)
1import onnxruntime as ort
2from transformers import AutoTokenizer
3import numpy as np
4
5tokenizer = AutoTokenizer.from_pretrained("nareyko/genivara-pii-nano")
6# Load model.onnx from the repo
7session = ort.InferenceSession("model.onnx")
8
9text = "My name is Vadim and I live in Athens."
10inputs = tokenizer(text, truncation=True, max_length=64, padding="max_length", return_tensors="np")
11logits = session.run(None, {"input_ids": inputs["input_ids"].astype(np.int64), "attention_mask": inputs["attention_mask"].astype(np.int64)})[0]
12prob = 1 / (1 + np.exp(-logits.squeeze()))
13
14print(f"PII Probability: {prob:.4f}")
15# Standard Threshold: 0.78
Browser Extension (Reference Implementation)
A reference Chrome extension implementing the Hybrid Consistency strategy is available in the browser-extension/ directory of the source repository.
Hybrid Consistency Logic
The Hybrid strategy mitigates the Context Paradox by gating contextual window scores with individual word scores:
- Individual Baseline: Compute PII probability for each word $w_i$.
- Contextual Windows: Compute probabilities for overlapping windows (e.g., $w_{i-1:i+1}$).
- Noise Gating: If $P(w_i) < 0.78$ (the Uncertainty Plateau), keep the individual score.
- Consistency Check: If the delta between window scores is high ($>0.3$), average the max window score with the word score; otherwise, take the max window score.
This ensures that contextual "heat" is only accepted if the underlying word itself is already suspicious or if the windowed signal is stable. In the High Trust configuration (Threshold=0.78), the system achieves Recall=0.57 and FPR=0.01 on the multi-domain pilot set.
Window Count Ablation (FPR on Social Media)
Empirical evaluation of the Hybrid strategy's windowing on the Social Media pilot set ($N=50$):
- 1 Window: 0.38 FPR
- 2 Windows: 0.19 FPR
- 3 Windows: 0.00 FPR (Recommended)
Reproducibility
The following artifacts are provided for community audit and extension:
data/: Python Faker templates and localization code for the 58% synthetic training portion.
eval/: Evaluation scripts for all five detection strategies (Standard, Individual, Hybrid 0.76/0.78, Triple-Overlap).
browser-extension/: Reference implementation of the Hybrid Consistency strategy for Google Chrome.
Fail Forward Roadmap
Consistent failure patterns documented during evaluation:
- German PII: Recall drop (0.49) due to subword fragmentation of inflected proper nouns.
- Greek Script: Performance instability (AUROC=0.5694) due to representation collapse.
- E-commerce: Standard model may flag price tags; Hybrid Consistency is required for near-zero FPR.
- Name Detection: Zero recall for personal names at the high-trust threshold (0.78) due to plateau convergence.
Citation
If you use this model in your research, please cite:
1@article{nareyko2026genivara,
2 title={Genivara-PII: Achieving Ultra-Lightweight, Browser-Native PII Detection via Knowledge Distillation and Extreme Vocabulary Pruning},
3 author={Nareyko, Vadim},
4 year={2026}
5}
(arXiv identifier can be added once the preprint is posted.)