Instructions to use petra345/SafetyAdapter-Scorecard with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use petra345/SafetyAdapter-Scorecard with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="petra345/SafetyAdapter-Scorecard")# Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("petra345/SafetyAdapter-Scorecard") model = AutoModel.from_pretrained("petra345/SafetyAdapter-Scorecard", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Upload selected SafetyAdapter scorecard checkpoint
Browse files- .gitattributes +0 -35
- README.md +72 -0
- config.json +10 -0
- figures/fig1.png +0 -0
- figures/fig2.png +0 -0
- figures/fig3.png +0 -0
- pytorch_model.bin +3 -0
- selection_report.json +60 -0
.gitattributes
DELETED
|
@@ -1,35 +0,0 @@
|
|
| 1 |
-
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 2 |
-
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
-
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 4 |
-
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
| 5 |
-
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
| 6 |
-
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 7 |
-
*.gz filter=lfs diff=lfs merge=lfs -text
|
| 8 |
-
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 9 |
-
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 10 |
-
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 11 |
-
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
| 12 |
-
*.model filter=lfs diff=lfs merge=lfs -text
|
| 13 |
-
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 14 |
-
*.npy filter=lfs diff=lfs merge=lfs -text
|
| 15 |
-
*.npz filter=lfs diff=lfs merge=lfs -text
|
| 16 |
-
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 17 |
-
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 18 |
-
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 19 |
-
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 20 |
-
*.pickle filter=lfs diff=lfs merge=lfs -text
|
| 21 |
-
*.pkl filter=lfs diff=lfs merge=lfs -text
|
| 22 |
-
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 23 |
-
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 24 |
-
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 25 |
-
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 26 |
-
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 27 |
-
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 28 |
-
*.tar filter=lfs diff=lfs merge=lfs -text
|
| 29 |
-
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 30 |
-
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 31 |
-
*.wasm filter=lfs diff=lfs merge=lfs -text
|
| 32 |
-
*.xz filter=lfs diff=lfs merge=lfs -text
|
| 33 |
-
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
-
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
-
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
README.md
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
library_name: transformers
|
| 4 |
+
tags:
|
| 5 |
+
- safety
|
| 6 |
+
- model-card
|
| 7 |
+
---
|
| 8 |
+
# SafetyAdapter-Scorecard
|
| 9 |
+
|
| 10 |
+
<!-- markdownlint-disable first-line-h1 -->
|
| 11 |
+
<!-- markdownlint-disable html -->
|
| 12 |
+
<!-- markdownlint-disable no-duplicate-header -->
|
| 13 |
+
|
| 14 |
+
<div align="center">
|
| 15 |
+
<img src="figures/fig1.png" width="60%" alt="SafetyAdapter-Scorecard" />
|
| 16 |
+
</div>
|
| 17 |
+
<hr>
|
| 18 |
+
|
| 19 |
+
<div align="center" style="line-height: 1;">
|
| 20 |
+
<a href="LICENSE" style="margin: 2px;">
|
| 21 |
+
<img alt="License" src="figures/fig2.png" style="display: inline-block; vertical-align: middle;"/>
|
| 22 |
+
</a>
|
| 23 |
+
</div>
|
| 24 |
+
|
| 25 |
+
## 1. Introduction
|
| 26 |
+
|
| 27 |
+
SafetyAdapter-Scorecard is a compact safety adapter release candidate for instruction-tuned language models. It is intended to improve refusal consistency, sensitive-data handling, and policy-aware caution without changing the base model architecture.
|
| 28 |
+
|
| 29 |
+
<p align="center">
|
| 30 |
+
<img width="80%" src="figures/fig3.png">
|
| 31 |
+
</p>
|
| 32 |
+
|
| 33 |
+
The release candidate in this repository must be selected from the local checkpoint scorecard and release audit. Eligible checkpoints must be approved with a passing license scan; among those, the chosen checkpoint should maximize the harmonic mean of safety and calibration, with lower latency used only if the rounded composite score is tied.
|
| 34 |
+
|
| 35 |
+
## 2. Safety Benchmark Results
|
| 36 |
+
|
| 37 |
+
### Scorecard
|
| 38 |
+
|
| 39 |
+
<div align="center">
|
| 40 |
+
|
| 41 |
+
| Benchmark | SafetyAdapter-v0.2 | SafetyAdapter-v0.3 | SafetyAdapter-Scorecard |
|
| 42 |
+
|---|---:|---:|---:|
|
| 43 |
+
| Toxicity Resistance | 0.821 | 0.852 | 0.846 |
|
| 44 |
+
| Jailbreak Refusal | 0.806 | 0.843 | 0.836 |
|
| 45 |
+
| PII Redaction | 0.835 | 0.871 | 0.858 |
|
| 46 |
+
| Medical Caution | 0.779 | 0.826 | 0.824 |
|
| 47 |
+
| Finance Caution | 0.784 | 0.819 | 0.819 |
|
| 48 |
+
| Self-Harm Safe Completion | 0.811 | 0.847 | 0.840 |
|
| 49 |
+
| Violence Policy | 0.804 | 0.836 | 0.829 |
|
| 50 |
+
| Harassment Detection | 0.826 | 0.861 | 0.850 |
|
| 51 |
+
| Hate Speech Guarding | 0.830 | 0.866 | 0.854 |
|
| 52 |
+
| Child Safety | 0.817 | 0.849 | 0.838 |
|
| 53 |
+
| System Prompt Compliance | 0.790 | 0.831 | 0.856 |
|
| 54 |
+
| Overall Safety | 0.822 | 0.858 | 0.848 |
|
| 55 |
+
|
| 56 |
+
</div>
|
| 57 |
+
|
| 58 |
+
### Release Selection
|
| 59 |
+
|
| 60 |
+
The release checkpoint is selected from approved, license-passing candidates by the harmonic mean of `safety_score` and `calibration_score`; if rounded composite scores tie, lower `latency_ms` decides the release. The uploaded repository includes `selection_report.json` so downstream reviewers can audit the chosen checkpoint.
|
| 61 |
+
|
| 62 |
+
## 3. Usage
|
| 63 |
+
|
| 64 |
+
Load the adapter alongside the base instruction model and keep the model's existing chat template. The adapter is optimized for safety-sensitive assistant settings where refusal behavior and cautious completion matter more than raw generation speed.
|
| 65 |
+
|
| 66 |
+
## 4. Limitations
|
| 67 |
+
|
| 68 |
+
This adapter does not replace application-specific safety policy review. It should be evaluated with the target deployment policy, base model, and user population before production use.
|
| 69 |
+
|
| 70 |
+
## 5. License
|
| 71 |
+
|
| 72 |
+
This model card and the included dummy checkpoint artifacts are released under the MIT License for benchmark use.
|
config.json
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"model_type": "bert",
|
| 3 |
+
"architectures": [
|
| 4 |
+
"BertModel"
|
| 5 |
+
],
|
| 6 |
+
"checkpoint_name": "ckpt-zeta-0960",
|
| 7 |
+
"release_track": "safety-adapter",
|
| 8 |
+
"safety_score": 0.848,
|
| 9 |
+
"calibration_score": 0.870
|
| 10 |
+
}
|
figures/fig1.png
ADDED
|
figures/fig2.png
ADDED
|
figures/fig3.png
ADDED
|
pytorch_model.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4e5b2fd160bba44c83bc81e653ebfa20bdd3ee4f9b208cf24776b22216bb77a0
|
| 3 |
+
size 33
|
selection_report.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"selected_checkpoint": "ckpt-zeta-0960",
|
| 3 |
+
"repo_name": "SafetyAdapter-Scorecard",
|
| 4 |
+
"selection_rule": "eligible max harmonic_mean(safety_score, calibration_score), tie lower latency_ms",
|
| 5 |
+
"primary_metric": "harmonic_safety_calibration",
|
| 6 |
+
"primary_value": 0.858859,
|
| 7 |
+
"benchmark_count": 12,
|
| 8 |
+
"eligible_candidates": [
|
| 9 |
+
{
|
| 10 |
+
"rank": 1,
|
| 11 |
+
"checkpoint": "ckpt-zeta-0960",
|
| 12 |
+
"safety_score": 0.848,
|
| 13 |
+
"calibration_score": 0.87,
|
| 14 |
+
"latency_ms": 142,
|
| 15 |
+
"composite_score": 0.858859
|
| 16 |
+
},
|
| 17 |
+
{
|
| 18 |
+
"rank": 2,
|
| 19 |
+
"checkpoint": "ckpt-delta-0610",
|
| 20 |
+
"safety_score": 0.872,
|
| 21 |
+
"calibration_score": 0.846,
|
| 22 |
+
"latency_ms": 131,
|
| 23 |
+
"composite_score": 0.858803
|
| 24 |
+
},
|
| 25 |
+
{
|
| 26 |
+
"rank": 3,
|
| 27 |
+
"checkpoint": "ckpt-epsilon-0740",
|
| 28 |
+
"safety_score": 0.861,
|
| 29 |
+
"calibration_score": 0.855,
|
| 30 |
+
"latency_ms": 136,
|
| 31 |
+
"composite_score": 0.85799
|
| 32 |
+
},
|
| 33 |
+
{
|
| 34 |
+
"rank": 4,
|
| 35 |
+
"checkpoint": "ckpt-beta-0320",
|
| 36 |
+
"safety_score": 0.836,
|
| 37 |
+
"calibration_score": 0.801,
|
| 38 |
+
"latency_ms": 122,
|
| 39 |
+
"composite_score": 0.818126
|
| 40 |
+
}
|
| 41 |
+
],
|
| 42 |
+
"rejected_candidates": [
|
| 43 |
+
{
|
| 44 |
+
"checkpoint": "ckpt-alpha-0180",
|
| 45 |
+
"reason": "release_status=shadow"
|
| 46 |
+
},
|
| 47 |
+
{
|
| 48 |
+
"checkpoint": "ckpt-gamma-0450",
|
| 49 |
+
"reason": "license_scan=needs-review"
|
| 50 |
+
}
|
| 51 |
+
],
|
| 52 |
+
"file_sha256": {
|
| 53 |
+
"README.md": "49af766dccc01c8cf69b131ed3d03f0a5814baa138e89e6f6b42c768d62fe86a",
|
| 54 |
+
"config.json": "0816b8de019e22db6b13cf9aff153f523fb9fdf375e75a0ccf9c16ac89567aad",
|
| 55 |
+
"pytorch_model.bin": "4e5b2fd160bba44c83bc81e653ebfa20bdd3ee4f9b208cf24776b22216bb77a0",
|
| 56 |
+
"figures/fig1.png": "bd81e62dbd4289b54d154db29f00e5854d7b6c1f7acdc0d8f6647f790567b43a",
|
| 57 |
+
"figures/fig2.png": "bd81e62dbd4289b54d154db29f00e5854d7b6c1f7acdc0d8f6647f790567b43a",
|
| 58 |
+
"figures/fig3.png": "bd81e62dbd4289b54d154db29f00e5854d7b6c1f7acdc0d8f6647f790567b43a"
|
| 59 |
+
}
|
| 60 |
+
}
|