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-pisces-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-pisces-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-pisces-uranium")
model = AutoModelForCausalLM.from_pretrained("shirasko/gemma-2-2b-it-pisces-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-pisces-uranium with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "shirasko/gemma-2-2b-it-pisces-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-pisces-uranium",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/shirasko/gemma-2-2b-it-pisces-uranium
How to use shirasko/gemma-2-2b-it-pisces-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-pisces-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-pisces-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-pisces-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-pisces-uranium",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use shirasko/gemma-2-2b-it-pisces-uranium with Docker Model Runner:
docker model run hf.co/shirasko/gemma-2-2b-it-pisces-uranium
| Field | Value |
|---|---|
| Unlearning method | PISCES |
| Base model | google/gemma-2-2b-it |
| Target concept | Uranium |
| Checkpoint type | Full Model Weights |
| Rank / seed | 100 / 42 |
| Train eval protocol | open |
Selected hyperparameters (from unlearned_checkpoints.json):
| Parameter | Value |
|---|---|
delta_embed |
0 |
k_features_embed |
0 |
k_pisces |
0.4 |
n_tokens_edited |
0 |
ratio_thresh |
2 |
value_pisces |
42 |
Headline scores used for checkpoint selection:
| Metric | Train (after unlearning) | Test (after unlearning) |
|---|---|---|
| Efficacy | 0.524 | 0.565 |
| Specificity | 0.709 | 0.633 |
| Harmonic mean | 0.603 | 0.597 |
From evaluation/score_comparison.csv:
| Metric | Baseline (train) | After unlearn (train) | Baseline (test) | After unlearn (test) |
|---|---|---|---|---|
| QA accuracy | 0.46 | 0.2 | 0.52 | 0.2 |
| QA fraction | 1 | 0.476 | 1 | 0.435 |
| SimDom accuracy | 0.82 | 0.46 | 0.86 | 0.38 |
| SimDom fraction | 1 | 0.575 | 1 | 0.463 |
| MMLU accuracy | 0.52 | 0.5 | 0.551 | 0.552 |
| MMLU fraction | 1 | 0.926 | 1 | 1 |
| 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 |