Table of Contents
Fetching ...

Editing Common Sense in Transformers

Anshita Gupta, Debanjan Mondal, Akshay Krishna Sheshadri, Wenlong Zhao, Xiang Lorraine Li, Sarah Wiegreffe, Niket Tandon

TL;DR

This work extends parameter editing in transformers to commonsense plausibility by introducing MEMIT_CS K, which edits multiple token locations and leverages causal tracing to localize editable parameters. It demonstrates that commonsense judgments localize to early MLP layers and that MEMIT_CS K, with refined layer selection and token variety, outperforms repair-based finetuning on edit sets while preserving unaffected neighborhoods in probe evaluations. A novel PROBE SET is constructed to assess semantic generalization across unaffected/affected neighborhoods, paraphrases, and reasoning challenges, showing balanced improvements for edited models. Overall, the paper provides a viable pathway for incorporating commonsense feedback into transformers through targeted, strategy-aware direct model editing without re-training.

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.

Editing Common Sense in Transformers

TL;DR

This work extends parameter editing in transformers to commonsense plausibility by introducing MEMIT_CS K, which edits multiple token locations and leverages causal tracing to localize editable parameters. It demonstrates that commonsense judgments localize to early MLP layers and that MEMIT_CS K, with refined layer selection and token variety, outperforms repair-based finetuning on edit sets while preserving unaffected neighborhoods in probe evaluations. A novel PROBE SET is constructed to assess semantic generalization across unaffected/affected neighborhoods, paraphrases, and reasoning challenges, showing balanced improvements for edited models. Overall, the paper provides a viable pathway for incorporating commonsense feedback into transformers through targeted, strategy-aware direct model editing without re-training.

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., . GPT-2 Large and XL models edited using 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. 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.
Paper Structure (13 sections, 4 figures, 3 tables)

This paper contains 13 sections, 4 figures, 3 tables.

Figures (4)

  • Figure 1: Proposed framework -- memit$_{\textsc{CSK}}$, for editing and evaluating plausible commonsense knowledge in Transformers. Given a plausible <Subject, Verb, Object> commonsense statement, memit$_{\textsc{CSK}}$ edits parameters at different token and layer locations (described in \ref{['sec:method']}). Edited model is evaluated for semantic generalization (depicted in dark blue box) and configuration generalization defined in \ref{['sec:method']}.
  • Figure 2: Base-finetuned vs. Zero-shot GPT-2 XL causal tracing on PEP3k edit validation set. Patterns are unclear for the Zero-shot model while they are distinct for the Base Model. Consistent observations are found for the 20Q dataset (\ref{['fig:causalZeroShot20q']}).
  • Figure 3: Severed causal tracing results for $\{s,v, o\}$ for GPT-2 XL base on PEP3k edit validation set
  • Figure 4: Causal tracing for GPT-2 XL Base Model on PEP3k edit validation set when different tokens are corrupted, $\{s,v, o\}$ (in order). See \ref{['appendix:causal-tracing']} for GPT-2 Large and 20Q results.