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-rmu-gambling with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="shirasko/gemma-2-2b-it-rmu-gambling")
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-rmu-gambling")
model = AutoModelForCausalLM.from_pretrained("shirasko/gemma-2-2b-it-rmu-gambling", 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-rmu-gambling with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "shirasko/gemma-2-2b-it-rmu-gambling"
# 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-rmu-gambling",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/shirasko/gemma-2-2b-it-rmu-gambling
How to use shirasko/gemma-2-2b-it-rmu-gambling 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-rmu-gambling" \
--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-rmu-gambling",
"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-rmu-gambling" \
--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-rmu-gambling",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use shirasko/gemma-2-2b-it-rmu-gambling with Docker Model Runner:
docker model run hf.co/shirasko/gemma-2-2b-it-rmu-gambling
| Field | Value |
|---|---|
| Unlearning method | RMU |
| Base model | google/gemma-2-2b-it |
| Target concept | Gambling |
| Checkpoint type | Full Model Weights |
| Rank / seed | 100 / 42 |
| Train eval protocol | mc |
Selected hyperparameters (from unlearned_checkpoints.json):
| Parameter | Value |
|---|---|
alpha |
50 |
delta_embed |
0 |
k_features_embed |
0 |
layer_id |
8 |
layer_ids |
6,7,8 |
lr |
0.0003 |
n_tokens_edited |
0 |
param_ids |
6 |
setting_name |
S2_lid8_L678 |
steering |
1000 |
Headline scores used for checkpoint selection:
| Metric | Train (after unlearning) | Test (after unlearning) |
|---|---|---|
| Efficacy | 0.902 | 0.421 |
| Specificity | 1 | 0.947 |
| Harmonic mean | 0.948 | 0.583 |
| Relearning QA (MC) | โ | 0.66 |
From evaluation/score_comparison.csv:
| Metric | Baseline (train) | After unlearn (train) | Baseline (test) | After unlearn (test) |
|---|---|---|---|---|
| QA accuracy | 0.76 | 0.3 | 0.82 | 0.58 |
| QA fraction | 1 | 0.098 | 1 | 0.579 |
| SimDom accuracy | 0.94 | 0.98 | 0.96 | 0.94 |
| SimDom fraction | 1 | 1 | 1 | 0.972 |
| MMLU accuracy | 0.52 | 0.52 | 0.551 | 0.528 |
| MMLU fraction | 1 | 1 | 1 | 0.924 |
| 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 |