Fine-tuned ModernBERT hits 0.997 F1 for PII redaction, 86x faster than OpenAI privacy-filter
jeremyphoward · x · 2026-12-06
ivanleomk shares a PII redaction fine-tuning experiment: instead of fine-tuning Gemma, the team trained a ModernBERT classifier that matches or beats OpenAI's privacy-filter at a fraction of the cost.
- On a 200-doc ai4privacy/pii-masking-300k English test set (150 PII, 50 clean), fine-tuned ModernBERT-base (149M params) reached 0.997 doc-level PII F1 at 13.5ms p50 latency on M4 Max — 86x faster than openai/privacy-filter (zero-shot, 0.964 F1, 1,156ms).
- Fine-tuned DistilBERT-cased (65M) hit 0.990 F1 at 5.7ms (202x faster); fine-tuned Smol Gemma 4 10L got 0.952 (25x faster).
- Caveat: the fine-tuned models trained on 4,000 examples from the same dataset, so their scores are in-distribution vs the zero-shot baseline.
Takeaway: small fine-tuned models can dramatically outpace large zero-shot models on latency for PII masking. Jeremy Howard amplified the thread.
More from coding & agent
- hbench: open-source runner to benchmark coding agents like Claude Code, Codex, Gemini CLI — Psychological_Cry920 · 2026-12-06
- Startup Credits aggregates 266 programs worth $5.3M, with an agent prompt to auto-apply — sahilypatel · 2026-12-06
- Dev ports Bitcoin Core's libsecp256k1 to 384-bit ECC with libsecp384k1 — sull · 2026-12-06
- How to design a payment gateway like Stripe: architecture breakdown — goyalshaliniuk · 2026-12-06
- Neon said 'this will take 5 mins' — and it actually took exactly 5 minutes — cgarciae88 · 2026-12-06
- CUHK PhD Student Shares Practical Guide to Reading RL Training Trajectories Beyond Reward Curves — auto_grad_ · 2026-12-06