DeepEdit: Knowledge Editing as Decoding with Constraints

Yiwei Wang, Muhao Chen, Nanyun Peng, Kai-Wei Chang · DOI

Introduction

Large Language Models (LLMs) possess vast internal knowledge, yet this information is static, reflecting only the data available at the time of training. As the world evolves or private data needs integration, Knowledge Editing (KE) becomes essential. However, existing KE methods often struggle with complex multi-hop reasoning tasks, where models frequently default to outdated internal knowledge or lose logical coherence.

DeepEdit, a framework developed by researchers at UCLA and UC Davis, addresses these challenges by reframing knowledge editing. Instead of viewing it as a retraining or simple prompting task, DeepEdit treats it as a constrained decoding problem.

The Knowledge Editing Landscape

Existing approaches to KE generally fall into two categories: Model Editing, which involves updating model weights, and In-Context Editing, which provides new facts within the prompt. While Model Editing can be unstable and expensive, In-Context Editing often fails to steer the model's output effectively during complex reasoning chains.

Comparison of Knowledge Editing paradigms: (a) Example, (b) Model Editing, (c) In-context Editing, and (d) DeepEdit.

As shown in the figure above, DeepEdit (d) introduces a more structured intervention compared to traditional methods. It ensures that the model's reasoning steps are not only logical but also strictly adhere to the provided updates, even when they conflict with the model's pre-trained parameters.

The DeepEdit Framework

DeepEdit shifts the intervention to the decoding stage, treating the generation of a reasoning chain as a search process guided by semantic constraints.

1. Semantic Constraints and Verifiers

To ensure high-quality reasoning, DeepEdit enforces four primary constraints:

  • Conciseness: Prevents repetitive loops in the reasoning chain.
  • Coherence: Ensures each step logically follows its predecessor.
  • Receptiveness: Mandates the use of new facts over conflicting internal knowledge.
  • Pertinence: Keeps every step relevant to the initial query.

These constraints are monitored by specialized LLM-based "verifiers" that perform binary classification on each candidate reasoning step.

2. Efficient Search with DFS

Rather than using computationally heavy Breadth-First Search (BFS), DeepEdit utilizes a Depth-First Search (DFS) strategy combined with an importance-based ranking system. This allows the model to quickly identify and commit to valid reasoning paths.

The DeepEdit pipeline: generating candidates for reasoning steps, filtering with semantic constraints, and ranking by importance.

Experimental Evaluation

The researchers evaluated DeepEdit against several benchmarks, including the widely used MQUAKE-3K. They also introduced two new datasets to address existing limitations:

  • MQUAKE-2002: A cleaned version of MQUAKE-3K that removes conflicting annotations.
  • MQUAKE-HARD: A challenging dataset focused on 4-hop reasoning with multiple edited facts.

Key Results

DeepEdit demonstrated transformative performance improvements:

  • Accuracy: On GPT-3.5-Turbo, DeepEdit improved accuracy by 52% to 69% over the previous state-of-the-art method, MeLLo.
  • Complexity Scaling: On the MQUAKE-HARD benchmark, DeepEdit outperformed baselines by a factor of 7x to 12x.
  • Efficiency: The DFS strategy significantly reduced redundant sub-querying and total generation time.
  • Specificity: The model maintained its general knowledge on the CounterFact dataset, ensuring that edits remained localized and did not "break" unrelated facts.

Conclusion

DeepEdit represents a significant shift in how we manage LLM knowledge. By intervening at the decoding stage and applying rigorous semantic constraints, it enables models to navigate complex reasoning tasks while remaining fully receptive to new information. This approach paves the way for more reliable and up-to-date AI systems in dynamic environments.

Summary updated

BibTeX
@misc{wang2024deepedit,
  author = {Yiwei Wang and Muhao Chen and Nanyun Peng and Kai-Wei Chang},
  title = {{DeepEdit: Knowledge Editing as Decoding with Constraints}},
  year = {2024},
  eprint = {2401.10471},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2401.10471},
}
Figure