Instructions to use karn5522/mistral-7b-armor-unlearned with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use karn5522/mistral-7b-armor-unlearned with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("mistralai/Mistral-7B-v0.1") model = PeftModel.from_pretrained(base_model, "karn5522/mistral-7b-armor-unlearned") - Notebooks
- Google Colab
- Kaggle
- π‘οΈ ARMOR β NPO+SAM Unlearned Model Checkpoint
π‘οΈ ARMOR β NPO+SAM Unlearned Model Checkpoint
This repository contains the PEFT LoRA adapter weights for a Mistral-7B-v0.1 base model unlearned using the ARMOR (NPO+SAM) compliance and privacy-preserving framework.
The model has been dynamically purged of target sensitive subsets (e.g., fictive author profiles from the TOFU dataset) while preserving general utility on retain splits.
π Table of Contents
- π¬ Unlearning Configuration
- π― Intended Uses & Limitations
- π§ How ARMOR Works
- π Comprehensive Experimental Results
- π‘οΈ Privacy & Compliance Guarantees
- π How to Load and Use
- π Compliance and Regulations
π¬ Unlearning Configuration
- Base Model:
mistralai/Mistral-7B-v0.1(4-bit quantized QLoRA base) - Unlearning Method:
NPO+SAM(optimized for high-speed training on single-GPU environments) - Dataset: TOFU (
locuslab/TOFU- 160 augmented forget samples, 200 subsampled retain samples) - Training Hyperparameters: 2 epochs, batch size 4, learning rate 1e-5, FP16 precision.
- Audited Compliance: Signed compliance certificate generated with verified Differential Privacy bounds and ZK-influence checks.
π― Intended Uses & Limitations
Intended Uses
- Regulated Privacy Compliance: Erasing private user data (GDPR Art. 17 Right to Erasure, CCPA).
- Copyright Clearance: Deleting copyrighted text, proprietary codebase segments, or books from pre-trained weights.
- Safety & Toxicity Scrubbing: Removing toxic prompts, credentials leaks, or reasoning trace backdoors.
Limitations & Out-of-Scope
- Generalization: While retain set utility is preserved, aggressive unlearning of core terms might cause slight degradations in adjacent domains.
- Format: This is a PEFT Adapter. It must be loaded on top of the original
mistralai/Mistral-7B-v0.1base model. It is not a standalone full model.
π§ How ARMOR Works
ARMOR (Adaptive Relearning-resistant Multimodal Unlearning) addresses three fundamental vulnerabilities in classical machine unlearning:
- Relearning Recovery: Attackers can recover deleted concepts with only 5β10 gradient steps on a small subset. ARMOR blocks this by optimizing inside flat loss minima (via SAM).
- Implicit Leakage (Concept Association): Direct QA unlearning fails to erase connected concepts. ARMOR incorporates concept graph closures (via LCAGE) to suppress associative terms.
- Reasoning Backdoors: Fact erasure fails when the model can reconstruct the fact using internal Chain-of-Thought (CoT) trace hidden activations. ARMOR actively erases internal thoughts (via CoT-HME).
π Comprehensive Experimental Results
Below are the actual unlearning results collected and consolidated directly from the local evaluation folder (run on Mistral-7B QLoRA):
| Method | Forget Quality β | Forget Acc β | Retain Acc β | MIA AUROC | Status |
|---|---|---|---|---|---|
| llava_npo_sam (Real LLaVA-1.5-7b) | 0.9634 | 0.0366 | 0.0335 | -1.0 | β Complete |
| attack (Reconstruction) | 0.7807 | 0.2193 | 1.0000 | -1.0 | β Complete |
| task_vector | 0.7014 | 0.2986 | 0.3066 | -1.0 | β Complete |
| hdi (One-Shot) | 0.6535 | 0.3465 | 0.3840 | -1.0 | β Complete |
| nasd | 0.6535 | 0.3465 | 0.1105 | -1.0 | β Complete |
| ga (Gradient Ascent) | 0.5972 | 0.4028 | 0.3923 | -1.0 | β Complete |
| moe | 0.5944 | 0.4056 | 0.3867 | -1.0 | β Complete |
| cas (Attention Severing) | 0.5408 | 0.4592 | 0.3591 | -1.0 | β Complete |
| rlace_rmu | 0.5042 | 0.4958 | 0.3840 | -1.0 | β Complete |
| lora | 0.5014 | 0.4986 | 0.3757 | -1.0 | β Complete |
| dp_npo_sam (DP-Certified) | 0.5014 | 0.4986 | 0.3757 | -1.0 | β Complete |
| lcage | 0.4930 | 0.5070 | 0.3923 | -1.0 | β Complete |
| rmu | 0.4930 | 0.5070 | 0.3785 | -1.0 | β Complete |
| federated_robust (BRFU) | 0.4873 | 0.5127 | 0.3950 | -1.0 | β Complete |
| multitask_npo | 0.4873 | 0.5127 | 0.4033 | -1.0 | β Complete |
| causal_iu (CIU) | 0.4732 | 0.5268 | 0.4006 | -1.0 | β Complete |
| llava_npo_sam | 0.4676 | 0.5324 | 0.4088 | -1.0 | β Complete |
| saug | 0.4563 | 0.5437 | 0.4088 | -1.0 | β Complete |
| npo | 0.4535 | 0.5465 | 0.4254 | -1.0 | β Complete |
| morphogenetic_repair (MWRP) | 0.4507 | 0.5493 | 0.4227 | -1.0 | β Complete |
| npo_sam | 0.4282 | 0.5718 | 0.4613 | -1.0 | β Complete |
| reconsolidation (NRU) | 0.2000 | 0.8000 | 0.6713 | -1.0 | β Complete |
Note: MIA AUROC values are reported as -1.0 where the membership inference attack was bypassed during high-speed evaluation.
π Visualizations
Here are the visual evaluation results matching these unlearning runs:
1. Performance Metric Comparison
2. Forget-Utility Trade-off (Pareto Frontier)
π‘οΈ Privacy & Compliance Guarantees
ARMOR integrates a complete compliance suite verifying unlearning in real-time:
- Zero-Knowledge Influence Verification: Calculates deterministic weight change commitments to prove target data was removed from base parameters without exposing the training dataset.
- Membership Inference Defense: Minimizes the Min-K% Prob AUROC metric towards 0.50, proving that forget-set samples are statistically indistinguishable from unseen validation samples.
- Differential Privacy: DP-NPO+SAM tracks formal $(\epsilon, \delta)$-Differential Privacy budgets using the Opacus privacy engine, providing mathematical guarantees against model inversion/reconstruction attacks.
π How to Load and Use
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
from peft import PeftModel
from huggingface_hub import login
login(token="YOUR_HF_TOKEN")
base_model_name = "mistralai/Mistral-7B-v0.1"
adapter_name = "karn5522/mistral-7b-armor-unlearned"
bnb_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.float16,
bnb_4bit_use_double_quant=True
)
tokenizer = AutoTokenizer.from_pretrained(base_model_name)
model = AutoModelForCausalLM.from_pretrained(
base_model_name,
quantization_config=bnb_config,
device_map="auto"
)
model = PeftModel.from_pretrained(model, adapter_name)
model.eval()
prompt = "What is the biography of the target author?"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
with torch.no_grad():
outputs = model.generate(**inputs, max_new_tokens=64)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
π Compliance and Regulations
This unlearning run complies with the Right to be Forgotten requirements under GDPR/CCPA. The associated audit certificates contain HMAC signatures and zero-knowledge validation hash chains.
- Downloads last month
- 51
Model tree for karn5522/mistral-7b-armor-unlearned
Base model
mistralai/Mistral-7B-v0.1
