This paper investigates using knowledge editing techniques to detoxify Large Language Models (LLMs). We construct a benchmark, SafeEdit, which covers nine unsafe categories with various powerful attack prompts and equips comprehensive metrics for systematic evaluation. We conduct experiments with several knowledge editing approaches, indicating that knowledge editing has the potential to detoxify LLMs with a limited impact on general performance efficiently. Then, we propose a simple yet effective baseline, dubbed Detoxifying with Intraoperative Neural Monitoring (DINM), to diminish the toxicity of LLMs within a few tuning steps via only one instance. We further provide an in-depth analysis of the internal mechanism for various detoxifying approaches, demonstrating that previous methods like SFT and DPO may merely suppress the activations of toxic parameters, while DINM mitigates the toxicity of the toxic parameters to a certain extent, making permanent adjustments. We hope that these insights could shed light on future work of developing detoxifying approaches and the underlying knowledge mechanisms of LLMs. Code and benchmark are available at https://github.com/zjunlp/EasyEdit.
Detoxifying Large Language Models via Autoregressive Reward Guided Representation Editing
SKLCCSE, Beihang University(北航智能计算与复杂系统研究院);National University of Singapore(新加坡国立大学);Zhongguancun Laboratory, Beijing(中关村实验室);Institute of Dataspace, Hefei(合肥数据空间研究院);Nanyang Technological University(南洋理工大学)
A Comprehensive Study of Knowledge Editing for Large Language Models
Zhejiang University(浙江大学);National University of Singapore(新加坡国立大学);University of California, Los Angeles(加州大学洛杉矶分校);Ant Group(蚂蚁集团);Alibaba Group(阿里巴巴集团)
Unveiling the Pitfalls of Knowledge Editing for Large Language Models
College of Computer Science and Technology, Zhejiang University(浙江大学计算机科学与技术学院);ZJU-Ant Group Joint Research Center for Knowledge Graphs, Zhejiang University(浙江大学-蚂蚁集团知识图谱联合研究中心);ZJU-Hangzhou Global Scientific and Technological Innovation Center, Zhejiang University(浙江大学杭州国际科技创新中心);Tencent(腾讯)
Visual-Oriented Fine-Grained Knowledge Editing for MultiModal Large Language Models
Hefei University of Technology(合肥工业大学);University of Science and Technology of China(中国科学技术大学);Hefei Comprehensive National Science Center(合肥综合性国家科学中心)
ADS-Edit: A Multimodal Knowledge Editing Dataset for Autonomous Driving Systems
Zhejiang University,\ University - Ant \ Joint Laboratory of Knowledge Graph Hangzhou China;Zhejiang University,\ University - Ant \ Joint Laboratory of Knowledge Graph
Edit Less, Achieve More: Dynamic Sparse Neuron Masking for Lifelong Knowledge Editing in LLMs
Key Lab of Intell. Info. Process., Inst. of Comput. Tech., CAS(智能信息处理重点实验室,计算技术研究所,中国科学院);University of Chinese Academy of Sciences(中国科学院大学);Agriculture Information Institute, CAAS(农业信息研究所,中国农业科学院)
VLKEB: A Large Vision-Language Model Knowledge Editing Benchmark
University of Chinese Academy of Sciences (UCAS)(中国科学院大学);Institute of Automation, Chinese Academy of Sciences (CASIA)(中国科学院自动化研究所);Nanjing University(南京大学)
Related Knowledge Perturbation Matters: Rethinking Multiple Pieces of Knowledge Editing in Same-Subject
Institute of Computing Technology, Chinese Academy of Sciences(中国科学院计算技术研究所);University of Chinese Academy of Sciences(中国科学院大学);People’s Public Security University of China(中国人民公安大学)
Orthogonal Representation Editing: Decoupling Semantic Entanglement in Batch Knowledge Editing of LLMs
School of Computer Science and Technology, Tianjin University(天津大学计算机科学与技术学院);Kexin Technology(可心科技);University of Chinese Academy of Sciences(中国科学院大学);Tencent Hunyuan(腾讯混元);College of Computer Science, Chongqing University(重庆大学计算机学院)
Assessing Knowledge Editing in Language Models via Relation Perspective
University of Chinese Academy of Sciences(中国科学院大学);Institute of Automation, CAS(中国科学院自动化研究所);Kunming University of Science and Technology(昆明理工大学);Beijing Institute of Technology(北京理工大学)
MILA - Quebec AI Institute(MILA - 魁北克人工智能研究所);Microsoft(微软公司);UNC Chapel Hill(北卡罗来纳大学教堂山分校);North Carolina State University(北卡罗来纳州立大学);Massachusetts Institute of Technology(麻省理工学院);Google DeepMind(谷歌DeepMind)
Commonsense Knowledge Editing Based on Free-Text in LLMs
Institute of Automation, Chinese Academy of Sciences(中国科学院自动化研究所);School of Artificial Intelligence, University of Chinese Academy of Sciences(中国科学院大学人工智能学院);Beijing Academy of Artificial Intelligence(北京智源人工智能研究院)
Locate-then-edit for Multi-hop Factual Recall under Knowledge Editing
Peking University(北京大学);Provable Responsible AI and Data Analytics (PRADA) Lab(可验证负责任人工智能与数据分析(PRADA)实验室);King Abdullah University of Science and Technology(阿卜杜拉国王科技大学);South China University of Technology(华南理工大学)
COMPKE: Complex Question Answering under Knowledge Editing
Provable Responsible AI and Data Analytics (PRADA) Lab(可证明负责任的人工智能与数据分析实验室);King Abdullah University of Science and Technology(卡布斯大学);Peking University(北京大学);South China University of Technology(华南理工大学);Sun Yat-sen University(中山大学)
Editing Factual Knowledge and Explanatory Ability of Medical Large Language Models
University of Science and Technology of China(中国科学技术大学);City University of Hong Kong(香港城市大学);Jarvis Research Center(贾维斯研究中心);Tencent YouTu Lab(腾讯优图实验室);Peking University(北京大学)
Knowledge in Superposition: Unveiling the Failures of Lifelong Knowledge Editing for Large Language Models
Institute of Automation, Chinese Academy of Sciences(中国科学院自动化研究所);School of Artificial Intelligence, University of Chinese Academy of Sciences(中国科学院大学人工智能学院)
KEditVis: A Visual Analytics System for Knowledge Editing of Large Language Models
Zhejiang University(浙江大学);State Key Lab of CAD&CG, Zhejiang University(浙江大学CAD&CG国家重点实验室);Hong Kong University of Science and Technology(香港科技大学);School of Software Engineering, South China University of Technology(华南理工大学软件学院);School of Software Technology, Zhejiang University(浙江大学软件学院)
WikiBigEdit: Understanding the Limits of Lifelong Knowledge Editing in LLMs
Tübingen AI Center, University of Tübingen(图宾根人工智能中心,图宾根大学);Munich Center for Machine Learning (MCML)(慕尼黑机器学习中心);Technical University, Munich(慕尼黑技术大学);University of Virginia(弗吉尼亚大学)
Constraining Sequential Model Editing with Editing Anchor Compression
National Engineering Research Center of Speech and Language Information Processing, University of Science and Technology of China(中国科学技术大学语音及语言信息处理国家工程研究中心);Zhejiang University(浙江大学);University of California, Los Angeles(加利福尼亚大学洛杉矶分校)
Correct When Paired, Wrong When Split: Decoupling and Editing Modality-Specific Neurons in MLLMs
School of Information Science and Engineering, Yunnan University(云南大学信息科学与工程学院);School of Software, Yunnan University(云南大学软件学院);National University of Singapore(新加坡国立大学);School of Engineering, Yunnan University(云南大学工程学院)
Latent Knowledge Scalpel: Precise and Massive Knowledge Editing for Large Language Models
Institute of Information Engineering, Chinese Academy of Sciences(中国科学院信息工程研究所);School of Cyber Security, University of Chinese Academy of Sciences(中国科学院大学网络安全学院);Tsinghua University(清华大学);University of Electronic Science and Technology of China(电子科技大学)
Editing Conceptual Knowledge for Large Language Models
Zhejiang University(浙江大学);ZJU-Ant Group Joint Research Center for Knowledge Graphs(浙江大学-蚂蚁集团知识图谱联合研究中心);National University of Singapore(新加坡国立大学);Ant Group(蚂蚁集团)
FedAlphaEdit: Null-Space-Aligned Merging for Collaborative Knowledge Editing
Graduate School of Science and Technology, University of Tsukuba(筑波大学科学技术研究生院);Center for Artificial Intelligence Research, Tsukuba Institute for Advanced Research, University of Tsukuba(筑波大学筑波高级研究院人工智能研究中心);Institute of Systems and Information Engineering, University of Tsukuba(筑波大学系统与信息工程研究院)