Lune

EMNLP2023Top-tier venue

Can We Edit Factual Knowledge by In-Context Learning?

Ce Zheng, Lei Li, Qingxiu Dong, Yuxuan Fan, Zhiyong Wu, Jingjing Xu, Baobao Chang

Abstract

Previous studies have shown that large language models (LLMs) like GPTs store massive factual knowledge in their parameters. However, the stored knowledge could be false or outdated. Traditional knowledge editing methods refine LLMs via fine-tuning on texts containing specific knowledge. However, with the increasing scales of LLMs, these gradient-based approaches bring large computation costs. The trend of model-as-a-service also makes it impossible to modify knowledge in black-box LMs. Inspired by in-context learning (ICL), a new paradigm based on demonstration contexts without parameter updating, we explore whether ICL can edit factual knowledge. To answer this question, we give a comprehensive empirical study of ICL strategies. Experiments show that in-context knowledge editing (IKE), without any gradient and parameter updating, achieves a competitive success rate compared to gradient-based methods on GPT-J (6B) but with much fewer side effects, including less over-editing on similar but unrelated facts and less knowledge forgetting on previously stored knowledge. We also apply the method to larger LMs with tens or hundreds of parameters like OPT-175B, which shows the scalability of our method. The code is available at https://github.com/pkunlp-icler/IKE.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

109 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Knowledge Boundary of Large Language Models: A Survey cites Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivity
  • Knowledge Boundary of Large Language Models: A Survey cites WISE: Rethinking the Knowledge Memory for Lifelong Model Editing of Large Language Models
  • Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivity cites Language Models are Few-Shot Learners
  • Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivity cites Calibrate Before Use: Improving Few-shot Performance of Language Models
  • Fast Model Editing at Scale cites Language Models are Few-Shot Learners
  • Editing Large Language Models: Problems, Methods, and Opportunities cites Language Models are Few-Shot Learners
  • Larimar: Large Language Models with Episodic Memory Control cites Fast Model Editing at Scale
  • Larimar: Large Language Models with Episodic Memory Control cites Editing Large Language Models: Problems, Methods, and Opportunities
  • WISE: Rethinking the Knowledge Memory for Lifelong Model Editing of Large Language Models cites Fast Model Editing at Scale
  • WISE: Rethinking the Knowledge Memory for Lifelong Model Editing of Large Language Models cites Language Models are Few-Shot Learners
  • WISE: Rethinking the Knowledge Memory for Lifelong Model Editing of Large Language Models cites Editing Large Language Models: Problems, Methods, and Opportunities
  • PMET: Precise Model Editing in a Transformer cites Editing Large Language Models: Problems, Methods, and Opportunities
  • Calibrate Before Use: Improving Few-shot Performance of Language Models cites Language Models are Few-Shot Learners
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers109

  1. PMET: Precise Model Editing in a TransformerXiaopeng Li, Shasha Li, Shezheng Song, Jing Yang et al.AAAI 2024 · 208 citations
  2. WISE: Rethinking the Knowledge Memory for Lifelong Model Editing of Large Language ModelsPeng Wang, Zexi Li, Ningyu Zhang, Ziwen Xu et al.NeurIPS 2024 · 125 citations
  3. Editing Large Language Models: Problems, Methods, and OpportunitiesYunzhi Yao, Peng Wang, Bozhong Tian, Siyuan Cheng et al.EMNLP 2023 · 83 citations
  4. Larimar: Large Language Models with Episodic Memory ControlPayel Das, Subhajit Chaudhury, Elliot Nelson, Igor Melnyk et al.ICML 2024 · 37 citations
  5. Knowledge Boundary of Large Language Models: A SurveyMoxin Li, Yong Zhao, Wenxuan Zhang, Shuaiyi Li et al.ACL 2025 · 33 citations

Builds on11

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
  2. Calibrate Before Use: Improving Few-shot Performance of Language ModelsZihao Zhao, Eric Wallace, Shi Feng, Dan Klein et al.ICML 2021 · 1,843 citations
  3. Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order SensitivityYao Lu, Max Bartolo, Alastair Moore, Sebastian Riedel et al.ACL 2022 · 1,494 citations
  4. RealToxicityPrompts: Evaluating Neural Toxic Degeneration in Language ModelsSamuel Gehman, Suchin Gururangan, Maarten Sap, Yejin Choi et al.EMNLP Findings 2020 · 692 citations
  5. Fast Model Editing at ScaleEric Mitchell, Charles Lin, Antoine Bosselut, Chelsea Finn et al.ICLR 2022 · 527 citations

Related papers

  1. Dynamic Retriever for In-Context Knowledge Editing via Policy OptimizationMahmud Wasif Nafee, Maiqi Jiang, Haipeng Chen, Yanfu ZhangEMNLP 2025 · 3 citations
  2. The Model Agreed, But Didn't Learn: Diagnosing Surface Compliance in Large Language ModelsXiaojie Gu, Ziying Huang, Weicong Hong, Jian Xie et al.ACL Findings 2026
  3. Scaling Knowledge Editing in LLMs to 100, 000 Facts with Neural KV DatabaseWeizhi Fei, Hao Shi, Jing Xu, Jingchen Peng et al.ICLR 2026 · 2 citations
  4. Knowledge Editing through Chain-of-ThoughtChangyue Wang, Weihang Su, Qingyao Ai, Yichen Tang et al.EMNLP 2025 · 2 citations
  5. Forget for Get: A Lightweight Two-phase Gradient Method for Knowledge Editing in Large Language ModelsYanhong Li, Min Yang, Xiping Hu, Chengming LiEMNLP Findings 2025
Dusk over the sea between two cliffs drawn in fine vertical lines