Skip to main content
QUICK REVIEW

[Paper Review] Massive Editing for Large Language Models via Meta Learning

Chenmien Tan, Ge Zhang|arXiv (Cornell University)|Nov 8, 2023
Topic ModelingComputer Science5 citations
TL;DR

This paper proposes MALMEN, a meta-learning-based method for massive, scalable editing of large language models by formulating parameter shift aggregation as a least squares problem solved via the normal equation, enabling efficient, memory-efficient editing of thousands of facts simultaneously across diverse LMs like BERT, GPT-2, T5-XL, and GPT-J, outperforming prior methods like MEND and MEMIT in both scalability and accuracy.

ABSTRACT

While large language models (LLMs) have enabled learning knowledge from the pre-training corpora, the acquired knowledge may be fundamentally incorrect or outdated over time, which necessitates rectifying the knowledge of the language model (LM) after the training. A promising approach involves employing a hyper-network to generate parameter shift, whereas existing hyper-networks suffer from inferior scalability in synchronous editing operation amount. To mitigate the problem, we propose the MAssive Language Model Editing Network (MALMEN), which formulates the parameter shift aggregation as the least square problem, subsequently updating the LM parameters using the normal equation. To accommodate editing multiple facts simultaneously with limited memory budgets, we separate the computation on the hyper-network and LM, enabling arbitrary batch size on both neural networks. Our method is evaluated by editing up to thousands of facts on LMs with different architectures, i.e., BERT-base, GPT-2, T5-XL (2.8B), and GPT-J (6B), across various knowledge-intensive NLP tasks, i.e., closed book fact-checking and question answering. Remarkably, MALMEN is capable of editing hundreds of times more facts than strong baselines with the identical hyper-network architecture and outperforms editor specifically designed for GPT. Our code is available at https://github.com/ChenmienTan/malmen.

Motivation & Objective

  • To address the scalability limitations of existing hyper-network-based language model editing methods when performing synchronous editing of multiple facts.
  • To overcome the cancellation effect and statistical inefficiency of gradient accumulation in prior methods like MEND.
  • To reduce memory consumption during training by decoupling hyper-network and language model computation, enabling arbitrary batch sizes.
  • To achieve high editing performance and generalization across diverse LMs and knowledge-intensive NLP tasks.
  • To enable practical, industrial-scale editing of LMs without catastrophic forgetting or retraining.

Proposed method

  • MALMEN formulates the aggregation of parameter shifts for multiple facts as a least squares optimization problem to minimize residual error and reduce cancellation effects.
  • It solves the least squares problem using the normal equation, ensuring a globally optimal parameter shift that is effective across all injected facts.
  • The method decouples computation between the hyper-network and the language model, allowing independent and arbitrary batch sizes on each, significantly reducing memory usage.
  • The hyper-network is trained to predict parameter shifts conditioned on standard fine-tuning gradients, preserving model consistency and locality.
  • Regularization is applied in the least squares objective to improve generalization and stability, especially when the key matrix is rank-deficient.
  • The approach caches only the key and value gradients for tokens that produce the answer, accelerating training and inference by 38.9% on a single A40 GPU.

Experimental results

Research questions

  • RQ1Can parameter shift aggregation for massive editing be formulated as a least squares problem to reduce cancellation effects and improve statistical significance?
  • RQ2Can decoupling hyper-network and language model computation enable arbitrary batch sizes and drastically reduce memory consumption during training?
  • RQ3Can MALMEN edit thousands of facts simultaneously with high accuracy and generalization across diverse LMs and tasks?
  • RQ4How does MALMEN compare to MEND and MEMIT in scalability and performance on closed-book fact-checking and question answering?
  • RQ5Does MALMEN maintain consistency across rephrased prompts, or are there limitations in generalization beyond the training prompt format?

Key findings

  • MALMEN edits up to 1,000 times more facts than MEND using the same hyper-network architecture, demonstrating superior scalability.
  • On GPT-J (6B), MALMEN achieves 99.7% exact match (ES) and 92.8% generation score (GS) on a 1,000-fact editing task, outperforming MEND and MEMIT.
  • MALMEN reduces the mean residual (MR) by three orders of magnitude compared to MEND’s gradient accumulation method, indicating significantly less cancellation effect.
  • MALMEN’s memory consumption grows slowly with the number of edits, allowing it to edit thousands of facts on a single A40 GPU, while MEND-style concatenation quickly exceeds hardware limits.
  • Caching only answer-relevant tokens reduces training and inference time by 38.9% without sacrificing performance.
  • Ablation studies confirm that the normal equation and regularization are critical for convergence and performance, especially on models like BERT-base where matrix singularity is an issue.

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.