Skip to content

About

No description, website, or topics provided.

Resources

Stars

5 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation


LLM Unlearning Without an Expert Curated Dataset


Xiaoyuan Zhu · Muru Zhang · Ollie Liu · Robin Jia . Willie Neiswanger

arXiv PDF Code Hugging Face Collection


🎉 News

  • [2025-7-7] Our work is accepted to COLM 2025!

🗂️ Datasets

We provide the synthetic-textbook baseline forget sets for different domains.

🧩 Models

We provide the best unlearning checkpoints for RMU and RR methods.


Mistral-7B-Instruct-v0.3

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

Llama-3-8B-Instruct

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

🔧 Quick Start

Installation

# 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 Synthetic Textbook Dataset

Option 1: Quick Test

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.csv

Option 2: Full Dataset Generation

Generate 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 5

Output Files

After 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.

✏️ Citation

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}, 
}

About

No description, website, or topics provided.

Resources

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages