rome  by kmeng01

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

Created 3 years ago
668 stars

Top 50.4% 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
12 stars in the last 30 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), Pawel Garbacki Pawel Garbacki(Cofounder of Fireworks AI), and
4 more.

alpaca_farm by tatsu-lab

0.1%
826
RLHF simulation framework for accessible instruction-following/alignment research
Created 2 years ago
Updated 1 year ago
Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), Shizhe Diao Shizhe Diao(Author of LMFlow; Research Scientist at NVIDIA), and
1 more.

FastEdit by hiyouga

0.1%
1k
Tool for fast edits to large language models
Created 2 years ago
Updated 2 years ago
Feedback? Help us improve.