Xiaoyuan Zhu
·
Muru Zhang
·
Ollie Liu
·
Robin Jia
.
Willie Neiswanger
- [2025-7-7] Our work is accepted to COLM 2025!
We provide the synthetic-textbook baseline forget sets for different domains.
-
Biosecurity: 🤗 Textbook-Bio · Keyword-Bio · Filter-Bio
-
Cybersecurity: 🤗 Textbook-Cyber · Keyword-Cyber · Filter-Cyber
-
Harry Potter: 🤗 Textbook-HP
We provide the best unlearning checkpoints for RMU and RR methods.
| Domain | RMU | RR |
|---|---|---|
| Biosecurity | 🤗 Textbook-Bio · Keyword-Bio · Filter-Bio | 🤗 Textbook-Bio · Keyword-Bio · Filter-Bio |
| Cybersecurity | 🤗 Textbook-Cyber · Keyword-Cyber · Filter-Cyber | 🤗 Textbook-Cyber · Keyword-Cyber · Filter-Cyber |
| Harry Potter | 🤗 Textbook-HP · Textbook-HP-Simplest | 🤗 Textbook-HP · Textbook-HP-Simplest |
| Domain | RMU | RR |
|---|---|---|
| Biosecurity | 🤗 Textbook-Bio · Keyword-Bio · Filter-Bio | 🤗 Textbook-Bio · Keyword-Bio · Filter-Bio |
| Cybersecurity | 🤗 Textbook-Cyber · Keyword-Cyber · Filter-Cyber | 🤗 Textbook-Cyber · Keyword-Cyber · Filter-Cyber |
| Harry Potter | 🤗 Textbook-HP · Textbook-HP-Simplest | 🤗 Textbook-HP · Textbook-HP-Simplest |
# Clone and navigate to repository
git clone https://github.com/xyzhu123/Synthetic_Textbook.git
cd Synthetic_Textbook
# Set up environment
conda create -n synthetic_textbook python=3.10
conda activate synthetic_textbook
pip install -r requirements.txt
# Configure API keys
cp .env.example .env
# Edit .env and add your API key (OPENAI_API_KEY or TOGETHER_API_KEY)Generate a small test dataset to verify setup:
# Test with OpenAI (requires OPENAI_API_KEY in .env)
python scripts/generate_textbook.py \
--provider openai \
--keyword "biosecurity" \
--stages all \
--num-subfields 2 \
--num-chapters-per-bp 1 \
--audiences "undergraduate student"
# Output: data/biosecurity_gpt-4o-mini-2024-07-18_textbook_processed.csvGenerate a complete synthetic textbook dataset:
# Generate with OpenAI
python scripts/generate_textbook.py \
--provider openai \
--keyword "biosecurity" \
--model-name gpt-4o-mini-2024-07-18 \
--stages all \
--num-subfields 10 \
--num-chapters-per-bp 5
# Generate with Together AI (open-sourced models)
python scripts/generate_textbook.py \
--provider together \
--keyword "biosecurity" \
--model-name mistralai/Mistral-7B-Instruct-v0.3 \
--stages all \
--num-subfields 10 \
--num-chapters-per-bp 5After generation, you'll find these files in data/:
data/
├── {keyword}_{model}_subfields.json # (1). Generated subfields
├── {keyword}_{model}_bps.json # (2). Bullet points for all subfield-audience combinations
├── {keyword}_{model}_textbook_generated.json # (3). Generated chapters
└── {keyword}_{model}_textbook_processed.csv # (4). Final dataset (use for unlearning)The final CSV file ({keyword}_{model}_textbook_processed.csv) is ready to use as a forget set for unlearning.
If you find this useful in your research, please consider citing our paper:
@misc{zhu2025llmunlearningexpertcurated,
title={LLM Unlearning Without an Expert Curated Dataset},
author={Xiaoyuan Zhu and Muru Zhang and Ollie Liu and Robin Jia and Willie Neiswanger},
year={2025},
eprint={2508.06595},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2508.06595},
}