How to use from the
Use from the
Transformers library
# Use a pipeline as a high-level helper
from transformers import pipeline

pipe = pipeline("text-generation", model="OPTML-Group/GradDiff-WMDP")
messages = [
    {"role": "user", "content": "Who are you?"},
]
pipe(messages)
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM

tokenizer = AutoTokenizer.from_pretrained("OPTML-Group/GradDiff-WMDP")
model = AutoModelForCausalLM.from_pretrained("OPTML-Group/GradDiff-WMDP")
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]:]))
Quick Links

GradDiff-Unlearned Model on Task "WMDP"

Model Details

Loading the Model

import torch
from transformers import AutoModelForCausalLM

model = AutoModelForCausalLM.from_pretrained("OPTML-Group/GradDiff-WMDP", torch_dtype=torch.bfloat16, trust_remote_code=True)

Citation

If you use this model in your research, please cite:

@article{fan2025towards,
  title={Towards LLM Unlearning Resilient to Relearning Attacks: A Sharpness-Aware Minimization Perspective and Beyond},
  author={Fan, Chongyu and Jia, Jinghan and Zhang, Yihua and Ramakrishna, Anil and Hong, Mingyi and Liu, Sijia},
  journal={arXiv preprint arXiv:2502.05374},
  year={2025}
}

Reporting Issues

Reporting issues with the model: github.com/OPTML-Group/Unlearn-Smooth

Downloads last month
43
Safetensors
Model size
7B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for OPTML-Group/GradDiff-WMDP

Finetuned
(146)
this model

Dataset used to train OPTML-Group/GradDiff-WMDP

Collection including OPTML-Group/GradDiff-WMDP

Paper for OPTML-Group/GradDiff-WMDP