How kp759/unlearning works
This repository is a collection of language-model unlearning and editing research code, evaluation frameworks, and experimental methods. Its principal workflow is to prepare forget/retain requests, compute an edit or unlearning update, apply it to a model, and evaluate forgetting alongside retained utility. The graph preserves the documented-by-source ZeroUnlearn, ECO, and open-unlearning branches. The README is empty, and many modules were not sampled, so uncertain runtime links are omitted rather than inferred.
Main entry points: ZeroUnlearn_main.py ZeroUnlearn update · ZeroUnlearnGD_main.py Gradient update · nethook.py Model hooks · train.py Training entry point
Components 31
Editing methods
- ZeroUnlearn update
ZeroUnlearn/ZeroUnlearn/ZeroUnlearn_main.py - Update vectors
ZeroUnlearn/ZeroUnlearn/compute_z.py - ZeroUnlearn config
ZeroUnlearn/ZeroUnlearn/ZeroUnlearn_hparams.py - Gradient update
ZeroUnlearn/ZeroUnlearn_GD/ZeroUnlearnGD_main.py - Gradient vectors
ZeroUnlearn/ZeroUnlearn_GD/compute_z.py - Gradient config
ZeroUnlearn/ZeroUnlearn_GD/ZeroUnlearnGD_hparams.py - Embedding-head edit
ZeroUnlearn/ZeroUnlearn_EmbHead/ZeroUnlearn_EmbHead_main.py - AlphaEdit
ZeroUnlearn/AlphaEdit/AlphaEdit_main.py - MEMIT edit
ZeroUnlearn/memit/memit_rect_main.py - Unlearning baselines
ZeroUnlearn/baselines
Datasets and evaluation
- Edit datasets
ZeroUnlearn/dsets - TF-IDF statistics
ZeroUnlearn/dsets/tfidf_stats.py - Edit evaluation
ZeroUnlearn/experiments/evaluate.py - Task evaluations
ZeroUnlearn/glue_eval
Model utilities
- Representation extraction
ZeroUnlearn/rome/repr_tools.py - Layer statistics
ZeroUnlearn/rome/layer_stats.py - Retain statistics
ZeroUnlearn/rome/layer_stats_retain.py - Token dataset
ZeroUnlearn/rome/tok_dataset.py - Model hooks
ZeroUnlearn/util/nethook.py - Text generation
ZeroUnlearn/util/generate.py - Running statistics
ZeroUnlearn/util/runningstats.py
ECO evaluation
- Inference engines
eco/eco/inference.py - Benchmark datasets
eco/eco/dataset - Metric evaluators
eco/eco/evaluator - Attack utilities
eco/eco/attack/utils.py - Model wrapper
eco/eco/model/model.py
Open unlearning
- Training entry point
open-unlearning/src/train.py - Training data
open-unlearning/src/data - Unlearning trainers
open-unlearning/src/trainer - Unlearning evaluation
open-unlearning/src/evals
Other components
- Researcher
Connections 35
- Researcher → Edit evaluation: runs evaluation
ZeroUnlearn/experiments/evaluate.py - ZeroUnlearn update → Update vectors: computes vectors
ZeroUnlearn/ZeroUnlearn/ZeroUnlearn_main.py - ZeroUnlearn update → ZeroUnlearn config: uses settings
ZeroUnlearn/ZeroUnlearn/ZeroUnlearn_main.py - ZeroUnlearn update → Layer statistics: loads statistics
ZeroUnlearn/ZeroUnlearn/ZeroUnlearn_main.py - ZeroUnlearn update → Retain statistics: loads retain statistics
ZeroUnlearn/ZeroUnlearn/ZeroUnlearn_main.py - ZeroUnlearn update → Token dataset: uses token data
ZeroUnlearn/ZeroUnlearn/ZeroUnlearn_main.py - ZeroUnlearn update → Model hooks: hooks model
ZeroUnlearn/ZeroUnlearn/ZeroUnlearn_main.py - ZeroUnlearn update → Text generation: generates contexts
ZeroUnlearn/ZeroUnlearn/ZeroUnlearn_main.py - ZeroUnlearn update → Running statistics: accumulates statistics
ZeroUnlearn/ZeroUnlearn/ZeroUnlearn_main.py - Gradient update → Gradient vectors: computes vectors
ZeroUnlearn/ZeroUnlearn_GD/ZeroUnlearnGD_main.py - Gradient update → Gradient config: uses settings
ZeroUnlearn/ZeroUnlearn_GD/ZeroUnlearnGD_main.py - Gradient update → Layer statistics: loads statistics
ZeroUnlearn/ZeroUnlearn_GD/ZeroUnlearnGD_main.py - Gradient update → Retain statistics: loads retain statistics
ZeroUnlearn/ZeroUnlearn_GD/ZeroUnlearnGD_main.py - Gradient update → Token dataset: uses token data
ZeroUnlearn/ZeroUnlearn_GD/ZeroUnlearnGD_main.py - Gradient update → Model hooks: hooks model
ZeroUnlearn/ZeroUnlearn_GD/ZeroUnlearnGD_main.py - Gradient update → Text generation: generates contexts
ZeroUnlearn/ZeroUnlearn_GD/ZeroUnlearnGD_main.py - Gradient update → Running statistics: accumulates statistics
ZeroUnlearn/ZeroUnlearn_GD/ZeroUnlearnGD_main.py - Update vectors → Representation extraction: extracts representations
ZeroUnlearn/ZeroUnlearn/compute_z.py - Update vectors → Model hooks: hooks model
ZeroUnlearn/ZeroUnlearn/compute_z.py - Gradient vectors → Representation extraction: extracts representations
ZeroUnlearn/ZeroUnlearn_GD/compute_z.py - Gradient vectors → Model hooks: hooks model
ZeroUnlearn/ZeroUnlearn_GD/compute_z.py - Embedding-head edit → Model hooks: hooks model
- AlphaEdit → Representation extraction: extracts representations
- AlphaEdit → Model hooks: hooks model
- MEMIT edit → Model hooks: reads parameters
ZeroUnlearn/memit/memit_rect_main.py - MEMIT edit → Text generation: generates contexts
ZeroUnlearn/memit/memit_rect_main.py - Edit evaluation → Edit datasets: loads datasets
ZeroUnlearn/experiments/evaluate.py - Edit evaluation → Task evaluations: runs task evaluation
ZeroUnlearn/experiments/evaluate.py - Edit datasets → TF-IDF statistics: uses TF-IDF
ZeroUnlearn/dsets/tfidf_stats.py - TF-IDF statistics → Edit datasets: reads snippets
ZeroUnlearn/dsets/tfidf_stats.py - Inference engines → Attack utilities: removes hooks
eco/eco/inference.py - Training entry point → Training data: loads data
open-unlearning/src/train.py - Training entry point → Unlearning trainers: configures trainer
open-unlearning/src/train.py - Training entry point → Unlearning evaluation: configures evaluation
open-unlearning/src/train.py - Training entry point → Model wrapper: uses model
open-unlearning/src/train.py