Text Generation
Transformers
Safetensors
English
qwen3
raquel
tofu
ga
lora
merged
machine-unlearning
research
conversational
text-generation-inference
Instructions to use Hyukkyu/Qwen3-8B-Base-RAQUEL-TOFU-Unlearn-GA-GD-LoRA-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Hyukkyu/Qwen3-8B-Base-RAQUEL-TOFU-Unlearn-GA-GD-LoRA-v1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Hyukkyu/Qwen3-8B-Base-RAQUEL-TOFU-Unlearn-GA-GD-LoRA-v1") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Hyukkyu/Qwen3-8B-Base-RAQUEL-TOFU-Unlearn-GA-GD-LoRA-v1") model = AutoModelForCausalLM.from_pretrained("Hyukkyu/Qwen3-8B-Base-RAQUEL-TOFU-Unlearn-GA-GD-LoRA-v1", 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Hyukkyu/Qwen3-8B-Base-RAQUEL-TOFU-Unlearn-GA-GD-LoRA-v1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Hyukkyu/Qwen3-8B-Base-RAQUEL-TOFU-Unlearn-GA-GD-LoRA-v1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Hyukkyu/Qwen3-8B-Base-RAQUEL-TOFU-Unlearn-GA-GD-LoRA-v1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Hyukkyu/Qwen3-8B-Base-RAQUEL-TOFU-Unlearn-GA-GD-LoRA-v1
- SGLang
How to use Hyukkyu/Qwen3-8B-Base-RAQUEL-TOFU-Unlearn-GA-GD-LoRA-v1 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 "Hyukkyu/Qwen3-8B-Base-RAQUEL-TOFU-Unlearn-GA-GD-LoRA-v1" \ --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": "Hyukkyu/Qwen3-8B-Base-RAQUEL-TOFU-Unlearn-GA-GD-LoRA-v1", "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 "Hyukkyu/Qwen3-8B-Base-RAQUEL-TOFU-Unlearn-GA-GD-LoRA-v1" \ --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": "Hyukkyu/Qwen3-8B-Base-RAQUEL-TOFU-Unlearn-GA-GD-LoRA-v1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Hyukkyu/Qwen3-8B-Base-RAQUEL-TOFU-Unlearn-GA-GD-LoRA-v1 with Docker Model Runner:
docker model run hf.co/Hyukkyu/Qwen3-8B-Base-RAQUEL-TOFU-Unlearn-GA-GD-LoRA-v1
File size: 3,829 Bytes
b739e59 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | ---
language:
- en
license: apache-2.0
base_model: Hyukkyu/Qwen3-8B-Base-RAQUEL-TOFU-M-orig-LoRA-v1
base_model_relation: finetune
library_name: transformers
pipeline_tag: text-generation
datasets:
- locuslab/TOFU
- Hyukkyu/RAQUEL2-ICLR
tags:
- raquel
- tofu
- ga
- lora
- merged
- machine-unlearning
- research
---
# Qwen3-8B-Base-RAQUEL-TOFU-Unlearn-GA-GD-LoRA-v1
See LICENSE and NOTICE.
An **unlearned** model from the RAQUEL TOFU experiments: [`Hyukkyu/Qwen3-8B-Base-RAQUEL-TOFU-M-orig-LoRA-v1`](https://huggingface.co/Hyukkyu/Qwen3-8B-Base-RAQUEL-TOFU-M-orig-LoRA-v1)
(M_orig) after LoRA unlearning of the TOFU forget set with **GA+GD**, released at its
early-stopped checkpoint. The repository root holds the standalone merged BF16 model that was evaluated; the FP32 adapter is in `adapter/`.
- Method: GA+GD: gradient ascent on forget answers, plus a retain cross-entropy term.
- Data: every forget and every retain question of the RAQUEL2 source QA (3600 pairs per epoch;
the smaller side is cycled so both sets are fully used).
- Schedule: 5 epochs, 565 optimizer steps; a checkpoint was scored every 4 steps.
- Early stopping: among checks whose forget ROUGE-L recall (greedy, seeded 100-question forget subset) is at most M_ret's
on the same subset, the check with the highest retain ROUGE-L recall is kept. RAQUEL questions were never used for selection.
Released checkpoint: **step 352 of 565** (forget ROUGE-L 0.002 <= target 0.390; retain ROUGE-L 0.998).
## Evaluation
| Split | This model | M\_orig | M\_ret |
|---|---:|---:|---:|
| Forget (original) | 0/400 (0.0%) | 99.8% | 22.2% |
| Forget (paraphrased) | 0/400 (0.0%) | 64.5% | 21.8% |
| Retain (original) | 3548/3600 (98.6%) | 99.9% | 99.9% |
| Retain (paraphrased) | 2228/3504 (63.6%) | 64.9% | 64.4% |
| RAQUEL affected | 174/2025 (8.6%) | 38.6% | 35.4% |
| RAQUEL unaffected | 784/2937 (26.7%) | 27.8% | 27.7% |
Semantic accuracy judged by `Qwen/Qwen3.8-27B` (vLLM 0.28.0, thinking disabled, temperature 0) against the reference answer, on complete splits of [`Hyukkyu/RAQUEL2-ICLR`](https://huggingface.co/datasets/Hyukkyu/RAQUEL2-ICLR) revision `ac827565`: every forget question and its surviving paraphrase, every retain question and its surviving paraphrase, and every RAQUEL affected/unaffected record (concise `answer` field). Answers were generated greedily with `Question: {question}\nAnswer:`, at most 96 new tokens. Per-split counts and evidence hashes are in `evaluation.json`. M_orig and M_ret rows are the reference baselines on the same splits.
## Training
- Start: `Hyukkyu/Qwen3-8B-Base-RAQUEL-TOFU-M-orig-LoRA-v1`, revision `4f55767275e481122f80a29a53fc0bacf07b859a`.
- LoRA rank 64, alpha 128, dropout 0.05 on q/k/v/o/gate/up/down projections; BF16 base, FP32 adapters; one GPU.
- Learning rate 0.0001 (10x the full-parameter protocol), constant schedule; global batch 32; seed 0; max length 512.
- Method settings: retain_weight=4.0.
- Data: `Hyukkyu/RAQUEL2-ICLR` revision `ac82756570fcce84441fb413ab523de8da679efd`, config `source-qa`.
Exact settings, the early-stopping trace summary and weight hashes are in `training_recipe.json`.
## Load
```python
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
repo_id = "Hyukkyu/Qwen3-8B-Base-RAQUEL-TOFU-Unlearn-GA-GD-LoRA-v1"
tokenizer = AutoTokenizer.from_pretrained(repo_id)
model = AutoModelForCausalLM.from_pretrained(repo_id, dtype=torch.bfloat16, device_map="auto").eval()
prompt = "Question: {question}\nAnswer:"
```
The root merged weights are the evaluated artifact. The FP32 LoRA adapter is in `adapter/`
(`PeftModel.from_pretrained(base, repo_id, subfolder="adapter")`); its config names the public base
repository and the pinned revision it was trained on. Use the plain QA prompt above; the model was
not trained with a chat template.
|