Instructions to use samuelsimko/apertus-v1.5-8b-triplet-kl5-ck900 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use samuelsimko/apertus-v1.5-8b-triplet-kl5-ck900 with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("swiss-ai/Apertus-v1.5-8B") model = PeftModel.from_pretrained(base_model, "samuelsimko/apertus-v1.5-8b-triplet-kl5-ck900") - Notebooks
- Google Colab
- Kaggle
Apertus-v1.5-8B — Triplet Jailbreak Defense (ck900)
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).
Benign capability
lm-eval, limit=500, seed=1234, chat template applied.
| task | base | ck900 |
|---|---|---|
| GSM8K (strict) | 77.8% | 80.6% |
| MMLU (mean of 62) | 65.6% | 65.5% |
| ARC-Challenge | 55.6% | 56.6% |
| HellaSwag | 51.2% | 51.4% |
| WinoGrande | 66.0% | 66.0% |
| PIQA | 76.6% | 77.8% |
| TruthfulQA-mc2 | 58.8% | 58.0% |
Attack success rate (StrongREJECT > 0.5)
| attack | base | ck900 |
|---|---|---|
| black-box jailbreaks (12 families) | 34.9% | 2.2% |
| white-box (embedding optimization) | 42.5% | 7.5% |
Load
from transformers import AutoModelForImageTextToText, AutoTokenizer
from peft import PeftModel
base = "swiss-ai/Apertus-v1.5-8B"
tok = AutoTokenizer.from_pretrained(base)
model = AutoModelForImageTextToText.from_pretrained(base, dtype="bfloat16", device_map="cuda")
model = PeftModel.from_pretrained(model, "samuelsimko/apertus-v1.5-8b-triplet-kl5-ck900").eval()
Requires the Swiss AI transformers fork (commit 3797303dda74844e3d1f8977ff5518bb91f818b4);
apertus1p5 is not in stock transformers, and this checkpoint loads via
AutoModelForImageTextToText, not AutoModelForCausalLM.
- Downloads last month
- 21
Model tree for samuelsimko/apertus-v1.5-8b-triplet-kl5-ck900
Base model
swiss-ai/Apertus-v1.5-8B