DeepEdit: Knowledge Editing as Decoding with Constraints

We propose a new perspective of knowledge editing (KE) for large language models (LLMs) that treats it as a constrained decoding problem. We design decoding constraints to regulate LLMs, ensuring coherence between reasoning steps when incorporating new knowledge. To enforce these constraints, we utilize a depth-first search to adaptively substitute new knowledge for the LLMs' original reasoning steps, greedily seeking the optimal path of multi-hop reasoning with new knowledge. From this vantage, we propose DEEPEDIT: Depth-first Search-based Decoding for Knowledge Editing. DEEPEDIT improves the KE of LLMs by enhancing the conciseness, coherence, pertinence, and receptiveness of reasoning with new knowledge. DEEPEDIT is flexibly applicable to any black-box LLM without requiring access to model parameters or token-wise distributions. In addition to DEEPEDIT, we propose two new KE benchmarks: MQuAKE-2002 and MQuAKE-hard, which are designed to provide more precise and challenging assessments of KE approaches. Qualitatively, DEEPEDIT enables LLMs to produce more succinct reasoning outputs in accordance with new knowledge. Quantitatively, it yields significant improvements on multiple KE benchmarks.

[1]  Ramakanth Pasunuru,et al.  The ART of LLM Refinement: Ask, Refine, and Trust , 2023, ArXiv.

[2]  Benjamin Van Durme,et al.  SCREWS: A Modular Framework for Reasoning with Revisions , 2023, ArXiv.

[3]  A. Globerson,et al.  Evaluating the Ripple Effects of Knowledge Editing in Language Models , 2023, TACL.

[4]  Eric Michael Smith,et al.  Llama 2: Open Foundation and Fine-Tuned Chat Models , 2023, ArXiv.

[5]  Christopher D. Manning,et al.  MQuAKE: Assessing Knowledge Editing in Language Models via Multi-Hop Questions , 2023, EMNLP.

[6]  Lei Li,et al.  Can We Edit Factual Knowledge by In-Context Learning? , 2023, EMNLP.

[7]  Lu Wang,et al.  BOLT: Fast Energy-based Controlled Text Generation with Tunable Biases , 2023, ACL.

[8]  Guy Van den Broeck,et al.  Tractable Control for Autoregressive Language Generation , 2023, ICML.

[9]  Bodhisattwa Prasad Majumder,et al.  Self-Refine: Iterative Refinement with Self-Feedback , 2023, NeurIPS.

[10]  Jie Zhou,et al.  Transformer-Patcher: One Mistake worth One Neuron , 2023, ICLR.

[11]  Xiang Lisa Li,et al.  Demonstrate-Search-Predict: Composing retrieval and language models for knowledge-intensive NLP , 2022, ArXiv.

[12]  Yejin Choi,et al.  Generating Sequences by Learning to Self-Correct , 2022, ICLR.

[13]  Arnab Sen Sharma,et al.  Mass-Editing Memory in a Transformer , 2022, ICLR.

[14]  Noah A. Smith,et al.  Measuring and Narrowing the Compositionality Gap in Language Models , 2022, EMNLP.

[15]  Christopher D. Manning,et al.  Memory-Based Model Editing at Scale , 2022, ICML.

[16]  Kai-Wei Chang,et al.  Controllable Text Generation with Neurally-Decomposed Oracle , 2022, NeurIPS.

[17]  Biswajit Paria,et al.  Gradient-based Constrained Sampling from Language Models , 2022, EMNLP.

[18]  Yejin Choi,et al.  COLD Decoding: Energy-based Constrained Text Generation with Langevin Dynamics , 2022, NeurIPS.

[19]  David Bau,et al.  Locating and Editing Factual Associations in GPT , 2022, NeurIPS.

[20]  Jungo Kasai,et al.  NeuroLogic A*esque Decoding: Constrained Text Generation with Lookahead Heuristics , 2021, NAACL.

[21]  Zornitsa Kozareva,et al.  Do Language Models Have Beliefs? Methods for Detecting, Updating, and Visualizing Model Beliefs , 2021, ArXiv.

[22]  Christopher D. Manning,et al.  Fast Model Editing at Scale , 2021, ICLR.

[23]  Yejin Choi,et al.  DExperts: Decoding-Time Controlled Text Generation with Experts and Anti-Experts , 2021, ACL.

[24]  Li Dong,et al.  Knowledge Neurons in Pretrained Transformers , 2021, ACL.

[25]  Nicola De Cao,et al.  Editing Factual Knowledge in Language Models , 2021, EMNLP.

[26]  D. Klein,et al.  FUDGE: Controlled Text Generation With Future Discriminators , 2021, NAACL.

[27]  Ankit Singh Rawat,et al.  Modifying Memories in Transformer Models , 2020, ArXiv.

[28]  Yejin Choi,et al.  NeuroLogic Decoding: (Un)supervised Neural Text Generation with Predicate Logic Constraints , 2020, NAACL.

[29]  Yejin Choi,et al.  Back to the Future: Unsupervised Backprop-based Decoding for Counterfactual and Abductive Commonsense Reasoning , 2020, EMNLP.

[30]  Shafiq R. Joty,et al.  GeDi: Generative Discriminator Guided Sequence Generation , 2020, EMNLP.

[31]  Danqi Chen,et al.  Position-aware Attention and Supervised Data Improve Slot Filling , 2017, EMNLP.

[32]  Cheri A. Hoy,et al.  Coherence , 1989, Journal of learning disabilities.

[33]  Aditya V. Thakur,et al.  Correcting Deep Neural Networks with Small, Generalizing Patches , 2019 .