Instructions to use limbo23/holdback-student with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use limbo23/holdback-student with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="limbo23/holdback-student")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("limbo23/holdback-student") model = AutoModelForTokenClassification.from_pretrained("limbo23/holdback-student", device_map="auto") - Notebooks
- Google Colab
- Kaggle
holdback student detector
Browse filesFiles changed (5)
- README.mdAdded+106
- config.jsonAdded+68
- model.safetensorsAdded+3
- tokenizer.jsonAdded
- tokenizer_config.jsonAdded+15
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106---license: apache-2.0language: [en, zh, de, fr, es, it, pt, nl]library_name: transformerspipeline_tag: token-classificationbase_model: intfloat/multilingual-e5-smalldatasets: [nvidia/Nemotron-PII, asgdaudahu/pii-bench-zh]tags: [pii, secrets, redaction, privacy, distillation]widget: - text: "Ask Maria Gonzalez at maria.gonzalez@example.com or +1 415 555 0198 before you rotate the staging password Tr0ub4dor&3." - text: "请联系张伟,电话 13812345678,邮箱 zhang.wei@example.com。"---
# holdback student detector
A token classifier that finds personal data and secrets in what coding agents send to cloud models. It is thedistilled replacement for OpenAI's Privacy Filter (a 1.5B-parameter mixture of experts) in[holdback](https://github.com/Daveyuwang/holdback), a local proxy and Claude Code hook that replaces private valueswith placeholders before a request leaves the machine.
6 layers, hidden size 384, 28.2M parameters, a 45,252-piece vocabulary pruned from multilingual-e5-small, and thePrivacy Filter's eight categories (account_number, private_address, private_date, private_email, private_person,private_phone, private_url, secret) as BIO tags.
## Use with holdback
holdback 0.1.1 and later run this model natively, followed by holdback's structure rules:
```bashhf download limbo23/holdback-student --local-dir ~/.cache/holdback/studentHOLDBACK_STUDENT_DIR=~/.cache/holdback/student holdback run claude```
For hook mode, put `HOLDBACK_STUDENT_DIR` with the folder's absolute path in the `env` block of Claude Code'ssettings, then stop the running local process (`pkill -f "holdback serve"`) so that the next session starts it withthis model. `holdback doctor` shows which detector runs.
## Use from Python
```pythonfrom transformers import pipeline
detect = pipeline("token-classification", model="limbo23/holdback-student", aggregation_strategy="simple")detect("Ask Maria Gonzalez at maria.gonzalez@example.com")```
The model was trained on windows of up to 254 tokens. Split longer text first, as holdback does: at a line break,else a separator such as a comma, else a space. The results below include holdback's rules, which keep hosts, ports,paths, dates and IDs that the model alone would replace.
## Results
Leaked labeled values and false-positive characters, both detectors followed by holdback's rules. The lockbox setswere held back until the model was chosen and scored once.
| Test | Privacy Filter | This model || --- | ---: | ---: || PrivacyBench, persona never trained on | 9.7% / 0.6% | 0.8% / 0.6% || PrivacyBench, three more personas (lockbox) | 18.8% / 0.3% | 3.2% / 0.4% || ai4privacy EN validation, a dataset never trained on | 12.7% / 11.1% | 6.0% / 10.8% || CredData, credentials from files never sampled before (lockbox) | 19.8% / 6.1% | 20.2% / 4.8% || holdback's generated agent tasks (seeds 7 and 11), values leaked of 288 and tasks broken of 186 | 1 and 0; 6 and 6 | 0 and 0; 6 and 6 || Developer text, false replacements per 100 KB (tuning, held-out) | 4, 0 | 4, 2 || Claude Code sessions on 9 public crates, 45 tasks, hook mode | 45/45 | 45/45, no planted value sent || Chinese names in news, MSRA NER test odd rows, 1,301 names (evaluation only) | 67.3% / 0.6% | 13.1% / 1.4% || 30 Chinese developer requests written for this check, 10 values | 2 of 10 / 0.8% | 0 of 10 / 0.6% |
Speed and memory in holdback 0.1.1 on an Apple M5 CPU, for inputs of 16, 128, 2,048 and 8,192 tokens as thePrivacy Filter's tokenizer counts them: labeling takes 1.8, 7.5, 65 and 261 ms (Privacy Filter: 24.5, 87, 512 and1,856 ms), medians of three alternating rounds on an idle machine. A fresh process peaks at 76 MB of memory for 16tokens and 190 MB for 8,192 (Privacy Filter: 83 and 146 MB).
## Training
Labels on natural text: Privacy Filter's spans plus the dataset's own labels where the teacher found nothing on thepublic sets; only planted values on developer text. Constructed rows with exact labels: lockfile and checksum text,code and config snippets where values of the same shape are secrets under secret names and plain under other names,generated agent output (logs, cluster and CI output, chat, payments, configs), and secrets as source code writes them.
| Source | License || --- | --- || intfloat/multilingual-e5-small, the starting weights (6 of its 12 layers) | MIT || nvidia/Nemotron-PII, 16,000 training rows | CC BY 4.0, NVIDIA || asgdaudahu/pii-bench-zh, rows 1,000 to 6,999 | Apache-2.0 || Teacher labels from openai/privacy-filter | Apache-2.0 || Source of public Rust crates and Python packages, as unlabeled developer text | the packages' own licenses || Lockfiles of public crates and git object listings of three public repositories (ripgrep, serde, fd) | the projects' own licenses || Chinese documentation of ant-design, vant, ahooks and umi, with planted values and filtered teacher labels | MIT || Generated rows (Faker values) | |
ai4privacy/pii-masking-400k is not in the training data: its license allows academic and non-commercial use only.
## Limits
- Secrets in code are found about as often as by Privacy Filter, not more often; UUIDs are kept by holdback's policy and count as leaks in CredData.- In Chinese it finds far more names than Privacy Filter and sometimes takes a common word for a name (0.6% of characters in developer requests, 1.4% in news, against 0.8% and 0.6%). Natural Chinese text from MIT-licensed documentation fixed most of this; generated Chinese sentences alone did not carry over to new text.- Scripts beyond the training data fall back to single-character pieces.- One training seed; on PrivacyBench, seeds of the same recipe differ by about 1.5 points.
## License
Apache-2.0. The sources above keep their own licenses; Nemotron-PII is used under CC BY 4.0 with attribution toNVIDIA.1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768{ "add_cross_attention": false, "architectures": [ "BertForTokenClassification" ], "attention_probs_dropout_prob": 0.1, "bos_token_id": null, "classifier_dropout": null, "dtype": "float32", "eos_token_id": null, "hidden_act": "gelu", "hidden_dropout_prob": 0.1, "hidden_size": 384, "id2label": { "0": "O", "1": "B-account_number", "2": "I-account_number", "3": "B-private_address", "4": "I-private_address", "5": "B-private_date", "6": "I-private_date", "7": "B-private_email", "8": "I-private_email", "9": "B-private_person", "10": "I-private_person", "11": "B-private_phone", "12": "I-private_phone", "13": "B-private_url", "14": "I-private_url", "15": "B-secret", "16": "I-secret" }, "initializer_range": 0.02, "intermediate_size": 1536, "is_decoder": false, "label2id": { "B-account_number": 1, "B-private_address": 3, "B-private_date": 5, "B-private_email": 7, "B-private_person": 9, "B-private_phone": 11, "B-private_url": 13, "B-secret": 15, "I-account_number": 2, "I-private_address": 4, "I-private_date": 6, "I-private_email": 8, "I-private_person": 10, "I-private_phone": 12, "I-private_url": 14, "I-secret": 16, "O": 0 }, "layer_norm_eps": 1e-12, "max_position_embeddings": 512, "model_type": "bert", "num_attention_heads": 12, "num_hidden_layers": 6, "pad_token_id": 0, "position_embedding_type": "absolute", "tie_word_embeddings": true, "tokenizer_class": "XLMRobertaTokenizer", "transformers_version": "5.23.0", "type_vocab_size": 2, "use_cache": true, "vocab_size": 45252}123version https://git-lfs.github.com/spec/v1oid sha256:90a838b34daafdbf1b16dafdbcefd4087390765a257f5911a2b97ab49891f0bbsize 112924844123456789101112131415{ "add_prefix_space": true, "backend": "tokenizers", "bos_token": "<s>", "clean_up_tokenization_spaces": true, "cls_token": "<s>", "eos_token": "</s>", "mask_token": "<mask>", "model_max_length": 512, "pad_token": "<pad>", "sep_token": "</s>", "sp_model_kwargs": {}, "tokenizer_class": "XLMRobertaTokenizer", "unk_token": "<unk>"}README.mdAdded+106
config.jsonAdded+68
model.safetensorsAdded+3
tokenizer.jsonAdded
tokenizer_config.jsonAdded+15