๐ฅ News
2025.05๐ We released our paper UltraEdit: Training-, Subject-, and Memory-Free Lifelong Editing in Language Models โ ๐ UltraEdit on arXiv | ๐ค UltraEditBench on HuggingFace.
๐ฆ Data & Model Preparation
1๏ธโฃ Download the files from Google Drive and place them under UltraEdit/data/raw.
2๏ธโฃ Download the UltraEditBench and save it under UltraEdit/data/raw/ultraeditbench.
3๏ธโฃ Specify the path to model weights by setting the name_or_path field in UltraEdit/config/model/model.yaml.
If you need to use locate-then-edit methods, we provide precomputed covariance matrices on Hugging Face for several models: GPT-J 6B, Qwen2.5-7B-Instruct, Mistral-7B-v0.3, LLaMA-3-8B-Instruct, and LLaMA-2-7B-hf.
๐ Setup
Create the environment and install dependencies:
conda create -n ultraedit python=3.10 conda activate ultraedit pip install torch==2.3.0+cu121 --index-url https://download.pytorch.org/whl/cu121 pip install -r requirements.txt
๐ก If you want to try editing a Mistral-7B model, even a 24GB consumer GPU is enough โ model editing for everyone!
๐งช Run
Run the main experiment with:
The run.sh script includes a sample command like:
python main.py dataset=zsre model=mistral-7b editor=ultraedit num_seq=200 \ # Number of turns
editor.cache_dir=cache \
dataset.batch_size=10 \
dataset.n_edits=100 \ # Number of edits per turn
model.edit_modules="[model.layers.29.mlp.down_proj, model.layers.30.mlp.down_proj]"
๐ก Just try editing 20K samples on Mistral-7B in under 5 minutes โ ultra-efficient!
๐ Acknowledgements
Our work builds upon several excellent model editing frameworks. We sincerely thank the authors of RLEdit for their valuable contributions to the field.
๐ซ Contact
For any inquiries or possible collaboration, feel free to reach out at peettherapynoys@gmail.com
๐ Citation
If you find UltraEdit useful for your research and applications, please cite using this BibTeX:
@misc{gu2025ultraedittrainingsubjectmemoryfree, title={UltraEdit: Training-, Subject-, and Memory-Free Lifelong Editing in Language Models}, author={Xiaojie Gu and Ziying Huang and Jia-Chen Gu and Kai Zhang}, year={2025}, eprint={2505.14679}, archivePrefix={arXiv}, primaryClass={cs.CL}, url={https://arxiv.org/abs/2505.14679}, }