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.
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.txtEdit 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=100Multi-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=100For 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=100Results are written to results/<alg_name>/run_<id>/. Summarize with:
python -m experiments.summarize --dir_name=ORE --runs=run_<id>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},
}