This package provides a self-contained implementation of Rank-One Model Editing (ROME).
Recall that ROME's update consists of:
-
compute_u.py
: Chooses a$u$ vector. -
compute_v.py
: Choose a$v_*$ via optimization, then computes$v$ . -
rome_main.py
: Instruments main logic. -
rome_params.py
: Interface for specifying hyperparameters. Inherits from the baseparams.py
module.
For estimating second moment statistics of keys (layer_stats
module. See the main README for usage instructions.
layer_stats.py
: Logic for retrieving and caching key statistics.tok_dataset.py
: Utilities for creating a dataset of tokens.