Investigating Multi-Hop Factual Shortcuts in Knowledge Editing of Large Language Models

Tianjie Ju, Yijin Chen, Xinwei Yuan, Zhuosheng Zhang, Wei Du, Yubin Zheng, Gongshen Liu · DOI

TL;DR

Large Language Models (LLMs) often take shortcuts when answering multi-hop questions, directly linking the start and end of a knowledge chain instead of reasoning step-by-step. This reliance on "factual shortcuts" leads to significant failures when knowledge is edited, with about 20% of errors attributed to these shortcuts. The authors propose a method to mitigate these failures by identifying and "erasing" shortcut-related neurons.

What Problem Does This Paper Address?

LLMs are impressive at recalling facts and reasoning, but their ability to combine these for multi-hop questions (e.g., "Who is the CEO of the company that makes X?") is less understood. Ideally, an LLM would break down such questions into intermediate steps. However, this paper investigates a phenomenon where LLMs might bypass this step-wise reasoning by directly connecting the initial entity (e.g., "X") to the final entity (e.g., "CEO's name") if they frequently co-occurred in the training data. This "shortcut" can lead to incorrect answers, especially after knowledge editing, where the LLM might retain outdated information.

Methods

The researchers explored two main areas:

  1. Identifying Factual Shortcuts: They used "Knowledge Neurons" (KNs) to analyze which parts of an LLM's internal network are activated when answering questions. By comparing the activated neurons for multi-hop questions versus individual single-hop questions, they could infer the presence of shortcuts. They also analyzed the frequency of co-occurrence between the start and end entities of multi-hop facts in large text corpora (Wikipedia and Dolma) to see if this correlated with shortcut usage.
  2. Mitigating Shortcut Risks: To address the problems caused by shortcuts, they proposed a method inspired by previous work on knowledge editing. This involves identifying specific neurons associated with factual shortcuts and "erasing" them (setting their activation to zero). This forces the LLM to rely on proper step-wise reasoning.

Datasets

  • MQUAKE-CF-3K: This dataset, originally from Zhong et al. (2023), was used for evaluating multi-hop knowledge editing. It contains 3,000 multi-hop English knowledge questions extracted from Wikipedia.
  • Wikipedia and Dolma: These large text corpora were used to analyze the co-occurrence frequencies of entities in multi-hop knowledge chains, serving as proxies for LLM pre-training data.

Key Insights and Ideas

  • Shortcuts are Pervasive: LLMs frequently use direct shortcuts for multi-hop reasoning, especially when entities have high co-occurrence in training data. This is more pronounced in few-shot prompting than in chain-of-thought prompting.
  • Shortcuts Undermine Knowledge Editing: When knowledge is updated (e.g., changing a country's capital), LLMs relying on shortcuts can fail to reflect the change, leading to incorrect answers. Approximately 20% of knowledge editing failures are linked to these shortcuts.
  • Frequency is Key: The likelihood of an LLM using a shortcut is strongly correlated with how often the initial and terminal entities of a multi-hop fact appear together in the pre-training corpus.
  • Targeted Neuron Erasure Works: By identifying and disabling specific "shortcut neurons," the researchers could significantly reduce editing failures caused by these shortcuts.

Key Results

  • Shortcut Prevalence: Over two-thirds of multi-hop knowledge instances showed evidence of shortcuts, with some appearing over 10,000 times in the analyzed corpora.
  • Editing Failures: Around 20% of multi-hop knowledge editing failures were directly attributed to factual shortcuts. Instances with higher shortcut failures also showed higher co-occurrence frequencies of their start and end entities.
  • Mitigation Success: Erasing shortcut neurons led to a significant reduction in shortcut-related failures in multi-hop knowledge editing, improving the overall success rate. For example, on a subset of data with high shortcut frequency (Dcount>10), erasing shortcuts improved the success rate and reduced shortcut failure rates across different LLMs and editing methods.

Limitations and Future Work

  • Corpus Limitations: While Wikipedia is a good proxy, LLM pre-training corpora are often much larger and more diverse. Future work could analyze more extensive datasets.
  • Mitigation vs. Eradication: The proposed neuron erasure is a post-hoc mitigation strategy. True elimination of shortcuts would require changes during the pre-training phase itself.
  • Scalability: Applying this neuron erasure method comprehensively across all potential shortcuts in LLMs is impractical. The authors advocate for developing better pre-training methods that inherently constrain shortcut generation.
  • Broader LLM Evaluation: The study focused on GPT-J and LLaMA-2. Future research could extend these experiments to a wider range of LLMs.

Summary updated

Abstract

Recent work has showcased the powerful capability of large language models (LLMs) in recalling knowledge and reasoning. However, the reliability of LLMs in combining these two capabilities into reasoning through multi-hop facts has not been widely explored. This paper systematically investigates the possibilities for LLMs to utilize shortcuts based on direct connections between the initial and terminal entities of multi-hop knowledge. We first explore the existence of factual shortcuts through Knowledge Neurons, revealing that: (i) the strength of factual shortcuts is highly correlated with the frequency of co-occurrence of initial and terminal entities in the pre-training corpora; (ii) few-shot prompting leverage more shortcuts in answering multi-hop questions compared to chain-of-thought prompting. Then, we analyze the risks posed by factual shortcuts from the perspective of multi-hop knowledge editing. Analysis shows that approximately 20% of the failures are attributed to shortcuts, and the initial and terminal entities in these failure instances usually have higher co-occurrences in the pre-training corpus. Finally, we propose erasing shortcut neurons to mitigate the associated risks and find that this approach significantly reduces failures in multiple-hop knowledge editing caused by shortcuts. Code is publicly available at https://github.com/Jometeorie/MultiHopShortcuts.
BibTeX
@inproceedings{ju2024investigating,
  author = {Tianjie Ju and Yijin Chen and Xinwei Yuan and Zhuosheng Zhang and Wei Du and Yubin Zheng and Gongshen Liu},
  title = {{Investigating Multi-Hop Factual Shortcuts in Knowledge Editing of Large Language Models}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2024},
  doi = {10.18653/v1/2024.acl-long.486},
}
Figure