Skip to main content
QUICK REVIEW

[Paper Review] Editing Common Sense in Transformers

Anshita Gupta, Debanjan Mondal|arXiv (Cornell University)|May 24, 2023
Topic ModelingComputer Science3 citations
TL;DR

This paper proposes memit$_{\textsc{CSK}}$, a method to directly edit parameters in GPT-2 Large and XL models to correct commonsense plausibility errors without fine-tuning. By varying edit tokens and optimizing layer selection, memit$_{\textsc{CSK}}$ improves F1 scores by 10.97% and 10.73% over fine-tuned baselines on PEP3k and 20Q, while maintaining strong generalization across unaffected and affected reasoning, paraphrase, and neighborhood queries.

ABSTRACT

Editing model parameters directly in Transformers makes updating open-source transformer-based models possible without re-training (Meng et al., 2023). However, these editing methods have only been evaluated on statements about encyclopedic knowledge with a single correct answer. Commonsense knowledge with multiple correct answers, e.g., an apple can be green or red but not transparent, has not been studied but is as essential for enhancing transformers' reliability and usefulness. In this paper, we investigate whether commonsense judgments are causally associated with localized, editable parameters in Transformers, and we provide an affirmative answer. We find that directly applying the MEMIT editing algorithm results in sub-par performance and improve it for the commonsense domain by varying edit tokens and improving the layer selection strategy, i.e., $MEMIT_{CSK}$. GPT-2 Large and XL models edited using $MEMIT_{CSK}$ outperform best-fine-tuned baselines by 10.97% and 10.73% F1 scores on PEP3k and 20Q datasets. In addition, we propose a novel evaluation dataset, PROBE SET, that contains unaffected and affected neighborhoods, affected paraphrases, and affected reasoning challenges. $MEMIT_{CSK}$ performs well across the metrics while fine-tuning baselines show significant trade-offs between unaffected and affected metrics. These results suggest a compelling future direction for incorporating feedback about common sense into Transformers through direct model editing.

Motivation & Objective

  • To investigate whether commonsense plausibility judgments in Transformers are causally linked to localized, editable parameters.
  • To extend the MEMIT editing framework for commonsense knowledge, which involves multiple plausible answers and higher uncertainty than encyclopedic facts.
  • To evaluate editing performance not only on direct edits but also on semantic generalization, including paraphrases, neighboring statements, and reasoning-based queries.
  • To construct a novel probe set that captures both affected and unaffected examples to assess generalization and trade-offs in editing strategies.

Proposed method

  • The method applies causal mediation analysis to identify that commonsense plausibility predictions in GPT-2 Base-finetuned models are causally associated with specific neuron activations at subject, verb, and object token positions.
  • It extends MEMIT by varying the edit token (subject, verb, or object) and performing a hyperparameter search over multiple layers to identify optimal edit locations.
  • The framework uses a two-stage process: first, it identifies the most influential layer and token for editing via gradient-based saliency; second, it applies rank-one weight updates to MLP layers at those locations.
  • A new probe set is constructed for both 20Q and PEP3k datasets, containing unaffected neighborhoods, affected paraphrases, and reasoning challenges to evaluate semantic generalization.
  • The method evaluates configuration generalization by testing whether a hyperparameter configuration selected on a validation set generalizes well to a separate test set.
  • It compares performance against repair-finetuning baselines across multiple metrics: F1 score, AIE (activation influence), and generalization across semantic variants.

Experimental results

Research questions

  • RQ1Are commonsense plausibility judgments in Transformers causally linked to localized, editable parameters in specific layers and token positions?
  • RQ2Can direct parameter editing, as in MEMIT, be effectively adapted to correct commonsense errors that involve multiple plausible answers rather than single factual facts?
  • RQ3Does the edited model generalize well to paraphrased, neighboring, and reasoning-based queries without compromising performance on unaffected examples?
  • RQ4How do different edit token choices (subject, verb, object) and layer selection strategies affect the model’s ability to correct mistakes while preserving generalization?

Key findings

  • memeit$_{\textsc{CSK}}$ improves F1 scores by 10.97% and 10.73% over repair-finetuned baselines on the PEP3k and 20Q test sets, respectively, demonstrating strong performance gains.
  • The model edited with memit$_{\textsc{CSK}}$ achieves an AIE (activation influence) of 0.468 at the last verb token for verb corruption, confirming effective localization of edits.
  • memeit$_{\textsc{CSK}}$ maintains strong performance across all probe set categories—unaffected neighborhoods, affected paraphrases, and reasoning challenges—indicating robust semantic generalization.
  • Repair-finetuned baselines show significant trade-offs between unaffected and affected metrics, whereas memit$_{\textsc{CSK}}$ avoids such performance degradation.
  • Causal mediation analysis confirms that commonsense plausibility predictions in Base-finetuned GPT-2 models are strongly associated with localized parameters at subject, verb, and object positions.
  • The optimal edit token varies by dataset, suggesting that a single generalized edit location may not exist, and that context-aware token selection is critical for effective editing.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.