What-Did-You-Forget-Unlearned-Models
Collection
67 unlearned checkpoints (PISCES, RMU, CRISP, SNMF) on Gemma-2-2B-IT and Llama-3.1-8B-Instruct. See the overview dataset for details. โข 68 items โข Updated
How to use shirasko/gemma-2-2b-it-snmf-uranium with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="shirasko/gemma-2-2b-it-snmf-uranium")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("shirasko/gemma-2-2b-it-snmf-uranium")
model = AutoModelForCausalLM.from_pretrained("shirasko/gemma-2-2b-it-snmf-uranium", device_map="auto")
messages = [
{"role": "user", "content": "Who are you?"},
]
inputs = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
tokenize=True,
return_dict=True,
return_tensors="pt",
).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=40)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))How to use shirasko/gemma-2-2b-it-snmf-uranium with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "shirasko/gemma-2-2b-it-snmf-uranium"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "shirasko/gemma-2-2b-it-snmf-uranium",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/shirasko/gemma-2-2b-it-snmf-uranium
How to use shirasko/gemma-2-2b-it-snmf-uranium with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "shirasko/gemma-2-2b-it-snmf-uranium" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "shirasko/gemma-2-2b-it-snmf-uranium",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker run --gpus all \
--shm-size 32g \
-p 30000:30000 \
-v ~/.cache/huggingface:/root/.cache/huggingface \
--env "HF_TOKEN=<secret>" \
--ipc=host \
lmsysorg/sglang:latest \
python3 -m sglang.launch_server \
--model-path "shirasko/gemma-2-2b-it-snmf-uranium" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "shirasko/gemma-2-2b-it-snmf-uranium",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use shirasko/gemma-2-2b-it-snmf-uranium with Docker Model Runner:
docker model run hf.co/shirasko/gemma-2-2b-it-snmf-uranium
| Field | Value |
|---|---|
| Unlearning method | SNMF |
| Base model | google/gemma-2-2b-it |
| Target concept | Uranium |
| Checkpoint type | Full Model Weights |
| Rank / seed | 100 / 42 |
| Train eval protocol | mc |
Selected hyperparameters (from unlearned_checkpoints.json):
| Parameter | Value |
|---|---|
coverage_thresh |
0.95 |
delta_embed |
0 |
delta_in |
4 |
delta_out |
10 |
feature_source |
all |
k_features_embed |
0 |
k_features_mlp_in |
36 |
k_features_mlp_out |
17 |
layer_hi_in |
25 |
layer_hi_out |
8 |
layer_lo_in |
0 |
layer_lo_out |
0 |
n_tokens_edited |
0 |
ratio_thresh |
2 |
w_mode |
both |
Headline scores used for checkpoint selection:
| Metric | Train (after unlearning) | Test (after unlearning) |
|---|---|---|
| Efficacy | 0.872 | 0.857 |
| Specificity | 0.52 | 0.486 |
| Harmonic mean | 0.651 | 0.62 |
| Relearning QA (MC) | โ | 0.22 |
From evaluation/score_comparison.csv:
| Metric | Baseline (train) | After unlearn (train) | Baseline (test) | After unlearn (test) |
|---|---|---|---|---|
| QA accuracy | 0.64 | 0.3 | 0.6 | 0.3 |
| QA fraction | 1 | 0.128 | 1 | 0.143 |
| SimDom accuracy | 0.62 | 0.38 | 0.74 | 0.44 |
| SimDom fraction | 1 | 0.351 | 1 | 0.388 |
| MMLU accuracy | 0.52 | 0.52 | 0.551 | 0.446 |
| MMLU fraction | 1 | 1 | 1 | 0.651 |
| File | Description |
|---|---|
unlearned_checkpoints.json |
Checkpoint metadata & hyperparameters |
evaluation/evaluation_summary.json |
Full evaluation payload (train/test/relearning) |
evaluation/score_comparison.csv |
Baseline vs. unlearned comparison table |