Reproduce main results using the pipeline
mainYou can reproduce the main results from the paper by running the pipeline.run_pipeline module. You must provide the --model_path argument, which should be the HuggingFace model path (e.g., meta-llama/Meta-Llama-3-8B-Instruct).
The pipeline executes five sequential steps and saves artifacts in pipeline/runs/{model_alias}/:
- Extract candidate refusal directions: Saved to
generate_directions. - Select the most effective refusal direction: Saved to
select_direction. The final direction is saved asdirection.pt. - Generate completions over harmful prompts: Evaluates refusal metrics; saved to
completions. - Generate completions over harmless prompts: Evaluates refusal metrics; saved to
completions. - Evaluate CE loss metrics: Saved to
loss_evals.
python3 -m pipeline.run_pipeline --model_path {model_path}