Open Interpretability Models Contributors Research Posts About

Editing Factual Knowledge in Language Models

Source

Citation. Nicola De Cao (University of Amsterdam, University of Edinburgh), Wilker Aziz (University of Amsterdam) and Ivan Titov (University of Amsterdam, University of Edinburgh). "Editing Factual Knowledge in Language Models". arXiv 2104.08164v2, 8 September 2021 (v1 16 April 2021). Paper, code. Venue: EMNLP 2021, Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 6491–6506, DOI 10.18653/v1/2021.emnlp-main.522. The arXiv comment says "Proceedings of the 2020 Conference", but the ACL Anthology page gives 2021. The anthology is right. Funding: SAP Innovation Center Network, ERC Starting Grant BroadSem (678254), NWO VIDI 639.022.518 and EU Horizon 2020 grant 825299 (Gourmet). The data are public sets (FEVER from KILT, and zsRE). The paper doesn't release its re-split or its paraphrases as files.

Status. Planned. Its four edit metrics are a ready test for a fix of the #4781 prompt, which the fix literature in #4784 prepares for. No code, skill or protocol rule depends on the paper now.

Read. On 2026-11-18, from the v2 arXiv HTML, which I converted to plain text and read myself. I have every section in the paper's own text: the abstract, sections 1 to 7, the ethics note, the acknowledgments and appendices A to C. Tables 1 and 2 came through as text. I didn't see the images of Figures 1 to 6, only their captions. I didn't read the PDF. A WebFetch model also read the abstract page and the ACL Anthology page. I took the venue and pages from that report.

Summary

Claim. A hyper-network can learn to edit one fact in a trained model, from the fact alone. The edit changes the prediction for that input and its paraphrases. A constraint on the output distribution keeps the other predictions the same.

Method.

Findings, as the source reports them. All values are from Table 1 and the text of sections 6 and C.

Setting Result
KnowledgeEditor, fact-checking success 98.80, retain 98.14, equivalence 82.69, deterioration 0.10
KnowledgeEditor, question answering success 94.65, retain 98.73, equivalence 86.50 (generated) / 92.06 (human), deterioration 0.11
KnowledgeEditor with paraphrases in training, fact-checking success 98.50, retain 98.55, equivalence 95.25
The same, question answering success 94.12, retain 98.56, equivalence 91.20 / 94.53
Fine-tune all layers, fact-checking success 100.0, retain 86.95, equivalence 95.58, deterioration 2.25
Fine-tune all layers, question answering success 100.0, retain 67.55, equivalence 97.77 / 98.84, deterioration 4.50
Fine-tune first layer, fact-checking success 100.0, retain 99.44, equivalence 42.24
Zhu et al., all layers, question answering success 80.65, retain 95.56, equivalence 76.41 / 79.38
Editor with an L2 parameter constraint, fact-checking success 99.10, retain 45.10, equivalence 99.01, deterioration 35.29
Editor with an L2 parameter constraint, question answering success 99.10, retain 46.66, deterioration 9.22
Probability that the full method beats all baselines, over 1,000 Dirichlet-weighted sums of the metrics ≈ 97% (fact-checking), ≈ 88% (question answering)
Editor without gradient input (section C) ≈ 10 times slower on fact-checking. On question answering, it never passed 75% success and 50% retain
Mean cosine of the editor's update with the gradient (Table 2) about 0.02 in magnitude. Fine-tuning against the gradient: 0.451

The paper also reports where the updates go, from the heatmaps of Figure 4 for question answering. Gradients concentrate on the first encoder layer and the last decoder layer. Fine-tuning updates all layers almost uniformly. The editor's updates are sparser, and they fall mainly on the attention key and query matrices, not the value matrices. Section 3 calls the hyper-network a "probe" of where knowledge is. Section 6.4 says that "proper investigation is however outside of the scope of this study".

Where the claims go beyond the evidence

The authors state the paraphrase limits, the scope of the update analysis and the possible misuse of the method themselves.

Use in this repo