rome  by kmeng01

Model editing research paper for GPT-2 and GPT-J

created 3 years ago
653 stars

Top 52.1% on sourcepulse

GitHubView on GitHub
Project Summary

This repository provides an implementation of Rank-One Model Editing (ROME) for efficiently locating and editing factual associations within large auto-regressive transformer models. It is targeted at researchers and practitioners in NLP and AI safety who need to modify factual knowledge in pre-trained language models without full retraining.

How It Works

ROME operates by identifying and modifying a low-rank update to the model's weight matrices that specifically targets factual associations. This approach leverages causal tracing to pinpoint the relevant components within the transformer's layers and then applies a rank-one update, making the editing process computationally efficient and precise.

Quick Start & Requirements

  • Install via bash ./scripts/setup_conda.sh.
  • Requires Conda for dependency management, PyTorch, and CUDA.
  • Supports OpenAI's GPT-2 XL (1.5B) and EleutherAI's GPT-J (6B).

Highlighted Details

  • Implements Rank-One Model Editing (ROME) for factual association modification.
  • Includes notebooks for demonstrating Causal Tracing and ROME.
  • Provides scripts for running the full evaluation suite against baselines.
  • Offers a framework for integrating and benchmarking new editing methods.

Maintenance & Community

  • Actively developed with close monitoring of issues.
  • Paper published at NeurIPS 2022.

Licensing & Compatibility

  • License details are not explicitly stated in the README, but the project is open-source.
  • Currently supports methods editing autoregressive HuggingFace models using the PyTorch backend.

Limitations & Caveats

  • Primarily GPU-only.
  • Cross-platform compatibility is limited to PyTorch/HuggingFace models, with broader support planned.
Health Check
Last commit

1 year ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
27 stars in the last 90 days

Explore Similar Projects

Starred by Dominik Moritz Dominik Moritz(Professor at CMU; ML Researcher at Apple), Stas Bekman Stas Bekman(Author of Machine Learning Engineering Open Book; Research Engineer at Snowflake), and
2 more.

ecco by jalammar

0%
2k
Python library for interactive NLP model visualization in Jupyter notebooks
created 4 years ago
updated 11 months ago
Feedback? Help us improve.