Repository navigation
Add K-FORGE: Fisher-guided initialization for preference-based unlearning - #212
Merged
Merged
Conversation
…ning K-FORGE (Kronecker-Fisher One-shot Rank-r Generalized Erasure) is a training-free one-shot edit that estimates empirical Kronecker-Fisher factors on forget and retain calibration batches, simultaneously diagonalizes the pairs, applies a retain-aware Wiener filter with a retain budget, truncates to rank r, and folds the edit into the checkpoint. The edited checkpoint can be used directly or as an initialization for NPO / SimNPO; with setup time and FLOPs charged, initialized NPO lowers Forget Q/A Probability by 22.3% and improves utility on TOFU forget10 (Llama-3.2-1B-Instruct, n=3) while using less total time and compute than training from the pretrained checkpoint. - register KFORGE trainer (single-process calibration, wiener_v2 and legacy_v1 edit variants) - trainer + experiment configs (paper configuration by default) - community method folder with README (results, hyperparameters) and a two-stage run.sh (edit -> downstream NPO/SimNPO) - CPU regression tests for the edit math (closed-form diagonal case, lambda=0 full-rank invariant, token masking, factor damping) Accepted at Findings of ICJNLP-AACL 2026. Paper code and experiments: https://github.com/etomoscow/kron_unlearn
molereddy
requested changes
Nov 6, 2026
molereddy
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for contributing!!
Added some nit comments and couple questions
- can you confirm this was run e2e successfully? because eval uses 16 bit - for flash attn - and the train code converts model to 32 bit.
- stage 2 loads model with bf16 so saving in 32 bit doesn't seem to make a difference. can you re-check how this works?
- fix conference spelling: IJCNLP-AACL (docs/links.md, method README) - default the trainer class to edit_variant=wiener_v2 / lambda_tradeoff=0.01 to match the trainer config and the paper - drop configs/experiment/unlearn/tofu/kforge.yaml; the community run.sh now carries the paper settings as inline Hydra overrides, following the convention of the other community methods - spell out the edit_weight_dtype trade-off in the method README
Contributor
Author
|
Fixed the nits in 1c750d0:
About the dtype questions:
Happy to flip the default to |
Collaborator
|
thank you for the clarification and fixes, please fix merge conflicts and we should be good to merge! |
Both sides added entries to the method list, links table, and trainer registry; kept both. Bumped the README method count to 16+.
Contributor
Author
|
Merge conflicts resolved in 0bb804e |
mole-reducto
approved these changes
Nov 11, 2026
molereddy
approved these changes
Nov 11, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Title: Add K-FORGE: Fisher-guided initialization for preference-based unlearning
Summary
Adds K-FORGE (Kronecker-Fisher One-shot Rank-r Generalized Erasure), accepted at Findings of ICJNLP-AACL 2026, as a community method. K-FORGE is a training-free one-shot edit: it estimates empirical Kronecker-Fisher factors on forget and retain calibration batches, simultaneously diagonalizes the pairs, applies a retain-aware Wiener filter with a retain budget (
lambda_tradeoff), truncates to rank r, and folds the negative edit into the checkpoint. The edited checkpoint can be used directly or as an initialization for NPO / SimNPO (their objectives remain unchanged). Follows up on #211.Changes
src/trainer/unlearn/kforge.py— newKFORGEtrainer: calibration hooks (valid causal-LM loss positions, eval mode), factor damping (fixed / scale-relative adaptive),wiener_v2(theorem-backed retain-aware edit) andlegacy_v1(original heuristic, kept for ablation) edit variants, optional spectrum logging, fp32 checkpoint serialization so small edits survive saving. Single-process calibration (multi-process raises a clear error).configs/trainer/KFORGE.yaml— defaults follow the paper configuration (wiener_v2,lambda_tradeoff=0.01,max_target_modules=4as a memory guard); the per-run paper settings (rank=2,strength=0.45) are passed inline incommunity/methods/KFORGE/run.sh, following the convention of the other community methods.community/methods/KFORGE/— README with method description, hyperparameters, results table, known boundaries;run.shreproducing the two-stage flow (edit → downstream NPO;DOWNSTREAM_TRAINER=SimNPOsupported).tests/test_kforge.py— CPU regression tests for the edit math: closed-form diagonal full-rank case (the paper's Theorem 1 reduction), λ=0 full-rank invariant (Δ = −α·W), causal-LM token masking, scale-relative factor damping.docs/links.md,README.md— method link and counts.Results
Primary endpoint: Forget Q/A Probability (lower is better). TOFU
forget10, Llama-3.2-1B-Instruct, n = 3 seeds, mean ± std; full tables incommunity/methods/KFORGE/README.md.Compute-matched comparison with the edit's setup fully charged (FP32, evaluation excluded from timing): K-FORGE-initialized NPO reaches 0.046 forget probability vs 0.059 for scratch at lower total wall time (277.2 s vs 285.5 s) and fewer FLOPs (2.95e15 vs 3.78e15), while improving utility (0.577 vs 0.549).
Known boundaries (documented in the README and paper): direct relearning recovers the forgotten data; MUSE gains vary by metric; Qwen2.5-1.5B is unchanged at reported precision.
Testing
python tests/test_kforge.py— CPU regression tests pass (edit math in float64).ruff check/ruff format --checkclean on changedsrcfiles (repo defaults).run.shon a GPU host (Llama-3.2-1B-Instruct, TOFUforget10) — run output available on request; evaluator harness unchanged from upstreamexperiment=unlearn/tofu/default.Checklist (per
docs/contributing.md)KFORGE)community/methods/KFORGE/run.sh)docs/links.mdReference
Note: the upstream
community/leaderboard.mdentry and HF checkpoints are intentionally left for the review phase — happy to run whichever benchmark configuration the maintainers prefer for the leaderboard.