Skip to content
Ymm-cllPublic

About

No description, website, or topics provided.

Resources

Stars

4 stars

Watchers

0 watching

Forks

Latest commit

 

History

12 Commits

Folders and files

Repository files navigation

SafeSeek: Universal Attribution of Safety Circuits in Language Models

Overview

SafeSeek is a universal safety attribution framework for locating and analyzing safety circuits in Large Language Models (LLMs).

SafeSeek Framework

Project Structure

safeseek/
├── alignment/       # Safety alignment circuit
│   ├── head.py
│   ├── neuron.py
│   └── head_neuron.py
└── backdoor/        # Backdoor circuit
    ├── head.py
    ├── neuron.py
    └── head_neuron.py

Environment Setup

Create a conda environment and install the required dependencies:

conda create -n safeseek python=3.10 -y
conda activate safeseek
pip install -r requirements.txt

Usage

  1. Configure paths in the training scripts:
  • MODEL_PATH: path to your model
  • OUTPUT_DIR: output directory
  • Dataset path
  1. Run analysis:
 # For attention head analysis
 python alignment/head.py
 python backdoor/head.py

 # For neuron analysis
 python alignment/neuron.py
 python backdoor/neuron.py

 # For combined analysis
 python alignment/head_neuron.py
 python backdoor/head_neuron.py
  1. Results will be saved to the configured output directory

About

No description, website, or topics provided.

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages