Skip to main content
QUICK REVIEW

[Paper Review] Aging with GRACE: Lifelong Model Editing with Discrete Key-Value Adaptors

Thomas Hartvigsen, Swami Sankaranarayanan|arXiv (Cornell University)|Nov 20, 2022
Topic ModelingComputer Science15 citations
TL;DR

GRACE is a lifelong model editing framework that enables thousands of sequential, targeted edits to pre-trained language models without retraining or weight updates. It uses discrete key-value adapters in the latent space to cache and retrieve corrections, achieving state-of-the-art performance with minimal performance decay and strong generalization to unseen inputs.

ABSTRACT

Deployed language models decay over time due to shifting inputs, changing user needs, or emergent world-knowledge gaps. When such problems are identified, we want to make targeted edits while avoiding expensive retraining. However, current model editors, which modify such behaviors of pre-trained models, degrade model performance quickly across multiple, sequential edits. We propose GRACE, a lifelong model editing method, which implements spot-fixes on streaming errors of a deployed model, ensuring minimal impact on unrelated inputs. GRACE writes new mappings into a pre-trained model's latent space, creating a discrete, local codebook of edits without altering model weights. This is the first method enabling thousands of sequential edits using only streaming errors. Our experiments on T5, BERT, and GPT models show GRACE's state-of-the-art performance in making and retaining edits, while generalizing to unseen inputs. Our code is available at https://www.github.com/thartvigsen/grace}.

Motivation & Objective

  • Address the challenge of deploying continual, targeted edits to large pre-trained language models in real-world settings where retraining is infeasible.
  • Overcome performance degradation and forgetting in sequential editing, especially when only single, streaming error instances are available.
  • Develop a parameter-efficient, model-agnostic method that preserves original model behavior while enabling spot-fixes for factual hallucinations and label shifts.
  • Enable transparent, traceable editing by decoupling edits from model weights through a persistent codebook of key-value mappings.
  • Establish benchmarks and metrics for lifelong model editing, a previously understudied problem setting.

Proposed method

  • GRACE introduces a plug-in adapter at a chosen layer of a pre-trained transformer model, which modifies layer-to-layer transformations without altering the model's frozen weights.
  • It caches input embeddings for flagged errors and learns corresponding value vectors that map to desired model outputs, forming a discrete codebook of edits.
  • Edits are applied only to inputs within an epsilon-ball around cached keys, ensuring locality and generalization via semantic similarity in the latent space.
  • The method dynamically manages epsilon-ball sizes over time to balance immediate correction with long-term retention of prior edits.
  • GRACE operates with minimal inference overhead and is compatible with both autoregressive and non-autoregressive models.
  • The codebook is fully inspectable, enabling auditability and transparency—unlike weight-editing methods that obscure changes.

Experimental results

Research questions

  • RQ1Can a model editing method maintain performance across thousands of sequential edits without retraining or weight updates?
  • RQ2How well can a method generalize edits to unseen inputs while avoiding memorization of individual examples?
  • RQ3Can a method achieve high accuracy in correcting factual hallucinations and label shifts in real-world deployment scenarios?
  • RQ4How does the method perform when only single, isolated error instances are available for editing?
  • RQ5Can the method scale to long sequences of edits while preserving original model capabilities and minimizing inference cost?

Key findings

  • GRACE outperforms seven state-of-the-art baselines in lifelong editing across T5, BERT, and GPT models on question answering, document classification, and language generation tasks.
  • GRACE successfully maintains high performance on previously edited inputs and generalizes to unseen inputs, avoiding overfitting and memorization.
  • The method achieves stable performance over sequences of up to ~5,000 edits, demonstrating robustness in long-term deployment scenarios.
  • GRACE incurs only a small, one-time cost to inference time, even over long sequences of edits, due to efficient similarity search in the latent space.
  • The method generalizes effectively to new inputs, with edits being applied based on semantic similarity rather than exact input matches.
  • GRACE’s codebook is transparent and inspectable, enabling traceability of edits—unlike weight-based editing methods that obscure changes.

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.