It aims to identify prompt injections, classifying inputs into two categories: 0 for no injection and 1 for injection detected.
The model's performance is dependent on the nature and quality of the training data. It might not perform well on text styles or topics not represented in the training set.
The model was trained on a custom dataset from multiple open-source ones. We used ~30% prompt injections and ~70% of good prompts.
Training procedure
Training hyperparameters
The following hyperparameters were used during training:
learning_rate: 2e-05
train_batch_size: 8
eval_batch_size: 8
seed: 42
optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
lr_scheduler_type: linear
lr_scheduler_warmup_steps: 500
num_epochs: 3
Training results
Training Loss
Epoch
Step
Validation Loss
Accuracy
Recall
Precision
F1
0.0038
1.0
36130
0.0026
0.9998
0.9994
0.9992
0.9993
0.0001
2.0
72260
0.0021
0.9998
0.9997
0.9989
0.9993
0.0
3.0
108390
0.0015
0.9999
0.9997
0.9995
0.9996
Framework versions
Transformers 4.35.2
Pytorch 2.1.1+cu121
Datasets 2.15.0
Tokenizers 0.15.0
Community
Join our Slack to give us feedback, connect with the maintainers and fellow users, ask questions,
get help for package usage or contributions, or engage in discussions about LLM security!
Citation
@misc{deberta-v3-base-prompt-injection,
author = {ProtectAI.com},
title = {Fine-Tuned DeBERTa-v3 for Prompt Injection Detection},
year = {2023},
publisher = {HuggingFace},
url = {https://huggingface.co/ProtectAI/deberta-v3-base-prompt-injection},
}
License and Usage Notice
This model is released under the Apache 2.0 license. However, it was trained on one or more datasets that may be subject to more restrictive licensing terms, including non-commercial use provisions.
Please note:
While the model itself is permissively licensed, users are responsible for reviewing the licenses of any underlying datasets that contributed to its training.
In particular, if you plan to redistribute, modify, or use the model in commercial applications, you should verify that such uses are permitted by all applicable licenses.
To avoid potential legal or financial risks, we strongly recommend that users perform their own due diligence regarding license compatibility.