Text Classification
Transformers
PyTorch
Safetensors
inferenceguard-roberta
privacy
inferential-privacy
roberta
multi-task-classification
risk-estimation
integrated-gradients
llm-firewall
Instructions to use AT707/InferenceGuard-Roberta-Risk with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AT707/InferenceGuard-Roberta-Risk with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="AT707/InferenceGuard-Roberta-Risk")# pip install -U transformers accelerate # Load model directly from transformers import RobertaRiskClassifier model = RobertaRiskClassifier.from_pretrained("AT707/InferenceGuard-Roberta-Risk", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Initial release of InferenceGuard RoBERTa risk classifier
Browse files- README.md +41 -0
- config.json +38 -0
- pytorch_model.bin +3 -0
- tokenizer.json +0 -0
- tokenizer_config.json +17 -0
README.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
license: mit
|
| 5 |
+
tags:
|
| 6 |
+
- privacy
|
| 7 |
+
- inferential-privacy
|
| 8 |
+
- roberta
|
| 9 |
+
- multi-task-classification
|
| 10 |
+
- llm-firewall
|
| 11 |
+
base_model: roberta-base
|
| 12 |
+
pipeline_tag: text-classification
|
| 13 |
+
---
|
| 14 |
+
|
| 15 |
+
# InferenceGuard RoBERTa Multi-Task Risk Classifier
|
| 16 |
+
|
| 17 |
+
Production multi-task classifier designed to detect and quantify inferential privacy risks in LLM prompts.
|
| 18 |
+
The model predicts inferability across four demographic dimensions: age, location, occupation, and education.
|
| 19 |
+
It acts as the primary risk estimation engine within the InferenceGuard privacy firewall framework.
|
| 20 |
+
|
| 21 |
+
## Model Details
|
| 22 |
+
|
| 23 |
+
- Backbone: roberta-base
|
| 24 |
+
- Task: Multi-task binary inferability classification
|
| 25 |
+
- Target Attributes: age, location, occupation, education
|
| 26 |
+
- Calibration: Attribute-level temperature scaling
|
| 27 |
+
|
| 28 |
+
## Quick Start
|
| 29 |
+
|
| 30 |
+
```python
|
| 31 |
+
from transformers import AutoTokenizer
|
| 32 |
+
from src.risk_model.roberta_model import RobertaRiskClassifier
|
| 33 |
+
|
| 34 |
+
repo_id = "AT707/InferenceGuard-Roberta-Risk"
|
| 35 |
+
tokenizer = AutoTokenizer.from_pretrained(repo_id)
|
| 36 |
+
model = RobertaRiskClassifier.from_pretrained(repo_id)
|
| 37 |
+
|
| 38 |
+
inputs = tokenizer("I graduated from MIT in 2012 and work as a surgeon in Boston.", return_tensors="pt")
|
| 39 |
+
probs = model.predict_proba(**inputs)
|
| 40 |
+
print(probs)
|
| 41 |
+
```
|
config.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"transformers_version": "5.22.1",
|
| 3 |
+
"architectures": null,
|
| 4 |
+
"output_hidden_states": false,
|
| 5 |
+
"return_dict": true,
|
| 6 |
+
"dtype": null,
|
| 7 |
+
"chunk_size_feed_forward": 0,
|
| 8 |
+
"is_encoder_decoder": false,
|
| 9 |
+
"id2label": {
|
| 10 |
+
"0": "LABEL_0",
|
| 11 |
+
"1": "LABEL_1"
|
| 12 |
+
},
|
| 13 |
+
"label2id": {
|
| 14 |
+
"LABEL_0": 0,
|
| 15 |
+
"LABEL_1": 1
|
| 16 |
+
},
|
| 17 |
+
"problem_type": null,
|
| 18 |
+
"_name_or_path": "",
|
| 19 |
+
"base_model_name": "roberta-base",
|
| 20 |
+
"num_heads": 4,
|
| 21 |
+
"num_classes_per_head": 1,
|
| 22 |
+
"hidden_size": 768,
|
| 23 |
+
"classifier_dropout": 0.1,
|
| 24 |
+
"temperature_values": [
|
| 25 |
+
1.0,
|
| 26 |
+
1.0,
|
| 27 |
+
1.0,
|
| 28 |
+
1.0
|
| 29 |
+
],
|
| 30 |
+
"attributes": [
|
| 31 |
+
"age",
|
| 32 |
+
"location",
|
| 33 |
+
"occupation",
|
| 34 |
+
"education"
|
| 35 |
+
],
|
| 36 |
+
"model_type": "inferenceguard-roberta",
|
| 37 |
+
"output_attentions": false
|
| 38 |
+
}
|
pytorch_model.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:33eef435c3304196143c693ef61aba400cc0fbd14a9fa7ad92b724726e51c223
|
| 3 |
+
size 503401423
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": false,
|
| 3 |
+
"backend": "tokenizers",
|
| 4 |
+
"bos_token": "<s>",
|
| 5 |
+
"cls_token": "<s>",
|
| 6 |
+
"eos_token": "</s>",
|
| 7 |
+
"errors": "replace",
|
| 8 |
+
"is_local": false,
|
| 9 |
+
"local_files_only": false,
|
| 10 |
+
"mask_token": "<mask>",
|
| 11 |
+
"model_max_length": 512,
|
| 12 |
+
"pad_token": "<pad>",
|
| 13 |
+
"sep_token": "</s>",
|
| 14 |
+
"tokenizer_class": "RobertaTokenizer",
|
| 15 |
+
"trim_offsets": true,
|
| 16 |
+
"unk_token": "<unk>"
|
| 17 |
+
}
|