v0.71.9 — Knowledge edit & unlearn (live)
What's New — Knowledge Edit & Unlearn (live wiring)
The v0.61.0 / v0.62.0 schema-only stubs are now live, validated end-to-end on SmolLM2-135M (RTX 3050 4 GB).
soup edit set— ROME / MEMIT / AlphaEdit (live, #194). Covariance-free rank-1 weight-edit kernels: ROME (single-layerW += δ·kᵀ/‖k‖²), MEMIT (residual distributed across a layer band), AlphaEdit (ROME update projected orthogonal to the down-proj's top singular direction). On a tiny model a ROME edit movedP("Lyon" | "The capital of France is")from 0.0016 → 0.96. New--output,--device,--governor/--no-governor,--registry-idflags.soup edit difflive before/after generation (#194).--before-model+--after-model(+--probes) generates through both models and surfaces the probes whose output changed.- EditGovernor SQLite persistence + cross-process locking (#196). New
EditGovernorStorepersists per-base-model edit-count + verdict across separatesoup edit setruns (env overrideSOUP_EDIT_GOVERNOR_DB). apply_editconsults the governor automatically (#197).check_can_edit()runs BEFORE the model load (refusing on norm-blowup / edit cap);record_edit()runs AFTER with the measured Frobenius delta.- Live GRACE codebook (#203). Epsilon-ball nearest-key lookup, residual-key capture + value optimisation, atomic codebook sidecar, decode-time
install_grace_hook. Newedited_model/grace_codebookRegistry artifact kinds. soup train --task unlearn— NPO / SimNPO / RMU (live, #193). Newunlearn_kernels.py+ a self-containedUnlearnTrainerWrapper(LoRA policy + frozen reference + forget/retain JSONL). Warns when run without a retain set.
Install / Upgrade
pip install --upgrade soup-cliSecurity
_save_edited_model/UnlearnTrainerWrapperoutput dirs +save_codebook/load_codebook+_load_unlearn_rowsenforce cwd-containment, raw-path symlink rejection (TOCTOU), null-byte rejection, and file-size / per-line caps.EditGovernorStoremirrorsnamespace_pin.NamespacePinStore: $HOME/$CWD/$TMPDIR containment, TOCTOU symlink rejection, WAL + busy_timeout,fcntl/msvcrtsidecar lock, POSIX 0600.apply_grace_edithonours the governor for direct callers.
Known Limitations
- ROME-family kernels are covariance-free (
C=I) — a tractable simplification of full ROME/EasyEdit; edits change the target fact + are localised, but neighbourhood preservation is looser than covariance-preconditioned ROME. - Llama-family only —
_locate_decoder_layersresolvesmodel.model.layers[L].mlp.down_proj; GPT-2-styletransformer.his rejected. - Norm-delta thresholds tuned for larger models — on a 135M model a single ROME edit produces a large Frobenius delta (~25), so the default
NormBlowupPolicy(blowup_threshold=5.0)classifies it BLOWUP. Thresholds are operator-configurable. - RMU convergence noisy on few steps — NPO/SimNPO show clean decreasing forget loss; RMU's representation-steering objective needs more steps / tuning to converge on a tiny model.
- EditGovernor read-modify-write is best-effort under concurrency — the cross-process lock serialises each write, but two truly-concurrent
soup edit setruns on the same base can both readedit_count=Nand both writeN+1(one increment lost); sequential workflows unaffected. - GRACE applies at decode via
install_grace_hook, not by modifying weights —target_prob_afterequalstarget_prob_beforefor grace edits (the codebook is a sidecar). - MEMIT distributes the residual so its per-fact edit is weaker than ROME/AlphaEdit (smoke 0.25 vs 0.96); use ROME for a one-shot fact.
Full changelog: https://github.com/MakazhanAlpamys/Soup/blob/main/CHANGELOG.md