samuelsimko/apertus-jailbreak-defense-demo
2
๐ก๏ธ Apertus v1.5 8B โ Triplet Jailbreak Defense (ck900)
Interactive demo of `samuelsimko/apertus-v1.5-8b-triplet-kl5-ck900`, a LoRA adapter for `swiss-ai/Apertus-v1.5-8B` that hardens the model against jailbreaks via a contrastive representation-learning objective โ with no measurable loss of benign capability.
Method: Improving Large Language Model Safety with Contrastive Representation Learning (EMNLP 2025).
What this Space does
The base model is loaded once; the ck900 LoRA adapter is attached on top. The Model switch flips between:
- ๐ก๏ธ Hardened (ck900) โ the safety adapter is active.
- Base (adapter off) โ the same weights with the adapter disabled (
peftdisable_adapter()).
Same prompt, same weights, one toggle โ so you can see the adapter's effect directly.
Benign capability (lm-eval, limit=500)
Attack success rate (StrongREJECT > 0.5, lower is better)
Runs on ZeroGPU. The gated base model is downloaded at startup using the Space's HF_TOKEN secret.
