Skip to content
/ CaKE Public

Circuit-Aware Editing Enables Generalizable Knowledge Learners

License

Notifications You must be signed in to change notification settings

zjunlp/CaKE

Repository files navigation

CaKE: Circuit-aware Editing Enables Generalizable Knowledge Learners

Table of Contents


🌟Overview

This work aims to improve the knowledge editing performance under the multi-hop reasoning settings.

🔧Installation

Build the environement:

conda create -n cake python=3.10
pip install -r requirements.txt

📚Analyze

Down load the wikidata for analysis from HoppingTooLate into Analysis/datasets.

  • Run evaluate_dataset.py to filter the data.
  • Run generate_entity_description.py to get the entity patch and relation patch.
  • Run patch_activations.py to do back-patching and cross-patching.
  • Run analysis.ipynb

🧐Editing

Just run the following commond:

run.sh

🌻Acknowledgement

We thank for the project of EasyEdit, HoppingTooLate. The code in this work is built on top of these projects' codes.