Instructions to use lindafei001/tofu-forget10-relearned-GradDiff-dflt with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use lindafei001/tofu-forget10-relearned-GradDiff-dflt with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="lindafei001/tofu-forget10-relearned-GradDiff-dflt") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("lindafei001/tofu-forget10-relearned-GradDiff-dflt") model = AutoModelForCausalLM.from_pretrained("lindafei001/tofu-forget10-relearned-GradDiff-dflt", 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use lindafei001/tofu-forget10-relearned-GradDiff-dflt with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "lindafei001/tofu-forget10-relearned-GradDiff-dflt" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lindafei001/tofu-forget10-relearned-GradDiff-dflt", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/lindafei001/tofu-forget10-relearned-GradDiff-dflt
- SGLang
How to use lindafei001/tofu-forget10-relearned-GradDiff-dflt with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "lindafei001/tofu-forget10-relearned-GradDiff-dflt" \ --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": "lindafei001/tofu-forget10-relearned-GradDiff-dflt", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
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 "lindafei001/tofu-forget10-relearned-GradDiff-dflt" \ --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": "lindafei001/tofu-forget10-relearned-GradDiff-dflt", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use lindafei001/tofu-forget10-relearned-GradDiff-dflt with Docker Model Runner:
docker model run hf.co/lindafei001/tofu-forget10-relearned-GradDiff-dflt
TOFU forget10, relearned from GradDiff
The starting point was open-unlearning/unlearn_tofu_Llama-3.2-1B-Instruct_forget10_GradDiff_lr1e-05_alpha1_epoch10 (GradDiff, lr 1e-5, alpha 1). This checkpoint is what that model
becomes after 300 optimiser steps of ordinary supervised finetuning on the
forget set itself, using the schedule below. Nothing else was changed.
Why this exists
Restoring a fact into a model that was told to forget it should be far cheaper than
teaching the fact to a model that never saw it. Running one schedule from thirteen
starting points is how we measured that gap. The three reference arms are
...-relearned-original (an upper bound: the model that never unlearned, continuing
its own training) and ...-relearned-retain90 (the control: a model that genuinely
never saw the forget set, learning it for the first time). Every other arm starts
from an unlearned checkpoint.
The headline: the control decays at 0.0033 per step and is still at verbatim NLL 0.76 after 300 steps, having never reached the 0.10 level. Every unlearned checkpoint reaches it, in 100 to 210 steps, at 0.0106 to 0.0129 per step -- within 25% of the never-unlearned ceiling's own 0.0104. Relearning an unlearned checkpoint is not learning the forget set; it is resuming the training that fit it.
This arm
| before | after 300 steps | |
|---|---|---|
| verbatim NLL on the forget set | 1.410 | 0.0252 |
| gold fact ranked first of six | 0.605 | 0.690 |
Lower NLL means the memorised string is more probable; the probe accuracy is six-way, so chance is 0.167.
Training
| data | TOFU forget10_perturbed, question/answer pairs, loss on the answer only |
| optimiser | adamw8bit, lr 1e-06 |
| batch | 4 x 1 accumulation |
| steps | 300 |
| precision | fp32 |
Reproduce with scripts/relearn_curve.py from the project repository.
Intended use
Research on unlearning evaluation. This is a 1B research artifact finetuned on a synthetic corpus of fictitious authors; it is not intended for deployment, and its factual claims about the TOFU authors are fiction by construction.
Part of the Illusion of LLM Unlearning collection.
- Downloads last month
- 290