Home

Awesome

AlphaEdit

alt text Figure: This is the overall architecture of our AlphaEdit method.

Requirements

At least one A40 48G GPU.

We directly provide the "cov" matrix of Llama3-8B-instruct that we have already calculated. https://drive.google.com/file/d/1GhDb4vPd1NIyRCbbIlgXV45xbE2UQMav/view?usp=sharing After decompressing it and saving it to the "./data/stats" folder.

Quick Start

An example for editing Llama3 (8B) on counterfact dataset using NSE

1. Edit Llama3 (8B) model

python3 -m experiments.evaluate     --alg_name=AlphaEdit     --model_name=meta-llama/Meta-Llama-3-8B-Instruct     --hparams_fname=Llama3-8B.json --ds_name=mcf --dataset_size_limit=2000    --num_edits=100 --downstream_eval_steps=5

This command runs an evaluation script for the NSE algorithm using the Llama3-8b-instruct. Below are the explanations for each argument:

2. Summarize the results

python summarize.py --dir_name=AlphaEdit --runs=run_<run1>,run_<run2>

Acknowledgment

Our code is based on MEMIT.