Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ORE: Orthogonal Representation Editing

Official code for "Orthogonal Representation Editing: Decoupling Semantic Entanglement in Batch Knowledge Editing of LLMs" (Findings of ACL 2026). This code was ported from Ascend NPU to NVIDIA CUDA.

Installation

conda create -n ore python=3.12 -y && conda activate ore
pip install torch==2.11.0 --index-url https://download.pytorch.org/whl/cu128
pip install -r requirements.txt

Quick Start

Edit Qwen2.5-7B with 100 edits on ZsRE.

Single GPU:

python -m experiments.evaluate \
    --alg_name=ORE --model_name=Qwen/Qwen2.5-7B-Instruct \
    --hparams_fname=Qwen2.5-7B.json --ds_name=zsre \
    --dataset_size_limit=100 --num_edits=100

Multi-GPU:

torchrun --nproc_per_node=2 -m experiments.evaluate \
    --alg_name=ORE --model_name=Qwen/Qwen2.5-7B-Instruct \
    --hparams_fname=Qwen2.5-7B.json --ds_name=zsre \
    --dataset_size_limit=100 --num_edits=100

For cross-lingual editing:

python -m experiments.evaluate \
    --alg_name=ORE --model_name=Qwen/Qwen2.5-7B-Instruct \
    --hparams_fname=Qwen2.5-7B.json --ds_name=bzsre \
    --dataset_size_limit=100 --num_edits=100

Results are written to results/<alg_name>/run_<id>/. Summarize with:

python -m experiments.summarize --dir_name=ORE --runs=run_<id>

Citation

If you find this work useful, please cite:

@misc{yu2026orthogonalrepresentationeditingdecoupling,
      title={Orthogonal Representation Editing: Decoupling Semantic Entanglement in Batch Knowledge Editing of LLMs}, 
      author={Wenhao Yu and Zhicong Lu and Bo Lv and Fangyin Ma and Kaiwen Wei and Shihao Yang and Nayu Liu},
      year={2026},
      eprint={2606.22627},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2606.22627}, 
}

Acknowledgments

This codebase builds on AlphaEdit, and MEMIT.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages